Mod doc set style de same

This commit is contained in:
Simon De Backer
2020-08-16 11:19:36 +02:00
parent 90417ae509
commit d4ee161c07
274 changed files with 6823 additions and 6756 deletions

View File

@@ -34,12 +34,12 @@
#include "singleapplication_p.h" #include "singleapplication_p.h"
/** /**
* @brief Constructor. Checks and fires up LocalServer or closes the program @brief Constructor. Checks and fires up LocalServer or closes the program
* if another instance already exists if another instance already exists
* @param argc @param argc
* @param argv @param argv
* @param {bool} allowSecondaryInstances @param {bool} allowSecondaryInstances
*/ */
SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSecondary, Options options, int timeout ) SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSecondary, Options options, int timeout )
: app_t( argc, argv ), d_ptr( new SingleApplicationPrivate( this ) ) : app_t( argc, argv ), d_ptr( new SingleApplicationPrivate( this ) )
{ {
@@ -142,8 +142,8 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
} }
/** /**
* @brief Destructor @brief Destructor
*/ */
SingleApplication::~SingleApplication() SingleApplication::~SingleApplication()
{ {
Q_D(SingleApplication); Q_D(SingleApplication);

View File

@@ -36,10 +36,10 @@
class SingleApplicationPrivate; class SingleApplicationPrivate;
/** /**
* @brief The SingleApplication class handles multiple instances of the same @brief The SingleApplication class handles multiple instances of the same
* Application Application
* @see QCoreApplication @see QCoreApplication
*/ */
class SingleApplication : public QAPPLICATION_CLASS class SingleApplication : public QAPPLICATION_CLASS
{ {
Q_OBJECT Q_OBJECT
@@ -48,15 +48,15 @@ class SingleApplication : public QAPPLICATION_CLASS
public: public:
/** /**
* @brief Mode of operation of SingleApplication. @brief Mode of operation of SingleApplication.
* Whether the block should be user-wide or system-wide and whether the Whether the block should be user-wide or system-wide and whether the
* primary instance should be notified when a secondary instance had been primary instance should be notified when a secondary instance had been
* started. started.
* @note Operating system can restrict the shared memory blocks to the same @note Operating system can restrict the shared memory blocks to the same
* user, in which case the User/System modes will have no effect and the user, in which case the User/System modes will have no effect and the
* block will be user wide. block will be user wide.
* @enum @enum
*/ */
enum Mode { enum Mode {
User = 1 << 0, User = 1 << 0,
System = 1 << 1, System = 1 << 1,
@@ -67,59 +67,59 @@ class SingleApplication : public QAPPLICATION_CLASS
Q_DECLARE_FLAGS(Options, Mode) Q_DECLARE_FLAGS(Options, Mode)
/** /**
* @brief Intitializes a SingleApplication instance with argc command line @brief Intitializes a SingleApplication instance with argc command line
* arguments in argv arguments in argv
* @arg {int &} argc - Number of arguments in argv @arg {int &} argc - Number of arguments in argv
* @arg {const char *[]} argv - Supplied command line arguments @arg {const char *[]} argv - Supplied command line arguments
* @arg {bool} allowSecondary - Whether to start the instance as secondary @arg {bool} allowSecondary - Whether to start the instance as secondary
* if there is already a primary instance. if there is already a primary instance.
* @arg {Mode} mode - Whether for the SingleApplication block to be applied @arg {Mode} mode - Whether for the SingleApplication block to be applied
* User wide or System wide. User wide or System wide.
* @arg {int} timeout - Timeout to wait in milliseconds. @arg {int} timeout - Timeout to wait in milliseconds.
* @note argc and argv may be changed as Qt removes arguments that it @note argc and argv may be changed as Qt removes arguments that it
* recognizes recognizes
* @note Mode::SecondaryNotification only works if set on both the primary @note Mode::SecondaryNotification only works if set on both the primary
* instance and the secondary instance. instance and the secondary instance.
* @note The timeout is just a hint for the maximum time of blocking @note The timeout is just a hint for the maximum time of blocking
* operations. It does not guarantee that the SingleApplication operations. It does not guarantee that the SingleApplication
* initialisation will be completed in given time, though is a good hint. initialisation will be completed in given time, though is a good hint.
* Usually 4*timeout would be the worst case (fail) scenario. Usually 4*timeout would be the worst case (fail) scenario.
* @see See the corresponding QAPPLICATION_CLASS constructor for reference @see See the corresponding QAPPLICATION_CLASS constructor for reference
*/ */
explicit SingleApplication( int &argc, char *argv[], bool allowSecondary = false, Options options = Mode::User, int timeout = 1000 ); explicit SingleApplication( int &argc, char *argv[], bool allowSecondary = false, Options options = Mode::User, int timeout = 1000 );
~SingleApplication(); ~SingleApplication();
/** /**
* @brief Returns if the instance is the primary instance @brief Returns if the instance is the primary instance
* @returns {bool} @returns {bool}
*/ */
bool isPrimary(); bool isPrimary();
/** /**
* @brief Returns if the instance is a secondary instance @brief Returns if the instance is a secondary instance
* @returns {bool} @returns {bool}
*/ */
bool isSecondary(); bool isSecondary();
/** /**
* @brief Returns a unique identifier for the current instance @brief Returns a unique identifier for the current instance
* @returns {qint32} @returns {qint32}
*/ */
quint32 instanceId(); quint32 instanceId();
/** /**
* @brief Returns the process ID (PID) of the primary instance @brief Returns the process ID (PID) of the primary instance
* @returns {qint64} @returns {qint64}
*/ */
qint64 primaryPid(); qint64 primaryPid();
/** /**
* @brief Sends a message to the primary instance. Returns true on success. @brief Sends a message to the primary instance. Returns true on success.
* @param {int} timeout - Timeout for connecting @param {int} timeout - Timeout for connecting
* @returns {bool} @returns {bool}
* @note sendMessage() will return false if invoked from the primary @note sendMessage() will return false if invoked from the primary
* instance. instance.
*/ */
bool sendMessage( QByteArray message, int timeout = 100 ); bool sendMessage( QByteArray message, int timeout = 100 );
Q_SIGNALS: Q_SIGNALS:

View File

@@ -258,8 +258,8 @@ qint64 SingleApplicationPrivate::primaryPid()
} }
/** /**
* @brief Executed when a connection has been made to the LocalServer @brief Executed when a connection has been made to the LocalServer
*/ */
void SingleApplicationPrivate::slotConnectionEstablished() void SingleApplicationPrivate::slotConnectionEstablished()
{ {
QLocalSocket *nextConnSocket = server->nextPendingConnection(); QLocalSocket *nextConnSocket = server->nextPendingConnection();

View File

@@ -298,9 +298,9 @@ ElementsLocation ECHSToXml::copy()
/******************************************************/ /******************************************************/
/** /**
* @brief ElementCollectionHandler::ElementCollectionHandler @brief ElementCollectionHandler::ElementCollectionHandler
* @param widget @param widget
*/ */
ElementCollectionHandler::ElementCollectionHandler() {} ElementCollectionHandler::ElementCollectionHandler() {}
ElementCollectionHandler::~ElementCollectionHandler() ElementCollectionHandler::~ElementCollectionHandler()
@@ -309,14 +309,14 @@ ElementCollectionHandler::~ElementCollectionHandler()
} }
/** /**
* @brief ElementCollectionHandler::copy @brief ElementCollectionHandler::copy
* Copy the content of collection represented by source to the collection represented by destination. Copy the content of collection represented by source to the collection represented by destination.
* Destination must be a directory, else the copy do nothing and return a null ElementLocation Destination must be a directory, else the copy do nothing and return a null ElementLocation
* if destination have an item with the same name of source, a dialog ask to user what to do. if destination have an item with the same name of source, a dialog ask to user what to do.
* @param source @param source
* @param destination @param destination
* @return @return
*/ */
ElementsLocation ElementCollectionHandler::copy(ElementsLocation &source, ElementsLocation &destination) ElementsLocation ElementCollectionHandler::copy(ElementsLocation &source, ElementsLocation &destination)
{ {
if (!source.exist() || !destination.exist() || destination.isElement()) return ElementsLocation(); if (!source.exist() || !destination.exist() || destination.isElement()) return ElementsLocation();
@@ -332,14 +332,14 @@ ElementsLocation ElementCollectionHandler::copy(ElementsLocation &source, Elemen
} }
/** /**
* @brief ElementCollectionHandler::createDir @brief ElementCollectionHandler::createDir
* Create a directorie with name @name as child of @parent. Create a directorie with name @name as child of @parent.
* Parent must be a directory Parent must be a directory
* @param parent : parent of the dir to create @param parent : parent of the dir to create
* @param name : name of directorie to create @param name : name of directorie to create
* @param name_list : translations of the directorie name @param name_list : translations of the directorie name
* @return : ElementsLocation that represent the new directorie, location can be null if an error was occurred @return : ElementsLocation that represent the new directorie, location can be null if an error was occurred
*/ */
ElementsLocation ElementCollectionHandler::createDir(ElementsLocation &parent, const QString &name, const NamesList &name_list) ElementsLocation ElementCollectionHandler::createDir(ElementsLocation &parent, const QString &name, const NamesList &name_list)
{ {
//Parent must be a directorie and writable //Parent must be a directorie and writable
@@ -393,13 +393,13 @@ ElementsLocation ElementCollectionHandler::createDir(ElementsLocation &parent, c
} }
/** /**
* @brief ElementCollectionHandler::importFromProject @brief ElementCollectionHandler::importFromProject
* Import the element represented by @location to the embedded collection of @project at the same path. Import the element represented by @location to the embedded collection of @project at the same path.
* @location must represente an element owned by a project embedded collection @location must represente an element owned by a project embedded collection
* @param project : project where copy the element @param project : project where copy the element
* @param location : location to copy @param location : location to copy
* @return true if import with success @return true if import with success
*/ */
bool ElementCollectionHandler::importFromProject(QETProject *project, ElementsLocation &location) bool ElementCollectionHandler::importFromProject(QETProject *project, ElementsLocation &location)
{ {
if (!(location.isElement() && location.exist() && location.isProject())) return false; if (!(location.isElement() && location.exist() && location.isProject())) return false;
@@ -436,12 +436,12 @@ bool ElementCollectionHandler::importFromProject(QETProject *project, ElementsLo
} }
/** /**
* @brief ElementCollectionHandler::setNames @brief ElementCollectionHandler::setNames
* Set the names stored in @name_list as the names of the item represented by location Set the names stored in @name_list as the names of the item represented by location
* @param location : location to change the names @param location : location to change the names
* @param name_list : NamesList to use @param name_list : NamesList to use
* @return return true if success @return return true if success
*/ */
bool ElementCollectionHandler::setNames(ElementsLocation &location, const NamesList &name_list) bool ElementCollectionHandler::setNames(ElementsLocation &location, const NamesList &name_list)
{ {
if ( !(location.exist() && location.isWritable()) ) { if ( !(location.exist() && location.isWritable()) ) {

View File

@@ -24,9 +24,9 @@
class QWidget; class QWidget;
/** /**
* @brief The ECHStrategy class @brief The ECHStrategy class
* Abstract class for manage copy of directory or element from a collection to another Abstract class for manage copy of directory or element from a collection to another
*/ */
class ECHStrategy class ECHStrategy
{ {
public: public:
@@ -38,9 +38,9 @@ class ECHStrategy
}; };
/** /**
* @brief The ECHSFileToFile class @brief The ECHSFileToFile class
* Manage the copy of directory or element from a file system collection to another file system collection Manage the copy of directory or element from a file system collection to another file system collection
*/ */
class ECHSFileToFile : public ECHStrategy class ECHSFileToFile : public ECHStrategy
{ {
public: public:
@@ -53,9 +53,9 @@ class ECHSFileToFile : public ECHStrategy
}; };
/** /**
* @brief The ECHSXmlToFile class @brief The ECHSXmlToFile class
* Manage the copy of a directory or element from an xml collection to a file. Manage the copy of a directory or element from an xml collection to a file.
*/ */
class ECHSXmlToFile : public ECHStrategy class ECHSXmlToFile : public ECHStrategy
{ {
public: public:
@@ -68,10 +68,10 @@ class ECHSXmlToFile : public ECHStrategy
}; };
/** /**
* @brief The ECHSToXml class @brief The ECHSToXml class
* Manage the copy of a directory or element from a collection (no matter if the source is a file system collection or an xml collection) Manage the copy of a directory or element from a collection (no matter if the source is a file system collection or an xml collection)
* to an xml collection to an xml collection
*/ */
class ECHSToXml : public ECHStrategy class ECHSToXml : public ECHStrategy
{ {
public: public:
@@ -80,10 +80,10 @@ class ECHSToXml : public ECHStrategy
}; };
/** /**
* @brief The ElementCollectionHandler class @brief The ElementCollectionHandler class
* Provide several method to copy element or directory from a collection Provide several method to copy element or directory from a collection
* to another collection. to another collection.
*/ */
class ElementCollectionHandler class ElementCollectionHandler
{ {
public: public:

View File

@@ -19,16 +19,16 @@
#include "elementcollectionitem.h" #include "elementcollectionitem.h"
/** /**
* @brief ElementCollectionItem::ElementCollectionItem @brief ElementCollectionItem::ElementCollectionItem
* Constructor Constructor
*/ */
ElementCollectionItem::ElementCollectionItem() ElementCollectionItem::ElementCollectionItem()
{} {}
/** /**
* @brief ElementCollectionItem::clearData @brief ElementCollectionItem::clearData
* Reset the data Reset the data
*/ */
void ElementCollectionItem::clearData() void ElementCollectionItem::clearData()
{ {
setText(QString()); setText(QString());
@@ -38,13 +38,13 @@ void ElementCollectionItem::clearData()
} }
/** /**
* @brief ElementCollectionItem::lastItemForPath @brief ElementCollectionItem::lastItemForPath
* Return the last existing item in this ElementCollectionItem hierarchy according to the given path. Return the last existing item in this ElementCollectionItem hierarchy according to the given path.
* Next_item is the first non existing item in this hierarchy according to the given path. Next_item is the first non existing item in this hierarchy according to the given path.
* @param path : The path to find last item. The path must be in form : path/otherPath/.../.../myElement.elmt. @param path : The path to find last item. The path must be in form : path/otherPath/.../.../myElement.elmt.
* @param no_found_path : The first item that not exist in this hierarchy @param no_found_path : The first item that not exist in this hierarchy
* @return : The last item that exist in this hierarchy, or nullptr can't find (an error was occurred, or path already exist) @return : The last item that exist in this hierarchy, or nullptr can't find (an error was occurred, or path already exist)
*/ */
ElementCollectionItem *ElementCollectionItem::lastItemForPath(const QString &path, QString &no_found_path) ElementCollectionItem *ElementCollectionItem::lastItemForPath(const QString &path, QString &no_found_path)
{ {
QStringList str_list = path.split("/"); QStringList str_list = path.split("/");
@@ -67,11 +67,11 @@ ElementCollectionItem *ElementCollectionItem::lastItemForPath(const QString &pat
} }
/** /**
* @brief ElementCollectionItem::childWithCollectionName @brief ElementCollectionItem::childWithCollectionName
* Return the child with the collection name @name, else return nullptr Return the child with the collection name @name, else return nullptr
* @param name @param name
* @return @return
*/ */
ElementCollectionItem *ElementCollectionItem::childWithCollectionName(const QString& name) const ElementCollectionItem *ElementCollectionItem::childWithCollectionName(const QString& name) const
{ {
rowCount(); rowCount();
@@ -85,10 +85,10 @@ ElementCollectionItem *ElementCollectionItem::childWithCollectionName(const QStr
} }
/** /**
* @brief ElementCollectionItem::directChilds @brief ElementCollectionItem::directChilds
* Return the direct child of this item Return the direct child of this item
* @return @return
*/ */
QList<QStandardItem *> ElementCollectionItem::directChilds() const QList<QStandardItem *> ElementCollectionItem::directChilds() const
{ {
QList <QStandardItem *> item_list; QList <QStandardItem *> item_list;
@@ -100,12 +100,12 @@ QList<QStandardItem *> ElementCollectionItem::directChilds() const
} }
/** /**
* @brief ElementCollectionItem::rowForInsertItem @brief ElementCollectionItem::rowForInsertItem
* Return the row for insert a new child item to this item with name @collection_name. Return the row for insert a new child item to this item with name @collection_name.
* If row can't be found (collection_name is null, or already exist) return -1; If row can't be found (collection_name is null, or already exist) return -1;
* @param collection_name @param collection_name
* @return @return
*/ */
int ElementCollectionItem::rowForInsertItem(const QString &name) int ElementCollectionItem::rowForInsertItem(const QString &name)
{ {
if (name.isEmpty()) if (name.isEmpty())
@@ -137,10 +137,10 @@ int ElementCollectionItem::rowForInsertItem(const QString &name)
} }
/** /**
* @brief ElementCollectionItem::itemAtPath @brief ElementCollectionItem::itemAtPath
* @param path @param path
* @return the item at path or nullptr if doesn't exist @return the item at path or nullptr if doesn't exist
*/ */
ElementCollectionItem *ElementCollectionItem::itemAtPath(const QString &path) ElementCollectionItem *ElementCollectionItem::itemAtPath(const QString &path)
{ {
QStringList str_list = path.split("/"); QStringList str_list = path.split("/");
@@ -160,9 +160,9 @@ ElementCollectionItem *ElementCollectionItem::itemAtPath(const QString &path)
} }
/** /**
* @brief ElementCollectionItem::elementsDirectChild @brief ElementCollectionItem::elementsDirectChild
* @return The direct element child of this item @return The direct element child of this item
*/ */
QList<ElementCollectionItem *> ElementCollectionItem::elementsDirectChild() const QList<ElementCollectionItem *> ElementCollectionItem::elementsDirectChild() const
{ {
QList <ElementCollectionItem *> element_child; QList <ElementCollectionItem *> element_child;
@@ -177,9 +177,9 @@ QList<ElementCollectionItem *> ElementCollectionItem::elementsDirectChild() cons
} }
/** /**
* @brief ElementCollectionItem::directoriesDirectChild @brief ElementCollectionItem::directoriesDirectChild
* @return the direct directory child of this item @return the direct directory child of this item
*/ */
QList<ElementCollectionItem *> ElementCollectionItem::directoriesDirectChild() const QList<ElementCollectionItem *> ElementCollectionItem::directoriesDirectChild() const
{ {
QList <ElementCollectionItem *> dir_child; QList <ElementCollectionItem *> dir_child;
@@ -194,9 +194,9 @@ QList<ElementCollectionItem *> ElementCollectionItem::directoriesDirectChild() c
} }
/** /**
* @brief ElementCollectionItem::elementsChild @brief ElementCollectionItem::elementsChild
* @return Every elements child (direct and indirect) of this item @return Every elements child (direct and indirect) of this item
*/ */
QList<ElementCollectionItem *> ElementCollectionItem::elementsChild() const QList<ElementCollectionItem *> ElementCollectionItem::elementsChild() const
{ {
QList <ElementCollectionItem *> list = elementsDirectChild(); QList <ElementCollectionItem *> list = elementsDirectChild();
@@ -208,9 +208,9 @@ QList<ElementCollectionItem *> ElementCollectionItem::elementsChild() const
} }
/** /**
* @brief ElementCollectionItem::directoriesChild @brief ElementCollectionItem::directoriesChild
* @return Every directories child (direct and indirect) of this item @return Every directories child (direct and indirect) of this item
*/ */
QList<ElementCollectionItem *> ElementCollectionItem::directoriesChild() const QList<ElementCollectionItem *> ElementCollectionItem::directoriesChild() const
{ {
QList<ElementCollectionItem *> list = directoriesDirectChild(); QList<ElementCollectionItem *> list = directoriesDirectChild();
@@ -224,9 +224,9 @@ QList<ElementCollectionItem *> ElementCollectionItem::directoriesChild() const
} }
/** /**
* @brief ElementCollectionItem::items @brief ElementCollectionItem::items
* @return every childs of this item (direct and indirect childs) @return every childs of this item (direct and indirect childs)
*/ */
QList<ElementCollectionItem *> ElementCollectionItem::items() const QList<ElementCollectionItem *> ElementCollectionItem::items() const
{ {
QList <ElementCollectionItem *> list; QList <ElementCollectionItem *> list;

View File

@@ -21,11 +21,11 @@
#include <QStandardItem> #include <QStandardItem>
/** /**
* @brief The ElementCollectionItem class @brief The ElementCollectionItem class
* This class represent a item (a directory or an element) in a element collection. This class represent a item (a directory or an element) in a element collection.
* This class must be herited for specialisation. This class must be herited for specialisation.
* This item is used by ElementsCollectionModel for manage the elements collection This item is used by ElementsCollectionModel for manage the elements collection
*/ */
class ElementCollectionItem : public QStandardItem class ElementCollectionItem : public QStandardItem
{ {
public: public:

View File

@@ -99,15 +99,15 @@ QStringList ElementsCollectionModel::mimeTypes() const
} }
/** /**
* @brief ElementsCollectionModel::canDropMimeData @brief ElementsCollectionModel::canDropMimeData
* Reimplemented from QStandardItemModel Reimplemented from QStandardItemModel
* @param data @param data
* @param action @param action
* @param row @param row
* @param column @param column
* @param parent @param parent
* @return @return
*/ */
bool ElementsCollectionModel::canDropMimeData(const QMimeData *data, bool ElementsCollectionModel::canDropMimeData(const QMimeData *data,
Qt::DropAction action, Qt::DropAction action,
int row, int row,

View File

@@ -38,10 +38,10 @@
#include <QTimer> #include <QTimer>
/** /**
* @brief ElementsCollectionWidget::ElementsCollectionWidget @brief ElementsCollectionWidget::ElementsCollectionWidget
* Default constructor. Default constructor.
* @param parent : parent widget of this widget. @param parent : parent widget of this widget.
*/ */
ElementsCollectionWidget::ElementsCollectionWidget(QWidget *parent): ElementsCollectionWidget::ElementsCollectionWidget(QWidget *parent):
QWidget(parent), QWidget(parent),
m_model(nullptr) m_model(nullptr)
@@ -66,9 +66,9 @@ ElementsCollectionWidget::ElementsCollectionWidget(QWidget *parent):
} }
/** /**
* @brief ElementsCollectionWidget::expandFirstItems @brief ElementsCollectionWidget::expandFirstItems
* Expand each first item in the tree view Expand each first item in the tree view
*/ */
void ElementsCollectionWidget::expandFirstItems() void ElementsCollectionWidget::expandFirstItems()
{ {
if (!m_model) if (!m_model)
@@ -79,10 +79,10 @@ void ElementsCollectionWidget::expandFirstItems()
} }
/** /**
* @brief ElementsCollectionWidget::addProject @brief ElementsCollectionWidget::addProject
* Add @project to be displayed Add @project to be displayed
* @param project @param project
*/ */
void ElementsCollectionWidget::addProject(QETProject *project) void ElementsCollectionWidget::addProject(QETProject *project)
{ {
if (m_model) if (m_model)
@@ -103,10 +103,10 @@ void ElementsCollectionWidget::removeProject(QETProject *project) {
} }
/** /**
* @brief ElementsCollectionWidget::highlightUnusedElement @brief ElementsCollectionWidget::highlightUnusedElement
* highlight the unused element highlight the unused element
* @See ElementsCollectionModel::highlightUnusedElement() @See ElementsCollectionModel::highlightUnusedElement()
*/ */
void ElementsCollectionWidget::highlightUnusedElement() void ElementsCollectionWidget::highlightUnusedElement()
{ {
if (m_model) if (m_model)
@@ -114,10 +114,10 @@ void ElementsCollectionWidget::highlightUnusedElement()
} }
/** /**
* @brief ElementsCollectionWidget::setCurrentLocation @brief ElementsCollectionWidget::setCurrentLocation
* Set the current item to be the item for @location Set the current item to be the item for @location
* @param location @param location
*/ */
void ElementsCollectionWidget::setCurrentLocation(const ElementsLocation &location) void ElementsCollectionWidget::setCurrentLocation(const ElementsLocation &location)
{ {
if (!location.exist()) if (!location.exist())
@@ -151,9 +151,9 @@ void ElementsCollectionWidget::setUpAction()
} }
/** /**
* @brief ElementsCollectionWidget::setUpWidget @brief ElementsCollectionWidget::setUpWidget
* Setup this widget Setup this widget
*/ */
void ElementsCollectionWidget::setUpWidget() void ElementsCollectionWidget::setUpWidget()
{ {
//Setup the main layout //Setup the main layout
@@ -188,9 +188,9 @@ void ElementsCollectionWidget::setUpWidget()
} }
/** /**
* @brief ElementsCollectionWidget::setUpConnection @brief ElementsCollectionWidget::setUpConnection
* Setup the connection used in this widget Setup the connection used in this widget
*/ */
void ElementsCollectionWidget::setUpConnection() void ElementsCollectionWidget::setUpConnection()
{ {
connect(m_tree_view, &QTreeView::customContextMenuRequested, this, &ElementsCollectionWidget::customContextMenu); connect(m_tree_view, &QTreeView::customContextMenuRequested, this, &ElementsCollectionWidget::customContextMenu);
@@ -221,10 +221,10 @@ void ElementsCollectionWidget::setUpConnection()
} }
/** /**
* @brief ElementsCollectionWidget::customContextMenu @brief ElementsCollectionWidget::customContextMenu
* Display the context menu of this widget at @point Display the context menu of this widget at @point
* @param point @param point
*/ */
void ElementsCollectionWidget::customContextMenu(const QPoint &point) void ElementsCollectionWidget::customContextMenu(const QPoint &point)
{ {
m_index_at_context_menu = m_tree_view->indexAt(point); m_index_at_context_menu = m_tree_view->indexAt(point);
@@ -283,9 +283,9 @@ void ElementsCollectionWidget::customContextMenu(const QPoint &point)
} }
/** /**
* @brief ElementsCollectionWidget::openDir @brief ElementsCollectionWidget::openDir
* Open the directory represented by the current selected item Open the directory represented by the current selected item
*/ */
void ElementsCollectionWidget::openDir() void ElementsCollectionWidget::openDir()
{ {
ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu); ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu);
@@ -309,9 +309,9 @@ void ElementsCollectionWidget::openDir()
} }
/** /**
* @brief ElementsCollectionWidget::editElement @brief ElementsCollectionWidget::editElement
* Edit the element represented by the current selected item Edit the element represented by the current selected item
*/ */
void ElementsCollectionWidget::editElement() void ElementsCollectionWidget::editElement()
{ {
ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu); ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu);
@@ -328,9 +328,9 @@ void ElementsCollectionWidget::editElement()
} }
/** /**
* @brief ElementsCollectionWidget::deleteElement @brief ElementsCollectionWidget::deleteElement
* Delete the element represented by the current selected item. Delete the element represented by the current selected item.
*/ */
void ElementsCollectionWidget::deleteElement() void ElementsCollectionWidget::deleteElement()
{ {
ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu); ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu);
@@ -360,9 +360,9 @@ void ElementsCollectionWidget::deleteElement()
} }
/** /**
* @brief ElementsCollectionWidget::deleteDirectory @brief ElementsCollectionWidget::deleteDirectory
* Delete directory represented by the current selected item Delete directory represented by the current selected item
*/ */
void ElementsCollectionWidget::deleteDirectory() void ElementsCollectionWidget::deleteDirectory()
{ {
ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu); ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu);
@@ -394,9 +394,9 @@ void ElementsCollectionWidget::deleteDirectory()
} }
/** /**
* @brief ElementsCollectionWidget::editDirectory @brief ElementsCollectionWidget::editDirectory
* Edit the directory represented by the current selected item Edit the directory represented by the current selected item
*/ */
void ElementsCollectionWidget::editDirectory() void ElementsCollectionWidget::editDirectory()
{ {
ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu); ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu);
@@ -414,9 +414,9 @@ void ElementsCollectionWidget::editDirectory()
} }
/** /**
* @brief ElementsCollectionWidget::newDirectory @brief ElementsCollectionWidget::newDirectory
* Create a new directory Create a new directory
*/ */
void ElementsCollectionWidget::newDirectory() void ElementsCollectionWidget::newDirectory()
{ {
ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu); ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu);
@@ -433,9 +433,9 @@ void ElementsCollectionWidget::newDirectory()
} }
/** /**
* @brief ElementsCollectionWidget::newElement @brief ElementsCollectionWidget::newElement
* Create a new element. Create a new element.
*/ */
void ElementsCollectionWidget::newElement() void ElementsCollectionWidget::newElement()
{ {
ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu); ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu);
@@ -459,9 +459,9 @@ void ElementsCollectionWidget::newElement()
} }
/** /**
* @brief ElementsCollectionWidget::showThisDir @brief ElementsCollectionWidget::showThisDir
* Hide all directories except the pointed dir; Hide all directories except the pointed dir;
*/ */
void ElementsCollectionWidget::showThisDir() void ElementsCollectionWidget::showThisDir()
{ {
//Disable the yellow background of the previous index //Disable the yellow background of the previous index
@@ -487,10 +487,10 @@ void ElementsCollectionWidget::showThisDir()
} }
/** /**
* @brief ElementsCollectionWidget::resetShowThisDir @brief ElementsCollectionWidget::resetShowThisDir
* reset show this dir, all collection are show. reset show this dir, all collection are show.
* If search field isn't empty, apply the search after show all collection If search field isn't empty, apply the search after show all collection
*/ */
void ElementsCollectionWidget::resetShowThisDir() void ElementsCollectionWidget::resetShowThisDir()
{ {
if (m_showed_index.isValid()) if (m_showed_index.isValid())
@@ -505,9 +505,9 @@ void ElementsCollectionWidget::resetShowThisDir()
} }
/** /**
* @brief ElementsCollectionWidget::dirProperties @brief ElementsCollectionWidget::dirProperties
* Open an informative dialog about the curent index Open an informative dialog about the curent index
*/ */
void ElementsCollectionWidget::dirProperties() void ElementsCollectionWidget::dirProperties()
{ {
ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu); ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu);
@@ -527,8 +527,8 @@ void ElementsCollectionWidget::dirProperties()
} }
/** /**
* @brief ElementsCollectionWidget::reload, the displayed collections. @brief ElementsCollectionWidget::reload, the displayed collections.
*/ */
void ElementsCollectionWidget::reload() void ElementsCollectionWidget::reload()
{ {
m_progress_bar->show(); m_progress_bar->show();
@@ -554,9 +554,9 @@ void ElementsCollectionWidget::reload()
} }
/** /**
* @brief ElementsCollectionWidget::loadingFinished @brief ElementsCollectionWidget::loadingFinished
* Process when collection finished to be loaded Process when collection finished to be loaded
*/ */
void ElementsCollectionWidget::loadingFinished() void ElementsCollectionWidget::loadingFinished()
{ {
if (m_new_model) if (m_new_model)
@@ -579,11 +579,11 @@ void ElementsCollectionWidget::loadingFinished()
} }
/** /**
* @brief ElementsCollectionWidget::locationWasSaved @brief ElementsCollectionWidget::locationWasSaved
* This method is connected with the signal savedToLocation of Element editor (see ElementsCollectionWidget::editElement()) This method is connected with the signal savedToLocation of Element editor (see ElementsCollectionWidget::editElement())
* Update or add the item represented by location to m_model Update or add the item represented by location to m_model
* @param location @param location
*/ */
void ElementsCollectionWidget::locationWasSaved(const ElementsLocation& location) void ElementsCollectionWidget::locationWasSaved(const ElementsLocation& location)
{ {
//Because this method update an item in the model, location must //Because this method update an item in the model, location must
@@ -606,10 +606,10 @@ void ElementsCollectionWidget::locationWasSaved(const ElementsLocation& location
} }
/** /**
* @brief ElementsCollectionWidget::search @brief ElementsCollectionWidget::search
* Search every item (directory or element) that match the text of m_search_field Search every item (directory or element) that match the text of m_search_field
* and display it, other item who does not match @text is hidden and display it, other item who does not match @text is hidden
*/ */
void ElementsCollectionWidget::search() void ElementsCollectionWidget::search()
{ {
QString text = m_search_field->text(); QString text = m_search_field->text();
@@ -655,10 +655,10 @@ void ElementsCollectionWidget::search()
} }
/** /**
* @brief ElementsCollectionWidget::hideCollection @brief ElementsCollectionWidget::hideCollection
* Hide all collection displayed in this tree Hide all collection displayed in this tree
* @param hide- true = hide , false = visible @param hide- true = hide , false = visible
*/ */
void ElementsCollectionWidget::hideCollection(bool hide) void ElementsCollectionWidget::hideCollection(bool hide)
{ {
for (int i=0 ; i <m_model->rowCount() ; i++) for (int i=0 ; i <m_model->rowCount() ; i++)
@@ -666,12 +666,12 @@ void ElementsCollectionWidget::hideCollection(bool hide)
} }
/** /**
* @brief ElementsCollectionWidget::hideItem @brief ElementsCollectionWidget::hideItem
* Hide the item @index. If @recursive is true, hide all subchilds of @index Hide the item @index. If @recursive is true, hide all subchilds of @index
* @param hide- true = hide , false = visible @param hide- true = hide , false = visible
* @param index- index to hide @param index- index to hide
* @param recursive- true = apply to child , false = only for @index @param recursive- true = apply to child , false = only for @index
*/ */
void ElementsCollectionWidget::hideItem(bool hide, const QModelIndex &index, bool recursive) void ElementsCollectionWidget::hideItem(bool hide, const QModelIndex &index, bool recursive)
{ {
m_tree_view->setRowHidden(index.row(), index.parent(), hide); m_tree_view->setRowHidden(index.row(), index.parent(), hide);
@@ -682,14 +682,14 @@ void ElementsCollectionWidget::hideItem(bool hide, const QModelIndex &index, boo
} }
/** /**
* @brief ElementsCollectionWidget::showAndExpandItem @brief ElementsCollectionWidget::showAndExpandItem
* Show the item @index and expand it. Show the item @index and expand it.
* If parent is true, ensure parents of @index is show and expanded If parent is true, ensure parents of @index is show and expanded
* If child is true, ensure all childs of @index is show and expended If child is true, ensure all childs of @index is show and expended
* @param index- index to show @param index- index to show
* @param parent- Apply to parent @param parent- Apply to parent
* @param child- Apply to all childs @param child- Apply to all childs
*/ */
void ElementsCollectionWidget::showAndExpandItem(const QModelIndex &index, bool parent, bool child) void ElementsCollectionWidget::showAndExpandItem(const QModelIndex &index, bool parent, bool child)
{ {
if (index.isValid()) { if (index.isValid()) {
@@ -702,10 +702,10 @@ void ElementsCollectionWidget::showAndExpandItem(const QModelIndex &index, bool
} }
/** /**
* @brief ElementsCollectionWidget::elementCollectionItemForIndex @brief ElementsCollectionWidget::elementCollectionItemForIndex
* @param index @param index
* @return The internal pointer of index casted to ElementCollectionItem; @return The internal pointer of index casted to ElementCollectionItem;
*/ */
ElementCollectionItem *ElementsCollectionWidget::elementCollectionItemForIndex(const QModelIndex &index) { ElementCollectionItem *ElementsCollectionWidget::elementCollectionItemForIndex(const QModelIndex &index) {
if (!index.isValid()) if (!index.isValid())
return nullptr; return nullptr;

View File

@@ -34,11 +34,11 @@ class QETProject;
class ElementsTreeView; class ElementsTreeView;
/** /**
* @brief The ElementsCollectionWidget class @brief The ElementsCollectionWidget class
* This widget embedd a tree view that display the element collection (common, custom, embedded) This widget embedd a tree view that display the element collection (common, custom, embedded)
* and all action needed to use this widget. and all action needed to use this widget.
* This is the element collection widget used in the diagram editor. This is the element collection widget used in the diagram editor.
*/ */
class ElementsCollectionWidget : public QWidget class ElementsCollectionWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT

View File

@@ -125,7 +125,7 @@ bool ElementsLocation::operator!=(const ElementsLocation &other) const {
this method don't return the extension name. this method don't return the extension name.
For exemple if this location represent an element they return myElement. For exemple if this location represent an element they return myElement.
@see fileName() @see fileName()
*/ */
QString ElementsLocation::baseName() const { QString ElementsLocation::baseName() const {
QRegExp regexp("^.*([^/]+)\\.elmt$"); QRegExp regexp("^.*([^/]+)\\.elmt$");
if (regexp.exactMatch(m_collection_path)) { if (regexp.exactMatch(m_collection_path)) {

View File

@@ -29,18 +29,18 @@ static int MAX_DND_PIXMAP_WIDTH = 500;
static int MAX_DND_PIXMAP_HEIGHT = 375; static int MAX_DND_PIXMAP_HEIGHT = 375;
/** /**
* @brief ElementsTreeView::ElementsTreeView @brief ElementsTreeView::ElementsTreeView
* @param parent @param parent
*/ */
ElementsTreeView::ElementsTreeView(QWidget *parent) : ElementsTreeView::ElementsTreeView(QWidget *parent) :
QTreeView(parent) QTreeView(parent)
{} {}
/** /**
* @brief ElementsTreeView::startDrag @brief ElementsTreeView::startDrag
* Reimplemented from QTreeView Reimplemented from QTreeView
* @param supportedActions @param supportedActions
*/ */
void ElementsTreeView::startDrag(Qt::DropActions supportedActions) void ElementsTreeView::startDrag(Qt::DropActions supportedActions)
{ {
QModelIndex index = currentIndex(); QModelIndex index = currentIndex();
@@ -63,10 +63,10 @@ void ElementsTreeView::startDrag(Qt::DropActions supportedActions)
} }
/** /**
* @brief ElementsTreeView::startElementDrag @brief ElementsTreeView::startElementDrag
* Build a QDrag according to the content of @location Build a QDrag according to the content of @location
* @param location : location to use for create the content of the QDrag @param location : location to use for create the content of the QDrag
*/ */
void ElementsTreeView::startElementDrag(const ElementsLocation &location) void ElementsTreeView::startElementDrag(const ElementsLocation &location)
{ {
if (!location.exist()) if (!location.exist())

View File

@@ -23,11 +23,11 @@
class ElementsLocation; class ElementsLocation;
/** /**
* @brief The ElementsTreeView class @brief The ElementsTreeView class
* This class just reimplement startDrag from QTreeView, for set a custom pixmap. This class just reimplement startDrag from QTreeView, for set a custom pixmap.
* This class must be used when the tree view have an ElementsCollectionModel as model. This class must be used when the tree view have an ElementsCollectionModel as model.
* The pixmap used is the pixmap of the dragged element or a directory pixmap. The pixmap used is the pixmap of the dragged element or a directory pixmap.
*/ */
class ElementsTreeView : public QTreeView class ElementsTreeView : public QTreeView
{ {
public: public:

View File

@@ -22,10 +22,10 @@
#include "elementslocation.h" #include "elementslocation.h"
/** /**
* @brief The FileElementCollectionItem class @brief The FileElementCollectionItem class
* This class specialise ElementCollectionItem for manage a collection in This class specialise ElementCollectionItem for manage a collection in
* a file system. They represente a directory or an element. a file system. They represente a directory or an element.
*/ */
class FileElementCollectionItem : public ElementCollectionItem class FileElementCollectionItem : public ElementCollectionItem
{ {
public: public:

View File

@@ -22,16 +22,16 @@
#include "qetproject.h" #include "qetproject.h"
/** /**
* @brief XmlElementCollection::XmlElementCollection @brief XmlElementCollection::XmlElementCollection
* Build an empty collection. Build an empty collection.
* The collection start by : The collection start by :
* <collection> * <collection>
* <category name="import> * <category name="import>
* </category> * </category>
* </collection> * </collection>
* All elements and category are stored as child of <category name="import> All elements and category are stored as child of <category name="import>
* @param project : the project of this collection @param project : the project of this collection
*/ */
XmlElementCollection::XmlElementCollection(QETProject *project) : XmlElementCollection::XmlElementCollection(QETProject *project) :
QObject(project), QObject(project),
m_project(project) m_project(project)
@@ -71,11 +71,11 @@ XmlElementCollection::XmlElementCollection(QETProject *project) :
} }
/** /**
* @brief XmlElementCollection::XmlElementCollection @brief XmlElementCollection::XmlElementCollection
* Constructor with an collection. The tagName of @dom_element must be "collection" Constructor with an collection. The tagName of @dom_element must be "collection"
* @param dom_element -the collection in a dom_element (the dom element in cloned) @param dom_element -the collection in a dom_element (the dom element in cloned)
* @param project : the project of this collection @param project : the project of this collection
*/ */
XmlElementCollection::XmlElementCollection(const QDomElement &dom_element, QETProject *project) : XmlElementCollection::XmlElementCollection(const QDomElement &dom_element, QETProject *project) :
QObject(project), QObject(project),
m_project(project) m_project(project)
@@ -87,29 +87,29 @@ XmlElementCollection::XmlElementCollection(const QDomElement &dom_element, QETPr
} }
/** /**
* @brief XmlElementCollection::root @brief XmlElementCollection::root
* The root is the first DOM-Element the xml collection, the tag name The root is the first DOM-Element the xml collection, the tag name
* of the dom element is : collection of the dom element is : collection
* @return The root QDomElement of the collection @return The root QDomElement of the collection
*/ */
QDomElement XmlElementCollection::root() const { QDomElement XmlElementCollection::root() const {
return m_dom_document.documentElement(); return m_dom_document.documentElement();
} }
/** /**
* @brief XmlElementCollection::importCategory @brief XmlElementCollection::importCategory
* @return The QDomElement import (the begining of a xml collection) or @return The QDomElement import (the begining of a xml collection) or
* a null QDomElement if doesn't exist. a null QDomElement if doesn't exist.
*/ */
QDomElement XmlElementCollection::importCategory() const { QDomElement XmlElementCollection::importCategory() const {
return root().firstChildElement("category"); return root().firstChildElement("category");
} }
/** /**
* @brief XmlElementCollection::childs @brief XmlElementCollection::childs
* @param parent_element @param parent_element
* @return All childs element in the @parent_element tree @return All childs element in the @parent_element tree
*/ */
QDomNodeList XmlElementCollection::childs(const QDomElement &parent_element) const QDomNodeList XmlElementCollection::childs(const QDomElement &parent_element) const
{ {
if (parent_element.ownerDocument() != m_dom_document) return QDomNodeList(); if (parent_element.ownerDocument() != m_dom_document) return QDomNodeList();
@@ -117,14 +117,14 @@ QDomNodeList XmlElementCollection::childs(const QDomElement &parent_element) con
} }
/** /**
* @brief XmlElementCollection::child @brief XmlElementCollection::child
* If parent_element have child element with an attribute name = @child_name, return it, else return a null QDomElement. If parent_element have child element with an attribute name = @child_name, return it, else return a null QDomElement.
* Only search for element with tag-name "category" and "element" (if child_name end with ".elmt") Only search for element with tag-name "category" and "element" (if child_name end with ".elmt")
* @param parent_element : the parent DomElement where we search for child. @param parent_element : the parent DomElement where we search for child.
* @parent_element must be a child node of this XmlElementCollection. @parent_element must be a child node of this XmlElementCollection.
* @param child_name : name of child to search. @param child_name : name of child to search.
* @return The child QDomElement or a null QDomElement if not found @return The child QDomElement or a null QDomElement if not found
*/ */
QDomElement XmlElementCollection::child(const QDomElement &parent_element, const QString &child_name) const QDomElement XmlElementCollection::child(const QDomElement &parent_element, const QString &child_name) const
{ {
if (parent_element.ownerDocument() != m_dom_document) return QDomElement(); if (parent_element.ownerDocument() != m_dom_document) return QDomElement();
@@ -149,10 +149,10 @@ QDomElement XmlElementCollection::child(const QDomElement &parent_element, const
} }
/** /**
* @brief XmlElementCollection::child @brief XmlElementCollection::child
* @param path @param path
* @return the DomElement at path if exist, else return a null QDomElement @return the DomElement at path if exist, else return a null QDomElement
*/ */
QDomElement XmlElementCollection::child(const QString &path) const QDomElement XmlElementCollection::child(const QString &path) const
{ {
QStringList path_list = path.split("/"); QStringList path_list = path.split("/");
@@ -173,10 +173,10 @@ QDomElement XmlElementCollection::child(const QString &path) const
} }
/** /**
* @brief XmlElementCollection::directories @brief XmlElementCollection::directories
* @param parent_element @param parent_element
* @return A list of directory stored in @parent_element @return A list of directory stored in @parent_element
*/ */
QList<QDomElement> XmlElementCollection::directories(const QDomElement &parent_element) const QList<QDomElement> XmlElementCollection::directories(const QDomElement &parent_element) const
{ {
QList <QDomElement> directory_list; QList <QDomElement> directory_list;
@@ -194,10 +194,10 @@ QList<QDomElement> XmlElementCollection::directories(const QDomElement &parent_e
} }
/** /**
* @brief XmlElementCollection::directoriesNames @brief XmlElementCollection::directoriesNames
* @param parent_element @param parent_element
* @return a list of names for every child directories of @parent_element @return a list of names for every child directories of @parent_element
*/ */
QStringList XmlElementCollection::directoriesNames(const QDomElement &parent_element) const QStringList XmlElementCollection::directoriesNames(const QDomElement &parent_element) const
{ {
QList <QDomElement> childs = directories(parent_element); QList <QDomElement> childs = directories(parent_element);
@@ -214,10 +214,10 @@ QStringList XmlElementCollection::directoriesNames(const QDomElement &parent_ele
} }
/** /**
* @brief XmlElementCollection::elements @brief XmlElementCollection::elements
* @param parent_element @param parent_element
* @return A list of element stored in @parent_element @return A list of element stored in @parent_element
*/ */
QList<QDomElement> XmlElementCollection::elements(const QDomElement &parent_element) const QList<QDomElement> XmlElementCollection::elements(const QDomElement &parent_element) const
{ {
QList <QDomElement> element_list; QList <QDomElement> element_list;
@@ -235,10 +235,10 @@ QList<QDomElement> XmlElementCollection::elements(const QDomElement &parent_elem
} }
/** /**
* @brief XmlElementCollection::elementsNames @brief XmlElementCollection::elementsNames
* @param parent_element @param parent_element
* @return A list of names fr every childs element of @parent_element @return A list of names fr every childs element of @parent_element
*/ */
QStringList XmlElementCollection::elementsNames(const QDomElement &parent_element) const QStringList XmlElementCollection::elementsNames(const QDomElement &parent_element) const
{ {
QList <QDomElement> childs = elements(parent_element); QList <QDomElement> childs = elements(parent_element);
@@ -255,11 +255,11 @@ QStringList XmlElementCollection::elementsNames(const QDomElement &parent_elemen
} }
/** /**
* @brief XmlElementCollection::element @brief XmlElementCollection::element
* @param path : path of the element in this collection @param path : path of the element in this collection
* @return the QDomElement that represent the element at path @path @return the QDomElement that represent the element at path @path
* or a null QDomElement if not found or doesn't represent an element or a null QDomElement if not found or doesn't represent an element
*/ */
QDomElement XmlElementCollection::element(const QString &path) const QDomElement XmlElementCollection::element(const QString &path) const
{ {
if (!path.endsWith(".elmt")) return QDomElement(); if (!path.endsWith(".elmt")) return QDomElement();
@@ -273,11 +273,11 @@ QDomElement XmlElementCollection::element(const QString &path) const
} }
/** /**
* @brief XmlElementCollection::directory @brief XmlElementCollection::directory
* @param path : path of the directory in this collection @param path : path of the directory in this collection
* @return the QDomElement that represent the directory at path @path @return the QDomElement that represent the directory at path @path
* or a null QDomElement if not found. or a null QDomElement if not found.
*/ */
QDomElement XmlElementCollection::directory(const QString &path) const QDomElement XmlElementCollection::directory(const QString &path) const
{ {
QDomElement directory = child(path); QDomElement directory = child(path);
@@ -289,15 +289,15 @@ QDomElement XmlElementCollection::directory(const QString &path) const
} }
/** /**
* @brief XmlElementCollection::addElement @brief XmlElementCollection::addElement
* Add the element at location to this collection. Add the element at location to this collection.
* The element is copied in this collection in "import" dir with the same path, in other word The element is copied in this collection in "import" dir with the same path, in other word
* if the path is dir1/dir2/dir3/myElement.elmt, myElement is copied to this collection at the path : import/dir1/dir2/dir3/myElement.elmt if the path is dir1/dir2/dir3/myElement.elmt, myElement is copied to this collection at the path : import/dir1/dir2/dir3/myElement.elmt
* If the path doesn't exist, he was created. If the path doesn't exist, he was created.
* If the element already exist, do nothing. If the element already exist, do nothing.
* @param location, location of the element @param location, location of the element
* @return the collection path of the added item or a null QString if element can't be added. @return the collection path of the added item or a null QString if element can't be added.
*/ */
QString XmlElementCollection::addElement(ElementsLocation &location) QString XmlElementCollection::addElement(ElementsLocation &location)
{ {
//location must be an element and exist //location must be an element and exist
@@ -423,15 +423,15 @@ QString XmlElementCollection::addElement(ElementsLocation &location)
} }
/** /**
* @brief XmlElementCollection::addElementDefinition @brief XmlElementCollection::addElementDefinition
* Add the élément defintion @xml_definition in the directory at path @dir_path with the name @elmt_name. Add the élément defintion @xml_definition in the directory at path @dir_path with the name @elmt_name.
* @param dir_path : the path of the directory where we must add the element. @param dir_path : the path of the directory where we must add the element.
* The path must be an existing directory of this collection. The path must be an existing directory of this collection.
* @param elmt_name : The name used to store the element (the name must end with .elmt, if not, .elmt will be append to @elmt_name) @param elmt_name : The name used to store the element (the name must end with .elmt, if not, .elmt will be append to @elmt_name)
* @param xml_definition : The xml definition of the element. @param xml_definition : The xml definition of the element.
* The tag name of @xml_definition must be "definition". The tag name of @xml_definition must be "definition".
* @return True if the element is added with success. @return True if the element is added with success.
*/ */
bool XmlElementCollection::addElementDefinition(const QString &dir_path, const QString &elmt_name, const QDomElement &xml_definition) bool XmlElementCollection::addElementDefinition(const QString &dir_path, const QString &elmt_name, const QDomElement &xml_definition)
{ {
QDomElement dom_dir = directory(dir_path); QDomElement dom_dir = directory(dir_path);
@@ -461,12 +461,12 @@ bool XmlElementCollection::addElementDefinition(const QString &dir_path, const Q
} }
/** /**
* @brief XmlElementCollection::removeElement @brief XmlElementCollection::removeElement
* Remove the element at path @path. Remove the element at path @path.
* @param path @param path
* @return True if element is removed and emit the signal elementRemoved. @return True if element is removed and emit the signal elementRemoved.
* else false. else false.
*/ */
bool XmlElementCollection::removeElement(const QString& path) bool XmlElementCollection::removeElement(const QString& path)
{ {
QDomElement elmt = element(path); QDomElement elmt = element(path);
@@ -481,16 +481,16 @@ bool XmlElementCollection::removeElement(const QString& path)
} }
/** /**
* @brief XmlElementCollection::copy @brief XmlElementCollection::copy
* Copy the content represented by source (an element or a directory) to destination. Copy the content represented by source (an element or a directory) to destination.
* Destination must be a directory of this collection. Destination must be a directory of this collection.
* If the destination already have an item at the same path of source, he will be replaced by source. If the destination already have an item at the same path of source, he will be replaced by source.
* @param source : content to copy @param source : content to copy
* @param destination : destination of the copy, must be a directory of this collection @param destination : destination of the copy, must be a directory of this collection
* @param rename : rename the copy with @rename else use the name of source @param rename : rename the copy with @rename else use the name of source
* @param deep_copy : if true copy all childs of source (only if source is directory) @param deep_copy : if true copy all childs of source (only if source is directory)
* @return the ElementLocation that represent the copy, if copy failed return a null ElementLocation @return the ElementLocation that represent the copy, if copy failed return a null ElementLocation
*/ */
ElementsLocation XmlElementCollection::copy(ElementsLocation &source, ElementsLocation &destination, const QString& rename, bool deep_copy) ElementsLocation XmlElementCollection::copy(ElementsLocation &source, ElementsLocation &destination, const QString& rename, bool deep_copy)
{ {
if (!(source.exist() && destination.isDirectory() && destination.isProject() && destination.projectCollection() == this)) if (!(source.exist() && destination.isDirectory() && destination.isProject() && destination.projectCollection() == this))
@@ -503,11 +503,11 @@ ElementsLocation XmlElementCollection::copy(ElementsLocation &source, ElementsLo
} }
/** /**
* @brief XmlElementCollection::exist @brief XmlElementCollection::exist
* Return true if the path @path exist in this collection Return true if the path @path exist in this collection
* @param path @param path
* @return @return
*/ */
bool XmlElementCollection::exist(const QString &path) const bool XmlElementCollection::exist(const QString &path) const
{ {
if (child(path).isNull()) if (child(path).isNull())
@@ -517,14 +517,14 @@ bool XmlElementCollection::exist(const QString &path) const
} }
/** /**
* @brief XmlElementCollection::createDir @brief XmlElementCollection::createDir
* Create a child directorie at path @path with the name @name. Create a child directorie at path @path with the name @name.
* Emit directorieAdded if success. Emit directorieAdded if success.
* @param path : path of parent diectorie @param path : path of parent diectorie
* @param name : name of the directori to create. @param name : name of the directori to create.
* @param name_list : translation of the directorie name. @param name_list : translation of the directorie name.
* @return true if creation success, if directorie already exist return true. @return true if creation success, if directorie already exist return true.
*/ */
bool XmlElementCollection::createDir(const QString& path, const QString& name, const NamesList &name_list) bool XmlElementCollection::createDir(const QString& path, const QString& name, const NamesList &name_list)
{ {
QString new_dir_path = path + "/" + name; QString new_dir_path = path + "/" + name;
@@ -551,12 +551,12 @@ bool XmlElementCollection::createDir(const QString& path, const QString& name, c
} }
/** /**
* @brief XmlElementCollection::removeDir @brief XmlElementCollection::removeDir
* Remove the directory at path @path. Remove the directory at path @path.
* @param path @param path
* @return true if successfuly removed and emit directoryRemoved(QString), @return true if successfuly removed and emit directoryRemoved(QString),
* else false. else false.
*/ */
bool XmlElementCollection::removeDir(const QString& path) bool XmlElementCollection::removeDir(const QString& path)
{ {
QDomElement dir = directory(path); QDomElement dir = directory(path);
@@ -569,14 +569,14 @@ bool XmlElementCollection::removeDir(const QString& path)
} }
/** /**
* @brief XmlElementCollection::elementsLocation @brief XmlElementCollection::elementsLocation
* Return all locations stored in dom_element (element and directory). Return all locations stored in dom_element (element and directory).
* If dom_element is null, return all location owned by this collection If dom_element is null, return all location owned by this collection
* dom_element must be a child of this collection. dom_element must be a child of this collection.
* @param dom_element : dom_element where we must to search location. @param dom_element : dom_element where we must to search location.
* @param childs = if true return all childs location of dom_element, if false, only return the direct childs location of dom_element. @param childs = if true return all childs location of dom_element, if false, only return the direct childs location of dom_element.
* @return @return
*/ */
QList<ElementsLocation> XmlElementCollection::elementsLocation(QDomElement dom_element, bool childs) const QList<ElementsLocation> XmlElementCollection::elementsLocation(QDomElement dom_element, bool childs) const
{ {
QList <ElementsLocation> location_list; QList <ElementsLocation> location_list;
@@ -612,13 +612,13 @@ QList<ElementsLocation> XmlElementCollection::elementsLocation(QDomElement dom_e
} }
/** /**
* @brief XmlElementCollection::domToLocation @brief XmlElementCollection::domToLocation
* Return the element location who represent the xml element : dom_element Return the element location who represent the xml element : dom_element
* dom_element must be owned by this collection dom_element must be owned by this collection
* @param dom_element : the dom_element of this collection that represent an element. @param dom_element : the dom_element of this collection that represent an element.
* The tag name of dom_element must be "element" The tag name of dom_element must be "element"
* @return the element location, location can be null if fail. @return the element location, location can be null if fail.
*/ */
ElementsLocation XmlElementCollection::domToLocation(QDomElement dom_element) const ElementsLocation XmlElementCollection::domToLocation(QDomElement dom_element) const
{ {
if (dom_element.ownerDocument() == m_dom_document) { if (dom_element.ownerDocument() == m_dom_document) {
@@ -638,9 +638,9 @@ ElementsLocation XmlElementCollection::domToLocation(QDomElement dom_element) co
} }
/** /**
* @brief XmlElementCollection::cleanUnusedElement @brief XmlElementCollection::cleanUnusedElement
* Remove elements in this collection which is not used in the owner project Remove elements in this collection which is not used in the owner project
*/ */
void XmlElementCollection::cleanUnusedElement() void XmlElementCollection::cleanUnusedElement()
{ {
foreach (ElementsLocation loc, m_project->unusedElements()) foreach (ElementsLocation loc, m_project->unusedElements())
@@ -648,9 +648,9 @@ void XmlElementCollection::cleanUnusedElement()
} }
/** /**
* @brief XmlElementCollection::cleanUnusedDirectory @brief XmlElementCollection::cleanUnusedDirectory
* Remove the empty directories of this collection Remove the empty directories of this collection
*/ */
void XmlElementCollection::cleanUnusedDirectory() void XmlElementCollection::cleanUnusedDirectory()
{ {
QDomNodeList lst = importCategory().elementsByTagName("category"); QDomNodeList lst = importCategory().elementsByTagName("category");
@@ -666,15 +666,15 @@ void XmlElementCollection::cleanUnusedDirectory()
} }
/** /**
* @brief XmlElementCollection::copyDirectory @brief XmlElementCollection::copyDirectory
* Copy the directory represented by source to destination. Copy the directory represented by source to destination.
* if destination have a directory with the same name as source, then this directory is removed if destination have a directory with the same name as source, then this directory is removed
* @param source : directory to copy @param source : directory to copy
* @param destination : destination of the copy @param destination : destination of the copy
* @param rename : rename the copy with @rename else use the name of source @param rename : rename the copy with @rename else use the name of source
* @param deep_copy :if true copy all childs of source @param deep_copy :if true copy all childs of source
* @return the ElementLocation that represent the copy, if copy failed return a null ElementLocation @return the ElementLocation that represent the copy, if copy failed return a null ElementLocation
*/ */
ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, ElementsLocation &destination, const QString& rename, bool deep_copy) ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, ElementsLocation &destination, const QString& rename, bool deep_copy)
{ {
QString new_dir_name = rename.isEmpty() ? source.fileName() : rename; QString new_dir_name = rename.isEmpty() ? source.fileName() : rename;
@@ -754,14 +754,14 @@ ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, E
} }
/** /**
* @brief XmlElementCollection::copyElement @brief XmlElementCollection::copyElement
* Copy the element represented by source to destination (must be a directory) Copy the element represented by source to destination (must be a directory)
* If element already exist in destination he will be replaced by the new. If element already exist in destination he will be replaced by the new.
* @param source : element to copy @param source : element to copy
* @param destination : destination of the copy @param destination : destination of the copy
* @param rename : rename the copy with @rename else use the name of source @param rename : rename the copy with @rename else use the name of source
* @return The ElementsLocation of the copy @return The ElementsLocation of the copy
*/ */
ElementsLocation XmlElementCollection::copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename) ElementsLocation XmlElementCollection::copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename)
{ {
QString new_elmt_name = rename.isEmpty() ? source.fileName() : rename; QString new_elmt_name = rename.isEmpty() ? source.fileName() : rename;

View File

@@ -27,9 +27,9 @@ class QFile;
class QETProject; class QETProject;
/** /**
* @brief The XmlElementCollection class @brief The XmlElementCollection class
* This class represent a collection of elements stored to xml This class represent a collection of elements stored to xml
*/ */
class XmlElementCollection : public QObject class XmlElementCollection : public QObject
{ {
Q_OBJECT Q_OBJECT
@@ -68,34 +68,34 @@ class XmlElementCollection : public QObject
signals: signals:
/** /**
* @brief elementAdded @brief elementAdded
* This signal is emited when a element is added to this collection This signal is emited when a element is added to this collection
* @param collection_path, the path of element in this collection @param collection_path, the path of element in this collection
*/ */
void elementAdded(QString collection_path); void elementAdded(QString collection_path);
/** /**
* @brief elementChanged @brief elementChanged
* This signal is emited when the defintion of the element at path was changed This signal is emited when the defintion of the element at path was changed
* @param collection_path, the path of this element in this collection @param collection_path, the path of this element in this collection
*/ */
void elementChanged (QString collection_path); void elementChanged (QString collection_path);
/** /**
* @brief elementRemoved @brief elementRemoved
* This signal is emited when an element is removed to this collection This signal is emited when an element is removed to this collection
* @param collection_path, the path of the removed element in this collection @param collection_path, the path of the removed element in this collection
*/ */
void elementRemoved(QString collection_path); void elementRemoved(QString collection_path);
/** /**
* @brief directorieAdded @brief directorieAdded
* This signal is emited when a directorie is added to this collection This signal is emited when a directorie is added to this collection
* @param collection_path, the path of the new directorie @param collection_path, the path of the new directorie
*/ */
void directorieAdded(QString collection_path); void directorieAdded(QString collection_path);
/** /**
* @brief directoryRemoved @brief directoryRemoved
* This signal is emited when a directory is removed to this collection This signal is emited when a directory is removed to this collection
* @param collection_path, the path of the removed directory @param collection_path, the path of the removed directory
*/ */
void directoryRemoved(QString collection_path); void directoryRemoved(QString collection_path);
private: private:

View File

@@ -21,16 +21,16 @@
#include "xmlprojectelementcollectionitem.h" #include "xmlprojectelementcollectionitem.h"
/** /**
* @brief XmlProjectElementCollectionItem::XmlProjectElementCollectionItem @brief XmlProjectElementCollectionItem::XmlProjectElementCollectionItem
* Constructor Constructor
*/ */
XmlProjectElementCollectionItem::XmlProjectElementCollectionItem() XmlProjectElementCollectionItem::XmlProjectElementCollectionItem()
{} {}
/** /**
* @brief XmlProjectElementCollectionItem::isDir @brief XmlProjectElementCollectionItem::isDir
* @return true if this item represent a directory @return true if this item represent a directory
*/ */
bool XmlProjectElementCollectionItem::isDir() const bool XmlProjectElementCollectionItem::isDir() const
{ {
if (m_dom_element.tagName() == "category") return true; if (m_dom_element.tagName() == "category") return true;
@@ -38,9 +38,9 @@ bool XmlProjectElementCollectionItem::isDir() const
} }
/** /**
* @brief XmlProjectElementCollectionItem::isElement @brief XmlProjectElementCollectionItem::isElement
* @return true if this item represent an element @return true if this item represent an element
*/ */
bool XmlProjectElementCollectionItem::isElement() const bool XmlProjectElementCollectionItem::isElement() const
{ {
if (m_dom_element.tagName() == "element") return true; if (m_dom_element.tagName() == "element") return true;
@@ -48,9 +48,9 @@ bool XmlProjectElementCollectionItem::isElement() const
} }
/** /**
* @brief XmlProjectElementCollectionItem::localName @brief XmlProjectElementCollectionItem::localName
* @return the located name of this item @return the located name of this item
*/ */
QString XmlProjectElementCollectionItem::localName() QString XmlProjectElementCollectionItem::localName()
{ {
if (!text().isNull()) if (!text().isNull())
@@ -71,18 +71,18 @@ QString XmlProjectElementCollectionItem::localName()
} }
/** /**
* @brief XmlProjectElementCollectionItem::name @brief XmlProjectElementCollectionItem::name
* @return The collection name of this item @return The collection name of this item
*/ */
QString XmlProjectElementCollectionItem::name() const QString XmlProjectElementCollectionItem::name() const
{ {
return m_dom_element.attribute("name"); return m_dom_element.attribute("name");
} }
/** /**
* @brief XmlProjectElementCollectionItem::collectionPath @brief XmlProjectElementCollectionItem::collectionPath
* @return The path of this item relative to the collection. @return The path of this item relative to the collection.
*/ */
QString XmlProjectElementCollectionItem::collectionPath() const QString XmlProjectElementCollectionItem::collectionPath() const
{ {
ElementsLocation loc (embeddedPath(), m_project); ElementsLocation loc (embeddedPath(), m_project);
@@ -93,10 +93,10 @@ QString XmlProjectElementCollectionItem::collectionPath() const
} }
/** /**
* @brief XmlProjectElementCollectionItem::embeddedPath @brief XmlProjectElementCollectionItem::embeddedPath
* @return The embedde path of this item @return The embedde path of this item
* The path is in form : embed://dir/subdir/myElement.elmt The path is in form : embed://dir/subdir/myElement.elmt
*/ */
QString XmlProjectElementCollectionItem::embeddedPath() const QString XmlProjectElementCollectionItem::embeddedPath() const
{ {
if (isCollectionRoot()) if (isCollectionRoot())
@@ -114,9 +114,9 @@ QString XmlProjectElementCollectionItem::embeddedPath() const
} }
/** /**
* @brief XmlProjectElementCollectionItem::isCollectionRoot @brief XmlProjectElementCollectionItem::isCollectionRoot
* @return true if this item represent the root of collection @return true if this item represent the root of collection
*/ */
bool XmlProjectElementCollectionItem::isCollectionRoot() const bool XmlProjectElementCollectionItem::isCollectionRoot() const
{ {
if (!parent()) if (!parent())
@@ -128,11 +128,11 @@ bool XmlProjectElementCollectionItem::isCollectionRoot() const
} }
/** /**
* @brief XmlProjectElementCollectionItem::addChildAtPath @brief XmlProjectElementCollectionItem::addChildAtPath
* Ask to this item item to add a new child with collection name @collection_name Ask to this item item to add a new child with collection name @collection_name
* (the child must exist in the xml element collection) (the child must exist in the xml element collection)
* @param collection_name : name of the child item to add. @param collection_name : name of the child item to add.
*/ */
void XmlProjectElementCollectionItem::addChildAtPath(const QString &collection_name) void XmlProjectElementCollectionItem::addChildAtPath(const QString &collection_name)
{ {
if (collection_name.isEmpty()) if (collection_name.isEmpty())
@@ -155,21 +155,21 @@ void XmlProjectElementCollectionItem::addChildAtPath(const QString &collection_n
} }
/** /**
* @brief XmlProjectElementCollectionItem::project @brief XmlProjectElementCollectionItem::project
* @return the paretn project of the managed collection @return the paretn project of the managed collection
*/ */
QETProject *XmlProjectElementCollectionItem::project() const QETProject *XmlProjectElementCollectionItem::project() const
{ {
return m_project; return m_project;
} }
/** /**
* @brief XmlProjectElementCollectionItem::setProject @brief XmlProjectElementCollectionItem::setProject
* Set the project for this item. Set the project for this item.
* Use this method for set this item the root of the collection Use this method for set this item the root of the collection
* @param project : project to manage the collection @param project : project to manage the collection
* @param set_data : if true, call setUpData for every child of this item @param set_data : if true, call setUpData for every child of this item
*/ */
void XmlProjectElementCollectionItem::setProject(QETProject *project, bool set_data, bool hide_element) void XmlProjectElementCollectionItem::setProject(QETProject *project, bool set_data, bool hide_element)
{ {
if (m_project) if (m_project)
@@ -181,9 +181,9 @@ void XmlProjectElementCollectionItem::setProject(QETProject *project, bool set_d
} }
/** /**
* @brief XmlProjectElementCollectionItem::setUpData @brief XmlProjectElementCollectionItem::setUpData
* SetUp the data of this item SetUp the data of this item
*/ */
void XmlProjectElementCollectionItem::setUpData() void XmlProjectElementCollectionItem::setUpData()
{ {
//Setup the displayed name //Setup the displayed name
@@ -212,10 +212,10 @@ void XmlProjectElementCollectionItem::setUpData()
} }
/** /**
* @brief XmlProjectElementCollectionItem::setUpIcon @brief XmlProjectElementCollectionItem::setUpIcon
* SetUp the icon of this item. SetUp the icon of this item.
* Because icon use several memory, we use this method for setup icon instead setUpData. Because icon use several memory, we use this method for setup icon instead setUpData.
*/ */
void XmlProjectElementCollectionItem::setUpIcon() void XmlProjectElementCollectionItem::setUpIcon()
{ {
if (!icon().isNull()) if (!icon().isNull())
@@ -232,10 +232,10 @@ void XmlProjectElementCollectionItem::setUpIcon()
} }
/** /**
* @brief XmlProjectElementCollectionItem::populate @brief XmlProjectElementCollectionItem::populate
* Create the childs of this item Create the childs of this item
* @param set_data : if true, call setUpData for every child of this item @param set_data : if true, call setUpData for every child of this item
*/ */
void XmlProjectElementCollectionItem::populate(bool set_data, bool hide_element) void XmlProjectElementCollectionItem::populate(bool set_data, bool hide_element)
{ {
QList <QDomElement> dom_category = m_project->embeddedElementCollection()->directories(m_dom_element); QList <QDomElement> dom_category = m_project->embeddedElementCollection()->directories(m_dom_element);
@@ -267,12 +267,12 @@ void XmlProjectElementCollectionItem::populate(bool set_data, bool hide_element)
} }
/** /**
* @brief XmlProjectElementCollectionItem::setXmlElement @brief XmlProjectElementCollectionItem::setXmlElement
* Set the managed content of this item Set the managed content of this item
* @param element : the dom element (directory or element), to be managed by this item @param element : the dom element (directory or element), to be managed by this item
* @param project : the parent project of managed collection @param project : the parent project of managed collection
* @param set_data : if true, call setUpData for every child of this item @param set_data : if true, call setUpData for every child of this item
*/ */
void XmlProjectElementCollectionItem::setXmlElement(const QDomElement& element, QETProject *project, bool set_data, bool hide_element) void XmlProjectElementCollectionItem::setXmlElement(const QDomElement& element, QETProject *project, bool set_data, bool hide_element)
{ {
m_dom_element = element; m_dom_element = element;

View File

@@ -24,9 +24,9 @@
class QETProject; class QETProject;
/** /**
* @brief The XmlProjectElementCollectionItem class @brief The XmlProjectElementCollectionItem class
* This class specialise ElementCollectionItem for manage an xml collection embedded in a project. This class specialise ElementCollectionItem for manage an xml collection embedded in a project.
*/ */
class XmlProjectElementCollectionItem : public ElementCollectionItem class XmlProjectElementCollectionItem : public ElementCollectionItem
{ {
public: public:

View File

@@ -126,15 +126,15 @@ void NamesList::fromXml(const QDomElement &xml_element, const QHash<QString, QSt
} }
/** /**
* @brief NamesList::fromXml @brief NamesList::fromXml
* Load the list of lang <-> name from an xml description. Load the list of lang <-> name from an xml description.
* @xml_element must be the parent of a child element tagged "names" @xml_element must be the parent of a child element tagged "names"
* If a couple lang <-> name already exist, they will overwrited, else If a couple lang <-> name already exist, they will overwrited, else
* they will be appened. they will be appened.
* @param xml_element : xml element to analyze @param xml_element : xml element to analyze
* @param xml_options : A set of options related to XML parsing. @param xml_options : A set of options related to XML parsing.
* @see getXmlOptions() @see getXmlOptions()
*/ */
void NamesList::fromXml(const pugi::xml_node &xml_element, const QHash<QString, QString> &xml_options) void NamesList::fromXml(const pugi::xml_node &xml_element, const QHash<QString, QString> &xml_options)
{ {
QHash<QString, QString> xml_opt = getXmlOptions(xml_options); QHash<QString, QString> xml_opt = getXmlOptions(xml_options);

View File

@@ -44,10 +44,10 @@ void NameListDialog::setInformationText(const QString &text) {
} }
/** /**
* @brief NameListDialog::namelistWidget @brief NameListDialog::namelistWidget
* @return the name list widget used by this dialog. @return the name list widget used by this dialog.
* The ownership of the namelistwidget stay to this dialog The ownership of the namelistwidget stay to this dialog
*/ */
NameListWidget *NameListDialog::namelistWidget() const { NameListWidget *NameListDialog::namelistWidget() const {
return m_namelist_widget; return m_namelist_widget;
} }

View File

@@ -27,9 +27,9 @@ namespace Ui {
} }
/** /**
* @brief The NameListDialog class @brief The NameListDialog class
* Provide a dialog for let user define localized string; Provide a dialog for let user define localized string;
*/ */
class NameListDialog : public QDialog class NameListDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT

View File

@@ -36,9 +36,9 @@ NameListWidget::~NameListWidget()
} }
/** /**
* @brief NameListWidget::addLine @brief NameListWidget::addLine
* Add a new line to the name list widget Add a new line to the name list widget
*/ */
void NameListWidget::addLine() void NameListWidget::addLine()
{ {
clean(); clean();
@@ -53,10 +53,10 @@ void NameListWidget::addLine()
} }
/** /**
* @brief NameListWidget::setNames @brief NameListWidget::setNames
* Set the current names of this dialog from @name_list Set the current names of this dialog from @name_list
* @param name_list @param name_list
*/ */
void NameListWidget::setNames(const NamesList &name_list) void NameListWidget::setNames(const NamesList &name_list)
{ {
for (QString lang : name_list.langs()) for (QString lang : name_list.langs())
@@ -74,9 +74,9 @@ void NameListWidget::setNames(const NamesList &name_list)
} }
/** /**
* @brief NameListWidget::names @brief NameListWidget::names
* @return the current name list edited by this dialog @return the current name list edited by this dialog
*/ */
NamesList NameListWidget::names() const NamesList NameListWidget::names() const
{ {
NamesList nl_; NamesList nl_;
@@ -95,10 +95,10 @@ NamesList NameListWidget::names() const
} }
/** /**
* @brief NameListWidget::setReadOnly @brief NameListWidget::setReadOnly
* Set this dialog to read only or not. Set this dialog to read only or not.
* @param ro @param ro
*/ */
void NameListWidget::setReadOnly(bool ro) void NameListWidget::setReadOnly(bool ro)
{ {
m_read_only = ro; m_read_only = ro;
@@ -116,10 +116,10 @@ void NameListWidget::setReadOnly(bool ro)
} }
/** /**
* @brief NameListWidget::isEmpty @brief NameListWidget::isEmpty
* @return true if empty. @return true if empty.
* An empty dialog, is a dialog without any edited lang. An empty dialog, is a dialog without any edited lang.
*/ */
bool NameListWidget::isEmpty() const { bool NameListWidget::isEmpty() const {
return names().isEmpty(); return names().isEmpty();
} }
@@ -142,9 +142,9 @@ void NameListWidget::setClipboardValue(QHash<QString, QString> value)
} }
/** /**
* @brief NameListWidget::clean @brief NameListWidget::clean
* Clean the lists of names by removing the emtpy lines Clean the lists of names by removing the emtpy lines
*/ */
void NameListWidget::clean() void NameListWidget::clean()
{ {
int names_count = ui->m_tree->topLevelItemCount() - 1; int names_count = ui->m_tree->topLevelItemCount() - 1;

View File

@@ -26,9 +26,9 @@ namespace Ui {
} }
/** /**
* @brief The NameListWidget class @brief The NameListWidget class
* Provide a widget for let user define localized string; Provide a widget for let user define localized string;
*/ */
class NameListWidget : public QWidget class NameListWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT

View File

@@ -24,16 +24,16 @@
#include <QAbstractButton> #include <QAbstractButton>
/** /**
* @brief The PropertiesEditorDialog class @brief The PropertiesEditorDialog class
* Create a dialog to edit some properties of a thing. Create a dialog to edit some properties of a thing.
* Only create a instance of this class and call exec, all is done for you in this class. Only create a instance of this class and call exec, all is done for you in this class.
* The first argument (a template) must be a subclass of QWidget and provide the 3 methods bellow : The first argument (a template) must be a subclass of QWidget and provide the 3 methods bellow :
* QString::title() QString::title()
* void::apply() void::apply()
* void::reset() void::reset()
* You can subclass the interface PropertiesEditorWidget who provide all this methods. You can subclass the interface PropertiesEditorWidget who provide all this methods.
* This dialog take ownership of the editor, so the editor will be deleted by this dialog This dialog take ownership of the editor, so the editor will be deleted by this dialog
*/ */
class PropertiesEditorDialog : public QDialog class PropertiesEditorDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT

View File

@@ -20,10 +20,10 @@
#include "propertieseditorwidget.h" #include "propertieseditorwidget.h"
/** /**
* @brief PropertiesEditorDockWidget::PropertiesEditorDockWidget @brief PropertiesEditorDockWidget::PropertiesEditorDockWidget
* Constructor Constructor
* @param parent : parent widget @param parent : parent widget
*/ */
PropertiesEditorDockWidget::PropertiesEditorDockWidget(QWidget *parent) : PropertiesEditorDockWidget::PropertiesEditorDockWidget(QWidget *parent) :
QDockWidget(parent), QDockWidget(parent),
ui(new Ui::PropertiesEditorDockWidget) ui(new Ui::PropertiesEditorDockWidget)
@@ -32,9 +32,9 @@ PropertiesEditorDockWidget::PropertiesEditorDockWidget(QWidget *parent) :
} }
/** /**
* @brief PropertiesEditorDockWidget::~PropertiesEditorDockWidget @brief PropertiesEditorDockWidget::~PropertiesEditorDockWidget
* Destructor Destructor
*/ */
PropertiesEditorDockWidget::~PropertiesEditorDockWidget() PropertiesEditorDockWidget::~PropertiesEditorDockWidget()
{ {
clear(); clear();
@@ -42,10 +42,10 @@ PropertiesEditorDockWidget::~PropertiesEditorDockWidget()
} }
/** /**
* @brief PropertiesEditorDockWidget::clear @brief PropertiesEditorDockWidget::clear
* Remove all editor present in this dock and delete it. Remove all editor present in this dock and delete it.
* They also disabled the button box at the bottom of this dock They also disabled the button box at the bottom of this dock
*/ */
void PropertiesEditorDockWidget::clear() void PropertiesEditorDockWidget::clear()
{ {
foreach (PropertiesEditorWidget *editor, m_editor_list) foreach (PropertiesEditorWidget *editor, m_editor_list)
@@ -59,9 +59,9 @@ void PropertiesEditorDockWidget::clear()
} }
/** /**
* @brief PropertiesEditorDockWidget::apply @brief PropertiesEditorDockWidget::apply
* Call the apply method for each editor present in this dock Call the apply method for each editor present in this dock
*/ */
void PropertiesEditorDockWidget::apply() void PropertiesEditorDockWidget::apply()
{ {
foreach(PropertiesEditorWidget *editor, m_editor_list) foreach(PropertiesEditorWidget *editor, m_editor_list)
@@ -69,9 +69,9 @@ void PropertiesEditorDockWidget::apply()
} }
/** /**
* @brief PropertiesEditorDockWidget::reset @brief PropertiesEditorDockWidget::reset
* Call the reset method for each editor present in this widget Call the reset method for each editor present in this widget
*/ */
void PropertiesEditorDockWidget::reset() void PropertiesEditorDockWidget::reset()
{ {
foreach(PropertiesEditorWidget *editor, m_editor_list) foreach(PropertiesEditorWidget *editor, m_editor_list)
@@ -79,14 +79,14 @@ void PropertiesEditorDockWidget::reset()
} }
/** /**
* @brief PropertiesEditorDockWidget::addEditor @brief PropertiesEditorDockWidget::addEditor
* Add an @editor in this dock at @index in the main vertical layout (note the button box Add an @editor in this dock at @index in the main vertical layout (note the button box
* are displayed at bottom of this layout by default) are displayed at bottom of this layout by default)
* When an editor is added, we enable the button box When an editor is added, we enable the button box
* @param editor : editor to add; @param editor : editor to add;
* @param index : index of editor in the layout @param index : index of editor in the layout
* @return true if was added (or already add) or false if can't be add (editor = nullptr) @return true if was added (or already add) or false if can't be add (editor = nullptr)
*/ */
bool PropertiesEditorDockWidget::addEditor(PropertiesEditorWidget *editor, int index) bool PropertiesEditorDockWidget::addEditor(PropertiesEditorWidget *editor, int index)
{ {
if (!editor) return false; if (!editor) return false;
@@ -98,20 +98,20 @@ bool PropertiesEditorDockWidget::addEditor(PropertiesEditorWidget *editor, int i
} }
/** /**
* @brief PropertiesEditorDockWidget::editors @brief PropertiesEditorDockWidget::editors
* @return all editor used in this dock @return all editor used in this dock
*/ */
QList<PropertiesEditorWidget *> PropertiesEditorDockWidget::editors() const { QList<PropertiesEditorWidget *> PropertiesEditorDockWidget::editors() const {
return m_editor_list; return m_editor_list;
} }
/** /**
* @brief PropertiesEditorDockWidget::removeEditor @brief PropertiesEditorDockWidget::removeEditor
* Remove @editor from this dock. The editor wasn't delete a the end of this method Remove @editor from this dock. The editor wasn't delete a the end of this method
* If the editor was the last on this widget, we disabled the button box If the editor was the last on this widget, we disabled the button box
* @param editor : editor to remove @param editor : editor to remove
* @return true on success, else false @return true on success, else false
*/ */
bool PropertiesEditorDockWidget::removeEditor(PropertiesEditorWidget *editor) bool PropertiesEditorDockWidget::removeEditor(PropertiesEditorWidget *editor)
{ {
bool result = m_editor_list.removeOne(editor); bool result = m_editor_list.removeOne(editor);

View File

@@ -19,52 +19,52 @@
#include <QUndoCommand> #include <QUndoCommand>
/** /**
* @brief PropertiesEditorWidget::PropertiesEditorWidget @brief PropertiesEditorWidget::PropertiesEditorWidget
* Constructor Constructor
* @param parent : parent widget @param parent : parent widget
*/ */
PropertiesEditorWidget::PropertiesEditorWidget(QWidget *parent) : PropertiesEditorWidget::PropertiesEditorWidget(QWidget *parent) :
QWidget(parent), QWidget(parent),
m_live_edit(false) m_live_edit(false)
{} {}
/** /**
* @brief PropertiesEditorWidget::associatedUndo @brief PropertiesEditorWidget::associatedUndo
* By default, return a nullptr By default, return a nullptr
* @return nullptr @return nullptr
*/ */
QUndoCommand *PropertiesEditorWidget::associatedUndo() const{ QUndoCommand *PropertiesEditorWidget::associatedUndo() const{
return nullptr; return nullptr;
} }
/** /**
* @brief PropertiesEditorWidget::title @brief PropertiesEditorWidget::title
* @return the title of this editor @return the title of this editor
*/ */
QString PropertiesEditorWidget::title() const { QString PropertiesEditorWidget::title() const {
return QString(); return QString();
} }
/** /**
* @brief PropertiesEditorWidget::setLiveEdit @brief PropertiesEditorWidget::setLiveEdit
* Set the editor in live edit mode. Set the editor in live edit mode.
* When an editor is in live edit mode, every change is applied immediately (no need to call apply). When an editor is in live edit mode, every change is applied immediately (no need to call apply).
* If live edit can be enable, return true, else false. If live edit can be enable, return true, else false.
* By default this method do nothing and return false (live edit is disable). By default this method do nothing and return false (live edit is disable).
* Herited class of PropertiesEditorWidget must reimplemente this methode to manage the live edit mode. Herited class of PropertiesEditorWidget must reimplemente this methode to manage the live edit mode.
* @param live_edit true to enable live edit @param live_edit true to enable live edit
* @return true if live edit is enable, else false. @return true if live edit is enable, else false.
*/ */
bool PropertiesEditorWidget::setLiveEdit(bool live_edit) { bool PropertiesEditorWidget::setLiveEdit(bool live_edit) {
Q_UNUSED(live_edit); Q_UNUSED(live_edit);
return false; return false;
} }
/** /**
* @brief PropertiesEditorWidget::isLiveEdit @brief PropertiesEditorWidget::isLiveEdit
* @return true if this editor is in live edit mode @return true if this editor is in live edit mode
* else return fasle. else return fasle.
*/ */
bool PropertiesEditorWidget::isLiveEdit() const { bool PropertiesEditorWidget::isLiveEdit() const {
return m_live_edit; return m_live_edit;
} }

View File

@@ -23,10 +23,10 @@
class QUndoCommand; class QUndoCommand;
/** /**
* @brief The PropertiesEditorWidget class @brief The PropertiesEditorWidget class
* This class extend QWidget method for have common way This class extend QWidget method for have common way
* to edit propertie. to edit propertie.
*/ */
class PropertiesEditorWidget : public QWidget class PropertiesEditorWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT

View File

@@ -19,13 +19,13 @@
#include <QPropertyAnimation> #include <QPropertyAnimation>
/** /**
* @brief QPropertyUndoCommand::QPropertyUndoCommand @brief QPropertyUndoCommand::QPropertyUndoCommand
* Default constructor with old and new value Default constructor with old and new value
* This command don't take ownership of @object This command don't take ownership of @object
* @param object @param object
* @param old_value @param old_value
* @param new_value @param new_value
*/ */
QPropertyUndoCommand::QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, const QVariant &new_value, QUndoCommand *parent) : QPropertyUndoCommand::QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, const QVariant &new_value, QUndoCommand *parent) :
QUndoCommand(parent), QUndoCommand(parent),
m_object(object), m_object(object),
@@ -35,14 +35,14 @@ QPropertyUndoCommand::QPropertyUndoCommand(QObject *object, const char *property
{} {}
/** /**
* @brief QPropertyUndoCommand::QPropertyUndoCommand @brief QPropertyUndoCommand::QPropertyUndoCommand
* Default constructor with old value. Default constructor with old value.
* Call setNewValue to setup the new value of the edited QObject Call setNewValue to setup the new value of the edited QObject
* This command don't take ownership of @object This command don't take ownership of @object
* @param object @param object
* @param old_value @param old_value
* @param parent @param parent
*/ */
QPropertyUndoCommand::QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, QUndoCommand *parent) : QPropertyUndoCommand::QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, QUndoCommand *parent) :
QUndoCommand(parent), QUndoCommand(parent),
m_object(object), m_object(object),
@@ -62,29 +62,29 @@ QPropertyUndoCommand::QPropertyUndoCommand(const QPropertyUndoCommand *other)
} }
/** /**
* @brief QPropertyUndoCommand::setNewValue @brief QPropertyUndoCommand::setNewValue
* Set the new value of the property (set with redo) to @new_value Set the new value of the property (set with redo) to @new_value
* @param new_value @param new_value
*/ */
void QPropertyUndoCommand::setNewValue(const QVariant &new_value) { void QPropertyUndoCommand::setNewValue(const QVariant &new_value) {
m_new_value = new_value; m_new_value = new_value;
} }
/** /**
* @brief QPropertyUndoCommand::enableAnimation @brief QPropertyUndoCommand::enableAnimation
* True to enable animation True to enable animation
* @param animate @param animate
*/ */
void QPropertyUndoCommand::enableAnimation (bool animate) { void QPropertyUndoCommand::enableAnimation (bool animate) {
m_animate = animate; m_animate = animate;
} }
/** /**
* @brief QPropertyUndoCommand::setAnimated @brief QPropertyUndoCommand::setAnimated
* @param animate = true for animate this undo @param animate = true for animate this undo
* @param first_time = if true, the first animation is done at the first call of redo @param first_time = if true, the first animation is done at the first call of redo
* if false, the first animation is done at the second call of redo. if false, the first animation is done at the second call of redo.
*/ */
void QPropertyUndoCommand::setAnimated(bool animate, bool first_time) void QPropertyUndoCommand::setAnimated(bool animate, bool first_time)
{ {
m_animate = animate; m_animate = animate;
@@ -92,11 +92,11 @@ void QPropertyUndoCommand::setAnimated(bool animate, bool first_time)
} }
/** /**
* @brief QPropertyUndoCommand::mergeWith @brief QPropertyUndoCommand::mergeWith
* Try to merge this command with other command Try to merge this command with other command
* @param other @param other
* @return true if was merged, else false @return true if was merged, else false
*/ */
bool QPropertyUndoCommand::mergeWith(const QUndoCommand *other) bool QPropertyUndoCommand::mergeWith(const QUndoCommand *other)
{ {
if (id() != other->id() || other->childCount()) return false; if (id() != other->id() || other->childCount()) return false;
@@ -107,9 +107,9 @@ bool QPropertyUndoCommand::mergeWith(const QUndoCommand *other)
} }
/** /**
* @brief QPropertyUndoCommand::redo @brief QPropertyUndoCommand::redo
* Redo this command Redo this command
*/ */
void QPropertyUndoCommand::redo() void QPropertyUndoCommand::redo()
{ {
if (m_object->property(m_property_name) != m_new_value) if (m_object->property(m_property_name) != m_new_value)
@@ -132,9 +132,9 @@ void QPropertyUndoCommand::redo()
} }
/** /**
* @brief QPropertyUndoCommand::undo @brief QPropertyUndoCommand::undo
* Undo this command Undo this command
*/ */
void QPropertyUndoCommand::undo() void QPropertyUndoCommand::undo()
{ {
if (m_object->property(m_property_name) != m_old_value) if (m_object->property(m_property_name) != m_old_value)

View File

@@ -24,12 +24,12 @@
class QObject; class QObject;
/** /**
* @brief The QPropertyUndoCommand class @brief The QPropertyUndoCommand class
* This undo command manage QProperty of a QObject. This undo command manage QProperty of a QObject.
* This undo command can use QPropertyAnimation to animate the change when undo/redo is call This undo command can use QPropertyAnimation to animate the change when undo/redo is call
* To use animation call setAnimated(true). By default animation is disable. To use animation call setAnimated(true). By default animation is disable.
* Some QVariant date can't be animated and result this command don't work. Some QVariant date can't be animated and result this command don't work.
*/ */
class QPropertyUndoCommand : public QUndoCommand class QPropertyUndoCommand : public QUndoCommand
{ {
public: public:

View File

@@ -19,11 +19,11 @@
#include <QWidget> #include <QWidget>
/** /**
* @brief QWidgetAnimation::QWidgetAnimation @brief QWidgetAnimation::QWidgetAnimation
* @param widget : widget to animate @param widget : widget to animate
* @param orientation : animate widget horizontally or vertically @param orientation : animate widget horizontally or vertically
* @param duration : the duration of animation @see void QVariantAnimation::setDuration(int msecs) @param duration : the duration of animation @see void QVariantAnimation::setDuration(int msecs)
*/ */
QWidgetAnimation::QWidgetAnimation(QWidget *widget, Qt::Orientation orientation, QWidgetAnimation::Behavior behavior, int duration) : QWidgetAnimation::QWidgetAnimation(QWidget *widget, Qt::Orientation orientation, QWidgetAnimation::Behavior behavior, int duration) :
QPropertyAnimation(widget), QPropertyAnimation(widget),
m_orientation(orientation), m_orientation(orientation),
@@ -51,10 +51,10 @@ QWidgetAnimation::QWidgetAnimation(QWidget *widget, Qt::Orientation orientation,
} }
/** /**
* @brief QWidgetAnimation::widgetToSubtract @brief QWidgetAnimation::widgetToSubtract
* Widget to subtract the size when the behavior is availableSpace Widget to subtract the size when the behavior is availableSpace
* @param widgets @param widgets
*/ */
void QWidgetAnimation::widgetToSubtract(QVector<QWidget *> widgets) void QWidgetAnimation::widgetToSubtract(QVector<QWidget *> widgets)
{ {
m_widget_to_substract.clear(); m_widget_to_substract.clear();
@@ -62,9 +62,9 @@ void QWidgetAnimation::widgetToSubtract(QVector<QWidget *> widgets)
} }
/** /**
* @brief QWidgetAnimation::show @brief QWidgetAnimation::show
* show the widget show the widget
*/ */
void QWidgetAnimation::show() void QWidgetAnimation::show()
{ {
if (m_state == QWidgetAnimation::Showing) if (m_state == QWidgetAnimation::Showing)
@@ -113,9 +113,9 @@ void QWidgetAnimation::show()
} }
/** /**
* @brief QWidgetAnimation::hide @brief QWidgetAnimation::hide
* Hide the widget Hide the widget
*/ */
void QWidgetAnimation::hide() void QWidgetAnimation::hide()
{ {
if (m_state == QWidgetAnimation::Hidding) if (m_state == QWidgetAnimation::Hidding)
@@ -135,10 +135,10 @@ void QWidgetAnimation::hide()
} }
/** /**
* @brief QWidgetAnimation::setHidden @brief QWidgetAnimation::setHidden
* true hide, false show true hide, false show
* @param hidden @param hidden
*/ */
void QWidgetAnimation::setHidden(bool hidden) void QWidgetAnimation::setHidden(bool hidden)
{ {
if (hidden) if (hidden)
@@ -148,10 +148,10 @@ void QWidgetAnimation::setHidden(bool hidden)
} }
/** /**
* @brief QWidgetAnimation::setLastShowSize @brief QWidgetAnimation::setLastShowSize
* Force the last show size value to @size Force the last show size value to @size
* @param size @param size
*/ */
void QWidgetAnimation::setLastShowSize(int size) void QWidgetAnimation::setLastShowSize(int size)
{ {
if (m_orientation == Qt::Vertical) { if (m_orientation == Qt::Vertical) {

View File

@@ -23,18 +23,18 @@
#include <QRect> #include <QRect>
/** /**
* @brief The QWidgetAnimation class @brief The QWidgetAnimation class
* This class animate the show and hide function of a QWidget. This class animate the show and hide function of a QWidget.
* *
* The role of @behavior is to calcul as best the animation process when widget is show. The role of @behavior is to calcul as best the animation process when widget is show.
* Because this class don't change the current and final size of the widget but her maximum size during the animation process, Because this class don't change the current and final size of the widget but her maximum size during the animation process,
* we must to know in advance the final size of the widget. we must to know in advance the final size of the widget.
* Behavior minimumSizeHint : the final size of the widget will be his minimum size hint. Behavior minimumSizeHint : the final size of the widget will be his minimum size hint.
* Behavior availableSpace : the final size of widget will be the available size of her parent. Behavior availableSpace : the final size of widget will be the available size of her parent.
* Since parent can have other widgets you can add a QVector of widget to subtract of the final size. Since parent can have other widgets you can add a QVector of widget to subtract of the final size.
* Because we suppose the animated widget will take the maximum available space, we subtract the minimum size hint of widgets in QVector. Because we suppose the animated widget will take the maximum available space, we subtract the minimum size hint of widgets in QVector.
* Behavior lastSize : The widget will have the same size as the last time he was showed. Behavior lastSize : The widget will have the same size as the last time he was showed.
*/ */
class QWidgetAnimation : public QPropertyAnimation class QWidgetAnimation : public QPropertyAnimation
{ {
Q_OBJECT Q_OBJECT

View File

@@ -21,9 +21,9 @@
#include <utility> #include <utility>
/** /**
* @brief QetGraphicsHandlerItem::QetGraphicsHandlerItem @brief QetGraphicsHandlerItem::QetGraphicsHandlerItem
* @param size, the size of the handler @param size, the size of the handler
*/ */
QetGraphicsHandlerItem::QetGraphicsHandlerItem(qreal size) : QetGraphicsHandlerItem::QetGraphicsHandlerItem(qreal size) :
m_size(size) m_size(size)
{ {
@@ -34,17 +34,17 @@ QetGraphicsHandlerItem::QetGraphicsHandlerItem(qreal size) :
} }
/** /**
* @brief QetGraphicsHandlerItem::boundingRect @brief QetGraphicsHandlerItem::boundingRect
* @return @return
*/ */
QRectF QetGraphicsHandlerItem::boundingRect() const { QRectF QetGraphicsHandlerItem::boundingRect() const {
return m_br; return m_br;
} }
/** /**
* @brief QetGraphicsHandlerItem::setColor @brief QetGraphicsHandlerItem::setColor
* @param color, set the color of the handler @param color, set the color of the handler
*/ */
void QetGraphicsHandlerItem::setColor(QColor color) void QetGraphicsHandlerItem::setColor(QColor color)
{ {
m_color = std::move(color); m_color = std::move(color);
@@ -52,11 +52,11 @@ void QetGraphicsHandlerItem::setColor(QColor color)
} }
/** /**
* @brief QetGraphicsHandlerItem::paint @brief QetGraphicsHandlerItem::paint
* @param painter @param painter
* @param option @param option
* @param widget @param widget
*/ */
void QetGraphicsHandlerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) void QetGraphicsHandlerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{ {
Q_UNUSED(option) Q_UNUSED(option)
@@ -73,10 +73,10 @@ void QetGraphicsHandlerItem::paint(QPainter *painter, const QStyleOptionGraphics
} }
/** /**
* @brief QetGraphicsHandlerItem::handlerForPoint @brief QetGraphicsHandlerItem::handlerForPoint
* @param points @param points
* @return A list of handler with pos at point @return A list of handler with pos at point
*/ */
QVector<QetGraphicsHandlerItem *> QetGraphicsHandlerItem::handlerForPoint(const QVector<QPointF> &points, int size) QVector<QetGraphicsHandlerItem *> QetGraphicsHandlerItem::handlerForPoint(const QVector<QPointF> &points, int size)
{ {
QVector <QetGraphicsHandlerItem *> list_; QVector <QetGraphicsHandlerItem *> list_;

View File

@@ -22,12 +22,12 @@
#include <QPen> #include <QPen>
/** /**
* @brief The QetGraphicsHandlerItem class @brief The QetGraphicsHandlerItem class
* This graphics item represents a point, destined to be used as an handler, This graphics item represents a point, destined to be used as an handler,
* for modifie the geometrie of a another graphics item (like shapes). for modifie the geometrie of a another graphics item (like shapes).
* The graphics item to be modified, must call "installSceneEventFilter" of this item with itself for argument,. The graphics item to be modified, must call "installSceneEventFilter" of this item with itself for argument,.
* The ghraphics item to be modified, need to reimplement "sceneEventFilter" for create the modification behavior. The ghraphics item to be modified, need to reimplement "sceneEventFilter" for create the modification behavior.
*/ */
class QetGraphicsHandlerItem : public QGraphicsItem class QetGraphicsHandlerItem : public QGraphicsItem
{ {
public: public:

View File

@@ -20,19 +20,19 @@
/** /**
* @brief QetGraphicsHandlerUtility::pointsForRect @brief QetGraphicsHandlerUtility::pointsForRect
* Return the keys points of the rectangle, stored in a vector. Return the keys points of the rectangle, stored in a vector.
* The points in the vector are stored like this : The points in the vector are stored like this :
* ********** **********
* 0---1---2 0---1---2
* | | | |
* 3 4 3 4
* | | | |
* 5---6---7 5---6---7
* ************ ************
* @param rect @param rect
* @return @return
*/ */
QVector<QPointF> QetGraphicsHandlerUtility::pointsForRect(const QRectF &rect) QVector<QPointF> QetGraphicsHandlerUtility::pointsForRect(const QRectF &rect)
{ {
QVector<QPointF> vector; QVector<QPointF> vector;
@@ -56,25 +56,26 @@ QVector<QPointF> QetGraphicsHandlerUtility::pointsForRect(const QRectF &rect)
} }
/** /**
* @brief QetGraphicsHandlerUtility::pointsForLine @brief QetGraphicsHandlerUtility::pointsForLine
* The point that define a line in a QVector. The point that define a line in a QVector.
* there is two points. there is two points.
* @param line @param line
* @return @return
*/ */
QVector<QPointF> QetGraphicsHandlerUtility::pointsForLine(const QLineF &line) { QVector<QPointF> QetGraphicsHandlerUtility::pointsForLine(const QLineF &line) {
return (QVector<QPointF> {line.p1(), line.p2()}); return (QVector<QPointF> {line.p1(), line.p2()});
} }
/** /**
* @brief QetGraphicsHandlerUtility::pointsForArc @brief QetGraphicsHandlerUtility::pointsForArc
* Return the points for the given arc. Return the points for the given arc.
* The first value in the vector is the start point, the second the end point. The first value in the vector is the start point,
* @param rect the second the end point.
* @param start_angle : start angle in degree @param rect
* @param span_angle : span angle in degree; @param start_angle : start angle in degree
* @return @param span_angle : span angle in degree;
*/ @return
*/
QVector<QPointF> QetGraphicsHandlerUtility::pointsForArc(const QRectF &rect, qreal start_angle, qreal span_angle) QVector<QPointF> QetGraphicsHandlerUtility::pointsForArc(const QRectF &rect, qreal start_angle, qreal span_angle)
{ {
QVector<QPointF> vector; QVector<QPointF> vector;
@@ -88,14 +89,18 @@ QVector<QPointF> QetGraphicsHandlerUtility::pointsForArc(const QRectF &rect, qre
} }
/** /**
* @brief QetGraphicsHandlerUtility::rectForPosAtIndex @brief QetGraphicsHandlerUtility::rectForPosAtIndex
* Return a rectangle after modification of the point '@pos' at index '@index' of original rectangle '@old_rect'. Return a rectangle after modification
* @param old_rect - the rectangle befor modification of the point '@pos' at index '@index' of original rectangle '@old_rect'.
* @param pos - the new position of a key point @param old_rect - the rectangle befor modification
* @param index - the index of the key point to modifie see QetGraphicsHandlerUtility::pointsForRect to know @param pos - the new position of a key point
* the index of each keys points of a rectangle) @param index - the index of the key point to modifie
* @return : the rectangle with modification. If index is lower than 0 or higher than 7, this method return old_rect. @see QetGraphicsHandlerUtility::pointsForRect to know
*/ the index of each keys points of a rectangle)
@return : the rectangle with modification.
If index is lower than 0 or higher than 7,
this method return old_rect.
*/
QRectF QetGraphicsHandlerUtility::rectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index) QRectF QetGraphicsHandlerUtility::rectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index)
{ {
if (index < 0 || index > 7) return old_rect; if (index < 0 || index > 7) return old_rect;
@@ -114,15 +119,19 @@ QRectF QetGraphicsHandlerUtility::rectForPosAtIndex(const QRectF &old_rect, cons
} }
/** /**
* @brief QetGraphicsHandlerUtility::mirrorRectForPosAtIndex @brief QetGraphicsHandlerUtility::mirrorRectForPosAtIndex
* Return a rectangle after modification of the point '@pos' at index '@index' of original rectangle '@old_rect'. Return a rectangle after modification of the point '@pos'
* the opposite edge is modified inversely (like a mirror) at index '@index' of original rectangle '@old_rect'.
* @param old_rect : the rectangle befor modification the opposite edge is modified inversely (like a mirror)
* @param pos : the new position of a key point @param old_rect : the rectangle befor modification
* @param index : the index of the key point to modifie see QetGraphicsHandlerUtility::pointsForRect to know @param pos : the new position of a key point
* the index of each keys points of a rectangle) @param index : the index of the key point to modifie
* @return : the rectangle with modification. If index is lower than 0 or higher than 7, this method return old_rect. @see QetGraphicsHandlerUtility::pointsForRect to know
*/ the index of each keys points of a rectangle)
@return : the rectangle with modification.
If index is lower than 0 or higher than 7,
this method return old_rect.
*/
QRectF QetGraphicsHandlerUtility::mirrorRectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index) QRectF QetGraphicsHandlerUtility::mirrorRectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index)
{ {
if (index < 0 || index > 7) return old_rect; if (index < 0 || index > 7) return old_rect;
@@ -172,13 +181,13 @@ QRectF QetGraphicsHandlerUtility::mirrorRectForPosAtIndex(const QRectF &old_rect
} }
/** /**
* @brief QetGraphicsHandlerUtility::lineForPosAtIndex @brief QetGraphicsHandlerUtility::lineForPosAtIndex
* Return a line after modification of @pos at index @index of @old_line. Return a line after modification of @pos at index @index of @old_line.
* @param old_line @param old_line
* @param pos @param pos
* @param index @param index
* @return @return
*/ */
QLineF QetGraphicsHandlerUtility::lineForPosAtIndex(const QLineF &old_line, const QPointF &pos, int index) { QLineF QetGraphicsHandlerUtility::lineForPosAtIndex(const QLineF &old_line, const QPointF &pos, int index) {
QLineF line = old_line; QLineF line = old_line;
index == 0 ? line.setP1(pos) : line.setP2(pos); index == 0 ? line.setP1(pos) : line.setP2(pos);
@@ -186,12 +195,12 @@ QLineF QetGraphicsHandlerUtility::lineForPosAtIndex(const QLineF &old_line, cons
} }
/** /**
* @brief QetGraphicsHandlerUtility::polygonForInsertPoint @brief QetGraphicsHandlerUtility::polygonForInsertPoint
* @param old_polygon : the polygon which we insert a new point. @param old_polygon : the polygon which we insert a new point.
* @param closed : polygon is closed or not @param closed : polygon is closed or not
* @param pos : the pos where the new point must be added @param pos : the pos where the new point must be added
* @return the new polygon @return the new polygon
*/ */
QPolygonF QetGraphicsHandlerUtility::polygonForInsertPoint(const QPolygonF &old_polygon, bool closed, const QPointF &pos) QPolygonF QetGraphicsHandlerUtility::polygonForInsertPoint(const QPolygonF &old_polygon, bool closed, const QPointF &pos)
{ {
qreal max_angle = 0; qreal max_angle = 0;
@@ -241,15 +250,17 @@ QPolygonF QetGraphicsHandlerUtility::polygonForInsertPoint(const QPolygonF &old_
} }
/** /**
* @brief QetGraphicsHandlerUtility::pointForRadiusRect @brief QetGraphicsHandlerUtility::pointForRadiusRect
* @param rect the rectangle. @param rect the rectangle.
* @param xRadius : x radius @param xRadius : x radius
* @param yRadius : y radius @param yRadius : y radius
* @param mode : absolute or relative size: NOTE this argument is not used, this function always compute with relative size. @param mode :
* @return the points of x and y radius of a rounded rect. absolute or relative size: NOTE this argument is not used,
* The points are always based on the top right corner of the rect. this function always compute with relative size.
* the first point of vector is X the second Y @return the points of x and y radius of a rounded rect.
*/ The points are always based on the top right corner of the rect.
the first point of vector is X the second Y
*/
QVector<QPointF> QetGraphicsHandlerUtility::pointForRadiusRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode) QVector<QPointF> QetGraphicsHandlerUtility::pointForRadiusRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode)
{ {
QVector<QPointF> v; QVector<QPointF> v;
@@ -283,13 +294,13 @@ QVector<QPointF> QetGraphicsHandlerUtility::pointForRadiusRect(const QRectF &rec
} }
/** /**
* @brief QetGraphicsHandlerUtility::radiusForPosAtIndex @brief QetGraphicsHandlerUtility::radiusForPosAtIndex
* @param rect the rectangle @param rect the rectangle
* @param pos : the pos of the new radius @param pos : the pos of the new radius
* @param index : index of radius 0=X 1=Y @param index : index of radius 0=X 1=Y
* @param mode @param mode
* @return @return
*/ */
qreal QetGraphicsHandlerUtility::radiusForPosAtIndex(const QRectF &rect, const QPointF &pos, int index, Qt::SizeMode mode) qreal QetGraphicsHandlerUtility::radiusForPosAtIndex(const QRectF &rect, const QPointF &pos, int index, Qt::SizeMode mode)
{ {
if (mode == Qt::AbsoluteSize) if (mode == Qt::AbsoluteSize)

View File

@@ -26,11 +26,11 @@
class QPainter; class QPainter;
/** /**
* @brief The QetGraphicsHandlerUtility class @brief The QetGraphicsHandlerUtility class
* This class provide some methods to create and use handler for This class provide some methods to create and use handler for
* modify graphics shape like line rectangle etc... modify graphics shape like line rectangle etc...
* They also provide some conveniance static method. They also provide some conveniance static method.
*/ */
class QetGraphicsHandlerUtility class QetGraphicsHandlerUtility
{ {
public: public:

View File

@@ -32,11 +32,12 @@ SearchAndReplaceWorker::SearchAndReplaceWorker()
} }
/** /**
* @brief SearchAndReplaceWorker::replaceDiagram @brief SearchAndReplaceWorker::replaceDiagram
* Replace all properties of each diagram in @diagram_list, Replace all properties of each diagram in @diagram_list,
* by the current titleblock propertie of this worker by the current titleblock propertie of this worker
* @param diagram_list, list of diagram to be changed, all diagrams must belong to the same project; @param diagram_list, list of diagram to be changed,
*/ all diagrams must belong to the same project;
*/
void SearchAndReplaceWorker::replaceDiagram(QList<Diagram *> diagram_list) void SearchAndReplaceWorker::replaceDiagram(QList<Diagram *> diagram_list)
{ {
if (diagram_list.isEmpty()) { if (diagram_list.isEmpty()) {
@@ -91,12 +92,14 @@ void SearchAndReplaceWorker::replaceDiagram(Diagram *diagram)
} }
/** /**
* @brief SearchAndReplaceWorker::replaceElement @brief SearchAndReplaceWorker::replaceElement
* Replace all properties of each elements in @list Replace all properties of each elements in @list
* All element must belong to the same project, if not this function do nothing. All element must belong to the same project,
* All change are made through a undo command append to undo list of the project. if not this function do nothing.
* @param list All change are made through a undo command append
*/ to undo list of the project.
@param list
*/
void SearchAndReplaceWorker::replaceElement(QList<Element *> list) void SearchAndReplaceWorker::replaceElement(QList<Element *> list)
{ {
if (list.isEmpty() || !list.first()->diagram()) { if (list.isEmpty() || !list.first()->diagram()) {
@@ -147,11 +150,11 @@ void SearchAndReplaceWorker::replaceElement(Element *element)
} }
/** /**
* @brief SearchAndReplaceWorker::replaceIndiText @brief SearchAndReplaceWorker::replaceIndiText
* Replace all displayed text of independent text of @list Replace all displayed text of independent text of @list
* Each must belong to the same project, if not this function do nothing Each must belong to the same project, if not this function do nothing
* @param list @param list
*/ */
void SearchAndReplaceWorker::replaceIndiText(QList<IndependentTextItem *> list) void SearchAndReplaceWorker::replaceIndiText(QList<IndependentTextItem *> list)
{ {
if (list.isEmpty() || !list.first()->diagram()) { if (list.isEmpty() || !list.first()->diagram()) {
@@ -183,12 +186,14 @@ void SearchAndReplaceWorker::replaceIndiText(IndependentTextItem *text)
} }
/** /**
* @brief SearchAndReplaceWorker::replaceConductor @brief SearchAndReplaceWorker::replaceConductor
* Replace all properties of each conductor in @list Replace all properties of each conductor in @list
* All conductor must belong to the same project, if not this function do nothing. All conductor must belong to the same project,
* All change are made through a undo command append to undo list of the project. if not this function do nothing.
* @param list All change are made through a undo command append
*/ to undo list of the project.
@param list
*/
void SearchAndReplaceWorker::replaceConductor(QList<Conductor *> list) void SearchAndReplaceWorker::replaceConductor(QList<Conductor *> list)
{ {
if (list.isEmpty() || !list.first()->diagram()) { if (list.isEmpty() || !list.first()->diagram()) {
@@ -232,15 +237,15 @@ void SearchAndReplaceWorker::replaceConductor(Conductor *conductor)
} }
/** /**
* @brief SearchAndReplaceWorker::replaceAdvanced @brief SearchAndReplaceWorker::replaceAdvanced
* Apply the change of text according to the current advancedStruct Apply the change of text according to the current advancedStruct
* All items in the 4 list must belong to the same QETProject, All items in the 4 list must belong to the same QETProject,
* if not this function do nothing if not this function do nothing
* @param d @param d
* @param e @param e
* @param t @param t
* @param c @param c
*/ */
void SearchAndReplaceWorker::replaceAdvanced(QList<Diagram *> diagrams, QList<Element *> elements, QList<IndependentTextItem *> texts, QList<Conductor *> conductors) void SearchAndReplaceWorker::replaceAdvanced(QList<Diagram *> diagrams, QList<Element *> elements, QList<IndependentTextItem *> texts, QList<Conductor *> conductors)
{ {
QETProject *project_ = nullptr; QETProject *project_ = nullptr;
@@ -348,15 +353,17 @@ void SearchAndReplaceWorker::replaceAdvanced(QList<Diagram *> diagrams, QList<El
} }
/** /**
* @brief SearchAndReplaceWorker::setupLineEdit @brief SearchAndReplaceWorker::setupLineEdit
* With search and replace, when the variable to edit is a text, With search and replace, when the variable to edit is a text,
* the editor is always the same no matter if it is for a folio, element or conductor. the editor is always the same no matter if it is for a folio,
* The editor is a QLineEdit to edit the text and checkbox to erase the text if checked. element or conductor.
* This function fill the editor, from the current string The editor is a QLineEdit to edit the text
* @param l and checkbox to erase the text if checked.
* @param cb This function fill the editor, from the current string
* @param str @param l
*/ @param cb
@param str
*/
void SearchAndReplaceWorker::setupLineEdit(QLineEdit *l, QCheckBox *cb, QString str) void SearchAndReplaceWorker::setupLineEdit(QLineEdit *l, QCheckBox *cb, QString str)
{ {
l->setText(str); l->setText(str);
@@ -385,11 +392,11 @@ ConductorProperties SearchAndReplaceWorker::invalidConductorProperties()
} }
/** /**
* @brief SearchAndReplaceWorker::applyChange @brief SearchAndReplaceWorker::applyChange
* @param original : the original properties @param original : the original properties
* @param change : the change properties, to be merged with @original @param change : the change properties, to be merged with @original
* @return a new conductor properties with the change applyed. @return a new conductor properties with the change applyed.
*/ */
ConductorProperties SearchAndReplaceWorker::applyChange(const ConductorProperties &original, const ConductorProperties &change) ConductorProperties SearchAndReplaceWorker::applyChange(const ConductorProperties &original, const ConductorProperties &change)
{ {
ConductorProperties new_properties = original; ConductorProperties new_properties = original;
@@ -420,11 +427,11 @@ ConductorProperties SearchAndReplaceWorker::applyChange(const ConductorPropertie
} }
/** /**
* @brief SearchAndReplaceWorker::applyChange @brief SearchAndReplaceWorker::applyChange
* @param original : the original string @param original : the original string
* @param change : the changed string: @param change : the changed string:
* @return the string to be use in the properties @return the string to be use in the properties
*/ */
QString SearchAndReplaceWorker::applyChange(const QString &original, const QString &change) QString SearchAndReplaceWorker::applyChange(const QString &original, const QString &change)
{ {
if (change.isEmpty()) {return original;} if (change.isEmpty()) {return original;}
@@ -433,11 +440,11 @@ QString SearchAndReplaceWorker::applyChange(const QString &original, const QStri
} }
/** /**
* @brief SearchAndReplaceWorker::replaceAdvanced @brief SearchAndReplaceWorker::replaceAdvanced
* @param diagram @param diagram
* @return the titleblock properties with the change applied, @return the titleblock properties with the change applied,
* according to the state of @m_advanced_struct according to the state of @m_advanced_struct
*/ */
TitleBlockProperties SearchAndReplaceWorker::replaceAdvanced(Diagram *diagram) TitleBlockProperties SearchAndReplaceWorker::replaceAdvanced(Diagram *diagram)
{ {
TitleBlockProperties p = diagram->border_and_titleblock.exportTitleBlock(); TitleBlockProperties p = diagram->border_and_titleblock.exportTitleBlock();
@@ -459,11 +466,11 @@ TitleBlockProperties SearchAndReplaceWorker::replaceAdvanced(Diagram *diagram)
} }
/** /**
* @brief SearchAndReplaceWorker::replaceAdvanced @brief SearchAndReplaceWorker::replaceAdvanced
* @param element @param element
* @return The diagram context with the change applied, @return The diagram context with the change applied,
* according to the state of @m_advanced_struct according to the state of @m_advanced_struct
*/ */
DiagramContext SearchAndReplaceWorker::replaceAdvanced(Element *element) DiagramContext SearchAndReplaceWorker::replaceAdvanced(Element *element)
{ {
DiagramContext context = element->elementInformations(); DiagramContext context = element->elementInformations();
@@ -484,11 +491,11 @@ DiagramContext SearchAndReplaceWorker::replaceAdvanced(Element *element)
} }
/** /**
* @brief SearchAndReplaceWorker::replaceAdvanced @brief SearchAndReplaceWorker::replaceAdvanced
* @param conductor @param conductor
* @return the conductor properties with the change applied, @return the conductor properties with the change applied,
* according to the state of @m_advanced_struct according to the state of @m_advanced_struct
*/ */
ConductorProperties SearchAndReplaceWorker::replaceAdvanced(Conductor *conductor) ConductorProperties SearchAndReplaceWorker::replaceAdvanced(Conductor *conductor)
{ {
ConductorProperties properties = conductor->properties(); ConductorProperties properties = conductor->properties();

View File

@@ -44,9 +44,10 @@ struct advancedReplaceStruct
}; };
/** /**
* @brief The SearchAndReplaceWorker class @brief The SearchAndReplaceWorker class
* This class is the worker use to change properties when use the search and replace function of QET This class is the worker use to change properties
*/ when use the search and replace function of QET
*/
class SearchAndReplaceWorker class SearchAndReplaceWorker
{ {
public: public:

View File

@@ -22,10 +22,10 @@
#include <QAbstractButton> #include <QAbstractButton>
/** /**
* @brief replaceAdvancedDialog::replaceAdvancedDialog @brief replaceAdvancedDialog::replaceAdvancedDialog
* @param advanced @param advanced
* @param parent @param parent
*/ */
replaceAdvancedDialog::replaceAdvancedDialog(advancedReplaceStruct advanced, QWidget *parent) : replaceAdvancedDialog::replaceAdvancedDialog(advancedReplaceStruct advanced, QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::replaceAdvancedDialog) ui(new Ui::replaceAdvancedDialog)
@@ -47,10 +47,10 @@ replaceAdvancedDialog::~replaceAdvancedDialog()
} }
/** /**
* @brief replaceAdvancedDialog::setAdvancedStruct @brief replaceAdvancedDialog::setAdvancedStruct
* Set the edited advanced struct Set the edited advanced struct
* @param advanced @param advanced
*/ */
void replaceAdvancedDialog::setAdvancedStruct(advancedReplaceStruct advanced) void replaceAdvancedDialog::setAdvancedStruct(advancedReplaceStruct advanced)
{ {
int index = advanced.who; int index = advanced.who;
@@ -73,9 +73,9 @@ void replaceAdvancedDialog::setAdvancedStruct(advancedReplaceStruct advanced)
} }
/** /**
* @brief replaceAdvancedDialog::advancedStruct @brief replaceAdvancedDialog::advancedStruct
* @return the edited advanced struct @return the edited advanced struct
*/ */
advancedReplaceStruct replaceAdvancedDialog::advancedStruct() const advancedReplaceStruct replaceAdvancedDialog::advancedStruct() const
{ {
advancedReplaceStruct a; advancedReplaceStruct a;
@@ -110,9 +110,9 @@ void replaceAdvancedDialog::fillWhatComboBox(int index)
} }
/** /**
* @brief replaceAdvancedDialog::on_m_who_cb_currentIndexChanged @brief replaceAdvancedDialog::on_m_who_cb_currentIndexChanged
* @param index @param index
*/ */
void replaceAdvancedDialog::on_m_who_cb_currentIndexChanged(int index) { void replaceAdvancedDialog::on_m_who_cb_currentIndexChanged(int index) {
fillWhatComboBox(index); fillWhatComboBox(index);
} }

View File

@@ -25,9 +25,9 @@
typedef SearchAndReplaceWorker sarw; typedef SearchAndReplaceWorker sarw;
/** /**
* @brief ReplaceConductorDialog::ReplaceConductorDialog @brief ReplaceConductorDialog::ReplaceConductorDialog
* @param parent @param parent
*/ */
ReplaceConductorDialog::ReplaceConductorDialog(const ConductorProperties &properties, QWidget *parent) : ReplaceConductorDialog::ReplaceConductorDialog(const ConductorProperties &properties, QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::ReplaceConductorDialog) ui(new Ui::ReplaceConductorDialog)
@@ -43,11 +43,11 @@ ReplaceConductorDialog::~ReplaceConductorDialog()
} }
/** /**
* @brief ReplaceConductorDialog::updatePreview @brief ReplaceConductorDialog::updatePreview
* Update the preview for single line Update the preview for single line
* @param b true: update from the value displayed by this widget @param b true: update from the value displayed by this widget
* false: update from the properties given at the constructor of this widget false: update from the properties given at the constructor of this widget
*/ */
void ReplaceConductorDialog::updatePreview(bool b) void ReplaceConductorDialog::updatePreview(bool b)
{ {
const QRect pixmap_rect(0, 0, 96, 96); const QRect pixmap_rect(0, 0, 96, 96);
@@ -124,9 +124,9 @@ void ReplaceConductorDialog::setProperties(const ConductorProperties &properties
} }
/** /**
* @brief ReplaceConductorDialog::properties @brief ReplaceConductorDialog::properties
* @return the properties edited by this widget @return the properties edited by this widget
*/ */
ConductorProperties ReplaceConductorDialog::properties() const ConductorProperties ReplaceConductorDialog::properties() const
{ {
ConductorProperties properties_; ConductorProperties properties_;

View File

@@ -27,9 +27,9 @@ namespace Ui {
} }
/** /**
* @brief The ReplaceConductorDialog class @brief The ReplaceConductorDialog class
* A Qdialog to edit a conductor properties, use for the search and replace feature of QElectrotech. A Qdialog to edit a conductor properties, use for the search and replace feature of QElectrotech.
*/ */
class ReplaceConductorDialog : public QDialog class ReplaceConductorDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT

View File

@@ -39,10 +39,10 @@ ReplaceElementDialog::~ReplaceElementDialog()
} }
/** /**
* @brief ReplaceElementDialog::setContext @brief ReplaceElementDialog::setContext
* Set the current diagram context to be edited Set the current diagram context to be edited
* @param context @param context
*/ */
void ReplaceElementDialog::setContext(DiagramContext context) void ReplaceElementDialog::setContext(DiagramContext context)
{ {
m_context = context; m_context = context;
@@ -53,9 +53,9 @@ void ReplaceElementDialog::setContext(DiagramContext context)
} }
/** /**
* @brief ReplaceElementDialog::context @brief ReplaceElementDialog::context
* @return The edited diagram context @return The edited diagram context
*/ */
DiagramContext ReplaceElementDialog::context() const DiagramContext ReplaceElementDialog::context() const
{ {
DiagramContext context; DiagramContext context;

View File

@@ -39,9 +39,9 @@ ReplaceFolioWidget::~ReplaceFolioWidget()
} }
/** /**
* @brief ReplaceFolioWidget::titleBlockProperties @brief ReplaceFolioWidget::titleBlockProperties
* @return the title block properties edited by this widget @return the title block properties edited by this widget
*/ */
TitleBlockProperties ReplaceFolioWidget::titleBlockProperties() const TitleBlockProperties ReplaceFolioWidget::titleBlockProperties() const
{ {
TitleBlockProperties prop; TitleBlockProperties prop;
@@ -71,10 +71,10 @@ TitleBlockProperties ReplaceFolioWidget::titleBlockProperties() const
} }
/** /**
* @brief ReplaceFolioWidget::setTitleBlockProperties @brief ReplaceFolioWidget::setTitleBlockProperties
* Set the title block properties edited by this widget Set the title block properties edited by this widget
* @param properties @param properties
*/ */
void ReplaceFolioWidget::setTitleBlockProperties(const TitleBlockProperties &properties) void ReplaceFolioWidget::setTitleBlockProperties(const TitleBlockProperties &properties)
{ {
sarw::setupLineEdit(ui->m_title_le, ui->m_title_cb, properties.title); sarw::setupLineEdit(ui->m_title_le, ui->m_title_cb, properties.title);
@@ -130,17 +130,17 @@ ReplaceFolioDialog::~ReplaceFolioDialog()
{} {}
/** /**
* @brief ReplaceFolioDialog::titleBlockProperties @brief ReplaceFolioDialog::titleBlockProperties
* @return The title block properties edited by this dialog @return The title block properties edited by this dialog
*/ */
TitleBlockProperties ReplaceFolioDialog::titleBlockProperties() const { TitleBlockProperties ReplaceFolioDialog::titleBlockProperties() const {
return m_widget->titleBlockProperties(); return m_widget->titleBlockProperties();
} }
/** /**
* @brief ReplaceFolioDialog::setTitleBlockProperties @brief ReplaceFolioDialog::setTitleBlockProperties
* @param properties : set the title block properties edited by this dialog @param properties : set the title block properties edited by this dialog
*/ */
void ReplaceFolioDialog::setTitleBlockProperties(const TitleBlockProperties &properties) { void ReplaceFolioDialog::setTitleBlockProperties(const TitleBlockProperties &properties) {
m_widget->setTitleBlockProperties(properties); m_widget->setTitleBlockProperties(properties);
} }

View File

@@ -36,10 +36,10 @@
#include <QSettings> #include <QSettings>
/** /**
* @brief SearchAndReplaceWidget::SearchAndReplaceWidget @brief SearchAndReplaceWidget::SearchAndReplaceWidget
* Constructor Constructor
* @param parent @param parent
*/ */
SearchAndReplaceWidget::SearchAndReplaceWidget(QWidget *parent) : SearchAndReplaceWidget::SearchAndReplaceWidget(QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SearchAndReplaceWidget) ui(new Ui::SearchAndReplaceWidget)
@@ -59,20 +59,20 @@ SearchAndReplaceWidget::SearchAndReplaceWidget(QWidget *parent) :
} }
/** /**
* @brief SearchAndReplaceWidget::~SearchAndReplaceWidget @brief SearchAndReplaceWidget::~SearchAndReplaceWidget
* Destructor Destructor
*/ */
SearchAndReplaceWidget::~SearchAndReplaceWidget() { SearchAndReplaceWidget::~SearchAndReplaceWidget() {
delete ui; delete ui;
} }
/** /**
* @brief SearchAndReplaceWidget::event @brief SearchAndReplaceWidget::event
* Reimplemented to clear the the lines edit and hide Reimplemented to clear the the lines edit and hide
* the advanced widgets, when this widget become hidden the advanced widgets, when this widget become hidden
* @param event @param event
* @return @return
*/ */
bool SearchAndReplaceWidget::event(QEvent *event) bool SearchAndReplaceWidget::event(QEvent *event)
{ {
if (event->type() == QEvent::Hide) if (event->type() == QEvent::Hide)
@@ -95,10 +95,10 @@ bool SearchAndReplaceWidget::event(QEvent *event)
} }
/** /**
* @brief SearchAndReplaceWidget::clear @brief SearchAndReplaceWidget::clear
* Clear the content of the search and replace line edit Clear the content of the search and replace line edit
* Clear all tree items in the tree widget (except the category items). Clear all tree items in the tree widget (except the category items).
*/ */
void SearchAndReplaceWidget::clear() void SearchAndReplaceWidget::clear()
{ {
disconnect(ui->m_tree_widget, &QTreeWidget::itemChanged, this, &SearchAndReplaceWidget::itemChanged); disconnect(ui->m_tree_widget, &QTreeWidget::itemChanged, this, &SearchAndReplaceWidget::itemChanged);
@@ -128,18 +128,18 @@ void SearchAndReplaceWidget::clear()
} }
/** /**
* @brief SearchAndReplaceWidget::setEditor @brief SearchAndReplaceWidget::setEditor
* Set the diagram editor of this widget Set the diagram editor of this widget
* @param editor @param editor
*/ */
void SearchAndReplaceWidget::setEditor(QETDiagramEditor *editor) { void SearchAndReplaceWidget::setEditor(QETDiagramEditor *editor) {
m_editor = editor; m_editor = editor;
} }
/** /**
* @brief SearchAndReplaceWidget::setUpTreeItems @brief SearchAndReplaceWidget::setUpTreeItems
* Set up the main tree widget items Set up the main tree widget items
*/ */
void SearchAndReplaceWidget::setUpTreeItems() void SearchAndReplaceWidget::setUpTreeItems()
{ {
m_root_qtwi = new QTreeWidgetItem(ui->m_tree_widget); m_root_qtwi = new QTreeWidgetItem(ui->m_tree_widget);
@@ -207,10 +207,10 @@ void SearchAndReplaceWidget::setUpTreeItems()
} }
/** /**
* @brief SearchAndReplaceWidget::setHideAdvanced @brief SearchAndReplaceWidget::setHideAdvanced
* Hide advanced widgets Hide advanced widgets
* @param hide @param hide
*/ */
void SearchAndReplaceWidget::setHideAdvanced(bool hide) void SearchAndReplaceWidget::setHideAdvanced(bool hide)
{ {
m_vertical_animation->setHidden(hide); m_vertical_animation->setHidden(hide);
@@ -218,9 +218,9 @@ void SearchAndReplaceWidget::setHideAdvanced(bool hide)
} }
/** /**
* @brief SearchAndReplaceWidget::fillItemsList @brief SearchAndReplaceWidget::fillItemsList
* Fill the tree Fill the tree
*/ */
void SearchAndReplaceWidget::fillItemsList() void SearchAndReplaceWidget::fillItemsList()
{ {
disconnect(ui->m_tree_widget, &QTreeWidget::itemChanged, this, &SearchAndReplaceWidget::itemChanged); disconnect(ui->m_tree_widget, &QTreeWidget::itemChanged, this, &SearchAndReplaceWidget::itemChanged);
@@ -296,10 +296,10 @@ void SearchAndReplaceWidget::fillItemsList()
} }
/** /**
* @brief SearchAndReplaceWidget::addElement @brief SearchAndReplaceWidget::addElement
* Add a tree widget item for @element Add a tree widget item for @element
* @param element @param element
*/ */
void SearchAndReplaceWidget::addElement(Element *element) void SearchAndReplaceWidget::addElement(Element *element)
{ {
QTreeWidgetItem *parent = m_elements_qtwi; QTreeWidgetItem *parent = m_elements_qtwi;
@@ -341,9 +341,9 @@ void SearchAndReplaceWidget::addElement(Element *element)
} }
/** /**
* @brief SearchAndReplaceWidget::search @brief SearchAndReplaceWidget::search
* Start the search Start the search
*/ */
void SearchAndReplaceWidget::search() void SearchAndReplaceWidget::search()
{ {
QString str = ui->m_search_le->text(); QString str = ui->m_search_le->text();
@@ -413,11 +413,11 @@ void SearchAndReplaceWidget::search()
} }
/** /**
* @brief SearchAndReplaceWidget::setVisibleAllParents @brief SearchAndReplaceWidget::setVisibleAllParents
* Set visible all parents of @item until the invisible root item Set visible all parents of @item until the invisible root item
* @param item @param item
* @param expend_parent @param expend_parent
*/ */
void SearchAndReplaceWidget::setVisibleAllParents(QTreeWidgetItem *item, bool expend_parent) void SearchAndReplaceWidget::setVisibleAllParents(QTreeWidgetItem *item, bool expend_parent)
{ {
if (item->parent()) if (item->parent())
@@ -430,11 +430,13 @@ void SearchAndReplaceWidget::setVisibleAllParents(QTreeWidgetItem *item, bool ex
} }
/** /**
* @brief SearchAndReplaceWidget::nextItem @brief SearchAndReplaceWidget::nextItem
* @param item : find the next item from @item, if @item is nullptr, start the search for the root of the tree @param item : find the next item from @item,
* @param flags if @item is nullptr, start the search for the root of the tree
* @return the next item according to flag or nullptr if there is not a next item @param flags
*/ @return the next item according to flag
or nullptr if there is not a next item
*/
QTreeWidgetItem *SearchAndReplaceWidget::nextItem(QTreeWidgetItem *item, QTreeWidgetItemIterator::IteratorFlag flags) const QTreeWidgetItem *SearchAndReplaceWidget::nextItem(QTreeWidgetItem *item, QTreeWidgetItemIterator::IteratorFlag flags) const
{ {
QTreeWidgetItem *qtwi = item; QTreeWidgetItem *qtwi = item;
@@ -459,11 +461,13 @@ QTreeWidgetItem *SearchAndReplaceWidget::nextItem(QTreeWidgetItem *item, QTreeWi
} }
/** /**
* @brief SearchAndReplaceWidget::previousItem @brief SearchAndReplaceWidget::previousItem
* @param item : find the previous item from @item, if @item is nullptr, start the search for the root of the tree @param item : find the previous item from @item,
* @param flags if @item is nullptr, start the search for the root of the tree
* @return the previous item according to flag or nullptr if there is not a previous item @param flags
*/ @return the previous item according to flag
or nullptr if there is not a previous item
*/
QTreeWidgetItem *SearchAndReplaceWidget::previousItem(QTreeWidgetItem *item, QTreeWidgetItemIterator::IteratorFlag flags) const QTreeWidgetItem *SearchAndReplaceWidget::previousItem(QTreeWidgetItem *item, QTreeWidgetItemIterator::IteratorFlag flags) const
{ {
QTreeWidgetItem *qtwi = item; QTreeWidgetItem *qtwi = item;
@@ -488,10 +492,10 @@ QTreeWidgetItem *SearchAndReplaceWidget::previousItem(QTreeWidgetItem *item, QTr
} }
/** /**
* @brief SearchAndReplaceWidget::updateNextPreviousButtons @brief SearchAndReplaceWidget::updateNextPreviousButtons
* According to the current item, if there is a next or a previous item, According to the current item, if there is a next or a previous item,
* we enable/disable the buttons next/previous item. we enable/disable the buttons next/previous item.
*/ */
void SearchAndReplaceWidget::updateNextPreviousButtons() void SearchAndReplaceWidget::updateNextPreviousButtons()
{ {
QTreeWidgetItem *item_ = ui->m_tree_widget->currentItem(); QTreeWidgetItem *item_ = ui->m_tree_widget->currentItem();
@@ -536,12 +540,12 @@ void SearchAndReplaceWidget::updateNextPreviousButtons()
} }
/** /**
* @brief SearchAndReplaceWidget::itemChanged @brief SearchAndReplaceWidget::itemChanged
* Reimplemented from QTreeWidget. Reimplemented from QTreeWidget.
* Use to update the check state of items. Use to update the check state of items.
* @param item @param item
* @param column @param column
*/ */
void SearchAndReplaceWidget::itemChanged(QTreeWidgetItem *item, int column) void SearchAndReplaceWidget::itemChanged(QTreeWidgetItem *item, int column)
{ {
Q_UNUSED(column); Q_UNUSED(column);
@@ -554,11 +558,11 @@ void SearchAndReplaceWidget::itemChanged(QTreeWidgetItem *item, int column)
} }
/** /**
* @brief SearchAndReplaceWidget::setChildCheckState @brief SearchAndReplaceWidget::setChildCheckState
* @param item : Parent of the items to be evaluated @param item : Parent of the items to be evaluated
* @param check : check state @param check : check state
* @param deep : if true, we evaluate every subchilds. @param deep : if true, we evaluate every subchilds.
*/ */
void SearchAndReplaceWidget::setChildCheckState(QTreeWidgetItem *item, Qt::CheckState check, bool deep) void SearchAndReplaceWidget::setChildCheckState(QTreeWidgetItem *item, Qt::CheckState check, bool deep)
{ {
for (int i=0 ; i<item->childCount() ; ++i) for (int i=0 ; i<item->childCount() ; ++i)
@@ -571,10 +575,11 @@ void SearchAndReplaceWidget::setChildCheckState(QTreeWidgetItem *item, Qt::Check
} }
/** /**
* @brief SearchAndReplaceWidget::updateParentCheckState @brief SearchAndReplaceWidget::updateParentCheckState
* @param item : a child item of the parent to be evaluated. @param item : a child item of the parent to be evaluated.
* @param all_parents : if true, we evaluate every parents, until the root item. @param all_parents : if true, we evaluate every parents,
*/ until the root item.
*/
void SearchAndReplaceWidget::updateParentCheckState(QTreeWidgetItem *item, bool all_parents) void SearchAndReplaceWidget::updateParentCheckState(QTreeWidgetItem *item, bool all_parents)
{ {
QTreeWidgetItem *parent = item->parent(); QTreeWidgetItem *parent = item->parent();
@@ -616,9 +621,9 @@ void SearchAndReplaceWidget::updateParentCheckState(QTreeWidgetItem *item, bool
} }
/** /**
* @brief SearchAndReplaceWidget::activateNextChecked @brief SearchAndReplaceWidget::activateNextChecked
* Activate the next checked (and visible) item Activate the next checked (and visible) item
*/ */
void SearchAndReplaceWidget::activateNextChecked() void SearchAndReplaceWidget::activateNextChecked()
{ {
//Next button is disabled, so there is not a next item. //Next button is disabled, so there is not a next item.
@@ -632,9 +637,9 @@ void SearchAndReplaceWidget::activateNextChecked()
} }
/** /**
* @brief SearchAndReplaceWidget::selectedDiagram @brief SearchAndReplaceWidget::selectedDiagram
* @return The list of visible and selected diagram in the tree widget @return The list of visible and selected diagram in the tree widget
*/ */
QList<Diagram *> SearchAndReplaceWidget::selectedDiagram() const QList<Diagram *> SearchAndReplaceWidget::selectedDiagram() const
{ {
QList <Diagram *> diagram_list; QList <Diagram *> diagram_list;
@@ -654,9 +659,9 @@ QList<Diagram *> SearchAndReplaceWidget::selectedDiagram() const
} }
/** /**
* @brief SearchAndReplaceWidget::selectedElement @brief SearchAndReplaceWidget::selectedElement
* @return The list of visible and selected element in the tree widget @return The list of visible and selected element in the tree widget
*/ */
QList<Element *> SearchAndReplaceWidget::selectedElement() const QList<Element *> SearchAndReplaceWidget::selectedElement() const
{ {
QList <Element *> element_list; QList <Element *> element_list;
@@ -676,9 +681,9 @@ QList<Element *> SearchAndReplaceWidget::selectedElement() const
} }
/** /**
* @brief SearchAndReplaceWidget::selectedConductor @brief SearchAndReplaceWidget::selectedConductor
* @return The list of visible and selected conductor in the tree widget @return The list of visible and selected conductor in the tree widget
*/ */
QList<Conductor *> SearchAndReplaceWidget::selectedConductor() const QList<Conductor *> SearchAndReplaceWidget::selectedConductor() const
{ {
QList <Conductor *> conductor_list; QList <Conductor *> conductor_list;
@@ -698,9 +703,10 @@ QList<Conductor *> SearchAndReplaceWidget::selectedConductor() const
} }
/** /**
* @brief SearchAndReplaceWidget::selectedText @brief SearchAndReplaceWidget::selectedText
* @return The list of visible and selected independant text in the tree widget @return The list of visible and selected independant text
*/ in the tree widget
*/
QList<IndependentTextItem *> SearchAndReplaceWidget::selectedText() const QList<IndependentTextItem *> SearchAndReplaceWidget::selectedText() const
{ {
QList <IndependentTextItem *> text_list; QList <IndependentTextItem *> text_list;
@@ -720,10 +726,10 @@ QList<IndependentTextItem *> SearchAndReplaceWidget::selectedText() const
} }
/** /**
* @brief SearchAndReplaceWidget::searchTerms @brief SearchAndReplaceWidget::searchTerms
* @param diagram @param diagram
* @return All QStrings use as terms for search. @return All QStrings use as terms for search.
*/ */
QStringList SearchAndReplaceWidget::searchTerms(Diagram *diagram) QStringList SearchAndReplaceWidget::searchTerms(Diagram *diagram)
{ {
QStringList list; QStringList list;
@@ -744,10 +750,10 @@ QStringList SearchAndReplaceWidget::searchTerms(Diagram *diagram)
} }
/** /**
* @brief SearchAndReplaceWidget::searchTerms @brief SearchAndReplaceWidget::searchTerms
* @param element @param element
* @return All QString use as terms for search @return All QString use as terms for search
*/ */
QStringList SearchAndReplaceWidget::searchTerms(Element *element) QStringList SearchAndReplaceWidget::searchTerms(Element *element)
{ {
QStringList list; QStringList list;
@@ -781,10 +787,10 @@ QStringList SearchAndReplaceWidget::searchTerms(Element *element)
} }
/** /**
* @brief SearchAndReplaceWidget::searchTerms @brief SearchAndReplaceWidget::searchTerms
* @param conductor @param conductor
* @return all QString use as terms for search. @return all QString use as terms for search.
*/ */
QStringList SearchAndReplaceWidget::searchTerms(Conductor *conductor) QStringList SearchAndReplaceWidget::searchTerms(Conductor *conductor)
{ {
QStringList list; QStringList list;
@@ -800,8 +806,8 @@ QStringList SearchAndReplaceWidget::searchTerms(Conductor *conductor)
} }
/** /**
* @brief SearchAndReplaceWidget::on_m_quit_button_clicked @brief SearchAndReplaceWidget::on_m_quit_button_clicked
*/ */
void SearchAndReplaceWidget::on_m_quit_button_clicked() void SearchAndReplaceWidget::on_m_quit_button_clicked()
{ {
if (auto animator = this->findChild<QWidgetAnimation *>("search and replace animator")) { if (auto animator = this->findChild<QWidgetAnimation *>("search and replace animator")) {
@@ -990,9 +996,9 @@ void SearchAndReplaceWidget::on_m_folio_pb_clicked()
} }
/** /**
* @brief SearchAndReplaceWidget::on_m_replace_pb_clicked @brief SearchAndReplaceWidget::on_m_replace_pb_clicked
* Replace the current selection Replace the current selection
*/ */
void SearchAndReplaceWidget::on_m_replace_pb_clicked() void SearchAndReplaceWidget::on_m_replace_pb_clicked()
{ {
QTreeWidgetItem *qtwi = ui->m_tree_widget->currentItem(); QTreeWidgetItem *qtwi = ui->m_tree_widget->currentItem();
@@ -1082,9 +1088,9 @@ void SearchAndReplaceWidget::on_m_replace_pb_clicked()
} }
/** /**
* @brief SearchAndReplaceWidget::on_m_replace_all_pb_clicked @brief SearchAndReplaceWidget::on_m_replace_all_pb_clicked
* Replace all checked item Replace all checked item
*/ */
void SearchAndReplaceWidget::on_m_replace_all_pb_clicked() void SearchAndReplaceWidget::on_m_replace_all_pb_clicked()
{ {
if (ui->m_folio_pb->text().endsWith(tr(" [édité]"))) { if (ui->m_folio_pb->text().endsWith(tr(" [édité]"))) {
@@ -1140,10 +1146,10 @@ void SearchAndReplaceWidget::on_m_element_pb_clicked()
} }
/** /**
* @brief SearchAndReplaceWidget::on_m_mode_cb_currentIndexChanged @brief SearchAndReplaceWidget::on_m_mode_cb_currentIndexChanged
* Update the search when user change mode. Update the search when user change mode.
* @param index @param index
*/ */
void SearchAndReplaceWidget::on_m_mode_cb_currentIndexChanged(int index) void SearchAndReplaceWidget::on_m_mode_cb_currentIndexChanged(int index)
{ {
Q_UNUSED(index); Q_UNUSED(index);
@@ -1151,10 +1157,10 @@ void SearchAndReplaceWidget::on_m_mode_cb_currentIndexChanged(int index)
} }
/** /**
* @brief SearchAndReplaceWidget::on_m_case_sensitive_cb_stateChanged @brief SearchAndReplaceWidget::on_m_case_sensitive_cb_stateChanged
* Update the search when change the case sensitive Update the search when change the case sensitive
* @param arg1 @param arg1
*/ */
void SearchAndReplaceWidget::on_m_case_sensitive_cb_stateChanged(int arg1) void SearchAndReplaceWidget::on_m_case_sensitive_cb_stateChanged(int arg1)
{ {
Q_UNUSED(arg1); Q_UNUSED(arg1);
@@ -1162,9 +1168,9 @@ void SearchAndReplaceWidget::on_m_case_sensitive_cb_stateChanged(int arg1)
} }
/** /**
* @brief SearchAndReplaceWidget::on_m_conductor_pb_clicked @brief SearchAndReplaceWidget::on_m_conductor_pb_clicked
* Open a dialog to edit the condutor properties Open a dialog to edit the condutor properties
*/ */
void SearchAndReplaceWidget::on_m_conductor_pb_clicked() void SearchAndReplaceWidget::on_m_conductor_pb_clicked()
{ {
ReplaceConductorDialog *dialog = new ReplaceConductorDialog(m_worker.m_conductor_properties, this); ReplaceConductorDialog *dialog = new ReplaceConductorDialog(m_worker.m_conductor_properties, this);
@@ -1191,9 +1197,9 @@ void SearchAndReplaceWidget::on_m_conductor_pb_clicked()
} }
/** /**
* @brief SearchAndReplaceWidget::on_m_advanced_replace_pb_clicked @brief SearchAndReplaceWidget::on_m_advanced_replace_pb_clicked
* Open the advanced editor. Open the advanced editor.
*/ */
void SearchAndReplaceWidget::on_m_advanced_replace_pb_clicked() void SearchAndReplaceWidget::on_m_advanced_replace_pb_clicked()
{ {
replaceAdvancedDialog *dialog = new replaceAdvancedDialog(m_worker.m_advanced_struct, this); replaceAdvancedDialog *dialog = new replaceAdvancedDialog(m_worker.m_advanced_struct, this);

View File

@@ -29,8 +29,8 @@
namespace autonum namespace autonum
{ {
/** /**
* @brief sequentialNumbers::sequentialNumbers @brief sequentialNumbers::sequentialNumbers
*/ */
sequentialNumbers::sequentialNumbers() sequentialNumbers::sequentialNumbers()
{} {}
@@ -83,12 +83,13 @@ namespace autonum
} }
/** /**
* @brief sequentialNumbers::toXml @brief sequentialNumbers::toXml
* export this sequential numbers into a QDomElement. export this sequential numbers into a QDomElement.
* @param document : QDomDocument used to create the QDomElement @param document : QDomDocument used to create the QDomElement
* @param tag_name : the tag name used for the QDomElement. @param tag_name : the tag name used for the QDomElement.
* @return A QDomElement, if this sequential have no value, the returned QDomELement is empty @return A QDomElement, if this sequential have no value,
*/ the returned QDomELement is empty
*/
QDomElement sequentialNumbers::toXml(QDomDocument &document, const QString& tag_name) const QDomElement sequentialNumbers::toXml(QDomDocument &document, const QString& tag_name) const
{ {
QDomElement element = document.createElement(tag_name); QDomElement element = document.createElement(tag_name);
@@ -110,10 +111,10 @@ namespace autonum
} }
/** /**
* @brief sequentialNumbers::fromXml @brief sequentialNumbers::fromXml
* Import sequential values from a QDomElement Import sequential values from a QDomElement
* @param element @param element
*/ */
void sequentialNumbers::fromXml(const QDomElement &element) void sequentialNumbers::fromXml(const QDomElement &element)
{ {
if (!element.hasChildNodes()) if (!element.hasChildNodes())
@@ -152,14 +153,17 @@ namespace autonum
} }
/** /**
* @brief AssignVariables::formulaToLabel @brief AssignVariables::formulaToLabel
* Return the @formula with variable assigned (ready to be displayed) Return the @formula with variable assigned
* @param formula - the formula to work (ready to be displayed)
* @param seqStruct - struct where is stocked int values (struct is passed as a reference and modified by this static method) @param formula - the formula to work
* @param diagram - the diagram where occure the formula. @param seqStruct - struct where is stocked int values
* @param elmt - parent element (if any) of the formula (struct is passed as a reference
* @return the string with variable assigned. and modified by this static method)
*/ @param diagram - the diagram where occure the formula.
@param elmt - parent element (if any) of the formula
@return the string with variable assigned.
*/
QString AssignVariables::formulaToLabel(QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt) QString AssignVariables::formulaToLabel(QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt)
{ {
AssignVariables av(std::move(formula), seqStruct, diagram, elmt); AssignVariables av(std::move(formula), seqStruct, diagram, elmt);
@@ -168,12 +172,13 @@ namespace autonum
} }
/** /**
* @brief AssignVariables::replaceVariable @brief AssignVariables::replaceVariable
* Replace the variables in @formula in form %{my-var} to the corresponding value stored in @dc Replace the variables in @formula in form %{my-var}
* @param formula to the corresponding value stored in @dc
* @param dc @param formula
* @return @param dc
*/ @return
*/
QString AssignVariables::replaceVariable(const QString &formula, const DiagramContext &dc) QString AssignVariables::replaceVariable(const QString &formula, const DiagramContext &dc)
{ {
QString str = formula; QString str = formula;
@@ -297,12 +302,13 @@ namespace autonum
} }
/** /**
* @brief setSequentialToList @brief setSequentialToList
* Append all sequential of type @type owned by @context in list Append all sequential of type @type owned by @context in list
* @param list : list to have value inserted @param list : list to have value inserted
* @param context : numerotation context to retrieve value @param context : numerotation context to retrieve value
* @param type : type of sequential (unit, unitfolio, ten, tenfolio, hundred, hundredfolio) @param type : type of sequential
*/ (unit, unitfolio, ten, tenfolio, hundred, hundredfolio)
*/
void setSequentialToList(QStringList &list, NumerotationContext &context, const QString& type) void setSequentialToList(QStringList &list, NumerotationContext &context, const QString& type)
{ {
for (int i = 0; i < context.size(); i++) for (int i = 0; i < context.size(); i++)
@@ -321,12 +327,12 @@ namespace autonum
} }
/** /**
* @brief setFolioSequentialToHash @brief setFolioSequentialToHash
* Insert all value of @list in @hash with key @autoNumName Insert all value of @list in @hash with key @autoNumName
* @param list : list to get values from @param list : list to get values from
* @param hash : hash to have values inserted @param hash : hash to have values inserted
* @param autoNumName : name to use as key of hash @param autoNumName : name to use as key of hash
*/ */
void setFolioSequentialToHash(QStringList &list, QHash<QString, QStringList> &hash, const QString& autoNumName) void setFolioSequentialToHash(QStringList &list, QHash<QString, QStringList> &hash, const QString& autoNumName)
{ {
if (hash.isEmpty() || !hash.contains(autoNumName)) if (hash.isEmpty() || !hash.contains(autoNumName))
@@ -355,15 +361,20 @@ namespace autonum
} }
/** /**
* @brief setSequential @brief setSequential
* Fill seqStruct Fill seqStruct
* @param label : label of sequential to fill (%sequ_, %sequf_, %seqt_, ect....) @param label : label of sequential to fill
* @param seqStruct : struct to fill (%sequ_, %sequf_, %seqt_, ect....)
* @param context : numerotation context use to know the current sequential num. @param seqStruct : struct to fill
* @param diagram : diagram where the sequential occur, notably use when label is folio type (%sequf_, %seqtf_, %seqhf_), @param context : numerotation context use
* to keep up to date the current sequential of folio. to know the current sequential num.
* @param hashKey : the hash key used to store the sequential for folio type. @param diagram : diagram where the sequential occur,
*/ notably use when label is folio type
(%sequf_, %seqtf_, %seqhf_),
to keep up to date the current sequential of folio.
@param hashKey :
the hash key used to store the sequential for folio type.
*/
void setSequential(const QString& label, sequentialNumbers &seqStruct, NumerotationContext &context, Diagram *diagram, const QString& hashKey) void setSequential(const QString& label, sequentialNumbers &seqStruct, NumerotationContext &context, Diagram *diagram, const QString& hashKey)
{ {
if (!context.isEmpty()) if (!context.isEmpty())
@@ -399,10 +410,10 @@ namespace autonum
} }
/** /**
* @brief numerotationContextToFormula @brief numerotationContextToFormula
* @param nc @param nc
* @return the numerotation context, converted to formula @return the numerotation context, converted to formula
*/ */
QString numerotationContextToFormula(const NumerotationContext &nc) QString numerotationContextToFormula(const NumerotationContext &nc)
{ {
QString type; QString type;
@@ -476,11 +487,13 @@ namespace autonum
} }
/** /**
* @brief elementPrefixForLocation @brief elementPrefixForLocation
* @param location @param location
* @return the prefix for an element represented by location, prefix can be null. @return the prefix for an element represented by location,
* Search for a prefix only if @location represent an element embedded in a project prefix can be null.
*/ Search for a prefix only if @location represent
an element embedded in a project
*/
QString elementPrefixForLocation(const ElementsLocation &location) QString elementPrefixForLocation(const ElementsLocation &location)
{ {
if (!location.isProject()) if (!location.isProject())

View File

@@ -55,10 +55,10 @@ namespace autonum
}; };
/** /**
* @brief The AssignVariables class @brief The AssignVariables class
* This class assign variable of a formula string. This class assign variable of a formula string.
* Return the final string used to be displayed from a formula string. Return the final string used to be displayed from a formula string.
*/ */
class AssignVariables class AssignVariables
{ {
public: public:

View File

@@ -21,32 +21,32 @@
#include "qet.h" #include "qet.h"
/** /**
* Constructor Constructor
*/ */
NumerotationContext::NumerotationContext(){ NumerotationContext::NumerotationContext(){
} }
/** /**
* Constructor from xml Constructor from xml
*/ */
NumerotationContext::NumerotationContext(QDomElement &e) { NumerotationContext::NumerotationContext(QDomElement &e) {
fromXml(e); fromXml(e);
} }
/** /**
* @brief NumerotationContext::clear, clear the content @brief NumerotationContext::clear, clear the content
*/ */
void NumerotationContext::clear () { void NumerotationContext::clear () {
content_.clear(); content_.clear();
} }
/** /**
* @brief NumerotationContext::addValue, add a new value on the contexte @brief NumerotationContext::addValue, add a new value on the contexte
* @param type the type of value @param type the type of value
* @param value the value itself @param value the value itself
* @param increase the increase number of value @param increase the increase number of value
* @return true if value is append @return true if value is append
*/ */
bool NumerotationContext::addValue(const QString &type, const QVariant &value, const int increase, const int initialvalue) { bool NumerotationContext::addValue(const QString &type, const QVariant &value, const int increase, const int initialvalue) {
if (!keyIsAcceptable(type) && !value.canConvert(QVariant::String)) return false; if (!keyIsAcceptable(type) && !value.canConvert(QVariant::String)) return false;
if (keyIsNumber(type) && !value.canConvert(QVariant::Int)) return false; if (keyIsNumber(type) && !value.canConvert(QVariant::Int)) return false;
@@ -58,80 +58,80 @@ bool NumerotationContext::addValue(const QString &type, const QVariant &value, c
} }
/** /**
* @brief NumerotationContext::operator [] @brief NumerotationContext::operator []
* @return the string at position @i @return the string at position @i
*/ */
QString NumerotationContext::operator [] (const int &i) const { QString NumerotationContext::operator [] (const int &i) const {
return (content_.at(i)); return (content_.at(i));
} }
/** /**
* @brief NumerotationContext::operator << , append other @brief NumerotationContext::operator << , append other
*/ */
void NumerotationContext::operator << (const NumerotationContext &other) { void NumerotationContext::operator << (const NumerotationContext &other) {
for (int i=0; i<other.size(); ++i) content_.append(other[i]); for (int i=0; i<other.size(); ++i) content_.append(other[i]);
} }
/** /**
* @brief NumerotationContext::size @brief NumerotationContext::size
* @return size of context @return size of context
*/ */
int NumerotationContext::size() const { int NumerotationContext::size() const {
return (content_.size()); return (content_.size());
} }
/** /**
* @brief NumerotationContext::isEmpty @brief NumerotationContext::isEmpty
* @return true if numerotation contet is empty @return true if numerotation contet is empty
*/ */
bool NumerotationContext::isEmpty() const { bool NumerotationContext::isEmpty() const {
if (content_.size() > 0) return false; if (content_.size() > 0) return false;
return true; return true;
} }
/** /**
* @brief NumerotationContext::itemAt @brief NumerotationContext::itemAt
* @return the content at position @i 1:type 2:value 3:increase @return the content at position @i 1:type 2:value 3:increase
*/ */
QStringList NumerotationContext::itemAt(const int i) const { QStringList NumerotationContext::itemAt(const int i) const {
return (content_.at(i).split("|")); return (content_.at(i).split("|"));
} }
/** /**
* @brief validRegExpNum @brief validRegExpNum
* @return all type use to numerotation @return all type use to numerotation
*/ */
QString NumerotationContext::validRegExpNum () const { QString NumerotationContext::validRegExpNum () const {
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio|string|idfolio|folio|plant|locmach|elementline|elementcolumn|elementprefix"); return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio|string|idfolio|folio|plant|locmach|elementline|elementcolumn|elementprefix");
} }
/** /**
* @brief NumerotationContext::validRegExpNumber @brief NumerotationContext::validRegExpNumber
* @return all type represents a number @return all type represents a number
*/ */
QString NumerotationContext::validRegExpNumber() const { QString NumerotationContext::validRegExpNumber() const {
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio"); return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio");
} }
/** /**
* @brief NumerotationContext::keyIsAcceptable @brief NumerotationContext::keyIsAcceptable
* @return true if @type is acceptable @return true if @type is acceptable
*/ */
bool NumerotationContext::keyIsAcceptable(const QString &type) const { bool NumerotationContext::keyIsAcceptable(const QString &type) const {
return (type.contains(QRegExp(validRegExpNum()))); return (type.contains(QRegExp(validRegExpNum())));
} }
/** /**
* @brief NumerotationContext::keyIsNumber @brief NumerotationContext::keyIsNumber
* @return true if @type represent a number @return true if @type represent a number
*/ */
bool NumerotationContext::keyIsNumber(const QString &type) const { bool NumerotationContext::keyIsNumber(const QString &type) const {
return (type.contains(QRegExp(validRegExpNumber()))); return (type.contains(QRegExp(validRegExpNumber())));
} }
/** /**
* @brief NumerotationContext::toXml @brief NumerotationContext::toXml
* Save the numerotation context in a QDomElement under the element name @str Save the numerotation context in a QDomElement under the element name @str
*/ */
QDomElement NumerotationContext::toXml(QDomDocument &d, const QString& str) { QDomElement NumerotationContext::toXml(QDomDocument &d, const QString& str) {
QDomElement num_auto = d.createElement(str); QDomElement num_auto = d.createElement(str);
for (int i=0; i<content_.size(); ++i) { for (int i=0; i<content_.size(); ++i) {
@@ -151,20 +151,20 @@ QDomElement NumerotationContext::toXml(QDomDocument &d, const QString& str) {
} }
/** /**
* @brief NumerotationContext::fromXml @brief NumerotationContext::fromXml
* load numerotation context from @e load numerotation context from @e
*/ */
void NumerotationContext::fromXml(QDomElement &e) { void NumerotationContext::fromXml(QDomElement &e) {
clear(); clear();
foreach(QDomElement qde, QET::findInDomElement(e, "part")) addValue(qde.attribute("type"), qde.attribute("value"), qde.attribute("increase").toInt(), qde.attribute("initialvalue").toInt()); foreach(QDomElement qde, QET::findInDomElement(e, "part")) addValue(qde.attribute("type"), qde.attribute("value"), qde.attribute("increase").toInt(), qde.attribute("initialvalue").toInt());
} }
/** /**
* @brief NumerotationContext::replaceValue @brief NumerotationContext::replaceValue
* This class replaces the current NC field value with content This class replaces the current NC field value with content
* @param index of NC Item @param index of NC Item
* @param QString content to replace current value @param QString content to replace current value
*/ */
void NumerotationContext::replaceValue(int index, QString content) { void NumerotationContext::replaceValue(int index, QString content) {
QString sep = "|"; QString sep = "|";
QString type = content_[index].split("|").at(0); QString type = content_[index].split("|").at(0);

View File

@@ -26,7 +26,7 @@
This class represents a numerotation context, i.e. the data (type, value, increase) This class represents a numerotation context, i.e. the data (type, value, increase)
of a numerotation at a given time. It is notably used by conductor of a numerotation at a given time. It is notably used by conductor
to store the informations they need to do their autonumerotation. to store the informations they need to do their autonumerotation.
*/ */
class NumerotationContext class NumerotationContext
{ {
public: public:

View File

@@ -19,8 +19,8 @@
#include "diagram.h" #include "diagram.h"
/** /**
* @brief Constructor @brief Constructor
*/ */
NumerotationContextCommands::NumerotationContextCommands(const NumerotationContext &nc, Diagram *d): NumerotationContextCommands::NumerotationContextCommands(const NumerotationContext &nc, Diagram *d):
diagram_ (d), diagram_ (d),
context_ (nc), context_ (nc),
@@ -28,16 +28,16 @@ NumerotationContextCommands::NumerotationContextCommands(const NumerotationConte
{} {}
/** /**
* @brief Destructor @brief Destructor
*/ */
NumerotationContextCommands::~NumerotationContextCommands() { NumerotationContextCommands::~NumerotationContextCommands() {
if (strategy_) delete strategy_; if (strategy_) delete strategy_;
} }
/** /**
* @brief NumerotationContextCommands::next @brief NumerotationContextCommands::next
* @return the next numerotation context @return the next numerotation context
*/ */
NumerotationContext NumerotationContextCommands::next() { NumerotationContext NumerotationContextCommands::next() {
NumerotationContext contextnum; NumerotationContext contextnum;
@@ -50,9 +50,9 @@ NumerotationContext NumerotationContextCommands::next() {
} }
/** /**
* @brief NumerotationContextCommands::previous @brief NumerotationContextCommands::previous
* @return the previous numerotation context @return the previous numerotation context
*/ */
NumerotationContext NumerotationContextCommands::previous() { NumerotationContext NumerotationContextCommands::previous() {
NumerotationContext contextnum; NumerotationContext contextnum;
@@ -65,9 +65,9 @@ NumerotationContext NumerotationContextCommands::previous() {
} }
/** /**
* @brief NumerotationContextCommands::toFinalString @brief NumerotationContextCommands::toFinalString
* @return the string represented by the numerotation context @return the string represented by the numerotation context
*/ */
QString NumerotationContextCommands::toRepresentedString() { QString NumerotationContextCommands::toRepresentedString() {
QString num; QString num;
if (context_.size()) { if (context_.size()) {
@@ -83,9 +83,9 @@ QString NumerotationContextCommands::toRepresentedString() {
} }
/** /**
* @brief NumerotationContextCommands::setNumStrategy @brief NumerotationContextCommands::setNumStrategy
* apply the good strategy relative to @str apply the good strategy relative to @str
*/ */
void NumerotationContextCommands::setNumStrategy(const QString &str) { void NumerotationContextCommands::setNumStrategy(const QString &str) {
if (strategy_) delete strategy_; if (strategy_) delete strategy_;
if (str == "unit") { if (str == "unit") {
@@ -149,8 +149,8 @@ void NumerotationContextCommands::setNumStrategy(const QString &str) {
/** /**
* Constructor Constructor
*/ */
NumStrategy::NumStrategy (Diagram *d): NumStrategy::NumStrategy (Diagram *d):
diagram_ (d) diagram_ (d)
{} {}
@@ -158,9 +158,9 @@ NumStrategy::NumStrategy (Diagram *d):
NumStrategy::~NumStrategy() {} NumStrategy::~NumStrategy() {}
/** /**
* @brief NumStrategy::nextString @brief NumStrategy::nextString
* @return the next value of @nc at position @i @return the next value of @nc at position @i
*/ */
NumerotationContext NumStrategy::nextString (const NumerotationContext &nc, const int i) const { NumerotationContext NumStrategy::nextString (const NumerotationContext &nc, const int i) const {
QStringList strl = nc.itemAt(i); QStringList strl = nc.itemAt(i);
NumerotationContext newnc; NumerotationContext newnc;
@@ -169,9 +169,9 @@ NumerotationContext NumStrategy::nextString (const NumerotationContext &nc, cons
} }
/** /**
* @brief NumStrategy::nextNumber @brief NumStrategy::nextNumber
* @return the next value of @nc at position @i @return the next value of @nc at position @i
*/ */
NumerotationContext NumStrategy::nextNumber (const NumerotationContext &nc, const int i) const { NumerotationContext NumStrategy::nextNumber (const NumerotationContext &nc, const int i) const {
QStringList strl = nc.itemAt(i); QStringList strl = nc.itemAt(i);
NumerotationContext newnc; NumerotationContext newnc;
@@ -181,9 +181,9 @@ NumerotationContext NumStrategy::nextNumber (const NumerotationContext &nc, cons
} }
/** /**
* @brief NumStrategy::previousNumber @brief NumStrategy::previousNumber
* @return the previous value of @nc at position @i @return the previous value of @nc at position @i
*/ */
NumerotationContext NumStrategy::previousNumber(const NumerotationContext &nc, const int i) const { NumerotationContext NumStrategy::previousNumber(const NumerotationContext &nc, const int i) const {
QStringList strl = nc.itemAt(i); QStringList strl = nc.itemAt(i);
NumerotationContext newnc; NumerotationContext newnc;
@@ -193,78 +193,78 @@ NumerotationContext NumStrategy::previousNumber(const NumerotationContext &nc, c
} }
/** /**
* Constructor Constructor
*/ */
UnitNum::UnitNum(Diagram *d): UnitNum::UnitNum(Diagram *d):
NumStrategy(d) NumStrategy(d)
{} {}
/** /**
* @brief UnitNum::toRepresentedString @brief UnitNum::toRepresentedString
* @return the represented string of num @return the represented string of num
*/ */
QString UnitNum::toRepresentedString(const QString num) const { QString UnitNum::toRepresentedString(const QString num) const {
return (num); return (num);
} }
/** /**
* @brief UnitNum::next @brief UnitNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext UnitNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext UnitNum::next (const NumerotationContext &nc, const int i) const {
return (nextNumber(nc, i)); return (nextNumber(nc, i));
} }
/** /**
* @brief UnitNum::previous @brief UnitNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext UnitNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext UnitNum::previous(const NumerotationContext &nc, const int i) const {
return (previousNumber(nc, i)); return (previousNumber(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
UnitFNum::UnitFNum(Diagram *d): UnitFNum::UnitFNum(Diagram *d):
NumStrategy(d) NumStrategy(d)
{} {}
/** /**
* @brief UnitFNum::toRepresentedString @brief UnitFNum::toRepresentedString
* @return the represented string of num @return the represented string of num
*/ */
QString UnitFNum::toRepresentedString(const QString num) const { QString UnitFNum::toRepresentedString(const QString num) const {
return (num); return (num);
} }
/** /**
* @brief UnitFNum::next @brief UnitFNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext UnitFNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext UnitFNum::next (const NumerotationContext &nc, const int i) const {
return (nextNumber(nc, i)); return (nextNumber(nc, i));
} }
/** /**
* @brief UnitFNum::previous @brief UnitFNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext UnitFNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext UnitFNum::previous(const NumerotationContext &nc, const int i) const {
return (previousNumber(nc, i)); return (previousNumber(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
TenNum::TenNum (Diagram *d): TenNum::TenNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief TenNum::toRepresentedString @brief TenNum::toRepresentedString
* @return the represented string of num @return the represented string of num
*/ */
QString TenNum::toRepresentedString(const QString num) const { QString TenNum::toRepresentedString(const QString num) const {
int numint = num.toInt(); int numint = num.toInt();
QString numstr = num; QString numstr = num;
@@ -273,32 +273,32 @@ QString TenNum::toRepresentedString(const QString num) const {
} }
/** /**
* @brief TenNum::next @brief TenNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext TenNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext TenNum::next (const NumerotationContext &nc, const int i) const {
return (nextNumber(nc, i)); return (nextNumber(nc, i));
} }
/** /**
* @brief TenNum::previous @brief TenNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext TenNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext TenNum::previous(const NumerotationContext &nc, const int i) const {
return (previousNumber(nc, i)); return (previousNumber(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
TenFNum::TenFNum (Diagram *d): TenFNum::TenFNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief TenFNum::toRepresentedString @brief TenFNum::toRepresentedString
* @return the represented string of num @return the represented string of num
*/ */
QString TenFNum::toRepresentedString(const QString num) const { QString TenFNum::toRepresentedString(const QString num) const {
int numint = num.toInt(); int numint = num.toInt();
QString numstr = num; QString numstr = num;
@@ -307,33 +307,33 @@ QString TenFNum::toRepresentedString(const QString num) const {
} }
/** /**
* @brief TenFNum::next @brief TenFNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext TenFNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext TenFNum::next (const NumerotationContext &nc, const int i) const {
return (nextNumber(nc, i)); return (nextNumber(nc, i));
} }
/** /**
* @brief TenFNum::previous @brief TenFNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext TenFNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext TenFNum::previous(const NumerotationContext &nc, const int i) const {
return (previousNumber(nc, i)); return (previousNumber(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
HundredNum::HundredNum (Diagram *d): HundredNum::HundredNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief HundredNum::toRepresentedString @brief HundredNum::toRepresentedString
* @return the represented string of num @return the represented string of num
*/ */
QString HundredNum::toRepresentedString(const QString num) const { QString HundredNum::toRepresentedString(const QString num) const {
int numint = num.toInt(); int numint = num.toInt();
QString numstr = num; QString numstr = num;
@@ -347,32 +347,32 @@ QString HundredNum::toRepresentedString(const QString num) const {
} }
/** /**
* @brief HundredNum::next @brief HundredNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext HundredNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext HundredNum::next (const NumerotationContext &nc, const int i) const {
return (nextNumber(nc, i)); return (nextNumber(nc, i));
} }
/** /**
* @brief HundredNum::previous @brief HundredNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext HundredNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext HundredNum::previous(const NumerotationContext &nc, const int i) const {
return (previousNumber(nc, i)); return (previousNumber(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
HundredFNum::HundredFNum (Diagram *d): HundredFNum::HundredFNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief HundredFNum::toRepresentedString @brief HundredFNum::toRepresentedString
* @return the represented string of num @return the represented string of num
*/ */
QString HundredFNum::toRepresentedString(const QString num) const { QString HundredFNum::toRepresentedString(const QString num) const {
int numint = num.toInt(); int numint = num.toInt();
QString numstr = num; QString numstr = num;
@@ -386,274 +386,274 @@ QString HundredFNum::toRepresentedString(const QString num) const {
} }
/** /**
* @brief HundredFNum::next @brief HundredFNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext HundredFNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext HundredFNum::next (const NumerotationContext &nc, const int i) const {
return (nextNumber(nc, i)); return (nextNumber(nc, i));
} }
/** /**
* @brief HundredFNum::previous @brief HundredFNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext HundredFNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext HundredFNum::previous(const NumerotationContext &nc, const int i) const {
return (previousNumber(nc, i)); return (previousNumber(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
StringNum::StringNum (Diagram *d): StringNum::StringNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief StringNum::toRepresentedString @brief StringNum::toRepresentedString
* @return the represented string of num @return the represented string of num
*/ */
QString StringNum::toRepresentedString(const QString str) const { QString StringNum::toRepresentedString(const QString str) const {
return (str); return (str);
} }
/** /**
* @brief StringNum::next @brief StringNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext StringNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext StringNum::next (const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* @brief StringNum::previous @brief StringNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext StringNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext StringNum::previous(const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
IdFolioNum::IdFolioNum (Diagram *d): IdFolioNum::IdFolioNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief IdFolioNum::toRepresentedString @brief IdFolioNum::toRepresentedString
* @return the represented string of num @return the represented string of num
*/ */
QString IdFolioNum::toRepresentedString(const QString str) const { QString IdFolioNum::toRepresentedString(const QString str) const {
Q_UNUSED(str); Q_UNUSED(str);
return ("%id"); return ("%id");
} }
/** /**
* @brief IdFolioNum::next @brief IdFolioNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext IdFolioNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext IdFolioNum::next (const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* @brief IdFolioNum::previous @brief IdFolioNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext IdFolioNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext IdFolioNum::previous(const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
FolioNum::FolioNum (Diagram *d): FolioNum::FolioNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief FolioNum::toRepresentedString @brief FolioNum::toRepresentedString
* @return the represented string of folio @return the represented string of folio
*/ */
QString FolioNum::toRepresentedString(const QString str) const { QString FolioNum::toRepresentedString(const QString str) const {
Q_UNUSED(str); Q_UNUSED(str);
return ("%F"); return ("%F");
} }
/** /**
* @brief FolioNum::next @brief FolioNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext FolioNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext FolioNum::next (const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* @brief FolioNum::previous @brief FolioNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext FolioNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext FolioNum::previous(const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
PlantNum::PlantNum (Diagram *d): PlantNum::PlantNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief PlantNum::toRepresentedString @brief PlantNum::toRepresentedString
* @return the represented string of folio @return the represented string of folio
*/ */
QString PlantNum::toRepresentedString(const QString str) const { QString PlantNum::toRepresentedString(const QString str) const {
Q_UNUSED(str); Q_UNUSED(str);
return "%M"; return "%M";
} }
/** /**
* @brief PlantNum::next @brief PlantNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext PlantNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext PlantNum::next (const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* @brief PlantNum::previous @brief PlantNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext PlantNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext PlantNum::previous(const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
LocmachNum::LocmachNum (Diagram *d): LocmachNum::LocmachNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief LocmachNum::toRepresentedString @brief LocmachNum::toRepresentedString
* @return the represented string of folio @return the represented string of folio
*/ */
QString LocmachNum::toRepresentedString(const QString str) const { QString LocmachNum::toRepresentedString(const QString str) const {
Q_UNUSED(str); Q_UNUSED(str);
return "%LM"; return "%LM";
} }
/** /**
* @brief LocmachNum::next @brief LocmachNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext LocmachNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext LocmachNum::next (const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* @brief LocmachNum::previous @brief LocmachNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext LocmachNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext LocmachNum::previous(const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
ElementLineNum::ElementLineNum (Diagram *d): ElementLineNum::ElementLineNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief ElementLineNum::toRepresentedString @brief ElementLineNum::toRepresentedString
* @return the represented string of folio @return the represented string of folio
*/ */
QString ElementLineNum::toRepresentedString(const QString str) const { QString ElementLineNum::toRepresentedString(const QString str) const {
Q_UNUSED(str); Q_UNUSED(str);
return "%l"; return "%l";
} }
/** /**
* @brief ElementLineNum::next @brief ElementLineNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext ElementLineNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext ElementLineNum::next (const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* @brief ElementLineNum::previous @brief ElementLineNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext ElementLineNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext ElementLineNum::previous(const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
ElementColumnNum::ElementColumnNum (Diagram *d): ElementColumnNum::ElementColumnNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief ElementColumnNum::toRepresentedString @brief ElementColumnNum::toRepresentedString
* @return the represented string of folio @return the represented string of folio
*/ */
QString ElementColumnNum::toRepresentedString(const QString str) const { QString ElementColumnNum::toRepresentedString(const QString str) const {
Q_UNUSED(str); Q_UNUSED(str);
return "%c"; return "%c";
} }
/** /**
* @brief ElementColumnNum::next @brief ElementColumnNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext ElementColumnNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext ElementColumnNum::next (const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* @brief ElementColumnNum::previous @brief ElementColumnNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext ElementColumnNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext ElementColumnNum::previous(const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* Constructor Constructor
*/ */
ElementPrefixNum::ElementPrefixNum (Diagram *d): ElementPrefixNum::ElementPrefixNum (Diagram *d):
NumStrategy (d) NumStrategy (d)
{} {}
/** /**
* @brief ElementPrefixNum::toRepresentedString @brief ElementPrefixNum::toRepresentedString
* @return the represented string of folio @return the represented string of folio
*/ */
QString ElementPrefixNum::toRepresentedString(const QString str) const { QString ElementPrefixNum::toRepresentedString(const QString str) const {
Q_UNUSED(str); Q_UNUSED(str);
return "%prefix"; return "%prefix";
} }
/** /**
* @brief ElementPrefixNum::next @brief ElementPrefixNum::next
* @return the next NumerotationContext nc at position i @return the next NumerotationContext nc at position i
*/ */
NumerotationContext ElementPrefixNum::next (const NumerotationContext &nc, const int i) const { NumerotationContext ElementPrefixNum::next (const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }
/** /**
* @brief ElementPrefixNum::previous @brief ElementPrefixNum::previous
* @return the previous NumerotationContext nc at posiiton i @return the previous NumerotationContext nc at posiiton i
*/ */
NumerotationContext ElementPrefixNum::previous(const NumerotationContext &nc, const int i) const { NumerotationContext ElementPrefixNum::previous(const NumerotationContext &nc, const int i) const {
return (nextString(nc, i)); return (nextString(nc, i));
} }

View File

@@ -24,8 +24,9 @@ class NumStrategy;
class Diagram; class Diagram;
/** /**
* this class provide methods to handle content of NumerotationContext. @brief The NumerotationContextCommands class
*/ this class provide methods to handle content of NumerotationContext.
*/
class NumerotationContextCommands class NumerotationContextCommands
{ {
public: public:

View File

@@ -25,10 +25,10 @@
#include "projectpropertiesdialog.h" #include "projectpropertiesdialog.h"
/** /**
* @brief AutoNumberingDockWidget::AutoNumberingDockWidget @brief AutoNumberingDockWidget::AutoNumberingDockWidget
* Constructor Constructor
* @param parent : parent widget @param parent : parent widget
*/ */
AutoNumberingDockWidget::AutoNumberingDockWidget(QWidget *parent) : AutoNumberingDockWidget::AutoNumberingDockWidget(QWidget *parent) :
QDockWidget(parent), QDockWidget(parent),
ui(new Ui::AutoNumberingDockWidget) ui(new Ui::AutoNumberingDockWidget)
@@ -38,9 +38,9 @@ AutoNumberingDockWidget::AutoNumberingDockWidget(QWidget *parent) :
} }
/** /**
* @brief AutoNumberingDockWidget::~AutoNumberingDockWidget @brief AutoNumberingDockWidget::~AutoNumberingDockWidget
* Destructor Destructor
*/ */
AutoNumberingDockWidget::~AutoNumberingDockWidget() AutoNumberingDockWidget::~AutoNumberingDockWidget()
{ {
this->disconnect(); this->disconnect();
@@ -48,9 +48,9 @@ AutoNumberingDockWidget::~AutoNumberingDockWidget()
} }
/** /**
* @brief AutoNumberingDockWidget::clear @brief AutoNumberingDockWidget::clear
* Remove all combo box values Remove all combo box values
*/ */
void AutoNumberingDockWidget::clear() void AutoNumberingDockWidget::clear()
{ {
ui->m_conductor_cb->clear(); ui->m_conductor_cb->clear();
@@ -67,11 +67,11 @@ void AutoNumberingDockWidget::projectClosed()
} }
/** /**
* @brief AutoNumberingDockWidget::setProject @brief AutoNumberingDockWidget::setProject
* @param project: project to be setted @param project: project to be setted
* @param projectview: projectview to be setted @param projectview: projectview to be setted
* assign Project and ProjectView, connect all signals and setContext assign Project and ProjectView, connect all signals and setContext
*/ */
void AutoNumberingDockWidget::setProject(QETProject *project, ProjectView *projectview) void AutoNumberingDockWidget::setProject(QETProject *project, ProjectView *projectview)
{ {
//Disconnect previous project //Disconnect previous project
@@ -133,9 +133,9 @@ void AutoNumberingDockWidget::setProject(QETProject *project, ProjectView *proje
} }
/** /**
* @brief AutoNumberingDockWidget::setContext @brief AutoNumberingDockWidget::setContext
* Add all itens to comboboxes Add all itens to comboboxes
*/ */
void AutoNumberingDockWidget::setContext() { void AutoNumberingDockWidget::setContext() {
this->clear(); this->clear();
@@ -165,9 +165,9 @@ void AutoNumberingDockWidget::setContext() {
} }
/** /**
* @brief AutoNumberingDockWidget::setConductorActive @brief AutoNumberingDockWidget::setConductorActive
* @param dv: activated diagramview @param dv: activated diagramview
*/ */
void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) { void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) {
if (dv!=nullptr) { if (dv!=nullptr) {
QString conductor_autonum = dv->diagram()->conductorsAutonumName(); QString conductor_autonum = dv->diagram()->conductorsAutonumName();
@@ -177,9 +177,9 @@ void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) {
} }
/** /**
* @brief AutoNumberingDockWidget::setActive @brief AutoNumberingDockWidget::setActive
* Set current used autonumberings Set current used autonumberings
*/ */
void AutoNumberingDockWidget::setActive() { void AutoNumberingDockWidget::setActive() {
if (m_project_view!=nullptr) { if (m_project_view!=nullptr) {
@@ -206,9 +206,9 @@ void AutoNumberingDockWidget::setActive() {
} }
/** /**
* @brief AutoNumberingDockWidget::conductorAutoNumChanged @brief AutoNumberingDockWidget::conductorAutoNumChanged
* Add new or remove conductor auto num from combobox Add new or remove conductor auto num from combobox
*/ */
void AutoNumberingDockWidget::conductorAutoNumChanged() { void AutoNumberingDockWidget::conductorAutoNumChanged() {
ui->m_conductor_cb->clear(); ui->m_conductor_cb->clear();
@@ -222,10 +222,10 @@ void AutoNumberingDockWidget::conductorAutoNumChanged() {
} }
/** /**
* @brief AutoNumberingDockWidget::on_m_conductor_cb_activated @brief AutoNumberingDockWidget::on_m_conductor_cb_activated
* @param unused @param unused
* Set new conductor AutoNum Set new conductor AutoNum
*/ */
void AutoNumberingDockWidget::on_m_conductor_cb_activated(int) void AutoNumberingDockWidget::on_m_conductor_cb_activated(int)
{ {
QString current_autonum = ui->m_conductor_cb->currentText(); QString current_autonum = ui->m_conductor_cb->currentText();
@@ -236,9 +236,9 @@ void AutoNumberingDockWidget::on_m_conductor_cb_activated(int)
} }
/** /**
* @brief AutoNumberingDockWidget::elementAutoNumChanged @brief AutoNumberingDockWidget::elementAutoNumChanged
* Add new or remove element auto num from combobox Add new or remove element auto num from combobox
*/ */
void AutoNumberingDockWidget::elementAutoNumChanged() { void AutoNumberingDockWidget::elementAutoNumChanged() {
ui->m_element_cb->clear(); ui->m_element_cb->clear();
@@ -253,10 +253,10 @@ void AutoNumberingDockWidget::elementAutoNumChanged() {
} }
/** /**
* @brief AutoNumberingDockWidget::on_m_element_cb_activated @brief AutoNumberingDockWidget::on_m_element_cb_activated
* @param unused @param unused
* Set new element AutoNum Set new element AutoNum
*/ */
void AutoNumberingDockWidget::on_m_element_cb_activated(int) void AutoNumberingDockWidget::on_m_element_cb_activated(int)
{ {
m_project->setCurrrentElementAutonum(ui->m_element_cb->currentText()); m_project->setCurrrentElementAutonum(ui->m_element_cb->currentText());
@@ -264,9 +264,9 @@ void AutoNumberingDockWidget::on_m_element_cb_activated(int)
} }
/** /**
* @brief AutoNumberingDockWidget::folioAutoNumChanged @brief AutoNumberingDockWidget::folioAutoNumChanged
* Add new or remove folio auto num from combobox Add new or remove folio auto num from combobox
*/ */
void AutoNumberingDockWidget::folioAutoNumChanged() { void AutoNumberingDockWidget::folioAutoNumChanged() {
ui->m_folio_cb->clear(); ui->m_folio_cb->clear();
@@ -281,10 +281,10 @@ void AutoNumberingDockWidget::folioAutoNumChanged() {
} }
/** /**
* @brief AutoNumberingDockWidget::on_m_folio_cb_activated @brief AutoNumberingDockWidget::on_m_folio_cb_activated
* @param unused @param unused
* Set new folio AutoNum Set new folio AutoNum
*/ */
void AutoNumberingDockWidget::on_m_folio_cb_activated(int) { void AutoNumberingDockWidget::on_m_folio_cb_activated(int) {
QString current_autonum = ui->m_folio_cb->currentText(); QString current_autonum = ui->m_folio_cb->currentText();
TitleBlockProperties ip = m_project -> defaultTitleBlockProperties(); TitleBlockProperties ip = m_project -> defaultTitleBlockProperties();

View File

@@ -23,8 +23,8 @@
#include "qetproject.h" #include "qetproject.h"
#include "diagram.h" #include "diagram.h"
/** /**
* Constructor Constructor
*/ */
FolioAutonumberingW::FolioAutonumberingW(QETProject *project, QWidget *parent) : FolioAutonumberingW::FolioAutonumberingW(QETProject *project, QWidget *parent) :
QWidget(parent), QWidget(parent),
project_(project), project_(project),
@@ -39,56 +39,56 @@ FolioAutonumberingW::FolioAutonumberingW(QETProject *project, QWidget *parent) :
} }
/** /**
* Destructor Destructor
*/ */
FolioAutonumberingW::~FolioAutonumberingW() FolioAutonumberingW::~FolioAutonumberingW()
{ {
delete ui; delete ui;
} }
/** /**
* @brief FolioAutonumberingW::setContext @brief FolioAutonumberingW::setContext
* construct autonums in the comboBox selected in the @autonum_chooser QcomboBox construct autonums in the comboBox selected in the @autonum_chooser QcomboBox
*/ */
void FolioAutonumberingW::setContext(QList <QString> autonums) { void FolioAutonumberingW::setContext(QList <QString> autonums) {
foreach (QString str, autonums) { ui->m_autonums_cb->addItem(str);} foreach (QString str, autonums) { ui->m_autonums_cb->addItem(str);}
} }
/** /**
* @brief FolioAutonumberingW::autoNumSelected @brief FolioAutonumberingW::autoNumSelected
* returns the current autonum selected returns the current autonum selected
*/ */
QString FolioAutonumberingW::autoNumSelected(){ QString FolioAutonumberingW::autoNumSelected(){
return ui->m_autonums_cb->currentText(); return ui->m_autonums_cb->currentText();
} }
/** /**
* @brief FolioAutonumberingW::fromFolio @brief FolioAutonumberingW::fromFolio
* returns the current "From Folio" index returns the current "From Folio" index
*/ */
int FolioAutonumberingW::fromFolio(){ int FolioAutonumberingW::fromFolio(){
return ui->m_from_cb->currentIndex()-1; return ui->m_from_cb->currentIndex()-1;
} }
/** /**
* @brief FolioAutonumberingW::toFolio @brief FolioAutonumberingW::toFolio
* returns the current "To Folio" index returns the current "To Folio" index
*/ */
int FolioAutonumberingW::toFolio(){ int FolioAutonumberingW::toFolio(){
return ui->m_to_cb->currentIndex()+this->fromFolio()+1; return ui->m_to_cb->currentIndex()+this->fromFolio()+1;
} }
/** /**
* @brief FolioAutonumberingW::newFoliosNumber @brief FolioAutonumberingW::newFoliosNumber
* returns the number of folios to create returns the number of folios to create
*/ */
int FolioAutonumberingW::newFoliosNumber(){ int FolioAutonumberingW::newFoliosNumber(){
return ui->m_new_tabs_sb->value(); return ui->m_new_tabs_sb->value();
} }
/** /**
* @brief FolioAutonumberingW::updateFolioList @brief FolioAutonumberingW::updateFolioList
* update Folio List in From and To ComboBox update Folio List in From and To ComboBox
*/ */
void FolioAutonumberingW::updateFolioList(){ void FolioAutonumberingW::updateFolioList(){
ui -> m_from_cb->clear(); ui -> m_from_cb->clear();
ui -> m_to_cb->clear(); ui -> m_to_cb->clear();
@@ -100,9 +100,9 @@ void FolioAutonumberingW::updateFolioList(){
} }
/** /**
* @brief FolioAutonumberingW::on_m_create_new_tabs_rb_clicked @brief FolioAutonumberingW::on_m_create_new_tabs_rb_clicked
* Enable New Tabs SpinBox * Enable New Tabs SpinBox
*/ */
void FolioAutonumberingW::on_m_create_new_tabs_rb_clicked() { void FolioAutonumberingW::on_m_create_new_tabs_rb_clicked() {
ui->m_from_cb->setEnabled(false); ui->m_from_cb->setEnabled(false);
ui->m_to_cb->setEnabled(false); ui->m_to_cb->setEnabled(false);
@@ -112,9 +112,9 @@ void FolioAutonumberingW::on_m_create_new_tabs_rb_clicked() {
} }
/** /**
* @brief FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked @brief FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked
* Enable From ComboBox, fill From ComboBox * Enable From ComboBox, fill From ComboBox
*/ */
void FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked() { void FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked() {
ui->m_new_tabs_sb->setEnabled(false); ui->m_new_tabs_sb->setEnabled(false);
ui->m_from_cb->setEnabled(true); ui->m_from_cb->setEnabled(true);
@@ -131,18 +131,18 @@ void FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked() {
} }
/** /**
* @brief FolioAutonumberingW::on_m_new_tabs_sb_valueChanged @brief FolioAutonumberingW::on_m_new_tabs_sb_valueChanged
* Enable Apply if any new folio is to be created * Enable Apply if any new folio is to be created
*/ */
void FolioAutonumberingW::on_m_new_tabs_sb_valueChanged(int){ void FolioAutonumberingW::on_m_new_tabs_sb_valueChanged(int){
if (ui->m_new_tabs_sb->value()>0) applyEnable(true); if (ui->m_new_tabs_sb->value()>0) applyEnable(true);
else applyEnable(false); else applyEnable(false);
} }
/** /**
* @brief FolioAutonumberingW::on_m_from_cb_currentIndexChanged @brief FolioAutonumberingW::on_m_from_cb_currentIndexChanged
* Enable To ComboBox * Enable To ComboBox
*/ */
void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(int){ void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(int){
int index = ui->m_from_cb->currentIndex(); int index = ui->m_from_cb->currentIndex();
ui->m_to_cb->clear(); ui->m_to_cb->clear();
@@ -159,9 +159,9 @@ void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(int){
} }
/** /**
* @brief SelectAutonumW::on_buttonBox_clicked @brief SelectAutonumW::on_buttonBox_clicked
* Action on @buttonBox clicked Action on @buttonBox clicked
*/ */
void FolioAutonumberingW::on_buttonBox_clicked(QAbstractButton *button) { void FolioAutonumberingW::on_buttonBox_clicked(QAbstractButton *button) {
//transform button to int //transform button to int
int answer = ui -> buttonBox -> buttonRole(button); int answer = ui -> buttonBox -> buttonRole(button);
@@ -194,9 +194,9 @@ void FolioAutonumberingW::on_buttonBox_clicked(QAbstractButton *button) {
} }
/** /**
* @brief SelectAutonumW::applyEnable @brief SelectAutonumW::applyEnable
* enable/disable the apply button enable/disable the apply button
*/ */
void FolioAutonumberingW::applyEnable(bool b) { void FolioAutonumberingW::applyEnable(bool b) {
if (b){ if (b){
bool valid = true; bool valid = true;

View File

@@ -23,8 +23,8 @@
#include <utility> #include <utility>
/** /**
* Constructor Constructor
*/ */
FormulaAutonumberingW::FormulaAutonumberingW(QWidget *parent) : FormulaAutonumberingW::FormulaAutonumberingW(QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::FormulaAutonumberingW) ui(new Ui::FormulaAutonumberingW)
@@ -35,41 +35,41 @@ FormulaAutonumberingW::FormulaAutonumberingW(QWidget *parent) :
} }
/** /**
* Destructor Destructor
*/ */
FormulaAutonumberingW::~FormulaAutonumberingW() FormulaAutonumberingW::~FormulaAutonumberingW()
{ {
delete ui; delete ui;
} }
/** /**
* @brief FormulaAutonumberingW::setContext @brief FormulaAutonumberingW::setContext
* @param formula to be inserted into context @param formula to be inserted into context
*/ */
void FormulaAutonumberingW::setContext(const QString& formula) { void FormulaAutonumberingW::setContext(const QString& formula) {
ui->m_formula_le->insert(formula); ui->m_formula_le->insert(formula);
} }
/** /**
* @brief FormulaAutonumberingW::clearContext @brief FormulaAutonumberingW::clearContext
* @param clear formula line edit text @param clear formula line edit text
*/ */
void FormulaAutonumberingW::clearContext() { void FormulaAutonumberingW::clearContext() {
ui->m_formula_le->clear(); ui->m_formula_le->clear();
} }
/** /**
* @brief FormulaAutonumberingW::formula @brief FormulaAutonumberingW::formula
* @return formula to be stored into project @return formula to be stored into project
*/ */
QString FormulaAutonumberingW::formula() { QString FormulaAutonumberingW::formula() {
return ui->m_formula_le->text(); return ui->m_formula_le->text();
} }
/** /**
* @brief FormulaAutonumberingW::on_m_formula_le_textChanged @brief FormulaAutonumberingW::on_m_formula_le_textChanged
* Update Apply Button Update Apply Button
*/ */
void FormulaAutonumberingW::on_m_formula_le_textChanged(QString text) { void FormulaAutonumberingW::on_m_formula_le_textChanged(QString text) {
emit (textChanged(std::move(text))); emit (textChanged(std::move(text)));
} }

View File

@@ -20,8 +20,8 @@
#include "ui_numparteditorw.h" #include "ui_numparteditorw.h"
/** /**
* Constructor Constructor
*/ */
NumPartEditorW::NumPartEditorW(int type, QWidget *parent) : NumPartEditorW::NumPartEditorW(int type, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::NumPartEditorW), ui(new Ui::NumPartEditorW),
@@ -34,9 +34,9 @@ NumPartEditorW::NumPartEditorW(int type, QWidget *parent) :
} }
/** /**
* Constructor Constructor
* Build with value of @context at position i Build with value of @context at position i
*/ */
NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, int type, QWidget *parent): NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, int type, QWidget *parent):
QWidget(parent), QWidget(parent),
ui(new Ui::NumPartEditorW), ui(new Ui::NumPartEditorW),
@@ -69,8 +69,8 @@ NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, int type, Q
} }
/** /**
* Destructor Destructor
*/ */
NumPartEditorW::~NumPartEditorW() NumPartEditorW::~NumPartEditorW()
{ {
delete intValidator; delete intValidator;
@@ -102,9 +102,9 @@ void NumPartEditorW::setVisibleItems()
} }
/** /**
* @brief NumPartEditorW::toNumContext @brief NumPartEditorW::toNumContext
* @return the display to NumerotationContext @return the display to NumerotationContext
*/ */
NumerotationContext NumPartEditorW::toNumContext() { NumerotationContext NumPartEditorW::toNumContext() {
NumerotationContext nc; NumerotationContext nc;
QString type_str; QString type_str;
@@ -160,9 +160,9 @@ NumerotationContext NumPartEditorW::toNumContext() {
} }
/** /**
* @brief NumPartEditorW::isValid @brief NumPartEditorW::isValid
* @return true if value field isn't empty or if type is folio @return true if value field isn't empty or if type is folio
*/ */
bool NumPartEditorW::isValid() { bool NumPartEditorW::isValid() {
if (type_ == folio || type_ == idfolio || type_ == elementline || type_ == plant || type_ == locmach || if (type_ == folio || type_ == idfolio || type_ == elementline || type_ == plant || type_ == locmach ||
type_ == elementcolumn || type_ == elementprefix) {return true;} type_ == elementcolumn || type_ == elementprefix) {return true;}
@@ -171,9 +171,9 @@ bool NumPartEditorW::isValid() {
} }
/** /**
* @brief NumPartEditorW::on_type_cb_activated @brief NumPartEditorW::on_type_cb_activated
* Action when user change the type comboBox Action when user change the type comboBox
*/ */
void NumPartEditorW::on_type_cb_activated(int) { void NumPartEditorW::on_type_cb_activated(int) {
if (ui->type_cb->currentText() == tr("Chiffre 1")) if (ui->type_cb->currentText() == tr("Chiffre 1"))
setType(unit); setType(unit);
@@ -207,27 +207,27 @@ void NumPartEditorW::on_type_cb_activated(int) {
} }
/** /**
* @brief NumPartEditorW::on_value_field_textChanged @brief NumPartEditorW::on_value_field_textChanged
* emit changed when @value_field text changed emit changed when @value_field text changed
*/ */
void NumPartEditorW::on_value_field_textEdited() { void NumPartEditorW::on_value_field_textEdited() {
emit changed(); emit changed();
} }
/** /**
* @brief NumPartEditorW::on_increase_spinBox_valueChanged @brief NumPartEditorW::on_increase_spinBox_valueChanged
* emit changed when @increase_spinBox value changed emit changed when @increase_spinBox value changed
*/ */
void NumPartEditorW::on_increase_spinBox_valueChanged(int) { void NumPartEditorW::on_increase_spinBox_valueChanged(int) {
if (!ui -> value_field -> text().isEmpty()) emit changed(); if (!ui -> value_field -> text().isEmpty()) emit changed();
} }
/** /**
* @brief NumPartEditorW::setType @brief NumPartEditorW::setType
* Set good behavior by type @t Set good behavior by type @t
* @param t, type used @param t, type used
* @param fnum, force the behavior of numeric type @param fnum, force the behavior of numeric type
*/ */
void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) { void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
setCurrentIndex(t); setCurrentIndex(t);
@@ -285,10 +285,10 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
} }
/** /**
* @brief NumPartEditorW::setCurrentIndex @brief NumPartEditorW::setCurrentIndex
* Set Current Index of type_cb Set Current Index of type_cb
* @param t, type used @param t, type used
*/ */
void NumPartEditorW::setCurrentIndex(NumPartEditorW::type t) { void NumPartEditorW::setCurrentIndex(NumPartEditorW::type t) {
int i=-1; int i=-1;
if (t == unit) if (t == unit)

View File

@@ -26,7 +26,7 @@
*This class represent a single part num widget. By this widget, we can define and edit *This class represent a single part num widget. By this widget, we can define and edit
*how the num auto must work . *how the num auto must work .
*This widget is called by selectautonumw. *This widget is called by selectautonumw.
*/ */
namespace Ui { namespace Ui {
class NumPartEditorW; class NumPartEditorW;
} }

View File

@@ -25,8 +25,8 @@
#include "assignvariables.h" #include "assignvariables.h"
/** /**
* Constructor Constructor
*/ */
SelectAutonumW::SelectAutonumW(int type, QWidget *parent) : SelectAutonumW::SelectAutonumW(int type, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SelectAutonumW), ui(new Ui::SelectAutonumW),
@@ -72,17 +72,17 @@ SelectAutonumW::SelectAutonumW(const NumerotationContext &context, int type, QWi
} }
/** /**
* Destructor Destructor
*/ */
SelectAutonumW::~SelectAutonumW() SelectAutonumW::~SelectAutonumW()
{ {
delete ui; delete ui;
} }
/** /**
* @brief SelectAutonumW::setCurrentContext @brief SelectAutonumW::setCurrentContext
* build the context of current diagram selected in the @diagram_chooser QcomboBox build the context of current diagram selected in the @diagram_chooser QcomboBox
*/ */
void SelectAutonumW::setContext(const NumerotationContext &context) { void SelectAutonumW::setContext(const NumerotationContext &context) {
m_context = context; m_context = context;
@@ -109,9 +109,9 @@ void SelectAutonumW::setContext(const NumerotationContext &context) {
} }
/** /**
* @brief SelectAutonumW::toNumContext @brief SelectAutonumW::toNumContext
* @return the content to @num_part_list to NumerotationContext @return the content to @num_part_list to NumerotationContext
*/ */
NumerotationContext SelectAutonumW::toNumContext() const { NumerotationContext SelectAutonumW::toNumContext() const {
NumerotationContext nc; NumerotationContext nc;
foreach (NumPartEditorW *npew, num_part_list_) nc << npew -> toNumContext(); foreach (NumPartEditorW *npew, num_part_list_) nc << npew -> toNumContext();
@@ -119,9 +119,9 @@ NumerotationContext SelectAutonumW::toNumContext() const {
} }
/** /**
* @brief SelectAutonumW::on_add_button_clicked @brief SelectAutonumW::on_add_button_clicked
* Action on add_button, add a @NumPartEditor * Action on add_button, add a @NumPartEditor
*/ */
void SelectAutonumW::on_add_button_clicked() void SelectAutonumW::on_add_button_clicked()
{ {
applyEnable(false); applyEnable(false);
@@ -133,9 +133,9 @@ void SelectAutonumW::on_add_button_clicked()
} }
/** /**
* @brief SelectAutonumW::on_remove_button_clicked @brief SelectAutonumW::on_remove_button_clicked
* Action on remove button, remove the last @NumPartEditor * Action on remove button, remove the last @NumPartEditor
*/ */
void SelectAutonumW::on_remove_button_clicked() { void SelectAutonumW::on_remove_button_clicked() {
//remove if @num_part_list contains more than one item //remove if @num_part_list contains more than one item
if (num_part_list_.size() > 1) { if (num_part_list_.size() > 1) {
@@ -150,9 +150,9 @@ void SelectAutonumW::on_remove_button_clicked() {
} }
/** /**
* @brief SelectAutonumW::formula @brief SelectAutonumW::formula
* @return autonumbering widget formula @return autonumbering widget formula
*/ */
QString SelectAutonumW::formula() QString SelectAutonumW::formula()
{ {
if (m_edited_type == 0) if (m_edited_type == 0)
@@ -169,9 +169,9 @@ QComboBox *SelectAutonumW::contextComboBox() const
} }
/** /**
* @brief SelectAutonumW::on_buttonBox_clicked @brief SelectAutonumW::on_buttonBox_clicked
* Action on @buttonBox clicked Action on @buttonBox clicked
*/ */
void SelectAutonumW::on_buttonBox_clicked(QAbstractButton *button) { void SelectAutonumW::on_buttonBox_clicked(QAbstractButton *button) {
//transform button to int //transform button to int
int answer = ui -> buttonBox -> buttonRole(button); int answer = ui -> buttonBox -> buttonRole(button);
@@ -233,9 +233,9 @@ void SelectAutonumW::on_buttonBox_clicked(QAbstractButton *button) {
} }
/** /**
* @brief SelectAutonumW::applyEnable @brief SelectAutonumW::applyEnable
* enable/disable the apply button enable/disable the apply button
*/ */
void SelectAutonumW::applyEnable(bool b) { void SelectAutonumW::applyEnable(bool b) {
if (b){ if (b){
bool valid= true; bool valid= true;
@@ -252,9 +252,9 @@ void SelectAutonumW::applyEnable(bool b) {
} }
/** /**
* @brief SelectAutonumW::contextToFormula @brief SelectAutonumW::contextToFormula
* Apply formula to ElementAutonumbering Widget Apply formula to ElementAutonumbering Widget
*/ */
void SelectAutonumW::contextToFormula() void SelectAutonumW::contextToFormula()
{ {
FormulaAutonumberingW* m_faw = nullptr; FormulaAutonumberingW* m_faw = nullptr;
@@ -271,9 +271,9 @@ void SelectAutonumW::contextToFormula()
} }
/** /**
* @brief SelectAutonumW::on_m_next_pb_clicked @brief SelectAutonumW::on_m_next_pb_clicked
* Increase NumerotationContext Increase NumerotationContext
*/ */
void SelectAutonumW::on_m_next_pb_clicked() void SelectAutonumW::on_m_next_pb_clicked()
{ {
NumerotationContextCommands ncc (toNumContext()); NumerotationContextCommands ncc (toNumContext());
@@ -282,9 +282,9 @@ void SelectAutonumW::on_m_next_pb_clicked()
} }
/** /**
* @brief SelectAutonumW::on_m_previous_pb_clicked @brief SelectAutonumW::on_m_previous_pb_clicked
* Decrease NumerotationContext Decrease NumerotationContext
*/ */
void SelectAutonumW::on_m_previous_pb_clicked() void SelectAutonumW::on_m_previous_pb_clicked()
{ {
NumerotationContextCommands ncc (toNumContext()); NumerotationContextCommands ncc (toNumContext());

View File

@@ -605,13 +605,13 @@ void BorderTitleBlock::draw(QPainter *painter)
} }
/** /**
* @brief BorderTitleBlock::drawDxf @brief BorderTitleBlock::drawDxf
* @param width @param width
* @param height @param height
* @param keep_aspect_ratio @param keep_aspect_ratio
* @param file_path @param file_path
* @param color @param color
*/ */
void BorderTitleBlock::drawDxf( void BorderTitleBlock::drawDxf(
int width, int width,
int height, int height,

View File

@@ -26,10 +26,10 @@
#include <QFileDialog> #include <QFileDialog>
/** /**
* @brief ConductorNumExport::ConductorNumExport @brief ConductorNumExport::ConductorNumExport
* @param project : the project to export the conductors num @param project : the project to export the conductors num
* @param parent : parent widget @param parent : parent widget
*/ */
ConductorNumExport::ConductorNumExport(QETProject *project, QWidget *parent) : ConductorNumExport::ConductorNumExport(QETProject *project, QWidget *parent) :
m_project(project), m_project(project),
m_parent_widget(parent) m_parent_widget(parent)
@@ -38,10 +38,10 @@ ConductorNumExport::ConductorNumExport(QETProject *project, QWidget *parent) :
} }
/** /**
* @brief ConductorNumExport::toCsv @brief ConductorNumExport::toCsv
* Export the num of conductors into a csv file. Export the num of conductors into a csv file.
* @return true if suceesfully exported. @return true if suceesfully exported.
*/ */
bool ConductorNumExport::toCsv() bool ConductorNumExport::toCsv()
{ {
QString name = QObject::tr("numero_de_fileries_") + m_project->title() + ".csv"; QString name = QObject::tr("numero_de_fileries_") + m_project->title() + ".csv";
@@ -86,9 +86,9 @@ bool ConductorNumExport::toCsv()
} }
/** /**
* @brief ConductorNumExport::wiresNum @brief ConductorNumExport::wiresNum
* @return the wire num formated in csv @return the wire num formated in csv
*/ */
QString ConductorNumExport::wiresNum() const QString ConductorNumExport::wiresNum() const
{ {
QString csv; QString csv;
@@ -106,9 +106,9 @@ QString ConductorNumExport::wiresNum() const
} }
/** /**
* @brief ConductorNumExport::fillHash @brief ConductorNumExport::fillHash
* @value m_hash @value m_hash
*/ */
void ConductorNumExport::fillHash() void ConductorNumExport::fillHash()
{ {
//We used this rx to avoid insert num composed only withe white space. //We used this rx to avoid insert num composed only withe white space.

View File

@@ -24,9 +24,9 @@ class QETProject;
class QWidget; class QWidget;
/** /**
* @brief The ConductorNumExport class @brief The ConductorNumExport class
* A class to export the num of conductors into a csv file. A class to export the num of conductors into a csv file.
*/ */
class ConductorNumExport class ConductorNumExport
{ {
public: public:

View File

@@ -241,10 +241,10 @@ ConductorProperties::~ConductorProperties() {
/** /**
* @brief ConductorProperties::toXml @brief ConductorProperties::toXml
* Export conductor propertie, in the XML element 'e' Export conductor propertie, in the XML element 'e'
* @param e the xml element @param e the xml element
*/ */
void ConductorProperties::toXml(QDomElement &e) const void ConductorProperties::toXml(QDomElement &e) const
{ {
e.setAttribute("type", typeToString(type)); e.setAttribute("type", typeToString(type));
@@ -284,10 +284,10 @@ void ConductorProperties::toXml(QDomElement &e) const
/** /**
* @brief ConductorProperties::fromXml @brief ConductorProperties::fromXml
* Import conductor propertie, from the attribute of the xml element 'e' Import conductor propertie, from the attribute of the xml element 'e'
* @param e the xml document @param e the xml document
*/ */
void ConductorProperties::fromXml(QDomElement &e) void ConductorProperties::fromXml(QDomElement &e)
{ {
// get conductor color // get conductor color
@@ -440,11 +440,11 @@ QString ConductorProperties::typeToString(ConductorType t)
} }
/** /**
* @brief ConductorProperties::applyForEqualAttributes @brief ConductorProperties::applyForEqualAttributes
* Test each attribute of properties in the list separatly. Test each attribute of properties in the list separatly.
* For each attributes, if is equal, the attribute is apply to this. For each attributes, if is equal, the attribute is apply to this.
* @param list @param list
*/ */
void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> list) void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> list)
{ {
const QList<ConductorProperties> clist = std::move(list); const QList<ConductorProperties> clist = std::move(list);
@@ -698,9 +698,9 @@ void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> lis
} }
/** /**
* @brief ConductorProperties::defaultProperties @brief ConductorProperties::defaultProperties
* @return the default properties stored in the setting file @return the default properties stored in the setting file
*/ */
ConductorProperties ConductorProperties::defaultProperties() ConductorProperties ConductorProperties::defaultProperties()
{ {
QSettings settings; QSettings settings;
@@ -712,10 +712,10 @@ ConductorProperties ConductorProperties::defaultProperties()
} }
/** /**
* @brief ConductorProperties::operator == @brief ConductorProperties::operator ==
* @param other @param other
* @return true if other == this @return true if other == this
*/ */
bool ConductorProperties::operator==(const ConductorProperties &other) const bool ConductorProperties::operator==(const ConductorProperties &other) const
{ {
return( return(

View File

@@ -137,10 +137,10 @@ void ConfigDialog::addPage(ConfigPage *page) {
} }
/** /**
* @brief ConfigDialog::setCurrentPage @brief ConfigDialog::setCurrentPage
* Set the current index to @index Set the current index to @index
* @param index @param index
*/ */
void ConfigDialog::setCurrentPage(const int index) { void ConfigDialog::setCurrentPage(const int index) {
pages_list->setCurrentRow(index); pages_list->setCurrentRow(index);
} }

View File

@@ -33,12 +33,12 @@
#include <utility> #include <utility>
/** /**
* @brief NewDiagramPage::NewDiagramPage @brief NewDiagramPage::NewDiagramPage
* Default constructor Default constructor
* @param project, If project, edit the propertie of Project @param project, If project, edit the propertie of Project
* else edit the properties by default of QElectroTech else edit the properties by default of QElectroTech
* @param parent, parent widget @param parent, parent widget
*/ */
NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent, ProjectPropertiesDialog *ppd) : NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent, ProjectPropertiesDialog *ppd) :
ConfigPage (parent), ConfigPage (parent),
ppd_ (ppd), ppd_ (ppd),
@@ -93,18 +93,18 @@ NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent, ProjectProp
} }
/** /**
* @brief NewDiagramPage::~NewDiagramPage @brief NewDiagramPage::~NewDiagramPage
*/ */
NewDiagramPage::~NewDiagramPage() { NewDiagramPage::~NewDiagramPage() {
disconnect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab())); disconnect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab()));
} }
/** /**
* @brief NewDiagramPage::applyConf @brief NewDiagramPage::applyConf
* Apply conf for this page. Apply conf for this page.
* If there is a project, save in the project, If there is a project, save in the project,
* else save to the default conf of QElectroTech else save to the default conf of QElectroTech
*/ */
void NewDiagramPage::applyConf() { void NewDiagramPage::applyConf() {
if (m_project) { //If project we save to the project if (m_project) { //If project we save to the project
if (m_project -> isReadOnly()) return; if (m_project -> isReadOnly()) return;
@@ -171,27 +171,27 @@ void NewDiagramPage::applyConf() {
} }
/** /**
* @brief NewDiagramPage::icon @brief NewDiagramPage::icon
* @return icon of this page @return icon of this page
*/ */
QIcon NewDiagramPage::icon() const { QIcon NewDiagramPage::icon() const {
if (m_project) return(QET::Icons::NewDiagram); if (m_project) return(QET::Icons::NewDiagram);
return(QET::Icons::Projects); return(QET::Icons::Projects);
} }
/** /**
* @brief NewDiagramPage::title @brief NewDiagramPage::title
* @return title of this page @return title of this page
*/ */
QString NewDiagramPage::title() const { QString NewDiagramPage::title() const {
if (m_project) return(tr("Nouveau folio", "configuration page title")); if (m_project) return(tr("Nouveau folio", "configuration page title"));
return(tr("Nouveau projet", "configuration page title")); return(tr("Nouveau projet", "configuration page title"));
} }
/** /**
* @brief NewDiagramPage::changeToAutoFolioTab @brief NewDiagramPage::changeToAutoFolioTab
* Set the current tab to Autonum Set the current tab to Autonum
*/ */
void NewDiagramPage::changeToAutoFolioTab(){ void NewDiagramPage::changeToAutoFolioTab(){
if (m_project){ if (m_project){
ppd_->setCurrentPage(ProjectPropertiesDialog::Autonum); ppd_->setCurrentPage(ProjectPropertiesDialog::Autonum);
@@ -201,9 +201,9 @@ void NewDiagramPage::changeToAutoFolioTab(){
} }
/** /**
* @brief NewDiagramPage::setFolioAutonum @brief NewDiagramPage::setFolioAutonum
* Set temporary TBP to use in auto folio num Set temporary TBP to use in auto folio num
*/ */
void NewDiagramPage::setFolioAutonum(QString autoNum){ void NewDiagramPage::setFolioAutonum(QString autoNum){
TitleBlockProperties tbptemp = ipw->propertiesAutoNum(std::move(autoNum)); TitleBlockProperties tbptemp = ipw->propertiesAutoNum(std::move(autoNum));
ipw->setProperties(tbptemp); ipw->setProperties(tbptemp);
@@ -211,17 +211,17 @@ void NewDiagramPage::setFolioAutonum(QString autoNum){
} }
/** /**
* @brief NewDiagramPage::saveCurrentTbp @brief NewDiagramPage::saveCurrentTbp
* Save current TBP to retrieve after auto folio num Save current TBP to retrieve after auto folio num
*/ */
void NewDiagramPage::saveCurrentTbp(){ void NewDiagramPage::saveCurrentTbp(){
savedTbp = ipw->properties(); savedTbp = ipw->properties();
} }
/** /**
* @brief NewDiagramPage::loadSavedTbp @brief NewDiagramPage::loadSavedTbp
* Retrieve saved auto folio num Retrieve saved auto folio num
*/ */
void NewDiagramPage::loadSavedTbp(){ void NewDiagramPage::loadSavedTbp(){
ipw->setProperties(savedTbp); ipw->setProperties(savedTbp);
applyConf(); applyConf();
@@ -304,9 +304,9 @@ PrintConfigPage::~PrintConfigPage() {
} }
/** /**
* @brief PrintConfigPage::applyConf @brief PrintConfigPage::applyConf
* Apply the config of this page Apply the config of this page
*/ */
void PrintConfigPage::applyConf() void PrintConfigPage::applyConf()
{ {
QString prefix = "print/default"; QString prefix = "print/default";

View File

@@ -378,14 +378,14 @@ long Createdxf::RGBcodeTable[255]{
}; };
/** /**
* @brief Createdxf::getcolorCode @brief Createdxf::getcolorCode
* This function returns the ACI color which is the "nearest" color to This function returns the ACI color which is the "nearest" color to
* the color defined by the red, green and blue (RGB) values passed the color defined by the red, green and blue (RGB) values passed
* in argument. in argument.
* @param red @param red
* @param green @param green
* @param blue @param blue
*/ */
int Createdxf::getcolorCode (const long red, const long green, const long blue) int Createdxf::getcolorCode (const long red, const long green, const long blue)
{ {
long acirgb, r,g,b; long acirgb, r,g,b;
@@ -409,12 +409,12 @@ int Createdxf::getcolorCode (const long red, const long green, const long blue)
} }
/** /**
* @brief Createdxf::drawLine @brief Createdxf::drawLine
* Conveniance function to draw line Conveniance function to draw line
* @param filepath @param filepath
* @param line @param line
* @param colorcode @param colorcode
*/ */
void Createdxf::drawLine(const QString &filepath, const QLineF &line, const int &colorcode) { void Createdxf::drawLine(const QString &filepath, const QLineF &line, const int &colorcode) {
drawLine(filepath, line.p1().x() * xScale, drawLine(filepath, line.p1().x() * xScale,
sheetHeight - (line.p1().y() * yScale), sheetHeight - (line.p1().y() * yScale),
@@ -547,12 +547,12 @@ void Createdxf::drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal
} }
/** /**
* @brief Createdxf::drawEllipse @brief Createdxf::drawEllipse
* Conveniance function for draw ellipse Conveniance function for draw ellipse
* @param filepath @param filepath
* @param rect @param rect
* @param colorcode @param colorcode
*/ */
void Createdxf::drawEllipse(const QString &filepath, const QRectF &rect, const int &colorcode) { void Createdxf::drawEllipse(const QString &filepath, const QRectF &rect, const int &colorcode) {
drawArcEllipse(filepath, rect.topLeft().x() * xScale, drawArcEllipse(filepath, rect.topLeft().x() * xScale,
sheetHeight - (rect.topLeft().y() * yScale), sheetHeight - (rect.topLeft().y() * yScale),
@@ -653,12 +653,12 @@ void Createdxf::drawRectangle (const QString &fileName, double x1, double y1, do
} }
/** /**
* @brief Createdxf::drawRectangle @brief Createdxf::drawRectangle
* Conveniance function for draw rectangle Conveniance function for draw rectangle
* @param filepath @param filepath
* @param rect @param rect
* @param color @param color
*/ */
void Createdxf::drawRectangle(const QString &filepath, const QRectF &rect, const int &colorcode) { void Createdxf::drawRectangle(const QString &filepath, const QRectF &rect, const int &colorcode) {
drawRectangle(filepath, rect.bottomLeft().x() * xScale, drawRectangle(filepath, rect.bottomLeft().x() * xScale,
sheetHeight - (rect.bottomLeft().y() * yScale), sheetHeight - (rect.bottomLeft().y() * yScale),

View File

@@ -26,11 +26,11 @@
#include <QSqlError> #include <QSqlError>
/** /**
* @brief projectDataBase::projectDataBase @brief projectDataBase::projectDataBase
* Default constructor Default constructor
* @param project : project from the database work @param project : project from the database work
* @param parent : parent QObject @param parent : parent QObject
*/ */
projectDataBase::projectDataBase(QETProject *project, QObject *parent) : projectDataBase::projectDataBase(QETProject *project, QObject *parent) :
QObject(parent), QObject(parent),
m_project(project) m_project(project)
@@ -46,18 +46,18 @@ projectDataBase::projectDataBase(QETProject *project, const QString &connection_
} }
/** /**
* @brief projectDataBase::~projectDataBase @brief projectDataBase::~projectDataBase
* Destructor Destructor
*/ */
projectDataBase::~projectDataBase() { projectDataBase::~projectDataBase() {
m_data_base.close(); m_data_base.close();
} }
/** /**
* @brief projectDataBase::updateDB @brief projectDataBase::updateDB
* Up to date the content of the data base. Up to date the content of the data base.
* Emit the signal dataBaseUpdated Emit the signal dataBaseUpdated
*/ */
void projectDataBase::updateDB() void projectDataBase::updateDB()
{ {
populateDiagramTable(); populateDiagramTable();
@@ -68,25 +68,25 @@ void projectDataBase::updateDB()
} }
/** /**
* @brief projectDataBase::project @brief projectDataBase::project
* @return the project of this database @return the project of this database
*/ */
QETProject *projectDataBase::project() const { QETProject *projectDataBase::project() const {
return m_project; return m_project;
} }
/** /**
* @brief projectDataBase::newQuery @brief projectDataBase::newQuery
* @return a QSqlquery with @query as query and the internal database of this class as database to use. @return a QSqlquery with @query as query and the internal database of this class as database to use.
*/ */
QSqlQuery projectDataBase::newQuery(const QString &query) { QSqlQuery projectDataBase::newQuery(const QString &query) {
return QSqlQuery(query, m_data_base); return QSqlQuery(query, m_data_base);
} }
/** /**
* @brief projectDataBase::addElement @brief projectDataBase::addElement
* @param element @param element
*/ */
void projectDataBase::addElement(Element *element) void projectDataBase::addElement(Element *element)
{ {
m_insert_elements_query.bindValue(":uuid", element->uuid().toString()); m_insert_elements_query.bindValue(":uuid", element->uuid().toString());
@@ -115,9 +115,9 @@ void projectDataBase::addElement(Element *element)
} }
/** /**
* @brief projectDataBase::removeElement @brief projectDataBase::removeElement
* @param element @param element
*/ */
void projectDataBase::removeElement(Element *element) void projectDataBase::removeElement(Element *element)
{ {
m_remove_element_query.bindValue(":uuid", element->uuid().toString()); m_remove_element_query.bindValue(":uuid", element->uuid().toString());
@@ -129,9 +129,9 @@ void projectDataBase::removeElement(Element *element)
} }
/** /**
* @brief projectDataBase::elementInfoChanged @brief projectDataBase::elementInfoChanged
* @param element @param element
*/ */
void projectDataBase::elementInfoChanged(Element *element) void projectDataBase::elementInfoChanged(Element *element)
{ {
auto hash = elementInfoToString(element); auto hash = elementInfoToString(element);
@@ -186,10 +186,10 @@ void projectDataBase::removeDiagram(Diagram *diagram)
} }
/** /**
* @brief projectDataBase::createDataBase @brief projectDataBase::createDataBase
* Create the data base Create the data base
* @return : true if the data base was successfully created. @return : true if the data base was successfully created.
*/ */
bool projectDataBase::createDataBase(const QString &connection_name, const QString &name) bool projectDataBase::createDataBase(const QString &connection_name, const QString &name)
{ {
@@ -285,8 +285,8 @@ bool projectDataBase::createDataBase(const QString &connection_name, const QStri
} }
/** /**
* @brief projectDataBase::createElementNomenclatureView @brief projectDataBase::createElementNomenclatureView
*/ */
void projectDataBase::createElementNomenclatureView() void projectDataBase::createElementNomenclatureView()
{ {
QString create_view ("CREATE VIEW element_nomenclature_view AS SELECT " QString create_view ("CREATE VIEW element_nomenclature_view AS SELECT "
@@ -322,8 +322,8 @@ void projectDataBase::createElementNomenclatureView()
} }
/** /**
* @brief projectDataBase::createSummaryView @brief projectDataBase::createSummaryView
*/ */
void projectDataBase::createSummaryView() void projectDataBase::createSummaryView()
{ {
QString create_view ("CREATE VIEW project_summary_view AS SELECT " QString create_view ("CREATE VIEW project_summary_view AS SELECT "
@@ -360,9 +360,9 @@ void projectDataBase::populateDiagramTable()
} }
/** /**
* @brief projectDataBase::populateElementTable @brief projectDataBase::populateElementTable
* Populate the element table Populate the element table
*/ */
void projectDataBase::populateElementTable() void projectDataBase::populateElementTable()
{ {
QSqlQuery query_(m_data_base); QSqlQuery query_(m_data_base);
@@ -388,9 +388,9 @@ void projectDataBase::populateElementTable()
} }
/** /**
* @brief projectDataBase::populateElementsTable @brief projectDataBase::populateElementsTable
* Populate the elements table Populate the elements table
*/ */
void projectDataBase::populateElementInfoTable() void projectDataBase::populateElementInfoTable()
{ {
QSqlQuery query(m_data_base); QSqlQuery query(m_data_base);
@@ -506,10 +506,10 @@ void projectDataBase::prepareQuery()
} }
/** /**
* @brief projectDataBase::elementInfoToString @brief projectDataBase::elementInfoToString
* @param elmt @param elmt
* @return the element information in hash as key for the info name and value as the information value. @return the element information in hash as key for the info name and value as the information value.
*/ */
QHash<QString, QString> projectDataBase::elementInfoToString(Element *elmt) QHash<QString, QString> projectDataBase::elementInfoToString(Element *elmt)
{ {
QHash<QString, QString> hash; //Store the value for each columns QHash<QString, QString> hash; //Store the value for each columns
@@ -527,14 +527,14 @@ QHash<QString, QString> projectDataBase::elementInfoToString(Element *elmt)
} }
/** /**
* @brief projectDataBase::exportDb @brief projectDataBase::exportDb
* @param parent @param parent
* @param caption @param caption
* @param dir @param dir
* @param filter @param filter
* @param selectedFilter @param selectedFilter
* @param options @param options
*/ */
void projectDataBase::exportDb(projectDataBase *db, QWidget *parent, const QString &caption, const QString &dir) void projectDataBase::exportDb(projectDataBase *db, QWidget *parent, const QString &caption, const QString &dir)
{ {
auto caption_ = caption; auto caption_ = caption;

View File

@@ -29,12 +29,12 @@ class QETProject;
class Diagram; class Diagram;
/** /**
* @brief The projectDataBase class @brief The projectDataBase class
* This class wrap a sqlite data base where you can find several thing about This class wrap a sqlite data base where you can find several thing about
* the content of a project. the content of a project.
* *
* NOTE this class is still in developement. @note this class is still in developement.
*/ */
class projectDataBase : public QObject class projectDataBase : public QObject
{ {
Q_OBJECT Q_OBJECT

View File

@@ -22,9 +22,9 @@
#include <QRegularExpression> #include <QRegularExpression>
/** /**
* @brief ElementQueryWidget::ElementQueryWidget @brief ElementQueryWidget::ElementQueryWidget
* @param parent @param parent
*/ */
ElementQueryWidget::ElementQueryWidget(QWidget *parent) : ElementQueryWidget::ElementQueryWidget(QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::ElementQueryWidget) ui(new Ui::ElementQueryWidget)
@@ -96,18 +96,18 @@ ElementQueryWidget::ElementQueryWidget(QWidget *parent) :
} }
/** /**
* @brief ElementQueryWidget::~ElementQueryWidget @brief ElementQueryWidget::~ElementQueryWidget
*/ */
ElementQueryWidget::~ElementQueryWidget() { ElementQueryWidget::~ElementQueryWidget() {
delete ui; delete ui;
} }
/** /**
* @brief ElementQueryWidget::setQuery @brief ElementQueryWidget::setQuery
* @param query @param query
* Set the current query to @query. Set the current query to @query.
* If it's possible, rebuild the state of the widget from the query If it's possible, rebuild the state of the widget from the query
*/ */
void ElementQueryWidget::setQuery(const QString &query) void ElementQueryWidget::setQuery(const QString &query)
{ {
if (query.startsWith("SELECT")) if (query.startsWith("SELECT"))
@@ -271,9 +271,9 @@ void ElementQueryWidget::setQuery(const QString &query)
} }
/** /**
* @brief ElementQueryWidget::queryStr @brief ElementQueryWidget::queryStr
* @return The current query @return The current query
*/ */
QString ElementQueryWidget::queryStr() const QString ElementQueryWidget::queryStr() const
{ {
//User define is own query //User define is own query
@@ -370,16 +370,16 @@ QString ElementQueryWidget::queryStr() const
} }
/** /**
* @brief ElementQueryWidget::updateQueryLine @brief ElementQueryWidget::updateQueryLine
*/ */
void ElementQueryWidget::updateQueryLine() { void ElementQueryWidget::updateQueryLine() {
ui->m_sql_query->setText(queryStr()); ui->m_sql_query->setText(queryStr());
} }
/** /**
* @brief ElementQueryWidget::selectedKeys @brief ElementQueryWidget::selectedKeys
* @return the current keys of selected infos to be exported @return the current keys of selected infos to be exported
*/ */
QStringList ElementQueryWidget::selectedKeys() const QStringList ElementQueryWidget::selectedKeys() const
{ {
//Made a string list with the colomns (keys) choosen by the user //Made a string list with the colomns (keys) choosen by the user
@@ -395,8 +395,8 @@ QStringList ElementQueryWidget::selectedKeys() const
} }
/** /**
* @brief ElementQueryWidget::setUpItems @brief ElementQueryWidget::setUpItems
*/ */
void ElementQueryWidget::setUpItems() void ElementQueryWidget::setUpItems()
{ {
for(QString key : QETApp::elementInfoKeys()) for(QString key : QETApp::elementInfoKeys())
@@ -419,18 +419,18 @@ void ElementQueryWidget::setUpItems()
} }
/** /**
* @brief ElementQueryWidget::FilterFor @brief ElementQueryWidget::FilterFor
* @param key @param key
* @return the filter associated to key @return the filter associated to key
*/ */
QPair<int, QString> ElementQueryWidget::FilterFor(const QString &key) const { QPair<int, QString> ElementQueryWidget::FilterFor(const QString &key) const {
return m_filter.value(key, qMakePair(0, QString())); return m_filter.value(key, qMakePair(0, QString()));
} }
/** /**
* @brief ElementQueryWidget::fillSavedQuery @brief ElementQueryWidget::fillSavedQuery
* Fill the combobox of saved queries Fill the combobox of saved queries
*/ */
void ElementQueryWidget::fillSavedQuery() void ElementQueryWidget::fillSavedQuery()
{ {
QFile file(QETApp::configDir() + "/nomenclature.json"); QFile file(QETApp::configDir() + "/nomenclature.json");
@@ -446,8 +446,8 @@ void ElementQueryWidget::fillSavedQuery()
} }
/** /**
* @brief ElementQueryWidget::on_m_up_pb_clicked @brief ElementQueryWidget::on_m_up_pb_clicked
*/ */
void ElementQueryWidget::on_m_up_pb_clicked() void ElementQueryWidget::on_m_up_pb_clicked()
{ {
auto row = ui->m_choosen_list->currentRow(); auto row = ui->m_choosen_list->currentRow();
@@ -463,8 +463,8 @@ void ElementQueryWidget::on_m_up_pb_clicked()
} }
/** /**
* @brief ElementQueryWidget::on_m_add_pb_clicked @brief ElementQueryWidget::on_m_add_pb_clicked
*/ */
void ElementQueryWidget::on_m_add_pb_clicked() void ElementQueryWidget::on_m_add_pb_clicked()
{ {
if (auto *item = ui->m_var_list->takeItem(ui->m_var_list->currentRow())) { if (auto *item = ui->m_var_list->takeItem(ui->m_var_list->currentRow())) {
@@ -475,8 +475,8 @@ void ElementQueryWidget::on_m_add_pb_clicked()
} }
/** /**
* @brief ElementQueryWidget::on_m_remove_pb_clicked @brief ElementQueryWidget::on_m_remove_pb_clicked
*/ */
void ElementQueryWidget::on_m_remove_pb_clicked() void ElementQueryWidget::on_m_remove_pb_clicked()
{ {
if (auto *item = ui->m_choosen_list->takeItem(ui->m_choosen_list->currentRow())) { if (auto *item = ui->m_choosen_list->takeItem(ui->m_choosen_list->currentRow())) {
@@ -487,8 +487,8 @@ void ElementQueryWidget::on_m_remove_pb_clicked()
} }
/** /**
* @brief ElementQueryWidget::on_m_down_pb_clicked @brief ElementQueryWidget::on_m_down_pb_clicked
*/ */
void ElementQueryWidget::on_m_down_pb_clicked() void ElementQueryWidget::on_m_down_pb_clicked()
{ {
auto row = ui->m_choosen_list->currentRow(); auto row = ui->m_choosen_list->currentRow();
@@ -504,8 +504,8 @@ void ElementQueryWidget::on_m_down_pb_clicked()
} }
/** /**
* @brief ElementQueryWidget::on_m_edit_sql_query_cb_clicked @brief ElementQueryWidget::on_m_edit_sql_query_cb_clicked
*/ */
void ElementQueryWidget::on_m_edit_sql_query_cb_clicked() void ElementQueryWidget::on_m_edit_sql_query_cb_clicked()
{ {
ui->m_sql_query->setEnabled(ui->m_edit_sql_query_cb->isChecked()); ui->m_sql_query->setEnabled(ui->m_edit_sql_query_cb->isChecked());
@@ -524,9 +524,9 @@ void ElementQueryWidget::on_m_edit_sql_query_cb_clicked()
} }
/** /**
* @brief ElementQueryWidget::on_m_filter_le_textEdited @brief ElementQueryWidget::on_m_filter_le_textEdited
* @param arg1 @param arg1
*/ */
void ElementQueryWidget::on_m_filter_le_textEdited(const QString &arg1) void ElementQueryWidget::on_m_filter_le_textEdited(const QString &arg1)
{ {
if (auto item = ui->m_choosen_list->currentItem()) if (auto item = ui->m_choosen_list->currentItem())
@@ -541,9 +541,9 @@ void ElementQueryWidget::on_m_filter_le_textEdited(const QString &arg1)
} }
/** /**
* @brief ElementQueryWidget::on_m_filter_type_cb_activated @brief ElementQueryWidget::on_m_filter_type_cb_activated
* @param index @param index
*/ */
void ElementQueryWidget::on_m_filter_type_cb_activated(int index) void ElementQueryWidget::on_m_filter_type_cb_activated(int index)
{ {
if (auto item = ui->m_choosen_list->currentItem()) if (auto item = ui->m_choosen_list->currentItem())
@@ -559,9 +559,9 @@ void ElementQueryWidget::on_m_filter_type_cb_activated(int index)
} }
/** /**
* @brief ElementQueryWidget::on_m_load_pb_clicked @brief ElementQueryWidget::on_m_load_pb_clicked
* Load a query from nomenclature.json file Load a query from nomenclature.json file
*/ */
void ElementQueryWidget::on_m_load_pb_clicked() void ElementQueryWidget::on_m_load_pb_clicked()
{ {
auto name = ui->m_conf_cb->currentText(); auto name = ui->m_conf_cb->currentText();
@@ -589,9 +589,9 @@ void ElementQueryWidget::on_m_load_pb_clicked()
} }
/** /**
* @brief ElementQueryWidget::on_m_save_current_conf_pb_clicked @brief ElementQueryWidget::on_m_save_current_conf_pb_clicked
* Save the actual query to nomenclature.json file Save the actual query to nomenclature.json file
*/ */
void ElementQueryWidget::on_m_save_current_conf_pb_clicked() void ElementQueryWidget::on_m_save_current_conf_pb_clicked()
{ {
QFile file_(QETApp::configDir() + "/nomenclature.json"); QFile file_(QETApp::configDir() + "/nomenclature.json");
@@ -648,9 +648,9 @@ void ElementQueryWidget::on_m_choosen_list_itemDoubleClicked(QListWidgetItem *it
} }
/** /**
* @brief ElementQueryWidget::reset @brief ElementQueryWidget::reset
* Clear this widget aka set to initial state Clear this widget aka set to initial state
*/ */
void ElementQueryWidget::reset() void ElementQueryWidget::reset()
{ {
//Ugly hack to force to remove all selected infos //Ugly hack to force to remove all selected infos

View File

@@ -28,10 +28,10 @@ class ElementQueryWidget;
} }
/** /**
* @brief The ElementQueryWidget class @brief The ElementQueryWidget class
* A widget use to edit a sql query for get element information A widget use to edit a sql query for get element information
* This widget only work to get information from ProjectDataBase This widget only work to get information from ProjectDataBase
*/ */
class ElementQueryWidget : public QWidget class ElementQueryWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT

View File

@@ -22,9 +22,9 @@
#include <QListWidgetItem> #include <QListWidgetItem>
/** /**
* @brief SummaryQueryWidget::SummaryQueryWidget @brief SummaryQueryWidget::SummaryQueryWidget
* @param parent @param parent
*/ */
SummaryQueryWidget::SummaryQueryWidget(QWidget *parent) : SummaryQueryWidget::SummaryQueryWidget(QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SummaryQueryWidget) ui(new Ui::SummaryQueryWidget)
@@ -39,17 +39,17 @@ SummaryQueryWidget::SummaryQueryWidget(QWidget *parent) :
} }
/** /**
* @brief SummaryQueryWidget::~SummaryQueryWidget @brief SummaryQueryWidget::~SummaryQueryWidget
*/ */
SummaryQueryWidget::~SummaryQueryWidget() SummaryQueryWidget::~SummaryQueryWidget()
{ {
delete ui; delete ui;
} }
/** /**
* @brief SummaryQueryWidget::queryStr @brief SummaryQueryWidget::queryStr
* @return The current query string @return The current query string
*/ */
QString SummaryQueryWidget::queryStr() const QString SummaryQueryWidget::queryStr() const
{ {
//User define is own query //User define is own query
@@ -80,11 +80,11 @@ QString SummaryQueryWidget::queryStr() const
} }
/** /**
* @brief SummaryQueryWidget::setQuery @brief SummaryQueryWidget::setQuery
* @param query @param query
* set the current query to @query. set the current query to @query.
* If it's possible, rebuild the state of the widget from the query If it's possible, rebuild the state of the widget from the query
*/ */
void SummaryQueryWidget::setQuery(const QString &query) void SummaryQueryWidget::setQuery(const QString &query)
{ {
if (query.startsWith("SELECT")) if (query.startsWith("SELECT"))
@@ -114,8 +114,8 @@ void SummaryQueryWidget::setQuery(const QString &query)
} }
/** /**
* @brief SummaryQueryWidget::setUpItems @brief SummaryQueryWidget::setUpItems
*/ */
void SummaryQueryWidget::setUpItems() void SummaryQueryWidget::setUpItems()
{ {
for (auto key : QETApp::diagramInfoKeys()) for (auto key : QETApp::diagramInfoKeys())
@@ -133,9 +133,9 @@ void SummaryQueryWidget::setUpItems()
} }
/** /**
* @brief SummaryQueryWidget::fillSavedQuery @brief SummaryQueryWidget::fillSavedQuery
* Fill the combo box of the saved query Fill the combo box of the saved query
*/ */
void SummaryQueryWidget::fillSavedQuery() void SummaryQueryWidget::fillSavedQuery()
{ {
QFile file(QETApp::configDir() + "/summary.json"); QFile file(QETApp::configDir() + "/summary.json");
@@ -151,16 +151,16 @@ void SummaryQueryWidget::fillSavedQuery()
} }
/** /**
* @brief SummaryQueryWidget::updateQueryLine @brief SummaryQueryWidget::updateQueryLine
*/ */
void SummaryQueryWidget::updateQueryLine() { void SummaryQueryWidget::updateQueryLine() {
ui->m_user_query_le->setText(queryStr()); ui->m_user_query_le->setText(queryStr());
} }
/** /**
* @brief SummaryQueryWidget::selectedKeys @brief SummaryQueryWidget::selectedKeys
* @return @return
*/ */
QStringList SummaryQueryWidget::selectedKeys() const QStringList SummaryQueryWidget::selectedKeys() const
{ {
//Made a string list with the colomns (keys) choosen by the user //Made a string list with the colomns (keys) choosen by the user
@@ -176,9 +176,9 @@ QStringList SummaryQueryWidget::selectedKeys() const
} }
/** /**
* @brief SummaryQueryWidget::on_m_available_list_itemDoubleClicked @brief SummaryQueryWidget::on_m_available_list_itemDoubleClicked
* @param item @param item
*/ */
void SummaryQueryWidget::on_m_available_list_itemDoubleClicked(QListWidgetItem *item) void SummaryQueryWidget::on_m_available_list_itemDoubleClicked(QListWidgetItem *item)
{ {
Q_UNUSED(item) Q_UNUSED(item)
@@ -186,9 +186,9 @@ void SummaryQueryWidget::on_m_available_list_itemDoubleClicked(QListWidgetItem *
} }
/** /**
* @brief SummaryQueryWidget::on_m_choosen_list_itemDoubleClicked @brief SummaryQueryWidget::on_m_choosen_list_itemDoubleClicked
* @param item @param item
*/ */
void SummaryQueryWidget::on_m_choosen_list_itemDoubleClicked(QListWidgetItem *item) void SummaryQueryWidget::on_m_choosen_list_itemDoubleClicked(QListWidgetItem *item)
{ {
Q_UNUSED(item) Q_UNUSED(item)
@@ -196,8 +196,8 @@ void SummaryQueryWidget::on_m_choosen_list_itemDoubleClicked(QListWidgetItem *it
} }
/** /**
* @brief SummaryQueryWidget::on_m_up_pb_clicked @brief SummaryQueryWidget::on_m_up_pb_clicked
*/ */
void SummaryQueryWidget::on_m_up_pb_clicked() void SummaryQueryWidget::on_m_up_pb_clicked()
{ {
auto row = ui->m_choosen_list->currentRow(); auto row = ui->m_choosen_list->currentRow();
@@ -213,8 +213,8 @@ void SummaryQueryWidget::on_m_up_pb_clicked()
} }
/** /**
* @brief SummaryQueryWidget::on_m_add_pb_clicked @brief SummaryQueryWidget::on_m_add_pb_clicked
*/ */
void SummaryQueryWidget::on_m_add_pb_clicked() void SummaryQueryWidget::on_m_add_pb_clicked()
{ {
if (auto *item = ui->m_available_list->takeItem(ui->m_available_list->currentRow())) { if (auto *item = ui->m_available_list->takeItem(ui->m_available_list->currentRow())) {
@@ -225,8 +225,8 @@ void SummaryQueryWidget::on_m_add_pb_clicked()
} }
/** /**
* @brief SummaryQueryWidget::on_m_remove_pb_clicked @brief SummaryQueryWidget::on_m_remove_pb_clicked
*/ */
void SummaryQueryWidget::on_m_remove_pb_clicked() void SummaryQueryWidget::on_m_remove_pb_clicked()
{ {
if (auto *item = ui->m_choosen_list->takeItem(ui->m_choosen_list->currentRow())) { if (auto *item = ui->m_choosen_list->takeItem(ui->m_choosen_list->currentRow())) {
@@ -237,8 +237,8 @@ void SummaryQueryWidget::on_m_remove_pb_clicked()
} }
/** /**
* @brief SummaryQueryWidget::on_m_down_pb_clicked @brief SummaryQueryWidget::on_m_down_pb_clicked
*/ */
void SummaryQueryWidget::on_m_down_pb_clicked() void SummaryQueryWidget::on_m_down_pb_clicked()
{ {
auto row = ui->m_choosen_list->currentRow(); auto row = ui->m_choosen_list->currentRow();
@@ -254,8 +254,8 @@ void SummaryQueryWidget::on_m_down_pb_clicked()
} }
/** /**
* @brief SummaryQueryWidget::on_m_edit_sql_query_cb_clicked @brief SummaryQueryWidget::on_m_edit_sql_query_cb_clicked
*/ */
void SummaryQueryWidget::on_m_edit_sql_query_cb_clicked() void SummaryQueryWidget::on_m_edit_sql_query_cb_clicked()
{ {
ui->m_user_query_le->setEnabled(ui->m_edit_sql_query_cb->isChecked()); ui->m_user_query_le->setEnabled(ui->m_edit_sql_query_cb->isChecked());
@@ -273,9 +273,9 @@ void SummaryQueryWidget::on_m_edit_sql_query_cb_clicked()
} }
/** /**
* @brief SummaryQueryWidget::reset @brief SummaryQueryWidget::reset
* Clear this widget aka set to initial state Clear this widget aka set to initial state
*/ */
void SummaryQueryWidget::reset() void SummaryQueryWidget::reset()
{ {
//Ugly hack to force to remove all selected infos //Ugly hack to force to remove all selected infos
@@ -286,8 +286,8 @@ void SummaryQueryWidget::reset()
} }
/** /**
* @brief SummaryQueryWidget::saveConfig @brief SummaryQueryWidget::saveConfig
*/ */
void SummaryQueryWidget::saveConfig() void SummaryQueryWidget::saveConfig()
{ {
QFile file_(QETApp::configDir() + "/summary.json"); QFile file_(QETApp::configDir() + "/summary.json");
@@ -316,8 +316,8 @@ void SummaryQueryWidget::saveConfig()
} }
/** /**
* @brief SummaryQueryWidget::loadConfig @brief SummaryQueryWidget::loadConfig
*/ */
void SummaryQueryWidget::loadConfig() void SummaryQueryWidget::loadConfig()
{ {
auto name = ui->m_config_gb->selectedText(); auto name = ui->m_config_gb->selectedText();

View File

@@ -1484,7 +1484,7 @@ bool Diagram::fromXml(QDomElement &document,
* @param folioSeq type * @param folioSeq type
* @param seq type * @param seq type
* @param type of sequential * @param type of sequential
*/ */
void Diagram::folioSequentialsFromXml(const QDomElement &root, void Diagram::folioSequentialsFromXml(const QDomElement &root,
QHash<QString, QHash<QString,
QStringList>* hash, QStringList>* hash,
@@ -1727,7 +1727,7 @@ void Diagram::updateLabels()
* @param sequential to be treated * @param sequential to be treated
* @param type to be treated * @param type to be treated
* @param Numerotation Context to be manipulated * @param Numerotation Context to be manipulated
*/ */
void Diagram::insertFolioSeqHash(QHash<QString, void Diagram::insertFolioSeqHash(QHash<QString,
QStringList> *hash, QStringList> *hash,
const QString& title, const QString& title,

View File

@@ -30,16 +30,16 @@
#include "qetgraphicstableitem.h" #include "qetgraphicstableitem.h"
/** /**
* @brief DiagramContent::DiagramContent @brief DiagramContent::DiagramContent
*/ */
DiagramContent::DiagramContent() {} DiagramContent::DiagramContent() {}
/** /**
* @brief DiagramContent::DiagramContent @brief DiagramContent::DiagramContent
* Constructor Constructor
* @param diagram : Construct a diagramContent and fill it with the selected item of @diagram @param diagram : Construct a diagramContent and fill it with the selected item of @diagram
* @param selected : this diagramcontent get only selected items if true. @param selected : this diagramcontent get only selected items if true.
*/ */
DiagramContent::DiagramContent(Diagram *diagram, bool selected) : DiagramContent::DiagramContent(Diagram *diagram, bool selected) :
m_selected_items(diagram->selectedItems()) m_selected_items(diagram->selectedItems())
{ {
@@ -120,12 +120,12 @@ DiagramContent::~DiagramContent()
{} {}
/** /**
* @brief DiagramContent::selectedTexts @brief DiagramContent::selectedTexts
* @return a list of every selected texts (every kind of texts) @return a list of every selected texts (every kind of texts)
* Note that the returned list of texts, correspond to the selected texts Note that the returned list of texts, correspond to the selected texts
* at the moment of the creation of this DiagramContent, at the moment of the creation of this DiagramContent,
* with the constructor : DiagramContent::DiagramContent(Diagram *diagram) with the constructor : DiagramContent::DiagramContent(Diagram *diagram)
*/ */
QList<DiagramTextItem *> DiagramContent::selectedTexts() const QList<DiagramTextItem *> DiagramContent::selectedTexts() const
{ {
QList<DiagramTextItem *> selected_texts; QList<DiagramTextItem *> selected_texts;
@@ -140,12 +140,12 @@ QList<DiagramTextItem *> DiagramContent::selectedTexts() const
} }
/** /**
* @brief DiagramContent::selectedTextsGroup @brief DiagramContent::selectedTextsGroup
* @return a list of selected texts group @return a list of selected texts group
* Note that the returned list of texts group, correspond to the selected texts group Note that the returned list of texts group, correspond to the selected texts group
* at the moment of the creation of this DiagramContent, at the moment of the creation of this DiagramContent,
* with the constructor : DiagramContent::DiagramContent(Diagram *diagram) with the constructor : DiagramContent::DiagramContent(Diagram *diagram)
*/ */
QList<ElementTextItemGroup *> DiagramContent::selectedTextsGroup() const QList<ElementTextItemGroup *> DiagramContent::selectedTextsGroup() const
{ {
QList<ElementTextItemGroup *> groups; QList<ElementTextItemGroup *> groups;
@@ -159,10 +159,10 @@ QList<ElementTextItemGroup *> DiagramContent::selectedTextsGroup() const
} }
/** /**
* @brief DiagramContent::conductors @brief DiagramContent::conductors
* @param filter @param filter
* @return Every conductors according to the filter @return Every conductors according to the filter
*/ */
QList<Conductor *> DiagramContent::conductors(int filter) const QList<Conductor *> DiagramContent::conductors(int filter) const
{ {
QList<Conductor *> result; QList<Conductor *> result;
@@ -180,12 +180,12 @@ QList<Conductor *> DiagramContent::conductors(int filter) const
} }
/** /**
* @brief DiagramContent::hasDeletableItems @brief DiagramContent::hasDeletableItems
* @return true if this diagram content have deletable item @return true if this diagram content have deletable item
* The deletable items correspond to the selected items of diagram The deletable items correspond to the selected items of diagram
* at the moment of the creation of this DiagramContent, at the moment of the creation of this DiagramContent,
* with the constructor : DiagramContent::DiagramContent(Diagram *diagram) with the constructor : DiagramContent::DiagramContent(Diagram *diagram)
*/ */
bool DiagramContent::hasDeletableItems() const bool DiagramContent::hasDeletableItems() const
{ {
for(QGraphicsItem *qgi : m_selected_items) for(QGraphicsItem *qgi : m_selected_items)
@@ -206,9 +206,9 @@ bool DiagramContent::hasDeletableItems() const
} }
/** /**
* @brief DiagramContent::hasCopiableItems @brief DiagramContent::hasCopiableItems
* @return true if this diagram content have copiable items. @return true if this diagram content have copiable items.
*/ */
bool DiagramContent::hasCopiableItems() const bool DiagramContent::hasCopiableItems() const
{ {
if(!m_images.isEmpty()) return true; if(!m_images.isEmpty()) return true;
@@ -220,9 +220,9 @@ bool DiagramContent::hasCopiableItems() const
} }
/** /**
* @brief DiagramContent::clear @brief DiagramContent::clear
* Remove all items from the diagram content Remove all items from the diagram content
*/ */
void DiagramContent::clear() void DiagramContent::clear()
{ {
m_elements.clear(); m_elements.clear();
@@ -239,10 +239,10 @@ void DiagramContent::clear()
} }
/** /**
* @brief DiagramContent::removeNonMovableItems @brief DiagramContent::removeNonMovableItems
* Remove all non movable item. Remove all non movable item.
* @return : return the numbers of removed item @return : return the numbers of removed item
*/ */
int DiagramContent::removeNonMovableItems() int DiagramContent::removeNonMovableItems()
{ {
int count_ = 0; int count_ = 0;
@@ -333,10 +333,10 @@ DiagramContent &DiagramContent::operator+=(const DiagramContent &other)
} }
/** /**
* @brief DiagramContent::potentialIsManaged @brief DiagramContent::potentialIsManaged
* @param conductors a list of conductors at the same potential. @param conductors a list of conductors at the same potential.
* @return true, if m_potential_conductors already have a conductor of this potential. @return true, if m_potential_conductors already have a conductor of this potential.
*/ */
bool DiagramContent::potentialIsManaged(QList<Conductor *> conductors) bool DiagramContent::potentialIsManaged(QList<Conductor *> conductors)
{ {
bool b = false; bool b = false;
@@ -351,9 +351,9 @@ bool DiagramContent::potentialIsManaged(QList<Conductor *> conductors)
} }
/** /**
* @brief DiagramContent::hasTextEditing @brief DiagramContent::hasTextEditing
* @return true if handle a text currently in editing intercation @return true if handle a text currently in editing intercation
*/ */
bool DiagramContent::hasTextEditing() bool DiagramContent::hasTextEditing()
{ {
for (DiagramTextItem *dti : selectedTexts()) { for (DiagramTextItem *dti : selectedTexts()) {
@@ -366,10 +366,10 @@ bool DiagramContent::hasTextEditing()
} }
/** /**
* @brief DiagramContent::items @brief DiagramContent::items
* @param filter @param filter
* @return The items of this diagram content according to @filter @return The items of this diagram content according to @filter
*/ */
QList<QGraphicsItem *> DiagramContent::items(int filter) const QList<QGraphicsItem *> DiagramContent::items(int filter) const
{ {
QList<QGraphicsItem *> items_list; QList<QGraphicsItem *> items_list;
@@ -393,10 +393,10 @@ QList<QGraphicsItem *> DiagramContent::items(int filter) const
} }
/** /**
* @brief DiagramContent::count @brief DiagramContent::count
* @param filter @param filter
* @return The number of items, according to @filter @return The number of items, according to @filter
*/ */
int DiagramContent::count(int filter) const int DiagramContent::count(int filter) const
{ {
int count = 0; int count = 0;
@@ -428,11 +428,11 @@ int DiagramContent::count(int filter) const
} }
/** /**
* @brief DiagramContent::sentence @brief DiagramContent::sentence
* @param filter @param filter
* @return A string that describe the items of the diagram content according to @filter. @return A string that describe the items of the diagram content according to @filter.
* Exemple : X elements, Y conductors etc.... Exemple : X elements, Y conductors etc....
*/ */
QString DiagramContent::sentence(int filter) const QString DiagramContent::sentence(int filter) const
{ {
int elements_count = (filter & Elements) ? m_elements.count() : 0; int elements_count = (filter & Elements) ? m_elements.count() : 0;
@@ -457,11 +457,11 @@ QString DiagramContent::sentence(int filter) const
} }
/** /**
* @brief operator << Use to debug a diagram content @brief operator << Use to debug a diagram content
* @param d : QDebug to use for display the debug info @param d : QDebug to use for display the debug info
* @param content : content to debug @param content : content to debug
* @return @return
*/ */
QDebug &operator<<(QDebug d, DiagramContent &content) { QDebug &operator<<(QDebug d, DiagramContent &content) {
Q_UNUSED(content) Q_UNUSED(content)
d << "DiagramContent {" << "\n"; d << "DiagramContent {" << "\n";

View File

@@ -21,13 +21,13 @@
#include <QDebug> #include <QDebug>
/** /**
* @brief DiagramContext::add @brief DiagramContext::add
* Add all value of @other to this. Add all value of @other to this.
* If a key already exist, the value is replaced. If a key already exist, the value is replaced.
* If a key doesn't exist, she will be added. If a key doesn't exist, she will be added.
* All other keys of this context, which are not present in @other, stay unchanged. All other keys of this context, which are not present in @other, stay unchanged.
* @param other @param other
*/ */
void DiagramContext::add(DiagramContext other) void DiagramContext::add(DiagramContext other)
{ {
for (QString key : other.keys()) { for (QString key : other.keys()) {
@@ -36,9 +36,9 @@ void DiagramContext::add(DiagramContext other)
} }
/** /**
* @brief DiagramContext::remove @brief DiagramContext::remove
* @param key @param key
*/ */
void DiagramContext::remove(const QString &key) { void DiagramContext::remove(const QString &key) {
m_content.remove(key); m_content.remove(key);
} }
@@ -117,9 +117,9 @@ int DiagramContext::count() {
} }
/** /**
* @brief DiagramContext::keyMustShow @brief DiagramContext::keyMustShow
* @return the value pairs with key, if key no found, return false @return the value pairs with key, if key no found, return false
*/ */
bool DiagramContext::keyMustShow(const QString &key) const { bool DiagramContext::keyMustShow(const QString &key) const {
if (m_content_show.contains(key)) if (m_content_show.contains(key))
return m_content_show[key]; return m_content_show[key];
@@ -163,11 +163,11 @@ void DiagramContext::fromXml(const QDomElement &e, const QString &tag_name) {
} }
/** /**
* @brief DiagramContext::fromXml @brief DiagramContext::fromXml
* Read this context properties from the @dom_element, looking for tags named @tag_name Read this context properties from the @dom_element, looking for tags named @tag_name
* @param dom_element : dom element to parse @param dom_element : dom element to parse
* @param tag_name : tag name to find, by default "property" @param tag_name : tag name to find, by default "property"
*/ */
void DiagramContext::fromXml(const pugi::xml_node &dom_element, const QString &tag_name) void DiagramContext::fromXml(const pugi::xml_node &dom_element, const QString &tag_name)
{ {
for(auto node = dom_element.child(tag_name.toStdString().c_str()) ; node ; node = node.next_sibling(tag_name.toStdString().c_str())) for(auto node = dom_element.child(tag_name.toStdString().c_str()) ; node ; node = node.next_sibling(tag_name.toStdString().c_str()))

View File

@@ -51,7 +51,7 @@
* location -> the location assigned to the element * location -> the location assigned to the element
* frozenLabel -> label locked at a given time * frozenLabel -> label locked at a given time
* *
*/ */
class DiagramContext class DiagramContext
{ {
public: public:

View File

@@ -24,12 +24,12 @@
/** /**
* @brief DiagramEventAddElement::DiagramEventAddElement @brief DiagramEventAddElement::DiagramEventAddElement
* Defaut constructor Defaut constructor
* @param location :location of diagram @param location :location of diagram
* @param diagram : diagram owner of this event @param diagram : diagram owner of this event
* @param pos : first pos of item ( optional, by defaut QPointF(0,0) ) @param pos : first pos of item ( optional, by defaut QPointF(0,0) )
*/ */
DiagramEventAddElement::DiagramEventAddElement(ElementsLocation &location, Diagram *diagram, QPointF pos) : DiagramEventAddElement::DiagramEventAddElement(ElementsLocation &location, Diagram *diagram, QPointF pos) :
DiagramEventInterface(diagram), DiagramEventInterface(diagram),
m_location(location), m_location(location),
@@ -53,10 +53,10 @@ DiagramEventAddElement::DiagramEventAddElement(ElementsLocation &location, Diagr
} }
/** /**
* @brief DiagramEventAddElement::~DiagramEventAddElement @brief DiagramEventAddElement::~DiagramEventAddElement
* Destructor Destructor
* Enable context menu for each view of diagram Enable context menu for each view of diagram
*/ */
DiagramEventAddElement::~DiagramEventAddElement() DiagramEventAddElement::~DiagramEventAddElement()
{ {
if (m_element) if (m_element)
@@ -69,11 +69,11 @@ DiagramEventAddElement::~DiagramEventAddElement()
} }
/** /**
* @brief DiagramEventAddElement::mouseMoveEvent @brief DiagramEventAddElement::mouseMoveEvent
* Move the element to new pos of mouse Move the element to new pos of mouse
* the event is always accepted the event is always accepted
* @param event @param event
*/ */
void DiagramEventAddElement::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddElement::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
if (m_element) { if (m_element) {
@@ -83,22 +83,22 @@ void DiagramEventAddElement::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
} }
/** /**
* @brief DiagramEventAddElement::mousePressEvent @brief DiagramEventAddElement::mousePressEvent
* Do nothing, but return true for not transit the event to other thing in diagram. Do nothing, but return true for not transit the event to other thing in diagram.
* the event is always accepted the event is always accepted
* @param event @param event
*/ */
void DiagramEventAddElement::mousePressEvent(QGraphicsSceneMouseEvent *event) { void DiagramEventAddElement::mousePressEvent(QGraphicsSceneMouseEvent *event) {
event->setAccepted(true); event->setAccepted(true);
} }
/** /**
* @brief DiagramEventAddElement::mouseReleaseEvent @brief DiagramEventAddElement::mouseReleaseEvent
* Right button finish this event (isRunning = false) and emit finish. Right button finish this event (isRunning = false) and emit finish.
* Left button add an element to diagram Left button add an element to diagram
* the event is always accepted the event is always accepted
* @param event @param event
*/ */
void DiagramEventAddElement::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddElement::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{ {
if (m_element) if (m_element)
@@ -121,11 +121,11 @@ void DiagramEventAddElement::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
} }
/** /**
* @brief DiagramEventAddElement::mouseDoubleClickEvent @brief DiagramEventAddElement::mouseDoubleClickEvent
* If mouse left double clic, finish this event (isRunning = false) and emit finish If mouse left double clic, finish this event (isRunning = false) and emit finish
* the event is always accepted the event is always accepted
* @param event @param event
*/ */
void DiagramEventAddElement::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddElement::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{ {
if (m_element && (event -> button() == Qt::LeftButton)) if (m_element && (event -> button() == Qt::LeftButton))
@@ -141,11 +141,11 @@ void DiagramEventAddElement::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *eve
} }
/** /**
* @brief DiagramEventAddElement::keyPressEvent @brief DiagramEventAddElement::keyPressEvent
* Press space key rotate the element to 90° (return true) Press space key rotate the element to 90° (return true)
* else call DiagramEventInterface::keyPressEvent(event), and return the value. else call DiagramEventInterface::keyPressEvent(event), and return the value.
* @param event @param event
*/ */
void DiagramEventAddElement::keyPressEvent(QKeyEvent *event) void DiagramEventAddElement::keyPressEvent(QKeyEvent *event)
{ {
if (m_element && event->key() == Qt::Key_Space) if (m_element && event->key() == Qt::Key_Space)
@@ -159,9 +159,9 @@ void DiagramEventAddElement::keyPressEvent(QKeyEvent *event)
} }
/** /**
* @brief DiagramEventAddElement::init @brief DiagramEventAddElement::init
* Init this event. Init this event.
*/ */
void DiagramEventAddElement::init() void DiagramEventAddElement::init()
{ {
foreach(QGraphicsView *view, m_diagram->views()) foreach(QGraphicsView *view, m_diagram->views())
@@ -169,9 +169,9 @@ void DiagramEventAddElement::init()
} }
/** /**
* @brief DiagramEventAddElement::buildElement @brief DiagramEventAddElement::buildElement
* Build the element, if the element is build successfully, we return true, otherwise false Build the element, if the element is build successfully, we return true, otherwise false
*/ */
bool DiagramEventAddElement::buildElement() bool DiagramEventAddElement::buildElement()
{ {
ElementsLocation import_loc = m_diagram->project()->importElement(m_location); ElementsLocation import_loc = m_diagram->project()->importElement(m_location);
@@ -196,10 +196,10 @@ bool DiagramEventAddElement::buildElement()
} }
/** /**
* @brief DiagramEventAddElement::addElement @brief DiagramEventAddElement::addElement
* Add an element at the current pos en current rotation, Add an element at the current pos en current rotation,
* if project autoconductor option is enable, and the element can be wired, we do it. if project autoconductor option is enable, and the element can be wired, we do it.
*/ */
void DiagramEventAddElement::addElement() void DiagramEventAddElement::addElement()
{ {
int state; int state;

View File

@@ -24,10 +24,10 @@
class Element; class Element;
/** /**
* @brief The DiagramEventAddElement class @brief The DiagramEventAddElement class
* This diagram event add a new element, for each left click button at the position of click. This diagram event add a new element, for each left click button at the position of click.
* Space key rotate current element by 90°, right click button finish this event. Space key rotate current element by 90°, right click button finish this event.
*/ */
class DiagramEventAddElement : public DiagramEventInterface class DiagramEventAddElement : public DiagramEventInterface
{ {
Q_OBJECT Q_OBJECT

View File

@@ -22,10 +22,10 @@
#include "diagramcommands.h" #include "diagramcommands.h"
/** /**
* @brief DiagramEventAddImage::DiagramEventAddImage @brief DiagramEventAddImage::DiagramEventAddImage
* Default constructor Default constructor
* @param diagram : diagram where operate this event @param diagram : diagram where operate this event
*/ */
DiagramEventAddImage::DiagramEventAddImage(Diagram *diagram) : DiagramEventAddImage::DiagramEventAddImage(Diagram *diagram) :
DiagramEventInterface(diagram), DiagramEventInterface(diagram),
m_image (nullptr), m_image (nullptr),
@@ -35,8 +35,8 @@ DiagramEventAddImage::DiagramEventAddImage(Diagram *diagram) :
} }
/** /**
* @brief DiagramEventAddImage::~DiagramEventAddImage @brief DiagramEventAddImage::~DiagramEventAddImage
*/ */
DiagramEventAddImage::~DiagramEventAddImage() DiagramEventAddImage::~DiagramEventAddImage()
{ {
if (m_running || m_abort) if (m_running || m_abort)
@@ -50,10 +50,10 @@ DiagramEventAddImage::~DiagramEventAddImage()
} }
/** /**
* @brief DiagramEventAddImage::mousePressEvent @brief DiagramEventAddImage::mousePressEvent
* Action when mouse is pressed Action when mouse is pressed
* @param event : event of mouse pressed @param event : event of mouse pressed
*/ */
void DiagramEventAddImage::mousePressEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddImage::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
if (m_image && event -> button() == Qt::LeftButton) if (m_image && event -> button() == Qt::LeftButton)
@@ -79,10 +79,10 @@ void DiagramEventAddImage::mousePressEvent(QGraphicsSceneMouseEvent *event)
} }
/** /**
* @brief DiagramEventAddImage::mouseMoveEvent @brief DiagramEventAddImage::mouseMoveEvent
* Action when mouse move Action when mouse move
* @param event : event of mouse move @param event : event of mouse move
*/ */
void DiagramEventAddImage::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddImage::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
if (!m_image || event->buttons() != Qt::NoButton) { if (!m_image || event->buttons() != Qt::NoButton) {
@@ -106,20 +106,20 @@ void DiagramEventAddImage::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
} }
/** /**
* @brief DiagramEventAddImage::mouseDoubleClickEvent @brief DiagramEventAddImage::mouseDoubleClickEvent
* This method is only use to overwrite double click. This method is only use to overwrite double click.
* When double click, image propertie dialog isn't open. When double click, image propertie dialog isn't open.
* @param event : event of mouse double click. @param event : event of mouse double click.
*/ */
void DiagramEventAddImage::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { void DiagramEventAddImage::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
event->setAccepted(true); event->setAccepted(true);
} }
/** /**
* @brief DiagramEventAddImage::wheelEvent @brief DiagramEventAddImage::wheelEvent
* Action when mouse wheel is rotate Action when mouse wheel is rotate
* @param event: evet of mouse wheel @param event: evet of mouse wheel
*/ */
void DiagramEventAddImage::wheelEvent(QGraphicsSceneWheelEvent *event) void DiagramEventAddImage::wheelEvent(QGraphicsSceneWheelEvent *event)
{ {
if (!m_is_added || !m_image || event -> modifiers() != Qt::CTRL) { if (!m_is_added || !m_image || event -> modifiers() != Qt::CTRL) {
@@ -136,9 +136,9 @@ void DiagramEventAddImage::wheelEvent(QGraphicsSceneWheelEvent *event)
} }
/** /**
* @brief DiagramEventAddImage::isNull @brief DiagramEventAddImage::isNull
* @return : true if image can't be loaded, otherwise return false. @return : true if image can't be loaded, otherwise return false.
*/ */
bool DiagramEventAddImage::isNull() const bool DiagramEventAddImage::isNull() const
{ {
if (!m_image) return true; if (!m_image) return true;
@@ -146,9 +146,9 @@ bool DiagramEventAddImage::isNull() const
} }
/** /**
* @brief DiagramEventAddImage::openDialog @brief DiagramEventAddImage::openDialog
* Open dialog for select the image to add. Open dialog for select the image to add.
*/ */
void DiagramEventAddImage::openDialog() void DiagramEventAddImage::openDialog()
{ {
if (m_diagram -> isReadOnly()) return; if (m_diagram -> isReadOnly()) return;

View File

@@ -24,9 +24,9 @@ class Diagram;
class DiagramImageItem; class DiagramImageItem;
/** /**
* @brief The DiagramEventAddImage class @brief The DiagramEventAddImage class
* This diagram event, handle the adding of an image in a diagram. This diagram event, handle the adding of an image in a diagram.
*/ */
class DiagramEventAddImage : public DiagramEventInterface class DiagramEventAddImage : public DiagramEventInterface
{ {
Q_OBJECT Q_OBJECT

View File

@@ -20,11 +20,11 @@
#include "diagramcommands.h" #include "diagramcommands.h"
/** /**
* @brief DiagramEventAddShape::DiagramEventAddShape @brief DiagramEventAddShape::DiagramEventAddShape
* Default constructor Default constructor
* @param diagram : the diagram where this event must operate @param diagram : the diagram where this event must operate
* @param shape_type : the type of shape to draw @param shape_type : the type of shape to draw
*/ */
DiagramEventAddShape::DiagramEventAddShape(Diagram *diagram, QetShapeItem::ShapeType shape_type) : DiagramEventAddShape::DiagramEventAddShape(Diagram *diagram, QetShapeItem::ShapeType shape_type) :
DiagramEventInterface(diagram), DiagramEventInterface(diagram),
m_shape_type (shape_type), m_shape_type (shape_type),
@@ -37,8 +37,8 @@ DiagramEventAddShape::DiagramEventAddShape(Diagram *diagram, QetShapeItem::Shape
} }
/** /**
* @brief DiagramEventAddShape::~DiagramEventAddShape @brief DiagramEventAddShape::~DiagramEventAddShape
*/ */
DiagramEventAddShape::~DiagramEventAddShape() DiagramEventAddShape::~DiagramEventAddShape()
{ {
if ((m_running || m_abort) && m_shape_item) if ((m_running || m_abort) && m_shape_item)
@@ -54,10 +54,10 @@ DiagramEventAddShape::~DiagramEventAddShape()
} }
/** /**
* @brief DiagramEventAddShape::mousePressEvent @brief DiagramEventAddShape::mousePressEvent
* Action when mouse is pressed Action when mouse is pressed
* @param event : event of mouse press @param event : event of mouse press
*/ */
void DiagramEventAddShape::mousePressEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddShape::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
if (Q_UNLIKELY(m_diagram->isReadOnly())) { if (Q_UNLIKELY(m_diagram->isReadOnly())) {
@@ -107,10 +107,10 @@ void DiagramEventAddShape::mousePressEvent(QGraphicsSceneMouseEvent *event)
} }
/** /**
* @brief DiagramEventAddShape::mouseMoveEvent @brief DiagramEventAddShape::mouseMoveEvent
* Action when mouse move Action when mouse move
* @param event : event of mouse move @param event : event of mouse move
*/ */
void DiagramEventAddShape::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddShape::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
updateHelpCross(event->scenePos()); updateHelpCross(event->scenePos());
@@ -128,10 +128,10 @@ void DiagramEventAddShape::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
} }
/** /**
* @brief DiagramEventAddShape::mouseReleaseEvent @brief DiagramEventAddShape::mouseReleaseEvent
* Action when mouse button is released Action when mouse button is released
* @param event : event of mouse release @param event : event of mouse release
*/ */
void DiagramEventAddShape::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddShape::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{ {
if (event->button() == Qt::RightButton) if (event->button() == Qt::RightButton)
@@ -170,10 +170,10 @@ void DiagramEventAddShape::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
} }
/** /**
* @brief DiagramEventAddShape::mouseDoubleClickEvent @brief DiagramEventAddShape::mouseDoubleClickEvent
* Action when mouse button is double clicked Action when mouse button is double clicked
* @param event : event of mouse double click @param event : event of mouse double click
*/ */
void DiagramEventAddShape::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddShape::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{ {
//If current item is a polyline, add it with an undo command //If current item is a polyline, add it with an undo command
@@ -204,10 +204,10 @@ void DiagramEventAddShape::init()
} }
/** /**
* @brief DiagramEventAddShape::updateHelpCross @brief DiagramEventAddShape::updateHelpCross
* Create and update the position of the cross to help user for draw new shape Create and update the position of the cross to help user for draw new shape
* @param p : the center of the cross @param p : the center of the cross
*/ */
void DiagramEventAddShape::updateHelpCross(const QPointF &p) void DiagramEventAddShape::updateHelpCross(const QPointF &p)
{ {
//If line isn't created yet, we create it. //If line isn't created yet, we create it.

View File

@@ -22,9 +22,9 @@
#include "qetshapeitem.h" #include "qetshapeitem.h"
/** /**
* @brief The DiagramEventAddShape class @brief The DiagramEventAddShape class
* This event manage the creation of a shape. This event manage the creation of a shape.
*/ */
class DiagramEventAddShape : public DiagramEventInterface class DiagramEventAddShape : public DiagramEventInterface
{ {
Q_OBJECT Q_OBJECT

View File

@@ -22,24 +22,24 @@
#include "diagram.h" #include "diagram.h"
/** /**
* @brief DiagramEventAddText::DiagramEventAddText @brief DiagramEventAddText::DiagramEventAddText
* Default constructor Default constructor
* @param diagram : the diagram where this event must operate @param diagram : the diagram where this event must operate
*/ */
DiagramEventAddText::DiagramEventAddText(Diagram *diagram) : DiagramEventAddText::DiagramEventAddText(Diagram *diagram) :
DiagramEventInterface(diagram) DiagramEventInterface(diagram)
{} {}
/** /**
* @brief DiagramEventAddText::~DiagramEventAddText @brief DiagramEventAddText::~DiagramEventAddText
*/ */
DiagramEventAddText::~DiagramEventAddText() DiagramEventAddText::~DiagramEventAddText()
{} {}
/** /**
* @brief DiagramEventAddText::mousePressEvent @brief DiagramEventAddText::mousePressEvent
* @param event : event of mouse press event. @param event : event of mouse press event.
*/ */
void DiagramEventAddText::mousePressEvent(QGraphicsSceneMouseEvent *event) void DiagramEventAddText::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
if (event->button() == Qt::LeftButton) if (event->button() == Qt::LeftButton)

View File

@@ -23,9 +23,9 @@
class Diagram; class Diagram;
/** /**
* @brief The DiagramEventAddText class @brief The DiagramEventAddText class
* This diagram event handle the creation of a new text in a diagram This diagram event handle the creation of a new text in a diagram
*/ */
class DiagramEventAddText : public DiagramEventInterface class DiagramEventAddText : public DiagramEventInterface
{ {
Q_OBJECT Q_OBJECT

View File

@@ -52,10 +52,10 @@ void DiagramEventInterface::wheelEvent(QGraphicsSceneWheelEvent *event) {
} }
/** /**
* @brief DiagramEventInterface::keyPressEvent @brief DiagramEventInterface::keyPressEvent
* By default, press escape key abort the curent action By default, press escape key abort the curent action
* @param event @param event
*/ */
void DiagramEventInterface::keyPressEvent(QKeyEvent *event) void DiagramEventInterface::keyPressEvent(QKeyEvent *event)
{ {
if (event->key() == Qt::Key_Escape) if (event->key() == Qt::Key_Escape)

View File

@@ -26,22 +26,22 @@ class QKeyEvent;
class Diagram; class Diagram;
/** /**
* @brief The DiagramEventInterface class @brief The DiagramEventInterface class
* isRunning() return true if action is running (do something). By default return false. isRunning() return true if action is running (do something). By default return false.
* *
* ##USE DiagramEventInterface## ##USE DiagramEventInterface##
* This class is the basic interface for manage event on a diagram. This class is the basic interface for manage event on a diagram.
* To create a behavior for event diagram, we need to herite this class. To create a behavior for event diagram, we need to herite this class.
* This interface work like this : This interface work like this :
* You need to create an interface and call diagram::setEventInterface(pointer_of_your_interface). You need to create an interface and call diagram::setEventInterface(pointer_of_your_interface).
* When a diagram get an event (mouse or key) if they have an event interface, When a diagram get an event (mouse or key) if they have an event interface,
* they send the event (with the status accepted to false) to the interface (for exemple mousePressEvent). they send the event (with the status accepted to false) to the interface (for exemple mousePressEvent).
* If the interface do something with this event, you need to set to true the accepted status of the event, then diagram do nothing. If the interface do something with this event, you need to set to true the accepted status of the event, then diagram do nothing.
* When the interface job is done, we need to emit the signal finish(), the diagram use this signal to delete the interface. When the interface job is done, we need to emit the signal finish(), the diagram use this signal to delete the interface.
* Be carreful with the destructor, diagram can at any time (even if interface is still running) delete the interface, Be carreful with the destructor, diagram can at any time (even if interface is still running) delete the interface,
* the bool m_abort is here for that at destruction time. the bool m_abort is here for that at destruction time.
* *
*/ */
class DiagramEventInterface : public QObject class DiagramEventInterface : public QObject
{ {
Q_OBJECT Q_OBJECT

View File

@@ -198,10 +198,10 @@ void DiagramView::handleElementDrop(QDropEvent *event)
} }
/** /**
* @brief DiagramView::handleTitleBlockDrop @brief DiagramView::handleTitleBlockDrop
* Handle the dropEvent that contain data of a titleblock Handle the dropEvent that contain data of a titleblock
* @param e @param e
*/ */
void DiagramView::handleTitleBlockDrop(QDropEvent *e) { void DiagramView::handleTitleBlockDrop(QDropEvent *e) {
// fetch the title block template location from the drop event // fetch the title block template location from the drop event
TitleBlockTemplateLocation tbt_loc; TitleBlockTemplateLocation tbt_loc;
@@ -247,10 +247,10 @@ void DiagramView::handleTitleBlockDrop(QDropEvent *e) {
} }
/** /**
* @brief DiagramView::handleTextDrop @brief DiagramView::handleTextDrop
*handle the drop of text *handle the drop of text
* @param e the QDropEvent describing the current drag'n drop @param e the QDropEvent describing the current drag'n drop
*/ */
void DiagramView::handleTextDrop(QDropEvent *e) { void DiagramView::handleTextDrop(QDropEvent *e) {
if (m_diagram -> isReadOnly() || (e -> mimeData() -> hasText() == false) ) return; if (m_diagram -> isReadOnly() || (e -> mimeData() -> hasText() == false) ) return;
@@ -284,12 +284,12 @@ void DiagramView::setSelectionMode() {
} }
/** /**
* @brief DiagramView::zoom @brief DiagramView::zoom
* Zomm the view. Zomm the view.
* A zoom_factor > 1 zoom in. A zoom_factor > 1 zoom in.
* A zoom_factor < 1 zoom out A zoom_factor < 1 zoom out
* @param zoom_factor @param zoom_factor
*/ */
void DiagramView::zoom(const qreal zoom_factor) void DiagramView::zoom(const qreal zoom_factor)
{ {
if (zoom_factor >= 1){ if (zoom_factor >= 1){
@@ -357,11 +357,11 @@ void DiagramView::copy() {
} }
/** /**
* @brief DiagramView::paste @brief DiagramView::paste
* Import the element stored in the clipboard to the diagram. Import the element stored in the clipboard to the diagram.
* @param pos : top left corner of the bounding rect of imported elements @param pos : top left corner of the bounding rect of imported elements
* @param clipboard_mode @param clipboard_mode
*/ */
void DiagramView::paste(const QPointF &pos, QClipboard::Mode clipboard_mode) { void DiagramView::paste(const QPointF &pos, QClipboard::Mode clipboard_mode) {
if (!isInteractive() || m_diagram -> isReadOnly()) return; if (!isInteractive() || m_diagram -> isReadOnly()) return;
@@ -448,9 +448,9 @@ void DiagramView::mousePressEvent(QMouseEvent *e)
} }
/** /**
* @brief DiagramView::mouseMoveEvent @brief DiagramView::mouseMoveEvent
* Manage the event move mouse Manage the event move mouse
*/ */
void DiagramView::mouseMoveEvent(QMouseEvent *e) void DiagramView::mouseMoveEvent(QMouseEvent *e)
{ {
if (m_event_interface && m_event_interface->mouseMoveEvent(e)) return; if (m_event_interface && m_event_interface->mouseMoveEvent(e)) return;
@@ -509,9 +509,9 @@ void DiagramView::mouseMoveEvent(QMouseEvent *e)
} }
/** /**
* @brief DiagramView::mouseReleaseEvent @brief DiagramView::mouseReleaseEvent
* Manage event release click mouse Manage event release click mouse
*/ */
void DiagramView::mouseReleaseEvent(QMouseEvent *e) void DiagramView::mouseReleaseEvent(QMouseEvent *e)
{ {
if (m_event_interface && m_event_interface->mouseReleaseEvent(e)) return; if (m_event_interface && m_event_interface->mouseReleaseEvent(e)) return;
@@ -563,9 +563,9 @@ void DiagramView::mouseReleaseEvent(QMouseEvent *e)
} }
/** /**
* @brief DiagramView::gestures @brief DiagramView::gestures
* @return @return
*/ */
bool DiagramView::gestures() const bool DiagramView::gestures() const
{ {
QSettings settings; QSettings settings;
@@ -606,11 +606,11 @@ void DiagramView::wheelEvent(QWheelEvent *event)
} }
/** /**
* @brief DiagramView::gestureEvent @brief DiagramView::gestureEvent
* Use the pinch of the trackpad for zoom Use the pinch of the trackpad for zoom
* @param event @param event
* @return @return
*/ */
bool DiagramView::gestureEvent(QGestureEvent *event) bool DiagramView::gestureEvent(QGestureEvent *event)
{ {
if (QGesture *gesture = event->gesture(Qt::PinchGesture)) if (QGesture *gesture = event->gesture(Qt::PinchGesture))
@@ -639,11 +639,11 @@ void DiagramView::focusInEvent(QFocusEvent *e) {
} }
/** /**
* @brief DiagramView::keyPressEvent @brief DiagramView::keyPressEvent
* Handles "key press" events. Reimplemented here to switch to visualisation Handles "key press" events. Reimplemented here to switch to visualisation
* mode if needed. mode if needed.
* @param e @param e
*/ */
void DiagramView::keyPressEvent(QKeyEvent *e) void DiagramView::keyPressEvent(QKeyEvent *e)
{ {
if (m_event_interface && m_event_interface->keyPressEvent(e)) if (m_event_interface && m_event_interface->keyPressEvent(e))
@@ -821,17 +821,17 @@ QString DiagramView::title() const {
} }
/** /**
* @brief DiagramView::editDiagramProperties @brief DiagramView::editDiagramProperties
* Edit the properties of the viewed digram Edit the properties of the viewed digram
*/ */
void DiagramView::editDiagramProperties() { void DiagramView::editDiagramProperties() {
DiagramPropertiesDialog::diagramPropertiesDialog(m_diagram, diagramEditor()); DiagramPropertiesDialog::diagramPropertiesDialog(m_diagram, diagramEditor());
} }
/** /**
* @brief DiagramView::adjustSceneRect @brief DiagramView::adjustSceneRect
* Calcul and set the area of the scene visualized by this view Calcul and set the area of the scene visualized by this view
*/ */
void DiagramView::adjustSceneRect() void DiagramView::adjustSceneRect()
{ {
QRectF scene_rect = m_diagram->sceneRect(); QRectF scene_rect = m_diagram->sceneRect();
@@ -912,9 +912,9 @@ void DiagramView::applyReadOnly() {
} }
/** /**
* @brief DiagramView::editSelectedConductorColor @brief DiagramView::editSelectedConductorColor
* Edit the color of the selected conductor; does nothing if multiple conductors are selected Edit the color of the selected conductor; does nothing if multiple conductors are selected
*/ */
void DiagramView::editSelectedConductorColor() void DiagramView::editSelectedConductorColor()
{ {
//retrieve selected content //retrieve selected content
@@ -996,14 +996,14 @@ void DiagramView::resetConductors() {
@param e Evenement @param e Evenement
*/ */
/** /**
* @brief DiagramView::event @brief DiagramView::event
* Manage the event on this diagram view. Manage the event on this diagram view.
* -At first activation (QEvent::WindowActivate or QEvent::Show) we zoomFit. -At first activation (QEvent::WindowActivate or QEvent::Show) we zoomFit.
* -Convert event interpreted to mouse event to gesture event if needed. -Convert event interpreted to mouse event to gesture event if needed.
* -send Shortcut to view (by default send to QMenu /QAction) -send Shortcut to view (by default send to QMenu /QAction)
* @param e the event. @param e the event.
* @return @return
*/ */
bool DiagramView::event(QEvent *e) { bool DiagramView::event(QEvent *e) {
if (Q_UNLIKELY(m_first_activation)) { if (Q_UNLIKELY(m_first_activation)) {
if (e -> type() == QEvent::Show) { if (e -> type() == QEvent::Show) {
@@ -1031,10 +1031,10 @@ bool DiagramView::event(QEvent *e) {
} }
/** /**
* @brief DiagramView::paintEvent @brief DiagramView::paintEvent
* Reimplemented from QGraphicsView Reimplemented from QGraphicsView
* @param event @param event
*/ */
void DiagramView::paintEvent(QPaintEvent *event) void DiagramView::paintEvent(QPaintEvent *event)
{ {
QGraphicsView::paintEvent(event); QGraphicsView::paintEvent(event);
@@ -1113,9 +1113,9 @@ bool DiagramView::selectedItemHasFocus() {
} }
/** /**
* @brief DiagramView::editSelection @brief DiagramView::editSelection
* Edit the selected item if he can be edited and if only one item is selected Edit the selected item if he can be edited and if only one item is selected
*/ */
void DiagramView::editSelection() { void DiagramView::editSelection() {
if (m_diagram -> isReadOnly() || m_diagram -> selectedItems().size() != 1 ) return; if (m_diagram -> isReadOnly() || m_diagram -> selectedItems().size() != 1 ) return;
@@ -1133,11 +1133,11 @@ void DiagramView::editSelection() {
} }
/** /**
* @brief DiagramView::setEventInterface @brief DiagramView::setEventInterface
* Set an event interface to diagram view. Set an event interface to diagram view.
* If diagram view already have an event interface, he delete it before. If diagram view already have an event interface, he delete it before.
* Diagram view take ownership of event interface and delete it when event interface is finish Diagram view take ownership of event interface and delete it when event interface is finish
*/ */
void DiagramView::setEventInterface(DVEventInterface *event_interface) void DiagramView::setEventInterface(DVEventInterface *event_interface)
{ {
if (m_event_interface) delete m_event_interface; if (m_event_interface) delete m_event_interface;
@@ -1146,10 +1146,10 @@ void DiagramView::setEventInterface(DVEventInterface *event_interface)
} }
/** /**
* @brief DiagramView::contextMenuActions @brief DiagramView::contextMenuActions
* @return a list of actions currently available for a context menu. @return a list of actions currently available for a context menu.
*
*/ */
QList<QAction *> DiagramView::contextMenuActions() const QList<QAction *> DiagramView::contextMenuActions() const
{ {
QList<QAction *> list; QList<QAction *> list;
@@ -1189,9 +1189,9 @@ QList<QAction *> DiagramView::contextMenuActions() const
} }
/** /**
* @brief DiagramView::contextMenuEvent @brief DiagramView::contextMenuEvent
* @param e @param e
*/ */
void DiagramView::contextMenuEvent(QContextMenuEvent *e) void DiagramView::contextMenuEvent(QContextMenuEvent *e)
{ {
QGraphicsView::contextMenuEvent(e); QGraphicsView::contextMenuEvent(e);
@@ -1237,9 +1237,9 @@ QETDiagramEditor *DiagramView::diagramEditor() const {
} }
/** /**
* @brief DiagramView::mouseDoubleClickEvent @brief DiagramView::mouseDoubleClickEvent
* @param e @param e
*/ */
void DiagramView::mouseDoubleClickEvent(QMouseEvent *e) void DiagramView::mouseDoubleClickEvent(QMouseEvent *e)
{ {
if (m_event_interface && m_event_interface -> mouseDoubleClickEvent(e)) return; if (m_event_interface && m_event_interface -> mouseDoubleClickEvent(e)) return;

View File

@@ -57,12 +57,12 @@ bool DVEventInterface::wheelEvent(QWheelEvent *event) {
} }
/** /**
* @brief DVEventInterface::keyPressEvent @brief DVEventInterface::keyPressEvent
* By default, press escape key abort the curent action. By default, press escape key abort the curent action.
* isFinish return true, and emit finish isFinish return true, and emit finish
* @param event @param event
* @return @return
*/ */
bool DVEventInterface::keyPressEvent(QKeyEvent *event) bool DVEventInterface::keyPressEvent(QKeyEvent *event)
{ {
if (event->key() == Qt::Key_Escape) if (event->key() == Qt::Key_Escape)

View File

@@ -27,14 +27,18 @@ class DiagramView;
class Diagram; class Diagram;
/** /**
* @brief The DVEventInterface class @brief The DVEventInterface class
* This class is the main interface for manage event of a Diagram View. This class is the main interface for manage event of a Diagram View.
* This do nothing, for create new event behavior, we must to create new class from this. This do nothing, for create new event behavior,
* Each method return a bool: True if the methode do something else return false. we must to create new class from this.
* Each method of DVEventInterface return false; Each method return a bool:
* isRunning() return true if action is started but not finish. By default return false. True if the methode do something else return false.
* isFinish() return true when the action is finish, or not started. By default return true. Each method of DVEventInterface return false;
*/ isRunning() return true if action is started but not finish.
By default return false.
isFinish() return true when the action is finish, or not started.
By default return true.
*/
class DVEventInterface : public QObject class DVEventInterface : public QObject
{ {
Q_OBJECT Q_OBJECT
@@ -54,8 +58,8 @@ class DVEventInterface : public QObject
signals: signals:
/** /**
* @brief finish @brief finish
* emited when the interface finish is work emited when the interface finish is work
*/ */
void finish(); void finish();

View File

@@ -20,14 +20,14 @@
#include "partterminal.h" #include "partterminal.h"
/** /**
* @brief PastePartsCommand::PastePartsCommand @brief PastePartsCommand::PastePartsCommand
* @param view : view where this command work @param view : view where this command work
* @param content_to_paste : content to paste @param content_to_paste : content to paste
* @param parent : parent undo command @param parent : parent undo command
* *
* Note : all terminal stored in @content_to_paste get a new uuid in the constructor of this class to avoid have Note : all terminal stored in @content_to_paste get a new uuid in the constructor of this class to avoid have
* several terminal of an element with the same uuid. several terminal of an element with the same uuid.
*/ */
PastePartsCommand::PastePartsCommand(ElementView *view, const ElementContent &content_to_paste, QUndoCommand *parent) : PastePartsCommand::PastePartsCommand(ElementView *view, const ElementContent &content_to_paste, QUndoCommand *parent) :
ElementEditionCommand(view ? view -> scene() : nullptr, view, parent) ElementEditionCommand(view ? view -> scene() : nullptr, view, parent)
{ {
@@ -44,16 +44,16 @@ PastePartsCommand::PastePartsCommand(ElementView *view, const ElementContent &co
} }
/** /**
* @brief PastePartsCommand::~PastePartsCommand @brief PastePartsCommand::~PastePartsCommand
*/ */
PastePartsCommand::~PastePartsCommand() PastePartsCommand::~PastePartsCommand()
{ {
m_scene->qgiManager().release(m_pasted_content); m_scene->qgiManager().release(m_pasted_content);
} }
/** /**
* @brief PastePartsCommand::undo @brief PastePartsCommand::undo
*/ */
void PastePartsCommand::undo() void PastePartsCommand::undo()
{ {
m_scene->blockSignals(true); m_scene->blockSignals(true);
@@ -72,8 +72,8 @@ void PastePartsCommand::undo()
} }
/** /**
* @brief PastePartsCommand::redo @brief PastePartsCommand::redo
*/ */
void PastePartsCommand::redo() void PastePartsCommand::redo()
{ {
if (m_first_redo) { if (m_first_redo) {
@@ -97,13 +97,13 @@ void PastePartsCommand::redo()
} }
/** /**
* @brief PastePartsCommand::setOffset @brief PastePartsCommand::setOffset
* Describe the offset to use with this undo command Describe the offset to use with this undo command
* @param old_offset_paste_count @param old_offset_paste_count
* @param old_start_top_left_corner @param old_start_top_left_corner
* @param new_offset_paste_count @param new_offset_paste_count
* @param new_start_top_left_corner @param new_start_top_left_corner
*/ */
void PastePartsCommand::setOffset(int old_offset_paste_count, const QPointF &old_start_top_left_corner, int new_offset_paste_count, const QPointF &new_start_top_left_corner) void PastePartsCommand::setOffset(int old_offset_paste_count, const QPointF &old_start_top_left_corner, int new_offset_paste_count, const QPointF &new_start_top_left_corner)
{ {
m_old_offset_paste_count = old_offset_paste_count; m_old_offset_paste_count = old_offset_paste_count;

View File

@@ -24,9 +24,9 @@
class ElementView; class ElementView;
/** /**
* @brief The PastePartsCommand class @brief The PastePartsCommand class
* Undo command for paste element primitive in an element editor Undo command for paste element primitive in an element editor
*/ */
class PastePartsCommand : public ElementEditionCommand class PastePartsCommand : public ElementEditionCommand
{ {
public: public:

View File

@@ -95,12 +95,12 @@ void ArcEditor::disconnectChangeConnections()
} }
/** /**
* @brief ArcEditor::setPart @brief ArcEditor::setPart
* Specifie to this editor the part to edit. Specifie to this editor the part to edit.
* Note that an editor can accept or refuse to edit a part. This editor accept only partArc. Note that an editor can accept or refuse to edit a part. This editor accept only partArc.
* @param new_part @param new_part
* @return @return
*/ */
bool ArcEditor::setPart(CustomElementPart *new_part) bool ArcEditor::setPart(CustomElementPart *new_part)
{ {
if (!new_part) if (!new_part)
@@ -137,9 +137,9 @@ bool ArcEditor::setParts(QList <CustomElementPart *> parts)
} }
/** /**
* @brief ArcEditor::currentPart @brief ArcEditor::currentPart
* @return the curent edited part, or 0 if there is no edited part @return the curent edited part, or 0 if there is no edited part
*/ */
CustomElementPart *ArcEditor::currentPart() const { CustomElementPart *ArcEditor::currentPart() const {
return(part); return(part);
} }
@@ -149,9 +149,9 @@ QList<CustomElementPart*> ArcEditor::currentParts() const {
} }
/** /**
* @brief ArcEditor::updateArcS @brief ArcEditor::updateArcS
* Update the start angle of the arc according to the edited value. Update the start angle of the arc according to the edited value.
*/ */
void ArcEditor::updateArcS() void ArcEditor::updateArcS()
{ {
if (m_locked) return; if (m_locked) return;
@@ -175,9 +175,9 @@ void ArcEditor::updateArcS()
} }
/** /**
* @brief ArcEditor::updateArcA @brief ArcEditor::updateArcA
* Update the span angle of the arc according to the edited value. Update the span angle of the arc according to the edited value.
*/ */
void ArcEditor::updateArcA() void ArcEditor::updateArcA()
{ {
if (m_locked) return; if (m_locked) return;
@@ -200,9 +200,9 @@ void ArcEditor::updateArcA()
} }
/** /**
* @brief ArcEditor::updateArcRect @brief ArcEditor::updateArcRect
* Update the geometrie of the rect that define this arc according the the edited values Update the geometrie of the rect that define this arc according the the edited values
*/ */
void ArcEditor::updateArcRectX() void ArcEditor::updateArcRectX()
{ {
if (m_locked) return; if (m_locked) return;
@@ -300,9 +300,9 @@ void ArcEditor::updateArcRectV()
} }
/** /**
* @brief ArcEditor::updateForm @brief ArcEditor::updateForm
* Update the value of the widgets Update the value of the widgets
*/ */
void ArcEditor::updateForm() void ArcEditor::updateForm()
{ {
if (!part) return; if (!part) return;
@@ -318,11 +318,11 @@ void ArcEditor::updateForm()
} }
/** /**
* @brief ArcEditor::activeConnections @brief ArcEditor::activeConnections
* Enable/disable connection between editor widget and slot editingFinished Enable/disable connection between editor widget and slot editingFinished
* True == enable | false == disable True == enable | false == disable
* @param active @param active
*/ */
void ArcEditor::activeConnections(bool active) void ArcEditor::activeConnections(bool active)
{ {
if (active) if (active)

View File

@@ -67,10 +67,11 @@ class ArcEditor : public ElementItemEditor
private: private:
void activeConnections(bool); void activeConnections(bool);
/*! /**
* \brief setUpChangeConnections @brief setUpChangeConnections
* Setup the connection from the arc(s) to the widget, to update it when the arc(s) are changed (moved ...) Setup the connection from the arc(s) to the widget,
*/ to update it when the arc(s) are changed (moved ...)
*/
void setUpChangeConnections(); void setUpChangeConnections();
void disconnectChangeConnections(); void disconnectChangeConnections();
}; };

View File

@@ -523,13 +523,13 @@ void ScalePartsCommand::adjustText() {
} }
} }
/** /**
* @brief ChangePropertiesCommand::ChangePropertiesCommand @brief ChangePropertiesCommand::ChangePropertiesCommand
* Change the properties of the drawed element Change the properties of the drawed element
* @param scene: scene to belong the property @param scene: scene to belong the property
* @param type: new type of element. @param type: new type of element.
* @param context: new info about type. @param context: new info about type.
* @param parent: parent undo @param parent: parent undo
*/ */
ChangePropertiesCommand::ChangePropertiesCommand(ElementScene *scene, const QString& type, const DiagramContext& info, const DiagramContext& elmt_info, QUndoCommand *parent) : ChangePropertiesCommand::ChangePropertiesCommand(ElementScene *scene, const QString& type, const DiagramContext& info, const DiagramContext& elmt_info, QUndoCommand *parent) :
ElementEditionCommand(scene, nullptr, parent) ElementEditionCommand(scene, nullptr, parent)
{ {

View File

@@ -24,11 +24,11 @@
#include "qgimanager.h" #include "qgimanager.h"
/** /**
* @brief The ElementEditionCommand class @brief The ElementEditionCommand class
* ElementEditionCommand is the base class for all commands classes involved in ElementEditionCommand is the base class for all commands classes involved in
the edition of an electrical element. It provides commonly required methods the edition of an electrical element. It provides commonly required methods
and attributes, such as accessors to the modified scene and view. and attributes, such as accessors to the modified scene and view.
*/ */
class ElementEditionCommand : public QUndoCommand class ElementEditionCommand : public QUndoCommand
{ {
// constructors, destructor // constructors, destructor

View File

@@ -472,8 +472,8 @@ QVector<QPointF> ElementPrimitiveDecorator::getResizingsPoints() const
} }
/** /**
* @brief ElementPrimitiveDecorator::adjusteHandlerPos @brief ElementPrimitiveDecorator::adjusteHandlerPos
*/ */
void ElementPrimitiveDecorator::adjusteHandlerPos() void ElementPrimitiveDecorator::adjusteHandlerPos()
{ {
QVector <QPointF> points_vector = mapToScene(getResizingsPoints()); QVector <QPointF> points_vector = mapToScene(getResizingsPoints());
@@ -482,10 +482,10 @@ void ElementPrimitiveDecorator::adjusteHandlerPos()
} }
/** /**
* @brief ElementPrimitiveDecorator::handlerMousePressEvent @brief ElementPrimitiveDecorator::handlerMousePressEvent
* @param qghi @param qghi
* @param event @param event
*/ */
void ElementPrimitiveDecorator::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event) void ElementPrimitiveDecorator::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
@@ -499,10 +499,10 @@ void ElementPrimitiveDecorator::handlerMousePressEvent(QetGraphicsHandlerItem *q
} }
/** /**
* @brief ElementPrimitiveDecorator::handlerMouseMoveEvent @brief ElementPrimitiveDecorator::handlerMouseMoveEvent
* @param qghi @param qghi
* @param event @param event
*/ */
void ElementPrimitiveDecorator::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event) void ElementPrimitiveDecorator::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{ {
Q_UNUSED(qghi); Q_UNUSED(qghi);
@@ -554,10 +554,10 @@ void ElementPrimitiveDecorator::handlerMouseMoveEvent(QetGraphicsHandlerItem *qg
} }
/** /**
* @brief ElementPrimitiveDecorator::handlerMouseReleaseEvent @brief ElementPrimitiveDecorator::handlerMouseReleaseEvent
* @param qghi @param qghi
* @param event @param event
*/ */
void ElementPrimitiveDecorator::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event) void ElementPrimitiveDecorator::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{ {
Q_UNUSED(qghi); Q_UNUSED(qghi);
@@ -585,9 +585,9 @@ void ElementPrimitiveDecorator::handlerMouseReleaseEvent(QetGraphicsHandlerItem
} }
/** /**
* @brief ElementPrimitiveDecorator::addHandler @brief ElementPrimitiveDecorator::addHandler
* Add handlers for this item Add handlers for this item
*/ */
void ElementPrimitiveDecorator::addHandler() void ElementPrimitiveDecorator::addHandler()
{ {
if (m_handler_vector.isEmpty() && scene()) if (m_handler_vector.isEmpty() && scene())
@@ -605,9 +605,9 @@ void ElementPrimitiveDecorator::addHandler()
} }
/** /**
* @brief ElementPrimitiveDecorator::removeHandler @brief ElementPrimitiveDecorator::removeHandler
* Remove the handlers of this item Remove the handlers of this item
*/ */
void ElementPrimitiveDecorator::removeHandler() void ElementPrimitiveDecorator::removeHandler()
{ {
if (!m_handler_vector.isEmpty()) if (!m_handler_vector.isEmpty())
@@ -688,11 +688,11 @@ QET::ScalingMethod ElementPrimitiveDecorator::scalingMethod(QGraphicsSceneMouseE
} }
/** /**
* @brief ElementPrimitiveDecorator::itemChange @brief ElementPrimitiveDecorator::itemChange
* @param change @param change
* @param value @param value
* @return @return
*/ */
QVariant ElementPrimitiveDecorator::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) QVariant ElementPrimitiveDecorator::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{ {
if (change == ItemSceneHasChanged) if (change == ItemSceneHasChanged)
@@ -718,11 +718,11 @@ QVariant ElementPrimitiveDecorator::itemChange(QGraphicsItem::GraphicsItemChange
} }
/** /**
* @brief ElementPrimitiveDecorator::sceneEventFilter @brief ElementPrimitiveDecorator::sceneEventFilter
* @param watched @param watched
* @param event @param event
* @return @return
*/ */
bool ElementPrimitiveDecorator::sceneEventFilter(QGraphicsItem *watched, QEvent *event) bool ElementPrimitiveDecorator::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{ {
//Watched must be an handler //Watched must be an handler

View File

@@ -75,7 +75,7 @@ ElementScene::ElementScene(QETElementEditor *editor, QObject *parent) :
/** /**
@brief ElementScene::~ElementScene @brief ElementScene::~ElementScene
*/ */
ElementScene::~ElementScene() ElementScene::~ElementScene()
{ {
//Disconnect to avoid crash, see bug report N° 122. //Disconnect to avoid crash, see bug report N° 122.

View File

@@ -144,10 +144,10 @@ void ElementView::zoomReset() {
} }
/** /**
* @brief ElementView::adjustSceneRect @brief ElementView::adjustSceneRect
* Adjust the scenRect, so that he include all primitives of element Adjust the scenRect, so that he include all primitives of element
* plus the viewport of the scene with a margin of 1/3 of herself plus the viewport of the scene with a margin of 1/3 of herself
*/ */
void ElementView::adjustSceneRect() { void ElementView::adjustSceneRect() {
QRectF esgr = m_scene -> elementSceneGeometricRect(); QRectF esgr = m_scene -> elementSceneGeometricRect();
QRectF vpbr = mapToScene(this -> viewport()->rect()).boundingRect(); QRectF vpbr = mapToScene(this -> viewport()->rect()).boundingRect();
@@ -156,10 +156,10 @@ void ElementView::adjustSceneRect() {
} }
/** /**
* @brief ElementView::resetSceneRect @brief ElementView::resetSceneRect
* reset le sceneRect (zone du schéma visualisée par l'ElementView) afin que reset le sceneRect (zone du schéma visualisée par l'ElementView) afin que
* celui-ci inclut uniquement les primitives de l'élément dessiné. celui-ci inclut uniquement les primitives de l'élément dessiné.
*/ */
void ElementView::resetSceneRect() { void ElementView::resetSceneRect() {
setSceneRect(m_scene -> elementSceneGeometricRect()); setSceneRect(m_scene -> elementSceneGeometricRect());
} }
@@ -366,9 +366,9 @@ void ElementView::mousePressEvent(QMouseEvent *e) {
} }
/** /**
* @brief ElementView::mouseMoveEvent @brief ElementView::mouseMoveEvent
* Manage the event move mouse Manage the event move mouse
*/ */
void ElementView::mouseMoveEvent(QMouseEvent *e) { void ElementView::mouseMoveEvent(QMouseEvent *e) {
if (e->buttons() == Qt::MidButton) if (e->buttons() == Qt::MidButton)
{ {
@@ -384,9 +384,9 @@ void ElementView::mouseMoveEvent(QMouseEvent *e) {
} }
/** /**
* @brief ElementView::mouseReleaseEvent @brief ElementView::mouseReleaseEvent
* Manage event release click mouse Manage event release click mouse
*/ */
void ElementView::mouseReleaseEvent(QMouseEvent *e) { void ElementView::mouseReleaseEvent(QMouseEvent *e) {
if (e -> button() == Qt::MidButton) { if (e -> button() == Qt::MidButton) {
setCursor(Qt::ArrowCursor); setCursor(Qt::ArrowCursor);
@@ -397,9 +397,9 @@ void ElementView::mouseReleaseEvent(QMouseEvent *e) {
} }
/** /**
* @brief ElementView::gestures @brief ElementView::gestures
* @return @return
*/ */
bool ElementView::gestures() const bool ElementView::gestures() const
{ {
QSettings settings; QSettings settings;
@@ -408,9 +408,9 @@ bool ElementView::gestures() const
/** /**
* @brief ElementView::wheelEvent @brief ElementView::wheelEvent
* @param e @param e
*/ */
void ElementView::wheelEvent(QWheelEvent *e) { void ElementView::wheelEvent(QWheelEvent *e) {
//Zoom and scrolling //Zoom and scrolling
if ( gestures() ) { if ( gestures() ) {
@@ -439,11 +439,11 @@ bool ElementView::event(QEvent *e) {
} }
/** /**
* Utilise le pincement du trackpad pour zoomer Utilise le pincement du trackpad pour zoomer
* @brief ElementView::gestureEvent @brief ElementView::gestureEvent
* @param event @param event
* @return @return
*/ */
bool ElementView::gestureEvent(QGestureEvent *event){ bool ElementView::gestureEvent(QGestureEvent *event){
if (QGesture *gesture = event->gesture(Qt::PinchGesture)) { if (QGesture *gesture = event->gesture(Qt::PinchGesture)) {
QPinchGesture *pinch = static_cast<QPinchGesture *>(gesture); QPinchGesture *pinch = static_cast<QPinchGesture *>(gesture);

View File

@@ -62,10 +62,10 @@ class EllipseEditor : public ElementItemEditor
private: private:
void activeConnections(bool); void activeConnections(bool);
/*! /**
* \brief setUpChangeConnections @brief setUpChangeConnections
* Setup the connection from the ellipse(s) to the widget, to update it when the ellipse(s) are changed (moved ...) Setup the connection from the ellipse(s) to the widget, to update it when the ellipse(s) are changed (moved ...)
*/ */
void setUpChangeConnections(); void setUpChangeConnections();
void disconnectChangeConnections(); void disconnectChangeConnections();
}; };

View File

@@ -23,9 +23,9 @@
#include "eseventaddarc.h" #include "eseventaddarc.h"
/** /**
* @brief ESEventAddArc::ESEventAddArc @brief ESEventAddArc::ESEventAddArc
* @param scene @param scene
*/ */
ESEventAddArc::ESEventAddArc(ElementScene *scene) : ESEventAddArc::ESEventAddArc(ElementScene *scene) :
ESEventInterface(scene), ESEventInterface(scene),
m_arc(nullptr), m_arc(nullptr),
@@ -33,18 +33,18 @@ ESEventAddArc::ESEventAddArc(ElementScene *scene) :
{} {}
/** /**
* @brief ESEventAddArc::~ESEventAddArc @brief ESEventAddArc::~ESEventAddArc
*/ */
ESEventAddArc::~ESEventAddArc() { ESEventAddArc::~ESEventAddArc() {
if (m_running || m_abort) if (m_running || m_abort)
delete m_arc; delete m_arc;
} }
/** /**
* @brief ESEventAddPolygon::mousePressEvent @brief ESEventAddPolygon::mousePressEvent
* @param event @param event
* @return @return
*/ */
bool ESEventAddArc::mousePressEvent(QGraphicsSceneMouseEvent *event) bool ESEventAddArc::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
if (event -> button() == Qt::LeftButton) if (event -> button() == Qt::LeftButton)
@@ -79,10 +79,10 @@ bool ESEventAddArc::mousePressEvent(QGraphicsSceneMouseEvent *event)
} }
/** /**
* @brief ESEventAddArc::mouseMoveEvent @brief ESEventAddArc::mouseMoveEvent
* @param event @param event
* @return @return
*/ */
bool ESEventAddArc::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { bool ESEventAddArc::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
updateHelpCross(event -> scenePos()); updateHelpCross(event -> scenePos());
if (!m_arc) return false; if (!m_arc) return false;
@@ -94,10 +94,10 @@ bool ESEventAddArc::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
} }
/** /**
* @brief ESEventAddArc::mouseReleaseEvent @brief ESEventAddArc::mouseReleaseEvent
* @param event @param event
* @return @return
*/ */
bool ESEventAddArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { bool ESEventAddArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
if (event -> button() == Qt::RightButton) { if (event -> button() == Qt::RightButton) {
if (m_arc) {delete m_arc; m_arc = nullptr;} if (m_arc) {delete m_arc; m_arc = nullptr;}
@@ -108,10 +108,10 @@ bool ESEventAddArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
} }
/** /**
* @brief ESEventAddArc::keyPressEvent @brief ESEventAddArc::keyPressEvent
* @param event @param event
* @return @return
*/ */
bool ESEventAddArc::keyPressEvent(QKeyEvent *event) { bool ESEventAddArc::keyPressEvent(QKeyEvent *event) {
if (m_arc && event->key() == Qt::Key_Space) { if (m_arc && event->key() == Qt::Key_Space) {
m_inverted = m_inverted ? false : true; m_inverted = m_inverted ? false : true;
@@ -123,9 +123,9 @@ bool ESEventAddArc::keyPressEvent(QKeyEvent *event) {
} }
/** /**
* @brief ESEventAddArc::updateArc @brief ESEventAddArc::updateArc
* Redraw the arc with curent value Redraw the arc with curent value
*/ */
void ESEventAddArc::updateArc() void ESEventAddArc::updateArc()
{ {
qreal width = (m_mouse_pos.x() - m_origin.x())*2; qreal width = (m_mouse_pos.x() - m_origin.x())*2;

View File

@@ -25,9 +25,9 @@ class PartArc;
class QGraphicsSceneMouseEvent; class QGraphicsSceneMouseEvent;
/** /**
* @brief The ESEventAddArc class @brief The ESEventAddArc class
* This ESEvent manage creation of arc in an ElementScene This ESEvent manage creation of arc in an ElementScene
*/ */
class ESEventAddArc : public ESEventInterface class ESEventAddArc : public ESEventInterface
{ {
public: public:

View File

@@ -23,9 +23,9 @@
#include <QUndoStack> #include <QUndoStack>
/** /**
* @brief ESEventAddDynamicTextField::ESEventAddDynamicTextField @brief ESEventAddDynamicTextField::ESEventAddDynamicTextField
* @param scene @param scene
*/ */
ESEventAddDynamicTextField::ESEventAddDynamicTextField(ElementScene *scene) : ESEventAddDynamicTextField::ESEventAddDynamicTextField(ElementScene *scene) :
ESEventInterface(scene) ESEventInterface(scene)
{ {
@@ -35,17 +35,17 @@ ESEventAddDynamicTextField::ESEventAddDynamicTextField(ElementScene *scene) :
} }
/** /**
* @brief ESEventAddDynamicTextField::~ESEventAddDynamicTextField @brief ESEventAddDynamicTextField::~ESEventAddDynamicTextField
*/ */
ESEventAddDynamicTextField::~ESEventAddDynamicTextField() { ESEventAddDynamicTextField::~ESEventAddDynamicTextField() {
delete m_text; delete m_text;
} }
/** /**
* @brief ESEventAddDynamicTextField::mouseMoveEvent @brief ESEventAddDynamicTextField::mouseMoveEvent
* @param event @param event
* @return @return
*/ */
bool ESEventAddDynamicTextField::mouseMoveEvent(QGraphicsSceneMouseEvent *event) bool ESEventAddDynamicTextField::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
QPointF pos = m_scene->snapToGrid(event->scenePos()); QPointF pos = m_scene->snapToGrid(event->scenePos());
@@ -55,10 +55,10 @@ bool ESEventAddDynamicTextField::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
} }
/** /**
* @brief ESEventAddDynamicTextField::mouseReleaseEvent @brief ESEventAddDynamicTextField::mouseReleaseEvent
* @param event @param event
* @return @return
*/ */
bool ESEventAddDynamicTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) bool ESEventAddDynamicTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{ {
if (event->button() == Qt::LeftButton) if (event->button() == Qt::LeftButton)

View File

@@ -25,9 +25,9 @@ class PartDynamicTextField;
class QGraphicsSceneMouseEvent; class QGraphicsSceneMouseEvent;
/** /**
* @brief The ESEventAddDynamicTextField class @brief The ESEventAddDynamicTextField class
* This ESEvent manage creation of dynamic text field in an ElementScene This ESEvent manage creation of dynamic text field in an ElementScene
*/ */
class ESEventAddDynamicTextField : public ESEventInterface class ESEventAddDynamicTextField : public ESEventInterface
{ {
public: public:

View File

@@ -23,17 +23,17 @@
#include "elementscene.h" #include "elementscene.h"
/** /**
* @brief ESEventAddEllipse::ESEventAddEllipse @brief ESEventAddEllipse::ESEventAddEllipse
* @param scene @param scene
*/ */
ESEventAddEllipse::ESEventAddEllipse(ElementScene *scene) : ESEventAddEllipse::ESEventAddEllipse(ElementScene *scene) :
ESEventInterface(scene), ESEventInterface(scene),
m_ellipse(nullptr) m_ellipse(nullptr)
{} {}
/** /**
* @brief ESEventAddEllipse::~ESEventAddEllipse @brief ESEventAddEllipse::~ESEventAddEllipse
*/ */
ESEventAddEllipse::~ESEventAddEllipse() { ESEventAddEllipse::~ESEventAddEllipse() {
if (m_running || m_abort){ if (m_running || m_abort){
delete m_ellipse; delete m_ellipse;
@@ -41,10 +41,10 @@ ESEventAddEllipse::~ESEventAddEllipse() {
} }
/** /**
* @brief ESEventAddEllipse::mousePressEvent @brief ESEventAddEllipse::mousePressEvent
* @param event @param event
* @return @return
*/ */
bool ESEventAddEllipse::mousePressEvent(QGraphicsSceneMouseEvent *event) { bool ESEventAddEllipse::mousePressEvent(QGraphicsSceneMouseEvent *event) {
if (event -> button() == Qt::LeftButton) { if (event -> button() == Qt::LeftButton) {
if(!m_running) m_running = true; if(!m_running) m_running = true;
@@ -72,10 +72,10 @@ bool ESEventAddEllipse::mousePressEvent(QGraphicsSceneMouseEvent *event) {
} }
/** /**
* @brief ESEventAddRect::mouseMoveEvent @brief ESEventAddRect::mouseMoveEvent
* @param event @param event
* @return @return
*/ */
bool ESEventAddEllipse::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { bool ESEventAddEllipse::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
updateHelpCross(event -> scenePos()); updateHelpCross(event -> scenePos());
if (!m_ellipse) return false; if (!m_ellipse) return false;
@@ -94,10 +94,10 @@ bool ESEventAddEllipse::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
} }
/** /**
* @brief ESEventAddEllipse::mouseReleaseEvent @brief ESEventAddEllipse::mouseReleaseEvent
* @param event @param event
* @return @return
*/ */
bool ESEventAddEllipse::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { bool ESEventAddEllipse::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
if (event -> button() == Qt::RightButton) { if (event -> button() == Qt::RightButton) {
if (m_ellipse) {delete m_ellipse; m_ellipse = nullptr;} if (m_ellipse) {delete m_ellipse; m_ellipse = nullptr;}

View File

@@ -26,9 +26,9 @@ class PartEllipse;
class QGraphicsSceneMouseEvent; class QGraphicsSceneMouseEvent;
/** /**
* @brief The ESEventAddEllipse class @brief The ESEventAddEllipse class
* This ESEvent manage creation of ellpise in an ElementScene This ESEvent manage creation of ellpise in an ElementScene
*/ */
class ESEventAddEllipse : public ESEventInterface class ESEventAddEllipse : public ESEventInterface
{ {
public: public:

Some files were not shown because too many files have changed in this diff Show More