← Back to team overview

destiny team mailing list archive

Re: QT Creator / Designer Issues

 

Was what I saw based on a document I read.  I never really thought about it
I suppose.  Makes sense.  Bad habits developed from someone else's bad
habits.

Ian Crotty
UTS Hardware Technician
Ball State University


On Tue, Mar 16, 2010 at 9:31 PM, Zach Elko <zachelko@xxxxxxxxx> wrote:

> 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
>
> _______________________________________________
> Mailing list: https://launchpad.net/~destiny
> Post to     : destiny@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~destiny
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References