unitconversion
7
unitconversion/api/api.pri
Normal file
@@ -0,0 +1,7 @@
|
||||
HEADERS += \
|
||||
$$PWD/appinit.h \
|
||||
$$PWD/iconhelper.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/appinit.cpp \
|
||||
$$PWD/iconhelper.cpp
|
||||
58
unitconversion/api/appinit.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#include "appinit.h"
|
||||
#include "qmutex.h"
|
||||
#include "qapplication.h"
|
||||
#include "qevent.h"
|
||||
#include "qwidget.h"
|
||||
|
||||
QScopedPointer<AppInit> AppInit::self;
|
||||
AppInit *AppInit::Instance()
|
||||
{
|
||||
if (self.isNull()) {
|
||||
static QMutex mutex;
|
||||
QMutexLocker locker(&mutex);
|
||||
if (self.isNull()) {
|
||||
self.reset(new AppInit);
|
||||
}
|
||||
}
|
||||
|
||||
return self.data();
|
||||
}
|
||||
|
||||
AppInit::AppInit(QObject *parent) : QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool AppInit::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
QWidget *w = (QWidget *)watched;
|
||||
if (!w->property("canMove").toBool()) {
|
||||
return QObject::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
static QPoint mousePoint;
|
||||
static bool mousePressed = false;
|
||||
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->type() == QEvent::MouseButtonPress) {
|
||||
if (mouseEvent->button() == Qt::LeftButton) {
|
||||
mousePressed = true;
|
||||
mousePoint = mouseEvent->globalPos() - w->pos();
|
||||
return true;
|
||||
}
|
||||
} else if (mouseEvent->type() == QEvent::MouseButtonRelease) {
|
||||
mousePressed = false;
|
||||
return true;
|
||||
} else if (mouseEvent->type() == QEvent::MouseMove) {
|
||||
if (mousePressed && (mouseEvent->buttons() && Qt::LeftButton)) {
|
||||
w->move(mouseEvent->globalPos() - mousePoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return QObject::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void AppInit::start()
|
||||
{
|
||||
qApp->installEventFilter(this);
|
||||
}
|
||||
25
unitconversion/api/appinit.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef APPINIT_H
|
||||
#define APPINIT_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class AppInit : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static AppInit *Instance();
|
||||
explicit AppInit(QObject *parent = 0);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
|
||||
private:
|
||||
static QScopedPointer<AppInit> self;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void start();
|
||||
};
|
||||
|
||||
#endif // APPINIT_H
|
||||
240
unitconversion/api/iconhelper.cpp
Normal file
@@ -0,0 +1,240 @@
|
||||
#include "iconhelper.h"
|
||||
|
||||
QScopedPointer<IconHelper> IconHelper::self;
|
||||
IconHelper *IconHelper::Instance()
|
||||
{
|
||||
if (self.isNull()) {
|
||||
static QMutex mutex;
|
||||
QMutexLocker locker(&mutex);
|
||||
if (self.isNull()) {
|
||||
self.reset(new IconHelper);
|
||||
}
|
||||
}
|
||||
|
||||
return self.data();
|
||||
}
|
||||
|
||||
IconHelper::IconHelper(QObject *parent) : QObject(parent)
|
||||
{
|
||||
//判断图形字体是否存在,不存在则加入
|
||||
QFontDatabase fontDb;
|
||||
if (!fontDb.families().contains("FontAwesome")) {
|
||||
int fontId = fontDb.addApplicationFont(":/image/fontawesome-webfont.ttf");
|
||||
QStringList fontName = fontDb.applicationFontFamilies(fontId);
|
||||
if (fontName.count() == 0) {
|
||||
qDebug() << "load fontawesome-webfont.ttf error";
|
||||
}
|
||||
}
|
||||
|
||||
if (fontDb.families().contains("FontAwesome")) {
|
||||
iconFont = QFont("FontAwesome");
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(4,8,0))
|
||||
iconFont.setHintingPreference(QFont::PreferNoHinting);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void IconHelper::setIcon(QLabel *lab, const QChar &str, quint32 size)
|
||||
{
|
||||
iconFont.setPixelSize(size);
|
||||
lab->setFont(iconFont);
|
||||
lab->setText(str);
|
||||
}
|
||||
|
||||
void IconHelper::setIcon(QAbstractButton *btn, const QChar &str, quint32 size)
|
||||
{
|
||||
iconFont.setPixelSize(size);
|
||||
btn->setFont(iconFont);
|
||||
btn->setText(str);
|
||||
}
|
||||
|
||||
QPixmap IconHelper::getPixmap(const QColor &color, const QChar &str, quint32 size,
|
||||
quint32 pixWidth, quint32 pixHeight, int flags)
|
||||
{
|
||||
QPixmap pix(pixWidth, pixHeight);
|
||||
pix.fill(Qt::transparent);
|
||||
|
||||
QPainter painter;
|
||||
painter.begin(&pix);
|
||||
painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
|
||||
painter.setPen(color);
|
||||
|
||||
iconFont.setPixelSize(size);
|
||||
painter.setFont(iconFont);
|
||||
painter.drawText(pix.rect(), flags, str);
|
||||
painter.end();
|
||||
|
||||
return pix;
|
||||
}
|
||||
|
||||
QPixmap IconHelper::getPixmap(QToolButton *btn, bool normal)
|
||||
{
|
||||
QPixmap pix;
|
||||
int index = btns.indexOf(btn);
|
||||
|
||||
if (index >= 0) {
|
||||
if (normal) {
|
||||
pix = pixNormal.at(index);
|
||||
} else {
|
||||
pix = pixDark.at(index);
|
||||
}
|
||||
}
|
||||
|
||||
return pix;
|
||||
}
|
||||
|
||||
void IconHelper::setStyle(QWidget *widget, const QString &type, int borderWidth, const QString &borderColor,
|
||||
const QString &normalBgColor, const QString &darkBgColor,
|
||||
const QString &normalTextColor, const QString &darkTextColor)
|
||||
{
|
||||
QString strBorder;
|
||||
if (type == "top") {
|
||||
strBorder = QString("border-width:%1px 0px 0px 0px;padding:%1px %2px %2px %2px;")
|
||||
.arg(borderWidth).arg(borderWidth * 2);
|
||||
} else if (type == "right") {
|
||||
strBorder = QString("border-width:0px %1px 0px 0px;padding:%2px %1px %2px %2px;")
|
||||
.arg(borderWidth).arg(borderWidth * 2);
|
||||
} else if (type == "bottom") {
|
||||
strBorder = QString("border-width:0px 0px %1px 0px;padding:%2px %2px %1px %2px;")
|
||||
.arg(borderWidth).arg(borderWidth * 2);
|
||||
} else if (type == "left") {
|
||||
strBorder = QString("border-width:0px 0px 0px %1px;padding:%2px %2px %2px %1px;")
|
||||
.arg(borderWidth).arg(borderWidth * 2);
|
||||
}
|
||||
|
||||
QStringList qss;
|
||||
qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:none;border-radius:0px;padding:5px;color:%2;background:%3;}")
|
||||
.arg(type).arg(normalTextColor).arg(normalBgColor));
|
||||
|
||||
qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton:hover,"
|
||||
"QWidget[flag=\"%1\"] QAbstractButton:pressed,"
|
||||
"QWidget[flag=\"%1\"] QAbstractButton:checked{"
|
||||
"border-style:solid;%2border-color:%3;color:%4;background:%5;}")
|
||||
.arg(type).arg(strBorder).arg(borderColor).arg(darkTextColor).arg(darkBgColor));
|
||||
|
||||
widget->setStyleSheet(qss.join(""));
|
||||
}
|
||||
|
||||
void IconHelper::setStyle(QWidget *widget, QList<QToolButton *> btns, QList<int> pixChar,
|
||||
quint32 iconSize, quint32 iconWidth, quint32 iconHeight,
|
||||
const QString &type, int borderWidth, const QString &borderColor,
|
||||
const QString &normalBgColor, const QString &darkBgColor,
|
||||
const QString &normalTextColor, const QString &darkTextColor)
|
||||
{
|
||||
int btnCount = btns.count();
|
||||
int charCount = pixChar.count();
|
||||
if (btnCount <= 0 || charCount <= 0 || btnCount != charCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
QString strBorder;
|
||||
if (type == "top") {
|
||||
strBorder = QString("border-width:%1px 0px 0px 0px;padding:%1px %2px %2px %2px;")
|
||||
.arg(borderWidth).arg(borderWidth * 2);
|
||||
} else if (type == "right") {
|
||||
strBorder = QString("border-width:0px %1px 0px 0px;padding:%2px %1px %2px %2px;")
|
||||
.arg(borderWidth).arg(borderWidth * 2);
|
||||
} else if (type == "bottom") {
|
||||
strBorder = QString("border-width:0px 0px %1px 0px;padding:%2px %2px %1px %2px;")
|
||||
.arg(borderWidth).arg(borderWidth * 2);
|
||||
} else if (type == "left") {
|
||||
strBorder = QString("border-width:0px 0px 0px %1px;padding:%2px %2px %2px %1px;")
|
||||
.arg(borderWidth).arg(borderWidth * 2);
|
||||
}
|
||||
|
||||
//如果图标是左侧显示则需要让没有选中的按钮左侧也有加深的边框,颜色为背景颜色
|
||||
QStringList qss;
|
||||
if (btns.at(0)->toolButtonStyle() == Qt::ToolButtonTextBesideIcon) {
|
||||
qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:solid;border-radius:0px;%2border-color:%3;color:%4;background:%5;}")
|
||||
.arg(type).arg(strBorder).arg(normalBgColor).arg(normalTextColor).arg(normalBgColor));
|
||||
} else {
|
||||
qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:none;border-radius:0px;padding:5px;color:%2;background:%3;}")
|
||||
.arg(type).arg(normalTextColor).arg(normalBgColor));
|
||||
}
|
||||
|
||||
qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton:hover,"
|
||||
"QWidget[flag=\"%1\"] QAbstractButton:pressed,"
|
||||
"QWidget[flag=\"%1\"] QAbstractButton:checked{"
|
||||
"border-style:solid;%2border-color:%3;color:%4;background:%5;}")
|
||||
.arg(type).arg(strBorder).arg(borderColor).arg(darkTextColor).arg(darkBgColor));
|
||||
|
||||
qss.append(QString("QWidget#%1{background:%2;}").arg(widget->objectName()).arg(normalBgColor));
|
||||
|
||||
qss.append(QString("QWidget>QToolButton{border-width:0px;}"));
|
||||
qss.append(QString("QWidget>QToolButton{background-color:%1;color:%2;}")
|
||||
.arg(normalBgColor).arg(normalTextColor));
|
||||
qss.append(QString("QWidget>QToolButton:hover,QWidget>QToolButton:pressed,QWidget>QToolButton:checked{background-color:%1;color:%2;}")
|
||||
.arg(darkBgColor).arg(darkTextColor));
|
||||
|
||||
widget->setStyleSheet(qss.join(""));
|
||||
|
||||
for (int i = 0; i < btnCount; i++) {
|
||||
//存储对应按钮对象,方便鼠标移上去的时候切换图片
|
||||
QPixmap pixNormal = getPixmap(normalTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight);
|
||||
QPixmap pixDark = getPixmap(darkTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight);
|
||||
|
||||
btns.at(i)->setIcon(QIcon(pixNormal));
|
||||
btns.at(i)->setIconSize(QSize(iconWidth, iconHeight));
|
||||
btns.at(i)->installEventFilter(this);
|
||||
|
||||
this->btns.append(btns.at(i));
|
||||
this->pixNormal.append(pixNormal);
|
||||
this->pixDark.append(pixDark);
|
||||
}
|
||||
}
|
||||
|
||||
void IconHelper::setStyle(QFrame *frame, QList<QToolButton *> btns, QList<int> pixChar,
|
||||
quint32 iconSize, quint32 iconWidth, quint32 iconHeight,
|
||||
const QString &normalBgColor, const QString &darkBgColor,
|
||||
const QString &normalTextColor, const QString &darkTextColor)
|
||||
{
|
||||
int btnCount = btns.count();
|
||||
int charCount = pixChar.count();
|
||||
if (btnCount <= 0 || charCount <= 0 || btnCount != charCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
QStringList qss;
|
||||
qss.append(QString("QFrame>QToolButton{border-style:none;border-width:0px;}"));
|
||||
qss.append(QString("QFrame>QToolButton{background-color:%1;color:%2;}")
|
||||
.arg(normalBgColor).arg(normalTextColor));
|
||||
qss.append(QString("QFrame>QToolButton:hover,QFrame>QToolButton:pressed,QFrame>QToolButton:checked{background-color:%1;color:%2;}")
|
||||
.arg(darkBgColor).arg(darkTextColor));
|
||||
|
||||
frame->setStyleSheet(qss.join(""));
|
||||
|
||||
for (int i = 0; i < btnCount; i++) {
|
||||
//存储对应按钮对象,方便鼠标移上去的时候切换图片
|
||||
QPixmap pixNormal = getPixmap(normalTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight);
|
||||
QPixmap pixDark = getPixmap(darkTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight);
|
||||
|
||||
btns.at(i)->setIcon(QIcon(pixNormal));
|
||||
btns.at(i)->setIconSize(QSize(iconWidth, iconHeight));
|
||||
btns.at(i)->installEventFilter(this);
|
||||
|
||||
this->btns.append(btns.at(i));
|
||||
this->pixNormal.append(pixNormal);
|
||||
this->pixDark.append(pixDark);
|
||||
}
|
||||
}
|
||||
|
||||
bool IconHelper::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (watched->inherits("QToolButton")) {
|
||||
QToolButton *btn = (QToolButton *)watched;
|
||||
int index = btns.indexOf(btn);
|
||||
if (index >= 0) {
|
||||
if (event->type() == QEvent::Enter) {
|
||||
btn->setIcon(QIcon(pixDark.at(index)));
|
||||
} else if (event->type() == QEvent::Leave) {
|
||||
if (btn->isChecked()) {
|
||||
btn->setIcon(QIcon(pixDark.at(index)));
|
||||
} else {
|
||||
btn->setIcon(QIcon(pixNormal.at(index)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return QObject::eventFilter(watched, event);
|
||||
}
|
||||
64
unitconversion/api/iconhelper.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef ICONHELPER_H
|
||||
#define ICONHELPER_H
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
|
||||
#include <QtWidgets>
|
||||
#endif
|
||||
|
||||
//图形字体处理类
|
||||
class IconHelper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static IconHelper *Instance();
|
||||
explicit IconHelper(QObject *parent = 0);
|
||||
|
||||
void setIcon(QLabel *lab, const QChar &str, quint32 size = 12);
|
||||
void setIcon(QAbstractButton *btn, const QChar &str, quint32 size = 12);
|
||||
QPixmap getPixmap(const QColor &color, const QChar &str, quint32 size = 12,
|
||||
quint32 pixWidth = 15, quint32 pixHeight = 15,
|
||||
int flags = Qt::AlignCenter);
|
||||
|
||||
//根据按钮获取该按钮对应的图标
|
||||
QPixmap getPixmap(QToolButton *btn, bool normal);
|
||||
|
||||
//指定导航面板样式,不带图标
|
||||
static void setStyle(QWidget *widget, const QString &type = "left", int borderWidth = 3,
|
||||
const QString &borderColor = "#029FEA",
|
||||
const QString &normalBgColor = "#292F38",
|
||||
const QString &darkBgColor = "#1D2025",
|
||||
const QString &normalTextColor = "#54626F",
|
||||
const QString &darkTextColor = "#FDFDFD");
|
||||
|
||||
//指定导航面板样式,带图标和效果切换
|
||||
void setStyle(QWidget *widget, QList<QToolButton *> btns, QList<int> pixChar,
|
||||
quint32 iconSize = 12, quint32 iconWidth = 15, quint32 iconHeight = 15,
|
||||
const QString &type = "left", int borderWidth = 3,
|
||||
const QString &borderColor = "#029FEA",
|
||||
const QString &normalBgColor = "#292F38",
|
||||
const QString &darkBgColor = "#1D2025",
|
||||
const QString &normalTextColor = "#54626F",
|
||||
const QString &darkTextColor = "#FDFDFD");
|
||||
|
||||
//指定导航按钮样式,带图标和效果切换
|
||||
void setStyle(QFrame *frame, QList<QToolButton *> btns, QList<int> pixChar,
|
||||
quint32 iconSize = 12, quint32 iconWidth = 15, quint32 iconHeight = 15,
|
||||
const QString &normalBgColor = "#2FC5A2",
|
||||
const QString &darkBgColor = "#3EA7E9",
|
||||
const QString &normalTextColor = "#EEEEEE",
|
||||
const QString &darkTextColor = "#FFFFFF");
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
|
||||
private:
|
||||
static QScopedPointer<IconHelper> self;
|
||||
QFont iconFont; //图形字体
|
||||
QList<QToolButton *> btns; //按钮队列
|
||||
QList<QPixmap> pixNormal; //正常图片队列
|
||||
QList<QPixmap> pixDark; //加深图片队列
|
||||
};
|
||||
#endif // ICONHELPER_H
|
||||
8
unitconversion/form/form.pri
Normal file
@@ -0,0 +1,8 @@
|
||||
FORMS += \
|
||||
$$PWD/frmmain.ui
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/frmmain.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/frmmain.cpp
|
||||
941
unitconversion/form/frmmain.cpp
Normal file
@@ -0,0 +1,941 @@
|
||||
#pragma execution_character_set("utf-8")
|
||||
|
||||
#include "frmmain.h"
|
||||
#include "ui_frmmain.h"
|
||||
#include "iconhelper.h"
|
||||
#include <qdebug.h>
|
||||
|
||||
frmMain::frmMain(QWidget *parent) : QDialog(parent), ui(new Ui::frmMain)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->initForm();
|
||||
}
|
||||
|
||||
frmMain::~frmMain()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool frmMain::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonDblClick) {
|
||||
if (watched == ui->widgetTitle) {
|
||||
on_btnMenu_Max_clicked();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return QWidget::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void frmMain::initForm()
|
||||
{
|
||||
this->setProperty("form", true);
|
||||
this->setProperty("canMove", true);
|
||||
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint |
|
||||
Qt::WindowMinMaxButtonsHint);
|
||||
IconHelper::Instance()->setIcon(ui->btnMenu_Min, QChar(0xf068));
|
||||
IconHelper::Instance()->setIcon(ui->btnMenu_Max, QChar(0xf067));
|
||||
IconHelper::Instance()->setIcon(ui->btnMenu_Close, QChar(0xf00d));
|
||||
//ui->widgetMenu->setVisible(false);
|
||||
ui->widgetTitle->installEventFilter(this);
|
||||
ui->widgetTitle->setProperty("form", "title");
|
||||
ui->widgetTop->setProperty("nav", "top");
|
||||
ui->labTitle->setText("压力单位转换工具");
|
||||
ui->labTitle->setFont(QFont("Microsoft Yahei", 20));
|
||||
this->setWindowTitle(ui->labTitle->text());
|
||||
ui->stackedWidget->setStyleSheet("QLabel{font:20pt;}QLineEdit{font:20pt;}QPushButton{font:20pt;}QSpinBox{font:20pt;}");
|
||||
//单独设置指示器大小
|
||||
int addWidth = 20;
|
||||
int addHeight = 10;
|
||||
int rbtnWidth = 15;
|
||||
int ckWidth = 13;
|
||||
int scrWidth = 12;
|
||||
int borderWidth = 3;
|
||||
QStringList qss;
|
||||
qss.append(
|
||||
QString("QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{width:%1px;}").arg(
|
||||
addWidth));
|
||||
qss.append(
|
||||
QString("QComboBox::down-arrow,QDateEdit[calendarPopup=\"true\"]::down-arrow,QTimeEdit[calendarPopup=\"true\"]::down-arrow,"
|
||||
"QDateTimeEdit[calendarPopup=\"true\"]::down-arrow{width:%1px;height:%1px;right:2px;}").arg(
|
||||
addHeight));
|
||||
qss.append(QString("QRadioButton::indicator{width:%1px;height:%1px;}").arg(rbtnWidth));
|
||||
qss.append(
|
||||
QString("QCheckBox::indicator,QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{width:%1px;height:%1px;}").arg(
|
||||
ckWidth));
|
||||
qss.append(
|
||||
QString("QScrollBar:horizontal{min-height:%1px;border-radius:%2px;}QScrollBar::handle:horizontal{border-radius:%2px;}"
|
||||
"QScrollBar:vertical{min-width:%1px;border-radius:%2px;}QScrollBar::handle:vertical{border-radius:%2px;}").arg(
|
||||
scrWidth).arg(scrWidth / 2));
|
||||
qss.append(QString("QWidget#widget_top>QToolButton:pressed,QWidget#widget_top>QToolButton:hover,"
|
||||
"QWidget#widget_top>QToolButton:checked,QWidget#widget_top>QLabel:hover{"
|
||||
"border-width:0px 0px %1px 0px;}").arg(borderWidth));
|
||||
qss.append(QString("QWidget#widgetleft>QPushButton:checked,QWidget#widgetleft>QToolButton:checked,"
|
||||
"QWidget#widgetleft>QPushButton:pressed,QWidget#widgetleft>QToolButton:pressed{"
|
||||
"border-width:0px 0px 0px %1px;}").arg(borderWidth));
|
||||
this->setStyleSheet(qss.join(""));
|
||||
QSize icoSize(32, 32);
|
||||
int icoWidth = 85;
|
||||
//设置顶部导航按钮
|
||||
QList<QToolButton *> tbtns = ui->widgetTop->findChildren<QToolButton *>();
|
||||
|
||||
foreach (QToolButton *btn, tbtns) {
|
||||
btn->setIconSize(icoSize);
|
||||
btn->setMinimumWidth(icoWidth);
|
||||
btn->setCheckable(true);
|
||||
connect(btn, SIGNAL(clicked()), this, SLOT(buttonClick()));
|
||||
}
|
||||
|
||||
QList<QLineEdit *> ledits = ui->page1->findChildren<QLineEdit *>();
|
||||
|
||||
foreach (QLineEdit *ledit, ledits) {
|
||||
connect(ledit, SIGNAL(textEdited(const QString)), this, SLOT(doTextEdited(const QString)));
|
||||
}
|
||||
|
||||
ui->btnMain->click();
|
||||
on_spinBox_rbit_valueChanged(1);
|
||||
}
|
||||
|
||||
void frmMain::buttonClick()
|
||||
{
|
||||
QToolButton *b = (QToolButton *)sender();
|
||||
QString name = b->text();
|
||||
QList<QToolButton *> tbtns = ui->widgetTop->findChildren<QToolButton *>();
|
||||
|
||||
foreach (QToolButton *btn, tbtns) {
|
||||
if (btn == b) {
|
||||
btn->setChecked(true);
|
||||
} else {
|
||||
btn->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (name == "主界面") {
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
} else if (name == "用户退出") {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
void frmMain::doTextEdited(const QString str)
|
||||
{
|
||||
QLineEdit *l = (QLineEdit *)sender();
|
||||
QList<QLineEdit *> ledits = ui->page1->findChildren<QLineEdit *>();
|
||||
//转换前单位
|
||||
QString beforeName = l->objectName();
|
||||
//转换前数值
|
||||
double beforeValue = l->text().toDouble();
|
||||
|
||||
foreach (QLineEdit *ledit, ledits) {
|
||||
//转换后单位
|
||||
QString curName = ledit->objectName();
|
||||
|
||||
if (ledit == l) {
|
||||
} else if (curName == "lineEdit_bar") {
|
||||
//巴 (bar)
|
||||
if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.01, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints);
|
||||
qDebug() << outStr;
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 1.01325, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.0004788, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.03386388, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.00009807, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 10, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.00001, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.00133322, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.06894757, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.980665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到巴 (bar)
|
||||
QString outStr = QString::number(beforeValue * 0.00009807, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_kpa") {
|
||||
//千帕 (kPa)
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 100.0, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 0.1, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 101.325, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 0.04788026, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 3.38638816, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 0.00980665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 1000, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 0.1, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 0.13332237, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 6.894757, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 98.0665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到千帕 (kPa)
|
||||
QString outStr = QString::number(beforeValue * 0.00980665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_mbar") {
|
||||
//毫巴 (mbar)
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 1000.0, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 10, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 1013.25, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 0.47880257, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 33.86388158, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 0.01, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 1.33322368, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 68.94757, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 980.665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到毫巴(mbar)
|
||||
QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_unit") {
|
||||
//标准大气压
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.98692327, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.00986923, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.00098692, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.00047254, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.03342105, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.00009678, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 9.86923267, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.00098692, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.00000987, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.00131579, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.06804596, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.96784111, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到标准大气压
|
||||
QString outStr = QString::number(beforeValue * 0.00009678, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_feet") {
|
||||
//磅力/英尺2
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 2088.54351212, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 20.88543512, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 2.08854351, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 2116.21671366, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 70.72619017, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 0.20481615, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 20885.43512121, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 2.08854351, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 0.02088544, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 2.78449568, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 144, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 2048.16152331, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到磅力/英尺2
|
||||
QString outStr = QString::number(beforeValue * 0.20481615, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_british_hg") {
|
||||
//英吋汞柱
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 29.52998751, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 0.29529988, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 0.02952999, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 29.92125984, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 0.01413903, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 0.0028959, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 295.29987508, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 0.02952999, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 0.0002953, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 0.03937008, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 2.03602088, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 28.9590252, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 0.0028959, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 10197.16212978, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 101.9716213, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 10332.274528, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 4.88242743, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 345.3154908, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 101971.62129779, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 0.10197162, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 13.59509806, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 703.06954974, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到公斤力/米2
|
||||
QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到英吋汞柱
|
||||
QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.1, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.101325, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.00004788, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.00338639, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.00000981, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.000001, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.00013332, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.00689476, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到兆帕(MPa)
|
||||
QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_hpa") {
|
||||
//百帕 (hPa)
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到百帕 (hPa)
|
||||
QString outStr = QString::number(beforeValue * 1000, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 10, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 1013.25, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 0.47880257, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 33.86388158, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 0.01, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 1.33322368, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 68.94757, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 980.665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到百帕(hPa)
|
||||
QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_pascal") {
|
||||
//帕斯卡
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 100000, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 1000, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 100, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 101325, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 47.88025694, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 3386.38815789, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 9.80665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 1000000, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 100, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 133.32236842, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 6894.757, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 98066.5, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到帕斯卡
|
||||
QString outStr = QString::number(beforeValue * 9.80665, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到毫米汞柱 (托)
|
||||
QString outStr = QString::number(beforeValue * 750.0616827, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到毫米汞柱 (托)
|
||||
QString outStr = QString::number(beforeValue * 7.50061683, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到毫米汞柱 (托)
|
||||
QString outStr = QString::number(beforeValue * 0.75006168, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到毫米汞柱 (托)
|
||||
QString outStr = QString::number(beforeValue * 760, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到毫米汞柱(托)
|
||||
QString outStr = QString::number(beforeValue * 0.35913146, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到毫米汞柱(托)
|
||||
QString outStr = QString::number(beforeValue * 25.4, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到毫米汞柱(托)
|
||||
QString outStr = QString::number(beforeValue * 0.07355592, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到毫米汞柱(托)
|
||||
QString outStr = QString::number(beforeValue * 7500.61682704, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到毫米汞柱(托)
|
||||
QString outStr = QString::number(beforeValue * 0.75006168, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到毫米汞柱(托)
|
||||
QString outStr = QString::number(beforeValue * 0.00750062, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到毫米汞柱 (托)
|
||||
QString outStr = QString::number(beforeValue * 51.71493037, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到毫米汞柱 (托)
|
||||
QString outStr = QString::number(beforeValue * 735.55924007, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到毫米汞柱 (托)
|
||||
QString outStr = QString::number(beforeValue * 0.07355592, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_cmz") {
|
||||
//磅力/英寸2
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 14.50377439, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 0.14503774, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 0.01450377, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 14.6959494, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 0.00694444, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 0.4911541, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 0.00142233, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 145.0377439, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 0.01450377, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 0.00014504, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 0.01933678, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 14.22334391, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 0.00142233, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 1.01971621, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.01019716, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.00101972, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 1.03322745, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.00048824, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.03453155, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.00101972, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.0000102, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.00135951, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.07030695, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱装换到公斤力/厘米2
|
||||
QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
} else if (curName == "lineEdit_mm_water_column") {
|
||||
//毫米水柱
|
||||
if (beforeName == "lineEdit_bar") {
|
||||
//从巴 (bar)装换到磅力/英寸2
|
||||
QString outStr = QString::number(beforeValue * 10197.16212978, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kpa") {
|
||||
//从千帕 (kPa)装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 101.9716213, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mbar") {
|
||||
//从毫巴 (mbar)装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_unit") {
|
||||
//从标准大气压装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 10332.274528, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_feet") {
|
||||
//从磅力/英尺2装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 4.88242743, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_british_hg") {
|
||||
//英吋汞柱装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 345.3154908, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kilogram_force") {
|
||||
//公斤力/米2装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mpa") {
|
||||
//兆帕(MPa)装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 101971.62129779, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_hpa") {
|
||||
//百帕(hPa)装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_pascal") {
|
||||
//帕斯卡装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 0.10197162, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_mmhg") {
|
||||
//毫米汞柱 (托)装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 13.59509806, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_cmz") {
|
||||
//磅力/英寸2装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 703.06954974, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
} else if (beforeName == "lineEdit_kgf_cm2") {
|
||||
//公斤力/厘米2装换到毫米水柱
|
||||
QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints);
|
||||
ledit->setText(outStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void frmMain::on_btnMenu_Min_clicked()
|
||||
{
|
||||
showMinimized();
|
||||
}
|
||||
void frmMain::on_btnMenu_Max_clicked()
|
||||
{
|
||||
static bool max = false;
|
||||
static QRect location = this->geometry();
|
||||
|
||||
if (max) {
|
||||
this->setGeometry(location);
|
||||
} else {
|
||||
location = this->geometry();
|
||||
this->setGeometry(qApp->desktop()->availableGeometry());
|
||||
}
|
||||
|
||||
this->setProperty("canMove", max);
|
||||
max = !max;
|
||||
}
|
||||
void frmMain::on_btnMenu_Close_clicked()
|
||||
{
|
||||
close();
|
||||
}
|
||||
void frmMain::on_spinBox_rbit_valueChanged(int arg1)
|
||||
{
|
||||
numOfDecimalPoints = arg1;
|
||||
QList<QLineEdit *> ledits = ui->page1->findChildren<QLineEdit *>();
|
||||
|
||||
foreach (QLineEdit *ledit, ledits) {
|
||||
ledit->setValidator(new QDoubleValidator(0, DBL_MAX, arg1, this));
|
||||
}
|
||||
}
|
||||
37
unitconversion/form/frmmain.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef FRMMAIN_H
|
||||
#define FRMMAIN_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class frmMain;
|
||||
}
|
||||
|
||||
class frmMain : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit frmMain(QWidget *parent = 0);
|
||||
~frmMain();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
|
||||
private:
|
||||
Ui::frmMain *ui;
|
||||
int numOfDecimalPoints;
|
||||
|
||||
private slots:
|
||||
void initForm();
|
||||
void buttonClick();
|
||||
void doTextEdited(const QString);
|
||||
|
||||
private slots:
|
||||
void on_btnMenu_Min_clicked();
|
||||
void on_btnMenu_Max_clicked();
|
||||
void on_btnMenu_Close_clicked();
|
||||
void on_spinBox_rbit_valueChanged(int arg1);
|
||||
};
|
||||
|
||||
#endif // UIDEMO01_H
|
||||
506
unitconversion/form/frmmain.ui
Normal file
@@ -0,0 +1,506 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>frmMain</class>
|
||||
<widget class="QDialog" name="frmMain">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QWidget" name="widgetTitle" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="labIco">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../other/main.qrc">:/image/logo.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labTitle">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widgetTop" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnMain">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>主界面</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../other/main.qrc">
|
||||
<normaloff>:/image/main_main.png</normaloff>:/image/main_main.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnExit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>用户退出</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../other/main.qrc">
|
||||
<normaloff>:/image/main_exit.png</normaloff>:/image/main_exit.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widgetMenu" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="1" colspan="3">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="btnMenu_Min">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>最小化</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="btnMenu_Close">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>关闭</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="btnMenu_Max">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>104</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_rbit">
|
||||
<property name="text">
|
||||
<string>小数点保留位</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_bar">
|
||||
<property name="text">
|
||||
<string>巴 (bar)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_kpa">
|
||||
<property name="text">
|
||||
<string>千帕 (kPa)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_mbar">
|
||||
<property name="text">
|
||||
<string>毫巴 (mbar)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_unit">
|
||||
<property name="text">
|
||||
<string>标准大气压</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_feet">
|
||||
<property name="text">
|
||||
<string>磅力/英尺2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_british_hg">
|
||||
<property name="text">
|
||||
<string>英吋汞柱</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_kilogram_force">
|
||||
<property name="text">
|
||||
<string>公斤力/米2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_rbit">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_bar"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_kpa"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_mbar"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_unit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_feet"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_british_hg"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_kilogram_force"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>105</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_mpa">
|
||||
<property name="text">
|
||||
<string>兆帕 (MPa)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_hpa">
|
||||
<property name="text">
|
||||
<string>百帕 (hPa)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_pascal">
|
||||
<property name="text">
|
||||
<string>帕斯卡</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_mmhg">
|
||||
<property name="text">
|
||||
<string>毫米汞柱 (托)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_cmz">
|
||||
<property name="text">
|
||||
<string>磅力/英寸2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_kgf_cm2">
|
||||
<property name="text">
|
||||
<string>公斤力/厘米2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_mm_water_column">
|
||||
<property name="text">
|
||||
<string>毫米水柱</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_mpa"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_hpa"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_pascal"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_mmhg"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_cmz"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_kgf_cm2"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_mm_water_column"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>104</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3"/>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page3">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5"/>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4"/>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../other/main.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
42
unitconversion/main.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "frmmain.h"
|
||||
#include "appinit.h"
|
||||
#include "qapplication.h"
|
||||
#include "qtextcodec.h"
|
||||
#include "qfile.h"
|
||||
#include "qdebug.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
a.setFont(QFont("Microsoft Yahei", 9));
|
||||
AppInit::Instance()->start();
|
||||
|
||||
#if (QT_VERSION <= QT_VERSION_CHECK(5,0,0))
|
||||
#if _MSC_VER
|
||||
QTextCodec *codec = QTextCodec::codecForName("gbk");
|
||||
#else
|
||||
QTextCodec *codec = QTextCodec::codecForName("utf-8");
|
||||
#endif
|
||||
QTextCodec::setCodecForLocale(codec);
|
||||
QTextCodec::setCodecForCStrings(codec);
|
||||
QTextCodec::setCodecForTr(codec);
|
||||
#else
|
||||
QTextCodec *codec = QTextCodec::codecForName("utf-8");
|
||||
QTextCodec::setCodecForLocale(codec);
|
||||
#endif
|
||||
|
||||
//加载样式表
|
||||
QFile file(":/qss/psblack.css");
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
QString qss = QLatin1String(file.readAll());
|
||||
QString paletteColor = qss.mid(20, 7);
|
||||
qApp->setPalette(QPalette(QColor(paletteColor)));
|
||||
qApp->setStyleSheet(qss);
|
||||
file.close();
|
||||
}
|
||||
|
||||
frmMain w;
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
BIN
unitconversion/other/image/fontawesome-webfont.ttf
Normal file
BIN
unitconversion/other/image/logo.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
unitconversion/other/image/main_exit.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
unitconversion/other/image/main_main.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
unitconversion/other/logo.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
8
unitconversion/other/main.qrc
Normal file
@@ -0,0 +1,8 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>image/fontawesome-webfont.ttf</file>
|
||||
<file>image/main_exit.png</file>
|
||||
<file>image/logo.png</file>
|
||||
<file>image/main_main.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
23
unitconversion/other/qss.qrc
Normal file
@@ -0,0 +1,23 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>qss/psblack.css</file>
|
||||
<file>qss/psblack/add_bottom.png</file>
|
||||
<file>qss/psblack/add_left.png</file>
|
||||
<file>qss/psblack/add_right.png</file>
|
||||
<file>qss/psblack/add_top.png</file>
|
||||
<file>qss/psblack/branch_close.png</file>
|
||||
<file>qss/psblack/branch_open.png</file>
|
||||
<file>qss/psblack/calendar_nextmonth.png</file>
|
||||
<file>qss/psblack/calendar_prevmonth.png</file>
|
||||
<file>qss/psblack/checkbox_checked.png</file>
|
||||
<file>qss/psblack/checkbox_checked_disable.png</file>
|
||||
<file>qss/psblack/checkbox_parcial.png</file>
|
||||
<file>qss/psblack/checkbox_parcial_disable.png</file>
|
||||
<file>qss/psblack/checkbox_unchecked.png</file>
|
||||
<file>qss/psblack/checkbox_unchecked_disable.png</file>
|
||||
<file>qss/psblack/radiobutton_checked.png</file>
|
||||
<file>qss/psblack/radiobutton_checked_disable.png</file>
|
||||
<file>qss/psblack/radiobutton_unchecked.png</file>
|
||||
<file>qss/psblack/radiobutton_unchecked_disable.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
657
unitconversion/other/qss/psblack.css
Normal file
@@ -0,0 +1,657 @@
|
||||
QPalette{background:#444444;}*{outline:0px;color:#DCDCDC;}
|
||||
|
||||
QWidget[form="true"]{
|
||||
border:1px solid #242424;
|
||||
border-radius:0px;
|
||||
}
|
||||
|
||||
QWidget[form="bottom"]{
|
||||
background:#484848;
|
||||
}
|
||||
|
||||
QWidget[form="bottom"] .QFrame{
|
||||
border:1px solid #DCDCDC;
|
||||
}
|
||||
|
||||
QWidget[form="bottom"] QLabel,QWidget[form="title"] QLabel{
|
||||
border-radius:0px;
|
||||
color:#DCDCDC;
|
||||
background:none;
|
||||
border-style:none;
|
||||
}
|
||||
|
||||
QWidget[form="title"],QWidget[nav="left"],QWidget[nav="top"] QAbstractButton{
|
||||
border-style:none;
|
||||
border-radius:0px;
|
||||
padding:5px;
|
||||
color:#DCDCDC;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838);
|
||||
}
|
||||
|
||||
QWidget[nav="top"] QAbstractButton:hover,QWidget[nav="top"] QAbstractButton:pressed,QWidget[nav="top"] QAbstractButton:checked{
|
||||
border-style:solid;
|
||||
border-width:0px 0px 2px 0px;
|
||||
padding:4px 4px 2px 4px;
|
||||
border-color:#00BB9E;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
||||
}
|
||||
|
||||
QWidget[nav="left"] QAbstractButton{
|
||||
border-radius:0px;
|
||||
color:#DCDCDC;
|
||||
background:none;
|
||||
border-style:none;
|
||||
}
|
||||
|
||||
QWidget[nav="left"] QAbstractButton:hover{
|
||||
color:#FFFFFF;
|
||||
background-color:#00BB9E;
|
||||
}
|
||||
|
||||
QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{
|
||||
color:#DCDCDC;
|
||||
border-style:solid;
|
||||
border-width:0px 0px 0px 2px;
|
||||
padding:4px 4px 4px 2px;
|
||||
border-color:#00BB9E;
|
||||
background-color:#444444;
|
||||
}
|
||||
|
||||
QWidget[video="true"] QLabel{
|
||||
color:#DCDCDC;
|
||||
border:1px solid #242424;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838);
|
||||
}
|
||||
|
||||
QWidget[video="true"] QLabel:focus{
|
||||
border:1px solid #00BB9E;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
||||
}
|
||||
|
||||
QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{
|
||||
border:1px solid #242424;
|
||||
border-radius:3px;
|
||||
padding:2px;
|
||||
background:none;
|
||||
selection-background-color:#00BB9E;
|
||||
selection-color:#FFFFFF;
|
||||
}
|
||||
|
||||
QLineEdit:focus,QTextEdit:focus,QPlainTextEdit:focus,QSpinBox:focus,QDoubleSpinBox:focus,QComboBox:focus,QDateEdit:focus,QTimeEdit:focus,QDateTimeEdit:focus,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QSpinBox:hover,QDoubleSpinBox:hover,QComboBox:hover,QDateEdit:hover,QTimeEdit:hover,QDateTimeEdit:hover{
|
||||
border:1px solid #242424;
|
||||
}
|
||||
|
||||
QLineEdit[echoMode="2"]{
|
||||
lineedit-password-character:9679;
|
||||
}
|
||||
|
||||
.QFrame{
|
||||
border:1px solid #242424;
|
||||
border-radius:3px;
|
||||
}
|
||||
|
||||
.QGroupBox{
|
||||
border:1px solid #242424;
|
||||
border-radius:5px;
|
||||
margin-top:3ex;
|
||||
}
|
||||
|
||||
.QGroupBox::title{
|
||||
subcontrol-origin:margin;
|
||||
position:relative;
|
||||
left:10px;
|
||||
}
|
||||
|
||||
.QPushButton,.QToolButton{
|
||||
border-style:none;
|
||||
border:1px solid #242424;
|
||||
color:#DCDCDC;
|
||||
padding:5px;
|
||||
min-height:15px;
|
||||
border-radius:5px;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838);
|
||||
}
|
||||
|
||||
.QPushButton:hover,.QToolButton:hover{
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
||||
}
|
||||
|
||||
.QPushButton:pressed,.QToolButton:pressed{
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838);
|
||||
}
|
||||
|
||||
.QToolButton::menu-indicator{
|
||||
image:None;
|
||||
}
|
||||
|
||||
QToolButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close{
|
||||
border-radius:3px;
|
||||
color:#DCDCDC;
|
||||
padding:3px;
|
||||
margin:0px;
|
||||
background:none;
|
||||
border-style:none;
|
||||
}
|
||||
|
||||
QToolButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover{
|
||||
color:#FFFFFF;
|
||||
margin:1px 1px 2px 1px;
|
||||
background-color:rgba(51,127,209,230);
|
||||
}
|
||||
|
||||
QPushButton#btnMenu_Close:hover{
|
||||
color:#FFFFFF;
|
||||
margin:1px 1px 2px 1px;
|
||||
background-color:rgba(238,0,0,128);
|
||||
}
|
||||
|
||||
QRadioButton::indicator{
|
||||
width:15px;
|
||||
height:15px;
|
||||
}
|
||||
|
||||
QRadioButton::indicator::unchecked{
|
||||
image:url(:/qss/psblack/radiobutton_unchecked.png);
|
||||
}
|
||||
|
||||
QRadioButton::indicator::unchecked:disabled{
|
||||
image:url(:/qss/psblack/radiobutton_unchecked_disable.png);
|
||||
}
|
||||
|
||||
QRadioButton::indicator::checked{
|
||||
image:url(:/qss/psblack/radiobutton_checked.png);
|
||||
}
|
||||
|
||||
QRadioButton::indicator::checked:disabled{
|
||||
image:url(:/qss/psblack/radiobutton_checked_disable.png);
|
||||
}
|
||||
|
||||
QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{
|
||||
padding:0px -3px 0px 0px;
|
||||
}
|
||||
|
||||
QCheckBox::indicator,QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{
|
||||
width:13px;
|
||||
height:13px;
|
||||
}
|
||||
|
||||
QCheckBox::indicator:unchecked,QGroupBox::indicator:unchecked,QTreeWidget::indicator:unchecked,QListWidget::indicator:unchecked{
|
||||
image:url(:/qss/psblack/checkbox_unchecked.png);
|
||||
}
|
||||
|
||||
QCheckBox::indicator:unchecked:disabled,QGroupBox::indicator:unchecked:disabled,QTreeWidget::indicator:unchecked:disabled,QListWidget::indicator:disabled{
|
||||
image:url(:/qss/psblack/checkbox_unchecked_disable.png);
|
||||
}
|
||||
|
||||
QCheckBox::indicator:checked,QGroupBox::indicator:checked,QTreeWidget::indicator:checked,QListWidget::indicator:checked{
|
||||
image:url(:/qss/psblack/checkbox_checked.png);
|
||||
}
|
||||
|
||||
QCheckBox::indicator:checked:disabled,QGroupBox::indicator:checked:disabled,QTreeWidget::indicator:checked:disabled,QListWidget::indicator:checked:disabled{
|
||||
image:url(:/qss/psblack/checkbox_checked_disable.png);
|
||||
}
|
||||
|
||||
QCheckBox::indicator:indeterminate,QGroupBox::indicator:indeterminate,QTreeWidget::indicator:indeterminate,QListWidget::indicator:indeterminate{
|
||||
image:url(:/qss/psblack/checkbox_parcial.png);
|
||||
}
|
||||
|
||||
QCheckBox::indicator:indeterminate:disabled,QGroupBox::indicator:indeterminate:disabled,QTreeWidget::indicator:indeterminate:disabled,QListWidget::indicator:indeterminate:disabled{
|
||||
image:url(:/qss/psblack/checkbox_parcial_disable.png);
|
||||
}
|
||||
|
||||
QTimeEdit::up-button,QDateEdit::up-button,QDateTimeEdit::up-button,QDoubleSpinBox::up-button,QSpinBox::up-button{
|
||||
image:url(:/qss/psblack/add_top.png);
|
||||
width:10px;
|
||||
height:10px;
|
||||
padding:2px 5px 0px 0px;
|
||||
}
|
||||
|
||||
QTimeEdit::down-button,QDateEdit::down-button,QDateTimeEdit::down-button,QDoubleSpinBox::down-button,QSpinBox::down-button{
|
||||
image:url(:/qss/psblack/add_bottom.png);
|
||||
width:10px;
|
||||
height:10px;
|
||||
padding:0px 5px 2px 0px;
|
||||
}
|
||||
|
||||
QTimeEdit::up-button:pressed,QDateEdit::up-button:pressed,QDateTimeEdit::up-button:pressed,QDoubleSpinBox::up-button:pressed,QSpinBox::up-button:pressed{
|
||||
top:-2px;
|
||||
}
|
||||
|
||||
QTimeEdit::down-button:pressed,QDateEdit::down-button:pressed,QDateTimeEdit::down-button:pressed,QDoubleSpinBox::down-button:pressed,QSpinBox::down-button:pressed,QSpinBox::down-button:pressed{
|
||||
bottom:-2px;
|
||||
}
|
||||
|
||||
QComboBox::down-arrow,QDateEdit[calendarPopup="true"]::down-arrow,QTimeEdit[calendarPopup="true"]::down-arrow,QDateTimeEdit[calendarPopup="true"]::down-arrow{
|
||||
image:url(:/qss/psblack/add_bottom.png);
|
||||
width:10px;
|
||||
height:10px;
|
||||
right:2px;
|
||||
}
|
||||
|
||||
QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{
|
||||
subcontrol-origin:padding;
|
||||
subcontrol-position:top right;
|
||||
width:15px;
|
||||
border-left-width:0px;
|
||||
border-left-style:solid;
|
||||
border-top-right-radius:3px;
|
||||
border-bottom-right-radius:3px;
|
||||
border-left-color:#242424;
|
||||
}
|
||||
|
||||
QComboBox::drop-down:on{
|
||||
top:1px;
|
||||
}
|
||||
|
||||
QMenuBar::item{
|
||||
color:#DCDCDC;
|
||||
background-color:#484848;
|
||||
margin:0px;
|
||||
padding:3px 10px;
|
||||
}
|
||||
|
||||
QMenu,QMenuBar,QMenu:disabled,QMenuBar:disabled{
|
||||
color:#DCDCDC;
|
||||
background-color:#484848;
|
||||
border:1px solid #242424;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
QMenu::item{
|
||||
padding:3px 20px;
|
||||
}
|
||||
|
||||
QMenu::indicator{
|
||||
width:13px;
|
||||
height:13px;
|
||||
}
|
||||
|
||||
QMenu::item:selected,QMenuBar::item:selected{
|
||||
color:#DCDCDC;
|
||||
border:0px solid #242424;
|
||||
background:#646464;
|
||||
}
|
||||
|
||||
QMenu::separator{
|
||||
height:1px;
|
||||
background:#242424;
|
||||
}
|
||||
|
||||
QProgressBar{
|
||||
min-height:10px;
|
||||
background:#484848;
|
||||
border-radius:5px;
|
||||
text-align:center;
|
||||
border:1px solid #484848;
|
||||
}
|
||||
|
||||
QProgressBar:chunk{
|
||||
border-radius:5px;
|
||||
background-color:#242424;
|
||||
}
|
||||
|
||||
QSlider::groove:horizontal{
|
||||
background:#484848;
|
||||
height:8px;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
QSlider::add-page:horizontal{
|
||||
background:#484848;
|
||||
height:8px;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
QSlider::sub-page:horizontal{
|
||||
background:#242424;
|
||||
height:8px;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal{
|
||||
width:13px;
|
||||
margin-top:-3px;
|
||||
margin-bottom:-3px;
|
||||
border-radius:6px;
|
||||
background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #444444,stop:0.8 #242424);
|
||||
}
|
||||
|
||||
QSlider::groove:vertical{
|
||||
width:8px;
|
||||
border-radius:4px;
|
||||
background:#484848;
|
||||
}
|
||||
|
||||
QSlider::add-page:vertical{
|
||||
width:8px;
|
||||
border-radius:4px;
|
||||
background:#484848;
|
||||
}
|
||||
|
||||
QSlider::sub-page:vertical{
|
||||
width:8px;
|
||||
border-radius:4px;
|
||||
background:#242424;
|
||||
}
|
||||
|
||||
QSlider::handle:vertical{
|
||||
height:14px;
|
||||
margin-left:-3px;
|
||||
margin-right:-3px;
|
||||
border-radius:6px;
|
||||
background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #444444,stop:0.8 #242424);
|
||||
}
|
||||
|
||||
QScrollBar:horizontal{
|
||||
background:#484848;
|
||||
padding:0px;
|
||||
border-radius:6px;
|
||||
max-height:12px;
|
||||
}
|
||||
|
||||
QScrollBar::handle:horizontal{
|
||||
background:#242424;
|
||||
min-width:50px;
|
||||
border-radius:6px;
|
||||
}
|
||||
|
||||
QScrollBar::handle:horizontal:hover{
|
||||
background:#00BB9E;
|
||||
}
|
||||
|
||||
QScrollBar::handle:horizontal:pressed{
|
||||
background:#00BB9E;
|
||||
}
|
||||
|
||||
QScrollBar::add-page:horizontal{
|
||||
background:none;
|
||||
}
|
||||
|
||||
QScrollBar::sub-page:horizontal{
|
||||
background:none;
|
||||
}
|
||||
|
||||
QScrollBar::add-line:horizontal{
|
||||
background:none;
|
||||
}
|
||||
|
||||
QScrollBar::sub-line:horizontal{
|
||||
background:none;
|
||||
}
|
||||
|
||||
QScrollBar:vertical{
|
||||
background:#484848;
|
||||
padding:0px;
|
||||
border-radius:6px;
|
||||
max-width:12px;
|
||||
}
|
||||
|
||||
QScrollBar::handle:vertical{
|
||||
background:#242424;
|
||||
min-height:50px;
|
||||
border-radius:6px;
|
||||
}
|
||||
|
||||
QScrollBar::handle:vertical:hover{
|
||||
background:#00BB9E;
|
||||
}
|
||||
|
||||
QScrollBar::handle:vertical:pressed{
|
||||
background:#00BB9E;
|
||||
}
|
||||
|
||||
QScrollBar::add-page:vertical{
|
||||
background:none;
|
||||
}
|
||||
|
||||
QScrollBar::sub-page:vertical{
|
||||
background:none;
|
||||
}
|
||||
|
||||
QScrollBar::add-line:vertical{
|
||||
background:none;
|
||||
}
|
||||
|
||||
QScrollBar::sub-line:vertical{
|
||||
background:none;
|
||||
}
|
||||
|
||||
QScrollArea{
|
||||
border:0px;
|
||||
}
|
||||
|
||||
QTreeView,QListView,QTableView,QTabWidget::pane{
|
||||
border:1px solid #242424;
|
||||
selection-background-color:#646464;
|
||||
selection-color:#DCDCDC;
|
||||
alternate-background-color:#525252;
|
||||
gridline-color:#242424;
|
||||
}
|
||||
|
||||
QTreeView::branch:closed:has-children{
|
||||
margin:4px;
|
||||
border-image:url(:/qss/psblack/branch_open.png);
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children{
|
||||
margin:4px;
|
||||
border-image:url(:/qss/psblack/branch_close.png);
|
||||
}
|
||||
|
||||
QTreeView,QListView,QTableView,QSplitter::handle,QTreeView::branch{
|
||||
background:#444444;
|
||||
}
|
||||
|
||||
QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{
|
||||
color:#DCDCDC;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838);
|
||||
}
|
||||
|
||||
QTableView::item:hover,QListView::item:hover,QTreeView::item:hover,QHeaderView{
|
||||
color:#DCDCDC;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
||||
}
|
||||
|
||||
QTableView::item,QListView::item,QTreeView::item{
|
||||
padding:1px;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
QHeaderView::section,QTableCornerButton:section{
|
||||
padding:3px;
|
||||
margin:0px;
|
||||
color:#DCDCDC;
|
||||
border:1px solid #242424;
|
||||
border-left-width:0px;
|
||||
border-right-width:1px;
|
||||
border-top-width:0px;
|
||||
border-bottom-width:1px;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
||||
}
|
||||
|
||||
QTabBar::tab{
|
||||
border:1px solid #242424;
|
||||
color:#DCDCDC;
|
||||
margin:0px;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
||||
}
|
||||
|
||||
QTabBar::tab:selected,QTabBar::tab:hover{
|
||||
border-style:solid;
|
||||
border-color:#00BB9E;
|
||||
background:#444444;
|
||||
}
|
||||
|
||||
QTabBar::tab:top,QTabBar::tab:bottom{
|
||||
padding:3px 8px 3px 8px;
|
||||
}
|
||||
|
||||
QTabBar::tab:left,QTabBar::tab:right{
|
||||
padding:8px 3px 8px 3px;
|
||||
}
|
||||
|
||||
QTabBar::tab:top:selected,QTabBar::tab:top:hover{
|
||||
border-width:2px 0px 0px 0px;
|
||||
}
|
||||
|
||||
QTabBar::tab:right:selected,QTabBar::tab:right:hover{
|
||||
border-width:0px 0px 0px 2px;
|
||||
}
|
||||
|
||||
QTabBar::tab:bottom:selected,QTabBar::tab:bottom:hover{
|
||||
border-width:0px 0px 2px 0px;
|
||||
}
|
||||
|
||||
QTabBar::tab:left:selected,QTabBar::tab:left:hover{
|
||||
border-width:0px 2px 0px 0px;
|
||||
}
|
||||
|
||||
QTabBar::tab:first:top:selected,QTabBar::tab:first:top:hover,QTabBar::tab:first:bottom:selected,QTabBar::tab:first:bottom:hover{
|
||||
border-left-width:1px;
|
||||
border-left-color:#242424;
|
||||
}
|
||||
|
||||
QTabBar::tab:first:left:selected,QTabBar::tab:first:left:hover,QTabBar::tab:first:right:selected,QTabBar::tab:first:right:hover{
|
||||
border-top-width:1px;
|
||||
border-top-color:#242424;
|
||||
}
|
||||
|
||||
QTabBar::tab:last:top:selected,QTabBar::tab:last:top:hover,QTabBar::tab:last:bottom:selected,QTabBar::tab:last:bottom:hover{
|
||||
border-right-width:1px;
|
||||
border-right-color:#242424;
|
||||
}
|
||||
|
||||
QTabBar::tab:last:left:selected,QTabBar::tab:last:left:hover,QTabBar::tab:last:right:selected,QTabBar::tab:last:right:hover{
|
||||
border-bottom-width:1px;
|
||||
border-bottom-color:#242424;
|
||||
}
|
||||
|
||||
QStatusBar::item{
|
||||
border:0px solid #484848;
|
||||
border-radius:3px;
|
||||
}
|
||||
|
||||
QToolBox::tab,QGroupBox#gboxDevicePanel,QGroupBox#gboxDeviceTitle,QFrame#gboxDevicePanel,QFrame#gboxDeviceTitle{
|
||||
padding:3px;
|
||||
border-radius:5px;
|
||||
color:#DCDCDC;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838);
|
||||
}
|
||||
|
||||
QToolTip{
|
||||
border:0px solid #DCDCDC;
|
||||
padding:1px;
|
||||
color:#DCDCDC;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838);
|
||||
}
|
||||
|
||||
QToolBox::tab:selected{
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
||||
}
|
||||
|
||||
QPrintPreviewDialog QToolButton{
|
||||
border:0px solid #DCDCDC;
|
||||
border-radius:0px;
|
||||
margin:0px;
|
||||
padding:3px;
|
||||
background:none;
|
||||
}
|
||||
|
||||
QColorDialog QPushButton,QFileDialog QPushButton{
|
||||
min-width:80px;
|
||||
}
|
||||
|
||||
QToolButton#qt_calendar_prevmonth{
|
||||
icon-size:0px;
|
||||
min-width:20px;
|
||||
image:url(:/qss/psblack/calendar_prevmonth.png);
|
||||
}
|
||||
|
||||
QToolButton#qt_calendar_nextmonth{
|
||||
icon-size:0px;
|
||||
min-width:20px;
|
||||
image:url(:/qss/psblack/calendar_nextmonth.png);
|
||||
}
|
||||
|
||||
QToolButton#qt_calendar_prevmonth,QToolButton#qt_calendar_nextmonth,QToolButton#qt_calendar_monthbutton,QToolButton#qt_calendar_yearbutton{
|
||||
border:0px solid #DCDCDC;
|
||||
border-radius:3px;
|
||||
margin:3px 3px 3px 3px;
|
||||
padding:3px;
|
||||
background:none;
|
||||
}
|
||||
|
||||
QToolButton#qt_calendar_prevmonth:hover,QToolButton#qt_calendar_nextmonth:hover,QToolButton#qt_calendar_monthbutton:hover,QToolButton#qt_calendar_yearbutton:hover,QToolButton#qt_calendar_prevmonth:pressed,QToolButton#qt_calendar_nextmonth:pressed,QToolButton#qt_calendar_monthbutton:pressed,QToolButton#qt_calendar_yearbutton:pressed{
|
||||
border:1px solid #242424;
|
||||
}
|
||||
|
||||
QCalendarWidget QSpinBox#qt_calendar_yearedit{
|
||||
margin:2px;
|
||||
}
|
||||
|
||||
QCalendarWidget QToolButton::menu-indicator{
|
||||
image:None;
|
||||
}
|
||||
|
||||
QCalendarWidget QTableView{
|
||||
border-width:0px;
|
||||
}
|
||||
|
||||
QCalendarWidget QWidget#qt_calendar_navigationbar{
|
||||
border:1px solid #242424;
|
||||
border-width:1px 1px 0px 1px;
|
||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838);
|
||||
}
|
||||
|
||||
QComboBox QAbstractItemView::item{
|
||||
min-height:20px;
|
||||
min-width:10px;
|
||||
}
|
||||
|
||||
QTableView[model="true"]::item{
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
QTableView QLineEdit,QTableView QComboBox,QTableView QSpinBox,QTableView QDoubleSpinBox,QTableView QDateEdit,QTableView QTimeEdit,QTableView QDateTimeEdit{
|
||||
border-width:0px;
|
||||
border-radius:0px;
|
||||
}
|
||||
|
||||
QTableView QLineEdit:focus,QTableView QComboBox:focus,QTableView QSpinBox:focus,QTableView QDoubleSpinBox:focus,QTableView QDateEdit:focus,QTableView QTimeEdit:focus,QTableView QDateTimeEdit:focus{
|
||||
border-width:0px;
|
||||
border-radius:0px;
|
||||
}
|
||||
|
||||
QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{
|
||||
background:#444444;
|
||||
}
|
||||
|
||||
QTabWidget::pane:top{top:-1px;}
|
||||
QTabWidget::pane:bottom{bottom:-1px;}
|
||||
QTabWidget::pane:left{right:-1px;}
|
||||
QTabWidget::pane:right{left:-1px;}
|
||||
|
||||
QDialog {
|
||||
background-color:#444444;
|
||||
color:#DCDCDC;
|
||||
}
|
||||
|
||||
QDialogButtonBox > QPushButton {
|
||||
min-width:50px;
|
||||
}
|
||||
|
||||
*:disabled,QMenu::item:disabled{
|
||||
background:#444444;
|
||||
border-color:#484848;
|
||||
color:#242424;
|
||||
}
|
||||
|
||||
/*TextColor:#DCDCDC*/
|
||||
/*PanelColor:#444444*/
|
||||
/*BorderColor:#242424*/
|
||||
/*NormalColorStart:#484848*/
|
||||
/*NormalColorEnd:#383838*/
|
||||
/*DarkColorStart:#646464*/
|
||||
/*DarkColorEnd:#525252*/
|
||||
/*HighColor:#00BB9E*/
|
||||
BIN
unitconversion/other/qss/psblack/add_bottom.png
Normal file
|
After Width: | Height: | Size: 201 B |
BIN
unitconversion/other/qss/psblack/add_left.png
Normal file
|
After Width: | Height: | Size: 233 B |
BIN
unitconversion/other/qss/psblack/add_right.png
Normal file
|
After Width: | Height: | Size: 235 B |
BIN
unitconversion/other/qss/psblack/add_top.png
Normal file
|
After Width: | Height: | Size: 197 B |
BIN
unitconversion/other/qss/psblack/branch_close.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
unitconversion/other/qss/psblack/branch_open.png
Normal file
|
After Width: | Height: | Size: 275 B |
BIN
unitconversion/other/qss/psblack/calendar_nextmonth.png
Normal file
|
After Width: | Height: | Size: 318 B |
BIN
unitconversion/other/qss/psblack/calendar_prevmonth.png
Normal file
|
After Width: | Height: | Size: 314 B |
BIN
unitconversion/other/qss/psblack/checkbox_checked.png
Normal file
|
After Width: | Height: | Size: 307 B |
BIN
unitconversion/other/qss/psblack/checkbox_checked_disable.png
Normal file
|
After Width: | Height: | Size: 338 B |
BIN
unitconversion/other/qss/psblack/checkbox_parcial.png
Normal file
|
After Width: | Height: | Size: 188 B |
BIN
unitconversion/other/qss/psblack/checkbox_parcial_disable.png
Normal file
|
After Width: | Height: | Size: 251 B |
BIN
unitconversion/other/qss/psblack/checkbox_unchecked.png
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
unitconversion/other/qss/psblack/checkbox_unchecked_disable.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
unitconversion/other/qss/psblack/radiobutton_checked.png
Normal file
|
After Width: | Height: | Size: 756 B |
BIN
unitconversion/other/qss/psblack/radiobutton_checked_disable.png
Normal file
|
After Width: | Height: | Size: 932 B |
BIN
unitconversion/other/qss/psblack/radiobutton_unchecked.png
Normal file
|
After Width: | Height: | Size: 564 B |
|
After Width: | Height: | Size: 715 B |
BIN
unitconversion/snap.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
33
unitconversion/unitconversion.pro
Normal file
@@ -0,0 +1,33 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2020-07-16T17:38:15
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = unitConversionOfPressure
|
||||
|
||||
RC_ICONS = other/logo.ico
|
||||
|
||||
TEMPLATE = app
|
||||
MOC_DIR = temp/moc
|
||||
RCC_DIR = temp/rcc
|
||||
UI_DIR = temp/ui
|
||||
OBJECTS_DIR = temp/obj
|
||||
DESTDIR = $$PWD/../bin
|
||||
|
||||
RESOURCES += other/main.qrc
|
||||
RESOURCES += other/qss.qrc
|
||||
CONFIG += warn_off
|
||||
|
||||
SOURCES += main.cpp
|
||||
|
||||
include ($$PWD/api/api.pri)
|
||||
include ($$PWD/form/form.pri)
|
||||
|
||||
INCLUDEPATH += $$PWD
|
||||
INCLUDEPATH += $$PWD/api
|
||||
INCLUDEPATH += $$PWD/form
|
||||