Merge branch 'master' of ssh://gitlab.mmo.to:42420/qwc/network-packet-composer

This commit is contained in:
Marcel Otte 2016-07-24 21:52:43 +02:00
commit 89cdcb7240
9 changed files with 55 additions and 75 deletions

View File

@ -2,7 +2,7 @@ stages:
- build - build
build: build:
image: archlinux_gcc53_qt5_cmake image: archlinux_gcc_qt5
stage: build stage: build
script: script:
- mkdir -p build - mkdir -p build

View File

@ -1,35 +0,0 @@
#-------------------------------------------------
#
# Project created by QtCreator 2015-01-06T11:56:33
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
QMAKE_CXXFLAGS += -std=c++14
TARGET = networkpacketcomposer
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
flowlayout.cpp \
guidededitorelement.cpp \
abstractguidededitormodel.cpp \
guidededitorview.cpp \
guidededitorlayer.cpp \
guidededitorelementview.cpp
HEADERS += mainwindow.h \
flowlayout.h \
guidededitorelement.h \
abstractguidededitormodel.h \
guidededitorview.h \
guidededitorlayer.h \
guidededitorelementview.h
INCLUDEPATH += $$PWD/../QtGuidedEditor
DEPENDPATH += $$PWD/../QtGuidedEditor

View File

@ -2,15 +2,14 @@
set(HEADERS abstractguidededitormodel.h set(HEADERS abstractguidededitormodel.h
guidededitorelement.h guidededitorelement.h
guidededitorelementview.h guidededitorelementview.h
guidededitorlayer.h guidededitorgroup.h
guidededitorlayer.h
flowlayout.h flowlayout.h
) )
set(SOURCES guidededitorelementview.cpp set(SOURCES guidededitorelementview.cpp
guidededitorelement.cpp guidededitorelement.cpp
abstractguidededitormodel.cpp abstractguidededitormodel.cpp
guidededitorlayer.cpp guidededitorgroup.cpp
guidededitorview.cpp guidededitorview.cpp
flowlayout.cpp flowlayout.cpp
) )

View File

@ -70,6 +70,16 @@ QString GuidedEditorElement::getValue() const
void GuidedEditorElement::setValue(const QString &value) void GuidedEditorElement::setValue(const QString &value)
{ {
this->value = value; this->value = value;
}
GuidedEditorGroup *GuidedEditorElement::getGroup() const
{
return this->group;
}
void GuidedEditorElement::setGroup(GuidedEditorGroup *group)
{
this->group = group;
} }

View File

@ -2,6 +2,7 @@
#define EDITORELEMENT_H #define EDITORELEMENT_H
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include "guidededitorgroup.h"
enum class ElementType { enum class ElementType {
@ -13,7 +14,6 @@ class GuidedEditorElement : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit GuidedEditorElement(); explicit GuidedEditorElement();
~GuidedEditorElement(); ~GuidedEditorElement();
@ -35,6 +35,9 @@ public:
QString getValue() const; QString getValue() const;
void setValue(const QString &value); void setValue(const QString &value);
GuidedEditorGroup* getGroup() const;
void setGroup(GuidedEditorGroup* group);
private: private:
QString title; QString title;
QString description; QString description;
@ -42,6 +45,7 @@ private:
QString syntaxregex; QString syntaxregex;
ElementType type; ElementType type;
QString value; QString value;
GuidedEditorGroup* group;
}; };

View File

@ -9,7 +9,7 @@
#include <QComboBox> #include <QComboBox>
#include "guidededitorelement.h" #include "guidededitorelement.h"
#include "guidededitorlayer.h" #include "guidededitorgroup.h"
class GuidedEditorElementView : public QWidget class GuidedEditorElementView : public QWidget
@ -41,7 +41,7 @@ private:
QComboBox* combobox; QComboBox* combobox;
QLabel* staticLabel; QLabel* staticLabel;
// layer information // layer information
GuidedEditorLayer* layer; GuidedEditorGroup* group;
}; };

View File

@ -0,0 +1,29 @@
#include "guidededitorgroup.h"
#include "cstdlib"
#include <QColor>
GuidedEditorGroup::GuidedEditorGroup(QObject *parent) : QObject(parent)
{
this->color = new QColor(rand()%20*10+50, rand()%20*10+50, rand()%20*10+50);
}
QString GuidedEditorGroup::getTitle() const
{
return title;
}
void GuidedEditorGroup::setTitle(const QString &value)
{
title = value;
}
QColor GuidedEditorGroup::getColor() const
{
return *color;
}
void GuidedEditorGroup::setColor(QColor *value)
{
color = value;
}

View File

@ -5,22 +5,22 @@
#include <QString> #include <QString>
#include <QColor> #include <QColor>
class GuidedEditorLayer : public QObject class GuidedEditorGroup : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit GuidedEditorLayer(QObject *parent = 0); explicit GuidedEditorGroup(QObject *parent = 0);
GuidedEditorLayer(QString title, QObject *parent = 0); GuidedEditorGroup(QString title, QObject *parent = 0);
QString getTitle() const; QString getTitle() const;
void setTitle(const QString &value); void setTitle(const QString &value);
QColor getColor() const; QColor getColor() const;
void setColor(const QColor &value); void setColor(QColor *value);
private: private:
QString title; QString title;
QColor color; QColor *color;
signals: signals:

View File

@ -1,27 +0,0 @@
#include "guidededitorlayer.h"
GuidedEditorLayer::GuidedEditorLayer(QObject *parent) : QObject(parent)
{
}
QString GuidedEditorLayer::getTitle() const
{
return title;
}
void GuidedEditorLayer::setTitle(const QString &value)
{
title = value;
}
QColor GuidedEditorLayer::getColor() const
{
return color;
}
void GuidedEditorLayer::setColor(const QColor &value)
{
color = value;
}