摘要:
1 MainWindow::MainWindow(QWidget *parent) : 2 QMainWindow(parent), 3 ui(new Ui::MainWindow) 4 { 5 ui->setupUi(this); 6 //设置最小大小 7 this->setMinimumSize(200,100); 8 9 ... 阅读全文
摘要:
1 //可以写任何复杂正则表达式 2 QRegExp reg("[A-Z]"); 3 ui->lineEdit->setValidator(new QRegExpValidator(reg,this)); 阅读全文
摘要:
QList 1 int main1(int argc, char *argv[]) 2 { 3 QApplication a(argc, argv); 4 5 QList<int> mylist={10,20,30}; 6 mylist << 100 << 200 << 300; 7 //创建容器 阅读全文
摘要:
ui mainwindow.h 1 #ifndef MAINWINDOW_H 2 #define MAINWINDOW_H 3 4 #include <QMainWindow> 5 #include <QStringData> 6 #include <QStringList> 7 #include 阅读全文
摘要:
UI 关键代码 mainwindow.h 1 QStringListModel *slm; 2 QStringList *sl; mainwindow.cpp init初始化 1 //初始化combox 2 ui->comboBox->insertItem(0,"山羊座","山羊座1"); 3 ui 阅读全文