[Qt-interest] Simple dialog question

Mystical Groovy mysticalgr at gmail.com
Wed Nov 4 08:02:26 CET 2009


Well I didnt actually understood what you're asking.
I'll guess somethings,

You want to change a label in you configuration dialog?
 its rather simple, use

configDlg.label.setText("wh00t");

in general, to access all of the widgets in the configuration dialog use the
code above as base.
for example, if you have a QPushButton you can access like that

configDlg.myPushButton.setMen(QMenu *menu);

Hope this helps.

2009/11/4 Phil <phillor at telstra.com>

> Thank you for reading this.
>
> This is another one of those long-standing problems that I have been unable
> to solve.
>
> As an example, say a menu item on the main window is connected to a slot
> which in turn calls a function in my configuration class to display a
> configuration dialog. The dialog has been created with Designer.
>
> void Configuration::showDialog()
> {
>  Configuration configDlg;
>  configDlg.exec();
>
>  label->setText("Text");
> }
>
> The above code displays the dialog but the label remains unchanged.
>
> The only way that I have been able to access or set items on a dialog is to
> put the code in the Configuration class constructor. This is not possible
> in my
> current application because the constructor is called before the item to be
> displayed is available.
>
> I've studied the Qt examples but, again, I cannot relate the example code
> to
> what I'm trying to achieve.
>
> Can anyone point me in the right direction?
>
> --
> Regards,
> Phil
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091104/d1068e69/attachment.html 


More information about the Qt-interest-old mailing list