!3 新增AI画图面板和功能

Merge pull request !3 from shangxiaoyang/openkylin/nile
This commit is contained in:
shangxiaoyang 2024-05-23 04:03:43 +00:00 committed by Gitee
commit eb26151fd1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
56 changed files with 1764 additions and 6 deletions

View File

@ -64,8 +64,20 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
)
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(AIBASE kylin-ai-base)
include_directories(${AIBASE_INCLUDE_DIRS})
pkg_check_modules(Gsetting REQUIRED gsettings-qt)
include_directories(${Gsetting_INCLUDE_DIRS})
pkg_check_modules(Jsoncpp REQUIRED jsoncpp)
include_directories(${Jsoncpp_INCLUDE_DIRS})
pkg_check_modules(JsonGlib REQUIRED json-glib-1.0)
include_directories(${JsonGlib_INCLUDE_DIRS})
## Generate header with version number
ecm_setup_version(${RELEASE_SERVICE_VERSION}
VARIABLE_PREFIX KOLOURPAINT
@ -308,6 +320,7 @@ set(kolourpaint_app_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/widgets/kpTransparentColorCell.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/toolbars/kpColorToolBar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/toolbars/kpToolToolBar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/toolbars/kpAiDrawingBar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/toolbars/options/kpToolWidgetBase.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/toolbars/options/kpToolWidgetBrush.cpp
${CMAKE_CURRENT_SOURCE_DIR}/widgets/toolbars/options/kpToolWidgetEraserSize.cpp
@ -345,7 +358,13 @@ target_link_libraries(kolourpaint
KF${KF_MAJOR_VERSION}::KIOFileWidgets
KF${KF_MAJOR_VERSION}::TextWidgets
Qt${QT_MAJOR_VERSION}::PrintSupport
Threads::Threads
${KSANE_LIBRARIES}
${AIBASE_LIBRARIES}
${Gsetting_LIBRARIES}
${Jsoncpp_LIBRARIES}
${JsonGlib_LIBRARIES}
# ${LIBUKUI_LOG4QT_PATH}
kolourpaint_lgpl
)

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
kolourpaint (4:23.08.3-ok3) nile; urgency=medium
* BUG号 : 无
* 需求号 : TASK AI画图
* 其他改动说明 : 无
* 其他改动影响域 : 无
-- shangxiaoyang <shangxiaoyang@kylinos.cn> Thu, 14 Mar 2024 20:43:16 +0800
kolourpaint (4:23.08.3-ok2.0) nile; urgency=medium
* BUG号 : 无

6
debian/control vendored
View File

@ -18,6 +18,10 @@ Build-Depends: cmake (>= 3.16.0~),
libkf5xmlgui-dev (>= 5.90.0~),
pkg-config,
qtbase5-dev (>= 5.15.2~),
libkylin-ai-base-dev,
libgsettings-qt-dev,
libjsoncpp-dev,
libjson-glib-dev,
Standards-Version: 4.6.1
Rules-Requires-Root: no
Homepage: https://apps.kde.org/en/kolourpaint
@ -27,7 +31,7 @@ Vcs-Git: https://gitee.com/openkylin/kolourpaint.git
Package: kolourpaint
Section: graphics
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Depends: ${misc:Depends}, ${shlibs:Depends}, kylin-aiassistant
Breaks: kolourpaint4 (<< 4:17.04)
Replaces: kolourpaint4 (<< 4:17.04)
Description: simple image editor and drawing application

View File

@ -42,7 +42,7 @@
//--------------------------------------------------------------------------------
bool kpToolEnvironment::drawAntiAliased = true;
bool kpToolEnvironment::AiDrawing = true;
//--------------------------------------------------------------------------------
struct kpToolEnvironmentPrivate

View File

@ -152,6 +152,7 @@ public:
void fitToPage () const;
static bool drawAntiAliased;
static bool AiDrawing;
private:

View File

@ -41,11 +41,15 @@
int main(int argc, char *argv [])
{
QApplication app(argc, argv);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
QApplication app(argc, argv);
KLocalizedString::setApplicationDomain("kolourpaint");
KAboutData aboutData

View File

@ -111,6 +111,7 @@ SYNC: Check for duplicate actions in menus caused by some of our actions
</Menu>
<Menu name="settings">
<Action name="file_aidrawing" append="show_merge" />
<Action name="settings_show_path" append="show_merge" />
<Action name="settings_draw_antialiased" append="show_merge" />
</Menu>

View File

@ -62,6 +62,7 @@
#define kpSettingShowGrid "Show Grid"
#define kpSettingShowPath "Show Path"
#define kpSettingDrawAntiAliased "Draw AntiAliased"
#define kpSettingAiDrawing "AI Drawing"
#define kpSettingColorSimilarity "Color Similarity"
#define kpSettingDitherOnOpen "Dither on Open if Screen is 15/16bpp and Image Num Colors More Than"
#define kpSettingPrintImageCenteredOnPage "Print Image Centered On Page"

View File

@ -109,6 +109,7 @@ void kpMainWindow::readGeneralSettings ()
d->configShowPath = cfg.readEntry (kpSettingShowPath, false);
d->moreEffectsDialogLastEffect = cfg.readEntry (kpSettingMoreEffectsLastEffect, 0);
kpToolEnvironment::drawAntiAliased = cfg.readEntry(kpSettingDrawAntiAliased, true);
kpToolEnvironment::AiDrawing = cfg.readEntry(kpSettingAiDrawing, true);
if (cfg.hasKey (kpSettingOpenImagesInSameWindow))
{

View File

@ -339,6 +339,9 @@ private slots:
void slotScreenshot();
void slotMakeScreenshot();
void slotAiDrawing(bool on);
void showAIImageData(const QPixmap &pixmaps);
void slotProperties ();
bool save (bool localOnly = false);

View File

@ -58,6 +58,7 @@ class kpThumbnailView;
class kpDocument;
class kpViewManager;
class kpColorToolBar;
class kpAIDrawingBar;
class kpToolToolBar;
class kpCommandHistory;
class kpTool;
@ -264,6 +265,7 @@ struct kpMainWindowPrivate
kpDocument *document;
kpViewManager *viewManager;
kpColorToolBar *colorToolBar;
kpAIDrawingBar *aiDrawToolBar;
kpToolToolBar *toolToolBar;
kpCommandHistory *commandHistory;

View File

@ -41,6 +41,7 @@
#include "kpDefs.h"
#include "document/kpDocument.h"
#include "widgets/toolbars/kpToolToolBar.h"
#include "widgets/toolbars/kpAiDrawingBar.h"
#include "environments/tools/kpToolEnvironment.h"
//---------------------------------------------------------------------
@ -67,6 +68,21 @@ void kpMainWindow::setupSettingsMenuActions ()
connect (d->actionShowPath, &QAction::triggered, this, &kpMainWindow::slotShowPathToggled);
slotEnableSettingsShowPath ();
d->aiDrawToolBar = new kpAIDrawingBar(this);
addDockWidget(Qt::RightDockWidgetArea, d->aiDrawToolBar);
addDockWidget(Qt::RightDockWidgetArea, d->aiDrawToolBar, Qt::Vertical);
connect(d->aiDrawToolBar, &kpAIDrawingBar::imageClicked, this, &kpMainWindow::showAIImageData);
if (kpToolEnvironment::AiDrawing)
d->aiDrawToolBar->show();
else
d->aiDrawToolBar->hide();
auto actionAIDrawing = ac->add<KToggleAction>(QStringLiteral("file_aidrawing"));
actionAIDrawing->setText(i18n("Displays the AI authoring bar"));
actionAIDrawing->setChecked(kpToolEnvironment::AiDrawing);
connect (actionAIDrawing, &QAction::triggered, this, &kpMainWindow::slotAiDrawing);
auto *action = ac->add<KToggleAction>(QStringLiteral("settings_draw_antialiased"));
action->setText(i18n("Draw Anti-Aliased"));
action->setChecked(kpToolEnvironment::drawAntiAliased);
@ -81,6 +97,35 @@ void kpMainWindow::setupSettingsMenuActions ()
//---------------------------------------------------------------------
void kpMainWindow::slotAiDrawing(bool on)
{
kpToolEnvironment::AiDrawing = on;
KConfigGroup cfg(KSharedConfig::openConfig(), kpSettingsGroupGeneral);
cfg.writeEntry(kpSettingAiDrawing, kpToolEnvironment::AiDrawing);
cfg.sync();
qDebug()<<"菜单栏是否选中:"<<on<< d->aiDrawToolBar->isHidden();
if (on)
d->aiDrawToolBar->show();
else
d->aiDrawToolBar->hide();
}
void kpMainWindow::showAIImageData(const QPixmap &pixmaps)
{
QPixmap pixmap = pixmaps;
auto *doc = new kpDocument(pixmap.width(), pixmap.height(), documentEnvironment());
doc->setImage(pixmap.toImage());
// Send document to current or new window.
setDocument(doc);
show();
qDebug() << "slotAiDrawing 处理图像数据 :" << pixmaps;
}
// private
void kpMainWindow::enableSettingsMenuDocumentActions (bool /*enable*/)
{

View File

@ -1,2 +1,4 @@
add_subdirectory( action )
add_subdirectory( app )
add_subdirectory( custom )
add_subdirectory( style )

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,6 @@
install(FILES
loading.gif
AI-Drawing@2x.png
slogo-Drawing.svg
bg@2x.png
DESTINATION ${DATA_INSTALL_DIR}/kolourpaint/pics)

BIN
pics/custom/bg@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

BIN
pics/custom/loading.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

36
pics/style/CMakeLists.txt Normal file
View File

@ -0,0 +1,36 @@
install(FILES
style-all.png
style-anime.png
style-ancient.png
style-baroque.png
style-cartoon.png
style-conceptual.png
style-cyberpunk.png
style-futurism.png
style-lolita.png
style-low-poly.png
style-oil-painting.png
style-pixel.png
style-realistic.png
style-surrealism.png
style-ukiyoe.png
style-vaporwave.png
style-watercolour.png
style-all@2x.png
style-anime@2x.png
style-ancient@2x.png
style-baroque@2x.png
style-cartoon@2x.png
style-conceptual@2x.png
style-cyberpunk@2x.png
style-futurism@2x.png
style-lolita@2x.png
style-low-poly@2x.png
style-oil-painting@2x.png
style-pixel@2x.png
style-realistic@2x.png
style-surrealism@2x.png
style-ukiyoe@2x.png
style-vaporwave@2x.png
style-watercolour@2x.png
DESTINATION ${DATA_INSTALL_DIR}/kolourpaint/pics/style)

BIN
pics/style/style-all.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
pics/style/style-all@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
pics/style/style-anime.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
pics/style/style-lolita.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
pics/style/style-pixel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
pics/style/style-ukiyoe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1497,6 +1497,11 @@ msgstr "扫描图像..."
msgid "Acquire Screenshot"
msgstr "捕获屏幕截图"
#: mainWindow/kpMainWindow_File.cpp:122
#, kde-format
msgid "Displays the AI authoring bar"
msgstr "显示AI创作栏"
#: mainWindow/kpMainWindow_File.cpp:122
#, kde-format
msgid "Properties"
@ -2662,3 +2667,123 @@ msgstr "填充前景色"
#, kde-format
msgid "Opaque"
msgstr "选区背景不透明"
msgid "A cute cat pilot wearing goggles is soaring through the blue sky, cartoon style, HD"
msgstr "一只可爱的猫咪飞行员戴着护目镜,正在蓝天中翱翔,卡通风格,高清"
msgid "Generate now"
msgstr "立即生成"
msgid "Image description"
msgstr "图像描述"
msgid "Image style"
msgstr "图像风格"
msgid "Image ratio"
msgstr "图像比例"
msgid "Scaling factor"
msgstr "缩放倍数"
msgid "Generated quantity"
msgstr "生成数量"
msgid "result"
msgstr "生成结果"
msgid "more"
msgstr "更多"
msgid "Pack up"
msgstr "收起"
msgid "style-all"
msgstr "探索无限"
msgid "style-ancient"
msgstr "古风"
msgid "style-anime"
msgstr "二次元"
msgid "style-realistic"
msgstr "写实风格"
msgid "style-ukiyoe"
msgstr "浮世绘"
msgid "style-low-poly"
msgstr "低多边形"
msgid "style-futurism"
msgstr "未来主义"
msgid "style-pixel"
msgstr "像素风格"
msgid "style-conceptual"
msgstr "概念艺术"
msgid "style-cyberpunk"
msgstr "赛博朋克"
msgid "style-lolita"
msgstr "洛丽塔风"
msgid "style-baroque"
msgstr "巴洛克风"
msgid "style-surrealism"
msgstr "超现实主义"
msgid "style-watercolour"
msgstr "水彩画"
msgid "style-vaporwave"
msgstr "蒸汽波艺术"
msgid "style-oil-painting"
msgstr "油画"
msgid "style-cartoon"
msgstr "卡通画"
msgid "Please configure the AI model account before you can use the mapping function."
msgstr "请先配置AI模型账号方可使用麒思妙绘功能。"
msgid "Configure now"
msgstr "立即配置"
msgid "In formation..."
msgstr "生成中..."
msgid "Network error"
msgstr "网络错误"
msgid "Service error"
msgstr "服务错误"
msgid "Authentication failure"
msgstr "鉴权失败"
msgid "Request failed"
msgstr "请求失败"
msgid "Task timeout"
msgstr "任务超时"
msgid "Text length exceeds the limit"
msgstr "文本长度超限"
msgid "Generation error"
msgstr "生成错误"
msgid "Text or style errors"
msgstr "文本或风格错误"
msgid "Parameter error"
msgstr "参数错误"
msgid "Image resolution"
msgstr "图像分辨率"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,253 @@
/*
Copyright (c) 2003-2007 Clarence Dang <dang@kde.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef KP_AI_DRAWINGBAR_H
#define KP_AI_DRAWINGBAR_H
#include <QDockWidget>
#include <QWidget>
#include <QPushButton>
#include <QButtonGroup>
#include <QLabel>
#include <QCheckBox>
#include <QVBoxLayout>
#include <QDialog>
#include <QPixmap>
#include <QStackedWidget>
#include <QScrollArea>
#include <QScrollBar>
#include <QPair>
#include <QList>
#include <QComboBox>
#include <QThread>
#include <QMouseEvent>
#include <QDebug>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QDir>
#include <QGSettings>
#include <ai-base/modelconfig.h>
#include <ai-base/vision.h>
#include <kylin-ai/config.h>
#define LOADING_IMAGE "/usr/share/kolourpaint/pics/loading.gif"
#define BG_IMAGE "/usr/share/kolourpaint/pics/bg@2x.png"
#define SLOGO_IMAGE "/usr/share/kolourpaint/pics/slogo-Drawing.svg"
#define DRAWING_IMAGE "/usr/share/kolourpaint/pics/AI-Drawing@2x.png"
#define KYLIN_AI_DBUS "com.kylin.aiassistant"
#define KYLIN_AI_PATH "/com/kylin/aiassistant"
#define AI_GSETTINGS "org.kylin.aiassistant.settings"
#define AI_KEY "isVisionSetup"
/**
* @brief The AIModeDataThread class
* 线AI的服务
*/
class AIModeDataThread : public QObject
{
Q_OBJECT
public:
AIModeDataThread();
~AIModeDataThread();
bool setSessionStatus();
VisionSession getVisionSession(){
return session;
}
bool someFunctionInThread();
void setAIData (QString str, QSize size, int quantity, VisionImageStyle Style){
textBox = str;
AIImageSize = size;
quantityNum = quantity;
ImageStyle = Style;
}
signals:
void finishedSignal(bool flag, QPixmap pixmap, int imageIndex, int imageSum, int errorCode);
private:
void sendErrorSignal(int ret){
emit finishedSignal(false, QPixmap(), 0, 1, ret);
for(int i = 0; i < quantityNum; i++)
emit finishedSignal(true, QPixmap(), i, quantityNum, ret);
}
static void generateImageCallback(VisionImageData imageData, void* userData);
private:
QPixmap pixmap;
int quantityNum = 1; //数量按钮
QSize AIImageSize;
QString textBox;
VisionImageStyle ImageStyle;
bool m_sessionFlag = false;
VisionSession session;
};
/**
* @brief The imageClickableLabel class
* QLabel点击事件类
*/
class imageClickableLabel : public QLabel
{
Q_OBJECT
signals:
void labelClicked(const QPixmap &pixmap);
public:
imageClickableLabel(const QPixmap &pixmap, QWidget *parent = nullptr) : QLabel(parent), pixmap(pixmap){}
protected:
void mousePressEvent(QMouseEvent *event) override
{
Q_UNUSED(event);
emit labelClicked(pixmap);
}
private:
QPixmap pixmap;
};
class kpAIDrawingBar : public QDockWidget
{
Q_OBJECT
signals:
void imageClicked(const QPixmap &pixmap);
public:
kpAIDrawingBar(QWidget *parent);
~kpAIDrawingBar();
public:
void initUI();
bool getConfigStatus();
void getconfigVersionData();
void loginConfigurationPage();
void setAiPixmap(QPixmap pixmap,int imageIndex, QGridLayout *pageLayout);
void updatePageLabel();
QSize getImageLabelSize();
bool eventFilter(QObject *watched, QEvent *event);
void handleLabelClicked(QObject *clickedObject);
QPixmap createPixmapWithText(const QString &text);
QPixmap AIGeneratesErrorHandling(int errorCode);
private slots:
void onConfigButtonClicked(); //配置按钮回调函数
void onConfigSettingsChange(const QString &key); //AI配置成功后回调
void onGenerateButtonClicked(); //生成按钮回调函数
void handleInputTextChanged(); //文字变化回调函数
void showPreviousPage(); //显示上一页
void showNextPage(); //显示下一页
void deleteCurrentPage();
void setEnabledDeleteButton();
void handleLabelClick(const QPixmap &pixmap);
void addPageAndStoreImages();
void onStyleMoreButtonClick();
void startThread() {
if (m_AiMode->setSessionStatus()){
m_AiMode->setAIData(textBox, AIImageSize, quantityNum, ImageStyle);
m_AiMode->someFunctionInThread();
}
}
void onThreadFinished(bool flag, QPixmap pixmap, int imageIndex, int imageSum, int errorCode);
private:
void updateImageGrid();
void updateResultGrid();
void deleteImageGridWidget();
void addResolutionComboBox();
void addQuantityComboBox();
QJsonArray readResolutionsFromJson(QString key);
int readNumFromJson(QString key);
QWidget *addAllStyleLabel(QString iconPath, QString labelText, int line);
QWidget *addStyleLabel(QString iconPath, QString labelText, int line);
void addStyleWidget();
void addStyleGrid(QWidget *widget, int line);
private:
int imageColumn = 2;//显示列表列数
int quantityNum = 1; //数量按钮
int show_quantityNum = 1; //数量按钮
int currentPageIndx = -1;//切换页第几页
bool styleFlag; //风格标志位,用于判断按下哪一个风格
bool deleteButtonFlag = true;
bool buildButtonFlag;
QGSettings *AiSettings; //监听配置信息
QSize AIImageSize; //图片大小
QSize showAIImageSize;
QMovie *movie = nullptr;//生成等待图标
QLabel *resultLabel; //生成结果 label
QLabel *pageLabel; //第几页面label
QLabel *selectedIconLabel;//风格图片选择Label
QLabel *selectedTextLabel;//风格文字选择Label
QWidget *configWidget; //立即配置页面
QWidget *widget_low_poly; //多边形风格
QString textBox; //图像描述文字
QString colorfulButtonStyle; //立即生成按钮渐变色
QString colorGrayButtonStyle;//立即生成按钮置灰
QBoxLayout *vbox; //页面布局
QHBoxLayout *resultGrid; //生成结果布局
QGridLayout *styleGrid; //风格布局
QPushButton *moreButton; //更多按钮
QScrollArea *scrollArea; //滚动窗口
QPushButton *buildButton; //立即生成按钮
QPushButton *deleteButton; //删除按钮
QComboBox *resolutionComboBox; //图像分辨率
QComboBox *quantityComboBox; //生成数量
QStackedWidget *stackedWidget; //生成结果的换页窗口
QVector<QVector<QPixmap>> imagesVector; //生成图像数据集成
VisionSession mSession = nullptr;
VisionImageStyle ImageStyle; //风格样式
AIModeDataThread *m_AiMode; //AI生成程序
};
#endif