Originally Posted by
high_flyer
setupUi() is not called in the auto generated code, but in your code... or I misunderstood you...
Correct, from the constructor of the derived class QMainWindow.
MainWindow
::MainWindow(QWidget ...
){
ui.setupUi(this);
// UI is only partially built from Qt Designer, connectSlotsByName
// is called in setupUi.
BuildRestOfUI(this);
// Can't call connectSlotByName a second time, otherwise each signal
// slot pairing from the previous call will add another signal slot pairing
// resulting in those slots getting 2 signals (called twice).
}
MainWindow::MainWindow(QWidget ...)
{
ui.setupUi(this);
// UI is only partially built from Qt Designer, connectSlotsByName
// is called in setupUi.
BuildRestOfUI(this);
// Can't call connectSlotByName a second time, otherwise each signal
// slot pairing from the previous call will add another signal slot pairing
// resulting in those slots getting 2 signals (called twice).
}
To copy to clipboard, switch view to plain text mode
//** Form generated from reading UI file 'MainWindow.ui'
{
if (MainWindowClass->objectName().isEmpty())
MainWindowClass
->setObjectName
(QString::fromUtf8("MainWindowClass"));
MainWindowClass->resize(766, 542);
actionNew
= new QAction(MainWindowClass
);
actionNew
->setObjectName
(QString::fromUtf8("actionNew"));
// >>snip<<
retranslateUi(MainWindowClass);
} // setupUi
//** Form generated from reading UI file 'MainWindow.ui'
void setupUi(QMainWindow *MainWindowClass)
{
if (MainWindowClass->objectName().isEmpty())
MainWindowClass->setObjectName(QString::fromUtf8("MainWindowClass"));
MainWindowClass->resize(766, 542);
actionNew = new QAction(MainWindowClass);
actionNew->setObjectName(QString::fromUtf8("actionNew"));
// >>snip<<
retranslateUi(MainWindowClass);
QMetaObject::connectSlotsByName(MainWindowClass);
} // setupUi
To copy to clipboard, switch view to plain text mode
Bookmarks