增加工具窗口显示
parent
2a424bd634
commit
458be41d96
|
@ -74,9 +74,8 @@ enum GDALREADARRCOPYMETHOD {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ShowProessAbstract :public QObject{
|
class ShowProessAbstract{
|
||||||
public:
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
public:
|
||||||
virtual void showProcess(double precent,QString tip);
|
virtual void showProcess(double precent,QString tip);
|
||||||
virtual void showToolInfo( QString tip) ;
|
virtual void showToolInfo( QString tip) ;
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
#include "QToolProcessBarDialog.h"
|
||||||
|
|
||||||
|
QToolProcessBarDialog::QToolProcessBarDialog(QWidget *parent)
|
||||||
|
: QDialog(parent)
|
||||||
|
{
|
||||||
|
ui.setupUi(this);
|
||||||
|
ui.progressBar->setRange(0, 100);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolProcessBarDialog::~QToolProcessBarDialog()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void QToolProcessBarDialog::showProcess(double precent, QString tip)
|
||||||
|
{
|
||||||
|
ui.progressBar->setValue(std::ceil(precent * 100));
|
||||||
|
ui.labelTip->setText(tip);
|
||||||
|
this->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QToolProcessBarDialog::showToolInfo(QString tip)
|
||||||
|
{
|
||||||
|
ui.textEditTip->append("\n"+tip);
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include "ui_QToolProcessBarDialog.h"
|
||||||
|
#include "ImageOperatorBase.h"
|
||||||
|
class QToolProcessBarDialog : public QDialog, public ShowProessAbstract
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
QToolProcessBarDialog(QWidget *parent = nullptr);
|
||||||
|
~QToolProcessBarDialog();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::QToolProcessBarDialogClass ui;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void showProcess(double precent, QString tip) override;
|
||||||
|
virtual void showToolInfo(QString tip) override;
|
||||||
|
};
|
|
@ -0,0 +1,73 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>QToolProcessBarDialogClass</class>
|
||||||
|
<widget class="QDialog" name="QToolProcessBarDialogClass">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>600</width>
|
||||||
|
<height>400</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>QToolProcessBarDialog</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget" native="true">
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QPushButton" name="OKpushButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>120</width>
|
||||||
|
<height>26</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>120</width>
|
||||||
|
<height>26</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>退出</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="labelTip">
|
||||||
|
<property name="text">
|
||||||
|
<string>提示</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QProgressBar" name="progressBar">
|
||||||
|
<property name="value">
|
||||||
|
<number>24</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="textEditTip"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Reference in New Issue