diff --git a/appicon.ico b/appicon.ico new file mode 100644 index 0000000..b965239 Binary files /dev/null and b/appicon.ico differ diff --git a/core_form/frmalbum/frmalbum.cpp b/core_form/frmalbum/frmalbum.cpp index a1c7a96..48e1d26 100644 --- a/core_form/frmalbum/frmalbum.cpp +++ b/core_form/frmalbum/frmalbum.cpp @@ -26,33 +26,38 @@ int FrmAlbum::getCopyType() void FrmAlbum::slot_updateImage() { + picWidgetList.clear(); + panelWidget->clearWidgets(); + QList urls = ImageManager::instance()->getImageUrls(FileConfigDecode::getInstance()->getAddress(), + FileConfigDecode::getInstance()->getUserName()); + qDebug() < urls = ImageManager::instance()->getImageUrls(FileConfigDecode::getInstance()->getAddress(), - // FileConfigDecode::getInstance()->getUserName()); + connect(widget, &FrmImgShow::signal_imageDelete, this, &FrmAlbum::slot_updateImage); - // foreach (const QUrl& u, urls) { - // qDebug() << "image url:" <loadImage(u); - // picWidgetList.push_front(widget); - // panelWidget->setWidget(picWidgetList, 3); - // } + widget->loadImage(u); + picWidgetList.push_back(widget); + + // panelWidget->setWidget(picWidgetList, 3); + } + panelWidget->setWidget(picWidgetList, 4); + panelWidget->setSpace(15); } void FrmAlbum::initForm() { - layout = new QVBoxLayout(); + layout = new QVBoxLayout(this); setLayout(layout); - panelWidget = new PanelWidget(); + panelWidget = new PanelWidget(this); panelWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); panelWidget->setStyleSheet("border:1px solid white;"); panelWidget->setSpace(5); @@ -75,7 +80,6 @@ void FrmAlbum::initForm() btnCopy->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); btnCopy->setStyleSheet("height:25px;width:70px;background-color:#1B9EF3;color:white;border-style:none;border-radius:8px"); connect(btnCopy, &QPushButton::clicked, [this](){ - qDebug() <<"btnCopy"; QString clipStr = ""; foreach (QString s, m_selectedImageSet) { switch (cbbCopyType->currentIndex()) { @@ -136,7 +140,6 @@ void FrmAlbum::initForm() connect(cbbCopyType, &QComboBox::currentIndexChanged, [this](int index){ m_copyType = index; - qDebug() << m_copyType; }); spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Fixed); @@ -155,13 +158,12 @@ void FrmAlbum::initForm() // qDebug() << ui->widget; connect(TCHttpService::getInstance(), &TCHttpService::signal_loginSuc, [this](){ - qDebug() <<"login success"; + // qDebug() <<"login success"; QList urls = ImageManager::instance()->getImageUrls(FileConfigDecode::getInstance()->getAddress(), FileConfigDecode::getInstance()->getUserName()); foreach (const QUrl& u, urls) { - qDebug() << "image url:" <loadImage(u); picWidgetList.push_front(widget); - panelWidget->setWidget(picWidgetList, 3); + + // panelWidget->setWidget(picWidgetList, 3); } + panelWidget->setWidget(picWidgetList, 4); + panelWidget->setSpace(15); }); - - - - - panelWidget->setWidget(picWidgetList, 4); - panelWidget->setSpace(15); } diff --git a/core_form/frmalbum/frmalbum.h b/core_form/frmalbum/frmalbum.h index 82b5c94..30aac75 100644 --- a/core_form/frmalbum/frmalbum.h +++ b/core_form/frmalbum/frmalbum.h @@ -6,9 +6,10 @@ #include #include #include "panelwidget.h" -#include "frmimgshow.h" -#include "fileconfigdecode.h"` #include +#include "frmimgshow.h" +#include "fileconfigdecode.h" + namespace Ui { class FrmAlbum; diff --git a/core_form/frmimgshow/frmimgshow.cpp b/core_form/frmimgshow/frmimgshow.cpp index a9c56af..708ee32 100644 --- a/core_form/frmimgshow/frmimgshow.cpp +++ b/core_form/frmimgshow/frmimgshow.cpp @@ -8,14 +8,12 @@ FrmImgShow::FrmImgShow(QWidget *parent) : QWidget(parent) connect(TCHttpService::getInstance(), &TCHttpService::signal_imageDownloaded, this, [this](const QString& requestId, const QPixmap& pixmap){ if (requestId == m_requestId) { - // setLoadingState(false); - qDebug() << "load success"; setImage(pixmap); } }); connect(TCHttpService::getInstance(), &TCHttpService::signal_downloadFailed, - this, [this](const QString& requestId, const QString& error){ + this, [this](const QString& requestId){ if (requestId == m_requestId) { qDebug() << "load failed"; } @@ -24,7 +22,6 @@ FrmImgShow::FrmImgShow(QWidget *parent) : QWidget(parent) void FrmImgShow::loadImage(const QUrl &imageUrl) { - qDebug() << "loadImage"; m_currentUrl = imageUrl; m_requestId = QUuid::createUuid().toString(); TCHttpService::getInstance()->downloadImage(m_requestId, imageUrl); @@ -46,14 +43,9 @@ void FrmImgShow::setImage(const QPixmap &pixmap) labImg->setPixmap(pixmap.scaled(this->labImg->width(), this->labImg->height())); } -void FrmImgShow::setLoadingState(bool loading) -{ - -} - void FrmImgShow::initSignalSlot() { - connect(btnCopy, &QPushButton::clicked, [this](){ + connect(btnCopy, &QPushButton::clicked, this, [this](){ switch(FrmAlbum::getCopyType()) { case 0: { @@ -86,7 +78,7 @@ void FrmImgShow::initSignalSlot() } }); - connect(ckbSelect, &QCheckBox::checkStateChanged, [this](Qt::CheckState state){ + connect(ckbSelect, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state){ if (state == Qt::Unchecked) { emit signal_imageUnselected(m_currentUrl.toString()); } @@ -95,6 +87,15 @@ void FrmImgShow::initSignalSlot() emit signal_imageSelected(m_currentUrl.toString()); } }); + + connect(btnDelete, &QPushButton::clicked, this, [this](){ + // qDebug() <<"delete"; + QString domain = FileConfigDecode::getInstance()->getAddress(); + QString userName = FileConfigDecode::getInstance()->getUserName(); + int del_res = ImageManager::instance()->removeImageUrl(domain, userName, m_currentUrl.toString()); + // qDebug() << "del_res:" << del_res; + emit signal_imageDelete(); + }); } @@ -199,7 +200,7 @@ void FrmImgShow::initForm() // btnCopy->setFixedSize(32, 32); // btnCopy->setCursor(Qt::PointingHandCursor); - setStyleSheet("background-color: #FF0000"); + // setStyleSheet("background-color: #FF0000"); setFixedSize(134, 160); diff --git a/core_form/frmimgshow/frmimgshow.h b/core_form/frmimgshow/frmimgshow.h index a7bad32..bf9d3e6 100644 --- a/core_form/frmimgshow/frmimgshow.h +++ b/core_form/frmimgshow/frmimgshow.h @@ -23,7 +23,6 @@ public: void loadImage(const QUrl& imageUrl); void setImage(const QPixmap& pixmap); - void setLoadingState(bool loading); void initSignalSlot(); @@ -56,6 +55,7 @@ private: signals: void signal_imageSelected(QString); void signal_imageUnselected(QString); + void signal_imageDelete(); }; #endif // FRMIMGSHOW_H diff --git a/core_form/frmsetting/frmsetting.cpp b/core_form/frmsetting/frmsetting.cpp index 33981d6..c213ab5 100644 --- a/core_form/frmsetting/frmsetting.cpp +++ b/core_form/frmsetting/frmsetting.cpp @@ -94,14 +94,14 @@ void FrmSetting::initWidget() } if (FileConfigDecode::getInstance()->getAutoLogin()) { ui->labAUtoLoginOpen->setStyleSheet(OPENQSS); - ui->labAUtoLoginOpen->setStyleSheet(CLOSEQSS); + ui->labAutoLoginClose->setStyleSheet(CLOSEQSS); TCHttpService::getInstance()->setConfiguration(FileConfigDecode::getInstance()->getUserName(), FileConfigDecode::getInstance()->getPassword(), FileConfigDecode::getInstance()->getAddress()); } else { ui->labAUtoLoginOpen->setStyleSheet(CLOSEQSS); - ui->labAUtoLoginOpen->setStyleSheet(OPENQSS); + ui->labAutoLoginClose->setStyleSheet(OPENQSS); } ui->schRename->setChecked(FileConfigDecode::getInstance()->getRename()); diff --git a/core_form/panelwidget/panelwidget.cpp b/core_form/panelwidget/panelwidget.cpp index e435e0e..e9c6f98 100644 --- a/core_form/panelwidget/panelwidget.cpp +++ b/core_form/panelwidget/panelwidget.cpp @@ -81,6 +81,14 @@ int PanelWidget::getColumnCount() return this->columnCount; } +void PanelWidget::clearWidgets() +{ + foreach (QWidget* w, widgets) { + delete w; + } + widgets.clear(); +} + void PanelWidget::setWidget(QList widgets, int columnCount) { this->widgets = widgets; @@ -94,7 +102,6 @@ void PanelWidget::setWidget(QList widgets, int columnCount) foreach (QWidget *widget, widgets) { gridLayout->removeWidget(widget); widget->setVisible(false); - delete widget; } //重新添加到布局中并可见 diff --git a/core_form/panelwidget/panelwidget.h b/core_form/panelwidget/panelwidget.h index 34f599e..07ccebc 100644 --- a/core_form/panelwidget/panelwidget.h +++ b/core_form/panelwidget/panelwidget.h @@ -60,6 +60,7 @@ public: QList getWidgets(); int getColumnCount(); + void clearWidgets(); public Q_SLOTS: @@ -70,6 +71,7 @@ public Q_SLOTS: void setAutoWidth(bool autoWidth); void setAutoHeight(bool autoHeight); + }; #endif // PANELWIDGET_H diff --git a/core_support/tchttpservice/tchttpservice.cpp b/core_support/tchttpservice/tchttpservice.cpp index 998429c..e7b0beb 100644 --- a/core_support/tchttpservice/tchttpservice.cpp +++ b/core_support/tchttpservice/tchttpservice.cpp @@ -156,28 +156,6 @@ void TCHttpService::apiUpload(const QString &filePath) }); } -void TCHttpService::apiSharePicShare(const QString &fileName, const QString &md5) -{ - - QString urlStr; - if (m_enableSsl) - urlStr = "https://" + m_domain + "/api/sharepic"; - else - urlStr = "http://" + m_domain + "/api/sharepic"; - - QMap headers; - QMap body; - QMap params; - - headers.insert("Content-Type", "application/json"); - - QString bodyStr = QString("\"%1\":\"%2\",\"%3\":\"%4\",\"%5\":\"%6\",\"%7\":\"%8\"").arg("token").arg(m_token). - arg("user").arg(m_userName).arg("md5").arg(md5).arg("filename").arg(fileName); - - params.insert("cmd", "share"); - -} - void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString domain) { this->m_domain = domain; @@ -203,9 +181,11 @@ void TCHttpService::setUploadNum(int nb) void TCHttpService::downloadImage(const QString &requestId, const QUrl &imageUrl) { -#if 0 +#if 1 QPixmap cachedPixmap; if (QPixmapCache::find(imageUrl.toString(), &cachedPixmap)) { + + emit signal_imageDownloaded(requestId, cachedPixmap); return; } @@ -217,7 +197,9 @@ void TCHttpService::downloadImage(const QString &requestId, const QUrl &imageUrl } #endif QNetworkRequest request(imageUrl); + request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork); QNetworkReply* reply = m_manager.get(request); + m_pendingRequests[reply] = requestId; connect(reply, &QNetworkReply::finished, [this, reply](){ @@ -229,6 +211,7 @@ void TCHttpService::downloadImage(const QString &requestId, const QUrl &imageUrl else { QPixmap pixmap; if (pixmap.loadFromData(reply->readAll())) { + cacheImage(reply->url(), pixmap); emit signal_imageDownloaded(requestId, pixmap); } else { @@ -236,9 +219,31 @@ void TCHttpService::downloadImage(const QString &requestId, const QUrl &imageUrl } } + reply->deleteLater(); }); - m_pendingRequests[reply] = requestId; + // connect(reply, &QNetworkReply::finished, [this, reply, imageUrl](){ + + // QString requestId = m_pendingRequests.take(reply); + + // if (reply->error() != QNetworkReply::NoError) { + // emit signal_downloadFailed(requestId, reply->errorString()); + // } + // else { + // QPixmap pixmap; + // if (pixmap.loadFromData(reply->readAll())) { + // QPixmapCache::insert(imageUrl.toString(), pixmap); + // emit signal_imageDownloaded(requestId, pixmap); + // } + // else { + // emit signal_downloadFailed(requestId, "Failed to load image data"); + // } + // } + + // reply->deleteLater(); + // }); + // connect(reply, &QNetworkReply::finished, this, &TCHttpService::slot_downloadFinished); + } QUrl TCHttpService::encodeUrl(QString urlStr, QMap params) @@ -314,6 +319,16 @@ QString TCHttpService::getCacheFilePath(const QUrl &imageUrl) return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + fileName; } +void TCHttpService::cacheImage(const QUrl &imageUrl, const QPixmap &pixmap) +{ + QPixmapCache::insert(imageUrl.toString(), pixmap); + + QString filePath = getCacheFilePath(imageUrl); + pixmap.save(filePath, "PNG"); + + cleanOldCacheFiles(); +} + TCHttpService::TCHttpService(QObject *parent) : QObject(parent) { @@ -329,6 +344,7 @@ void TCHttpService::slot_downloadFinished(QNetworkReply *reply) else { QPixmap pixmap; if (pixmap.loadFromData(reply->readAll())) { + cacheImage(reply->url(), pixmap); emit signal_imageDownloaded(requestId, pixmap); } else { diff --git a/core_support/tchttpservice/tchttpservice.h b/core_support/tchttpservice/tchttpservice.h index 9821ee7..98a6955 100644 --- a/core_support/tchttpservice/tchttpservice.h +++ b/core_support/tchttpservice/tchttpservice.h @@ -41,7 +41,6 @@ public: void apiMd5(const QString& filePath); #endif void apiUpload(const QString& filePath); - void apiSharePicShare(const QString& fileName, const QString& md5); void setConfiguration(QString userName, QString firstPwd, QString domain); void setSsl(bool enable); bool getOnlineState(); @@ -55,6 +54,7 @@ private: void cleanOldCacheFiles(); bool getCachedImage(const QUrl& imageUrl, QPixmap& pixmap); QString getCacheFilePath(const QUrl& imageUrl); + void cacheImage(const QUrl& imageUrl, const QPixmap& pixmap); signals: void signal_loginSuc(); diff --git a/core_support/urldatabase/urldatabase.cpp b/core_support/urldatabase/urldatabase.cpp index 169ca36..e81be37 100644 --- a/core_support/urldatabase/urldatabase.cpp +++ b/core_support/urldatabase/urldatabase.cpp @@ -1,4 +1,4 @@ -#include "urldatabase.h".h" +#include "urldatabase.h" #include #include #include @@ -171,6 +171,33 @@ bool ImageManager::addImageUrl(const QString &domain, const QString &user, const return query.exec(); } +bool ImageManager::removeImageUrl(const QString &domain, const QString &user, const QUrl &imageUrl) +{ + int domainId = getDomainId(domain); + int userId = getUserId(user); + + if (domainId == -1 || userId == -1) { + return false; + } + + QSqlQuery query(m_db); + query.prepare("SELECT id FROM domain_users WHERE domain_id = ? AND user_id = ?"); + query.addBindValue(domainId); + query.addBindValue(userId); + + if (!query.exec() || !query.next()) { + return false; + } + + int domainUserId = query.value(0).toInt(); + query.prepare("DELETE FROM image_urls WHERE domain_user_id = ? AND image_url = ?"); + query.addBindValue(domainUserId); + query.addBindValue(imageUrl.toString()); + + + return query.exec(); +} + QList ImageManager::getImageUrls(const QString &domain, const QString &user) { QList urls; diff --git a/core_support/urldatabase/urldatabase.h b/core_support/urldatabase/urldatabase.h index 050c4fc..02bd0e9 100644 --- a/core_support/urldatabase/urldatabase.h +++ b/core_support/urldatabase/urldatabase.h @@ -30,9 +30,12 @@ public: // 添加域名-用户对(不重复) bool addDomainUser(const QString &domain, const QString &user); + // bool deleteDomainUser(const QString& domain, const QString& user); + // 上传成功后添加图片URL bool addImageUrl(const QString &domain, const QString &user, const QUrl &imageUrl); + bool removeImageUrl(const QString& domain, const QString& user, const QUrl& imageUrl); // 获取特定域名-用户的所有图片URL QList getImageUrls(const QString &domain, const QString &user); diff --git a/innoSetup/打包脚本.iss b/innoSetup/打包脚本.iss new file mode 100644 index 0000000..e2dfe16 --- /dev/null +++ b/innoSetup/打包脚本.iss @@ -0,0 +1,57 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "PicPanel" +#define MyAppVersion "2.0" +#define MyAppPublisher "Lenn" +#define MyAppURL "https://huangyanjie.com" +#define MyAppExeName "picpanel.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{13350D01-8FED-4820-B13F-20F5591D31F7} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +UninstallDisplayIcon={app}\{#MyAppExeName} +; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run +; on anything but x64 and Windows 11 on Arm. +ArchitecturesAllowed=x64compatible +; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the +; install be done in "64-bit mode" on x64 or Windows 11 on Arm, +; meaning it should use the native 64-bit Program Files directory and +; the 64-bit view of the registry. +ArchitecturesInstallIn64BitMode=x64compatible +DisableProgramGroupPage=yes +; Uncomment the following line to run in non administrative install mode (install for current user only). +;PrivilegesRequired=lowest +OutputDir=C:\Users\Lenn Louis\Desktop +OutputBaseFilename=PicPanel-2.0-x64 +SetupIconFile=C:\Users\Lenn Louis\Desktop\appicon.ico +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "C:\Users\Lenn Louis\Desktop\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\Lenn Louis\Downloads\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Release\release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/picpanel.pro b/picpanel.pro index c9710c4..21317de 100644 --- a/picpanel.pro +++ b/picpanel.pro @@ -22,7 +22,7 @@ INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD/core_form INCLUDEPATH += $$PWD/core_ui INCLUDEPATH += $$PWD/core_support -include($$PWD/core_qui/core_qui.pri) +# include($$PWD/core_qui/core_qui.pri) include($$PWD/core_form/core_form.pri) include($$PWD/core_ui/core_ui.pri) include($$PWD/core_support/core_support.pri) @@ -40,6 +40,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin #UI_DIR = $$PWD/build/ui #DESTDIR = $$PWD/build/bin +RC_ICONS = appicon.ico RESOURCES += \ image.qrc \ diff --git a/picpanel.pro.user b/picpanel.pro.user index 0b58974..c40b16d 100644 --- a/picpanel.pro.user +++ b/picpanel.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {631b5895-04c2-4f08-83d2-9e1277f189a1} + {4f2ec396-c2e0-4f3d-a369-5968ecaf5cee} ProjectExplorer.Project.ActiveTarget @@ -78,7 +78,7 @@ true true Builtin.DefaultTidyAndClazy - 12 + 16 true @@ -99,8 +99,8 @@ 0 0 - E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Debug - E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug + C:\Users\Lenn Louis\Downloads\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Debug + C:/Users/Lenn Louis/Downloads/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug true @@ -138,8 +138,8 @@ 2 - E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-release - E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-release + C:\Users\Lenn Louis\Downloads\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Release + C:/Users/Lenn Louis/Downloads/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Release true @@ -172,12 +172,54 @@ false - release + Release Qt4ProjectManager.Qt4BuildConfiguration 0 0 - 2 + + 0 + C:\Users\Lenn Louis\Downloads\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Profile + C:/Users/Lenn Louis/Downloads/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 0 @@ -196,20 +238,19 @@ true 0 true - 2 false -e cpu-cycles --call-graph "dwarf,4096" -F 250 - Qt4ProjectManager.Qt4RunConfiguration:E:/picpanel/picpanel.pro - E:/picpanel/picpanel.pro + Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Lenn Louis/Downloads/picpanel/picpanel.pro + C:/Users/Lenn Louis/Downloads/picpanel/picpanel.pro false true true true - E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-release + C:/Users/Lenn Louis/Downloads/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Release 1 diff --git a/picpanel.pro.user.631b589 b/picpanel.pro.user.631b589 new file mode 100644 index 0000000..0b58974 --- /dev/null +++ b/picpanel.pro.user.631b589 @@ -0,0 +1,229 @@ + + + + + + EnvironmentId + {631b5895-04c2-4f08-83d2-9e1277f189a1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + 0 + false + true + false + 2 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + false + + + 0 + true + + true + true + Builtin.DefaultTidyAndClazy + 12 + true + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 6.7.3 MinGW 64-bit + Desktop Qt 6.7.3 MinGW 64-bit + qt.qt6.673.win64_mingw_kit + 1 + 0 + 0 + + 0 + E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-Debug + E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:\picpanel\build\Desktop_Qt_6_7_3_MinGW_64_bit-release + E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-release + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + 2 + + + 0 + 部署 + 部署 + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + 0 + true + + + 2 + + false + -e cpu-cycles --call-graph "dwarf,4096" -F 250 + + Qt4ProjectManager.Qt4RunConfiguration:E:/picpanel/picpanel.pro + E:/picpanel/picpanel.pro + false + true + true + true + E:/picpanel/build/Desktop_Qt_6_7_3_MinGW_64_bit-release + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/widget.cpp b/widget.cpp index 33890ea..5b52281 100644 --- a/widget.cpp +++ b/widget.cpp @@ -111,7 +111,7 @@ bool Widget::eventFilter(QObject *watched, QEvent *event) if (mouseEvent->type() == QEvent::MouseButtonPress) { if (mouseEvent->button() == Qt::LeftButton) { mousePressed = true; - mousePoint = mouseEvent->globalPos() - this->pos(); + mousePoint = mouseEvent->globalPosition().toPoint() - this->pos(); } } else if (mouseEvent->type() == QEvent::MouseButtonRelease){ @@ -119,7 +119,7 @@ bool Widget::eventFilter(QObject *watched, QEvent *event) } else if (mouseEvent->type() == QEvent::MouseMove) { if (mousePressed) { - this->move(mouseEvent->globalPos() - mousePoint); + this->move(mouseEvent->globalPosition().toPoint() - mousePoint); return true; } } diff --git a/widget.h b/widget.h index 7d32354..829e3ef 100644 --- a/widget.h +++ b/widget.h @@ -23,9 +23,9 @@ #include "iconhelper.h" #define VERSION_MAJ "2" -#define VERSION_MIN "0" +#define VERSION_MIN "1" -#define VERSION_BATE 1 +#define VERSION_BATE 0 class QPushButton;