From 65dce2627f806d70779aeec6213520ce3dc7381c Mon Sep 17 00:00:00 2001 From: CalciteM Team Date: Wed, 4 Sep 2019 22:53:41 +0800 Subject: [PATCH] AppUI: Merge two pro and ui files --- millwindow.ui => app.ui | 72 ++++++------- gamewindow.ui | 228 ++++++++++++++++++++++++++++++++++----- mill.pro | 78 -------------- millgame.pro | 163 ++++++++++++++-------------- src/ui/qt/gamewindow.cpp | 9 ++ src/ui/qt/gamewindow.h | 4 - 6 files changed, 327 insertions(+), 227 deletions(-) rename millwindow.ui => app.ui (95%) delete mode 100644 mill.pro diff --git a/millwindow.ui b/app.ui similarity index 95% rename from millwindow.ui rename to app.ui index 8b308bc6..eeace4c1 100644 --- a/millwindow.ui +++ b/app.ui @@ -7,7 +7,7 @@ 0 0 491 - 418 + 432 @@ -32,7 +32,7 @@ - + :/icon/resources/icon/ic_reply_black_48dp.png:/icon/resources/icon/ic_reply_black_48dp.png @@ -56,7 +56,7 @@ - + :/icon/resources/icon/ic_menu_black_48dp.png:/icon/resources/icon/ic_menu_black_48dp.png @@ -123,7 +123,7 @@ 新局 - + :/icon/resources/icon/ic_radio_button_on_black_48dp.png:/icon/resources/icon/ic_radio_button_on_black_48dp.png @@ -152,7 +152,7 @@ 认输 - + :/icon/resources/icon/ic_flag_black_48dp.png:/icon/resources/icon/ic_flag_black_48dp.png @@ -178,7 +178,7 @@ 悔棋 - + :/icon/resources/icon/ic_reply_black_48dp.png:/icon/resources/icon/ic_reply_black_48dp.png @@ -206,7 +206,7 @@ 提示 - + :/icon/resources/icon/ic_visibility_black_48dp.png:/icon/resources/icon/ic_visibility_black_48dp.png @@ -227,7 +227,7 @@ 0 0 491 - 17 + 21 @@ -417,7 +417,7 @@ - :/icon/resources/icon/Black.png + :/icon/resources/icon/Black.png Qt::AlignCenter @@ -498,7 +498,7 @@ - :/icon/resources/icon/White.png + :/icon/resources/icon/White.png Qt::AlignCenter @@ -641,7 +641,7 @@ - :/icon/resources/icon/Help.png + :/icon/resources/icon/Help.png @@ -685,7 +685,7 @@ - + :/icon/resources/icon/DocumentHS.png:/icon/resources/icon/DocumentHS.png @@ -700,7 +700,7 @@ - + :/icon/resources/icon/OpenHS.png:/icon/resources/icon/OpenHS.png @@ -712,7 +712,7 @@ - + :/icon/resources/icon/SaveHS.png:/icon/resources/icon/SaveHS.png @@ -724,7 +724,7 @@ - + :/icon/resources/icon/SaveHS.png:/icon/resources/icon/SaveHS.png @@ -741,7 +741,7 @@ false - + :/icon/resources/icon/EditTableHS.png:/icon/resources/icon/EditTableHS.png @@ -750,7 +750,7 @@ - + :/icon/resources/icon/FlipVerticalHS.png:/icon/resources/icon/FlipVerticalHS.png @@ -759,7 +759,7 @@ - + :/icon/resources/icon/FlipHorizontalHS.png:/icon/resources/icon/FlipHorizontalHS.png @@ -768,7 +768,7 @@ - + :/icon/resources/icon/RightHS.png:/icon/resources/icon/RightHS.png @@ -780,7 +780,7 @@ - + :/icon/resources/icon/LeftHS.png:/icon/resources/icon/LeftHS.png @@ -798,7 +798,7 @@ false - + :/icon/resources/icon/Invert.png:/icon/resources/icon/Invert.png @@ -807,7 +807,7 @@ - + :/icon/resources/icon/First.png:/icon/resources/icon/First.png @@ -822,7 +822,7 @@ - + :/icon/resources/icon/Previous.png:/icon/resources/icon/Previous.png @@ -834,7 +834,7 @@ - + :/icon/resources/icon/Next.png:/icon/resources/icon/Next.png @@ -849,7 +849,7 @@ - + :/icon/resources/icon/Last.png:/icon/resources/icon/Last.png @@ -864,7 +864,7 @@ true - + :/icon/resources/icon/Play.png:/icon/resources/icon/Play.png @@ -876,7 +876,7 @@ - + :/icon/resources/icon/BreakpointHS.png:/icon/resources/icon/BreakpointHS.png @@ -902,7 +902,7 @@ true - + :/icon/resources/icon/FullScreenHS.png:/icon/resources/icon/FullScreenHS.png @@ -920,7 +920,7 @@ true - + :/icon/resources/icon/Web.png:/icon/resources/icon/Web.png @@ -932,7 +932,7 @@ - + :/icon/resources/icon/OptionsHS.png:/icon/resources/icon/OptionsHS.png @@ -950,7 +950,7 @@ false - + :/icon/resources/icon/Black.png:/icon/resources/icon/Black.png @@ -965,7 +965,7 @@ true - + :/icon/resources/icon/White.png:/icon/resources/icon/White.png @@ -980,7 +980,7 @@ false - + :/icon/resources/icon/PrimaryKeyHS.png:/icon/resources/icon/PrimaryKeyHS.png @@ -1053,7 +1053,7 @@ true - + :/icon/resources/icon/Help.png:/icon/resources/icon/Help.png @@ -1068,7 +1068,7 @@ true - + :/icon/resources/icon/HomeHS.png:/icon/resources/icon/HomeHS.png @@ -1104,7 +1104,7 @@ - + diff --git a/gamewindow.ui b/gamewindow.ui index 10104e2b..9ee96890 100644 --- a/gamewindow.ui +++ b/gamewindow.ui @@ -7,7 +7,7 @@ 0 0 491 - 418 + 432 @@ -24,6 +24,63 @@ false + + + + + + + + + + :/icon/resources/icon/ic_reply_black_48dp.png:/icon/resources/icon/ic_reply_black_48dp.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + :/icon/resources/icon/ic_menu_black_48dp.png:/icon/resources/icon/ic_menu_black_48dp.png + + + + + + + + + + + 玩家: + + + + + + + 电脑: + + + + + @@ -49,6 +106,119 @@ + + + + + + + 黑体 + 12 + + + + color: rgb(0, 0, 127); + + + 新局 + + + + :/icon/resources/icon/ic_radio_button_on_black_48dp.png:/icon/resources/icon/ic_radio_button_on_black_48dp.png + + + + 24 + 24 + + + + false + + + + + + + + 黑体 + 12 + + + + color: rgb(0, 0, 127); + + + 认输 + + + + :/icon/resources/icon/ic_flag_black_48dp.png:/icon/resources/icon/ic_flag_black_48dp.png + + + + 24 + 24 + + + + + + + + + 黑体 + 12 + + + + color: rgb(0, 0, 127); + + + 悔棋 + + + + :/icon/resources/icon/ic_reply_black_48dp.png:/icon/resources/icon/ic_reply_black_48dp.png + + + + 24 + 24 + + + + + + + + + 黑体 + 12 + false + PreferDefault + + + + color: rgb(0, 0, 127); + + + 提示 + + + + :/icon/resources/icon/ic_visibility_black_48dp.png:/icon/resources/icon/ic_visibility_black_48dp.png + + + + 24 + 24 + + + + + + @@ -247,7 +417,7 @@ - :/icon/resources/icon/Black.png + :/icon/resources/icon/Black.png Qt::AlignCenter @@ -328,7 +498,7 @@ - :/icon/resources/icon/White.png + :/icon/resources/icon/White.png Qt::AlignCenter @@ -471,7 +641,7 @@ - :/icon/resources/icon/Help.png + :/icon/resources/icon/Help.png @@ -515,7 +685,7 @@ - + :/icon/resources/icon/DocumentHS.png:/icon/resources/icon/DocumentHS.png @@ -530,7 +700,7 @@ - + :/icon/resources/icon/OpenHS.png:/icon/resources/icon/OpenHS.png @@ -542,7 +712,7 @@ - + :/icon/resources/icon/SaveHS.png:/icon/resources/icon/SaveHS.png @@ -554,7 +724,7 @@ - + :/icon/resources/icon/SaveHS.png:/icon/resources/icon/SaveHS.png @@ -571,7 +741,7 @@ false - + :/icon/resources/icon/EditTableHS.png:/icon/resources/icon/EditTableHS.png @@ -580,7 +750,7 @@ - + :/icon/resources/icon/FlipVerticalHS.png:/icon/resources/icon/FlipVerticalHS.png @@ -589,7 +759,7 @@ - + :/icon/resources/icon/FlipHorizontalHS.png:/icon/resources/icon/FlipHorizontalHS.png @@ -598,7 +768,7 @@ - + :/icon/resources/icon/RightHS.png:/icon/resources/icon/RightHS.png @@ -610,7 +780,7 @@ - + :/icon/resources/icon/LeftHS.png:/icon/resources/icon/LeftHS.png @@ -628,7 +798,7 @@ false - + :/icon/resources/icon/Invert.png:/icon/resources/icon/Invert.png @@ -637,7 +807,7 @@ - + :/icon/resources/icon/First.png:/icon/resources/icon/First.png @@ -652,7 +822,7 @@ - + :/icon/resources/icon/Previous.png:/icon/resources/icon/Previous.png @@ -664,7 +834,7 @@ - + :/icon/resources/icon/Next.png:/icon/resources/icon/Next.png @@ -679,7 +849,7 @@ - + :/icon/resources/icon/Last.png:/icon/resources/icon/Last.png @@ -694,7 +864,7 @@ true - + :/icon/resources/icon/Play.png:/icon/resources/icon/Play.png @@ -706,7 +876,7 @@ - + :/icon/resources/icon/BreakpointHS.png:/icon/resources/icon/BreakpointHS.png @@ -732,7 +902,7 @@ true - + :/icon/resources/icon/FullScreenHS.png:/icon/resources/icon/FullScreenHS.png @@ -750,7 +920,7 @@ true - + :/icon/resources/icon/Web.png:/icon/resources/icon/Web.png @@ -762,7 +932,7 @@ - + :/icon/resources/icon/OptionsHS.png:/icon/resources/icon/OptionsHS.png @@ -780,7 +950,7 @@ false - + :/icon/resources/icon/Black.png:/icon/resources/icon/Black.png @@ -795,7 +965,7 @@ true - + :/icon/resources/icon/White.png:/icon/resources/icon/White.png @@ -810,7 +980,7 @@ false - + :/icon/resources/icon/PrimaryKeyHS.png:/icon/resources/icon/PrimaryKeyHS.png @@ -883,7 +1053,7 @@ true - + :/icon/resources/icon/Help.png:/icon/resources/icon/Help.png @@ -898,7 +1068,7 @@ true - + :/icon/resources/icon/HomeHS.png:/icon/resources/icon/HomeHS.png @@ -934,7 +1104,7 @@ - + diff --git a/mill.pro b/mill.pro deleted file mode 100644 index 7d617749..00000000 --- a/mill.pro +++ /dev/null @@ -1,78 +0,0 @@ -QT += core gui \ - multimedia - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -TARGET = mill -TEMPLATE = app - -CONFIG += warn_off - -INCLUDEPATH += src -INCLUDEPATH += include - -SOURCES += \ - src/client.cpp \ - src/main.cpp \ - src/boarditem.cpp \ - src/gamecontroller.cpp \ - src/gamescene.cpp \ - src/gameview.cpp \ - src/ninechess.cpp \ - src/ninechessai_ab.cpp \ - src/ninechesswindow.cpp \ - src/pieceitem.cpp \ - src/aithread.cpp \ - src/server.cpp - -HEADERS += \ - include/config.h \ - include/version.h \ - include/version.h.template \ - src/HashNode.h \ - src/MemoryPool.h \ - src/MemoryPool.tcc \ - src/StackAlloc.h \ - src/boarditem.h \ - src/client.h \ - src/gamecontroller.h \ - src/gamescene.h \ - src/gameview.h \ - src/graphicsconst.h \ - src/hashMap.h \ - src/ninechess.h \ - src/ninechessai_ab.h \ - src/ninechesswindow.h \ - src/pieceitem.h \ - src/manuallistview.h \ - src/aithread.h \ - src/server.h \ - src/zobrist.h - -FORMS += \ - millwindow.ui - -RESOURCES += \ - ninechesswindow.qrc - -DISTFILES += \ - NineChess.rc \ - ../Readme.md \ - ../Sample.txt \ - ../History.txt \ - ../Licence.txt \ - version.sh - -RC_FILE += NineChess.rc - -# Mobile App support -DEFINES += MOBILE_APP_UI - -# With C++17 support -greaterThan(QT_MAJOR_VERSION, 4) { -CONFIG += c++17 -#QMAKE_CXXFLAGS += -O0 -g3 -fsanitize=leak -fno-omit-frame-pointer -#QMAKE_LFLAGS += -fsanitize=leak -} else { -QMAKE_CXXFLAGS += -std=c++0x -} diff --git a/millgame.pro b/millgame.pro index 6f6b647e..4952ee18 100644 --- a/millgame.pro +++ b/millgame.pro @@ -1,80 +1,83 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2015-11-03T22:30:34 -# -#------------------------------------------------- - -QT += core gui \ - multimedia - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -TARGET = MillGame -TEMPLATE = app - -CONFIG += warn_off - -INCLUDEPATH += include -INCLUDEPATH += src/base -INCLUDEPATH += src/ai -INCLUDEPATH += src/game -INCLUDEPATH += src/ui/qt - -SOURCES += \ - src/game/millgame.cpp \ - src/main.cpp \ - src/base/thread.cpp \ - src/ai/search.cpp \ - src/ui/qt/gamewindow.cpp \ - src/ui/qt/pieceitem.cpp \ - src/ui/qt/server.cpp \ - src/ui/qt/boarditem.cpp \ - src/ui/qt/gamecontroller.cpp \ - src/ui/qt/gamescene.cpp \ - src/ui/qt/gameview.cpp \ - src/ui/qt/client.cpp - -HEADERS += \ - include/config.h \ - include/version.h \ - include/version.h.template \ - src/base/HashNode.h \ - src/base/hashMap.h \ - src/base/MemoryPool.h \ - src/base/MemoryPool.tcc \ - src/base/stackalloc.h \ - src/base/thread.h \ - src/ai/search.h \ - src/ai/zobrist.h \ - src/game/millgame.h \ - src/ui/qt/client.h \ - src/ui/qt/gamecontroller.h \ - src/ui/qt/gamescene.h \ - src/ui/qt/gameview.h \ - src/ui/qt/gamewindow.h \ - src/ui/qt/graphicsconst.h \ - src/ui/qt/pieceitem.h \ - src/ui/qt/manuallistview.h \ - src/ui/qt/server.h \ - src/ui/qt/boarditem.h - -FORMS += \ - gamewindow.ui - -RESOURCES += \ - gamewindow.qrc - -DISTFILES += \ - MillGame.rc \ - version.sh - -RC_FILE += millgame.rc - -# With C++17 support -greaterThan(QT_MAJOR_VERSION, 4) { -CONFIG += c++17 -#QMAKE_CXXFLAGS += -O0 -g3 -fsanitize=leak -fno-omit-frame-pointer -#QMAKE_LFLAGS += -fsanitize=leak -} else { -QMAKE_CXXFLAGS += -std=c++0x -} +#------------------------------------------------- +# +# Project created by QtCreator 2015-11-03T22:30:34 +# +#------------------------------------------------- + +QT += core gui \ + multimedia + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = MillGame +TEMPLATE = app + +CONFIG += warn_off + +INCLUDEPATH += include +INCLUDEPATH += src/base +INCLUDEPATH += src/ai +INCLUDEPATH += src/game +INCLUDEPATH += src/ui/qt + +SOURCES += \ + src/game/millgame.cpp \ + src/main.cpp \ + src/base/thread.cpp \ + src/ai/search.cpp \ + src/ui/qt/gamewindow.cpp \ + src/ui/qt/pieceitem.cpp \ + src/ui/qt/server.cpp \ + src/ui/qt/boarditem.cpp \ + src/ui/qt/gamecontroller.cpp \ + src/ui/qt/gamescene.cpp \ + src/ui/qt/gameview.cpp \ + src/ui/qt/client.cpp + +HEADERS += \ + include/config.h \ + include/version.h \ + include/version.h.template \ + src/base/HashNode.h \ + src/base/hashMap.h \ + src/base/MemoryPool.h \ + src/base/MemoryPool.tcc \ + src/base/stackalloc.h \ + src/base/thread.h \ + src/ai/search.h \ + src/ai/zobrist.h \ + src/game/millgame.h \ + src/ui/qt/client.h \ + src/ui/qt/gamecontroller.h \ + src/ui/qt/gamescene.h \ + src/ui/qt/gameview.h \ + src/ui/qt/gamewindow.h \ + src/ui/qt/graphicsconst.h \ + src/ui/qt/pieceitem.h \ + src/ui/qt/manuallistview.h \ + src/ui/qt/server.h \ + src/ui/qt/boarditem.h + +FORMS += \ + gamewindow.ui + +RESOURCES += \ + gamewindow.qrc + +DISTFILES += \ + MillGame.rc \ + version.sh + +RC_FILE += millgame.rc + +# Mobile App support +#DEFINES += MOBILE_APP_UI + +# With C++17 support +greaterThan(QT_MAJOR_VERSION, 4) { +CONFIG += c++17 +#QMAKE_CXXFLAGS += -O0 -g3 -fsanitize=leak -fno-omit-frame-pointer +#QMAKE_LFLAGS += -fsanitize=leak +} else { +QMAKE_CXXFLAGS += -std=c++0x +} diff --git a/src/ui/qt/gamewindow.cpp b/src/ui/qt/gamewindow.cpp index 8244594b..b34a13e9 100644 --- a/src/ui/qt/gamewindow.cpp +++ b/src/ui/qt/gamewindow.cpp @@ -324,6 +324,15 @@ void MillGameWindow::initialize() #else /* MOBILE_APP_UI */ int h = QApplication::desktop()->height(); this->resize(QSize(h * 3/4, h * 3/4)); + + ui.pushButton_back->setVisible(false); + ui.pushButton_option->setVisible(false); + ui.label_2->setVisible(false); + ui.label->setVisible(false); + ui.pushButton_newGame->setVisible(false); + ui.pushButton_giveUp->setVisible(false); + ui.pushButton_retractMove->setVisible(false); + ui.pushButton_hint->setVisible(false); #endif /* MOBILE_APP_UI */ // 窗口最大化 diff --git a/src/ui/qt/gamewindow.h b/src/ui/qt/gamewindow.h index 863d4af3..a08b1273 100644 --- a/src/ui/qt/gamewindow.h +++ b/src/ui/qt/gamewindow.h @@ -30,11 +30,7 @@ #include "config.h" -#ifdef MOBILE_APP_UI -#include "ui_millwindow.h" -#else #include "ui_gamewindow.h" -#endif #include "server.h" #include "client.h"