Skip to content

Commit

Permalink
更新代码
Browse files Browse the repository at this point in the history
  • Loading branch information
feiyangqingyun committed Mar 8, 2024
1 parent 8b28eb5 commit c35ec2f
Show file tree
Hide file tree
Showing 38 changed files with 737 additions and 274 deletions.
4 changes: 2 additions & 2 deletions ui/core_base/appdata.cpp → ui/core_helper/appdata.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "appdata.h"
#include "quihelper.h"
#include "qthelper.h"

QString AppData::TitleFlag = "(QQ: 517216493 WX: feiyangqingyun)";
int AppData::RowHeight = 25;
Expand All @@ -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;
Expand Down
File renamed without changes.
24 changes: 17 additions & 7 deletions ui/core_base/appinit.cpp → ui/core_helper/appinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ 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);
Expand All @@ -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;
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 17 additions & 9 deletions ui/core_base/core_base.pri → ui/core_helper/core_helper.pri
Original file line number Diff line number Diff line change
@@ -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
}}

#指定编译产生的文件分门别类放到对应目录
Expand All @@ -13,21 +13,23 @@ 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
#开启后会将打印信息用控制台输出
#CONFIG += console
#开启后不会生成空的 debug release 目录
#CONFIG -= debug_and_release

#引入全志H3芯片依赖
#引入全志H3芯片依赖(不需要的用户可以删除)
include ($$PWD/h3.pri)
#将当前目录加入到头文件路径
INCLUDEPATH += $$PWD
Expand All @@ -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) {
Expand All @@ -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
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added ui/core_helper/qrc/font/DroidSansFallback.ttf
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions ui/core_helper/qrc/wasm.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>font/DroidSansFallback.ttf</file>
</qresource>
</RCC>
Loading

0 comments on commit c35ec2f

Please sign in to comment.