- #include<QtGui>
- int main(int argc,char **argv)
- {
- QApplication app(argc,argv);
- QDialog *dialog=new QDialog;
- QHBoxLayout *topLeftLayout=new QHBoxLayout;
- QHBoxLayout *mainLayout=new QHBoxLayout;
- QVBoxLayout *leftLayout=new QVBoxLayout;
- QVBoxLayout *rightLayout=new QVBoxLayout;
- QLineEdit *lineEdit=new QLineEdit;
- QLabel *lable=new QLabel("Find what:");
- QCheckBox *checkBox1=new QCheckBox("Match case");
- QCheckBox *checkBox2=new QCheckBox("Search backward");
- QPushButton *pushButton1=new QPushButton("Find");
- QPushButton *pushButton2=new QPushButton("Close");
- rightLayout->addWidget(pushButton1);
- rightLayout->addWidget(pushButton2);
- topLeftLayout->addWidget(lable);
- topLeftLayout->addWidget(lineEdit);
- leftLayout->addLayout(topLeftLayout);
- leftLayout->addWidget(checkBox1);
- leftLayout->addWidget(checkBox2);
- mainLayout->addLayout(leftLayout);
- mainLayout->addLayout(rightLayout);
- dialog->setLayout(mainLayout);
- dialog->show();
- return app.exec();
- }
