QElectroTech  0.8-dev
elementtextpattern.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef ELEMENTTEXTPATTERN_H
19 #define ELEMENTTEXTPATTERN_H
20 
21 #include <QString>
22 #include <QDomDocument>
23 
24 class Element;
25 class QWidget;
26 
28 {
29  public:
31 
32  private:
33  QString getName(bool &ok) const;
34  QWidget *parentWidget() const;
35  QDomDocument xmlConf() const;
36 
37  private:
38  Element *m_element = nullptr;
39  QString m_name;
40 };
41 
43 {
44  public:
46 
47  private:
48  QString getName(const QStringList& list,
49  bool *ok,
50  bool *erase) const;
51  QWidget *parentWidget() const;
52  void apply(QString name, bool erase = false) const;
53 
54  private:
55  Element *m_element = nullptr;
56 };
57 
58 #endif // ELEMENTTEXTCONFIGURATION_H
ExportElementTextPattern::xmlConf
QDomDocument xmlConf() const
Definition: elementtextpattern.cpp:104
ExportElementTextPattern::ExportElementTextPattern
ExportElementTextPattern(Element *elmt)
ExportElementTextPattern::ExportElementTextPattern Constructor.
Definition: elementtextpattern.cpp:42
DynamicElementTextItem
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
Definition: dynamicelementtextitem.h:39
ExportElementTextPattern::parentWidget
QWidget * parentWidget() const
Definition: elementtextpattern.cpp:95
QetGraphicsItem::diagram
Diagram * diagram() const
Definition: qetgraphicsitem.cpp:40
DeleteQGraphicsItemCommand
Definition: deleteqgraphicsitemcommand.h:31
elementtextitemgroup.h
DiagramContent
Definition: diagramcontent.h:46
DynamicElementTextItem::fromXml
void fromXml(const QDomElement &dom_elmt) override
DynamicElementTextItem::fromXml Import this text from xml.
Definition: dynamicelementtextitem.cpp:154
addelementtextcommand.h
QET::findInDomElement
QList< QDomElement > findInDomElement(const QDomElement &, const QString &)
Definition: qet.cpp:333
ImportElementTextPattern::apply
void apply(QString name, bool erase=false) const
ImportElementTextPattern::apply Apply the user choice.
Definition: elementtextpattern.cpp:199
AddTextsGroupCommand
The AddTextsGroupCommand class Manage the adding of a texts group.
Definition: addelementtextcommand.h:54
qetapp.h
ImportElementTextPattern
Definition: elementtextpattern.h:43
importelementtextpatterndialog.h
qet.h
QET::QetMessageBox::question
QMessageBox::StandardButton question(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:53
QET::QetMessageBox::information
QMessageBox::StandardButton information(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:38
element.h
QET::writeXmlFile
bool writeXmlFile(QDomDocument &xml_doc, const QString &filepath, QString *error_message=nullptr)
Definition: qet.cpp:584
ImportElementTextPattern::parentWidget
QWidget * parentWidget() const
Definition: elementtextpattern.cpp:183
RemoveTextsGroupCommand
The RemoveTextsGroupCommand class Manage the removinf of a texts group.
Definition: addelementtextcommand.h:85
Element
Definition: element.h:41
ImportElementTextPattern::ImportElementTextPattern
ImportElementTextPattern(Element *elmt)
Definition: elementtextpattern.cpp:127
Diagram::undoStack
QUndoStack & undoStack()
Diagram::undoStack.
Definition: diagram.h:397
ImportElementTextPatternDialog::getItem
static QString getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &items, bool *ok=nullptr, bool *erase=nullptr)
ImportElementTextPatternDialog::getItem For all arguments see QInputDialog::getItem,...
Definition: importelementtextpatterndialog.cpp:43
elementtextpattern.h
ExportElementTextPattern
Definition: elementtextpattern.h:28
DiagramContent::m_element_texts
QSet< DynamicElementTextItem * > m_element_texts
Definition: diagramcontent.h:77
ExportElementTextPattern::m_element
Element * m_element
Definition: elementtextpattern.h:38
ElementTextItemGroup
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
Definition: elementtextitemgroup.h:36
ExportElementTextPattern::getName
QString getName(bool &ok) const
ExportElementTextConf::getName Open a dialog to let user set the name of the conf and return it.
Definition: elementtextpattern.cpp:81
ImportElementTextPattern::m_element
Element * m_element
Definition: elementtextpattern.h:55
ImportElementTextPattern::getName
QString getName(const QStringList &list, bool *ok, bool *erase) const
ImportElementTextPattern::getName Open a dialog to let user select a conf.
Definition: elementtextpattern.cpp:170
ExportElementTextPattern::m_name
QString m_name
Definition: elementtextpattern.h:39
dynamicelementtextitem.h
Element::toXml
virtual QDomElement toXml(QDomDocument &, QHash< Terminal *, int > &) const
Element::toXml Allows to export the element in XML.
Definition: element.cpp:1130
deleteqgraphicsitemcommand.h
Element::textGroups
QList< ElementTextItemGroup * > textGroups() const
Element::textGroups.
Definition: element.cpp:1420
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
Element::dynamicTextItems
QList< DynamicElementTextItem * > dynamicTextItems() const
Element::dynamicTextItems.
Definition: element.cpp:1316
diagram.h
QETApp::configDir
static QString configDir()
QETApp::configDir Return the QET configuration folder, i.e. the path to the folder in which QET will ...
Definition: qetapp.cpp:805
AddElementTextCommand
The AddElementTextCommand class Manage the adding of element text.
Definition: addelementtextcommand.h:34