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:
image: archlinux_gcc53_qt5_cmake
image: archlinux_gcc_qt5
stage: build
script:
- 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
guidededitorelement.h
guidededitorelementview.h
guidededitorlayer.h
guidededitorlayer.h
guidededitorgroup.h
flowlayout.h
)
set(SOURCES guidededitorelementview.cpp
guidededitorelement.cpp
abstractguidededitormodel.cpp
guidededitorlayer.cpp
guidededitorgroup.cpp
guidededitorview.cpp
flowlayout.cpp
)

View File

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

View File

@ -9,7 +9,7 @@
#include <QComboBox>
#include "guidededitorelement.h"
#include "guidededitorlayer.h"
#include "guidededitorgroup.h"
class GuidedEditorElementView : public QWidget
@ -41,7 +41,7 @@ private:
QComboBox* combobox;
QLabel* staticLabel;
// 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 <QColor>
class GuidedEditorLayer : public QObject
class GuidedEditorGroup : public QObject
{
Q_OBJECT
public:
explicit GuidedEditorLayer(QObject *parent = 0);
GuidedEditorLayer(QString title, QObject *parent = 0);
explicit GuidedEditorGroup(QObject *parent = 0);
GuidedEditorGroup(QString title, QObject *parent = 0);
QString getTitle() const;
void setTitle(const QString &value);
QColor getColor() const;
void setColor(const QColor &value);
void setColor(QColor *value);
private:
QString title;
QColor color;
QColor *color;
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;
}