Announcement

Collapse
No announcement yet.

Blast from the past - KDE 3.5

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by sithlord48 View Post

    UI files.. my main issue comes from the fact they can have their own connections and don't get me started on finding a "on_objectName_signal" methods within a class. (those made from clicking "goto slot" in designer)

    Qt4+ is a real joy to code with.
    Ah, signals and slots!!! The most powerful "callback" feature in the Qt API. I loved them! Here is some S&S code from my Homestead app, which was written in 2004 using Qt4 and maintained until 2020, when it was replaced with a web based app, but long after I retired in 2008. I used S&S technology extensively. I also liked that you can turn them on and off at will, using disconnect(), for special purposes during processing.
    Code:
    // Initialize the signal and slot connections
    // ui.btn... prefix buttons, ui.le... prefix line edit text boxes, ui.cbo... prefix combo boxes
    // ui.tab... prefix tabs, ui.grid... prefix grids
    // Buttons actions (SIGNALs) are connected to specific functions (SLOTs).
    connect(ui.btnSearch, SIGNAL(clicked()), this, SLOT(searchAll()));
    connect(ui.btnQUIT, SIGNAL(clicked()), this, SLOT(QuitClicked()));
    connect(ui.btnEditProperty, SIGNAL(clicked()), this, SLOT(editProperty()));
    connect(ui.btnUndoProperty, SIGNAL(clicked()), this, SLOT(undoProperty()));
    connect(ui.btnNewProperty, SIGNAL(clicked()), this, SLOT(newProperty()));
    connect(ui.btnDeleteProperty, SIGNAL(clicked()), this, SLOT(deleteProperty()));
    connect(ui.btnSWAP, SIGNAL(clicked()), this, SLOT(persinfoSwap()));
    connect(ui.btnEditPersInfo, SIGNAL(clicked()), this, SLOT(editPersInfo()));
    connect(ui.btnSearchHistory, SIGNAL(clicked()), this, SLOT(SearchHistory()));
    connect(ui.btnUndoPersInfo, SIGNAL(clicked()), this, SLOT(UndoPersInfo()));
    connect(ui.btnNewIncome, SIGNAL(clicked()), this, SLOT(NewIncome()));
    connect(ui.btnDeleteIncome, SIGNAL(clicked()), this, SLOT(DeleteIncome()));
    connect(ui.btnVNI, SIGNAL(clicked()), this, SLOT(toggleVNI()));
    connect(ui.btnReject, SIGNAL(clicked()), this, SLOT(toggleReject()));
    connect(ui.btnCalcAllProperty, SIGNAL(clicked()), this, SLOT(CalcAllProperties()));
    connect(ui.btnCalcPctExm, SIGNAL(clicked()), this, SLOT(calcThisProperty()));
    connect(ui.btnDateBtchRpt, SIGNAL(clicked()), this, SLOT(printDateBtchRpt()));
    connect(ui.btnBatchBatchRpt, SIGNAL(clicked()), this, SLOT(printBatchBatchRpt()));
    connect(ui.btnXTabAllCnty, SIGNAL(clicked()), this, SLOT(GenerateXTabAllCounties()));
    connect(ui.btnXTabEachCnty, SIGNAL(clicked()), this, SLOT(GenerateXTabEachCounty()));
    connect(ui.btnMakeN458, SIGNAL(clicked()), this, SLOT(generateN458files()));
    connect(ui.btnLabelsAddrByCounty, SIGNAL(clicked()), this, SLOT(labelsAddrBycounty()));
    connect(ui.btnAorDRoster, SIGNAL(clicked()), this, SLOT(AorDRoster()));
    connect(ui.btnMakeLetterR, SIGNAL(clicked()), this, SLOT(MakeLetterR()));
    connect(ui.btnMakeLetterD, SIGNAL(clicked()), this, SLOT(MakeLetterD()));
    connect(ui.btnPrintQ, SIGNAL(clicked()), this, SLOT(printQEditsQuery()));
    connect(ui.btnShortRpt, SIGNAL(clicked()), this, SLOT(shortRpt()));
    connect(ui.btnLongRpt, SIGNAL(clicked()), this, SLOT(longRpt()));
    
    // line edit signals on lost focus, allowing edit checks and cursor flow control
    connect(ui.leHEC, SIGNAL(lostFocus()), this, SLOT(toggleServiceDates()));
    connect(ui.leSSSN, SIGNAL(lostFocus()), this, SLOT(toggleSYOB()));
    connect(ui.leBDate, SIGNAL(lostFocus()), this, SLOT(BDateLostFocus()));
    connect(ui.leLine8f, SIGNAL(lostFocus()), this, SLOT(leLine8fLostFocus()));
    connect(ui.leParcelID, SIGNAL(lostFocus()), this, SLOT(leParcelIDfLostFocus()));
    connect(ui.leTaxDistrict, SIGNAL(lostFocus()), this, SLOT(leTaxDistrictfLostFocus()));
    connect(ui.lePart, SIGNAL(lostFocus()), this, SLOT(partLostFocusAction()));
    
    // combo box signals allows access to the newly selected row of the combo box
    connect(ui.cboCountyName, SIGNAL(currentIndexChanged(int)), this, SLOT(passCntyNum( int )));
    connect(ui.cboMS, SIGNAL(currentIndexChanged(int)), this, SLOT(passMsNum( int )));
    connect(ui.cboAppType, SIGNAL(currentIndexChanged(int)), this, SLOT(passApptype( int )));
    
    // tab signals Detects the change in the selected Tab of the UI and displays the new tab.
    connect(ui.tabHomestead, SIGNAL(currentChanged(int)), this, SLOT(setCurrentTab(int)));
    
    // grid signals "Index" allows access to the specific row and column clicked
    connect(ui.gridPersInfo, SIGNAL(clicked(QModelIndex)), this, SLOT(displaySelectedPersInfo( QModelIndex )));
    connect(ui.gridMultiProp, SIGNAL(clicked(QModelIndex)), this, SLOT(displaySelectedMultiProp( QModelIndex )));
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment

    Working...
    X