[Qt-interest] Simple dialog question

Phil phillor at telstra.com
Wed Nov 4 07:31:53 CET 2009


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



More information about the Qt-interest-old mailing list