mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 23:20:05 +00:00
Add Qt project
This commit is contained in:
parent
9daee7b8c6
commit
760e8a52a1
11 changed files with 296 additions and 2 deletions
11
scwx-qt/source/scwx/qt/main.cpp
Normal file
11
scwx-qt/source/scwx/qt/main.cpp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#include "main_window.hpp"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
scwx::qt::MainWindow w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
41
scwx-qt/source/scwx/qt/main_window.cpp
Normal file
41
scwx-qt/source/scwx/qt/main_window.cpp
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include "main_window.hpp"
|
||||
#include "./ui_main_window.h"
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
|
||||
template<typename... Types>
|
||||
class variant
|
||||
{
|
||||
public:
|
||||
template<typename T>
|
||||
inline variant(T&& value)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using ValueBase = variant<float, double>;
|
||||
|
||||
struct Value : ValueBase
|
||||
{
|
||||
using ValueBase::ValueBase;
|
||||
};
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent) :
|
||||
QMainWindow(parent), ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
Value(0.0f);
|
||||
Value(0.0);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
30
scwx-qt/source/scwx/qt/main_window.hpp
Normal file
30
scwx-qt/source/scwx/qt/main_window.hpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui
|
||||
{
|
||||
class MainWindow;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget* parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
private:
|
||||
Ui::MainWindow* ui;
|
||||
};
|
||||
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
33
scwx-qt/source/scwx/qt/main_window.ui
Normal file
33
scwx-qt/source/scwx/qt/main_window.ui
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout"/>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Loading…
Add table
Add a link
Reference in a new issue