destiny team mailing list archive
-
destiny team
-
Mailing list archive
-
Message #00127
QT Creator / Designer Issues
Hello,
As I was making some changes to Sleuths, I came across some interesting
syntax...
intviewButton = new QPushButton;
intviewButton = ui->intviewButton;
nextButton = new QPushButton;
nextButton = ui->nextButton;
lastButton = new QPushButton;
lastButton = ui->lastButton;
noteButton = new QPushButton;
noteButton = ui->noteButton;
Since this UI was created with QT Creator / Designer, all of the GUI object
stuff is done with the ui file. For example, from ui_mainwindow.h:
radioButton3 = new QRadioButton(centralWidget);
radioButton3->setObjectName(QString::fromUtf8("radioButton3"));
radioButton3->setGeometry(QRect(930, 290, 91, 20));
radioButton3->setIconSize(QSize(23, 23));
As you can see, we don't (and shouldn't) be new'ing all of our GUI elements
in the implementation class for our window, it's just a useless and wasteful
step.
I've fixed this issue in mainwindow.cpp for SleuthsScene2. If you come
across it in any other files, please comment out all lines that look of the
form: someGUIThing = new GuiThing; someGUIThing = ui->someGUIThing;
Thanks!
Zach J. Elko
Ball State University Unified Technology Support
Certified Hardware & Software Technician
Follow ups