Compare commits
3 Commits
c01756886b
...
262ab3712e
Author | SHA1 | Date |
---|---|---|
an | 262ab3712e | |
an | f9722647af | |
an | 91182c6015 |
5
LICENSE
5
LICENSE
|
@ -1,3 +1,8 @@
|
|||
Modified source code from rust-qt-binding-generator is included as a submodule
|
||||
under the directory of the same name. That code is GNU GPL with exception to the
|
||||
generated code. It is only required to *build* Tycho, so this exception also
|
||||
applies to any binary version of Tycho.
|
||||
|
||||
Some of the data contained in tests/data and benches/data is Copyright © Bungie
|
||||
Software. I do not own them, but am permitted to redistribute them. Everything
|
||||
else is public domain, as stated:
|
||||
|
|
|
@ -9,7 +9,11 @@ set(CMAKE_AUTOMOC ON)
|
|||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror")
|
||||
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
|
||||
endif()
|
||||
|
||||
find_package(
|
||||
Qt5 5.6.0
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
},
|
||||
"IMapView": {
|
||||
"type": "Object",
|
||||
"baseClass": "IProjectView",
|
||||
"functions": {
|
||||
},
|
||||
"properties": {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QWidget>
|
||||
|
||||
class IProjectModel : public QAbstractItemModel
|
||||
{
|
||||
|
@ -31,10 +32,16 @@ signals:
|
|||
void selected(std::uint16_t index);
|
||||
};
|
||||
|
||||
class IProjectView
|
||||
class IProjectView : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
using QObject::QObject;
|
||||
|
||||
virtual ~IProjectView() {}
|
||||
|
||||
virtual QWidget *widget() = 0;
|
||||
};
|
||||
|
||||
// EOF
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "tycho.h"
|
||||
|
||||
MapProps::MapProps(Project *parent) :
|
||||
QDialog(static_cast<QWidget *>(parent)),
|
||||
QDialog(parent),
|
||||
m_mapModel(parent->mapModel())
|
||||
{
|
||||
setupUi(this);
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#include "tycho.h"
|
||||
|
||||
MapView::MapView(Project *parent) :
|
||||
QWidget(static_cast<QWidget *>(parent)),
|
||||
IMapView(parent),
|
||||
m_internal(parent),
|
||||
m_mapModel(parent->mapModel())
|
||||
{
|
||||
setupUi(this);
|
||||
setupUi(&m_internal);
|
||||
|
||||
dbgPrintFunc();
|
||||
}
|
||||
|
@ -14,4 +15,9 @@ MapView::~MapView()
|
|||
dbgPrintFunc();
|
||||
}
|
||||
|
||||
QWidget *MapView::widget()
|
||||
{
|
||||
return &m_internal;
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
|
|
@ -30,7 +30,7 @@ Project::Project(Type type) :
|
|||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
listView->setModel(m_model);
|
||||
verticalLayout->insertWidget(0, dynamic_cast<QWidget *>(m_view));
|
||||
verticalLayout->insertWidget(0, m_view->widget());
|
||||
|
||||
connect(listView,
|
||||
SIGNAL(doubleClicked(QModelIndex const &)),
|
||||
|
@ -57,7 +57,7 @@ IProjectModel *Project::model() const
|
|||
|
||||
MapModel *Project::mapModel() const
|
||||
{
|
||||
return dynamic_cast<MapModel *>(m_model);
|
||||
return qobject_cast<MapModel *>(m_model);
|
||||
}
|
||||
|
||||
void Project::closeEvent(QCloseEvent *event)
|
||||
|
|
|
@ -47,8 +47,7 @@ private:
|
|||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
};
|
||||
|
||||
class MapView final : public QWidget,
|
||||
public IProjectView,
|
||||
class MapView final : public IMapView,
|
||||
private Ui::MapView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -57,7 +56,10 @@ public:
|
|||
explicit MapView(Project *parent);
|
||||
~MapView();
|
||||
|
||||
QWidget *widget();
|
||||
|
||||
private:
|
||||
QWidget m_internal;
|
||||
MapModel *const m_mapModel;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue