Skip to content

Commit

Permalink
Merge pull request #13 from BreeDurbin/ui-files-2
Browse files Browse the repository at this point in the history
split ui file inti multiple ui files
  • Loading branch information
BreeDurbin authored Apr 17, 2024
2 parents a06d234 + b30e091 commit da8b05d
Show file tree
Hide file tree
Showing 65 changed files with 607 additions and 223 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
"qlistview": "cpp",
"qgroupbox": "cpp",
"qlabel": "cpp",
"qtabwidget": "cpp"
"qtabwidget": "cpp",
"qdialog": "cpp",
"qwidget": "cpp"
},
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()

add_subdirectory(lib)
add_subdirectory(src)
69 changes: 4 additions & 65 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,66 +1,5 @@

set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)

find_package(Boost 1.83.0 COMPONENTS filesystem)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt6 COMPONENTS Core Widgets Gui REQUIRED)
qt_standard_project_setup()

set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/include/mainwindow.hpp
${CMAKE_CURRENT_SOURCE_DIR}/model/include/creaturemodel.hpp
${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.ui
)

set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/model/creaturemodel.cpp
)

set(RESOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/graphics.qrc
${CMAKE_CURRENT_SOURCE_DIR}/resources.qrc
)


add_executable(
${PROJECT_NAME}
#headers
${HEADER_FILES}
#sources
${SOURCE_FILES}
#resources
${RESOURCE_FILES}
)

target_include_directories(
${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/component/include
${CMAKE_CURRENT_SOURCE_DIR}/model/include
)

target_link_libraries(
${PROJECT_NAME}
PRIVATE
styleLib
Qt6::Core
Qt6::Widgets
Qt6::Gui
${Boost_LIBRARIES}
)

set_target_properties(
${PROJECT_NAME}
PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
)
add_subdirectory(style)
add_subdirectory(model)
add_subdirectory(qt)
add_subdirectory(cyrus)
12 changes: 0 additions & 12 deletions src/component/creaturecombobox.cpp

This file was deleted.

Empty file.
Empty file removed src/component/effectrepository.cpp
Empty file.
13 changes: 0 additions & 13 deletions src/component/include/creaturecombobox.hpp

This file was deleted.

16 changes: 0 additions & 16 deletions src/component/include/creaturerepository.hpp

This file was deleted.

18 changes: 0 additions & 18 deletions src/component/include/effectrepository.hpp

This file was deleted.

34 changes: 34 additions & 0 deletions src/cyrus/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)

find_package(Boost 1.83.0 COMPONENTS filesystem)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt6 COMPONENTS Core Widgets Gui REQUIRED)
qt_standard_project_setup()

add_executable(
${PROJECT_NAME}
#sources
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)

target_link_libraries(
${PROJECT_NAME}
PRIVATE
styleLib
qtLib
modelLib
)

set_target_properties(
${PROJECT_NAME}
PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
)
7 changes: 4 additions & 3 deletions src/main.cpp → src/cyrus/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
#include <QDebug>
#include <QPalette>

#include <mainwindow.hpp>
#include <CyrusDialog.h>

int main(int argc, char* argv[])
{
{
QApplication *a = new QApplication(argc, argv);
QGuiApplication::setDesktopFileName("org.cyrus.Cyrus");

MainWindow w;
CyrusDialog w;
w.show();

return a->exec();
Expand Down
26 changes: 0 additions & 26 deletions src/include/mainwindow.hpp

This file was deleted.

36 changes: 36 additions & 0 deletions src/model/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt6 COMPONENTS Core Widgets Gui REQUIRED)
qt_standard_project_setup()

set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/CreatureModel/CreatureModel.h
)

set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/CreatureModel/CreatureModel.cpp
)

add_library(
modelLib
#sources
${SOURCE_FILES}
)

target_link_libraries(
modelLib
PRIVATE
styleLib
Qt6::Core
Qt6::Widgets
Qt6::Gui
)

target_include_directories(
modelLib
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/CreatureModel
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "include/creaturemodel.hpp"
#include "CreatureModel.h"
#include <QBrush>
#include <QColor>
#include <QFont>
#include <QIcon>
#include "colorrepository.hpp"
#include "colorrepository.h"


CreatureModel::CreatureModel(QObject *parent){
Expand Down
File renamed without changes.
74 changes: 74 additions & 0 deletions src/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt6 COMPONENTS Core Widgets Gui REQUIRED)
qt_standard_project_setup()

set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/CyrusDialog/CyrusDialog.h
${CMAKE_CURRENT_SOURCE_DIR}/CombatPage/CombatPage.h
${CMAKE_CURRENT_SOURCE_DIR}/CreaturePage/CreaturePage.h
${CMAKE_CURRENT_SOURCE_DIR}/WorldPage/WorldPage.h
${CMAKE_CURRENT_SOURCE_DIR}/CampaignPage/CampaignPage.h
${CMAKE_CURRENT_SOURCE_DIR}/SettingsPage/SettingsPage.h
)

set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/CyrusDialog/CyrusDialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CombatPage/CombatPage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CreaturePage/CreaturePage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/WorldPage/WorldPage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CampaignPage/CampaignPage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/SettingsPage/SettingsPage.cpp
)

set(UI_FILES
${CMAKE_CURRENT_SOURCE_DIR}/CyrusDialog/CyrusDialog.ui
${CMAKE_CURRENT_SOURCE_DIR}/CombatPage/CombatPage.ui
${CMAKE_CURRENT_SOURCE_DIR}/CreaturePage/CreaturePage.ui
${CMAKE_CURRENT_SOURCE_DIR}/WorldPage/WorldPage.ui
${CMAKE_CURRENT_SOURCE_DIR}/CampaignPage/CampaignPage.ui
${CMAKE_CURRENT_SOURCE_DIR}/SettingsPage/SettingsPage.ui
)

set(RESOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/asset/graphics.qrc
${CMAKE_CURRENT_SOURCE_DIR}/asset/resources.qrc
)

add_library(
qtLib
STATIC
#headers
${HEADER_FILES}
#ui
${UI_FILES}
#sources
${SOURCE_FILES}
#resources
${RESOURCE_FILES}
)

target_link_libraries(
qtLib
PUBLIC
styleLib
modelLib
Qt6::Core
Qt6::Widgets
Qt6::Gui
)

target_include_directories(
qtLib
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/CyrusDialog
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/CampaignPage
${CMAKE_CURRENT_SOURCE_DIR}/CombatPage
${CMAKE_CURRENT_SOURCE_DIR}/CreaturePage
${CMAKE_CURRENT_SOURCE_DIR}/SettingsPage
${CMAKE_CURRENT_SOURCE_DIR}/WorldPage
)
16 changes: 16 additions & 0 deletions src/qt/CampaignPage/CampaignPage.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "CampaignPage.h"
#include "ui_CampaignPage.h"

CampaignPage::CampaignPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::CampaignPage)
{
ui->setupUi(this);
}

CampaignPage::~CampaignPage()
{
delete ui;
}


19 changes: 19 additions & 0 deletions src/qt/CampaignPage/CampaignPage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <QWidget>

QT_BEGIN_NAMESPACE
namespace Ui{ class CampaignPage; }
QT_END_NAMESPACE

class CampaignPage : public QWidget
{
Q_OBJECT

public:
explicit CampaignPage(QWidget *parent = nullptr);
~CampaignPage();

private:
Ui::CampaignPage *ui;
};
Loading

0 comments on commit da8b05d

Please sign in to comment.