🎉 empty Qt6 window !
parent
4165716590
commit
41cc81c70b
|
@ -0,0 +1,4 @@
|
||||||
|
*~*
|
||||||
|
*\#*
|
||||||
|
.cache
|
||||||
|
build
|
|
@ -0,0 +1,8 @@
|
||||||
|
.PHONY: build install
|
||||||
|
|
||||||
|
build:
|
||||||
|
meson setup build
|
||||||
|
meson compile -C build
|
||||||
|
|
||||||
|
install: build
|
||||||
|
meson install -C build
|
|
@ -0,0 +1,45 @@
|
||||||
|
project(
|
||||||
|
'pixtool',
|
||||||
|
'cpp',
|
||||||
|
version: '0.0.0',
|
||||||
|
default_options: [
|
||||||
|
'cpp_std=c++17',
|
||||||
|
'warning_level=3'
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('version', meson.project_version())
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
input: 'src/conf.in.hpp',
|
||||||
|
output: 'conf.hpp',
|
||||||
|
configuration: conf
|
||||||
|
)
|
||||||
|
|
||||||
|
qt6 = import('qt6')
|
||||||
|
qt6_dep = dependency('qt6', modules: ['Core', 'Widgets'])
|
||||||
|
|
||||||
|
qt_src = qt6.compile_moc(
|
||||||
|
headers: [
|
||||||
|
'src/gui/Window.hpp'
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
executable(
|
||||||
|
'pixtool',
|
||||||
|
sources: [
|
||||||
|
'src/main.cpp',
|
||||||
|
'src/Presenter.cpp',
|
||||||
|
|
||||||
|
# model
|
||||||
|
'src/pixtool/PixTool.cpp',
|
||||||
|
|
||||||
|
# gui
|
||||||
|
'src/gui/Window.cpp',
|
||||||
|
] + qt_src,
|
||||||
|
dependencies: [
|
||||||
|
qt6_dep
|
||||||
|
],
|
||||||
|
install: true
|
||||||
|
)
|
|
@ -0,0 +1,14 @@
|
||||||
|
#include "Presenter.hpp"
|
||||||
|
|
||||||
|
namespace pt
|
||||||
|
{
|
||||||
|
/*explicit*/ Presenter::Presenter(gui::Window& window, model::PixTool& pixtool)
|
||||||
|
: m_window { window }
|
||||||
|
, m_pixtool { pixtool }
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ Presenter::~Presenter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
#ifndef pt_PRESENTER_HPP
|
||||||
|
#define pt_PRESENTER_HPP
|
||||||
|
|
||||||
|
#include "pixtool/PixTool.hpp"
|
||||||
|
#include "gui/Window.hpp"
|
||||||
|
|
||||||
|
namespace pt
|
||||||
|
{
|
||||||
|
class Presenter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit Presenter(gui::Window& window, model::PixTool& pixtool);
|
||||||
|
virtual ~Presenter();
|
||||||
|
|
||||||
|
private:
|
||||||
|
gui::Window& m_window;
|
||||||
|
model::PixTool& m_pixtool;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef pt_CONF_HPP
|
||||||
|
#define pt_CONF_HPP
|
||||||
|
|
||||||
|
#define PT_VERSION std::string("@version@")
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,21 @@
|
||||||
|
#include "Window.hpp"
|
||||||
|
#include "conf.hpp"
|
||||||
|
|
||||||
|
namespace pt
|
||||||
|
{
|
||||||
|
namespace gui
|
||||||
|
{
|
||||||
|
/*explicit*/ Window::Window(QWidget* parent)
|
||||||
|
: QMainWindow(parent)
|
||||||
|
{
|
||||||
|
setWindowTitle(QString::fromStdString("PixTool v" + PT_VERSION));
|
||||||
|
setMinimumSize(QSize {640, 480});
|
||||||
|
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ Window::~Window()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
#ifndef pt_gui_WINDOW_HPP
|
||||||
|
#define pt_gui_WINDOW_HPP
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
namespace pt
|
||||||
|
{
|
||||||
|
namespace gui
|
||||||
|
{
|
||||||
|
class Window: public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit Window(QWidget* parent=nullptr);
|
||||||
|
virtual ~Window();
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,18 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <QApplication>
|
||||||
|
#include "pixtool/PixTool.hpp"
|
||||||
|
#include "gui/Window.hpp"
|
||||||
|
#include "Presenter.hpp"
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
QApplication app {argc, argv};
|
||||||
|
|
||||||
|
pt::gui::Window window;
|
||||||
|
|
||||||
|
pt::model::PixTool pixtool;
|
||||||
|
|
||||||
|
pt::Presenter presenter {window, pixtool};
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
#include "PixTool.hpp"
|
||||||
|
|
||||||
|
namespace pt
|
||||||
|
{
|
||||||
|
namespace model
|
||||||
|
{
|
||||||
|
/*explicit*/ PixTool::PixTool()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ PixTool::~PixTool()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
#ifndef pt_model_PIXTOOL_HPP
|
||||||
|
#define pt_model_PIXTOOL_HPP
|
||||||
|
|
||||||
|
namespace pt
|
||||||
|
{
|
||||||
|
namespace model
|
||||||
|
{
|
||||||
|
class PixTool
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit PixTool();
|
||||||
|
virtual ~PixTool();
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue