更新代码
parent
a834f26a5c
commit
fa1ee7d535
|
@ -1,5 +1,5 @@
|
|||
#include "appdata.h"
|
||||
#include "quihelper.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
QString AppData::TitleFlag = "(QQ: 517216493 WX: feiyangqingyun)";
|
||||
int AppData::RowHeight = 25;
|
||||
|
@ -10,7 +10,7 @@ int AppData::FormHeight = 750;
|
|||
void AppData::checkRatio()
|
||||
{
|
||||
//根据分辨率设定宽高
|
||||
int width = QUIHelper::deskWidth();
|
||||
int width = QtHelper::deskWidth();
|
||||
if (width >= 1440) {
|
||||
RowHeight = RowHeight < 25 ? 25 : RowHeight;
|
||||
RightWidth = RightWidth < 220 ? 220 : RightWidth;
|
|
@ -33,17 +33,27 @@ bool AppInit::eventFilter(QObject *watched, QEvent *event)
|
|||
static QPoint mousePoint;
|
||||
static bool mousePressed = false;
|
||||
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->type() == QEvent::MouseButtonPress) {
|
||||
int type = event->type();
|
||||
QPoint p;
|
||||
QMouseEvent *mouseEvent = (QMouseEvent *)(event);
|
||||
if (mouseEvent) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||
p = mouseEvent->globalPos();
|
||||
#else
|
||||
p = mouseEvent->globalPosition().toPoint();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (type == QEvent::MouseButtonPress) {
|
||||
if (mouseEvent->button() == Qt::LeftButton) {
|
||||
mousePressed = true;
|
||||
mousePoint = mouseEvent->globalPos() - w->pos();
|
||||
mousePoint = p - w->pos();
|
||||
}
|
||||
} else if (mouseEvent->type() == QEvent::MouseButtonRelease) {
|
||||
} else if (type == QEvent::MouseButtonRelease) {
|
||||
mousePressed = false;
|
||||
} else if (mouseEvent->type() == QEvent::MouseMove) {
|
||||
} else if (type == QEvent::MouseMove) {
|
||||
if (mousePressed) {
|
||||
w->move(mouseEvent->globalPos() - mousePoint);
|
||||
w->move(p - mousePoint);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
QT += network
|
||||
QT *= network
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
lessThan(QT_MAJOR_VERSION, 6) {
|
||||
android {QT += androidextras}
|
||||
android {QT *= androidextras}
|
||||
} else {
|
||||
QT += core-private
|
||||
QT *= core-private
|
||||
}}
|
||||
|
||||
#指定编译产生的文件分门别类放到对应目录
|
||||
|
@ -13,13 +13,15 @@ UI_DIR = temp/ui
|
|||
OBJECTS_DIR = temp/obj
|
||||
|
||||
#指定编译生成的可执行文件放到源码上一级目录下的bin目录
|
||||
!android {
|
||||
!wasm {
|
||||
!android:!ios {
|
||||
DESTDIR = $$PWD/../bin
|
||||
}}
|
||||
}
|
||||
|
||||
#把所有警告都关掉眼不见为净
|
||||
CONFIG += warn_off
|
||||
#QMAKE_CXXFLAGS_WARN_ON -= -w34100
|
||||
#QMAKE_CXXFLAGS *= -Wno-unused-parameter
|
||||
|
||||
#开启大资源支持
|
||||
CONFIG += resources_big
|
||||
#开启后会将打印信息用控制台输出
|
||||
|
@ -27,7 +29,7 @@ CONFIG += resources_big
|
|||
#开启后不会生成空的 debug release 目录
|
||||
#CONFIG -= debug_and_release
|
||||
|
||||
#引入全志H3芯片依赖
|
||||
#引入全志H3芯片依赖(不需要的用户可以删除)
|
||||
include ($$PWD/h3.pri)
|
||||
#将当前目录加入到头文件路径
|
||||
INCLUDEPATH += $$PWD
|
||||
|
@ -47,8 +49,8 @@ SOURCES += $$PWD/customstyle.cpp
|
|||
HEADERS += $$PWD/iconhelper.h
|
||||
SOURCES += $$PWD/iconhelper.cpp
|
||||
|
||||
HEADERS += $$PWD/quihelper.h
|
||||
SOURCES += $$PWD/quihelper.cpp
|
||||
HEADERS += $$PWD/qthelper.h
|
||||
SOURCES += $$PWD/qthelper.cpp
|
||||
|
||||
#可以指定不加载对应的资源文件
|
||||
!contains(DEFINES, no_qrc_image) {
|
||||
|
@ -62,3 +64,9 @@ RESOURCES += $$PWD/qrc/qm.qrc
|
|||
!contains(DEFINES, no_qrc_font) {
|
||||
RESOURCES += $$PWD/qrc/font.qrc
|
||||
}
|
||||
|
||||
wasm {
|
||||
HEADERS += $$PWD/wasmhelper.h
|
||||
SOURCES += $$PWD/wasmhelper.cpp
|
||||
RESOURCES += $$PWD/qrc/wasm.qrc
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1,5 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>font/DroidSansFallback.ttf</file>
|
||||
</qresource>
|
||||
</RCC>
|
File diff suppressed because it is too large
Load Diff
|
@ -1,15 +1,17 @@
|
|||
#ifndef QUIHELPER2_H
|
||||
#define QUIHELPER2_H
|
||||
#ifndef QTHELPER_H
|
||||
#define QTHELPER_H
|
||||
|
||||
#include "head.h"
|
||||
|
||||
class QUIHelper
|
||||
class QtHelper
|
||||
{
|
||||
public:
|
||||
//获取当前鼠标所在屏幕索引/区域尺寸/缩放系数
|
||||
//获取所有屏幕区域/当前鼠标所在屏幕索引/区域尺寸/缩放系数
|
||||
static QList<QRect> getScreenRects(bool available = true);
|
||||
static int getScreenIndex();
|
||||
static QRect getScreenRect(bool available = true);
|
||||
static qreal getScreenRatio(bool devicePixel = false);
|
||||
static qreal getScreenRatio(int index = -1, bool devicePixel = false);
|
||||
|
||||
//矫正当前鼠标所在屏幕居中尺寸
|
||||
static QRect checkCenterRect(QRect &rect, bool available = true);
|
||||
|
||||
|
@ -24,12 +26,20 @@ public:
|
|||
static void setFormInCenter(QWidget *form);
|
||||
static void showForm(QWidget *form);
|
||||
|
||||
//程序文件名称+当前所在路径
|
||||
//程序文件名称和当前所在路径
|
||||
static QString appName();
|
||||
static QString appPath();
|
||||
|
||||
//程序最前面获取应用程序路径和名称
|
||||
static void getCurrentInfo(char *argv[], QString &path, QString &name);
|
||||
//程序最前面读取配置文件节点的值
|
||||
static QString getIniValue(const QString &fileName, const QString &key);
|
||||
static QString getIniValue(char *argv[], const QString &key, const QString &dir = QString(), const QString &file = QString());
|
||||
|
||||
//获取本地网卡IP集合
|
||||
static QStringList getLocalIPs();
|
||||
//添加网卡集合并根据默认值设置当前项
|
||||
static void initLocalIPs(QComboBox *cbox, const QString &defaultIP, bool local127 = true);
|
||||
|
||||
//获取内置颜色集合
|
||||
static QList<QColor> colors;
|
||||
|
@ -53,8 +63,10 @@ public:
|
|||
static QString getUuid();
|
||||
//校验目录
|
||||
static void checkPath(const QString &dirName);
|
||||
//延时
|
||||
static void sleep(int msec);
|
||||
//通用延时函数(支持Qt4 Qt5 Qt6)
|
||||
static void sleep(int msec, bool exec = true);
|
||||
//检查程序是否已经运行
|
||||
static void checkRun();
|
||||
|
||||
//设置Qt自带样式
|
||||
static void setStyle();
|
||||
|
@ -74,9 +86,24 @@ public:
|
|||
//一次性设置所有包括编码样式字体等
|
||||
static void initAll(bool utf8 = true, bool style = true, int fontSize = 13);
|
||||
//初始化main函数最前面执行的一段代码
|
||||
static void initMain(bool desktopSettingsAware = true, bool useOpenGLES = false);
|
||||
static void initMain(bool desktopSettingsAware = false, bool use96Dpi = true, bool logCritical = true);
|
||||
//初始化opengl类型(1=AA_UseDesktopOpenGL 2=AA_UseOpenGLES 3=AA_UseSoftwareOpenGL)
|
||||
static void initOpenGL(quint8 type = 0, bool checkCardEnable = false, bool checkVirtualSystem = false);
|
||||
|
||||
//读取qss文件获取样式表内容
|
||||
static QString getStyle(const QString &qssFile);
|
||||
//设置qss文件到全局样式
|
||||
static void setStyle(const QString &qssFile);
|
||||
|
||||
//执行命令行返回执行结果
|
||||
static QString doCmd(const QString &program, const QStringList &arguments, int timeout = 1000);
|
||||
//获取显卡是否被禁用
|
||||
static bool isVideoCardEnable();
|
||||
//获取是否在虚拟机环境
|
||||
static bool isVirtualSystem();
|
||||
|
||||
//插入消息
|
||||
static bool replaceCRLF;
|
||||
static QVector<int> msgTypes;
|
||||
static QVector<QString> msgKeys;
|
||||
static QVector<QColor> msgColors;
|
||||
|
@ -147,6 +174,15 @@ public:
|
|||
static QString getTimeString(QElapsedTimer timer);
|
||||
//文件大小转 KB MB GB TB
|
||||
static QString getSizeString(quint64 size);
|
||||
|
||||
//设置系统时间
|
||||
static void setSystemDateTime(const QString &year, const QString &month, const QString &day,
|
||||
const QString &hour, const QString &min, const QString &sec);
|
||||
//设置开机自启动
|
||||
static void runWithSystem(bool autoRun = true);
|
||||
static void runWithSystem(const QString &fileName, const QString &filePath, bool autoRun = true);
|
||||
//启动运行程序(已经在运行则不启动)
|
||||
static void runBin(const QString &path, const QString &name);
|
||||
};
|
||||
|
||||
#endif // QUIHELPER2_H
|
||||
#endif // QTHELPER_H
|
|
@ -0,0 +1,107 @@
|
|||
#include "wasmhelper.h"
|
||||
#include "qrect.h"
|
||||
#include "emscripten.h"
|
||||
#include "emscripten/html5.h"
|
||||
|
||||
//弹出js信息框
|
||||
EM_JS(void, showMessageJs, (const char *text), {
|
||||
alert(UTF8ToString(text));
|
||||
})
|
||||
|
||||
//弹出js输入框
|
||||
EM_JS(const char *, getInputJs, (const char *title, const char *defaultText), {
|
||||
var result = prompt(UTF8ToString(title), UTF8ToString(defaultText));
|
||||
if (!result)
|
||||
{
|
||||
result = "";
|
||||
}
|
||||
return stringToNewUTF8(result);
|
||||
})
|
||||
|
||||
//打开iframe窗体
|
||||
EM_JS(void, openIframeJs, (const char *flag, const char *url, const char *style), {
|
||||
//如果存在则只移动位置
|
||||
var id = UTF8ToString(flag);
|
||||
var iframe = document.getElementById(id);
|
||||
if (iframe)
|
||||
{
|
||||
iframe.style = UTF8ToString(style);
|
||||
return;
|
||||
}
|
||||
|
||||
iframe = document.createElement('iframe');
|
||||
iframe.id = id;
|
||||
iframe.src = UTF8ToString(url);
|
||||
iframe.style = UTF8ToString(style);
|
||||
iframe.scrolling = 'no';
|
||||
document.body.appendChild(iframe);
|
||||
})
|
||||
|
||||
//加载iframe窗体
|
||||
EM_JS(void, reloadIframeJs, (const char *flag, const char *url), {
|
||||
var iframe = document.getElementById(UTF8ToString(flag));
|
||||
if (iframe)
|
||||
{
|
||||
iframe.src = UTF8ToString(url);
|
||||
}
|
||||
})
|
||||
|
||||
//移动iframe窗体
|
||||
EM_JS(void, moveIframeJs, (const char *flag, const char *style), {
|
||||
var iframe = document.getElementById(UTF8ToString(flag));
|
||||
if (iframe)
|
||||
{
|
||||
iframe.style = UTF8ToString(style);
|
||||
}
|
||||
})
|
||||
|
||||
//隐藏iframe窗体
|
||||
EM_JS(void, hideIframeJs, (const char *flag), {
|
||||
var iframe = document.getElementById(UTF8ToString(flag));
|
||||
if (iframe)
|
||||
{
|
||||
iframe.style = "display:none";
|
||||
}
|
||||
})
|
||||
|
||||
void WasmHelper::showMessage(const QString &text)
|
||||
{
|
||||
showMessageJs(text.toUtf8().constData());
|
||||
}
|
||||
|
||||
QString WasmHelper::getInput(const QString &title, const QString &text)
|
||||
{
|
||||
return getInputJs(title.toUtf8().constData(), text.toUtf8().constData());
|
||||
}
|
||||
|
||||
QString WasmHelper::getIframeStyle(const QRect &rect)
|
||||
{
|
||||
QString style = QString("border:0px;position:absolute;margin:0px;padding:0px;z-index:10000;opacity:1.0;");
|
||||
style += QString("left:%1px;").arg(rect.x());
|
||||
style += QString("top:%1px;").arg(rect.y());
|
||||
style += QString("width:%1px;").arg(rect.width());
|
||||
style += QString("height:%1px;").arg(rect.height());
|
||||
return style;
|
||||
}
|
||||
|
||||
void WasmHelper::openIframe(const QString &flag, const QString &url, const QRect &rect)
|
||||
{
|
||||
QString style = getIframeStyle(rect);
|
||||
openIframeJs(flag.toUtf8().constData(), url.toUtf8().constData(), style.toUtf8().constData());
|
||||
}
|
||||
|
||||
void WasmHelper::reloadIframe(const QString &flag, const QString &url)
|
||||
{
|
||||
reloadIframeJs(flag.toUtf8().constData(), url.toUtf8().constData());
|
||||
}
|
||||
|
||||
void WasmHelper::moveIframe(const QString &flag, const QRect &rect)
|
||||
{
|
||||
QString style = getIframeStyle(rect);
|
||||
moveIframeJs(flag.toUtf8().constData(), style.toUtf8().constData());
|
||||
}
|
||||
|
||||
void WasmHelper::hideIframe(const QString &flag)
|
||||
{
|
||||
hideIframeJs(flag.toUtf8().constData());
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef WASMHELPER_H
|
||||
#define WASMHELPER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class WasmHelper
|
||||
{
|
||||
public:
|
||||
//弹出js信息框
|
||||
static void showMessage(const QString &text);
|
||||
//弹出js输入框
|
||||
static QString getInput(const QString &title, const QString &text);
|
||||
|
||||
//获取iframe样式
|
||||
static QString getIframeStyle(const QRect &rect);
|
||||
//打开iframe窗体
|
||||
static void openIframe(const QString &flag, const QString &url, const QRect &rect);
|
||||
//重新加载iframe窗体
|
||||
static void reloadIframe(const QString &flag, const QString &url);
|
||||
//移动iframe窗体
|
||||
static void moveIframe(const QString &flag, const QRect &rect);
|
||||
//隐藏iframe窗体
|
||||
static void hideIframe(const QString &flag);
|
||||
};
|
||||
|
||||
#endif // WASMHELPER_H
|
|
@ -1,7 +1,7 @@
|
|||
#include "frmmain.h"
|
||||
#include "ui_frmmain.h"
|
||||
#include "iconhelper.h"
|
||||
#include "quihelper.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
frmMain::frmMain(QWidget *parent) : QDialog(parent), ui(new Ui::frmMain)
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ bool frmMain::eventFilter(QObject *watched, QEvent *event)
|
|||
void frmMain::initForm()
|
||||
{
|
||||
//设置无边框
|
||||
QUIHelper::setFramelessForm(this);
|
||||
QtHelper::setFramelessForm(this);
|
||||
//设置图标
|
||||
IconHelper::setIcon(ui->labIco, 0xf099, 35);
|
||||
IconHelper::setIcon(ui->btnMenu_Min, 0xf068);
|
||||
|
@ -125,7 +125,7 @@ void frmMain::on_btnMenu_Max_clicked()
|
|||
this->setGeometry(location);
|
||||
} else {
|
||||
location = this->geometry();
|
||||
this->setGeometry(QUIHelper::getScreenRect());
|
||||
this->setGeometry(QtHelper::getScreenRect());
|
||||
}
|
||||
|
||||
this->setProperty("canMove", max);
|
||||
|
|
|
@ -1,29 +1,21 @@
|
|||
#include "frmmain.h"
|
||||
#include "appinit.h"
|
||||
#include "quihelper.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QUIHelper::initMain();
|
||||
QtHelper::initMain();
|
||||
QApplication a(argc, argv);
|
||||
AppInit::Instance()->start();
|
||||
|
||||
QUIHelper::setFont();
|
||||
QUIHelper::setCode();
|
||||
|
||||
QtHelper::setFont();
|
||||
QtHelper::setCode();
|
||||
//加载样式表
|
||||
QFile file(":/qss/blacksoft.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();
|
||||
}
|
||||
QtHelper::setStyle(":/qss/blacksoft.css");
|
||||
|
||||
frmMain w;
|
||||
w.resize(800, 600);
|
||||
QUIHelper::setFormInCenter(&w);
|
||||
QtHelper::setFormInCenter(&w);
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
|
|
|
@ -13,6 +13,4 @@ RESOURCES += $$PWD/../core_qss/qss.qrc
|
|||
INCLUDEPATH += $$PWD
|
||||
INCLUDEPATH += $$PWD/form
|
||||
include ($$PWD/form/form.pri)
|
||||
|
||||
INCLUDEPATH += $$PWD/../core_base
|
||||
include ($$PWD/../core_base/core_base.pri)
|
||||
include ($$PWD/../core_helper/core_helper.pri)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "frmmain.h"
|
||||
#include "ui_frmmain.h"
|
||||
#include "iconhelper.h"
|
||||
#include "quihelper.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
frmMain::frmMain(QWidget *parent) : QWidget(parent), ui(new Ui::frmMain)
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ void frmMain::getQssColor(const QString &qss, QString &textColor, QString &panel
|
|||
void frmMain::initForm()
|
||||
{
|
||||
//设置无边框
|
||||
QUIHelper::setFramelessForm(this);
|
||||
QtHelper::setFramelessForm(this);
|
||||
//设置图标
|
||||
IconHelper::setIcon(ui->labIco, 0xf073, 30);
|
||||
IconHelper::setIcon(ui->btnMenu_Min, 0xf068);
|
||||
|
@ -99,14 +99,11 @@ void frmMain::initForm()
|
|||
void frmMain::initStyle()
|
||||
{
|
||||
//加载样式表
|
||||
QString qss;
|
||||
QFile file(":/qss/blacksoft.css");
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
qss = QLatin1String(file.readAll());
|
||||
QString qss = QtHelper::getStyle(":/qss/blacksoft.css");
|
||||
if (!qss.isEmpty()) {
|
||||
QString paletteColor = qss.mid(20, 7);
|
||||
qApp->setPalette(QPalette(paletteColor));
|
||||
qApp->setPalette(QPalette(QColor(paletteColor)));
|
||||
qApp->setStyleSheet(qss);
|
||||
file.close();
|
||||
}
|
||||
|
||||
//先从样式表中取出对应的颜色
|
||||
|
@ -149,8 +146,7 @@ void frmMain::initLeftMain()
|
|||
iconsMain << 0xf030 << 0xf03e << 0xf247;
|
||||
btnsMain << ui->tbtnMain1 << ui->tbtnMain2 << ui->tbtnMain3;
|
||||
|
||||
int count = btnsMain.count();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
for (int i = 0; i < btnsMain.count(); ++i) {
|
||||
QToolButton *btn = (QToolButton *)btnsMain.at(i);
|
||||
btn->setCheckable(true);
|
||||
btn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||
|
@ -174,8 +170,7 @@ void frmMain::initLeftConfig()
|
|||
iconsConfig << 0xf031 << 0xf036 << 0xf249 << 0xf055 << 0xf05a << 0xf249;
|
||||
btnsConfig << ui->tbtnConfig1 << ui->tbtnConfig2 << ui->tbtnConfig3 << ui->tbtnConfig4 << ui->tbtnConfig5 << ui->tbtnConfig6;
|
||||
|
||||
int count = btnsConfig.count();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
for (int i = 0; i < btnsConfig.count(); ++i) {
|
||||
QToolButton *btn = (QToolButton *)btnsConfig.at(i);
|
||||
btn->setCheckable(true);
|
||||
btn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
|
@ -198,9 +193,7 @@ void frmMain::leftMainClick()
|
|||
{
|
||||
QAbstractButton *b = (QAbstractButton *)sender();
|
||||
QString name = b->text();
|
||||
|
||||
int count = btnsMain.count();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
for (int i = 0; i < btnsMain.count(); ++i) {
|
||||
QAbstractButton *btn = btnsMain.at(i);
|
||||
btn->setChecked(btn == b);
|
||||
}
|
||||
|
@ -212,9 +205,7 @@ void frmMain::leftConfigClick()
|
|||
{
|
||||
QToolButton *b = (QToolButton *)sender();
|
||||
QString name = b->text();
|
||||
|
||||
int count = btnsConfig.count();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
for (int i = 0; i < btnsConfig.count(); ++i) {
|
||||
QAbstractButton *btn = btnsConfig.at(i);
|
||||
btn->setChecked(btn == b);
|
||||
}
|
||||
|
@ -236,7 +227,7 @@ void frmMain::on_btnMenu_Max_clicked()
|
|||
this->setGeometry(location);
|
||||
} else {
|
||||
location = this->geometry();
|
||||
this->setGeometry(QUIHelper::getScreenRect());
|
||||
this->setGeometry(QtHelper::getScreenRect());
|
||||
}
|
||||
|
||||
this->setProperty("canMove", max);
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
#include "frmmain.h"
|
||||
#include "appinit.h"
|
||||
#include "quihelper.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QUIHelper::initMain();
|
||||
QtHelper::initMain();
|
||||
QApplication a(argc, argv);
|
||||
AppInit::Instance()->start();
|
||||
|
||||
QUIHelper::setFont();
|
||||
QUIHelper::setCode();
|
||||
QtHelper::setFont();
|
||||
QtHelper::setCode();
|
||||
|
||||
frmMain w;
|
||||
QUIHelper::setFormInCenter(&w);
|
||||
QtHelper::setFormInCenter(&w);
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
|
|
|
@ -13,6 +13,4 @@ RESOURCES += $$PWD/../core_qss/qss.qrc
|
|||
INCLUDEPATH += $$PWD
|
||||
INCLUDEPATH += $$PWD/form
|
||||
include ($$PWD/form/form.pri)
|
||||
|
||||
INCLUDEPATH += $$PWD/../core_base
|
||||
include ($$PWD/../core_base/core_base.pri)
|
||||
include ($$PWD/../core_helper/core_helper.pri)
|
||||
|
|
|
@ -1,28 +1,20 @@
|
|||
#include "frmmain.h"
|
||||
#include "appinit.h"
|
||||
#include "quihelper.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QUIHelper::initMain();
|
||||
QtHelper::initMain();
|
||||
QApplication a(argc, argv);
|
||||
AppInit::Instance()->start();
|
||||
|
||||
QUIHelper::setFont();
|
||||
QUIHelper::setCode();
|
||||
|
||||
QtHelper::setFont();
|
||||
QtHelper::setCode();
|
||||
//加载样式表
|
||||
QFile file(":/qss/blacksoft.css");
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
QString qss = QLatin1String(file.readAll());
|
||||
QString paletteColor = qss.mid(20, 7);
|
||||
qApp->setPalette(QPalette(paletteColor));
|
||||
qApp->setStyleSheet(qss);
|
||||
file.close();
|
||||
}
|
||||
QtHelper::setStyle(":/qss/blacksoft.css");
|
||||
|
||||
frmMain w;
|
||||
QUIHelper::setFormInCenter(&w);
|
||||
QtHelper::setFormInCenter(&w);
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
|
|
|
@ -13,6 +13,4 @@ RESOURCES += $$PWD/../core_qss/qss.qrc
|
|||
INCLUDEPATH += $$PWD
|
||||
INCLUDEPATH += $$PWD/form
|
||||
include ($$PWD/form/form.pri)
|
||||
|
||||
INCLUDEPATH += $$PWD/../core_base
|
||||
include ($$PWD/../core_base/core_base.pri)
|
||||
include ($$PWD/../core_helper/core_helper.pri)
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#include "frmmain.h"
|
||||
#include "appinit.h"
|
||||
#include "quihelper.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QUIHelper::initMain();
|
||||
QtHelper::initMain();
|
||||
QApplication a(argc, argv);
|
||||
AppInit::Instance()->start();
|
||||
|
||||
QUIHelper::setFont();
|
||||
QUIHelper::setCode();
|
||||
QtHelper::setFont();
|
||||
QtHelper::setCode();
|
||||
|
||||
frmMain w;
|
||||
w.setWindowTitle("metro风格主界面 (QQ: 517216493 WX: feiyangqingyun)");
|
||||
QUIHelper::setFormInCenter(&w);
|
||||
QtHelper::setFormInCenter(&w);
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
|
|
|
@ -11,6 +11,4 @@ SOURCES += main.cpp
|
|||
INCLUDEPATH += $$PWD
|
||||
INCLUDEPATH += $$PWD/form
|
||||
include ($$PWD/form/form.pri)
|
||||
|
||||
INCLUDEPATH += $$PWD/../core_base
|
||||
include ($$PWD/../core_base/core_base.pri)
|
||||
include ($$PWD/../core_helper/core_helper.pri)
|
||||
|
|
Loading…
Reference in New Issue