diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6bd4a85d..4d52b08b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,6 +15,7 @@ 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 @@ -23,6 +24,12 @@ set(SOURCE_FILES ${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 @@ -30,7 +37,7 @@ add_executable( #sources ${SOURCE_FILES} #resources - ${CMAKE_CURRENT_SOURCE_DIR}/resources.qrc + ${RESOURCE_FILES} ) target_include_directories( diff --git a/src/graphics.qrc b/src/graphics.qrc new file mode 100644 index 00000000..18d462e3 --- /dev/null +++ b/src/graphics.qrc @@ -0,0 +1,11 @@ + + + images/cyrus_background.png + images/CYRUS_HERO.png + images/CYRUS_BANNER.png + images/CYRUS_BANNER_TINY.png + images/CYRUS_ICON_TINY.png + images/Designer.png + images/logo_big.png + + diff --git a/src/images/CYRUS_BANNER.png b/src/images/CYRUS_BANNER.png new file mode 100644 index 00000000..41d641b9 Binary files /dev/null and b/src/images/CYRUS_BANNER.png differ diff --git a/src/images/CYRUS_BANNER_TINY.png b/src/images/CYRUS_BANNER_TINY.png new file mode 100644 index 00000000..d36dd416 Binary files /dev/null and b/src/images/CYRUS_BANNER_TINY.png differ diff --git a/src/images/CYRUS_HERO.png b/src/images/CYRUS_HERO.png new file mode 100644 index 00000000..e376a56f Binary files /dev/null and b/src/images/CYRUS_HERO.png differ diff --git a/src/images/CYRUS_ICON_TINY.png b/src/images/CYRUS_ICON_TINY.png new file mode 100644 index 00000000..9495bcb5 Binary files /dev/null and b/src/images/CYRUS_ICON_TINY.png differ diff --git a/src/images/Designer (3).png b/src/images/Designer (3).png deleted file mode 100644 index 610335a2..00000000 Binary files a/src/images/Designer (3).png and /dev/null differ diff --git a/src/images/Designer (6).png b/src/images/Designer (6).png deleted file mode 100644 index c0e61d33..00000000 Binary files a/src/images/Designer (6).png and /dev/null differ diff --git a/src/images/cyrus_logo.png b/src/images/logo_big.png similarity index 100% rename from src/images/cyrus_logo.png rename to src/images/logo_big.png diff --git a/src/include/mainwindow.hpp b/src/include/mainwindow.hpp index 659cedae..a79f0dec 100644 --- a/src/include/mainwindow.hpp +++ b/src/include/mainwindow.hpp @@ -3,8 +3,12 @@ #include #include +namespace Ui { +class MainWindow; +} + class MainWindow - : public QMainWindow + : public QMainWindow { Q_OBJECT @@ -15,4 +19,8 @@ class MainWindow private: void initializeInitiative(QHBoxLayout* layout); void initializeCreatureRepository(QHBoxLayout* layout); + +protected: + Ui::MainWindow *ui; + }; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5e6df166..449d1701 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -14,8 +14,12 @@ #include #include -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { + ui->setupUi(this); + //title and size this->setWindowTitle("Cyrus: Combat Tracker"); this->setMinimumSize(1920, 1080); @@ -23,6 +27,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) setStyleSheet("#MainWindow { border-image: url(:/images/cyrus_background.png) 0 0 0 0 stretch stretch;}"); + + + /* setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred)); //setBackgroundRole(QPalette::Background); @@ -47,11 +54,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) initializeCreatureRepository(outer); // final show call - this->centralWidget()->show(); + this->centralWidget()->show(); */ } MainWindow::~MainWindow() { + delete ui; } void MainWindow::initializeInitiative(QHBoxLayout* outer){ diff --git a/src/mainwindow.ui b/src/mainwindow.ui new file mode 100644 index 00000000..7c271251 --- /dev/null +++ b/src/mainwindow.ui @@ -0,0 +1,91 @@ + + + MainWindow + + + + 0 + 0 + 1600 + 1080 + + + + MainWindow + + + false + + + + + + -10 + 70 + 1631 + 1091 + + + + QTabWidget::West + + + QTabWidget::Rounded + + + 0 + + + + Combat + + + + + Creatures + + + + + World + + + + + Settings + + + + + + + 0 + 0 + 2050 + 71 + + + + + + + + + + :/images/images/CYRUS_HERO.png + + + true + + + + + + + + + + + + + diff --git a/src/model/creaturemodel.cpp b/src/model/creaturemodel.cpp index a45a4f12..052e411b 100644 --- a/src/model/creaturemodel.cpp +++ b/src/model/creaturemodel.cpp @@ -87,6 +87,8 @@ QVariant CreatureModel::data(const QModelIndex &index, int role) const{ return QString::number(creatures[index.row()].initiative); else return QVariant(); + case Qt::SizeHintRole: + return QSize(1300, 50); default: return QVariant(); } @@ -101,6 +103,7 @@ QHash CreatureModel::roleNames() const{ roles[Qt::DecorationRole] = "decoration"; roles[Qt::DisplayRole] = "display"; roles[Qt::EditRole] = "edit"; + roles[Qt::SizeHintRole] = "sizeHint"; return roles; } diff --git a/src/resources.qrc b/src/resources.qrc index 84e7d196..3429699b 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -1,8 +1,6 @@ - - images/cyrus_logo.png - images/cyrus_background.png - icons/monster.png - icons/initiative.png - - \ No newline at end of file + + icons/monster.png + icons/initiative.png + +