- ui->setupUi()
新建好Qt的工程之后,总是会在MainWindow函数中有一行代码
ui->setupUi(this);
跟踪进这行代码
class Ui_MainWindow
{
public:
QWidget *centralWidget;
QLabel *label;
QLabel *label_2;
QMenuBar *menuBar;
QToolBar *mainToolBar;
QStatusBar *statusBar;
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(635, 550);
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
label = new QLabel(centralWidget);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(70, 90, 491, 321));
label_2 = new QLabel(centralWidget);
l