mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
QETProject have is own database + add widget to edit nomenclature model
QETProject have is own ProjectDataBase, then when the database is updated, everything that need the database is also updated trough the signal emitted by the database. Begin a widget to edit the NomenclatureModel
This commit is contained in:
@@ -75,6 +75,20 @@ QVector<QStringList> projectDataBase::elementsInfoFromQuery(const QString &query
|
|||||||
return result_;
|
return result_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief projectDataBase::updateDB
|
||||||
|
* Up to date the content of the data base.
|
||||||
|
* Except at the creation of this class,
|
||||||
|
* call this method each time you want to query the data base
|
||||||
|
* to be sure that the content reflect the current state of the project.
|
||||||
|
* Emit the singal dataBaseUpdated
|
||||||
|
*/
|
||||||
|
void projectDataBase::updateDB()
|
||||||
|
{
|
||||||
|
populateElementsTable();
|
||||||
|
emit dataBaseUpdated();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief projectDataBase::createDataBase
|
* @brief projectDataBase::createDataBase
|
||||||
* Create the data base
|
* Create the data base
|
||||||
@@ -114,8 +128,7 @@ bool projectDataBase::createDataBase()
|
|||||||
query_.exec();
|
query_.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
populateElementsTable();
|
updateDB();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,8 @@
|
|||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
#include "qetproject.h"
|
|
||||||
|
|
||||||
class Element;
|
class Element;
|
||||||
|
class QETProject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The projectDataBase class
|
* @brief The projectDataBase class
|
||||||
@@ -43,6 +42,10 @@ class projectDataBase : public QObject
|
|||||||
virtual ~projectDataBase() override;
|
virtual ~projectDataBase() override;
|
||||||
|
|
||||||
QVector<QStringList> elementsInfoFromQuery(const QString &query);
|
QVector<QStringList> elementsInfoFromQuery(const QString &query);
|
||||||
|
void updateDB();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void dataBaseUpdated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool createDataBase();
|
bool createDataBase();
|
||||||
|
|||||||
207
sources/factory/propertieseditorfactory.cpp
Normal file
207
sources/factory/propertieseditorfactory.cpp
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2020 QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "propertieseditorfactory.h"
|
||||||
|
#include "QGraphicsItem"
|
||||||
|
#include "element.h"
|
||||||
|
#include "PropertiesEditor/propertieseditorwidget.h"
|
||||||
|
#include "elementpropertieswidget.h"
|
||||||
|
#include "element.h"
|
||||||
|
#include "independenttextitem.h"
|
||||||
|
#include "inditextpropertieswidget.h"
|
||||||
|
#include "diagramimageitem.h"
|
||||||
|
#include "imagepropertieswidget.h"
|
||||||
|
#include "qetshapeitem.h"
|
||||||
|
#include "shapegraphicsitempropertieswidget.h"
|
||||||
|
#include "dynamicelementtextitem.h"
|
||||||
|
#include "dynamicelementtextitemeditor.h"
|
||||||
|
#include "elementtextitemgroup.h"
|
||||||
|
#include "qetgraphicstableitem.h"
|
||||||
|
#include "graphicstablepropertieseditor.h"
|
||||||
|
#include "nomenclaturemodel.h"
|
||||||
|
#include "nomenclaturemodelpropertieswidget.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief PropertiesEditorFactory::propertiesEditor
|
||||||
|
* @param model : the model to be edited
|
||||||
|
* @param editor : if the properties editor to be created is the same class as @editor, the this function set @item as edited item of @editor and return editor
|
||||||
|
* @param parent : parent widget of the returned editor
|
||||||
|
* @return an editor or nullptr
|
||||||
|
*/
|
||||||
|
PropertiesEditorWidget *PropertiesEditorFactory::propertiesEditor(QAbstractItemModel *model, PropertiesEditorWidget *editor, QWidget *parent)
|
||||||
|
{
|
||||||
|
Q_UNUSED(model)
|
||||||
|
Q_UNUSED(editor)
|
||||||
|
Q_UNUSED(parent)
|
||||||
|
|
||||||
|
if (auto m = static_cast<NomenclatureModel *>(model))
|
||||||
|
{
|
||||||
|
if (editor &&
|
||||||
|
editor->metaObject()->className() == NomenclatureModelPropertiesWidget::staticMetaObject.className())
|
||||||
|
{
|
||||||
|
static_cast<NomenclatureModelPropertiesWidget *>(editor)->setModel(m);
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
return new NomenclatureModelPropertiesWidget(m, parent);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief propertiesEditor
|
||||||
|
* @param items : The items to be edited
|
||||||
|
* @param editor : If the properties editor to be created is the same class as @editor, then this function set @item as edited item of @editor and return editor
|
||||||
|
* @param parent : parent widget of the returned editor
|
||||||
|
* @return : an editor or nullptr;
|
||||||
|
*/
|
||||||
|
PropertiesEditorWidget *PropertiesEditorFactory::propertiesEditor(QList<QGraphicsItem *> items, PropertiesEditorWidget *editor, QWidget *parent)
|
||||||
|
{
|
||||||
|
int count_ = items.size();
|
||||||
|
|
||||||
|
//The editor widget can only edit one item
|
||||||
|
//or several items of the same type
|
||||||
|
if (count_ != 1)
|
||||||
|
{
|
||||||
|
if (count_ == 0) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
int type_ = items.first()->type();
|
||||||
|
for (QGraphicsItem *qgi : items) {
|
||||||
|
if (qgi->type() != type_) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QGraphicsItem *item = items.first();
|
||||||
|
const int type_ = item->type();
|
||||||
|
QString class_name;
|
||||||
|
if (editor) {
|
||||||
|
class_name = editor->metaObject()->className();
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type_)
|
||||||
|
{
|
||||||
|
case Element::Type: //1000
|
||||||
|
{
|
||||||
|
if (count_ > 1) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
auto elmt = static_cast<Element*>(item);
|
||||||
|
//auto created_editor = new ElementPropertiesWidget(elmt, parent);
|
||||||
|
|
||||||
|
//We already edit an element, just update the editor with a new element
|
||||||
|
if (class_name == ElementPropertiesWidget::staticMetaObject.className())
|
||||||
|
{
|
||||||
|
static_cast<ElementPropertiesWidget*>(editor)->setElement(elmt);
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
return new ElementPropertiesWidget(elmt, parent);
|
||||||
|
}
|
||||||
|
case IndependentTextItem::Type: //1005
|
||||||
|
{
|
||||||
|
QList<IndependentTextItem *> text_list;
|
||||||
|
for (QGraphicsItem *qgi : items) {
|
||||||
|
text_list.append(static_cast<IndependentTextItem*>(qgi));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (class_name == IndiTextPropertiesWidget::staticMetaObject.className())
|
||||||
|
{
|
||||||
|
static_cast<IndiTextPropertiesWidget*>(editor)->setText(text_list);
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new IndiTextPropertiesWidget(text_list, parent);
|
||||||
|
}
|
||||||
|
case DiagramImageItem::Type: //1007
|
||||||
|
{
|
||||||
|
if (count_ > 1) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
return new ImagePropertiesWidget(static_cast<DiagramImageItem*>(item), parent);
|
||||||
|
}
|
||||||
|
case QetShapeItem::Type: //1008
|
||||||
|
{
|
||||||
|
QList<QetShapeItem *> shapes_list;
|
||||||
|
for (QGraphicsItem *qgi : items) {
|
||||||
|
shapes_list.append(static_cast<QetShapeItem*>(qgi));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (class_name == ShapeGraphicsItemPropertiesWidget::staticMetaObject.className())
|
||||||
|
{
|
||||||
|
static_cast<ShapeGraphicsItemPropertiesWidget*>(editor)->setItems(shapes_list);
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ShapeGraphicsItemPropertiesWidget(shapes_list, parent);
|
||||||
|
}
|
||||||
|
case DynamicElementTextItem::Type: //1010
|
||||||
|
{
|
||||||
|
if (count_ > 1) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
DynamicElementTextItem *deti = static_cast<DynamicElementTextItem *>(item);
|
||||||
|
//For dynamic element text, we open the element editor to edit it
|
||||||
|
//If we already edit an element, just update the editor with a new element
|
||||||
|
if (class_name == ElementPropertiesWidget::staticMetaObject.className())
|
||||||
|
{
|
||||||
|
static_cast<ElementPropertiesWidget*>(editor)->setDynamicText(deti);
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
return new ElementPropertiesWidget(deti, parent);
|
||||||
|
}
|
||||||
|
case QGraphicsItemGroup::Type:
|
||||||
|
{
|
||||||
|
if (count_ > 1) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ElementTextItemGroup *group = dynamic_cast<ElementTextItemGroup *>(item))
|
||||||
|
{
|
||||||
|
//For element text item group, we open the element editor to edit it
|
||||||
|
//If we already edit an element, just update the editor with a new element
|
||||||
|
if(class_name == ElementPropertiesWidget::staticMetaObject.className())
|
||||||
|
{
|
||||||
|
static_cast<ElementPropertiesWidget *>(editor)->setTextsGroup(group);
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
return new ElementPropertiesWidget(group, parent);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case QetGraphicsTableItem::Type:
|
||||||
|
{
|
||||||
|
if (count_ > 1) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto table = static_cast<QetGraphicsTableItem*>(item);
|
||||||
|
if (class_name == GraphicsTablePropertiesEditor::staticMetaObject.className())
|
||||||
|
{
|
||||||
|
static_cast<GraphicsTablePropertiesEditor*>(editor)->setTable(table);
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
return new GraphicsTablePropertiesEditor(table, parent);
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
34
sources/factory/propertieseditorfactory.h
Normal file
34
sources/factory/propertieseditorfactory.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2020 QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef PROPERTIESEDITORFACTORY_H
|
||||||
|
#define PROPERTIESEDITORFACTORY_H
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
class QAbstractItemModel;
|
||||||
|
class QGraphicsItem;
|
||||||
|
class PropertiesEditorWidget;
|
||||||
|
class QWidget;
|
||||||
|
|
||||||
|
namespace PropertiesEditorFactory
|
||||||
|
{
|
||||||
|
PropertiesEditorWidget *propertiesEditor(QAbstractItemModel *model, PropertiesEditorWidget *editor = nullptr, QWidget *parent=nullptr);
|
||||||
|
PropertiesEditorWidget *propertiesEditor(QList<QGraphicsItem *> items, PropertiesEditorWidget *editor = nullptr, QWidget *parent = nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // PROPERTIESEDITORFACTORY_H
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "nomenclaturemodel.h"
|
#include "nomenclaturemodel.h"
|
||||||
#include "qetapp.h"
|
#include "qetapp.h"
|
||||||
|
#include "qetproject.h"
|
||||||
|
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
@@ -28,9 +29,10 @@
|
|||||||
*/
|
*/
|
||||||
NomenclatureModel::NomenclatureModel(QETProject *project, QObject *parent) :
|
NomenclatureModel::NomenclatureModel(QETProject *project, QObject *parent) :
|
||||||
QAbstractTableModel(parent),
|
QAbstractTableModel(parent),
|
||||||
m_project(project),
|
m_project(project)
|
||||||
m_database(project)
|
{
|
||||||
{}
|
connect(m_project->dataBase(), &projectDataBase::dataBaseUpdated, this, &NomenclatureModel::dataBaseUpdated);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief NomenclatureModel::rowCount
|
* @brief NomenclatureModel::rowCount
|
||||||
@@ -159,6 +161,22 @@ QVariant NomenclatureModel::data(const QModelIndex &index, int role) const
|
|||||||
void NomenclatureModel::query(const QString &query)
|
void NomenclatureModel::query(const QString &query)
|
||||||
{
|
{
|
||||||
m_query = query;
|
m_query = query;
|
||||||
m_record.clear();
|
|
||||||
m_record = m_database.elementsInfoFromQuery(query);
|
if (m_project) {
|
||||||
|
m_project->dataBase()->updateDB();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief NomenclatureModel::dataBaseUpdated
|
||||||
|
* slot called when the project database is updated
|
||||||
|
*/
|
||||||
|
void NomenclatureModel::dataBaseUpdated()
|
||||||
|
{
|
||||||
|
m_record.clear();
|
||||||
|
m_record = m_project->dataBase()->elementsInfoFromQuery(m_query);
|
||||||
|
|
||||||
|
auto row = m_record.size();
|
||||||
|
auto col = row ? m_record.first().count() : 1;
|
||||||
|
emit dataChanged(this->index(0,0), this->index(row-1, col-1), QVector<int>(Qt::DisplayRole));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include "projectdatabase.h"
|
|
||||||
|
|
||||||
|
|
||||||
class QETProject;
|
class QETProject;
|
||||||
|
|
||||||
@@ -45,10 +43,12 @@ class NomenclatureModel : public QAbstractTableModel
|
|||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
void query(const QString &query);
|
void query(const QString &query);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void dataBaseUpdated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<QETProject> m_project;
|
QPointer<QETProject> m_project;
|
||||||
QString m_query;
|
QString m_query;
|
||||||
projectDataBase m_database;
|
|
||||||
QVector<QStringList> m_record;
|
QVector<QStringList> m_record;
|
||||||
QHash<int, QHash<int, QVariant>> m_header_data;
|
QHash<int, QHash<int, QVariant>> m_header_data;
|
||||||
QHash<int, QVariant> m_index_0_0_data;
|
QHash<int, QVariant> m_index_0_0_data;
|
||||||
|
|||||||
@@ -391,6 +391,7 @@ void QetGraphicsTableItem::dataChanged(const QModelIndex &topLeft, const QModelI
|
|||||||
setUpColumnAndRowMinimumSize();
|
setUpColumnAndRowMinimumSize();
|
||||||
adjustSize();
|
adjustSize();
|
||||||
setSize(size_);
|
setSize(size_);
|
||||||
|
qDebug() << "data changed";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
#include "QPropertyUndoCommand/qpropertyundocommand.h"
|
#include "QPropertyUndoCommand/qpropertyundocommand.h"
|
||||||
#include "itemmodelcommand.h"
|
#include "itemmodelcommand.h"
|
||||||
|
#include "propertieseditorfactory.h"
|
||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QFontDialog>
|
#include <QFontDialog>
|
||||||
@@ -69,6 +70,11 @@ void GraphicsTablePropertiesEditor::setTable(QetGraphicsTableItem *table)
|
|||||||
for (auto c : m_connect_list) {
|
for (auto c : m_connect_list) {
|
||||||
disconnect(c);
|
disconnect(c);
|
||||||
}
|
}
|
||||||
|
if (m_current_model_editor)
|
||||||
|
{
|
||||||
|
ui->m_content_layout->removeWidget(m_current_model_editor);
|
||||||
|
m_current_model_editor->deleteLater();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_table_item = table;
|
m_table_item = table;
|
||||||
@@ -76,6 +82,12 @@ void GraphicsTablePropertiesEditor::setTable(QetGraphicsTableItem *table)
|
|||||||
m_connect_list << connect(m_table_item.data(), &QetGraphicsTableItem::xChanged, this, &GraphicsTablePropertiesEditor::updateUi);
|
m_connect_list << connect(m_table_item.data(), &QetGraphicsTableItem::xChanged, this, &GraphicsTablePropertiesEditor::updateUi);
|
||||||
m_connect_list << connect(m_table_item.data(), &QetGraphicsTableItem::yChanged, this, &GraphicsTablePropertiesEditor::updateUi);
|
m_connect_list << connect(m_table_item.data(), &QetGraphicsTableItem::yChanged, this, &GraphicsTablePropertiesEditor::updateUi);
|
||||||
|
|
||||||
|
|
||||||
|
if (auto editor = PropertiesEditorFactory::propertiesEditor(table->model(), this))
|
||||||
|
{
|
||||||
|
ui->m_content_layout->insertWidget(0, editor);
|
||||||
|
m_current_model_editor = editor;
|
||||||
|
}
|
||||||
updateUi();
|
updateUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class GraphicsTablePropertiesEditor : public PropertiesEditorWidget
|
|||||||
m_edit_connection;
|
m_edit_connection;
|
||||||
QButtonGroup *m_header_button_group = nullptr,
|
QButtonGroup *m_header_button_group = nullptr,
|
||||||
*m_table_button_group = nullptr;
|
*m_table_button_group = nullptr;
|
||||||
|
QWidget *m_current_model_editor = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QMargins)
|
Q_DECLARE_METATYPE(QMargins)
|
||||||
|
|||||||
@@ -6,20 +6,30 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>331</width>
|
<width>353</width>
|
||||||
<height>484</height>
|
<height>534</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTabWidget" name="m_tab">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="m_display_tab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Affichage</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Position</string>
|
<string>Position</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="label_8">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -65,6 +75,15 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QSpinBox" name="m_header_left_margin"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QSpinBox" name="m_header_bottom_margin"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QSpinBox" name="m_header_top_margin"/>
|
||||||
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -75,18 +94,9 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QSpinBox" name="m_header_left_margin"/>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QSpinBox" name="m_header_bottom_margin"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
<item row="2" column="2">
|
||||||
<widget class="QSpinBox" name="m_header_right_margin"/>
|
<widget class="QSpinBox" name="m_header_right_margin"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QSpinBox" name="m_header_top_margin"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -248,6 +258,30 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="m_content_tab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Contenu</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="m_content_layout">
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>534</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2020 The QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "nomenclaturemodelpropertieswidget.h"
|
||||||
|
#include "ui_nomenclaturemodelpropertieswidget.h"
|
||||||
|
#include "nomenclaturemodel.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief NomenclatureModelPropertiesWidget::NomenclatureModelPropertiesWidget
|
||||||
|
* @param model
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
|
NomenclatureModelPropertiesWidget::NomenclatureModelPropertiesWidget(NomenclatureModel *model, QWidget *parent) :
|
||||||
|
PropertiesEditorWidget(parent),
|
||||||
|
ui(new Ui::NomenclatureModelPropertiesWidget)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
if (model) {
|
||||||
|
setModel(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief NomenclatureModelPropertiesWidget::~NomenclatureModelPropertiesWidget
|
||||||
|
*/
|
||||||
|
NomenclatureModelPropertiesWidget::~NomenclatureModelPropertiesWidget() {
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief NomenclatureModelPropertiesWidget::setModel
|
||||||
|
* @param model
|
||||||
|
*/
|
||||||
|
void NomenclatureModelPropertiesWidget::setModel(NomenclatureModel *model) {
|
||||||
|
m_model = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NomenclatureModelPropertiesWidget::on_m_edit_query_pb_clicked()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void NomenclatureModelPropertiesWidget::on_m_refresh_pb_clicked() {
|
||||||
|
if (m_model) {
|
||||||
|
m_model->query("SELECT plant, location, label, comment, description FROM element_info ORDER BY plant, location, label, comment, description");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2020 The QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef NOMENCLATUREMODELPROPERTIESWIDGET_H
|
||||||
|
#define NOMENCLATUREMODELPROPERTIESWIDGET_H
|
||||||
|
|
||||||
|
#include "PropertiesEditor/propertieseditorwidget.h"
|
||||||
|
|
||||||
|
class NomenclatureModel;
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class NomenclatureModelPropertiesWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The NomenclatureModelPropertiesWidget class
|
||||||
|
* This class is an editor for a NomenclatureModel
|
||||||
|
*/
|
||||||
|
class NomenclatureModelPropertiesWidget : public PropertiesEditorWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit NomenclatureModelPropertiesWidget(NomenclatureModel *model = nullptr, QWidget *parent = nullptr);
|
||||||
|
~NomenclatureModelPropertiesWidget();
|
||||||
|
|
||||||
|
void setModel(NomenclatureModel *model);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_m_edit_query_pb_clicked();
|
||||||
|
void on_m_refresh_pb_clicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::NomenclatureModelPropertiesWidget *ui;
|
||||||
|
NomenclatureModel *m_model = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // NOMENCLATUREMODELPROPERTIESWIDGET_H
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>NomenclatureModelPropertiesWidget</class>
|
||||||
|
<widget class="QWidget" name="NomenclatureModelPropertiesWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>106</width>
|
||||||
|
<height>78</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="m_edit_query_pb">
|
||||||
|
<property name="text">
|
||||||
|
<string>Requette</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../qelectrotech.qrc">
|
||||||
|
<normaloff>:/ico/16x16/edit-rename.png</normaloff>:/ico/16x16/edit-rename.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="m_refresh_pb">
|
||||||
|
<property name="text">
|
||||||
|
<string>Recharger</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../qelectrotech.qrc">
|
||||||
|
<normaloff>:/ico/16x16/view-refresh.png</normaloff>:/ico/16x16/view-refresh.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../../../qelectrotech.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -46,7 +46,8 @@ static int BACKUP_INTERVAL = 120000; //interval in ms of backup = 2min
|
|||||||
*/
|
*/
|
||||||
QETProject::QETProject(QObject *parent) :
|
QETProject::QETProject(QObject *parent) :
|
||||||
QObject (parent),
|
QObject (parent),
|
||||||
m_titleblocks_collection(this)
|
m_titleblocks_collection(this),
|
||||||
|
m_data_base(this, this)
|
||||||
{
|
{
|
||||||
m_elements_collection = new XmlElementCollection(this);
|
m_elements_collection = new XmlElementCollection(this);
|
||||||
init();
|
init();
|
||||||
@@ -60,7 +61,8 @@ QETProject::QETProject(QObject *parent) :
|
|||||||
*/
|
*/
|
||||||
QETProject::QETProject(const QString &path, QObject *parent) :
|
QETProject::QETProject(const QString &path, QObject *parent) :
|
||||||
QObject (parent),
|
QObject (parent),
|
||||||
m_titleblocks_collection(this)
|
m_titleblocks_collection(this),
|
||||||
|
m_data_base(this, this)
|
||||||
{
|
{
|
||||||
QFile file(path);
|
QFile file(path);
|
||||||
m_state = openFile(&file);
|
m_state = openFile(&file);
|
||||||
@@ -78,7 +80,8 @@ QETProject::QETProject(const QString &path, QObject *parent) :
|
|||||||
*/
|
*/
|
||||||
QETProject::QETProject(KAutoSaveFile *backup, QObject *parent) :
|
QETProject::QETProject(KAutoSaveFile *backup, QObject *parent) :
|
||||||
QObject (parent),
|
QObject (parent),
|
||||||
m_titleblocks_collection(this)
|
m_titleblocks_collection(this),
|
||||||
|
m_data_base(this, this)
|
||||||
{
|
{
|
||||||
m_state = openFile(backup);
|
m_state = openFile(backup);
|
||||||
//Failed to open from the backup, try to open the crashed
|
//Failed to open from the backup, try to open the crashed
|
||||||
@@ -112,6 +115,14 @@ QETProject::~QETProject() {
|
|||||||
qDeleteAll(m_diagrams_list);
|
qDeleteAll(m_diagrams_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief QETProject::dataBase
|
||||||
|
* @return The data base of this project
|
||||||
|
*/
|
||||||
|
projectDataBase *QETProject::dataBase() {
|
||||||
|
return &m_data_base;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief QETProject::uuid
|
* @brief QETProject::uuid
|
||||||
* @return the uuid of this project
|
* @return the uuid of this project
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "titleblockproperties.h"
|
#include "titleblockproperties.h"
|
||||||
#include "templatescollection.h"
|
#include "templatescollection.h"
|
||||||
#include "properties/xrefproperties.h"
|
#include "properties/xrefproperties.h"
|
||||||
|
#include "projectdatabase.h"
|
||||||
|
|
||||||
class Diagram;
|
class Diagram;
|
||||||
class ElementsLocation;
|
class ElementsLocation;
|
||||||
@@ -71,6 +72,7 @@ class QETProject : public QObject
|
|||||||
|
|
||||||
// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
|
projectDataBase *dataBase();
|
||||||
QUuid uuid() const;
|
QUuid uuid() const;
|
||||||
ProjectState state() const;
|
ProjectState state() const;
|
||||||
QList<Diagram *> diagrams() const;
|
QList<Diagram *> diagrams() const;
|
||||||
@@ -268,6 +270,7 @@ class QETProject : public QObject
|
|||||||
m_autosave_timer;
|
m_autosave_timer;
|
||||||
KAutoSaveFile *m_backup_file = nullptr;
|
KAutoSaveFile *m_backup_file = nullptr;
|
||||||
QUuid m_uuid = QUuid::createUuid();
|
QUuid m_uuid = QUuid::createUuid();
|
||||||
|
projectDataBase m_data_base;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QETProject *)
|
Q_DECLARE_METATYPE(QETProject *)
|
||||||
|
|||||||
@@ -16,19 +16,9 @@
|
|||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "diagrampropertieseditordockwidget.h"
|
#include "diagrampropertieseditordockwidget.h"
|
||||||
#include "elementpropertieswidget.h"
|
|
||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
#include "element.h"
|
#include "PropertiesEditor/propertieseditorwidget.h"
|
||||||
#include "diagramimageitem.h"
|
#include "propertieseditorfactory.h"
|
||||||
#include "imagepropertieswidget.h"
|
|
||||||
#include "qetshapeitem.h"
|
|
||||||
#include "shapegraphicsitempropertieswidget.h"
|
|
||||||
#include "dynamicelementtextitem.h"
|
|
||||||
#include "elementtextitemgroup.h"
|
|
||||||
#include "independenttextitem.h"
|
|
||||||
#include "inditextpropertieswidget.h"
|
|
||||||
#include "qetgraphicstableitem.h"
|
|
||||||
#include "graphicstablepropertieseditor.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DiagramPropertiesEditorDockWidget::DiagramPropertiesEditorDockWidget
|
* @brief DiagramPropertiesEditorDockWidget::DiagramPropertiesEditorDockWidget
|
||||||
@@ -81,176 +71,21 @@ void DiagramPropertiesEditorDockWidget::setDiagram(Diagram *diagram)
|
|||||||
*/
|
*/
|
||||||
void DiagramPropertiesEditorDockWidget::selectionChanged()
|
void DiagramPropertiesEditorDockWidget::selectionChanged()
|
||||||
{
|
{
|
||||||
if (!m_diagram) return;
|
if (!m_diagram) {
|
||||||
|
|
||||||
int count_ = m_diagram->selectedItems().size();
|
|
||||||
|
|
||||||
//The editor widget can only edit one item
|
|
||||||
//or several items of the same type
|
|
||||||
if (count_ != 1)
|
|
||||||
{
|
|
||||||
if (count_ == 0) {
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = -1;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<QGraphicsItem *> list_ = m_diagram->selectedItems();
|
auto editor_ = PropertiesEditorFactory::propertiesEditor(m_diagram->selectedItems(), editors().count()? editors().first() : nullptr, this);
|
||||||
int type_ = list_.first()->type();
|
if (!editor_) {
|
||||||
for (QGraphicsItem *qgi : list_)
|
|
||||||
{
|
|
||||||
if (qgi->type() != type_)
|
|
||||||
{
|
|
||||||
clear();
|
clear();
|
||||||
m_edited_qgi_type = -1;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
if (editors().count() &&
|
||||||
}
|
editors().first() != editor_) {
|
||||||
|
|
||||||
QGraphicsItem *item = m_diagram->selectedItems().first();
|
|
||||||
const int type_ = item->type();
|
|
||||||
|
|
||||||
switch (type_)
|
|
||||||
{
|
|
||||||
case Element::Type: //1000
|
|
||||||
{
|
|
||||||
if (count_ > 1)
|
|
||||||
{
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = -1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//We already edit an element, just update the editor with a new element
|
|
||||||
if (m_edited_qgi_type == type_)
|
|
||||||
{
|
|
||||||
static_cast<ElementPropertiesWidget*>(editors().first())->setElement(static_cast<Element*>(item));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = type_;
|
|
||||||
addEditor(new ElementPropertiesWidget(static_cast<Element*>(item), this));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case IndependentTextItem::Type: //1005
|
|
||||||
{
|
|
||||||
QList<IndependentTextItem *> text_list;
|
|
||||||
for (QGraphicsItem *qgi : m_diagram->selectedItems()) {
|
|
||||||
text_list.append(static_cast<IndependentTextItem*>(qgi));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_edited_qgi_type == type_)
|
|
||||||
{
|
|
||||||
static_cast<IndiTextPropertiesWidget*>(editors().first())->setText(text_list);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = type_;
|
|
||||||
addEditor(new IndiTextPropertiesWidget(text_list, this));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DiagramImageItem::Type: //1007
|
|
||||||
{
|
|
||||||
if (count_ > 1)
|
|
||||||
{
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = -1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = type_;
|
|
||||||
addEditor(new ImagePropertiesWidget(static_cast<DiagramImageItem*>(item), this));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case QetShapeItem::Type: //1008
|
|
||||||
{
|
|
||||||
QList<QetShapeItem *> shapes_list;
|
|
||||||
for (QGraphicsItem *qgi : m_diagram->selectedItems()) {
|
|
||||||
shapes_list.append(static_cast<QetShapeItem*>(qgi));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_edited_qgi_type == type_)
|
|
||||||
{
|
|
||||||
static_cast<ShapeGraphicsItemPropertiesWidget*>(editors().first())->setItems(shapes_list);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = type_;
|
|
||||||
addEditor(new ShapeGraphicsItemPropertiesWidget(shapes_list, this));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DynamicElementTextItem::Type: //1010
|
|
||||||
{
|
|
||||||
if (count_ > 1)
|
|
||||||
{
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = -1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DynamicElementTextItem *deti = static_cast<DynamicElementTextItem *>(item);
|
|
||||||
|
|
||||||
//For dynamic element text, we open the element editor to edit it
|
|
||||||
//If we already edit an element, just update the editor with a new element
|
|
||||||
if (m_edited_qgi_type == Element::Type)
|
|
||||||
{
|
|
||||||
static_cast<ElementPropertiesWidget*>(editors().first())->setDynamicText(deti);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = Element::Type;
|
|
||||||
addEditor(new ElementPropertiesWidget(deti, this));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case QGraphicsItemGroup::Type:
|
|
||||||
{
|
|
||||||
if (count_ > 1)
|
|
||||||
{
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = -1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ElementTextItemGroup *group = dynamic_cast<ElementTextItemGroup *>(item))
|
|
||||||
{
|
|
||||||
//For element text item group, we open the element editor to edit it
|
|
||||||
//If we already edit an element, just update the editor with a new element
|
|
||||||
if(m_edited_qgi_type == Element::Type)
|
|
||||||
{
|
|
||||||
static_cast<ElementPropertiesWidget *>(editors().first())->setTextsGroup(group);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = Element::Type;
|
|
||||||
addEditor(new ElementPropertiesWidget(group, this));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case QetGraphicsTableItem::Type:
|
|
||||||
{
|
|
||||||
if (count_ > 1)
|
|
||||||
{
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = -1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clear();
|
|
||||||
m_edited_qgi_type = type_;
|
|
||||||
addEditor(new GraphicsTablePropertiesEditor(static_cast<QetGraphicsTableItem*>(item), this));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
m_edited_qgi_type = -1;
|
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addEditor(editor_);
|
||||||
for (PropertiesEditorWidget *pew : editors()) {
|
for (PropertiesEditorWidget *pew : editors()) {
|
||||||
pew->setLiveEdit(true);
|
pew->setLiveEdit(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user