Compare commits

..

No commits in common. "262ab3712e986130d0ba4f8600efb9b211c03506" and "c01756886b7921f88390c10b30895235bfcc9b10" have entirely different histories.

8 changed files with 9 additions and 34 deletions

View File

@ -1,8 +1,3 @@
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:

View File

@ -9,11 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror")
find_package(
Qt5 5.6.0

View File

@ -57,7 +57,6 @@
},
"IMapView": {
"type": "Object",
"baseClass": "IProjectView",
"functions": {
},
"properties": {

View File

@ -3,7 +3,6 @@
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
#include <QAbstractItemModel>
#include <QWidget>
class IProjectModel : public QAbstractItemModel
{
@ -32,16 +31,10 @@ signals:
void selected(std::uint16_t index);
};
class IProjectView : public QObject
class IProjectView
{
Q_OBJECT
public:
using QObject::QObject;
virtual ~IProjectView() {}
virtual QWidget *widget() = 0;
};
// EOF

View File

@ -1,7 +1,7 @@
#include "tycho.h"
MapProps::MapProps(Project *parent) :
QDialog(parent),
QDialog(static_cast<QWidget *>(parent)),
m_mapModel(parent->mapModel())
{
setupUi(this);

View File

@ -1,11 +1,10 @@
#include "tycho.h"
MapView::MapView(Project *parent) :
IMapView(parent),
m_internal(parent),
QWidget(static_cast<QWidget *>(parent)),
m_mapModel(parent->mapModel())
{
setupUi(&m_internal);
setupUi(this);
dbgPrintFunc();
}
@ -15,9 +14,4 @@ MapView::~MapView()
dbgPrintFunc();
}
QWidget *MapView::widget()
{
return &m_internal;
}
// EOF

View File

@ -30,7 +30,7 @@ Project::Project(Type type) :
setAttribute(Qt::WA_DeleteOnClose);
listView->setModel(m_model);
verticalLayout->insertWidget(0, m_view->widget());
verticalLayout->insertWidget(0, dynamic_cast<QWidget *>(m_view));
connect(listView,
SIGNAL(doubleClicked(QModelIndex const &)),
@ -57,7 +57,7 @@ IProjectModel *Project::model() const
MapModel *Project::mapModel() const
{
return qobject_cast<MapModel *>(m_model);
return dynamic_cast<MapModel *>(m_model);
}
void Project::closeEvent(QCloseEvent *event)

View File

@ -47,7 +47,8 @@ private:
QVariant data(const QModelIndex &index, int role) const override;
};
class MapView final : public IMapView,
class MapView final : public QWidget,
public IProjectView,
private Ui::MapView
{
Q_OBJECT
@ -56,10 +57,7 @@ public:
explicit MapView(Project *parent);
~MapView();
QWidget *widget();
private:
QWidget m_internal;
MapModel *const m_mapModel;
};