QUiLoader uiLoader;
QFile file("sortdialog.ui");
QWidget *sortDialog=uiLoader.load(&file);
if(sortDialog)
{
...
}
how to access the form's child widgets:
we can use QObject::findChild():
QComboBox *primaryColumnCombo=sortDialog->findChild("primaryColumnCombo");
if(primaryColumnCombo)
{
...
}
Pay attention:
If we want to use QUiLoader class,we must add this line to the application's .pro file:
CONFIG +=uitools
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/56374/showart_520787.html

RSS订阅

