ui 0.11 修改按钮颜色 增加help界面

This commit is contained in:
ZESl
2020-04-25 15:23:26 +08:00
parent 6226f3f909
commit e53ea3e6b7
6 changed files with 95 additions and 6 deletions

15
Classes/Help.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "Help.h"
Help::Help(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
// QTextCodec *codec = QTextCodec::codecForName("utf-8"); //不起作用
// QTextCodec::setCodecForLocale(codec);
ui.textBrowser->setText(QString::fromUtf8("help")); // 暂时不能写显示中文
}
Help::~Help()
{
}

17
Classes/Help.h Normal file
View File

@@ -0,0 +1,17 @@
#pragma once
#include <QWidget>
#include "ui_Help.h"
#include <QTextCodec>
class Help : public QWidget
{
Q_OBJECT
public:
Help(QWidget *parent = Q_NULLPTR);
~Help();
private:
Ui::Help ui;
};

View File

@@ -48,8 +48,8 @@ void Reconstruction::setPicStyle()
void Reconstruction::setButtonStyle()
{
QString buttonStyle = "QPushButton{background-color:white;color: black;}"
"QPushButton:hover{background-color:#cceeff; color: black;}"
"QPushButton:pressed{background-color:rgb(85, 170, 255);border - style: inset; }";
"QPushButton:hover{background-color:#e5ebfb; color: black;}"
"QPushButton:pressed{background-color:rgb(204,213,240);border - style: inset; }";
ui.pushButton->setStyleSheet(buttonStyle);
ui.pushButton_2->setStyleSheet(buttonStyle);
ui.pushButton_3->setStyleSheet(buttonStyle);
@@ -359,4 +359,11 @@ void Reconstruction::on_pushButton_16_clicked()
// todo 颜色选取框已选择颜色color接下来对color进行处理
}
}
// 帮助
void Reconstruction::on_pushButton_18_clicked()
{
Help* help = new Help();
help->show();
}
#pragma endregion

View File

@@ -16,6 +16,7 @@
#include <vtkRenderWindow.h>
#include <QProgressDialog>
#include "MyThread.h"
#include "Help.h"
using namespace pcl;
using namespace std;
@@ -60,6 +61,7 @@ private slots:
void on_pushButton_15_clicked();
void on_pushButton_16_clicked();
void on_pushButton_17_clicked();
void on_pushButton_18_clicked();
void setPicAction(QString action);
void setCloud();
};

30
UI/Help.ui Normal file
View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Help</class>
<widget class="QWidget" name="Help">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>601</width>
<height>411</height>
</rect>
</property>
<property name="windowTitle">
<string>Help</string>
</property>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>581</width>
<height>391</height>
</rect>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

View File

@@ -69,7 +69,7 @@
<string notr="true"/>
</property>
<property name="currentIndex">
<number>1</number>
<number>2</number>
</property>
<widget class="QWidget" name="page">
<widget class="QLabel" name="label_2">
@@ -1016,7 +1016,7 @@
<property name="geometry">
<rect>
<x>820</x>
<y>330</y>
<y>310</y>
<width>141</width>
<height>41</height>
</rect>
@@ -1034,7 +1034,7 @@
<property name="geometry">
<rect>
<x>820</x>
<y>410</y>
<y>390</y>
<width>141</width>
<height>41</height>
</rect>
@@ -1052,7 +1052,7 @@
<property name="geometry">
<rect>
<x>820</x>
<y>490</y>
<y>470</y>
<width>141</width>
<height>41</height>
</rect>
@@ -1098,6 +1098,24 @@
<string/>
</property>
</widget>
<widget class="QPushButton" name="pushButton_18">
<property name="geometry">
<rect>
<x>820</x>
<y>550</y>
<width>141</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<family>黑体</family>
</font>
</property>
<property name="text">
<string>帮助</string>
</property>
</widget>
</widget>
</widget>
<widget class="QWidget" name="widget" native="true">