pro:初步添加属性窗口。
This commit is contained in:
31
Gui/Form/FileInfoForm.cpp
Normal file
31
Gui/Form/FileInfoForm.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "FileInfoForm.h"
|
||||
|
||||
#include "ui_FileInfoForm.h"
|
||||
|
||||
FileInfo::FileInfo(QWidget* parent) : QDialog(parent), ui(new Ui::FileInfo)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
InitControl();
|
||||
setWindowTitle(tr("属性"));
|
||||
}
|
||||
|
||||
FileInfo::~FileInfo()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
int FileInfo::exec()
|
||||
{
|
||||
ui->pedDir->setPlainText(dirName_);
|
||||
ui->pedName->setPlainText(baseName_);
|
||||
ui->lbSize->setText(fileSize_);
|
||||
ui->lbTime->setText(fileTime_);
|
||||
ui->lbType->setText(fileType_);
|
||||
return QDialog::exec();
|
||||
}
|
||||
|
||||
void FileInfo::InitControl()
|
||||
{
|
||||
ui->pedDir->setReadOnly(true);
|
||||
ui->pedName->setReadOnly(true);
|
||||
}
|
||||
34
Gui/Form/FileInfoForm.h
Normal file
34
Gui/Form/FileInfoForm.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef FILEINFOFORM_H
|
||||
#define FILEINFOFORM_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class FileInfo;
|
||||
}
|
||||
|
||||
class FileInfo : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FileInfo(QWidget* parent = nullptr);
|
||||
~FileInfo();
|
||||
|
||||
int exec() override;
|
||||
|
||||
public:
|
||||
QString baseName_;
|
||||
QString dirName_;
|
||||
QString fileType_;
|
||||
QString fileTime_;
|
||||
QString fileSize_;
|
||||
|
||||
private:
|
||||
void InitControl();
|
||||
|
||||
private:
|
||||
Ui::FileInfo* ui;
|
||||
};
|
||||
|
||||
#endif // FILEINFOFORM_H
|
||||
148
Gui/Form/FileInfoForm.ui
Normal file
148
Gui/Form/FileInfoForm.ui
Normal file
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FileInfo</class>
|
||||
<widget class="QDialog" name="FileInfo">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>544</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>类型:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbType">
|
||||
<property name="text">
|
||||
<string>TYPE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbTime">
|
||||
<property name="text">
|
||||
<string>TIME</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>名称:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbSize">
|
||||
<property name="text">
|
||||
<string>SIZE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="pedName"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>目录:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="pedDir"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCopyFileName">
|
||||
<property name="text">
|
||||
<string>复制文件名</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCopyDirPath">
|
||||
<property name="text">
|
||||
<string>复制目录</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCopyFull">
|
||||
<property name="text">
|
||||
<string>复制全路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClose">
|
||||
<property name="text">
|
||||
<string>关闭</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user