1 Star 0 Fork 0

连先森/qt-application

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
findfiledialog3.cpp 2.06 KB
一键复制 编辑 原始数据 按行查看 历史
连先森 提交于 2023-11-18 09:41 . 新增示例
#include "findfiledialog3.h"
#include <QtGui>
#include <QLabel>
#include <QLineEdit>
#include <QCheckBox>
#include <QTableWidget>
#include <QPushButton>
#include <QGridLayout>
#include <QVBoxLayout>
#include "findfiledialog.h"
FindFileDialog3::FindFileDialog3(QWidget *parent)
: QDialog(parent)
{
namedLabel = new QLabel(tr("&Named:"));
namedLineEdit = new QLineEdit;
namedLabel->setBuddy(namedLineEdit);
lookInLabel = new QLabel(tr("&Look in:"));
lookInLineEdit = new QLineEdit;
lookInLabel->setBuddy(lookInLineEdit);
subfoldersCheckBox = new QCheckBox(tr("Include subfolders"));
QStringList labels;
labels << tr("Name") << tr("In Folder") << tr("Size")
<< tr("Modified");
tableWidget = new QTableWidget;
tableWidget->setColumnCount(4);
tableWidget->setHorizontalHeaderLabels(labels);
messageLabel = new QLabel(tr("0 files found"));
messageLabel->setFrameShape(QLabel::Panel);
messageLabel->setFrameShadow(QLabel::Sunken);
findButton = new QPushButton(tr("&Find"));
stopButton = new QPushButton(tr("Stop"));
closeButton = new QPushButton(tr("Close"));
helpButton = new QPushButton(tr("Help"));
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
QGridLayout *leftLayout = new QGridLayout;
leftLayout->addWidget(namedLabel, 0, 0);
leftLayout->addWidget(namedLineEdit, 0, 1);
leftLayout->addWidget(lookInLabel, 1, 0);
leftLayout->addWidget(lookInLineEdit, 1, 1);
leftLayout->addWidget(subfoldersCheckBox, 2, 0, 1, 2);
leftLayout->addWidget(tableWidget, 3, 0, 1, 2);
leftLayout->addWidget(messageLabel, 4, 0, 1, 2);
QVBoxLayout *rightLayout = new QVBoxLayout;
rightLayout->addWidget(findButton);
rightLayout->addWidget(stopButton);
rightLayout->addWidget(closeButton);
rightLayout->addStretch();
rightLayout->addWidget(helpButton);
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addLayout(leftLayout);
mainLayout->addLayout(rightLayout);
setLayout(mainLayout);
setWindowTitle(tr("Find Files or Folders"));
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liandy0906/qt-application.git
git@gitee.com:liandy0906/qt-application.git
liandy0906
qt-application
qt-application
master

搜索帮助