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

@@ -25,10 +25,10 @@
#include <QSqlRecord>
/**
* @brief ProjectDBModel::ProjectDBModel
* @param project :project of this nomenclature
* @param parent : parent QObject
*/
@brief ProjectDBModel::ProjectDBModel
@param project :project of this nomenclature
@param parent : parent QObject
*/
ProjectDBModel::ProjectDBModel(QETProject *project, QObject *parent) :
QAbstractTableModel(parent),
m_project(project)
@@ -37,9 +37,9 @@ ProjectDBModel::ProjectDBModel(QETProject *project, QObject *parent) :
}
/**
* @brief ProjectDBModel::ProjectDBModel
* @param other_model
*/
@brief ProjectDBModel::ProjectDBModel
@param other_model
*/
ProjectDBModel::ProjectDBModel(const ProjectDBModel &other_model) :
QAbstractTableModel(other_model.parent())
{
@@ -51,11 +51,11 @@ ProjectDBModel::ProjectDBModel(const ProjectDBModel &other_model) :
}
/**
* @brief ProjectDBModel::rowCount
* Reimplemented for QAbstractTableModel
* @param parent
* @return
*/
@brief ProjectDBModel::rowCount
Reimplemented for QAbstractTableModel
@param parent
@return
*/
int ProjectDBModel::rowCount(const QModelIndex &parent) const
{
if (parent.isValid())
@@ -65,11 +65,11 @@ int ProjectDBModel::rowCount(const QModelIndex &parent) const
}
/**
* @brief ProjectDBModel::columnCount
* Reimplemented for QAbstractTableModel
* @param parent
* @return
*/
@brief ProjectDBModel::columnCount
Reimplemented for QAbstractTableModel
@param parent
@return
*/
int ProjectDBModel::columnCount(const QModelIndex &parent) const
{
if (parent.isValid())
@@ -83,15 +83,15 @@ int ProjectDBModel::columnCount(const QModelIndex &parent) const
}
/**
* @brief ProjectDBModel::setHeaderData
* Reimplemented from QAbstractTableModel.
* Only horizontal orientation is accepted.
* @param section
* @param orientation
* @param value
* @param role
* @return
*/
@brief ProjectDBModel::setHeaderData
Reimplemented from QAbstractTableModel.
Only horizontal orientation is accepted.
@param section
@param orientation
@param value
@param role
@return
*/
bool ProjectDBModel::setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role)
{
if (orientation == Qt::Vertical) {
@@ -105,13 +105,13 @@ bool ProjectDBModel::setHeaderData(int section, Qt::Orientation orientation, con
}
/**
* @brief ProjectDBModel::headerData
* Reimplemented from QAbstractTableModel.
* @param section
* @param orientation
* @param role
* @return
*/
@brief ProjectDBModel::headerData
Reimplemented from QAbstractTableModel.
@param section
@param orientation
@param role
@return
*/
QVariant ProjectDBModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Vertical) {
@@ -130,13 +130,13 @@ QVariant ProjectDBModel::headerData(int section, Qt::Orientation orientation, in
}
/**
* @brief ProjectDBModel::setData
* Only store the data for the index 0.0
* @param index
* @param value
* @param role
* @return
*/
@brief ProjectDBModel::setData
Only store the data for the index 0.0
@param index
@param value
@param role
@return
*/
bool ProjectDBModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
if (!index.isValid() || index.row() != 0 || index.column() != 0) {
@@ -148,12 +148,12 @@ bool ProjectDBModel::setData(const QModelIndex &index, const QVariant &value, in
}
/**
* @brief ProjectDBModel::data
* Reimplemented for QAbstractTableModel
* @param index
* @param role
* @return
*/
@brief ProjectDBModel::data
Reimplemented for QAbstractTableModel
@param index
@param role
@return
*/
QVariant ProjectDBModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid())
@@ -174,10 +174,10 @@ QVariant ProjectDBModel::data(const QModelIndex &index, int role) const
}
/**
* @brief ProjectDBModel::setQuery
* Query the internall bd with @query.
* @param query
*/
@brief ProjectDBModel::setQuery
Query the internall bd with @query.
@param query
*/
void ProjectDBModel::setQuery(const QString &query)
{
auto rm_ = m_query != query;
@@ -206,9 +206,9 @@ void ProjectDBModel::setQuery(const QString &query)
}
/**
* @brief ProjectDBModel::queryString
* @return the current query used by this model
*/
@brief ProjectDBModel::queryString
@return the current query used by this model
*/
QString ProjectDBModel::queryString() const {
return m_query;
}
@@ -218,12 +218,12 @@ QETProject *ProjectDBModel::project() const {
}
/**
* @brief ProjectDBModel::toXml
* Save the model to xml,since model can have unlimited data we only save few data (only these used by qelectrotech).
* The query, all header data. and some data of index::(0,0). All other data are not saved.
* @param document
* @return
*/
@brief ProjectDBModel::toXml
Save the model to xml,since model can have unlimited data we only save few data (only these used by qelectrotech).
The query, all header data. and some data of index::(0,0). All other data are not saved.
@param document
@return
*/
QDomElement ProjectDBModel::toXml(QDomDocument &document) const
{
auto dom_element = document.createElement(xmlTagName());
@@ -265,10 +265,10 @@ QDomElement ProjectDBModel::toXml(QDomDocument &document) const
}
/**
* @brief ProjectDBModel::fromXml
* Restore the model from xml
* @param element
*/
@brief ProjectDBModel::fromXml
Restore the model from xml
@param element
*/
void ProjectDBModel::fromXml(const QDomElement &element)
{
if (element.tagName() != xmlTagName())
@@ -290,18 +290,18 @@ void ProjectDBModel::fromXml(const QDomElement &element)
}
/**
* @brief ProjectDBModel::setIdentifier
* Set the identifier of this model to @identifier
* @param identifier
*/
@brief ProjectDBModel::setIdentifier
Set the identifier of this model to @identifier
@param identifier
*/
void ProjectDBModel::setIdentifier(const QString &identifier) {
m_identifier = identifier;
}
/**
* @brief ProjectDBModel::dataBaseUpdated
* slot called when the project database is updated
*/
@brief ProjectDBModel::dataBaseUpdated
slot called when the project database is updated
*/
void ProjectDBModel::dataBaseUpdated()
{
auto original_record = m_record;

View File

@@ -25,16 +25,16 @@
class QETProject;
/**
* @brief The ProjectDBModel class
* This model is intended to be use with the @class projectDataBase
* and is designed to be displayed by the @class QetGraphicsTableItem (but can be use by other view class since it inherit from QAbstractTableModel).
* This class should be sufficient to display the content of the project data base from a query set by the method void ProjectDBModel::setQuery(const QString &query).
* The indentifier method is used by widget editor to retrieve the good widget for edit the query. By defaut identifer return the string 'unknow'.
* You should use setIdentfier method to set your custom identifier.
* At the time this sentence is written, there is two identifier :
* nomenclature
* summary
*/
@brief The ProjectDBModel class
This model is intended to be use with the @class projectDataBase
and is designed to be displayed by the @class QetGraphicsTableItem (but can be use by other view class since it inherit from QAbstractTableModel).
This class should be sufficient to display the content of the project data base from a query set by the method void ProjectDBModel::setQuery(const QString &query).
The indentifier method is used by widget editor to retrieve the good widget for edit the query. By defaut identifer return the string 'unknow'.
You should use setIdentfier method to set your custom identifier.
At the time this sentence is written, there is two identifier :
nomenclature
summary
*/
class ProjectDBModel : public QAbstractTableModel
{
Q_OBJECT

View File

@@ -26,20 +26,20 @@
static int no_model_height = 20;
static int no_model_width = 40;
/**
* @brief QetGraphicsHeaderItem::QetGraphicsHeaderItem
* @param parent
*/
@brief QetGraphicsHeaderItem::QetGraphicsHeaderItem
@param parent
*/
QetGraphicsHeaderItem::QetGraphicsHeaderItem(QGraphicsItem *parent) :
QGraphicsObject(parent)
{}
/**
* @brief QetGraphicsHeaderItem::setModel
* Set the model presented by this item
* Since QetGraphicsHeaderItem don't take ownership of model,
* if item already have a model, it's your responsability to delete it.
* @param model
*/
@brief QetGraphicsHeaderItem::setModel
Set the model presented by this item
Since QetGraphicsHeaderItem don't take ownership of model,
if item already have a model, it's your responsability to delete it.
@param model
*/
void QetGraphicsHeaderItem::setModel(QAbstractItemModel *model)
{
if (m_model) {
@@ -65,29 +65,29 @@ void QetGraphicsHeaderItem::setModel(QAbstractItemModel *model)
}
/**
* @brief QetGraphicsHeaderItem::model
* @return the model that this item is presenting
*/
@brief QetGraphicsHeaderItem::model
@return the model that this item is presenting
*/
QAbstractItemModel *QetGraphicsHeaderItem::model() const {
return m_model;
}
/**
* @brief QetGraphicsHeaderItem::boundingRect
* Reimplemented from QGraphicsObject::boundingRect() const;
* @return
*/
@brief QetGraphicsHeaderItem::boundingRect
Reimplemented from QGraphicsObject::boundingRect() const;
@return
*/
QRectF QetGraphicsHeaderItem::boundingRect() const {
return m_bounding_rect;
}
/**
* @brief QetGraphicsHeaderItem::paint
* Reimplemented from QGraphicsObject::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) const;
* @param painter
* @param option
* @param widget
*/
@brief QetGraphicsHeaderItem::paint
Reimplemented from QGraphicsObject::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) const;
@param painter
@param option
@param widget
*/
void QetGraphicsHeaderItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option)
@@ -141,18 +141,18 @@ void QetGraphicsHeaderItem::paint(QPainter *painter, const QStyleOptionGraphicsI
}
/**
* @brief QetGraphicsHeaderItem::rect
* @return the current rect of the item aka the size of rectangle painted.
*/
@brief QetGraphicsHeaderItem::rect
@return the current rect of the item aka the size of rectangle painted.
*/
QRect QetGraphicsHeaderItem::rect() const {
return m_current_rect;
}
/**
* @brief QetGraphicsHeaderItem::resizeSection
* @param logicalIndex
* @param size
*/
@brief QetGraphicsHeaderItem::resizeSection
@param logicalIndex
@param size
*/
void QetGraphicsHeaderItem::resizeSection(int logicalIndex, int size)
{
if (!m_model)
@@ -187,10 +187,10 @@ void QetGraphicsHeaderItem::resizeSection(int logicalIndex, int size)
}
/**
* @brief QetGraphicsHeaderItem::sectionSize
* @param logical_index
* @return the width (or height for vertical headers) of the given logicalIndex.
*/
@brief QetGraphicsHeaderItem::sectionSize
@param logical_index
@return the width (or height for vertical headers) of the given logicalIndex.
*/
int QetGraphicsHeaderItem::sectionSize(int logical_index) const
{
if (logical_index>=0 && logical_index<m_current_sections_width.size()) {
@@ -201,11 +201,11 @@ int QetGraphicsHeaderItem::sectionSize(int logical_index) const
}
/**
* @brief QetGraphicsHeaderItem::toXml
* save the header to xml
* @param document
* @return
*/
@brief QetGraphicsHeaderItem::toXml
save the header to xml
@param document
@return
*/
QDomElement QetGraphicsHeaderItem::toXml(QDomDocument &document) const
{
auto dom_element = document.createElement(xmlTagName());
@@ -217,10 +217,10 @@ QDomElement QetGraphicsHeaderItem::toXml(QDomDocument &document) const
}
/**
* @brief QetGraphicsHeaderItem::fromXml
* Restore the header from xml
* @param element
*/
@brief QetGraphicsHeaderItem::fromXml
Restore the header from xml
@param element
*/
void QetGraphicsHeaderItem::fromXml(const QDomElement &element)
{
if ((element.tagName() != xmlTagName()) || !m_model) {
@@ -232,10 +232,10 @@ void QetGraphicsHeaderItem::fromXml(const QDomElement &element)
}
/**
* @brief QetGraphicsHeaderItem::setUpMinimumSectionsSize
* Setup the minimum section size and height of the item.
* Not that this function doesn't change the current size of this item.
*/
@brief QetGraphicsHeaderItem::setUpMinimumSectionsSize
Setup the minimum section size and height of the item.
Not that this function doesn't change the current size of this item.
*/
void QetGraphicsHeaderItem::setUpMinimumSectionsSize()
{
if (!m_model)
@@ -265,20 +265,20 @@ void QetGraphicsHeaderItem::setUpMinimumSectionsSize()
}
/**
* @brief QetGraphicsHeaderItem::setUpBoundingRect
* Setup the bounding rect of the item
*/
@brief QetGraphicsHeaderItem::setUpBoundingRect
Setup the bounding rect of the item
*/
void QetGraphicsHeaderItem::setUpBoundingRect() {
m_bounding_rect = m_current_rect.adjusted(-10, -10, 10, 10);
}
/**
* @brief QetGraphicsHeaderItem::headerDataChanged
* Update the header when data of displayed model change
* @param orientation
* @param first
* @param last
*/
@brief QetGraphicsHeaderItem::headerDataChanged
Update the header when data of displayed model change
@param orientation
@param first
@param last
*/
void QetGraphicsHeaderItem::headerDataChanged(Qt::Orientations orientation, int first, int last)
{
Q_UNUSED(orientation)
@@ -291,10 +291,10 @@ void QetGraphicsHeaderItem::headerDataChanged(Qt::Orientations orientation, int
}
/**
* @brief QetGraphicsHeaderItem::adjustSize
* If needed, this function resize the current height and section
* according to there minimum
*/
@brief QetGraphicsHeaderItem::adjustSize
If needed, this function resize the current height and section
according to there minimum
*/
void QetGraphicsHeaderItem::adjustSize()
{
if (m_section_height != m_minimum_section_height)

View File

@@ -27,16 +27,16 @@
class QAbstractItemModel;
/**
* @brief The QetGraphicsHeaderItem class
* The header have a few parameters to edit her visual aspect.
* Margins, to edit the margin between the cell and the text.
* Text font.
* Text alignment in the cell
* These three parameters are not settable directly with the header but trough the model to be displayed by the header.
* Header search these parameters only in the section 0 for cell of header.
* By consequence, set data in other section is useless also these parameter can't be set individually for each cell.
* The margins is stored in the model in index Qt::UserRole+1 and for value a QString. See QETUtils::marginsFromString and QETUtils::marginsToString
*/
@brief The QetGraphicsHeaderItem class
The header have a few parameters to edit her visual aspect.
Margins, to edit the margin between the cell and the text.
Text font.
Text alignment in the cell
These three parameters are not settable directly with the header but trough the model to be displayed by the header.
Header search these parameters only in the section 0 for cell of header.
By consequence, set data in other section is useless also these parameter can't be set individually for each cell.
The margins is stored in the model in index Qt::UserRole+1 and for value a QString. See QETUtils::marginsFromString and QETUtils::marginsToString
*/
class QetGraphicsHeaderItem : public QGraphicsObject
{
Q_OBJECT

View File

@@ -34,11 +34,11 @@ static int no_model_height = 20;
static int no_model_width = 40;
/**
* @brief QetGraphicsTableItem::adjustTableToFolio
* Adjust the table @table to fit at best the folio
* @param table : table to adjust
* @param margins : margins between table and folio.
*/
@brief QetGraphicsTableItem::adjustTableToFolio
Adjust the table @table to fit at best the folio
@param table : table to adjust
@param margins : margins between table and folio.
*/
void QetGraphicsTableItem::adjustTableToFolio(QetGraphicsTableItem *table, QMargins margins)
{
if (!table->diagram()) {
@@ -62,11 +62,11 @@ void QetGraphicsTableItem::adjustTableToFolio(QetGraphicsTableItem *table, QMarg
}
/**
* @brief QetGraphicsTableItem::checkInsufficientRowsCount
* Check if the number of rows of @table + linked table is enough to display all
* content of the model, if not open a dialog to advise user what to do.
* @param table
*/
@brief QetGraphicsTableItem::checkInsufficientRowsCount
Check if the number of rows of @table + linked table is enough to display all
content of the model, if not open a dialog to advise user what to do.
@param table
*/
void QetGraphicsTableItem::checkInsufficientRowsCount(QetGraphicsTableItem *table)
{
if (!table->diagram() || !table->model()) {
@@ -114,10 +114,10 @@ void QetGraphicsTableItem::checkInsufficientRowsCount(QetGraphicsTableItem *tabl
}
/**
* @brief QetGraphicsTableItem::QetGraphicsTableItem
* Default constructor
* @param parent
*/
@brief QetGraphicsTableItem::QetGraphicsTableItem
Default constructor
@param parent
*/
QetGraphicsTableItem::QetGraphicsTableItem(QGraphicsItem *parent) :
QetGraphicsItem(parent)
{
@@ -146,12 +146,12 @@ QetGraphicsTableItem::~QetGraphicsTableItem()
{}
/**
* @brief QetGraphicsTableItem::setModel
* Set the model presented by this item.
* Since QetGraphicsTableItem don't take ownership of model,
* if item already have a model, it's your responsibility to delete it.
* @param model
*/
@brief QetGraphicsTableItem::setModel
Set the model presented by this item.
Since QetGraphicsTableItem don't take ownership of model,
if item already have a model, it's your responsibility to delete it.
@param model
*/
void QetGraphicsTableItem::setModel(QAbstractItemModel *model)
{
if (m_model)
@@ -178,29 +178,29 @@ void QetGraphicsTableItem::setModel(QAbstractItemModel *model)
}
/**
* @brief QetGraphicsTableItem::model
* @return The model that this item is presenting
*/
@brief QetGraphicsTableItem::model
@return The model that this item is presenting
*/
QAbstractItemModel *QetGraphicsTableItem::model() const {
return m_model;
}
/**
* @brief QetGraphicsTableItem::boundingRect
* Reimplemented from QGraphicsObject
* @return
*/
@brief QetGraphicsTableItem::boundingRect
Reimplemented from QGraphicsObject
@return
*/
QRectF QetGraphicsTableItem::boundingRect() const {
return m_bounding_rect;
}
/**
* @brief QetGraphicsTableItem::paint
* Draw the table
* @param painter
* @param option
* @param widget
*/
@brief QetGraphicsTableItem::paint
Draw the table
@param painter
@param option
@param widget
*/
void QetGraphicsTableItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option)
@@ -285,10 +285,10 @@ void QetGraphicsTableItem::paint(QPainter *painter, const QStyleOptionGraphicsIt
}
/**
* @brief QetGraphicsTableItem::setSize
* Set the current size of the table to @size
* @param size
*/
@brief QetGraphicsTableItem::setSize
Set the current size of the table to @size
@param size
*/
void QetGraphicsTableItem::setSize(const QSize &size)
{
auto new_size = size;
@@ -309,9 +309,9 @@ void QetGraphicsTableItem::setSize(const QSize &size)
}
/**
* @brief QetGraphicsTableItem::size
* @return The current size of the table
*/
@brief QetGraphicsTableItem::size
@return The current size of the table
*/
QSize QetGraphicsTableItem::size() const
{
QSize size_(m_header_item->rect().width(), m_current_size.height());
@@ -319,10 +319,10 @@ QSize QetGraphicsTableItem::size() const
}
/**
* @brief QetGraphicsTableItem::minimumSize
* @return the minimum size the table can be
* The returned size take care of the table's minimum width, but also the header item's minimum width
*/
@brief QetGraphicsTableItem::minimumSize
@return the minimum size the table can be
The returned size take care of the table's minimum width, but also the header item's minimum width
*/
QSize QetGraphicsTableItem::minimumSize() const
{
if (!m_model) {
@@ -348,10 +348,10 @@ QSize QetGraphicsTableItem::minimumSize() const
}
/**
* @brief QetGraphicsTableItem::setDisplayNRow
* Limit the number of row to display
* @param number : set to 0 or less to disabled the limit of row to display
*/
@brief QetGraphicsTableItem::setDisplayNRow
Limit the number of row to display
@param number : set to 0 or less to disabled the limit of row to display
*/
void QetGraphicsTableItem::setDisplayNRow(const int &number) {
m_number_of_displayed_row = number;
setToMinimumHeight();
@@ -360,25 +360,25 @@ void QetGraphicsTableItem::setDisplayNRow(const int &number) {
}
/**
* @brief QetGraphicsTableItem::displayNRow
* @return the number of row displayed.
* A value of 0 or less mean there is no limit
*/
@brief QetGraphicsTableItem::displayNRow
@return the number of row displayed.
A value of 0 or less mean there is no limit
*/
int QetGraphicsTableItem::displayNRow() const {
return m_number_of_displayed_row;
}
/**
* @brief QetGraphicsTableItem::setPreviousTable
* Set the previous table to @table.
* If this table already have a previous table, the previous table will be replaced.
* Set new table to nullptr to remove an existing previous table.
* The table uses the model of the new previous table.
* Since the table does not take ownership of the model, it is your responsibility to manage the old model.
* Linked tables (table with next and/or previous table) share the same model, a table always take the model of the previous table..
* When remove a previous table (set to nullptr) from a table, the model is also removed, you need to set a new model
* @param table
*/
@brief QetGraphicsTableItem::setPreviousTable
Set the previous table to @table.
If this table already have a previous table, the previous table will be replaced.
Set new table to nullptr to remove an existing previous table.
The table uses the model of the new previous table.
Since the table does not take ownership of the model, it is your responsibility to manage the old model.
Linked tables (table with next and/or previous table) share the same model, a table always take the model of the previous table..
When remove a previous table (set to nullptr) from a table, the model is also removed, you need to set a new model
@param table
*/
void QetGraphicsTableItem::setPreviousTable(QetGraphicsTableItem *table)
{
if (m_previous_table == table ||
@@ -405,11 +405,11 @@ void QetGraphicsTableItem::setPreviousTable(QetGraphicsTableItem *table)
}
/**
* @brief QetGraphicsTableItem::setNextTable
* Set the next table to @table
* nullptr will remove an existing next table.
* @param table
*/
@brief QetGraphicsTableItem::setNextTable
Set the next table to @table
nullptr will remove an existing next table.
@param table
*/
void QetGraphicsTableItem::setNextTable(QetGraphicsTableItem *table)
{
if (m_next_table == table ||
@@ -440,10 +440,10 @@ QString QetGraphicsTableItem::tableName() const {
}
/**
* @brief QetGraphicsTableItem::displayNRowOffset
* @return the offset (aka the last displayed row) of displayed row.
* If this item have a previous table, the previous offset is added.
*/
@brief QetGraphicsTableItem::displayNRowOffset
@return the offset (aka the last displayed row) of displayed row.
If this item have a previous table, the previous offset is added.
*/
int QetGraphicsTableItem::displayNRowOffset() const
{
auto offset_ = m_number_of_displayed_row;
@@ -462,10 +462,10 @@ QetGraphicsTableItem *QetGraphicsTableItem::nextTable() const {
}
/**
* @brief QetGraphicsTableItem::setToMinimumHeight
* Set the height to the the minimum.
* The width stay unchanged.
*/
@brief QetGraphicsTableItem::setToMinimumHeight
Set the height to the the minimum.
The width stay unchanged.
*/
void QetGraphicsTableItem::setToMinimumHeight()
{
auto size_ = size();
@@ -487,19 +487,19 @@ void QetGraphicsTableItem::initLink()
}
/**
* @brief QetGraphicsTableItem::minimumRowHeigth
* @return the minimum height of a row
*/
@brief QetGraphicsTableItem::minimumRowHeigth
@return the minimum height of a row
*/
int QetGraphicsTableItem::minimumRowHeigth() const {
return m_minimum_row_height;
}
/**
* @brief QetGraphicsTableItem::toXml
* Save the table to xml
* @param dom_document : parent document
* @return the dom_element that describe the table
*/
@brief QetGraphicsTableItem::toXml
Save the table to xml
@param dom_document : parent document
@return the dom_element that describe the table
*/
QDomElement QetGraphicsTableItem::toXml(QDomDocument &dom_document) const
{
auto dom_table = dom_document.createElement(xmlTagName());
@@ -535,11 +535,11 @@ QDomElement QetGraphicsTableItem::toXml(QDomDocument &dom_document) const
}
/**
* @brief QetGraphicsTableItem::fromXml
* Restore the table from xml.
* Make this item is already in a diagram to
* @param dom_element
*/
@brief QetGraphicsTableItem::fromXml
Restore the table from xml.
Make this item is already in a diagram to
@param dom_element
*/
void QetGraphicsTableItem::fromXml(const QDomElement &dom_element)
{
if (dom_element.tagName() != xmlTagName()) {
@@ -573,10 +573,10 @@ void QetGraphicsTableItem::fromXml(const QDomElement &dom_element)
}
/**
* @brief QetGraphicsTableItem::hoverEnterEvent
* Reimplemented from QetGraphicsItem
* @param event
*/
@brief QetGraphicsTableItem::hoverEnterEvent
Reimplemented from QetGraphicsItem
@param event
*/
void QetGraphicsTableItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
if (m_model)
@@ -589,10 +589,10 @@ void QetGraphicsTableItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
}
/**
* @brief QetGraphicsTableItem::hoverLeaveEvent
* Reimplemented from QetGraphicsItem
* @param event
*/
@brief QetGraphicsTableItem::hoverLeaveEvent
Reimplemented from QetGraphicsItem
@param event
*/
void QetGraphicsTableItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
if (m_model) {
@@ -602,12 +602,12 @@ void QetGraphicsTableItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
}
/**
* @brief QetGraphicsTableItem::sceneEventFilter
* Reimplemented from QetGraphicsItem
* @param watched
* @param event
* @return
*/
@brief QetGraphicsTableItem::sceneEventFilter
Reimplemented from QetGraphicsItem
@param watched
@param event
@return
*/
bool QetGraphicsTableItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{
if (watched == &m_handler_item)
@@ -633,11 +633,11 @@ bool QetGraphicsTableItem::sceneEventFilter(QGraphicsItem *watched, QEvent *even
}
/**
* @brief QetGraphicsTableItem::itemChange
* @param change
* @param value
* @return
*/
@brief QetGraphicsTableItem::itemChange
@param change
@param value
@return
*/
QVariant QetGraphicsTableItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
//item was removed from scene, we remove the handler
@@ -660,10 +660,10 @@ void QetGraphicsTableItem::modelReseted() {
}
/**
* @brief QetGraphicsTableItem::setUpColumnAndRowMinimumSize
* Calcule the minimum row height and the minimum column width for each columns
* this function doesn't change the geometry of the table.
*/
@brief QetGraphicsTableItem::setUpColumnAndRowMinimumSize
Calcule the minimum row height and the minimum column width for each columns
this function doesn't change the geometry of the table.
*/
void QetGraphicsTableItem::setUpColumnAndRowMinimumSize()
{
if (!m_model)
@@ -693,8 +693,8 @@ void QetGraphicsTableItem::setUpColumnAndRowMinimumSize()
}
/**
* @brief QetGraphicsTableItem::setUpBoundingRect
*/
@brief QetGraphicsTableItem::setUpBoundingRect
*/
void QetGraphicsTableItem::setUpBoundingRect()
{
QSize header_size = m_header_item->rect().size();
@@ -703,16 +703,16 @@ void QetGraphicsTableItem::setUpBoundingRect()
}
/**
* @brief QetGraphicsTableItem::adjustHandlerPos
* Adjust the pos of the handler item
*/
@brief QetGraphicsTableItem::adjustHandlerPos
Adjust the pos of the handler item
*/
void QetGraphicsTableItem::adjustHandlerPos() {
m_handler_item.setPos(mapToScene(QRect(QPoint(0,0), size()).bottomRight()));
}
/**
* @brief QetGraphicsTableItem::setUpHandler
*/
@brief QetGraphicsTableItem::setUpHandler
*/
void QetGraphicsTableItem::setUpHandler()
{
m_handler_item.setColor(Qt::blue);
@@ -759,9 +759,9 @@ void QetGraphicsTableItem::handlerMouseReleaseEvent(QGraphicsSceneMouseEvent *ev
}
/**
* @brief QetGraphicsTableItem::adjustColumnsWidth
* Adjust the size of each column according to the current table width by setting the sectionSize of the header item
*/
@brief QetGraphicsTableItem::adjustColumnsWidth
Adjust the size of each column according to the current table width by setting the sectionSize of the header item
*/
void QetGraphicsTableItem::adjustColumnsWidth()
{
if (!m_model)
@@ -819,9 +819,9 @@ void QetGraphicsTableItem::dataChanged(const QModelIndex &topLeft, const QModelI
}
/**
* @brief QetGraphicsTableItem::headerSectionResized
* Connected to the header signal QetGraphicsTableItem sectionResized
*/
@brief QetGraphicsTableItem::headerSectionResized
Connected to the header signal QetGraphicsTableItem sectionResized
*/
void QetGraphicsTableItem::headerSectionResized()
{
auto header_size = m_header_item->rect().size();
@@ -834,10 +834,10 @@ void QetGraphicsTableItem::headerSectionResized()
}
/**
* @brief QetGraphicsTableItem::adjustSize
* If needed, this function resize the current height and width of table and/or the size of columns.
* according to there minimum
*/
@brief QetGraphicsTableItem::adjustSize
If needed, this function resize the current height and width of table and/or the size of columns.
according to there minimum
*/
void QetGraphicsTableItem::adjustSize()
{
//If there is no model, set the size to minimum

View File

@@ -28,17 +28,17 @@ class QAbstractItemModel;
class QetGraphicsHeaderItem;
/**
* @brief The QetGraphicsTableItem class
* This item display a table destined to represent the content of a QAbstractItemModel
* The table have a few parameters to edit her visual aspect.
* Margins, to edit the margin between the cell and the text.
* Text font.
* Text alignment in the cell
* These three parameters are not settable directly with the table but trough the model to be displayed by the table.
* The table search these parameters only in the index(0,0) for all the table.
* By consequence, set data in other index than 0,0 is useless also these parameter can't be set individually for each cell.
* The margins is stored in the model in index Qt::UserRole+1 and for value a QString. See QETUtils::marginsFromString and QETUtils::marginsToString
*/
@brief The QetGraphicsTableItem class
This item display a table destined to represent the content of a QAbstractItemModel
The table have a few parameters to edit her visual aspect.
Margins, to edit the margin between the cell and the text.
Text font.
Text alignment in the cell
These three parameters are not settable directly with the table but trough the model to be displayed by the table.
The table search these parameters only in the index(0,0) for all the table.
By consequence, set data in other index than 0,0 is useless also these parameter can't be set individually for each cell.
The margins is stored in the model in index Qt::UserRole+1 and for value a QString. See QETUtils::marginsFromString and QETUtils::marginsToString
*/
class QetGraphicsTableItem : public QetGraphicsItem
{
Q_OBJECT

View File

@@ -30,10 +30,10 @@
#include <QFontDialog>
/**
* @brief GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor
* @param table
* @param parent
*/
@brief GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor
@param table
@param parent
*/
GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor(QetGraphicsTableItem *table, QWidget *parent) :
PropertiesEditorWidget(parent),
ui(new Ui::GraphicsTablePropertiesEditor)
@@ -57,17 +57,17 @@ GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor(QetGraphicsTableIte
}
/**
* @brief GraphicsTablePropertiesEditor::~GraphicsTablePropertiesEditor
*/
@brief GraphicsTablePropertiesEditor::~GraphicsTablePropertiesEditor
*/
GraphicsTablePropertiesEditor::~GraphicsTablePropertiesEditor() {
delete ui;
}
/**
* @brief GraphicsTablePropertiesEditor::setTable
* Set the table to be edited
* @param table
*/
@brief GraphicsTablePropertiesEditor::setTable
Set the table to be edited
@param table
*/
void GraphicsTablePropertiesEditor::setTable(QetGraphicsTableItem *table)
{
if (m_table_item) {
@@ -97,9 +97,9 @@ void GraphicsTablePropertiesEditor::setTable(QetGraphicsTableItem *table)
}
/**
* @brief GraphicsTablePropertiesEditor::apply
* Apply the current edition
*/
@brief GraphicsTablePropertiesEditor::apply
Apply the current edition
*/
void GraphicsTablePropertiesEditor::apply()
{
if(!m_table_item && m_table_item->diagram()) {
@@ -113,9 +113,9 @@ void GraphicsTablePropertiesEditor::apply()
}
/**
* @brief GraphicsTablePropertiesEditor::associatedUndo
* @return the undo command associated to the edition
*/
@brief GraphicsTablePropertiesEditor::associatedUndo
@return the undo command associated to the edition
*/
QUndoCommand *GraphicsTablePropertiesEditor::associatedUndo() const
{
if (m_live_edit)
@@ -198,8 +198,8 @@ bool GraphicsTablePropertiesEditor::setLiveEdit(bool live_edit)
}
/**
* @brief GraphicsTablePropertiesEditor::on_m_header_font_pb_clicked
*/
@brief GraphicsTablePropertiesEditor::on_m_header_font_pb_clicked
*/
void GraphicsTablePropertiesEditor::on_m_header_font_pb_clicked()
{
if (m_table_item && m_table_item->model())
@@ -219,8 +219,8 @@ void GraphicsTablePropertiesEditor::on_m_header_font_pb_clicked()
}
/**
* @brief GraphicsTablePropertiesEditor::on_m_table_font_pb_clicked
*/
@brief GraphicsTablePropertiesEditor::on_m_table_font_pb_clicked
*/
void GraphicsTablePropertiesEditor::on_m_table_font_pb_clicked()
{
if (m_table_item && m_table_item->model())
@@ -241,8 +241,8 @@ void GraphicsTablePropertiesEditor::on_m_table_font_pb_clicked()
}
/**
* @brief GraphicsTablePropertiesEditor::updateUi
*/
@brief GraphicsTablePropertiesEditor::updateUi
*/
void GraphicsTablePropertiesEditor::updateUi()
{
//Disconnect every connections of editor widgets
@@ -343,8 +343,8 @@ void GraphicsTablePropertiesEditor::updateInfoLabel()
}
/**
* @brief GraphicsTablePropertiesEditor::setUpEditConnection
*/
@brief GraphicsTablePropertiesEditor::setUpEditConnection
*/
void GraphicsTablePropertiesEditor::setUpEditConnection()
{
for (QMetaObject::Connection c : m_edit_connection) {
@@ -410,8 +410,8 @@ void GraphicsTablePropertiesEditor::on_m_next_pb_clicked()
}
/**
* @brief GraphicsTablePropertiesEditor::on_m_auto_geometry_pb_clicked
*/
@brief GraphicsTablePropertiesEditor::on_m_auto_geometry_pb_clicked
*/
void GraphicsTablePropertiesEditor::on_m_auto_geometry_pb_clicked()
{
if (m_table_item) {
@@ -420,8 +420,8 @@ void GraphicsTablePropertiesEditor::on_m_auto_geometry_pb_clicked()
}
/**
* @brief GraphicsTablePropertiesEditor::on_m_apply_geometry_to_linked_table_pb_clicked
*/
@brief GraphicsTablePropertiesEditor::on_m_apply_geometry_to_linked_table_pb_clicked
*/
void GraphicsTablePropertiesEditor::on_m_apply_geometry_to_linked_table_pb_clicked()
{
if (m_table_item.isNull() || !m_table_item->diagram() || (!m_table_item->nextTable() && !m_table_item->previousTable())) {

View File

@@ -32,9 +32,9 @@ class QUndoStack;
class QButtonGroup;
/**
* @brief The GraphicsTablePropertiesEditor class
* This widget is used to edit the property of both QetGraphicsTableItem and QetGraphicsHeaderItem
*/
@brief The GraphicsTablePropertiesEditor class
This widget is used to edit the property of both QetGraphicsTableItem and QetGraphicsHeaderItem
*/
class GraphicsTablePropertiesEditor : public PropertiesEditorWidget
{
Q_OBJECT

View File

@@ -25,10 +25,10 @@
#include <QDialogButtonBox>
/**
* @brief projectDBModelPropertiesWidget::projectDBModelPropertiesWidget
* @param model
* @param parent
*/
@brief projectDBModelPropertiesWidget::projectDBModelPropertiesWidget
@param model
@param parent
*/
ProjectDBModelPropertiesWidget::ProjectDBModelPropertiesWidget(ProjectDBModel *model, QWidget *parent) :
PropertiesEditorWidget(parent),
ui(new Ui::ProjectDBModelPropertiesWidget)
@@ -38,16 +38,16 @@ ProjectDBModelPropertiesWidget::ProjectDBModelPropertiesWidget(ProjectDBModel *m
}
/**
* @brief projectDBModelPropertiesWidget::~projectDBModelPropertiesWidget
*/
@brief projectDBModelPropertiesWidget::~projectDBModelPropertiesWidget
*/
ProjectDBModelPropertiesWidget::~ProjectDBModelPropertiesWidget() {
delete ui;
}
/**
* @brief projectDBModelPropertiesWidget::setModel
* @param model
*/
@brief projectDBModelPropertiesWidget::setModel
@param model
*/
void ProjectDBModelPropertiesWidget::setModel(ProjectDBModel *model) {
m_model = model;
ui->m_edit_query_pb->setEnabled(m_model);
@@ -55,8 +55,8 @@ void ProjectDBModelPropertiesWidget::setModel(ProjectDBModel *model) {
}
/**
* @brief projectDBModelPropertiesWidget::on_m_edit_query_pb_clicked
*/
@brief projectDBModelPropertiesWidget::on_m_edit_query_pb_clicked
*/
void ProjectDBModelPropertiesWidget::on_m_edit_query_pb_clicked()
{
QDialog d(this);

View File

@@ -27,9 +27,9 @@ class ProjectDBModelPropertiesWidget;
}
/**
* @brief The projectDBModelPropertiesWidget class
* This class is an editor for a NomenclatureModel
*/
@brief The projectDBModelPropertiesWidget class
This class is an editor for a NomenclatureModel
*/
class ProjectDBModelPropertiesWidget : public PropertiesEditorWidget
{
Q_OBJECT

View File

@@ -69,11 +69,11 @@ class ConductorXmlRetroCompatibility
};
/**
* @brief Conductor::Conductor
* Default constructor.
* @param p1 : first terminal of this conductor.
* @param p2 : second terminal of this conductor.
*/
@brief Conductor::Conductor
Default constructor.
@param p1 : first terminal of this conductor.
@param p2 : second terminal of this conductor.
*/
Conductor::Conductor(Terminal *p1, Terminal* p2) :
terminal1(p1),
terminal2(p2),
@@ -131,9 +131,9 @@ Conductor::Conductor(Terminal *p1, Terminal* p2) :
}
/**
* @brief Conductor::~Conductor
* Destructor. The conductor is removed from is terminal
*/
@brief Conductor::~Conductor
Destructor. The conductor is removed from is terminal
*/
Conductor::~Conductor()
{
removeHandler();
@@ -143,10 +143,10 @@ Conductor::~Conductor()
}
/**
* @brief Conductor::isValid
* @return true if conductor is valid else false;
* A non valid conductor, is a conductor without two terminal
*/
@brief Conductor::isValid
@return true if conductor is valid else false;
A non valid conductor, is a conductor without two terminal
*/
bool Conductor::isValid() const {
return m_valid;
}
@@ -171,9 +171,9 @@ void Conductor::updatePath(const QRectF &rect) {
}
/**
* @brief Conductor::segmentsToPath
* Generate the QPainterPath from the list of points
*/
@brief Conductor::segmentsToPath
Generate the QPainterPath from the list of points
*/
void Conductor::segmentsToPath()
{
QPainterPath path;
@@ -606,20 +606,20 @@ bool Conductor::valideXml(QDomElement &e){
}
/**
* @brief Conductor::mouseDoubleClickEvent
* Manage the mouse double click
* @param event
*/
@brief Conductor::mouseDoubleClickEvent
Manage the mouse double click
@param event
*/
void Conductor::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
event->accept();
editProperty();
}
/**
* @brief Conductor::mousePressEvent
* Manage the mouse press event
* @param event
*/
@brief Conductor::mousePressEvent
Manage the mouse press event
@param event
*/
void Conductor::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
QGraphicsObject::mousePressEvent(event);
@@ -629,9 +629,9 @@ void Conductor::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief Conductor::mouseReleaseEvent
* @param event
*/
@brief Conductor::mouseReleaseEvent
@param event
*/
void Conductor::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (!(event -> modifiers() & Qt::ControlModifier))
@@ -639,10 +639,10 @@ void Conductor::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief Conductor::hoverEnterEvent
* Manage the hover enter event
* @param event
*/
@brief Conductor::hoverEnterEvent
Manage the hover enter event
@param event
*/
void Conductor::hoverEnterEvent(QGraphicsSceneHoverEvent *event) {
Q_UNUSED(event);
m_mouse_over = true;
@@ -650,10 +650,10 @@ void Conductor::hoverEnterEvent(QGraphicsSceneHoverEvent *event) {
}
/**
* @brief Conductor::hoverLeaveEvent
* Manage the mouse leave event
* @param event
*/
@brief Conductor::hoverLeaveEvent
Manage the mouse leave event
@param event
*/
void Conductor::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
Q_UNUSED(event);
update();
@@ -661,11 +661,11 @@ void Conductor::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
}
/**
* @brief Conductor::itemChange
* @param change
* @param value
* @return
*/
@brief Conductor::itemChange
@param change
@param value
@return
*/
QVariant Conductor::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (change == QGraphicsItem::ItemSelectedChange)
@@ -702,11 +702,11 @@ QVariant Conductor::itemChange(GraphicsItemChange change, const QVariant &value)
}
/**
* @brief Conductor::sceneEventFilter
* @param watched
* @param event
* @return
*/
@brief Conductor::sceneEventFilter
@param watched
@param event
@return
*/
bool Conductor::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{
//Watched must be an handler
@@ -747,9 +747,9 @@ bool Conductor::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
}
/**
* @brief Conductor::adjusteHandlerPos
* Adjust the position of the handler item
*/
@brief Conductor::adjusteHandlerPos
Adjust the position of the handler item
*/
void Conductor::adjusteHandlerPos()
{
if (m_handler_vector.isEmpty())
@@ -764,10 +764,10 @@ void Conductor::adjusteHandlerPos()
}
/**
* @brief Conductor::handlerMousePressEvent
* @param qghi
* @param event
*/
@brief Conductor::handlerMousePressEvent
@param qghi
@param event
*/
void Conductor::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event);
@@ -787,10 +787,10 @@ void Conductor::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSc
}
/**
* @brief Conductor::handlerMouseMoveEvent
* @param qghi
* @param event
*/
@brief Conductor::handlerMouseMoveEvent
@param qghi
@param event
*/
void Conductor::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
if (m_moving_segment)
@@ -815,10 +815,10 @@ void Conductor::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSce
}
/**
* @brief Conductor::handlerMouseReleaseEvent
* @param qghi
* @param event
*/
@brief Conductor::handlerMouseReleaseEvent
@param qghi
@param event
*/
void Conductor::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event);
@@ -839,9 +839,9 @@ void Conductor::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphics
}
/**
* @brief Conductor::addHandler
* Add handlers for this item
*/
@brief Conductor::addHandler
Add handlers for this item
*/
void Conductor::addHandler()
{
if (m_handler_vector.isEmpty() && scene())
@@ -859,9 +859,9 @@ void Conductor::addHandler()
}
/**
* @brief Conductor::removeHandler
* Remove the handlers of this item
*/
@brief Conductor::removeHandler
Remove the handlers of this item
*/
void Conductor::removeHandler()
{
if (!m_handler_vector.isEmpty())
@@ -872,9 +872,9 @@ void Conductor::removeHandler()
}
/**
* @brief Conductor::boundingRect
* @return
*/
@brief Conductor::boundingRect
@return
*/
QRectF Conductor::boundingRect() const
{
QRectF br = shape().boundingRect();
@@ -882,10 +882,10 @@ QRectF Conductor::boundingRect() const
}
/**
* @brief Conductor::shape
* @return the shape of conductor.
* The shape thickness is bigger when conductor is hovered
*/
@brief Conductor::shape
@return the shape of conductor.
The shape thickness is bigger when conductor is hovered
*/
QPainterPath Conductor::shape() const
{
QPainterPathStroker pps;
@@ -898,9 +898,9 @@ QPainterPath Conductor::shape() const
}
/**
* @brief Conductor::nearShape
* @return : An area in which it is considered a point is near this conductor.
*/
@brief Conductor::nearShape
@return : An area in which it is considered a point is near this conductor.
*/
QPainterPath Conductor::nearShape() const
{
QPainterPathStroker pps;
@@ -968,11 +968,11 @@ void Conductor::pointsToSegments(const QList<QPointF>& points_list) {
}
/**
* @brief Conductor::fromXml
* Load the conductor and her information from xml element
* @param e
* @return true is loading success else return false
*/
@brief Conductor::fromXml
Load the conductor and her information from xml element
@param e
@return true is loading success else return false
*/
bool Conductor::fromXml(QDomElement &dom_element)
{
setPos(dom_element.attribute("x", nullptr).toDouble(),
@@ -1061,12 +1061,12 @@ QDomElement Conductor::toXml(QDomDocument &dom_document, QHash<Terminal *, int>
}
/**
* @brief Conductor::pathFromXml
* Generate the path (of the line) from xml file by checking the segments in the xml
* file
* @param e
* @return true if generate path success else return false
*/
@brief Conductor::pathFromXml
Generate the path (of the line) from xml file by checking the segments in the xml
file
@param e
@return true if generate path success else return false
*/
bool Conductor::pathFromXml(const QDomElement &e) {
// parcourt les elements XML "segment" et en extrait deux listes de longueurs
// les segments non valides sont ignores
@@ -1139,12 +1139,12 @@ bool Conductor::pathFromXml(const QDomElement &e) {
}
/**
* @brief Conductor::handlerPoints
* @return The points used to draw the handler square, used to modify
* the path of the conductor.
* The points stored in the QVector are the middle point of each segments that compose the conductor,
* at exception of the first and last segment because there just here to extend the terminal.
*/
@brief Conductor::handlerPoints
@return The points used to draw the handler square, used to modify
the path of the conductor.
The points stored in the QVector are the middle point of each segments that compose the conductor,
at exception of the first and last segment because there just here to extend the terminal.
*/
QVector<QPointF> Conductor::handlerPoints() const
{
QList <ConductorSegment *> sl = segmentsList();
@@ -1178,9 +1178,9 @@ const QList<ConductorSegment *> Conductor::segmentsList() const {
}
/**
* @brief Conductor::length
* @return the length of this conductor
*/
@brief Conductor::length
@return the length of this conductor
*/
qreal Conductor::length() const{
return path().length();
}
@@ -1206,11 +1206,11 @@ ConductorSegment *Conductor::middleSegment() {
}
/**
* @brief Conductor::posForText
* Calculate and return the better pos for text.
* @param flag : flag is used to know if text pos is near of
* a vertical or horizontal conductor segment.
*/
@brief Conductor::posForText
Calculate and return the better pos for text.
@param flag : flag is used to know if text pos is near of
a vertical or horizontal conductor segment.
*/
QPointF Conductor::posForText(Qt::Orientations &flag)
{
@@ -1277,11 +1277,11 @@ QPointF Conductor::posForText(Qt::Orientations &flag)
}
/**
* @brief Conductor::calculateTextItemPosition
* Move the text at middle of conductor (if is vertical or horizontal)
* otherwise, move conductor at the middle of the longest segment of conductor.
* If text was moved by user, this function do nothing, except check if text is near conductor.
*/
@brief Conductor::calculateTextItemPosition
Move the text at middle of conductor (if is vertical or horizontal)
otherwise, move conductor at the middle of the longest segment of conductor.
If text was moved by user, this function do nothing, except check if text is near conductor.
*/
void Conductor::calculateTextItemPosition()
{
if (!m_text_item || !diagram() || m_properties.type != ConductorProperties::Multi)
@@ -1440,10 +1440,10 @@ ConductorProfile Conductor::profile(Qt::Corner path_type) const {
}
/**
* @brief Conductor::refreshText
* Refresh the text of this conductor.
* recalcule and set the text according to the formula.
*/
@brief Conductor::refreshText
Refresh the text of this conductor.
recalcule and set the text according to the formula.
*/
void Conductor::refreshText()
{
if (m_freeze_label)
@@ -1489,13 +1489,13 @@ QPainterPath Conductor::path() const
}
/**
* @brief Conductor::setPropertiesToPotential
* @param properties
* @param only_text
* Set @propertie to conductor and every conductors in the same potential of @conductor.
* If @only_text is true only formula, text, function and tension/protocol is set
* to other conductor in the same potential, the other values of property stay unmodified
*/
@brief Conductor::setPropertiesToPotential
@param properties
@param only_text
Set @propertie to conductor and every conductors in the same potential of @conductor.
If @only_text is true only formula, text, function and tension/protocol is set
to other conductor in the same potential, the other values of property stay unmodified
*/
void Conductor::setPropertyToPotential(const ConductorProperties &property, bool only_text)
{
setProperties(property);
@@ -1522,10 +1522,10 @@ void Conductor::setPropertyToPotential(const ConductorProperties &property, bool
}
/**
* @brief Conductor::setProperties
* Set @property as current property of conductor
* @param properties : properties
*/
@brief Conductor::setProperties
Set @property as current property of conductor
@param properties : properties
*/
void Conductor::setProperties(const ConductorProperties &property)
{
if (m_properties == property) return;
@@ -1566,9 +1566,9 @@ void Conductor::setProperties(const ConductorProperties &property)
}
/**
* @brief Conductor::properties
* @return the properties of this Conductor
*/
@brief Conductor::properties
@return the properties of this Conductor
*/
ConductorProperties Conductor::properties() const
{
return(m_properties);
@@ -1590,10 +1590,10 @@ void Conductor::setHighlighted(Conductor::Highlight hl) {
}
/**
* @brief Conductor::displayedTextChanged
* Update the properties (text) of this conductor and other conductors
* at the same potential of this conductor.
*/
@brief Conductor::displayedTextChanged
Update the properties (text) of this conductor and other conductors
at the same potential of this conductor.
*/
void Conductor::displayedTextChanged()
{
QVariant old_value, new_value;
@@ -1627,14 +1627,14 @@ void Conductor::displayedTextChanged()
/**
* @brief Conductor::relatedPotentialConductors
* Return all conductors at the same potential of this conductor, this conductor isn't
* part of the returned QSet.
* @param all_diagram : if true search in all diagram of the project,
* false search only in the parent diagram of this conductor
* @param t_list, a list of terminal already found for this potential.
* @return a QSet of conductor at the same potential.
*/
@brief Conductor::relatedPotentialConductors
Return all conductors at the same potential of this conductor, this conductor isn't
part of the returned QSet.
@param all_diagram : if true search in all diagram of the project,
false search only in the parent diagram of this conductor
@param t_list, a list of terminal already found for this potential.
@return a QSet of conductor at the same potential.
*/
QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram, QList <Terminal *> *t_list)
{
bool declar_t_list = false;
@@ -1688,9 +1688,9 @@ QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram,
}
/**
* @brief Conductor::diagramEditor
* @return The parent diagram editor or nullptr;
*/
@brief Conductor::diagramEditor
@return The parent diagram editor or nullptr;
*/
QETDiagramEditor* Conductor::diagramEditor() const {
if (!diagram()) return nullptr;
if (diagram() -> views().isEmpty()) return nullptr;
@@ -1703,8 +1703,8 @@ QETDiagramEditor* Conductor::diagramEditor() const {
}
/**
* @brief Conductor::editProperty
*/
@brief Conductor::editProperty
*/
void Conductor::editProperty() {
ConductorPropertiesDialog::PropertiesDialog(this, diagramEditor());
}
@@ -1716,11 +1716,11 @@ void Conductor::setSequenceNum(const autonum::sequentialNumbers& sn)
}
/**
* @brief Conductor::setUpConnectionForFormula
* setup connection according to the variable of formula
* @param old_formula
* @param new_formula
*/
@brief Conductor::setUpConnectionForFormula
setup connection according to the variable of formula
@param old_formula
@param new_formula
*/
void Conductor::setUpConnectionForFormula(QString old_formula, QString new_formula)
{
if (diagram())
@@ -1909,9 +1909,9 @@ ConductorProfilesGroup Conductor::profiles() const {
}
/**
* @brief Conductor::setProfiles
* @param cpg : the new profils of conductor
*/
@brief Conductor::setProfiles
@param cpg : the new profils of conductor
*/
void Conductor::setProfiles(const ConductorProfilesGroup &cpg) {
conductor_profiles = cpg;
if (conductor_profiles[currentPathType()].isNull()) {
@@ -1988,11 +1988,11 @@ QPointF Conductor::movePointIntoPolygon(const QPointF &point, const QPainterPath
}
/**
* @brief longuestConductorInPotential
* @param conductor : a conductor in the potential to search
* @param all_diagram : true -> search in the whole project, false -> search only in the diagram of conductor
* @return the longuest conductor in the same potential of conductor
*/
@brief longuestConductorInPotential
@param conductor : a conductor in the potential to search
@param all_diagram : true -> search in the whole project, false -> search only in the diagram of conductor
@return the longuest conductor in the same potential of conductor
*/
Conductor * longuestConductorInPotential(Conductor *conductor, bool all_diagram) {
Conductor *longuest_conductor = conductor;
//Search the longuest conductor
@@ -2004,11 +2004,11 @@ Conductor * longuestConductorInPotential(Conductor *conductor, bool all_diagram)
}
/**
* @brief relatedConductors
* @param conductor
* @return return all conductors who share the same terminals of @conductor given as parametre,
* except @conductor himself.
*/
@brief relatedConductors
@param conductor
@return return all conductors who share the same terminals of @conductor given as parametre,
except @conductor himself.
*/
QList <Conductor *> relatedConductors(const Conductor *conductor) {
QList<Conductor *> other_conductors_list = conductor -> terminal1 -> conductors();
other_conductors_list << conductor -> terminal2->conductors();
@@ -2017,11 +2017,11 @@ QList <Conductor *> relatedConductors(const Conductor *conductor) {
}
/**
* @brief Conductor::setFreezeLabel
* Freeze this conductor label if true
* Unfreeze this conductor label if false
* @param freeze
*/
@brief Conductor::setFreezeLabel
Freeze this conductor label if true
Unfreeze this conductor label if false
@param freeze
*/
void Conductor::setFreezeLabel(bool freeze)
{
m_freeze_label = freeze;

View File

@@ -68,10 +68,12 @@ class Conductor : public QGraphicsObject
Terminal *terminal2;
public:
/**
* Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a conductor.
* @return the QGraphicsItem type
*/
/**
@brief type
Enable the use of qgraphicsitem_cast
to safely cast a QGraphicsItem into a conductor.
@return the QGraphicsItem type
*/
int type() const override { return Type; }
Diagram *diagram() const;
ConductorTextItem *textItem() const;

View File

@@ -62,10 +62,10 @@ Conductor *ConductorTextItem::parentConductor() const {
}
/**
* @brief ConductorTextItem::fromXml
* Read the properties stored in the xml element given in parameter
* @param e
*/
@brief ConductorTextItem::fromXml
Read the properties stored in the xml element given in parameter
@param e
*/
void ConductorTextItem::fromXml(const QDomElement &e) {
if (e.hasAttribute("userx")) {
setPos(e.attribute("userx").toDouble(),
@@ -87,9 +87,9 @@ bool ConductorTextItem::wasMovedByUser() const {
}
/**
* @brief ConductorTextItem::wasRotateByUser
* @return true if text was explicit moved by user else false
*/
@brief ConductorTextItem::wasRotateByUser
@return true if text was explicit moved by user else false
*/
bool ConductorTextItem::wasRotateByUser() const {
return(rotate_by_user_);
}
@@ -110,11 +110,11 @@ void ConductorTextItem::forceMovedByUser(bool moved_by_user) {
}
/**
* @brief ConductorTextItem::forceRotateByUser
* @param rotate_by_user true pour que la rotation du texte soit consideree
@brief ConductorTextItem::forceRotateByUser
@param rotate_by_user true pour que la rotation du texte soit consideree
comme ayant ete definie par l'utilisateur (et donc soit sauvegardee), false
pour remettre le texte a sont angle originelle
*/
*/
void ConductorTextItem::forceRotateByUser(bool rotate_by_user) {
if (rotate_by_user == rotate_by_user_) return;
@@ -125,9 +125,9 @@ void ConductorTextItem::forceRotateByUser(bool rotate_by_user) {
}
/**
* @brief ConductorTextItem::setPos
* @param pos
*/
@brief ConductorTextItem::setPos
@param pos
*/
void ConductorTextItem::setPos(const QPointF &pos)
{
/*
@@ -149,10 +149,10 @@ void ConductorTextItem::setPos(const QPointF &pos)
}
/**
* @brief ConductorTextItem::setPos
* @param x
* @param y
*/
@brief ConductorTextItem::setPos
@param x
@param y
*/
void ConductorTextItem::setPos(qreal x, qreal y)
{
QPointF p(x,y);
@@ -160,18 +160,18 @@ void ConductorTextItem::setPos(qreal x, qreal y)
}
/**
* @brief ConductorTextItem::mousePressEvent
* @param event
*/
@brief ConductorTextItem::mousePressEvent
@param event
*/
void ConductorTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
before_mov_pos_ = pos();
DiagramTextItem::mousePressEvent(event);
}
/**
* @brief ConductorTextItem::mouseMoveEvent
* @param event
*/
@brief ConductorTextItem::mouseMoveEvent
@param event
*/
void ConductorTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
if (textInteractionFlags() & Qt::TextEditable) QGraphicsTextItem::mouseMoveEvent(event);
@@ -194,9 +194,9 @@ void ConductorTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
}
/**
* @brief ConductorTextItem::mouseReleaseEvent
* @param e
*/
@brief ConductorTextItem::mouseReleaseEvent
@param e
*/
void ConductorTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
if (flags() & QGraphicsItem::ItemIsMovable) {

View File

@@ -21,10 +21,10 @@
#include "imagepropertieswidget.h"
/**
* @brief DiagramImageItem::DiagramImageItem
* Constructor without pixmap
* @param parent_item the parent graphics item
*/
@brief DiagramImageItem::DiagramImageItem
Constructor without pixmap
@param parent_item the parent graphics item
*/
DiagramImageItem::DiagramImageItem(QetGraphicsItem *parent_item):
QetGraphicsItem(parent_item)
{
@@ -32,11 +32,11 @@ DiagramImageItem::DiagramImageItem(QetGraphicsItem *parent_item):
}
/**
* @brief DiagramImageItem::DiagramImageItem
* Constructor with pixmap
* @param pixmap the pixmap to be draw
* @param parent_item the parent graphic item
*/
@brief DiagramImageItem::DiagramImageItem
Constructor with pixmap
@param pixmap the pixmap to be draw
@param parent_item the parent graphic item
*/
DiagramImageItem::DiagramImageItem(const QPixmap &pixmap, QetGraphicsItem *parent_item):
QetGraphicsItem(parent_item),
pixmap_(pixmap)
@@ -46,19 +46,19 @@ DiagramImageItem::DiagramImageItem(const QPixmap &pixmap, QetGraphicsItem *paren
}
/**
* @brief DiagramImageItem::~DiagramImageItem
* Destructor
*/
@brief DiagramImageItem::~DiagramImageItem
Destructor
*/
DiagramImageItem::~DiagramImageItem() {
}
/**
* @brief DiagramImageItem::paint
* Draw the pixmap.
* @param painter the Qpainter to use for draw the pixmap
* @param option the style option
* @param widget the QWidget where we draw the pixmap
*/
@brief DiagramImageItem::paint
Draw the pixmap.
@param painter the Qpainter to use for draw the pixmap
@param option the style option
@param widget the QWidget where we draw the pixmap
*/
void DiagramImageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
painter -> drawPixmap(pixmap_.rect(),pixmap_);
@@ -80,9 +80,9 @@ void DiagramImageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *
}
/**
* @brief DiagramImageItem::editProperty
* Open the approriate dialog to edit this image
*/
@brief DiagramImageItem::editProperty
Open the approriate dialog to edit this image
*/
void DiagramImageItem::editProperty()
{
if (diagram() -> isReadOnly()) return;
@@ -91,21 +91,21 @@ void DiagramImageItem::editProperty()
}
/**
* @brief DiagramImageItem::setPixmap
* Set the new pixmap to be draw
* @param pixmap the new pixmap
*/
@brief DiagramImageItem::setPixmap
Set the new pixmap to be draw
@param pixmap the new pixmap
*/
void DiagramImageItem::setPixmap(const QPixmap &pixmap) {
pixmap_ = pixmap;
setTransformOriginPoint(boundingRect().center());
}
/**
* @brief DiagramImageItem::boundingRect
* the outer bounds of the item as a rectangle,
* if no pixmap are set, return a default QRectF
* @return a QRectF represent the bounding rectangle
*/
@brief DiagramImageItem::boundingRect
the outer bounds of the item as a rectangle,
if no pixmap are set, return a default QRectF
@return a QRectF represent the bounding rectangle
*/
QRectF DiagramImageItem::boundingRect() const {
if (!pixmap_.isNull()) {
return (QRectF(pixmap_.rect()));
@@ -116,19 +116,19 @@ QRectF DiagramImageItem::boundingRect() const {
}
/**
* @brief DiagramImageItem::name
* @return the generic name of this item (picture)
*/
@brief DiagramImageItem::name
@return the generic name of this item (picture)
*/
QString DiagramImageItem::name() const {
return tr("une image");
}
/**
* @brief DiagramImageItem::fromXml
* Load this image fro xml elemebt @e
* @param e
* @return true if succesfully load.
*/
@brief DiagramImageItem::fromXml
Load this image fro xml elemebt @e
@param e
@return true if succesfully load.
*/
bool DiagramImageItem::fromXml(const QDomElement &e)
{
if (e.tagName() != "image") {

View File

@@ -22,18 +22,18 @@
#include "diagram.h"
/**
* @brief DiagramTextItem::DiagramTextItem
* @param parent : parent item
*/
@brief DiagramTextItem::DiagramTextItem
@param parent : parent item
*/
DiagramTextItem::DiagramTextItem(QGraphicsItem *parent) :
QGraphicsTextItem(parent)
{ build(); }
/**
* @brief DiagramTextItem::DiagramTextItem
* @param text : text to display
* @param parent : parent item
*/
@brief DiagramTextItem::DiagramTextItem
@param text : text to display
@param parent : parent item
*/
DiagramTextItem::DiagramTextItem(const QString &text, QGraphicsItem *parent) :
QGraphicsTextItem(text, parent),
m_mouse_hover(false),
@@ -41,9 +41,9 @@ DiagramTextItem::DiagramTextItem(const QString &text, QGraphicsItem *parent) :
{ build(); }
/**
* @brief DiagramTextItem::build
* Build this item with default value
*/
@brief DiagramTextItem::build
Build this item with default value
*/
void DiagramTextItem::build()
{
//set Zvalue at 10 to be upper than the DiagramImageItem
@@ -57,19 +57,19 @@ void DiagramTextItem::build()
}
/**
* @brief DiagramTextItem::diagram
* @return The diagram of this item or 0 if this text isn't in a diagram
*/
@brief DiagramTextItem::diagram
@return The diagram of this item or 0 if this text isn't in a diagram
*/
Diagram *DiagramTextItem::diagram() const {
return(qobject_cast<Diagram *>(scene()));
}
/**
* @brief DiagramTextItem::toXml
* This method do nothing and return an empty DomElement
* This is used to be inherited by child class
* @return
*/
@brief DiagramTextItem::toXml
This method do nothing and return an empty DomElement
This is used to be inherited by child class
@return
*/
QDomElement DiagramTextItem::toXml(QDomDocument &) const {
return QDomElement();
}
@@ -186,9 +186,9 @@ Qt::Alignment DiagramTextItem::alignment() const
}
/**
* @brief DiagramTextItem::frameRect
* @return the rect used to draw a frame around this text
*/
@brief DiagramTextItem::frameRect
@return the rect used to draw a frame around this text
*/
QRectF DiagramTextItem::frameRect() const
{
//Get the bounding rectangle of the text
@@ -226,13 +226,13 @@ bool DiagramTextItem::isHtml() const {
}
/**
* @brief DiagramTextItem::paint
* Draw this text field. This method draw the text by calling QGraphicsTextItem::paint.
* If text is hovered, this method draw the bounding rect in grey
* @param painter : painter to use
* @param option : style option
* @param widget : widget where must to draw
*/
@brief DiagramTextItem::paint
Draw this text field. This method draw the text by calling QGraphicsTextItem::paint.
If text is hovered, this method draw the bounding rect in grey
@param painter : painter to use
@param option : style option
@param widget : widget where must to draw
*/
void DiagramTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
painter -> setRenderHint(QPainter::Antialiasing, false);
@@ -261,9 +261,9 @@ void DiagramTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
}
/**
* @brief DiagramTextItem::focusInEvent
* @param e
*/
@brief DiagramTextItem::focusInEvent
@param e
*/
void DiagramTextItem::focusInEvent(QFocusEvent *event)
{
QGraphicsTextItem::focusInEvent(event);
@@ -275,9 +275,9 @@ void DiagramTextItem::focusInEvent(QFocusEvent *event)
}
/**
* @brief DiagramTextItem::focusOutEvent
* @param event
*/
@brief DiagramTextItem::focusOutEvent
@param event
*/
void DiagramTextItem::focusOutEvent(QFocusEvent *event)
{
QGraphicsTextItem::focusOutEvent(event);
@@ -313,9 +313,9 @@ void DiagramTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
}
/**
* @brief DiagramTextItem::mousePressEvent
* @param event
*/
@brief DiagramTextItem::mousePressEvent
@param event
*/
void DiagramTextItem::mousePressEvent (QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
@@ -328,9 +328,9 @@ void DiagramTextItem::mousePressEvent (QGraphicsSceneMouseEvent *event)
}
/**
* @brief DiagramTextItem::mouseMoveEvent
* @param event
*/
@brief DiagramTextItem::mouseMoveEvent
@param event
*/
void DiagramTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
if (textInteractionFlags() & Qt::TextEditable) QGraphicsTextItem::mouseMoveEvent(event);
@@ -359,9 +359,9 @@ void DiagramTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
}
/**
* @brief DiagramTextItem::mouseReleaseEvent
* @param event
*/
@brief DiagramTextItem::mouseReleaseEvent
@param event
*/
void DiagramTextItem::mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
{
//Signal to diagram movement is finish
@@ -394,19 +394,19 @@ void DiagramTextItem::applyRotation(const qreal &angle) {
}
/**
* @brief DiagramTextItem::prepareAlignment
* Call this function before changing the bounding rect of this text.
*/
@brief DiagramTextItem::prepareAlignment
Call this function before changing the bounding rect of this text.
*/
void DiagramTextItem::prepareAlignment()
{
m_alignment_rect = boundingRect();
}
/**
* @brief DiagramTextItem::finishAlignment
* Call this function after changing the bouding rect of this text
* to set the position of this text according to the alignment property.
*/
@brief DiagramTextItem::finishAlignment
Call this function after changing the bouding rect of this text
to set the position of this text according to the alignment property.
*/
void DiagramTextItem::finishAlignment()
{
if(m_block_alignment)
@@ -448,8 +448,8 @@ void DiagramTextItem::finishAlignment()
}
/**
* @brief Edit the text with HtmlEditor
*/
@brief Edit the text with HtmlEditor
*/
void DiagramTextItem::edit()
{
QWidget *parent = nullptr;

View File

@@ -31,10 +31,10 @@
#include <QGraphicsSceneMouseEvent>
/**
* @brief DynamicElementTextItem::DynamicElementTextItem
* Constructor
* @param parent_element
*/
@brief DynamicElementTextItem::DynamicElementTextItem
Constructor
@param parent_element
*/
DynamicElementTextItem::DynamicElementTextItem(Element *parent_element) :
m_parent_element(parent_element),
m_uuid(QUuid::createUuid())
@@ -66,9 +66,9 @@ DynamicElementTextItem::~DynamicElementTextItem()
{}
/**
* @brief DynamicElementTextItem::textFromMetaEnum
* @return The QMetaEnum of the enum TextFrom
*/
@brief DynamicElementTextItem::textFromMetaEnum
@return The QMetaEnum of the enum TextFrom
*/
QMetaEnum DynamicElementTextItem::textFromMetaEnum()
{
DynamicElementTextItem deti;
@@ -79,11 +79,11 @@ DynamicElementTextItem::DynamicElementTextItem()
{}
/**
* @brief DynamicElementTextItem::toXml
* Export this text to xml
* @param dom_doc
* @return
*/
@brief DynamicElementTextItem::toXml
Export this text to xml
@param dom_doc
@return
*/
QDomElement DynamicElementTextItem::toXml(QDomDocument &dom_doc) const
{
QDomElement root_element = dom_doc.createElement(xmlTagName());
@@ -147,10 +147,10 @@ QDomElement DynamicElementTextItem::toXml(QDomDocument &dom_doc) const
}
/**
* @brief DynamicElementTextItem::fromXml
* Import this text from xml
* @param dom_elmt
*/
@brief DynamicElementTextItem::fromXml
Import this text from xml
@param dom_elmt
*/
void DynamicElementTextItem::fromXml(const QDomElement &dom_elmt)
{
if (dom_elmt.tagName() != xmlTagName()) {
@@ -219,20 +219,20 @@ void DynamicElementTextItem::fromXml(const QDomElement &dom_elmt)
}
/**
* @brief DynamicElementTextItem::ParentElement
* @return a pointer to the parent element. Note the pointer can be null.
* Note that the text can return a parent element,
* even if the text belong to a group of this same element.
*/
@brief DynamicElementTextItem::ParentElement
@return a pointer to the parent element. Note the pointer can be null.
Note that the text can return a parent element,
even if the text belong to a group of this same element.
*/
Element *DynamicElementTextItem::parentElement() const {
return m_parent_element;
}
/**
* @brief DynamicElementTextItem::parentGroup
* @return The group where this text belong, if this item
* is note in a group, return nullptr.
*/
@brief DynamicElementTextItem::parentGroup
@return The group where this text belong, if this item
is note in a group, return nullptr.
*/
ElementTextItemGroup *DynamicElementTextItem::parentGroup() const
{
if(parentItem())
@@ -245,16 +245,16 @@ ElementTextItemGroup *DynamicElementTextItem::parentGroup() const
}
/**
* @brief DynamicElementTextItem::elementUseForInfo
* @return a pointer to the element we must use for the variable information.
* If this text is owned by a simple element, the simple element is returned, this is the same element returned by the function parentElement().
* If this text is owned by a master element, the master element is returned, this is the same element returned by the function parentElement().
* If this text is owned by a report element, the report element is returned, this is the same element returned by the function parentElement().
* If this text is owned by a terminal element, the terminal element is returned, this is the same element returned by the function parentElement().
* If this text is owned by a slave element, we return the master element set as master of the parent slave element,
* if the parent slave is not linked to a master, this function return a nullptr.
* If this text have no parent element, return nullptr
*/
@brief DynamicElementTextItem::elementUseForInfo
@return a pointer to the element we must use for the variable information.
If this text is owned by a simple element, the simple element is returned, this is the same element returned by the function parentElement().
If this text is owned by a master element, the master element is returned, this is the same element returned by the function parentElement().
If this text is owned by a report element, the report element is returned, this is the same element returned by the function parentElement().
If this text is owned by a terminal element, the terminal element is returned, this is the same element returned by the function parentElement().
If this text is owned by a slave element, we return the master element set as master of the parent slave element,
if the parent slave is not linked to a master, this function return a nullptr.
If this text have no parent element, return nullptr
*/
Element *DynamicElementTextItem::elementUseForInfo() const
{
Element *elmt = parentElement();
@@ -286,10 +286,10 @@ Element *DynamicElementTextItem::elementUseForInfo() const
}
/**
* @brief DynamicElementTextItem::refreshLabelConnection
* Refresh the connection of this text when the source of text is label,
* or composite text, with a variable %{label}
*/
@brief DynamicElementTextItem::refreshLabelConnection
Refresh the connection of this text when the source of text is label,
or composite text, with a variable %{label}
*/
void DynamicElementTextItem::refreshLabelConnection()
{
if ((m_text_from == ElementInfo && m_info_name == "label") ||
@@ -309,18 +309,18 @@ void DynamicElementTextItem::refreshLabelConnection()
}
/**
* @brief DynamicElementTextItem::textFrom
* @return what the final text is created from.
*/
@brief DynamicElementTextItem::textFrom
@return what the final text is created from.
*/
DynamicElementTextItem::TextFrom DynamicElementTextItem::textFrom() const {
return m_text_from;
}
/**
* @brief DynamicElementTextItem::setTextFrom
* Set the final text is created from.
* @param text_from
*/
@brief DynamicElementTextItem::setTextFrom
Set the final text is created from.
@param text_from
*/
void DynamicElementTextItem::setTextFrom(DynamicElementTextItem::TextFrom text_from)
{
if(m_text_from == text_from)
@@ -372,18 +372,18 @@ void DynamicElementTextItem::setTextFrom(DynamicElementTextItem::TextFrom text_f
}
/**
* @brief DynamicElementTextItem::text
* @return the text of this text
*/
@brief DynamicElementTextItem::text
@return the text of this text
*/
QString DynamicElementTextItem::text() const {
return m_text;
}
/**
* @brief DynamicElementTextItem::setText
* Set the text of this text
* @param formula
*/
@brief DynamicElementTextItem::setText
Set the text of this text
@param formula
*/
void DynamicElementTextItem::setText(const QString &text)
{
m_text = text;
@@ -393,10 +393,10 @@ void DynamicElementTextItem::setText(const QString &text)
}
/**
* @brief DynamicElementTextItem::setInfoName
* Set the information name of the parent element.
* @param info_name
*/
@brief DynamicElementTextItem::setInfoName
Set the information name of the parent element.
@param info_name
*/
void DynamicElementTextItem::setInfoName(const QString &info_name)
{
QString old_info_name = m_info_name;
@@ -439,18 +439,18 @@ void DynamicElementTextItem::setInfoName(const QString &info_name)
}
/**
* @brief DynamicElementTextItem::infoName
* @return the info name of this text
*/
@brief DynamicElementTextItem::infoName
@return the info name of this text
*/
QString DynamicElementTextItem::infoName() const {
return m_info_name;
}
/**
* @brief DynamicElementTextItem::setCompositeText
* Set the composite text of this text item to @text
* @param text
*/
@brief DynamicElementTextItem::setCompositeText
Set the composite text of this text item to @text
@param text
*/
void DynamicElementTextItem::setCompositeText(const QString &text)
{
QString old_composite_text = m_composite_text;
@@ -495,9 +495,9 @@ void DynamicElementTextItem::setCompositeText(const QString &text)
}
/**
* @brief DynamicElementTextItem::compositeText
* @return
*/
@brief DynamicElementTextItem::compositeText
@return
*/
QString DynamicElementTextItem::compositeText() const
{
return m_composite_text;
@@ -521,9 +521,9 @@ QUuid DynamicElementTextItem::uuid() const
}
/**
* @brief DynamicElementTextItem::mousePressEvent
* @param event
*/
@brief DynamicElementTextItem::mousePressEvent
@param event
*/
void DynamicElementTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
//The text become selected, we set the real color, otherwise the editor will display the color of text as blue,
@@ -540,9 +540,9 @@ void DynamicElementTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief DynamicElementTextItem::mouseMoveEvent
* @param event
*/
@brief DynamicElementTextItem::mouseMoveEvent
@param event
*/
void DynamicElementTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
if((event->buttons() & Qt::LeftButton) && (flags() & ItemIsMovable))
@@ -576,9 +576,9 @@ void DynamicElementTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief DynamicElementTextItem::mouseReleaseEvent
* @param event
*/
@brief DynamicElementTextItem::mouseReleaseEvent
@param event
*/
void DynamicElementTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (m_parent_element)
@@ -592,12 +592,12 @@ void DynamicElementTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief DynamicElementTextItem::mouseDoubleClickEvent
* Reimplemented functions, for add extra feature when this text is owned by a slave.
* In this case if the parent slave element is linked to a master, and this text display the label of the master
* (both if the 'text from' is 'element info' or 'composite text') the QGraphicsView go to master and select it.
* @param event
*/
@brief DynamicElementTextItem::mouseDoubleClickEvent
Reimplemented functions, for add extra feature when this text is owned by a slave.
In this case if the parent slave element is linked to a master, and this text display the label of the master
(both if the 'text from' is 'element info' or 'composite text') the QGraphicsView go to master and select it.
@param event
*/
void DynamicElementTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
DiagramTextItem::mouseDoubleClickEvent(event);
@@ -605,12 +605,12 @@ void DynamicElementTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *eve
}
/**
* @brief DynamicElementTextItem::hoverEnterEvent
* If the parent element of this text is a folio report or a slave element, the element is linked
* and the text display the variable "label" we set the text blue for signal the user that the text act like
* a link when we double click on.
* @param event
*/
@brief DynamicElementTextItem::hoverEnterEvent
If the parent element of this text is a folio report or a slave element, the element is linked
and the text display the variable "label" we set the text blue for signal the user that the text act like
a link when we double click on.
@param event
*/
void DynamicElementTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
DiagramTextItem::hoverEnterEvent(event);
@@ -632,9 +632,9 @@ void DynamicElementTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
}
/**
* @brief DynamicElementTextItem::hoverLeaveEvent
* @param event
*/
@brief DynamicElementTextItem::hoverLeaveEvent
@param event
*/
void DynamicElementTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
DiagramTextItem::hoverLeaveEvent(event);
@@ -806,10 +806,10 @@ void DynamicElementTextItem::elementInfoChanged()
}
/**
* @brief DynamicElementTextItem::masterChanged
* This function is only use when the parent element is a slave.
* Call when the master element linked to the parent slave element of this text change
*/
@brief DynamicElementTextItem::masterChanged
This function is only use when the parent element is a slave.
Call when the master element linked to the parent slave element of this text change
*/
void DynamicElementTextItem::masterChanged()
{
//First we remove the old connection
@@ -834,10 +834,10 @@ void DynamicElementTextItem::masterChanged()
}
/**
* @brief DynamicElementTextItem::reportChanged
* This function is only use when parent element of this text is a folio report
* The linked report of the parent element was changed
*/
@brief DynamicElementTextItem::reportChanged
This function is only use when parent element of this text is a folio report
The linked report of the parent element was changed
*/
void DynamicElementTextItem::reportChanged()
{
/*
@@ -880,9 +880,9 @@ void DynamicElementTextItem::reportChanged()
}
/**
* @brief DynamicElementTextItem::reportFormulaChanged
* The report formula use in the project was changed
*/
@brief DynamicElementTextItem::reportFormulaChanged
The report formula use in the project was changed
*/
void DynamicElementTextItem::reportFormulaChanged()
{
m_report_formula = parentElement()->diagram()->project()->defaultReportProperties();
@@ -947,9 +947,9 @@ void DynamicElementTextItem::removeConnectionForReportFormula(const QString &for
}
/**
* @brief DynamicElementTextItem::setupFormulaConnection
* Setup the required connection for the formula of the label.
*/
@brief DynamicElementTextItem::setupFormulaConnection
Setup the required connection for the formula of the label.
*/
void DynamicElementTextItem::setupFormulaConnection()
{
if ((m_text_from == ElementInfo && m_info_name == "label") ||
@@ -1006,9 +1006,9 @@ void DynamicElementTextItem::updateReportFormulaConnection()
}
/**
* @brief DynamicElementTextItem::updateReportText
* This function is only use when this text is owned by a report, and this text have for info the Label.
*/
@brief DynamicElementTextItem::updateReportText
This function is only use when this text is owned by a report, and this text have for info the Label.
*/
void DynamicElementTextItem::updateReportText()
{
if(!(m_parent_element.data()->linkType() & Element::AllReport))
@@ -1034,11 +1034,11 @@ void DynamicElementTextItem::updateReportText()
}
/**
* @brief DynamicElementTextItem::updateLabel
* Update the displayed text, when this dynamic text is based on the label of the parent element.
* This function is notably use when the label itself is based from a formula.
* If this dynamic text isn't based on label, this function do nothing.
*/
@brief DynamicElementTextItem::updateLabel
Update the displayed text, when this dynamic text is based on the label of the parent element.
This function is notably use when the label itself is based from a formula.
If this dynamic text isn't based on label, this function do nothing.
*/
void DynamicElementTextItem::updateLabel()
{
if ((m_text_from == ElementInfo && m_info_name == "label") ||
@@ -1061,10 +1061,10 @@ void DynamicElementTextItem::updateLabel()
}
/**
* @brief DynamicElementTextItem::conductorWasAdded
* Function only use when parent element is a folio report
* @param conductor
*/
@brief DynamicElementTextItem::conductorWasAdded
Function only use when parent element is a folio report
@param conductor
*/
void DynamicElementTextItem::conductorWasAdded(Conductor *conductor)
{
Q_UNUSED(conductor)
@@ -1072,10 +1072,10 @@ void DynamicElementTextItem::conductorWasAdded(Conductor *conductor)
}
/**
* @brief DynamicElementTextItem::conductorWasRemoved
* Function only use when parent element is a folio report
* @param conductor
*/
@brief DynamicElementTextItem::conductorWasRemoved
Function only use when parent element is a folio report
@param conductor
*/
void DynamicElementTextItem::conductorWasRemoved(Conductor *conductor)
{
if(m_watched_conductor.data() == conductor)
@@ -1087,10 +1087,10 @@ void DynamicElementTextItem::conductorWasRemoved(Conductor *conductor)
}
/**
* @brief DynamicElementTextItem::setPotentialConductor
* This function is only used when the parent element of this text is a report element
* Get a conductor in the potential of the parent report
*/
@brief DynamicElementTextItem::setPotentialConductor
This function is only used when the parent element of this text is a report element
Get a conductor in the potential of the parent report
*/
void DynamicElementTextItem::setPotentialConductor()
{
if(parentElement() && (parentElement()->linkType() & Element::AllReport))
@@ -1137,9 +1137,9 @@ void DynamicElementTextItem::setPotentialConductor()
}
/**
* @brief DynamicElementTextItem::conductorPropertiesChanged
* This function is only used when the parent element of this text is a report element
*/
@brief DynamicElementTextItem::conductorPropertiesChanged
This function is only used when the parent element of this text is a report element
*/
void DynamicElementTextItem::conductorPropertiesChanged()
{
if(m_parent_element && (m_parent_element.data()->linkType() & Element::AllReport))
@@ -1162,11 +1162,11 @@ void DynamicElementTextItem::conductorPropertiesChanged()
}
/**
* @brief DynamicElementTextItem::reportReplacedCompositeText
* This function is only used when the parent element of this text is a report element
* @return the composite text with the variable replaced by the real value.
* If the parent element of this text is not a folio report, return a default QString.
*/
@brief DynamicElementTextItem::reportReplacedCompositeText
This function is only used when the parent element of this text is a report element
@return the composite text with the variable replaced by the real value.
If the parent element of this text is not a folio report, return a default QString.
*/
QString DynamicElementTextItem::reportReplacedCompositeText() const
{
QString string;
@@ -1199,10 +1199,10 @@ QString DynamicElementTextItem::reportReplacedCompositeText() const
}
/**
* @brief DynamicElementTextItem::zoomToLinkedElement
* If the parent element is a folio report or a slave element,
* and is linked, zoom to the linked element
*/
@brief DynamicElementTextItem::zoomToLinkedElement
If the parent element is a folio report or a slave element,
and is linked, zoom to the linked element
*/
void DynamicElementTextItem::zoomToLinkedElement()
{
if(!parentElement())
@@ -1245,9 +1245,9 @@ void DynamicElementTextItem::zoomToLinkedElement()
}
/**
* @brief DynamicElementTextItem::updateXref
* Create or delete the Xref according to the current properties of the project
*/
@brief DynamicElementTextItem::updateXref
Create or delete the Xref according to the current properties of the project
*/
void DynamicElementTextItem::updateXref()
{
if(diagram())

View File

@@ -30,11 +30,11 @@ class ElementTextItemGroup;
class CrossRefItem;
/**
* @brief The DynamicElementTextItem class
* This class provide a simple text field of element who can be added or removed directly from the diagram editor.
* This text is created to compensate a big lack of the ElementTextItem : ElementTextItem can't be added or removed directly in the diagram editor
*
*/
@brief The DynamicElementTextItem class
This class provide a simple text field of element who can be added or removed directly from the diagram editor.
This text is created to compensate a big lack of the ElementTextItem : ElementTextItem can't be added or removed directly in the diagram editor
*/
class DynamicElementTextItem : public DiagramTextItem
{
friend class DynamicTextItemDelegate;

View File

@@ -70,11 +70,11 @@ class ElementXmlRetroCompatibility
};
/**
* @brief Element::Element
* @param location, location of this element
* @param parent, parent graphics item
* @param state, state of the instanciation
*/
@brief Element::Element
@param location, location of this element
@param parent, parent graphics item
@param state, state of the instanciation
*/
Element::Element(const ElementsLocation &location,
QGraphicsItem *parent,
int *state,
@@ -120,8 +120,8 @@ Element::Element(const ElementsLocation &location,
}
/**
* @brief Element::~Element
*/
@brief Element::~Element
*/
Element::~Element()
{
qDeleteAll (m_dynamic_text_list);
@@ -129,19 +129,19 @@ Element::~Element()
}
/**
* @brief Element::terminals
* @return the list of terminals of this element.
*/
@brief Element::terminals
@return the list of terminals of this element.
*/
QList<Terminal *> Element::terminals() const {
return m_terminals;
}
/**
* @brief Element::conductors
* @return The list of conductors docked to this element
* the list is sorted according to the position of the terminal where the conductor is docked
* from top to bottom, and left to right.
*/
@brief Element::conductors
@return The list of conductors docked to this element
the list is sorted according to the position of the terminal where the conductor is docked
from top to bottom, and left to right.
*/
QList<Conductor *> Element::conductors() const
{
QList<Conductor *> conductors;
@@ -179,10 +179,10 @@ void Element::setHighlighted(bool hl) {
}
/**
* @brief Element::displayHelpLine
* Display the help line of each terminal if b is true
* @param b
*/
@brief Element::displayHelpLine
Display the help line of each terminal if b is true
@param b
*/
void Element::displayHelpLine(bool b)
{
foreach (Terminal *t, terminals())
@@ -190,11 +190,11 @@ void Element::displayHelpLine(bool b)
}
/**
* @brief Element::paint
* @param painter
* @param options
* @param widget
*/
@brief Element::paint
@param painter
@param options
@param widget
*/
void Element::paint(QPainter *painter,
const QStyleOptionGraphicsItem *options,
QWidget *)
@@ -224,13 +224,13 @@ QRectF Element::boundingRect() const {
}
/**
* @brief Element::setSize
* Define the size of the element.
* The size must be a multiple of 10.
* If not, the dimensions indicated will be arrrondies to higher tens.
* @param wid
* @param hei
*/
@brief Element::setSize
Define the size of the element.
The size must be a multiple of 10.
If not, the dimensions indicated will be arrrondies to higher tens.
@param wid
@param hei
*/
void Element::setSize(int wid, int hei)
{
prepareGeometryChange();
@@ -273,9 +273,9 @@ QPoint Element::hotspot() const {
}
/**
* @brief Element::pixmap
* @return the pixmap of this element
*/
@brief Element::pixmap
@return the pixmap of this element
*/
QPixmap Element::pixmap() {
return ElementPictureFactory::instance()->pixmap(m_location);
}
@@ -306,7 +306,7 @@ void Element::drawAxes(QPainter *painter,
Dessine le cadre de selection de l'element de maniere systematiquement non antialiasee.
@param painter Le QPainter a utiliser pour dessiner les bornes.
@param options Les options de style a prendre en compte
*/
*/
void Element::drawSelection(QPainter *painter,
const QStyleOptionGraphicsItem *options) {
Q_UNUSED(options);
@@ -332,7 +332,7 @@ void Element::drawSelection(QPainter *painter,
Dessine le cadre de selection de l'element de maniere systematiquement non antialiasee.
@param painter Le QPainter a utiliser pour dessiner les bornes.
@param options Les options de style a prendre en compte
*/
*/
void Element::drawHighlight(QPainter *painter,
const QStyleOptionGraphicsItem *options) {
Q_UNUSED(options);
@@ -359,19 +359,19 @@ void Element::drawHighlight(QPainter *painter,
}
/**
* @brief Element::buildFromXml
* Build this element from an xml description
* @param xml_def_elmt
* @param state
* Optional pointer which define the status of build
* 0 - evreything all right
* 4 - xml isn't a "definition"
* 5 - attribute of the definition isn't present or valid
* 6 - the definition is empty
* 7 - parsing of a xml node who describe a graphical part failed.
* 8 - No part of the drawing could be loaded
* @return
*/
@brief Element::buildFromXml
Build this element from an xml description
@param xml_def_elmt
@param state
Optional pointer which define the status of build
0 - evreything all right
4 - xml isn't a "definition"
5 - attribute of the definition isn't present or valid
6 - the definition is empty
7 - parsing of a xml node who describe a graphical part failed.
8 - No part of the drawing could be loaded
@return
*/
bool Element::buildFromXml(const QDomElement &xml_def_elmt, int *state)
{
m_state = QET::GIBuildingFromXml;
@@ -517,11 +517,11 @@ bool Element::buildFromXml(const QDomElement &xml_def_elmt, int *state)
}
/**
* @brief Element::parseElement
* Parse the element of the xml description of this element
* @param dom
* @return
*/
@brief Element::parseElement
Parse the element of the xml description of this element
@param dom
@return
*/
bool Element::parseElement(const QDomElement &dom)
{
if (dom.tagName() == "terminal") return(parseTerminal(dom));
@@ -531,13 +531,13 @@ bool Element::parseElement(const QDomElement &dom)
}
/**
* @brief Element::parseInput
* Parse the input (old text field)
* the parsed input are converted to dynamic text field, this function
* is only here to keep compatibility with old text.
* @param dom_element
* @return
*/
@brief Element::parseInput
Parse the input (old text field)
the parsed input are converted to dynamic text field, this function
is only here to keep compatibility with old text.
@param dom_element
@return
*/
bool Element::parseInput(const QDomElement &dom_element)
{
qreal pos_x, pos_y;
@@ -588,11 +588,11 @@ bool Element::parseInput(const QDomElement &dom_element)
}
/**
* @brief Element::parseDynamicText
* Create the dynamic text field describ in @dom_element
* @param dom_element
* @return
*/
@brief Element::parseDynamicText
Create the dynamic text field describ in @dom_element
@param dom_element
@return
*/
DynamicElementTextItem *Element::parseDynamicText(
const QDomElement &dom_element)
{
@@ -610,11 +610,11 @@ DynamicElementTextItem *Element::parseDynamicText(
}
/*!
* \brief Element::parseTerminal
* Parse partTerminal from xml structure
* \param dom_element
* \return
*/
\brief Element::parseTerminal
Parse partTerminal from xml structure
\param dom_element
\return
*/
Terminal *Element::parseTerminal(const QDomElement &dom_element)
{
@@ -668,18 +668,18 @@ bool Element::valideXml(QDomElement &e) {
}
/**
* @brief Element::fromXml
* Import the parameters of this element from a xml document.
* When call this function ensure this element is already in a scene, because
* the dynamic text item and element text item group (in the xml file) are created in this function
* and need a diagram for create their Xref, when this element is linked to another.
* If not the Xref can be not displayed, until the next call of update Xref of the group or text item.
* @param e : the dom element where the parameter is stored
* @param table_id_adr : Reference to the mapping table between IDs of the XML file
* and the addresses in memory. If the import succeeds, it must be add the right couples (id, address).
* @param handle_inputs_rotation : apply the rotation of this element to his child text
* @return
*/
@brief Element::fromXml
Import the parameters of this element from a xml document.
When call this function ensure this element is already in a scene, because
the dynamic text item and element text item group (in the xml file) are created in this function
and need a diagram for create their Xref, when this element is linked to another.
If not the Xref can be not displayed, until the next call of update Xref of the group or text item.
@param e : the dom element where the parameter is stored
@param table_id_adr : Reference to the mapping table between IDs of the XML file
and the addresses in memory. If the import succeeds, it must be add the right couples (id, address).
@param handle_inputs_rotation : apply the rotation of this element to his child text
@return
*/
bool Element::fromXml(QDomElement &e,
QHash<int,
Terminal *> &table_id_adr,
@@ -1245,11 +1245,11 @@ QDomElement Element::toXml(QDomDocument &document,
}
/**
* @brief Element::addDynamiqueTextItem
* Add @deti as a dynamic text item of this element, @deti is reparented to this
* If @deti is null, a new DynamicElementTextItem is created and added to this element.
* @param deti
*/
@brief Element::addDynamiqueTextItem
Add @deti as a dynamic text item of this element, @deti is reparented to this
If @deti is null, a new DynamicElementTextItem is created and added to this element.
@param deti
*/
void Element::addDynamicTextItem(DynamicElementTextItem *deti)
{
if (deti && !m_dynamic_text_list.contains(deti))
@@ -1267,11 +1267,11 @@ void Element::addDynamicTextItem(DynamicElementTextItem *deti)
}
/**
* @brief Element::removeDynamicTextItem
* Remove @deti, no matter if is a child of this element or a child of a group of this element.
* Set he parent item of @deti to 0, @deti is not deleted.
* @param deti
*/
@brief Element::removeDynamicTextItem
Remove @deti, no matter if is a child of this element or a child of a group of this element.
Set he parent item of @deti to 0, @deti is not deleted.
@param deti
*/
void Element::removeDynamicTextItem(DynamicElementTextItem *deti)
{
if (m_dynamic_text_list.contains(deti))
@@ -1296,23 +1296,23 @@ void Element::removeDynamicTextItem(DynamicElementTextItem *deti)
}
/**
* @brief Element::dynamicTextItems
* @return all dynamic text items of this element directly child of this element.
* Texts in text-groups belonging to this element are not returned by this function.
* @see ElementTextItemGroup::texts
*/
@brief Element::dynamicTextItems
@return all dynamic text items of this element directly child of this element.
Texts in text-groups belonging to this element are not returned by this function.
@see ElementTextItemGroup::texts
*/
QList<DynamicElementTextItem *> Element::dynamicTextItems() const {
return m_dynamic_text_list;
}
/**
* @brief Element::addTextGroup
* Create and add an element text item group to this element.
* If this element already have a group with the same name,
* then @name will renamed to name1 or name2 etc....
* @param name : the name of the group
* @return the created group.
*/
@brief Element::addTextGroup
Create and add an element text item group to this element.
If this element already have a group with the same name,
then @name will renamed to name1 or name2 etc....
@param name : the name of the group
@return the created group.
*/
ElementTextItemGroup *Element::addTextGroup(const QString &name)
{
if(m_texts_group.isEmpty())
@@ -1341,10 +1341,10 @@ ElementTextItemGroup *Element::addTextGroup(const QString &name)
}
/**
* @brief Element::addTextGroup
* @param group add group @group to the group of this element.
* the group must not be owned by an element.
*/
@brief Element::addTextGroup
@param group add group @group to the group of this element.
the group must not be owned by an element.
*/
void Element::addTextGroup(ElementTextItemGroup *group)
{
if(group->parentElement())
@@ -1356,12 +1356,12 @@ void Element::addTextGroup(ElementTextItemGroup *group)
}
/**
* @brief Element::removeTextGroup
* Remove the text group @group from this element, and set the parent of group to 0.
* group is not deleted.
* All texts owned by the group will be reparented to this element
* @param name
*/
@brief Element::removeTextGroup
Remove the text group @group from this element, and set the parent of group to 0.
group is not deleted.
All texts owned by the group will be reparented to this element
@param name
*/
void Element::removeTextGroup(ElementTextItemGroup *group)
{
if(!m_texts_group.contains(group))
@@ -1386,11 +1386,11 @@ void Element::removeTextGroup(ElementTextItemGroup *group)
}
/**
* @brief Element::textGroup
* @param name
* @return the text group named @name or nullptr if this element
* haven't got a group with this name
*/
@brief Element::textGroup
@param name
@return the text group named @name or nullptr if this element
haven't got a group with this name
*/
ElementTextItemGroup *Element::textGroup(const QString &name) const
{
for (ElementTextItemGroup *group : m_texts_group)
@@ -1401,21 +1401,21 @@ ElementTextItemGroup *Element::textGroup(const QString &name) const
}
/**
* @brief Element::textGroups
* @return All texts groups of this element
*/
@brief Element::textGroups
@return All texts groups of this element
*/
QList<ElementTextItemGroup *> Element::textGroups() const
{
return m_texts_group;
}
/**
* @brief Element::addTextToGroup
* Add the text @text to the group @group;
* If @group isn't owned by this element return false.
* The text must be a text of this element.
* @return : true if the text was succesfully added to the group.
*/
@brief Element::addTextToGroup
Add the text @text to the group @group;
If @group isn't owned by this element return false.
The text must be a text of this element.
@return : true if the text was succesfully added to the group.
*/
bool Element::addTextToGroup(DynamicElementTextItem *text,
ElementTextItemGroup *group)
{
@@ -1434,10 +1434,10 @@ bool Element::addTextToGroup(DynamicElementTextItem *text,
}
/**
* @brief Element::removeTextFromGroup
* Remove the text @text from the group @group, en reparent @text to this element
* @return true if text was succesfully removed
*/
@brief Element::removeTextFromGroup
Remove the text @text from the group @group, en reparent @text to this element
@return true if text was succesfully removed
*/
bool Element::removeTextFromGroup(DynamicElementTextItem *text,
ElementTextItemGroup *group)
{
@@ -1456,13 +1456,13 @@ bool Element::removeTextFromGroup(DynamicElementTextItem *text,
}
/**
* @brief Element::AlignedFreeTerminals
* @return a list of terminal (owned by this element) aligned to other terminal (from other element)
* The first Terminal of QPair is a Terminal owned by this element,
* this terminal haven't got any conductor docked.
* The second Terminal of QPair is a Terminal owned by an other element,
* which is aligned with the first Terminal. The second Terminal can have or not docked conductors.
*/
@brief Element::AlignedFreeTerminals
@return a list of terminal (owned by this element) aligned to other terminal (from other element)
The first Terminal of QPair is a Terminal owned by this element,
this terminal haven't got any conductor docked.
The second Terminal of QPair is a Terminal owned by an other element,
which is aligned with the first Terminal. The second Terminal can have or not docked conductors.
*/
QList <QPair <Terminal *, Terminal *> > Element::AlignedFreeTerminals() const
{
QList <QPair <Terminal *, Terminal *> > list;
@@ -1482,14 +1482,14 @@ QList <QPair <Terminal *, Terminal *> > Element::AlignedFreeTerminals() const
}
/**
* @brief Element::initLink
* Initialise the link between this element and other elements.
* This method can be call once because init the link according to
* uuid store in a private list, after link, the list is clear, so
* call another time do nothing.
@brief Element::initLink
Initialise the link between this element and other elements.
This method can be call once because init the link according to
uuid store in a private list, after link, the list is clear, so
call another time do nothing.
*
* @param prj, ownership project of this element and other element to be linked
*/
@param prj, ownership project of this element and other element to be linked
*/
void Element::initLink(QETProject *prj)
{
// if nothing to link return now
@@ -1524,11 +1524,11 @@ QString Element::linkTypeToString() const
}
/**
* @brief Element::setElementInformations
* Set new information for this element.
* If new information is different of current infotmation emit @elementInfoChange
* @param dc
*/
@brief Element::setElementInformations
Set new information for this element.
If new information is different of current infotmation emit @elementInfoChange
@param dc
*/
void Element::setElementInformations(DiagramContext dc)
{
if (m_element_informations == dc) {
@@ -1542,12 +1542,12 @@ void Element::setElementInformations(DiagramContext dc)
}
/**
* @brief comparPos
* Compare position of the two elements. Compare 3 points:
* 1 folio - 2 row - 3 line
* returns a response when a comparison is found.
* @return true if elmt1 is at lower position than elmt 2, else false
*/
@brief comparPos
Compare position of the two elements. Compare 3 points:
1 folio - 2 row - 3 line
returns a response when a comparison is found.
@return true if elmt1 is at lower position than elmt 2, else false
*/
bool comparPos(const Element *elmt1, const Element *elmt2) {
//Compare folio first
if (elmt1->diagram()->folioIndex() != elmt2->diagram()->folioIndex())
@@ -1570,9 +1570,9 @@ bool comparPos(const Element *elmt1, const Element *elmt2) {
}
/**
* @brief Element::mouseMoveEvent
* @param event
*/
@brief Element::mouseMoveEvent
@param event
*/
void Element::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
QetGraphicsItem::mouseMoveEvent(event);
@@ -1583,9 +1583,9 @@ void Element::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief Element::mouseReleaseEvent
* @param event
*/
@brief Element::mouseReleaseEvent
@param event
*/
void Element::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
QetGraphicsItem::mouseReleaseEvent(event);
@@ -1596,10 +1596,10 @@ void Element::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
/**
* When mouse over element
* change m_mouse_over to true (used in paint() function )
* Also highlight linked elements
* @param e QGraphicsSceneHoverEvent
When mouse over element
change m_mouse_over to true (used in paint() function )
Also highlight linked elements
@param e QGraphicsSceneHoverEvent
*/
void Element::hoverEnterEvent(QGraphicsSceneHoverEvent *e) {
Q_UNUSED(e)
@@ -1613,10 +1613,10 @@ void Element::hoverEnterEvent(QGraphicsSceneHoverEvent *e) {
}
/**
* When mouse over element leave the position
* change m_mouse_over to false(used in paint() function )
* Also un-highlight linked elements
* @param e QGraphicsSceneHoverEvent
When mouse over element leave the position
change m_mouse_over to false(used in paint() function )
Also un-highlight linked elements
@param e QGraphicsSceneHoverEvent
*/
void Element::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) {
Q_UNUSED(e)
@@ -1629,11 +1629,11 @@ void Element::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) {
}
/**
* @brief Element::setUpFormula
* Set up the formula used to create the label of this element
* @param : if true set tagged text to code letter (ex K for coil) with condition :
* formula is empty, text tagged "label" is emptty or "_";
*/
@brief Element::setUpFormula
Set up the formula used to create the label of this element
@param : if true set tagged text to code letter (ex K for coil) with condition :
formula is empty, text tagged "label" is emptty or "_";
*/
void Element::setUpFormula(bool code_letter)
{
Q_UNUSED(code_letter)
@@ -1676,34 +1676,34 @@ void Element::setUpFormula(bool code_letter)
}
/**
* @brief Element::getPrefix
* get Element Prefix
*/
@brief Element::getPrefix
get Element Prefix
*/
QString Element::getPrefix() const{
return m_prefix;
}
/**
* @brief Element::setPrefix
* set Element Prefix
*/
@brief Element::setPrefix
set Element Prefix
*/
void Element::setPrefix(QString prefix) {
m_prefix = std::move(prefix);
}
/**
* @brief Element::freezeLabel
* Freeze this element label
*/
@brief Element::freezeLabel
Freeze this element label
*/
void Element::freezeLabel(bool freeze)
{
m_freeze_label = freeze;
}
/**
* @brief Element::freezeNewAddedElement
* Freeze this label if needed
*/
@brief Element::freezeNewAddedElement
Freeze this label if needed
*/
void Element::freezeNewAddedElement() {
if (this->diagram()->freezeNewElements()
|| this->diagram()->project()->isFreezeNewElements()) {
@@ -1713,11 +1713,11 @@ void Element::freezeNewAddedElement() {
}
/**
* @brief Element::actualLabel
* Always return the current label to be displayed.
* This function is usefull when label is based on formula, because label can change at any time.
* @return
*/
@brief Element::actualLabel
Always return the current label to be displayed.
This function is usefull when label is based on formula, because label can change at any time.
@return
*/
QString Element::actualLabel()
{
if (m_element_informations.value("formula").toString().isEmpty()) {
@@ -1733,9 +1733,9 @@ QString Element::actualLabel()
}
/**
* @brief Element::name
* @return the human name of this element
*/
@brief Element::name
@return the human name of this element
*/
QString Element::name() const {
return m_names.name(m_location.baseName());
}

View File

@@ -46,7 +46,7 @@ class Element : public QetGraphicsItem
/**
* @brief The kind enum
* Used to know the kind of this element (master, slave, report ect...)
*/
*/
enum kind {Simple = 1,
NextReport = 2,
PreviousReport = 4,
@@ -68,7 +68,7 @@ class Element : public QetGraphicsItem
/**
* Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into an Element.
* @return the QGraphicsItem type
*/
*/
enum { Type = UserType + 1000 };
int type() const override { return Type; }
@@ -243,7 +243,7 @@ inline int Element::orientation() const {
/**
* @brief Element::uuid
* @return the uuid of this element
*/
*/
inline QUuid Element::uuid() const {
return m_uuid;
}
@@ -251,7 +251,7 @@ inline QUuid Element::uuid() const {
/**
* @brief Element::linkedElements
* @return the list of linked elements, the list is sorted by position
*/
*/
inline QList <Element *> Element::linkedElements() {
std::sort(connected_elements.begin(),
connected_elements.end(),

View File

@@ -36,9 +36,9 @@ bool sorting(QGraphicsItem *qgia, QGraphicsItem *qgib)
}
/**
* @brief ElementTextItemGroup::ElementTextItemGroup
* @param parent
*/
@brief ElementTextItemGroup::ElementTextItemGroup
@param parent
*/
ElementTextItemGroup::ElementTextItemGroup(const QString &name, Element *parent) :
QGraphicsItemGroup(parent),
m_name(name),
@@ -52,9 +52,9 @@ ElementTextItemGroup::~ElementTextItemGroup()
{}
/**
* @brief ElementTextItemGroup::addToGroup
* @param item
*/
@brief ElementTextItemGroup::addToGroup
@param item
*/
void ElementTextItemGroup::addToGroup(QGraphicsItem *item)
{
if(item->type() == DynamicElementTextItem::Type)
@@ -83,9 +83,9 @@ void ElementTextItemGroup::addToGroup(QGraphicsItem *item)
}
/**
* @brief ElementTextItemGroup::removeFromGroup
* @param item
*/
@brief ElementTextItemGroup::removeFromGroup
@param item
*/
void ElementTextItemGroup::removeFromGroup(QGraphicsItem *item)
{
QGraphicsItemGroup::removeFromGroup(item);
@@ -114,21 +114,21 @@ void ElementTextItemGroup::removeFromGroup(QGraphicsItem *item)
}
/**
* @brief ElementTextItemGroup::blockAlignmentUpdate
* If true, the texts in this group are never aligned, moved, rotated etc...
* the texts stay as it was, until blockAlignmentUpdate is set to false.
* @param block
*/
@brief ElementTextItemGroup::blockAlignmentUpdate
If true, the texts in this group are never aligned, moved, rotated etc...
the texts stay as it was, until blockAlignmentUpdate is set to false.
@param block
*/
void ElementTextItemGroup::blockAlignmentUpdate(bool block)
{
m_block_alignment_update = block;
}
/**
* @brief ElementTextItemGroup::setAlignement
* Set the alignement of this group
* @param alignement
*/
@brief ElementTextItemGroup::setAlignement
Set the alignement of this group
@param alignement
*/
void ElementTextItemGroup::setAlignment(Qt::Alignment alignement)
{
m_alignment = alignement;
@@ -142,11 +142,11 @@ Qt::Alignment ElementTextItemGroup::alignment() const
}
/**
* @brief ElementTextItemGroup::setAlignment
* Update the alignement of the items in this group, according
* to the current alignement.
* @param alignement
*/
@brief ElementTextItemGroup::setAlignment
Update the alignement of the items in this group, according
to the current alignement.
@param alignement
*/
void ElementTextItemGroup::updateAlignment()
{
if(m_block_alignment_update)
@@ -235,11 +235,11 @@ void ElementTextItemGroup::updateAlignment()
}
/**
* @brief ElementTextItemGroup::setVerticalAdjustment
* Set the value of the vertical adjustment to @v.
* The vertical adjutment is use to adjust the space between the texts of this group.
* @param v
*/
@brief ElementTextItemGroup::setVerticalAdjustment
Set the value of the vertical adjustment to @v.
The vertical adjutment is use to adjust the space between the texts of this group.
@param v
*/
void ElementTextItemGroup::setVerticalAdjustment(int v)
{
prepareGeometryChange();
@@ -249,9 +249,9 @@ void ElementTextItemGroup::setVerticalAdjustment(int v)
}
/**
* @brief ElementTextItemGroup::setName
* @param name Set the name of this group
*/
@brief ElementTextItemGroup::setName
@param name Set the name of this group
*/
void ElementTextItemGroup::setName(QString name)
{
m_name = std::move(name);
@@ -311,9 +311,9 @@ bool ElementTextItemGroup::frame() const {
}
/**
* @brief ElementTextItemGroup::texts
* @return Every texts in this group
*/
@brief ElementTextItemGroup::texts
@return Every texts in this group
*/
QList<DynamicElementTextItem *> ElementTextItemGroup::texts() const
{
QList<DynamicElementTextItem *> list;
@@ -326,9 +326,9 @@ QList<DynamicElementTextItem *> ElementTextItemGroup::texts() const
}
/**
* @brief ElementTextItemGroup::diagram
* @return The diagram of this group, or nullptr if this group is not in a diagram
*/
@brief ElementTextItemGroup::diagram
@return The diagram of this group, or nullptr if this group is not in a diagram
*/
Diagram *ElementTextItemGroup::diagram() const
{
if(scene())
@@ -338,9 +338,9 @@ Diagram *ElementTextItemGroup::diagram() const
}
/**
* @brief ElementTextItemGroup::parentElement
* @return The parent element of this group or nullptr
*/
@brief ElementTextItemGroup::parentElement
@return The parent element of this group or nullptr
*/
Element *ElementTextItemGroup::parentElement() const
{
if(parentItem() && parentItem()->type() == Element::Type)
@@ -350,11 +350,11 @@ Element *ElementTextItemGroup::parentElement() const
}
/**
* @brief ElementTextItemGroup::toXml
* Export data of this group to xml
* @param dom_document
* @return
*/
@brief ElementTextItemGroup::toXml
Export data of this group to xml
@param dom_document
@return
*/
QDomElement ElementTextItemGroup::toXml(QDomDocument &dom_document) const
{
QDomElement dom_element = dom_document.createElement(this->xmlTaggName());
@@ -385,10 +385,10 @@ QDomElement ElementTextItemGroup::toXml(QDomDocument &dom_document) const
}
/**
* @brief ElementTextItemGroup::fromXml
* Import data of this group from xml
* @param dom_element
*/
@brief ElementTextItemGroup::fromXml
Import data of this group from xml
@param dom_element
*/
void ElementTextItemGroup::fromXml(QDomElement &dom_element)
{
if (dom_element.tagName() != xmlTaggName()) {
@@ -430,11 +430,11 @@ void ElementTextItemGroup::fromXml(QDomElement &dom_element)
}
/**
* @brief ElementTextItemGroup::paint
* @param painter
* @param option
* @param widget
*/
@brief ElementTextItemGroup::paint
@param painter
@param option
@param widget
*/
void ElementTextItemGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option);
@@ -484,9 +484,9 @@ void ElementTextItemGroup::paint(QPainter *painter, const QStyleOptionGraphicsIt
}
/**
* @brief ElementTextItemGroup::boundingRect
* @return
*/
@brief ElementTextItemGroup::boundingRect
@return
*/
QRectF ElementTextItemGroup::boundingRect() const
{
//If we refer to the Qt doc, the bounding rect of a QGraphicsItemGroup,
@@ -530,9 +530,9 @@ void ElementTextItemGroup::setPos(qreal x, qreal y)
}
/**
* @brief ElementTextItemGroup::mousePressEvent
* @param event
*/
@brief ElementTextItemGroup::mousePressEvent
@param event
*/
void ElementTextItemGroup::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if(event->button() == Qt::LeftButton)
@@ -546,9 +546,9 @@ void ElementTextItemGroup::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief ElementTextItemGroup::mouseMoveEvent
* @param event
*/
@brief ElementTextItemGroup::mouseMoveEvent
@param event
*/
void ElementTextItemGroup::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
if((event->buttons() & Qt::LeftButton) && (flags() & ItemIsMovable))
@@ -582,9 +582,9 @@ void ElementTextItemGroup::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief ElementTextItemGroup::mouseReleaseEvent
* @param event
*/
@brief ElementTextItemGroup::mouseReleaseEvent
@param event
*/
void ElementTextItemGroup::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if(diagram())
@@ -631,9 +631,9 @@ void ElementTextItemGroup::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event
}
/**
* @brief ElementTextItemGroup::keyPressEvent
* @param event
*/
@brief ElementTextItemGroup::keyPressEvent
@param event
*/
void ElementTextItemGroup::keyPressEvent(QKeyEvent *event)
{
if(event->modifiers() == Qt::ControlModifier)

View File

@@ -28,10 +28,10 @@ class Diagram;
class CrossRefItem;
/**
* @brief The ElementTextItemGroup class
* This class represent a group of element text
* Texts in the group can be aligned left / center /right
*/
@brief The ElementTextItemGroup class
This class represent a group of element text
Texts in the group can be aligned left / center /right
*/
class ElementTextItemGroup : public QObject, public QGraphicsItemGroup
{
Q_OBJECT

View File

@@ -22,31 +22,31 @@
#include <QRegularExpression>
/**
* @brief MasterElement::MasterElement
* Default constructor
* @param location location of xml definition
* @param qgi parent QGraphicItem
* @param s parent diagram
* @param state int used to know if the creation of element have error
*/
@brief MasterElement::MasterElement
Default constructor
@param location location of xml definition
@param qgi parent QGraphicItem
@param s parent diagram
@param state int used to know if the creation of element have error
*/
MasterElement::MasterElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
Element(location, qgi, state, Element::Master)
{}
/**
* @brief MasterElement::~MasterElement
* default destructor
*/
@brief MasterElement::~MasterElement
default destructor
*/
MasterElement::~MasterElement() {
unlinkAllElements();
}
/**
* @brief MasterElement::linkToElement
* Link this master to another element
* For this class element must be a slave
* @param elmt
*/
@brief MasterElement::linkToElement
Link this master to another element
For this class element must be a slave
@param elmt
*/
void MasterElement::linkToElement(Element *elmt)
{
// check if element is slave and if isn't already linked
@@ -65,9 +65,9 @@ void MasterElement::linkToElement(Element *elmt)
}
/**
* @brief MasterElement::unlinkAllElements
* Unlink all of the element in the QList connected_elements
*/
@brief MasterElement::unlinkAllElements
Unlink all of the element in the QList connected_elements
*/
void MasterElement::unlinkAllElements()
{
// if this element is free no need to do something
@@ -80,10 +80,10 @@ void MasterElement::unlinkAllElements()
}
/**
* @brief MasterElement::unlinkElement
* Unlink the given elmt in parametre
* @param elmt element to unlink from this
*/
@brief MasterElement::unlinkElement
Unlink the given elmt in parametre
@param elmt element to unlink from this
*/
void MasterElement::unlinkElement(Element *elmt)
{
//Ensure elmt is linked to this element
@@ -99,21 +99,21 @@ void MasterElement::unlinkElement(Element *elmt)
}
/**
* @brief MasterElement::initLink
* @param project
* Call init Link from custom element and after
* call update label for setup it.
*/
@brief MasterElement::initLink
@param project
Call init Link from custom element and after
call update label for setup it.
*/
void MasterElement::initLink(QETProject *project) {
//Create the link with other element if needed
Element::initLink(project);
}
/**
* @brief MasterElement::XrefBoundingRect
* @return The bounding rect of the Xref, if this element
* haven't got a xref, return a default QRectF
*/
@brief MasterElement::XrefBoundingRect
@return The bounding rect of the Xref, if this element
haven't got a xref, return a default QRectF
*/
QRectF MasterElement::XrefBoundingRect() const
{
if(m_Xref_item)
@@ -149,15 +149,15 @@ void MasterElement::xrefPropertiesChanged()
}
/**
* @brief MasterElement::aboutDeleteXref
* Check if Xref item must be displayed, if not, delete it.
* If Xref item is deleted or already not used (nullptr) return true;
* Else return false if Xref item is used
* NOTICE : Xref can display nothing but not be deleted so far.
* For exemple, if Xref is display has cross, only power contact are linked and
* option show power contact is disable, the cross isn't draw.
* @return
*/
@brief MasterElement::aboutDeleteXref
Check if Xref item must be displayed, if not, delete it.
If Xref item is deleted or already not used (nullptr) return true;
Else return false if Xref item is used
NOTICE : Xref can display nothing but not be deleted so far.
For exemple, if Xref is display has cross, only power contact are linked and
option show power contact is disable, the cross isn't draw.
@return
*/
void MasterElement::aboutDeleteXref()
{
if(!m_Xref_item)

View File

@@ -23,11 +23,11 @@
class CrossRefItem;
/**
* @brief The MasterElement class
* This class is a custom element, with extended behavior
* to be a master element. Master element can be linked with slave element
* and display a cross ref item for know with what other element he is linked
*/
@brief The MasterElement class
This class is a custom element, with extended behavior
to be a master element. Master element can be linked with slave element
and display a cross ref item for know with what other element he is linked
*/
class MasterElement : public Element
{
Q_OBJECT

View File

@@ -19,11 +19,11 @@
#include "diagram.h"
/**
* @brief QetGraphicsItem::QetGraphicsItem Default constructor
* @param uuid, uuid of the item
* @param diagram, diagram aka QGraphicsScene of the item
* @param parent, Parent Item
*/
@brief QetGraphicsItem::QetGraphicsItem Default constructor
@param uuid, uuid of the item
@param diagram, diagram aka QGraphicsScene of the item
@param parent, Parent Item
*/
QetGraphicsItem::QetGraphicsItem(QGraphicsItem *parent):
QGraphicsObject(parent),
is_movable_(true),
@@ -35,18 +35,18 @@ QetGraphicsItem::~QetGraphicsItem()
{}
/**
* @brief QetGraphicsItem::diagram
@brief QetGraphicsItem::diagram
*return the diagram of this item
*/
*/
Diagram* QetGraphicsItem::diagram() const{
return(qobject_cast<Diagram *>(scene()));
}
/**
* @brief QetGraphicsItem::setPos
@brief QetGraphicsItem::setPos
*set the position of the item to p
* @param p the new position of item
*/
@param p the new position of item
*/
void QetGraphicsItem::setPos(const QPointF &p) {
QPointF pp = Diagram::snapToGrid(p);
if (pp == pos() || !is_movable_)
@@ -55,28 +55,28 @@ void QetGraphicsItem::setPos(const QPointF &p) {
}
/**
* @brief QetGraphicsItem::setPos
@brief QetGraphicsItem::setPos
*set the position of the item
* @param x new abscisse of item
* @param y new ordonne of item
*/
@param x new abscisse of item
@param y new ordonne of item
*/
void QetGraphicsItem::setPos(qreal x, qreal y) {
setPos(QPointF(x, y));
}
/**
* @brief QetGraphicsItem::state
* @return the current state of this item
*/
@brief QetGraphicsItem::state
@return the current state of this item
*/
QET::GraphicsItemState QetGraphicsItem::state() const {
return m_state;
}
/**
* @brief QetGraphicsItem::mousePressEvent
@brief QetGraphicsItem::mousePressEvent
*handle the mouse click
* @param event
*/
@param event
*/
void QetGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
@@ -91,10 +91,10 @@ void QetGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief QetGraphicsItem::mouseDoubleClickEvent
@brief QetGraphicsItem::mouseDoubleClickEvent
*handle the mouse double click
* @param event
*/
@param event
*/
void QetGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
editProperty();
@@ -102,10 +102,10 @@ void QetGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief QetGraphicsItem::mouseMoveEvent
@brief QetGraphicsItem::mouseMoveEvent
*handle mouse movement
* @param event
*/
@param event
*/
void QetGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
if (isSelected() && event->buttons() & Qt::LeftButton)
@@ -143,10 +143,10 @@ void QetGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief QetGraphicsItem::mouseReleaseEvent
@brief QetGraphicsItem::mouseReleaseEvent
*handle mouse release click
* @param e
*/
@param e
*/
void QetGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (diagram()) {

View File

@@ -28,13 +28,13 @@
#include "qeticons.h"
/**
* @brief QetShapeItem::QetShapeItem
* Constructor of shape item. point 1 and 2 must be in scene coordinate
* @param p1 first point
* @param p2 second point
* @param type type of item (line, rectangle, ellipse)
* @param parent parent item
*/
@brief QetShapeItem::QetShapeItem
Constructor of shape item. point 1 and 2 must be in scene coordinate
@param p1 first point
@param p2 second point
@param type type of item (line, rectangle, ellipse)
@param parent parent item
*/
QetShapeItem::QetShapeItem(QPointF p1, QPointF p2, ShapeType type, QGraphicsItem *parent) :
QetGraphicsItem(parent),
m_shapeType(type),
@@ -69,10 +69,10 @@ QetShapeItem::~QetShapeItem()
}
/**
* @brief QetShapeItem::setPen
* Set the pen to use for draw the shape
* @param pen
*/
@brief QetShapeItem::setPen
Set the pen to use for draw the shape
@param pen
*/
void QetShapeItem::setPen(const QPen &pen)
{
if (m_pen == pen) return;
@@ -82,10 +82,10 @@ void QetShapeItem::setPen(const QPen &pen)
}
/**
* @brief QetShapeItem::setBrush
* Set the brush to use for the fill the shape
* @param brush
*/
@brief QetShapeItem::setBrush
Set the brush to use for the fill the shape
@param brush
*/
void QetShapeItem::setBrush(const QBrush &brush)
{
if (m_brush == brush) return;
@@ -95,12 +95,12 @@ void QetShapeItem::setBrush(const QBrush &brush)
}
/**
* @brief QetShapeItem::setP2
* Set the second point of this item.
* If this item is a polyline,
* the last point of the polyline is replaced by P2.
* @param P2
*/
@brief QetShapeItem::setP2
Set the second point of this item.
If this item is a polyline,
the last point of the polyline is replaced by P2.
@param P2
*/
void QetShapeItem::setP2(const QPointF &P2)
{
if (m_shapeType == Polygon && m_polygon.last() != P2)
@@ -116,11 +116,11 @@ void QetShapeItem::setP2(const QPointF &P2)
}
/**
* @brief QetShapeItem::setLine
* Set item geometry to line (only available for line shape)
* @param line
* @return : true when shape is a Line, else false
*/
@brief QetShapeItem::setLine
Set item geometry to line (only available for line shape)
@param line
@return : true when shape is a Line, else false
*/
bool QetShapeItem::setLine(const QLineF &line)
{
if (Q_UNLIKELY(m_shapeType != Line)) return false;
@@ -132,11 +132,11 @@ bool QetShapeItem::setLine(const QLineF &line)
}
/**
* @brief QetShapeItem::setRect
* Set this item geometry to rect (only available if shape is a rectangle or an ellipse)
* @param rect : new rect
* @return : true when shape is rectangle or ellipse, else false
*/
@brief QetShapeItem::setRect
Set this item geometry to rect (only available if shape is a rectangle or an ellipse)
@param rect : new rect
@return : true when shape is rectangle or ellipse, else false
*/
bool QetShapeItem::setRect(const QRectF &rect)
{
if (Q_LIKELY(m_shapeType == Rectangle || m_shapeType == Ellipse))
@@ -152,11 +152,11 @@ bool QetShapeItem::setRect(const QRectF &rect)
}
/**
* @brief QetShapeItem::setPolygon
* Set this item geometry to polygon (only available if shape is a polyline)
* @param polygon : new polygon
* @return true if item is polygon, else false
*/
@brief QetShapeItem::setPolygon
Set this item geometry to polygon (only available if shape is a polyline)
@param polygon : new polygon
@return true if item is polygon, else false
*/
bool QetShapeItem::setPolygon(const QPolygonF &polygon)
{
if (Q_UNLIKELY(m_shapeType != Polygon)) {
@@ -169,10 +169,10 @@ bool QetShapeItem::setPolygon(const QPolygonF &polygon)
}
/**
* @brief QetShapeItem::setClosed
* Close this item, have effect only if this item is a polygon.
* @param close
*/
@brief QetShapeItem::setClosed
Close this item, have effect only if this item is a polygon.
@param close
*/
void QetShapeItem::setClosed(bool close)
{
if (m_shapeType == Polygon && close != m_closed)
@@ -200,18 +200,18 @@ void QetShapeItem::setYRadius(qreal Y)
}
/**
* @brief QetShapeItem::pointCount
* @return the number of point in the polygon
*/
@brief QetShapeItem::pointCount
@return the number of point in the polygon
*/
int QetShapeItem::pointsCount() const {
return m_polygon.size();
}
/**
* @brief QetShapeItem::setNextPoint
* Add a new point to the curent polygon
* @param P the new point.
*/
@brief QetShapeItem::setNextPoint
Add a new point to the curent polygon
@param P the new point.
*/
void QetShapeItem::setNextPoint(QPointF P)
{
prepareGeometryChange();
@@ -219,11 +219,11 @@ void QetShapeItem::setNextPoint(QPointF P)
}
/**
* @brief QetShapeItem::removePoints
* Number of point to remove on the polygon
* If @number is superior to number of polygon points-2,
* all points of polygon will be removed except the first two (minimum point for the polygon);
*/
@brief QetShapeItem::removePoints
Number of point to remove on the polygon
If @number is superior to number of polygon points-2,
all points of polygon will be removed except the first two (minimum point for the polygon);
*/
void QetShapeItem::removePoints(int number)
{
if (pointsCount() == 2 || number < 1) return;
@@ -242,17 +242,17 @@ void QetShapeItem::removePoints(int number)
}
/**
* @brief QetShapeItem::boundingRect
* @return the bounding rect of this item
*/
@brief QetShapeItem::boundingRect
@return the bounding rect of this item
*/
QRectF QetShapeItem::boundingRect() const {
return shape().boundingRect().adjusted(-6, -6, 6, 6);
}
/**
* @brief QetShapeItem::shape
* @return the shape of this item
*/
@brief QetShapeItem::shape
@return the shape of this item
*/
QPainterPath QetShapeItem::shape() const
{
QPainterPath path;
@@ -286,12 +286,12 @@ QPainterPath QetShapeItem::shape() const
}
/**
* @brief QetShapeItem::paint
* Paint this item
* @param painter
* @param option
* @param widget
*/
@brief QetShapeItem::paint
Paint this item
@param painter
@param option
@param widget
*/
void QetShapeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option)
@@ -326,10 +326,10 @@ void QetShapeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
}
/**
* @brief QetShapeItem::hoverEnterEvent
* Handle hover enter event
* @param event
*/
@brief QetShapeItem::hoverEnterEvent
Handle hover enter event
@param event
*/
void QetShapeItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
m_hovered = true;
@@ -337,10 +337,10 @@ void QetShapeItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
}
/**
* @brief QetShapeItem::hoverLeaveEvent
* Handle hover leave event
* @param event
*/
@brief QetShapeItem::hoverLeaveEvent
Handle hover leave event
@param event
*/
void QetShapeItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
m_hovered = false;
@@ -359,11 +359,11 @@ void QetShapeItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief QetShapeItem::itemChange
* @param change
* @param value
* @return
*/
@brief QetShapeItem::itemChange
@param change
@param value
@return
*/
QVariant QetShapeItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
if (change == ItemSelectedHasChanged)
@@ -396,11 +396,11 @@ QVariant QetShapeItem::itemChange(QGraphicsItem::GraphicsItemChange change, cons
}
/**
* @brief QetShapeItem::sceneEventFilter
* @param watched
* @param event
* @return
*/
@brief QetShapeItem::sceneEventFilter
@param watched
@param event
@return
*/
bool QetShapeItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{
//Watched must be an handler
@@ -436,9 +436,9 @@ bool QetShapeItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
}
/**
* @brief QetShapeItem::contextMenuEvent
* @param event
*/
@brief QetShapeItem::contextMenuEvent
@param event
*/
void QetShapeItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
m_context_menu_pos = event->pos();
@@ -495,8 +495,8 @@ void QetShapeItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
}
/**
* @brief QetShapeItem::switchResizeMode
*/
@brief QetShapeItem::switchResizeMode
*/
void QetShapeItem::switchResizeMode()
{
if (m_shapeType == Ellipse)
@@ -590,9 +590,9 @@ void QetShapeItem::addHandler()
}
/**
* @brief QetShapeItem::adjusteHandlerPos
* Adjust the position of the handler item
*/
@brief QetShapeItem::adjusteHandlerPos
Adjust the position of the handler item
*/
void QetShapeItem::adjusteHandlerPos()
{
if (m_handler_vector.isEmpty()) {
@@ -689,10 +689,10 @@ void QetShapeItem::removePoint()
}
/**
* @brief QetShapeItem::handlerMousePressEvent
* @param qghi
* @param event
*/
@brief QetShapeItem::handlerMousePressEvent
@param qghi
@param event
*/
void QetShapeItem::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi)
@@ -709,10 +709,10 @@ void QetShapeItem::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphic
}
/**
* @brief QetShapeItem::handlerMouseMoveEvent
* @param qghi
* @param event
*/
@brief QetShapeItem::handlerMouseMoveEvent
@param qghi
@param event
*/
void QetShapeItem::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi)
@@ -773,10 +773,10 @@ void QetShapeItem::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphics
}
/**
* @brief QetShapeItem::handlerMouseReleaseEvent
* @param qghi
* @param event
*/
@brief QetShapeItem::handlerMouseReleaseEvent
@param qghi
@param event
*/
void QetShapeItem::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -831,11 +831,11 @@ void QetShapeItem::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraph
}
/**
* @brief QetShapeItem::fromXml
* Build this item from the xml description
* @param e element where is stored this item
* @return true if load success
*/
@brief QetShapeItem::fromXml
Build this item from the xml description
@param e element where is stored this item
@return true if load success
*/
bool QetShapeItem::fromXml(const QDomElement &e)
{
if (e.tagName() != "shape") return (false);
@@ -888,11 +888,11 @@ bool QetShapeItem::fromXml(const QDomElement &e)
}
/**
* @brief QetShapeItem::toXml
* Save this item to xml element
* @param document parent document xml
* @return element xml where is write this item
*/
@brief QetShapeItem::toXml
Save this item to xml element
@param document parent document xml
@return element xml where is write this item
*/
QDomElement QetShapeItem::toXml(QDomDocument &document) const
{
QDomElement result = document.createElement("shape");
@@ -948,11 +948,11 @@ QDomElement QetShapeItem::toXml(QDomDocument &document) const
}
/**
* @brief QetShapeItem::toDXF
* Draw this element to the dxf document
* @param filepath file path of the the dxf document
* @return true if draw success
*/
@brief QetShapeItem::toDXF
Draw this element to the dxf document
@param filepath file path of the the dxf document
@return true if draw success
*/
bool QetShapeItem::toDXF(const QString &filepath,const QPen &pen)
{
@@ -966,9 +966,9 @@ bool QetShapeItem::toDXF(const QString &filepath,const QPen &pen)
}
/**
* @brief QetShapeItem::editProperty
* Edit the property of this item
*/
@brief QetShapeItem::editProperty
Edit the property of this item
*/
void QetShapeItem::editProperty()
{
if (diagram() -> isReadOnly()) return;
@@ -978,9 +978,9 @@ void QetShapeItem::editProperty()
}
/**
* @brief QetShapeItem::name
* @return the name of the curent shape.
*/
@brief QetShapeItem::name
@return the name of the curent shape.
*/
QString QetShapeItem::name() const {
switch (m_shapeType) {
case Line: return tr("une ligne");

View File

@@ -28,10 +28,10 @@ class QetGraphicsHandlerItem;
class QAction;
/**
* @brief The QetShapeItem class
* this class is used to draw a basic shape (line, rectangle, ellipse)
* into a diagram, that can be saved to .qet file.
*/
@brief The QetShapeItem class
this class is used to draw a basic shape (line, rectangle, ellipse)
into a diagram, that can be saved to .qet file.
*/
class QetShapeItem : public QetGraphicsItem
{
Q_OBJECT

View File

@@ -22,11 +22,11 @@
#include <QDebug>
/**
* @brief centerToParentBottom
* Center the item at the bottom of is parent.
* @param item item to center
* @return true if centered else false (item have not parent)
*/
@brief centerToParentBottom
Center the item at the bottom of is parent.
@param item item to center
@return true if centered else false (item have not parent)
*/
bool centerToParentBottom(QGraphicsItem *item) {
if (! item->parentItem()) {
qDebug() << "Qet::centerToParentBottom : item have not parent";
@@ -42,13 +42,13 @@ bool centerToParentBottom(QGraphicsItem *item) {
}
/**
* @brief centerToBottomDiagram
* Set item pos to the bottom of diagram and centered vertically to element_to_follow, and add offset.
* @param item_to_center
* @param element_to_follow
* @param offset
* @return true if element is centered else false (element_to_follow have not diagram)
*/
@brief centerToBottomDiagram
Set item pos to the bottom of diagram and centered vertically to element_to_follow, and add offset.
@param item_to_center
@param element_to_follow
@param offset
@return true if element is centered else false (element_to_follow have not diagram)
*/
#include "elementtextitemgroup.h"
#include "crossrefitem.h"
bool centerToBottomDiagram (QGraphicsItem *item_to_center, Element *element_to_follow, qreal offset) {

View File

@@ -30,9 +30,9 @@ ReportElement::ReportElement(const ElementsLocation &location, const QString& li
{}
/**
* @brief ReportElement::~ReportElement
* Destructor
*/
@brief ReportElement::~ReportElement
Destructor
*/
ReportElement::~ReportElement()
{
unlinkAllElements();
@@ -41,11 +41,11 @@ ReportElement::~ReportElement()
}
/**
* @brief ReportElement::linkToElement
* Link this element to the other element
* @param elmt
* element to be linked with this
*/
@brief ReportElement::linkToElement
Link this element to the other element
@param elmt
element to be linked with this
*/
void ReportElement::linkToElement(Element * elmt)
{
if (!diagram() && !elmt -> diagram())
@@ -70,9 +70,9 @@ void ReportElement::linkToElement(Element * elmt)
}
/**
* @brief ReportElement::unLinkAllElements
* Unlink all of the element in the QList connected_elements
*/
@brief ReportElement::unLinkAllElements
Unlink all of the element in the QList connected_elements
*/
void ReportElement::unlinkAllElements()
{
if (isFree())
@@ -92,12 +92,12 @@ void ReportElement::unlinkAllElements()
emit linkedElementChanged();
}
/**
* @brief ReportElement::unlinkElement
@brief ReportElement::unlinkElement
*unlink the specified element.
*for reportelement, they must be only one linked element, so we call
*unlinkAllElements for clear the connected_elements list.
* @param elmt
*/
@param elmt
*/
void ReportElement::unlinkElement(Element *elmt) {
Q_UNUSED (elmt);
unlinkAllElements();

View File

@@ -21,10 +21,10 @@
#include "element.h"
/**
* @brief The ReportElement class
@brief The ReportElement class
*this class represent an element that can be linked to an other ReportElement
* a folio report in a diagram is a element that show a wire go on an other folio
*/
a folio report in a diagram is a element that show a wire go on an other folio
*/
class ReportElement : public Element
{
Q_OBJECT

View File

@@ -19,27 +19,27 @@
#include "diagram.h"
/**
* @brief SimpleElement::SimpleElement
* @param location
* @param qgi
* @param s
* @param state
*/
@brief SimpleElement::SimpleElement
@param location
@param qgi
@param s
@param state
*/
SimpleElement::SimpleElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
Element(location, qgi, state, Element::Simple)
{}
/**
* @brief SimpleElement::~SimpleElement
*/
@brief SimpleElement::~SimpleElement
*/
SimpleElement::~SimpleElement() {}
/**
* @brief SimpleElement::initLink
* @param project
* Call init Link from custom element and after
* call update label for setup it.
*/
@brief SimpleElement::initLink
@param project
Call init Link from custom element and after
call update label for setup it.
*/
void SimpleElement::initLink(QETProject *project) {
Element::initLink(project);
}

View File

@@ -23,9 +23,9 @@
class QETProject;
/**
* @brief The SimpleElement class
*this class represente a simple element with no specific attribute
*/
@brief The SimpleElement class
this class represente a simple element with no specific attribute
*/
class SimpleElement : public Element {
Q_OBJECT

View File

@@ -22,13 +22,13 @@
#include "dynamicelementtextitem.h"
/**
* @brief SlaveElement::SlaveElement
* Default constructor
* @param location location of xml definition
* @param qgi parent QGraphicItem
* @param s parent diagram
* @param state int used to know if the creation of element have error
*/
@brief SlaveElement::SlaveElement
Default constructor
@param location location of xml definition
@param qgi parent QGraphicItem
@param s parent diagram
@param state int used to know if the creation of element have error
*/
SlaveElement::SlaveElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
Element(location, qgi, state, Element::Slave)
{
@@ -36,19 +36,19 @@ SlaveElement::SlaveElement(const ElementsLocation &location, QGraphicsItem *qgi,
}
/**
* @brief SlaveElement::~SlaveElement
* default destructor
*/
@brief SlaveElement::~SlaveElement
default destructor
*/
SlaveElement::~SlaveElement() {
unlinkAllElements();
}
/**
* @brief SlaveElement::linkToElement
* Link this slave to another element
* For this class element must be a master
* @param elmt
*/
@brief SlaveElement::linkToElement
Link this slave to another element
For this class element must be a master
@param elmt
*/
void SlaveElement::linkToElement(Element *elmt)
{
// check if element is master and if isn't already linked
@@ -65,9 +65,9 @@ void SlaveElement::linkToElement(Element *elmt)
}
/**
* @brief SlaveElement::unlinkAllElements
* Unlink all of the element in the QList connected_elements
*/
@brief SlaveElement::unlinkAllElements
Unlink all of the element in the QList connected_elements
*/
void SlaveElement::unlinkAllElements()
{
// if this element is free no need to do something
@@ -80,10 +80,10 @@ void SlaveElement::unlinkAllElements()
}
/**
* @brief SlaveElement::unlinkElement
* Unlink the given elmt in parametre
* @param elmt
*/
@brief SlaveElement::unlinkElement
Unlink the given elmt in parametre
@param elmt
*/
void SlaveElement::unlinkElement(Element *elmt)
{
//Ensure elmt is linked to this element

View File

@@ -72,14 +72,14 @@ void Terminal::init(QString number, QString name, bool hiddenName) {
}
/*!
* \brief Terminal::init
* Additionaly to the init above, this method stores position and orientation into the data class
* \param pf
* \param o
* \param number
* \param name
* \param hiddenName
*/
\brief Terminal::init
Additionaly to the init above, this method stores position and orientation into the data class
\param pf
\param o
\param number
\param name
\param hiddenName
*/
void Terminal::init(QPointF pf, Qet::Orientation o, QString number, QString name, bool hiddenName)
{
// definition du pount d'amarrage pour un conducteur