[qet] qet/qet: [5449] Apply clang-tidy's modernize-use-auto |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5449
Author: scorpio810
Date: 2018-07-19 18:27:20 +0200 (Thu, 19 Jul 2018)
Log Message:
-----------
Apply clang-tidy's modernize-use-auto
Modified Paths:
--------------
trunk/sources/ElementsCollection/elementcollectionitem.cpp
trunk/sources/ElementsCollection/elementscollectionmodel.cpp
trunk/sources/ElementsCollection/elementscollectionwidget.cpp
trunk/sources/ElementsCollection/elementstreeview.cpp
trunk/sources/ElementsCollection/fileelementcollectionitem.cpp
trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp
trunk/sources/QPropertyUndoCommand/qpropertyundocommand.cpp
trunk/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp
trunk/sources/aboutqet.cpp
trunk/sources/autoNum/ui/selectautonumw.cpp
trunk/sources/bordertitleblock.cpp
trunk/sources/configdialog.cpp
trunk/sources/configpages.cpp
trunk/sources/diagram.cpp
trunk/sources/diagramcommands.cpp
trunk/sources/diagramcontent.cpp
trunk/sources/diagramcontextwidget.cpp
trunk/sources/diagramevent/diagrameventaddelement.cpp
trunk/sources/diagramevent/diagrameventaddtext.cpp
trunk/sources/diagramfoliolist.cpp
trunk/sources/diagramprintdialog.cpp
trunk/sources/diagramschooser.cpp
trunk/sources/diagramview.cpp
trunk/sources/editor/arceditor.cpp
trunk/sources/editor/elementprimitivedecorator.cpp
trunk/sources/editor/elementscene.cpp
trunk/sources/editor/elementview.cpp
trunk/sources/editor/ellipseeditor.cpp
trunk/sources/editor/graphicspart/partarc.cpp
trunk/sources/editor/graphicspart/partellipse.cpp
trunk/sources/editor/graphicspart/partline.cpp
trunk/sources/editor/graphicspart/partpolygon.cpp
trunk/sources/editor/graphicspart/partrectangle.cpp
trunk/sources/editor/lineeditor.cpp
trunk/sources/editor/polygoneditor.cpp
trunk/sources/editor/qetelementeditor.cpp
trunk/sources/editor/styleeditor.cpp
trunk/sources/editor/terminaleditor.cpp
trunk/sources/editor/texteditor.cpp
trunk/sources/editor/ui/dynamictextfieldeditor.cpp
trunk/sources/editor/ui/elementpropertieseditorwidget.cpp
trunk/sources/editor/ui/rectangleeditor.cpp
trunk/sources/elementdialog.cpp
trunk/sources/elementscategoryeditor.cpp
trunk/sources/elementsmover.cpp
trunk/sources/elementspanel.cpp
trunk/sources/elementspanelwidget.cpp
trunk/sources/elementtextpattern.cpp
trunk/sources/elementtextsmover.cpp
trunk/sources/exportdialog.cpp
trunk/sources/exportpropertieswidget.cpp
trunk/sources/genericpanel.cpp
trunk/sources/nameslistwidget.cpp
trunk/sources/newelementwizard.cpp
trunk/sources/projectconfigpages.cpp
trunk/sources/projectview.cpp
trunk/sources/qet.cpp
trunk/sources/qetapp.cpp
trunk/sources/qetdiagrameditor.cpp
trunk/sources/qetgraphicsitem/conductor.cpp
trunk/sources/qetgraphicsitem/conductortextitem.cpp
trunk/sources/qetgraphicsitem/customelement.cpp
trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
trunk/sources/qetgraphicsitem/element.cpp
trunk/sources/qetgraphicsitem/elementtextitemgroup.cpp
trunk/sources/qetgraphicsitem/qetshapeitem.cpp
trunk/sources/qetgraphicsitem/terminal.cpp
trunk/sources/qetprintpreviewdialog.cpp
trunk/sources/qetproject.cpp
trunk/sources/qtextorientationspinboxwidget.cpp
trunk/sources/recentfiles.cpp
trunk/sources/richtext/richtexteditor.cpp
trunk/sources/titleblock/dimensionwidget.cpp
trunk/sources/titleblock/qettemplateeditor.cpp
trunk/sources/titleblock/templatecellwidget.cpp
trunk/sources/titleblock/templatecommands.cpp
trunk/sources/titleblock/templatelogomanager.cpp
trunk/sources/titleblock/templatescollection.cpp
trunk/sources/titleblock/templateview.cpp
trunk/sources/titleblocktemplate.cpp
trunk/sources/ui/conductorpropertiesdialog.cpp
trunk/sources/ui/diagrampropertiesdialog.cpp
trunk/sources/ui/diagrampropertieseditordockwidget.cpp
trunk/sources/ui/diagramselection.cpp
trunk/sources/ui/dynamicelementtextitemeditor.cpp
trunk/sources/ui/dynamicelementtextmodel.cpp
trunk/sources/ui/elementpropertieswidget.cpp
trunk/sources/ui/importelementdialog.cpp
trunk/sources/ui/linksingleelementwidget.cpp
trunk/sources/ui/masterpropertieswidget.cpp
trunk/sources/ui/multipastedialog.cpp
trunk/sources/ui/potentialselectordialog.cpp
trunk/sources/ui/projectpropertiesdialog.cpp
trunk/sources/undocommand/addelementtextcommand.cpp
trunk/sources/undocommand/changeelementinformationcommand.cpp
trunk/sources/undocommand/linkelementcommand.cpp
trunk/sources/undocommand/rotateselectioncommand.cpp
trunk/sources/undocommand/rotatetextscommand.cpp
Modified: trunk/sources/ElementsCollection/elementcollectionitem.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementcollectionitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ElementsCollection/elementcollectionitem.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -75,7 +75,7 @@
{
rowCount();
foreach (QStandardItem *qsi, directChilds()) {
- ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsi);
+ auto *eci = static_cast<ElementCollectionItem *>(qsi);
if (eci->name() == name)
return eci;
}
@@ -167,7 +167,7 @@
QList <ElementCollectionItem *> element_child;
foreach (QStandardItem *qsi, directChilds()) {
- ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsi);
+ auto *eci = static_cast<ElementCollectionItem *>(qsi);
if (eci->isElement())
element_child.append(eci);
}
@@ -184,7 +184,7 @@
QList <ElementCollectionItem *> dir_child;
foreach (QStandardItem *qsi, directChilds()) {
- ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsi);
+ auto *eci = static_cast<ElementCollectionItem *>(qsi);
if (eci->isDir())
dir_child.append(eci);
}
@@ -231,7 +231,7 @@
QList <ElementCollectionItem *> list;
for (int i=0 ; i<rowCount() ; i++) {
- ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(child(i));
+ auto *eci = static_cast<ElementCollectionItem *>(child(i));
list.append(eci);
list.append(eci->items());
}
Modified: trunk/sources/ElementsCollection/elementscollectionmodel.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementscollectionmodel.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ElementsCollection/elementscollectionmodel.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -68,9 +68,9 @@
QModelIndex index = indexes.first();
if (index.isValid())
{
- ElementCollectionItem *item = static_cast<ElementCollectionItem*>(itemFromIndex(index));
+ auto *item = static_cast<ElementCollectionItem*>(itemFromIndex(index));
- QMimeData *mime_data = new QMimeData();
+ auto *mime_data = new QMimeData();
mime_data->setText(item->collectionPath());
if (item->isElement())
@@ -120,7 +120,7 @@
if (static_cast<FileElementCollectionItem *>(qsi)->isCommonCollection())
return false;
- ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsi);
+ auto *eci = static_cast<ElementCollectionItem *>(qsi);
if (data->hasFormat("application/x-qet-element-uri") || data->hasFormat("application/x-qet-category-uri"))
{
@@ -156,7 +156,7 @@
if (qsi->type() == FileElementCollectionItem::Type)
{
- FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(qsi);
+ auto *feci = static_cast<FileElementCollectionItem *>(qsi);
if (feci->isCommonCollection())
return false;
@@ -185,7 +185,7 @@
return false;
}
else if (qsi->type() == XmlProjectElementCollectionItem::Type) {
- XmlProjectElementCollectionItem *xpeci = static_cast<XmlProjectElementCollectionItem*>(qsi);
+ auto *xpeci = static_cast<XmlProjectElementCollectionItem*>(qsi);
if (xpeci->isElement() && xpeci->parent() && xpeci->parent()->type() == XmlProjectElementCollectionItem::Type)
xpeci = static_cast<XmlProjectElementCollectionItem *>(xpeci->parent());
@@ -254,7 +254,7 @@
*/
void ElementsCollectionModel::addCommonCollection(bool set_data)
{
- FileElementCollectionItem *feci = new FileElementCollectionItem();
+ auto *feci = new FileElementCollectionItem();
if (feci->setRootPath(QETApp::commonElementsDirN(), set_data, m_hide_element)) {
invisibleRootItem()->appendRow(feci);
if (set_data)
@@ -270,7 +270,7 @@
*/
void ElementsCollectionModel::addCustomCollection(bool set_data)
{
- FileElementCollectionItem *feci = new FileElementCollectionItem();
+ auto *feci = new FileElementCollectionItem();
if (feci->setRootPath(QETApp::customElementsDirN(), set_data, m_hide_element)) {
invisibleRootItem()->appendRow(feci);
if (set_data)
@@ -313,7 +313,7 @@
foreach(ElementCollectionItem *eci, child_list) {
if (eci->type() == FileElementCollectionItem::Type) {
- FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(eci);
+ auto *feci = static_cast<FileElementCollectionItem *>(eci);
if (feci->isCustomCollection()) {
last_item = feci->lastItemForPath(location.collectionPath(false), collection_name);
@@ -341,7 +341,7 @@
m_project_list.append(project);
int row = m_project_list.indexOf(project);
- XmlProjectElementCollectionItem *xpeci = new XmlProjectElementCollectionItem();
+ auto *xpeci = new XmlProjectElementCollectionItem();
m_project_hash.insert(project, xpeci);
xpeci->setProject(project, set_data);
@@ -419,7 +419,7 @@
QList <ElementCollectionItem *> list;
for (int i=0 ; i<rowCount() ; i++) {
- ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(item(i));
+ auto *eci = static_cast<ElementCollectionItem *>(item(i));
list.append(eci);
list.append(eci->items());
}
@@ -478,7 +478,7 @@
ElementCollectionItem *match_eci = nullptr;
if (eci->type() == FileElementCollectionItem::Type) {
- if (FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(eci)) {
+ if (auto *feci = static_cast<FileElementCollectionItem *>(eci)) {
if ( (location.isCommonCollection() && feci->isCommonCollection()) ||
(location.isCustomCollection() && !feci->isCommonCollection()) ) {
match_eci = feci->itemAtPath(location.collectionPath(false));
@@ -486,7 +486,7 @@
}
}
else if (eci->type() == XmlProjectElementCollectionItem::Type) {
- if (XmlProjectElementCollectionItem *xpeci = static_cast<XmlProjectElementCollectionItem *>(eci)) {
+ if (auto *xpeci = static_cast<XmlProjectElementCollectionItem *>(eci)) {
match_eci = xpeci->itemAtPath(location.collectionPath(false));
}
}
@@ -507,7 +507,7 @@
void ElementsCollectionModel::elementIntegratedToCollection(const QString& path)
{
QObject *object = sender();
- XmlElementCollection *collection = static_cast<XmlElementCollection *> (object);
+ auto *collection = static_cast<XmlElementCollection *> (object);
if (!collection)
return;
@@ -540,7 +540,7 @@
void ElementsCollectionModel::itemRemovedFromCollection(const QString& path)
{
QObject *object = sender();
- XmlElementCollection *collection = static_cast<XmlElementCollection *> (object);
+ auto *collection = static_cast<XmlElementCollection *> (object);
if (!collection)
return;
@@ -568,7 +568,7 @@
void ElementsCollectionModel::updateItem(const QString& path)
{
QObject *object = sender();
- XmlElementCollection *collection = static_cast<XmlElementCollection *> (object);
+ auto *collection = static_cast<XmlElementCollection *> (object);
if (!collection)
return;
Modified: trunk/sources/ElementsCollection/elementscollectionwidget.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementscollectionwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ElementsCollection/elementscollectionwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -242,7 +242,7 @@
if (eci->type() == FileElementCollectionItem::Type)
{
add_open_dir = true;
- FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
+ auto *feci = static_cast<FileElementCollectionItem*>(eci);
if (!feci->isCommonCollection())
{
if (feci->isDir())
@@ -261,7 +261,7 @@
}
if (eci->type() == XmlProjectElementCollectionItem::Type)
{
- XmlProjectElementCollectionItem *xpeci = static_cast<XmlProjectElementCollectionItem *>(eci);
+ auto *xpeci = static_cast<XmlProjectElementCollectionItem *>(eci);
if (xpeci->isCollectionRoot())
add_open_dir = true;
}
@@ -404,7 +404,7 @@
if (eci->type() != FileElementCollectionItem::Type) return;
- FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
+ auto *feci = static_cast<FileElementCollectionItem*>(eci);
if(feci->isCommonCollection()) return;
ElementsLocation location(feci->collectionPath());
@@ -424,7 +424,7 @@
if (eci->type() != FileElementCollectionItem::Type) return;
- FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
+ auto *feci = static_cast<FileElementCollectionItem*>(eci);
if(feci->isCommonCollection()) return;
ElementsLocation location(feci->collectionPath());
@@ -445,7 +445,7 @@
return;
}
- FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
+ auto *feci = static_cast<FileElementCollectionItem*>(eci);
if(feci->isCommonCollection()) {
return;
}
@@ -533,7 +533,7 @@
void ElementsCollectionWidget::reload()
{
m_progress_bar->show();
- ElementsCollectionModel *new_model = new ElementsCollectionModel(m_tree_view);
+ auto *new_model = new ElementsCollectionModel(m_tree_view);
QList <QETProject *> project_list;
project_list.append(m_waiting_project);
Modified: trunk/sources/ElementsCollection/elementstreeview.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementstreeview.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ElementsCollection/elementstreeview.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -50,8 +50,8 @@
return;
}
- if (QStandardItemModel *qsim = static_cast<QStandardItemModel *>(model())) {
- if (ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsim->itemFromIndex(index))) {
+ if (auto *qsim = static_cast<QStandardItemModel *>(model())) {
+ if (auto *eci = static_cast<ElementCollectionItem *>(qsim->itemFromIndex(index))) {
ElementsLocation loc (eci->collectionPath());
if (loc.exist()) {
startElementDrag(loc);
@@ -72,10 +72,10 @@
if (!location.exist())
return;
- QDrag *drag = new QDrag(this);
+ auto *drag = new QDrag(this);
QString location_str = location.toString();
- QMimeData *mime_data = new QMimeData();
+ auto *mime_data = new QMimeData();
mime_data->setText(location_str);
if (location.isDirectory())
Modified: trunk/sources/ElementsCollection/fileelementcollectionitem.cpp
===================================================================
--- trunk/sources/ElementsCollection/fileelementcollectionitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ElementsCollection/fileelementcollectionitem.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -58,7 +58,7 @@
if (isCollectionRoot())
return m_path;
- FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *> (parent());
+ auto *feci = static_cast<FileElementCollectionItem *> (parent());
if (feci)
return feci->fileSystemPath() + "/" + m_path;
else
@@ -172,7 +172,7 @@
return "custom://";
}
else if (parent() && parent()->type() == FileElementCollectionItem::Type) {
- ElementCollectionItem *eci = static_cast<ElementCollectionItem*>(parent());
+ auto *eci = static_cast<ElementCollectionItem*>(parent());
if (eci->isCollectionRoot())
return eci->collectionPath() + m_path;
else
@@ -222,7 +222,7 @@
if (collection_name.isEmpty())
return;
- FileElementCollectionItem *feci = new FileElementCollectionItem();
+ auto *feci = new FileElementCollectionItem();
insertRow(rowForInsertItem(collection_name), feci);
feci->setPathName(collection_name);
feci->setUpData();
@@ -299,7 +299,7 @@
//Get all directory in this directory.
foreach(QString str, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name))
{
- FileElementCollectionItem *feci = new FileElementCollectionItem();
+ auto *feci = new FileElementCollectionItem();
appendRow(feci);
feci->setPathName(str, set_data, hide_element);
if (set_data)
@@ -313,7 +313,7 @@
dir.setNameFilters(QStringList() << "*.elmt");
foreach(QString str, dir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name))
{
- FileElementCollectionItem *feci = new FileElementCollectionItem();
+ auto *feci = new FileElementCollectionItem();
appendRow(feci);
feci->setPathName(str, set_data);
if (set_data)
Modified: trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp
===================================================================
--- trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -102,7 +102,7 @@
if (isCollectionRoot())
return "embed://";
else if (parent()){
- XmlProjectElementCollectionItem *xpeci = static_cast<XmlProjectElementCollectionItem *>(parent());
+ auto *xpeci = static_cast<XmlProjectElementCollectionItem *>(parent());
if (xpeci->isCollectionRoot())
return xpeci->embeddedPath() + name();
@@ -143,7 +143,7 @@
while (!child_element.isNull()) {
if (child_element.attribute("name") == collection_name) {
- XmlProjectElementCollectionItem *xpeci = new XmlProjectElementCollectionItem ();
+ auto *xpeci = new XmlProjectElementCollectionItem ();
insertRow(rowForInsertItem(collection_name), xpeci);
xpeci->setXmlElement(child_element, m_project);
xpeci->setUpData();
@@ -229,7 +229,7 @@
foreach (QDomElement element, dom_category)
{
- XmlProjectElementCollectionItem *xpeci = new XmlProjectElementCollectionItem();
+ auto *xpeci = new XmlProjectElementCollectionItem();
appendRow(xpeci);
xpeci->setXmlElement(element, m_project, set_data, hide_element);
if (set_data)
@@ -244,7 +244,7 @@
foreach (QDomElement element, dom_elements)
{
- XmlProjectElementCollectionItem *xpeci = new XmlProjectElementCollectionItem();
+ auto *xpeci = new XmlProjectElementCollectionItem();
appendRow(xpeci);
xpeci->setXmlElement(element, m_project, set_data);
if (set_data)
Modified: trunk/sources/QPropertyUndoCommand/qpropertyundocommand.cpp
===================================================================
--- trunk/sources/QPropertyUndoCommand/qpropertyundocommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/QPropertyUndoCommand/qpropertyundocommand.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -100,7 +100,7 @@
bool QPropertyUndoCommand::mergeWith(const QUndoCommand *other)
{
if (id() != other->id() || other->childCount()) return false;
- QPropertyUndoCommand const *undo = static_cast<const QPropertyUndoCommand *>(other);
+ auto const *undo = static_cast<const QPropertyUndoCommand *>(other);
if (m_object != undo->m_object || m_property_name != undo->m_property_name) return false;
m_new_value = undo->m_new_value;
return true;
Modified: trunk/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp
===================================================================
--- trunk/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -82,7 +82,7 @@
QVector <QetGraphicsHandlerItem *> list_;
for (QPointF point : points)
{
- QetGraphicsHandlerItem *qghi = new QetGraphicsHandlerItem(size);
+ auto *qghi = new QetGraphicsHandlerItem(size);
qghi->setPos(point);
list_ << qghi;
}
Modified: trunk/sources/aboutqet.cpp
===================================================================
--- trunk/sources/aboutqet.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/aboutqet.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -40,7 +40,7 @@
setModal(true);
- QTabWidget *tabs = new QTabWidget();
+ auto *tabs = new QTabWidget();
tabs -> addTab(aboutTab(), tr("À &propos", "tab title"));
tabs -> addTab(authorsTab(), tr("A&uteurs", "tab title"));
tabs -> addTab(translatorsTab(), tr("&Traducteurs", "tab title"));
@@ -52,11 +52,11 @@
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), this, SLOT(accept()));
- QVBoxLayout *vlayout = new QVBoxLayout(this);
+ auto *vlayout = new QVBoxLayout(this);
vlayout->addWidget(tabs);
vlayout->addWidget(buttons);
- QScrollArea* scrollArea = new QScrollArea(this);
+ auto* scrollArea = new QScrollArea(this);
scrollArea->setWidgetResizable(true);
scrollArea->setFixedSize (590, 590);
scrollArea->setWidget(tabs);
@@ -135,7 +135,7 @@
authors -> setTextFormat(Qt::RichText);
QWidget *authors_widget = new QWidget();
- QHBoxLayout *authors_layout = new QHBoxLayout(authors_widget);
+ auto *authors_layout = new QHBoxLayout(authors_widget);
authors_layout -> addWidget(authors, 0, Qt::AlignCenter);
return(authors_widget);
}
@@ -175,7 +175,7 @@
translators -> setTextFormat(Qt::RichText);
QWidget *translators_widget = new QWidget();
- QHBoxLayout *translators_layout = new QHBoxLayout(translators_widget);
+ auto *translators_layout = new QHBoxLayout(translators_widget);
translators_layout -> addWidget(translators, 0, Qt::AlignCenter);
return(translators_widget);
}
@@ -207,7 +207,7 @@
contributors -> setTextFormat(Qt::RichText);
QWidget *contributors_widget = new QWidget();
- QHBoxLayout *contributors_layout = new QHBoxLayout(contributors_widget);
+ auto *contributors_layout = new QHBoxLayout(contributors_widget);
contributors_layout -> addWidget(contributors, 0, Qt::AlignCenter);
return(contributors_widget);
}
@@ -221,12 +221,12 @@
QLabel *title_license = new QLabel(tr("Ce programme est sous licence GNU/GPL."));
// Text of the GNU/GPL in a scrollable text box not editable
- QTextEdit *text_license = new QTextEdit();
+ auto *text_license = new QTextEdit();
text_license -> setPlainText(QET::license());
text_license -> setReadOnly(true);
// All in a vertical arrangement
- QVBoxLayout *license_layout = new QVBoxLayout();
+ auto *license_layout = new QVBoxLayout();
license_layout -> addWidget(title_license);
license_layout -> addWidget(text_license);
license -> setLayout(license_layout);
Modified: trunk/sources/autoNum/ui/selectautonumw.cpp
===================================================================
--- trunk/sources/autoNum/ui/selectautonumw.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/autoNum/ui/selectautonumw.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -94,7 +94,7 @@
}
else {
for (int i=0; i<m_context.size(); ++i) { //build with the content of @context
- NumPartEditorW *part= new NumPartEditorW(m_context, i, m_edited_type, this);
+ auto *part= new NumPartEditorW(m_context, i, m_edited_type, this);
connect (part, SIGNAL(changed()), this, SLOT(applyEnable()));
num_part_list_ << part;
ui -> editor_layout -> addWidget(part);
@@ -125,7 +125,7 @@
void SelectAutonumW::on_add_button_clicked()
{
applyEnable(false);
- NumPartEditorW *part = new NumPartEditorW(m_edited_type, this);
+ auto *part = new NumPartEditorW(m_edited_type, this);
connect (part, SIGNAL(changed()), this, SLOT(applyEnable()));
num_part_list_ << part;
ui -> editor_layout -> addWidget(part);
Modified: trunk/sources/bordertitleblock.cpp
===================================================================
--- trunk/sources/bordertitleblock.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/bordertitleblock.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -673,8 +673,8 @@
return (DiagramPosition("", 0));
QPointF relative_pos = pos - insideBorderRect().topLeft();
- int row_number = int(ceil(relative_pos.x() / columnsWidth()));
- int column_number = int(ceil(relative_pos.y() / rowsHeight()));
+ auto row_number = int(ceil(relative_pos.x() / columnsWidth()));
+ auto column_number = int(ceil(relative_pos.y() / rowsHeight()));
QString letter = "A";
for (int i = 1 ; i < column_number ; ++ i)
Modified: trunk/sources/configdialog.cpp
===================================================================
--- trunk/sources/configdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/configdialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -41,11 +41,11 @@
buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
// layouts
- QHBoxLayout *hlayout1 = new QHBoxLayout();
+ auto *hlayout1 = new QHBoxLayout();
hlayout1 -> addWidget(pages_list);
hlayout1 -> addWidget(pages_widget);
- QVBoxLayout *vlayout1 = new QVBoxLayout();
+ auto *vlayout1 = new QVBoxLayout();
vlayout1 -> addLayout(hlayout1);
vlayout1 -> addWidget(buttons);
setLayout(vlayout1);
@@ -80,7 +80,7 @@
Add the \a page ConfigPage to this configuration dialog.
*/
void ConfigDialog::addPageToList(ConfigPage *page) {
- QListWidgetItem *new_button = new QListWidgetItem(pages_list);
+ auto *new_button = new QListWidgetItem(pages_list);
new_button -> setIcon(page -> icon());
new_button -> setText(page -> title());
new_button -> setTextAlignment(Qt::AlignHCenter);
Modified: trunk/sources/configpages.cpp
===================================================================
--- trunk/sources/configpages.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/configpages.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -73,9 +73,9 @@
connect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab()));
// main tab widget
- QTabWidget *tab_widget = new QTabWidget(this);
+ auto *tab_widget = new QTabWidget(this);
QWidget *diagram_widget = new QWidget();
- QVBoxLayout *diagram_layout = new QVBoxLayout(diagram_widget);
+ auto *diagram_layout = new QVBoxLayout(diagram_widget);
diagram_layout -> addWidget(bpw);
diagram_layout -> addWidget(ipw);
@@ -85,7 +85,7 @@
tab_widget -> addTab (rpw, tr("Reports de folio"));
tab_widget -> addTab (xrefpw, tr("Références croisées"));
- QVBoxLayout *vlayout1 = new QVBoxLayout();
+ auto *vlayout1 = new QVBoxLayout();
vlayout1->addWidget(tab_widget);
setLayout(vlayout1);
@@ -235,7 +235,7 @@
epw = new ExportPropertiesWidget(ExportProperties::defaultExportProperties());
// layout vertical contenant le titre, une ligne horizontale et epw
- QVBoxLayout *vlayout1 = new QVBoxLayout();
+ auto *vlayout1 = new QVBoxLayout();
QLabel *title = new QLabel(this -> title());
vlayout1 -> addWidget(title);
@@ -283,7 +283,7 @@
epw -> setPrintingMode(true);
// layout vertical contenant le titre, une ligne horizontale et epw
- QVBoxLayout *vlayout1 = new QVBoxLayout();
+ auto *vlayout1 = new QVBoxLayout();
QLabel *title = new QLabel(this -> title());
vlayout1 -> addWidget(title);
Modified: trunk/sources/diagram.cpp
===================================================================
--- trunk/sources/diagram.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagram.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -159,9 +159,9 @@
qreal limite_x = rect.x() + rect.width();
qreal limite_y = rect.y() + rect.height();
- int g_x = (int)ceil(rect.x());
+ auto g_x = (int)ceil(rect.x());
while (g_x % xGrid) ++ g_x;
- int g_y = (int)ceil(rect.y());
+ auto g_y = (int)ceil(rect.y());
while (g_y % yGrid) ++ g_y;
QPolygon points;
@@ -649,10 +649,10 @@
;
// Determine les elements a "XMLiser"
foreach(QGraphicsItem *qgi, list_items) {
- if (Element *elmt = qgraphicsitem_cast<Element *>(qgi)) {
+ if (auto *elmt = qgraphicsitem_cast<Element *>(qgi)) {
if (whole_content) list_elements << elmt;
else if (elmt -> isSelected()) list_elements << elmt;
- } else if (Conductor *f = qgraphicsitem_cast<Conductor *>(qgi)) {
+ } else if (auto *f = qgraphicsitem_cast<Conductor *>(qgi)) {
if (whole_content) list_conductors << f;
// lorsqu'on n'exporte pas tout le diagram, il faut retirer les conducteurs non selectionnes
// et pour l'instant, les conducteurs non selectionnes sont les conducteurs dont un des elements n'est pas selectionne
@@ -659,13 +659,13 @@
else if (f -> terminal1 -> parentItem() -> isSelected() && f -> terminal2 -> parentItem() -> isSelected()) {
list_conductors << f;
}
- } else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
+ } else if (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
if (whole_content) list_texts << iti;
else if (iti -> isSelected()) list_texts << iti;
- } else if (DiagramImageItem *dii = qgraphicsitem_cast<DiagramImageItem *>(qgi)) {
+ } else if (auto *dii = qgraphicsitem_cast<DiagramImageItem *>(qgi)) {
if (whole_content) list_images << dii;
else if (dii -> isSelected()) list_images << dii;
- } else if (QetShapeItem *dsi = qgraphicsitem_cast<QetShapeItem *>(qgi)) {
+ } else if (auto *dsi = qgraphicsitem_cast<QetShapeItem *>(qgi)) {
if (whole_content) list_shapes << dsi;
else if (dsi -> isSelected()) list_shapes << dsi;
}
@@ -920,7 +920,7 @@
// Load text
QList<IndependentTextItem *> added_texts;
foreach (QDomElement text_xml, QET::findInDomElement(root, "inputs", "input")) {
- IndependentTextItem *iti = new IndependentTextItem();
+ auto *iti = new IndependentTextItem();
iti -> fromXml(text_xml);
addItem(iti);
added_texts << iti;
@@ -929,7 +929,7 @@
// Load image
QList<DiagramImageItem *> added_images;
foreach (QDomElement image_xml, QET::findInDomElement(root, "images", "image")) {
- DiagramImageItem *dii = new DiagramImageItem ();
+ auto *dii = new DiagramImageItem ();
dii -> fromXml(image_xml);
addItem(dii);
added_images << dii;
@@ -959,7 +959,7 @@
Terminal *p2 = table_adr_id.value(id_p2);
if (p1 != p2)
{
- Conductor *c = new Conductor(p1, p2);
+ auto *c = new Conductor(p1, p2);
if (c->isValid())
{
addItem(c);
@@ -1069,7 +1069,7 @@
{
case Conductor::Type:
{
- Conductor *conductor = static_cast<Conductor *>(item);
+ auto *conductor = static_cast<Conductor *>(item);
conductor->terminal1->addConductor(conductor);
conductor->terminal2->addConductor(conductor);
conductor->calculateTextItemPosition();
@@ -1078,7 +1078,7 @@
case IndependentTextItem::Type:
{
- const IndependentTextItem *text = static_cast<const IndependentTextItem *>(item);
+ const auto *text = static_cast<const IndependentTextItem *>(item);
connect(text, &IndependentTextItem::diagramTextChanged, this, &Diagram::diagramTextChanged);
}
}
@@ -1098,13 +1098,13 @@
{
case Element::Type:
{
- Element *elmt = static_cast<Element*>(item);
+ auto *elmt = static_cast<Element*>(item);
elmt->unlinkAllElements();
}
break;
case Conductor::Type:
{
- Conductor *conductor = static_cast<Conductor *>(item);
+ auto *conductor = static_cast<Conductor *>(item);
conductor->terminal1->removeConductor(conductor);
conductor->terminal2->removeConductor(conductor);
}
@@ -1112,7 +1112,7 @@
case IndependentTextItem::Type:
{
- const IndependentTextItem *text = static_cast<const IndependentTextItem *>(item);
+ const auto *text = static_cast<const IndependentTextItem *>(item);
disconnect(text, &IndependentTextItem::diagramTextChanged, this, &Diagram::diagramTextChanged);
}
}
@@ -1456,7 +1456,7 @@
QList<CustomElement *> Diagram::customElements() const {
QList<CustomElement *> elements_list;
foreach(QGraphicsItem *qgi, items()) {
- if (CustomElement *elmt = qgraphicsitem_cast<CustomElement *>(qgi)) {
+ if (auto *elmt = qgraphicsitem_cast<CustomElement *>(qgi)) {
elements_list << elmt;
}
}
@@ -1466,7 +1466,7 @@
QList <Element *> Diagram::elements() const {
QList<Element *> element_list;
foreach (QGraphicsItem *qgi, items()) {
- if (Element *elmt = qgraphicsitem_cast<Element *>(qgi))
+ if (auto *elmt = qgraphicsitem_cast<Element *>(qgi))
element_list <<elmt;
}
return (element_list);
@@ -1479,7 +1479,7 @@
QList <Conductor *> Diagram::conductors() const {
QList<Conductor *> cnd_list;
foreach (QGraphicsItem *qgi, items()) {
- if (Conductor *cnd = qgraphicsitem_cast<Conductor *>(qgi))
+ if (auto *cnd = qgraphicsitem_cast<Conductor *>(qgi))
cnd_list <<cnd;
}
return (cnd_list);
@@ -1662,7 +1662,7 @@
*/
void Diagram::setDrawTerminals(bool dt) {
foreach(QGraphicsItem *qgi, items()) {
- if (Terminal *t = qgraphicsitem_cast<Terminal *>(qgi)) {
+ if (auto *t = qgraphicsitem_cast<Terminal *>(qgi)) {
t -> setVisible(dt);
}
}
@@ -1683,7 +1683,7 @@
QSet<Conductor *> Diagram::selectedConductors() const {
QSet<Conductor *> conductors_set;
foreach(QGraphicsItem *qgi, selectedItems()) {
- if (Conductor *c = qgraphicsitem_cast<Conductor *>(qgi)) {
+ if (auto *c = qgraphicsitem_cast<Conductor *>(qgi)) {
conductors_set << c;
}
}
@@ -1761,11 +1761,11 @@
DiagramContent Diagram::content() const {
DiagramContent dc;
foreach(QGraphicsItem *qgi, items()) {
- if (Element *e = qgraphicsitem_cast<Element *>(qgi)) {
+ if (auto *e = qgraphicsitem_cast<Element *>(qgi)) {
dc.m_elements << e;
- } else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
+ } else if (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
dc.m_text_fields << iti;
- } else if (Conductor *c = qgraphicsitem_cast<Conductor *>(qgi)) {
+ } else if (auto *c = qgraphicsitem_cast<Conductor *>(qgi)) {
dc.m_conductors_to_move << c;
}
}
Modified: trunk/sources/diagramcommands.cpp
===================================================================
--- trunk/sources/diagramcommands.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagramcommands.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -260,7 +260,7 @@
setupAnimation(qgi->toGraphicsObject(), "pos", qgi->pos(), qgi->pos() + actual_movement);
else if(qgi->type() == QGraphicsItemGroup::Type) //ElementTextItemGroup is a QObject but not a QGraphicsObject
{
- if(ElementTextItemGroup *etig = dynamic_cast<ElementTextItemGroup *>(qgi))
+ if(auto *etig = dynamic_cast<ElementTextItemGroup *>(qgi))
setupAnimation(etig, "pos", etig->pos(), etig->pos() + actual_movement);
}
else qgi -> setPos(qgi->pos() + actual_movement);
@@ -286,7 +286,7 @@
void MoveElementsCommand::setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant& start, const QVariant& end) {
//create animation group if not yet.
if (m_anim_group == nullptr) m_anim_group = new QParallelAnimationGroup();
- QPropertyAnimation *animation = new QPropertyAnimation(target, propertyName);
+ auto *animation = new QPropertyAnimation(target, propertyName);
animation->setDuration(300);
animation->setStartValue(start);
animation->setEndValue(end);
Modified: trunk/sources/diagramcontent.cpp
===================================================================
--- trunk/sources/diagramcontent.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagramcontent.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -44,11 +44,11 @@
//Get the selected items
for (QGraphicsItem *item : m_selected_items)
{
- if (Element *elmt = qgraphicsitem_cast<Element *>(item))
+ if (auto *elmt = qgraphicsitem_cast<Element *>(item))
m_elements << elmt;
- else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
+ else if (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
m_text_fields << iti;
- else if (Conductor *c = qgraphicsitem_cast<Conductor *>(item))
+ else if (auto *c = qgraphicsitem_cast<Conductor *>(item))
{
//Get the isolated selected conductor (= not movable, but deletable)
if (!c->terminal1->parentItem()->isSelected() &&\
@@ -56,14 +56,14 @@
m_other_conductors << c;
}
}
- else if (DiagramImageItem *dii = qgraphicsitem_cast<DiagramImageItem *>(item))
+ else if (auto *dii = qgraphicsitem_cast<DiagramImageItem *>(item))
m_images << dii;
- else if (QetShapeItem *dsi = qgraphicsitem_cast<QetShapeItem *>(item))
+ else if (auto *dsi = qgraphicsitem_cast<QetShapeItem *>(item))
m_shapes << dsi;
- else if (DynamicElementTextItem *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item))
+ else if (auto *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item))
m_element_texts << deti;
- else if (QGraphicsItemGroup *group = qgraphicsitem_cast<QGraphicsItemGroup *>(item))
- if(ElementTextItemGroup *etig = dynamic_cast<ElementTextItemGroup *>(group))
+ else if (auto *group = qgraphicsitem_cast<QGraphicsItemGroup *>(item))
+ if(auto *etig = dynamic_cast<ElementTextItemGroup *>(group))
m_texts_groups << etig;
}
@@ -147,7 +147,7 @@
for(QGraphicsItem *qgi : m_selected_items)
if(qgi->type() == QGraphicsItemGroup::Type)
- if(ElementTextItemGroup *grp = dynamic_cast<ElementTextItemGroup *>(qgi))
+ if(auto *grp = dynamic_cast<ElementTextItemGroup *>(qgi))
groups << grp;
return groups;
Modified: trunk/sources/diagramcontextwidget.cpp
===================================================================
--- trunk/sources/diagramcontextwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagramcontextwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -183,7 +183,7 @@
Initialize the layout of this widget.
*/
void DiagramContextWidget::initLayout() {
- QVBoxLayout *vlayout0 = new QVBoxLayout();
+ auto *vlayout0 = new QVBoxLayout();
vlayout0 -> setContentsMargins(0, 0, 0, 0);
vlayout0 -> addWidget(format_label);
vlayout0 -> addWidget(table_);
Modified: trunk/sources/diagramevent/diagrameventaddelement.cpp
===================================================================
--- trunk/sources/diagramevent/diagrameventaddelement.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagramevent/diagrameventaddelement.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -230,7 +230,7 @@
{
QPair <Terminal *, Terminal *> pair = element -> AlignedFreeTerminals().takeFirst();
- Conductor *conductor = new Conductor(pair.first, pair.second);
+ auto *conductor = new Conductor(pair.first, pair.second);
new AddItemCommand<Conductor *>(conductor, m_diagram, QPointF(), undo_object);
//Autonum the new conductor, the undo command associated for this, have for parent undo_object
Modified: trunk/sources/diagramevent/diagrameventaddtext.cpp
===================================================================
--- trunk/sources/diagramevent/diagrameventaddtext.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagramevent/diagrameventaddtext.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -45,7 +45,7 @@
{
if (event->button() == Qt::LeftButton)
{
- IndependentTextItem *text = new IndependentTextItem();
+ auto *text = new IndependentTextItem();
m_diagram -> undoStack().push(new AddItemCommand<IndependentTextItem *>(text, m_diagram, event->scenePos()));
text->setTextInteractionFlags(Qt::TextEditorInteraction);
text->setFocus(Qt::MouseFocusReason);
Modified: trunk/sources/diagramfoliolist.cpp
===================================================================
--- trunk/sources/diagramfoliolist.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagramfoliolist.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -236,16 +236,16 @@
qreal y0 = tablesSpacing + rect.topLeft().y();
for (int i = 0; i < tables; ++i) {
- QRectF *tableRect = new QRectF(x0, y0, tableWidth, rect.height() - 2*tablesSpacing);
+ auto *tableRect = new QRectF(x0, y0, tableWidth, rect.height() - 2*tablesSpacing);
qp->drawRect(*tableRect);
list_rectangles_.push_back(tableRect);
for (int j = 1; j < rows; ++j) {
- QLineF *line = new QLineF(x0, y0 + j*rowHeight, x0 + tableWidth,y0 + j*rowHeight);
+ auto *line = new QLineF(x0, y0 + j*rowHeight, x0 + tableWidth,y0 + j*rowHeight);
qp->drawLine(*line);
list_lines_.push_back(line);
}
for (int j = 0; j < cols-1; ++j) {
- QLineF *line = new QLineF(x0 + colWidths[j]*tableWidth, y0, x0 + colWidths[j]*tableWidth,y0 + rows*rowHeight);
+ auto *line = new QLineF(x0 + colWidths[j]*tableWidth, y0, x0 + colWidths[j]*tableWidth,y0 + rows*rowHeight);
qp->drawLine(*line);
list_lines_.push_back(line);
x0 += colWidths[j]*tableWidth;
Modified: trunk/sources/diagramprintdialog.cpp
===================================================================
--- trunk/sources/diagramprintdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagramprintdialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -187,7 +187,7 @@
QRect printable_area = fullpage ? printer_ -> paperRect() : printer_ -> pageRect();
QRect diagram_rect = diagramRect(diagram, options);
- int h_pages_count = int(ceil(qreal(diagram_rect.width()) / qreal(printable_area.width())));
+ auto h_pages_count = int(ceil(qreal(diagram_rect.width()) / qreal(printable_area.width())));
return(h_pages_count);
}
@@ -203,7 +203,7 @@
QRect printable_area = fullpage ? printer_ -> paperRect() : printer_ -> pageRect();
QRect diagram_rect = diagramRect(diagram, options);
- int v_pages_count = int(ceil(qreal(diagram_rect.height()) / qreal(printable_area.height())));
+ auto v_pages_count = int(ceil(qreal(diagram_rect.height()) / qreal(printable_area.height())));
return(v_pages_count);
}
Modified: trunk/sources/diagramschooser.cpp
===================================================================
--- trunk/sources/diagramschooser.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagramschooser.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -164,7 +164,7 @@
QString diagram_title = diagram -> title();
if (diagram_title.isEmpty()) diagram_title = tr("Folio sans titre");
- QCheckBox *checkbox = new QCheckBox(diagram_title);
+ auto *checkbox = new QCheckBox(diagram_title);
checkbox -> setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum));
checkbox -> setChecked(selected_diagrams.contains(diagram));
connect(checkbox, SIGNAL(toggled(bool)), this, SIGNAL(selectionChanged()));
Modified: trunk/sources/diagramview.cpp
===================================================================
--- trunk/sources/diagramview.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/diagramview.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -227,7 +227,7 @@
QString integrated_template_name = tbt_loc.name();
if (mustIntegrateTitleBlockTemplate(tbt_loc))
{
- IntegrationMoveTitleBlockTemplatesHandler *handler = new IntegrationMoveTitleBlockTemplatesHandler(this);
+ auto *handler = new IntegrationMoveTitleBlockTemplatesHandler(this);
//QString error_message;
integrated_template_name = m_diagram->project()->integrateTitleBlockTemplate(tbt_loc, handler);
@@ -507,7 +507,7 @@
{
if (QGesture *gesture = event->gesture(Qt::PinchGesture))
{
- QPinchGesture *pinch = static_cast<QPinchGesture *>(gesture);
+ auto *pinch = static_cast<QPinchGesture *>(gesture);
if (pinch->changeFlags() & QPinchGesture::ScaleFactorChanged)
{
qreal value = gesture->property("scaleFactor").toReal();
@@ -831,7 +831,7 @@
ConductorProperties initial_properties = edited_conductor -> properties();
// prepare a color dialog showing the initial conductor color
- QColorDialog *color_dialog = new QColorDialog(this);
+ auto *color_dialog = new QColorDialog(this);
color_dialog -> setWindowTitle(tr("Choisir la nouvelle couleur de ce conducteur"));
#ifdef Q_OS_MAC
color_dialog -> setWindowFlags(Qt::Sheet);
@@ -850,7 +850,7 @@
initial_properties.color = new_color;
new_value.setValue(initial_properties);
- QPropertyUndoCommand *undo = new QPropertyUndoCommand(edited_conductor, "properties", old_value, new_value);
+ auto *undo = new QPropertyUndoCommand(edited_conductor, "properties", old_value, new_value);
undo->setText(tr("Modifier les propriétés d'un conducteur", "undo caption"));
diagram() -> undoStack().push(undo);
}
@@ -958,11 +958,11 @@
// note: QInputEvent::modifiers and QKeyEvent::modifiers() do not return the
// same values, hence the casts
if (e -> type() == QEvent::KeyPress || e -> type() == QEvent::KeyRelease) {
- if (QKeyEvent *ke = static_cast<QKeyEvent *>(e)) {
+ if (auto *ke = static_cast<QKeyEvent *>(e)) {
result = (ke -> modifiers() == (Qt::ControlModifier | Qt::ShiftModifier));
}
} else if (e -> type() >= QEvent::MouseButtonPress && e -> type() <= QEvent::MouseMove) {
- if (QMouseEvent *me = static_cast<QMouseEvent *>(e)) {
+ if (auto *me = static_cast<QMouseEvent *>(e)) {
result = (me -> modifiers() == (Qt::ControlModifier | Qt::ShiftModifier));
}
}
@@ -992,11 +992,11 @@
//We use dynamic_cast instead of qgraphicsitem_cast for QetGraphicsItem
//because they haven't got they own type().
//Use qgraphicsitem_cast will have weird behavior for this class.
- if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
+ if (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
iti -> edit();
- else if (QetGraphicsItem *qgi = dynamic_cast<QetGraphicsItem *> (item))
+ else if (auto *qgi = dynamic_cast<QetGraphicsItem *> (item))
qgi -> editProperty();
- else if (Conductor *c = qgraphicsitem_cast<Conductor *>(item))
+ else if (auto *c = qgraphicsitem_cast<Conductor *>(item))
c -> editProperty();
}
@@ -1084,7 +1084,7 @@
QList <QAction *> list = contextMenuActions();
if(!list.isEmpty())
{
- QMenu *context_menu = new QMenu(this);
+ auto *context_menu = new QMenu(this);
context_menu->addActions(list);
context_menu->popup(e->globalPos());
e->accept();
Modified: trunk/sources/editor/arceditor.cpp
===================================================================
--- trunk/sources/editor/arceditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/arceditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -47,9 +47,9 @@
h->setRange(-5000, 5000);
v->setRange(-5000, 5000);
- QVBoxLayout *v_layout = new QVBoxLayout(this);
+ auto *v_layout = new QVBoxLayout(this);
- QGridLayout *grid = new QGridLayout();
+ auto *grid = new QGridLayout();
grid -> addWidget(new QLabel(tr("Centre : ")), 0, 0);
grid -> addWidget(new QLabel("x"), 1, 0, Qt::AlignRight);
grid -> addWidget(x, 1, 1);
@@ -99,7 +99,7 @@
return(true);
}
- if (PartArc *part_arc = dynamic_cast<PartArc *>(new_part))
+ if (auto *part_arc = dynamic_cast<PartArc *>(new_part))
{
if (part == part_arc) return true;
if (part)
Modified: trunk/sources/editor/elementprimitivedecorator.cpp
===================================================================
--- trunk/sources/editor/elementprimitivedecorator.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/elementprimitivedecorator.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -122,7 +122,7 @@
QList<CustomElementPart *> primitives;
for(QGraphicsItem *item : items)
{
- if (CustomElementPart *part_item = dynamic_cast<CustomElementPart *>(item))
+ if (auto *part_item = dynamic_cast<CustomElementPart *>(item))
{
primitives << part_item;
}
@@ -143,7 +143,7 @@
QList<QGraphicsItem *> ElementPrimitiveDecorator::graphicsItems() const {
QList<QGraphicsItem *> list;
foreach (CustomElementPart *part_item, decorated_items_) {
- if (QGraphicsItem *item = dynamic_cast<QGraphicsItem *>(part_item)) {
+ if (auto *item = dynamic_cast<QGraphicsItem *>(part_item)) {
list << item;
}
}
@@ -555,7 +555,7 @@
ElementEditionCommand *command = nullptr;
if (current_operation_square_ > QET::NoOperation)
{
- ScalePartsCommand *scale_command = new ScalePartsCommand();
+ auto *scale_command = new ScalePartsCommand();
scale_command -> setScaledPrimitives(items());
scale_command -> setTransformation(
mapToScene(original_bounding_rect_).boundingRect(),
@@ -717,7 +717,7 @@
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
- QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
+ auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{
Modified: trunk/sources/editor/elementscene.cpp
===================================================================
--- trunk/sources/editor/elementscene.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/elementscene.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -416,7 +416,7 @@
{
//If the export concerns only the selection, the not selected part is ignored
if (!all_parts && !qgi -> isSelected()) continue;
- if (CustomElementPart *ce = dynamic_cast<CustomElementPart *>(qgi))
+ if (auto *ce = dynamic_cast<CustomElementPart *>(qgi))
{
if (ce -> isUseless()) continue;
description.appendChild(ce -> toXml(xml_document));
@@ -492,7 +492,7 @@
if (qgi->type() == ElementPrimitiveDecorator::Type) continue;
if (qgi->type() == QGraphicsRectItem::Type) continue;
if (qgi->type() == PartDynamicTextField::Type) continue;
- if (CustomElementPart *cep = dynamic_cast <CustomElementPart*> (qgi)) {
+ if (auto *cep = dynamic_cast <CustomElementPart*> (qgi)) {
esgr |= cep -> sceneGeometricRect();
}
}
@@ -675,7 +675,7 @@
#endif
dialog_author.setMinimumSize(400, 260);
dialog_author.setWindowTitle(tr("Éditer les informations sur l'auteur", "window title"));
- QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog_author);
+ auto *dialog_layout = new QVBoxLayout(&dialog_author);
// ajoute un champ explicatif au dialogue
QLabel *information_label = new QLabel(tr("Vous pouvez utiliser ce champ libre pour mentionner les auteurs de l'élément, sa licence, ou tout autre renseignement que vous jugerez utile."));
@@ -684,7 +684,7 @@
dialog_layout -> addWidget(information_label);
// ajoute un QTextEdit au dialogue
- QTextEdit *text_field = new QTextEdit();
+ auto *text_field = new QTextEdit();
text_field -> setAcceptRichText(false);
text_field -> setPlainText(informations());
text_field -> setReadOnly(is_read_only);
@@ -738,7 +738,7 @@
dialog.setModal(true);
dialog.setMinimumSize(400, 330);
dialog.setWindowTitle(tr("Éditer les noms", "window title"));
- QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog);
+ auto *dialog_layout = new QVBoxLayout(&dialog);
// ajoute un champ explicatif au dialogue
QLabel *information_label = new QLabel(tr("Vous pouvez spécifier le nom de l'élément dans plusieurs langues."));
@@ -747,7 +747,7 @@
dialog_layout -> addWidget(information_label);
// ajoute un NamesListWidget au dialogue
- NamesListWidget *names_widget = new NamesListWidget();
+ auto *names_widget = new NamesListWidget();
names_widget -> setNames(m_names_list);
names_widget -> setReadOnly(is_read_only);
dialog_layout -> addWidget(names_widget);
@@ -772,7 +772,7 @@
QList<CustomElementPart *> ElementScene::primitives() const {
QList<CustomElementPart *> primitives_list;
foreach (QGraphicsItem *item, items()) {
- if (CustomElementPart *primitive = dynamic_cast<CustomElementPart *>(item)) {
+ if (auto *primitive = dynamic_cast<CustomElementPart *>(item)) {
primitives_list << primitive;
}
}
@@ -1001,7 +1001,7 @@
else if (qde.tagName() == "input") cep = pdtf = new PartDynamicTextField(m_element_editor);
else continue;
- if (QGraphicsItem *qgi = dynamic_cast<QGraphicsItem *>(cep))
+ if (auto *qgi = dynamic_cast<QGraphicsItem *>(cep))
{
if (!qgi->zValue())
qgi->setZValue(z++);
@@ -1180,7 +1180,7 @@
if (!command -> elementView()) {
foreach (QGraphicsView *view, views()) {
- if (ElementView *element_view = dynamic_cast<ElementView *>(view)) {
+ if (auto *element_view = dynamic_cast<ElementView *>(view)) {
command -> setElementView(element_view);
break;
}
Modified: trunk/sources/editor/elementview.cpp
===================================================================
--- trunk/sources/editor/elementview.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/elementview.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -296,7 +296,7 @@
// si quelque chose a effectivement ete ajoute au schema, on cree un objet d'annulation
if (content_pasted.count()) {
m_scene -> clearSelection();
- PastePartsCommand *undo_object = new PastePartsCommand(this, content_pasted);
+ auto *undo_object = new PastePartsCommand(this, content_pasted);
m_scene -> undoStack().push(undo_object);
}
return(content_pasted);
@@ -343,7 +343,7 @@
// si quelque chose a effectivement ete ajoute au schema, on cree un objet d'annulation
if (content_pasted.count()) {
m_scene -> clearSelection();
- PastePartsCommand *undo_object = new PastePartsCommand(this, content_pasted);
+ auto *undo_object = new PastePartsCommand(this, content_pasted);
undo_object -> setOffset(offset_paste_count_ - 1, old_start_top_left_corner, offset_paste_count_, start_top_left_corner_);
m_scene -> undoStack().push(undo_object);
}
@@ -446,7 +446,7 @@
*/
bool ElementView::gestureEvent(QGestureEvent *event){
if (QGesture *gesture = event->gesture(Qt::PinchGesture)) {
- QPinchGesture *pinch = static_cast<QPinchGesture *>(gesture);
+ auto *pinch = static_cast<QPinchGesture *>(gesture);
if (pinch->changeFlags() & QPinchGesture::ScaleFactorChanged){
qreal value = gesture->property("scaleFactor").toReal();
if (value > 1){
@@ -515,9 +515,9 @@
qreal limite_x = r.x() + r.width();
qreal limite_y = r.y() + r.height();
- int g_x = (int)ceil(r.x());
+ auto g_x = (int)ceil(r.x());
while (g_x % drawn_x_grid) ++ g_x;
- int g_y = (int)ceil(r.y());
+ auto g_y = (int)ceil(r.y());
while (g_y % drawn_y_grid) ++ g_y;
for (int gx = g_x ; gx < limite_x ; gx += drawn_x_grid) {
Modified: trunk/sources/editor/ellipseeditor.cpp
===================================================================
--- trunk/sources/editor/ellipseeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/ellipseeditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -44,9 +44,9 @@
h->setRange(-5000, 5000);
v->setRange(-5000, 5000);
- QVBoxLayout *v_layout = new QVBoxLayout(this);
+ auto *v_layout = new QVBoxLayout(this);
- QGridLayout *grid = new QGridLayout();
+ auto *grid = new QGridLayout();
grid -> addWidget(new QLabel(tr("Centre : ")), 0, 0);
grid -> addWidget(new QLabel("x"), 1, 0, Qt::AlignRight);
grid -> addWidget(x, 1, 1);
@@ -88,7 +88,7 @@
style_ -> setPart(nullptr);
return(true);
}
- if (PartEllipse *part_ellipse = dynamic_cast<PartEllipse *>(new_part))
+ if (auto *part_ellipse = dynamic_cast<PartEllipse *>(new_part))
{
if (part == part_ellipse) return true;
if (part)
Modified: trunk/sources/editor/graphicspart/partarc.cpp
===================================================================
--- trunk/sources/editor/graphicspart/partarc.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/graphicspart/partarc.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -218,7 +218,7 @@
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
- QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
+ auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{
Modified: trunk/sources/editor/graphicspart/partellipse.cpp
===================================================================
--- trunk/sources/editor/graphicspart/partellipse.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/graphicspart/partellipse.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -214,7 +214,7 @@
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
- QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
+ auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{
Modified: trunk/sources/editor/graphicspart/partline.cpp
===================================================================
--- trunk/sources/editor/graphicspart/partline.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/graphicspart/partline.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -190,7 +190,7 @@
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
- QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
+ auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{
Modified: trunk/sources/editor/graphicspart/partpolygon.cpp
===================================================================
--- trunk/sources/editor/graphicspart/partpolygon.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/graphicspart/partpolygon.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -308,7 +308,7 @@
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
- QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
+ auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{
Modified: trunk/sources/editor/graphicspart/partrectangle.cpp
===================================================================
--- trunk/sources/editor/graphicspart/partrectangle.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/graphicspart/partrectangle.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -322,7 +322,7 @@
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
- QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
+ auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{
Modified: trunk/sources/editor/lineeditor.cpp
===================================================================
--- trunk/sources/editor/lineeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/lineeditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -62,7 +62,7 @@
end1_length = new QDoubleSpinBox();
end2_length = new QDoubleSpinBox();
- QGridLayout *grid = new QGridLayout();
+ auto *grid = new QGridLayout();
grid -> addWidget(new QLabel("x1"), 0, 0);
grid -> addWidget(x1, 0, 1);
grid -> addWidget(new QLabel("y1"), 0, 2);
@@ -72,7 +72,7 @@
grid -> addWidget(new QLabel("y2"), 1, 2);
grid -> addWidget(y2, 1, 3);
- QGridLayout *grid2 = new QGridLayout();
+ auto *grid2 = new QGridLayout();
grid2 -> addWidget(new QLabel(tr("Fin 1")), 0, 0);
grid2 -> addWidget(end1_type, 0, 1);
grid2 -> addWidget(end1_length, 0, 2);
@@ -80,7 +80,7 @@
grid2 -> addWidget(end2_type, 1, 1);
grid2 -> addWidget(end2_length, 1, 2);
- QVBoxLayout *v_layout = new QVBoxLayout(this);
+ auto *v_layout = new QVBoxLayout(this);
v_layout -> addWidget(style_);
v_layout -> addLayout(grid);
v_layout -> addLayout(grid2);
@@ -115,7 +115,7 @@
style_ -> setPart(nullptr);
return(true);
}
- if (PartLine *part_line = dynamic_cast<PartLine *>(new_part))
+ if (auto *part_line = dynamic_cast<PartLine *>(new_part))
{
if (part == part_line) return true;
if (part)
Modified: trunk/sources/editor/polygoneditor.cpp
===================================================================
--- trunk/sources/editor/polygoneditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/polygoneditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -45,7 +45,7 @@
updateForm();
// layout
- QVBoxLayout *layout = new QVBoxLayout(this);
+ auto *layout = new QVBoxLayout(this);
layout -> addWidget(style_);
layout -> addWidget(new QLabel(tr("Points du polygone :")));
layout -> addWidget(&points_list);
@@ -106,7 +106,7 @@
point = part -> mapToScene(point);
QStringList qsl;
qsl << QString("%1").arg(point.x()) << QString("%1").arg(point.y());
- QTreeWidgetItem *qtwi = new QTreeWidgetItem(qsl);
+ auto *qtwi = new QTreeWidgetItem(qsl);
qtwi -> setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable);
points_list.addTopLevelItem(qtwi);
}
@@ -135,7 +135,7 @@
style_ -> setPart(nullptr);
return(true);
}
- if (PartPolygon *part_polygon = dynamic_cast<PartPolygon *>(new_part))
+ if (auto *part_polygon = dynamic_cast<PartPolygon *>(new_part))
{
if (part == part_polygon) return true;
if (part)
Modified: trunk/sources/editor/qetelementeditor.cpp
===================================================================
--- trunk/sources/editor/qetelementeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/qetelementeditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -537,7 +537,7 @@
m_undo_dock -> setFeatures(QDockWidget::AllDockWidgetFeatures);
m_undo_dock -> setMinimumWidth(290);
addDockWidget(Qt::RightDockWidgetArea, m_undo_dock);
- QUndoView* undo_view = new QUndoView(&(m_elmt_scene -> undoStack()), this);
+ auto* undo_view = new QUndoView(&(m_elmt_scene -> undoStack()), this);
undo_view -> setEmptyLabel(tr("Aucune modification"));
m_undo_dock -> setWidget(undo_view);
@@ -596,7 +596,7 @@
style_editable = true;
foreach (QGraphicsItem *qgi, selected_qgis)
{
- if (CustomElementPart *cep = dynamic_cast<CustomElementPart *>(qgi))
+ if (auto *cep = dynamic_cast<CustomElementPart *>(qgi))
cep_list << cep;
else
style_editable = false;
@@ -609,11 +609,11 @@
if(selected_qgis.size() == 1)
{
QGraphicsItem *qgi = selected_qgis.first();
- if (CustomElementPart *selection = dynamic_cast<CustomElementPart *>(qgi))
+ if (auto *selection = dynamic_cast<CustomElementPart *>(qgi))
{
if (QWidget *widget = m_tools_dock_stack->widget(1))
{
- if (ElementItemEditor *editor = dynamic_cast<ElementItemEditor *>(widget))
+ if (auto *editor = dynamic_cast<ElementItemEditor *>(widget))
{
if(editor->currentPart() == selection)
return;
@@ -626,11 +626,11 @@
if (selected_qgis.size() == 1)
{
QGraphicsItem *qgi = selected_qgis.first();
- if (CustomElementPart *selection = dynamic_cast<CustomElementPart *>(qgi))
+ if (auto *selection = dynamic_cast<CustomElementPart *>(qgi))
{
//The current editor already edit the selected part
if (QWidget *widget = m_tools_dock_stack->widget(1))
- if (ElementItemEditor *editor = dynamic_cast<ElementItemEditor *>(widget))
+ if (auto *editor = dynamic_cast<ElementItemEditor *>(widget))
if(editor->currentPart() == selection)
return;
@@ -1065,7 +1065,7 @@
QString program = (QDir::homePath() + "/.qet/DXFtoQET");
#endif
QStringList arguments;
-QProcess *DXF = new QProcess(qApp);
+auto *DXF = new QProcess(qApp);
DXF->start(program,arguments);
}
@@ -1336,9 +1336,9 @@
if (qgis.count() <= QET_MAX_PARTS_IN_ELEMENT_EDITOR_LIST) {
for (int j = qgis.count() - 1 ; j >= 0 ; -- j) {
QGraphicsItem *qgi = qgis[j];
- if (CustomElementPart *cep = dynamic_cast<CustomElementPart *>(qgi)) {
+ if (auto *cep = dynamic_cast<CustomElementPart *>(qgi)) {
QString part_desc = cep -> name();
- QListWidgetItem *qlwi = new QListWidgetItem(part_desc);
+ auto *qlwi = new QListWidgetItem(part_desc);
QVariant v;
v.setValue<QGraphicsItem *>(qgi);
qlwi -> setData(42, v);
@@ -1382,7 +1382,7 @@
m_parts_list -> blockSignals(true);
for (int i = 0 ; i < m_parts_list -> count() ; ++ i) {
QListWidgetItem *qlwi = m_parts_list -> item(i);
- QGraphicsItem *qgi = qlwi -> data(42).value<QGraphicsItem *>();
+ auto *qgi = qlwi -> data(42).value<QGraphicsItem *>();
if (qgi) {
qgi -> setSelected(qlwi -> isSelected());
}
@@ -1578,7 +1578,7 @@
if (!m_tools_dock_stack -> currentIndex()) return;
// s'il y a un widget d'edition affiche, on le met a jour
- if (ElementItemEditor *current_editor = dynamic_cast<ElementItemEditor *>(m_tools_dock_stack->widget(1))) {
+ if (auto *current_editor = dynamic_cast<ElementItemEditor *>(m_tools_dock_stack->widget(1))) {
current_editor -> updateForm();
}
}
Modified: trunk/sources/editor/styleeditor.cpp
===================================================================
--- trunk/sources/editor/styleeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/styleeditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -98,7 +98,7 @@
main_layout -> addWidget(new QLabel("<u>" + tr("Apparence :") + "</u> "));
- QHBoxLayout *color_layout = new QHBoxLayout();
+ auto *color_layout = new QHBoxLayout();
color_layout -> addWidget(new QLabel(tr("Contour :")), 0, Qt::AlignRight);
color_layout -> addWidget(outline_color);
color_layout -> addSpacing(10);
@@ -106,7 +106,7 @@
color_layout -> addWidget(filling_color);
main_layout -> addLayout(color_layout);
- QHBoxLayout *style_layout = new QHBoxLayout();
+ auto *style_layout = new QHBoxLayout();
style_layout -> addWidget(new QLabel(tr("Style : ")), 0, Qt::AlignRight);
style_layout -> addWidget(line_style);
style_layout -> addSpacing(10);
@@ -205,7 +205,7 @@
return(true);
}
- if (CustomElementGraphicPart *part_graphic = dynamic_cast<CustomElementGraphicPart *>(new_part))
+ if (auto *part_graphic = dynamic_cast<CustomElementGraphicPart *>(new_part))
{
part = part_graphic;
updateForm();
@@ -237,7 +237,7 @@
foreach (CustomElementPart *cep, part_list)
{
- if (CustomElementGraphicPart *cegp = dynamic_cast<CustomElementGraphicPart *>(cep))
+ if (auto *cegp = dynamic_cast<CustomElementGraphicPart *>(cep))
m_part_list << cegp;
else
return false;
Modified: trunk/sources/editor/terminaleditor.cpp
===================================================================
--- trunk/sources/editor/terminaleditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/terminaleditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -48,10 +48,10 @@
orientation -> addItem(QET::Icons::South, tr("Sud"), Qet::South);
orientation -> addItem(QET::Icons::West, tr("Ouest"), Qet::West);
- QVBoxLayout *main_layout = new QVBoxLayout();
+ auto *main_layout = new QVBoxLayout();
main_layout -> addWidget(new QLabel(tr("Position : ")));
- QHBoxLayout *position = new QHBoxLayout();
+ auto *position = new QHBoxLayout();
position -> addWidget(new QLabel(tr("x : ")));
position -> addWidget(qle_x );
position -> addWidget(new QLabel(tr("y : ")));
@@ -58,7 +58,7 @@
position -> addWidget(qle_y );
main_layout -> addLayout(position);
- QHBoxLayout *ori = new QHBoxLayout();
+ auto *ori = new QHBoxLayout();
ori -> addWidget(new QLabel(tr("Orientation : ")));
ori -> addWidget(orientation );
main_layout -> addLayout(ori);
@@ -91,7 +91,7 @@
part = nullptr;
return(true);
}
- if (PartTerminal *part_terminal = dynamic_cast<PartTerminal *>(new_part))
+ if (auto *part_terminal = dynamic_cast<PartTerminal *>(new_part))
{
if(part == part_terminal) return true;
if (part)
Modified: trunk/sources/editor/texteditor.cpp
===================================================================
--- trunk/sources/editor/texteditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/texteditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -51,10 +51,10 @@
qle_x -> setRange(-5000, 5000);
qle_y -> setRange(-5000, 5000);
- QVBoxLayout *main_layout = new QVBoxLayout();
+ auto *main_layout = new QVBoxLayout();
main_layout -> addWidget(new QLabel(tr("Position : ")));
- QHBoxLayout *position = new QHBoxLayout();
+ auto *position = new QHBoxLayout();
position -> addWidget(new QLabel(tr("x : ")));
position -> addWidget(qle_x );
position -> addWidget(new QLabel(tr("y : ")));
@@ -61,12 +61,12 @@
position -> addWidget(qle_y );
main_layout -> addLayout(position);
- QHBoxLayout *fs = new QHBoxLayout();
+ auto *fs = new QHBoxLayout();
fs -> addWidget(new QLabel(tr("Taille : ")));
fs -> addWidget(font_size);
main_layout -> addLayout(fs);
- QHBoxLayout *color_layout = new QHBoxLayout();
+ auto *color_layout = new QHBoxLayout();
color_layout -> addWidget(new QLabel(tr("Couleur : ")));
color_layout -> addWidget(black_color_);
color_layout -> addWidget(white_color_);
@@ -73,11 +73,11 @@
color_layout -> addStretch();
main_layout -> addLayout(color_layout);
- QHBoxLayout *t = new QHBoxLayout();
+ auto *t = new QHBoxLayout();
t -> addWidget(new QLabel(tr("Texte : ")));
t -> addWidget(qle_text);
- QHBoxLayout *rotation_angle_layout = new QHBoxLayout();
+ auto *rotation_angle_layout = new QHBoxLayout();
rotation_angle_layout -> addWidget(rotation_angle_label);
rotation_angle_layout -> addWidget(rotation_angle_);
@@ -110,7 +110,7 @@
part = nullptr;
return(true);
}
- if (PartText *part_text = dynamic_cast<PartText *>(new_part))
+ if (auto *part_text = dynamic_cast<PartText *>(new_part))
{
if (part == part_text) return true;
part = part_text;
Modified: trunk/sources/editor/ui/dynamictextfieldeditor.cpp
===================================================================
--- trunk/sources/editor/ui/dynamictextfieldeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/ui/dynamictextfieldeditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -228,7 +228,7 @@
void DynamicTextFieldEditor::on_m_width_sb_editingFinished()
{
- qreal width = (qreal)ui->m_width_sb->value();
+ auto width = (qreal)ui->m_width_sb->value();
if(width != m_text_field.data()->textWidth())
{
Modified: trunk/sources/editor/ui/elementpropertieseditorwidget.cpp
===================================================================
--- trunk/sources/editor/ui/elementpropertieseditorwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/ui/elementpropertieseditorwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -156,7 +156,7 @@
for(const QString& key : keys)
{
- QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_tree);
+ auto *qtwi = new QTreeWidgetItem(ui->m_tree);
qtwi->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable);
qtwi->setData(0, Qt::DisplayRole, QETApp::elementTranslatedInfoKey(key));
qtwi->setData(0, Qt::UserRole, key);
Modified: trunk/sources/editor/ui/rectangleeditor.cpp
===================================================================
--- trunk/sources/editor/ui/rectangleeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/editor/ui/rectangleeditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -68,7 +68,7 @@
return(true);
}
- if (PartRectangle *part_rectangle = dynamic_cast<PartRectangle *>(part))
+ if (auto *part_rectangle = dynamic_cast<PartRectangle *>(part))
{
if (m_part == part_rectangle) {
return true;
@@ -147,7 +147,7 @@
}
m_locked = true;
- QUndoCommand *undo = new QUndoCommand();
+ auto *undo = new QUndoCommand();
undo->setText(tr("Modifier un rectangle"));
QRectF rect(editedTopLeft(), QSizeF(ui->m_width_sb->value(), ui->m_height_sb->value()));
Modified: trunk/sources/elementdialog.cpp
===================================================================
--- trunk/sources/elementdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/elementdialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -53,7 +53,7 @@
setWindowFlags(Qt::Sheet);
#endif
- QVBoxLayout *layout = new QVBoxLayout(this);
+ auto *layout = new QVBoxLayout(this);
QString title_, label_;
switch (m_mode)
@@ -142,7 +142,7 @@
*/
void ElementDialog::indexClicked(const QModelIndex &index)
{
- ElementCollectionItem *eci = static_cast<ElementCollectionItem*> (m_model->itemFromIndex(index));
+ auto *eci = static_cast<ElementCollectionItem*> (m_model->itemFromIndex(index));
m_location = ElementsLocation(eci->collectionPath());
checkCurrentLocation();
}
@@ -300,7 +300,7 @@
*/
ElementsLocation ElementDialog::execConfiguredDialog(int mode, QWidget *parentWidget)
{
- ElementDialog *element_dialog = new ElementDialog(mode, parentWidget);
+ auto *element_dialog = new ElementDialog(mode, parentWidget);
element_dialog->exec();
ElementsLocation location = element_dialog->location();
delete element_dialog;
Modified: trunk/sources/elementscategoryeditor.cpp
===================================================================
--- trunk/sources/elementscategoryeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/elementscategoryeditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -99,7 +99,7 @@
*/
void ElementsCategoryEditor::setUpWidget()
{
- QVBoxLayout *editor_layout = new QVBoxLayout();
+ auto *editor_layout = new QVBoxLayout();
setLayout(editor_layout);
m_names_list = new NamesListWidget();
@@ -109,7 +109,7 @@
m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(m_buttons, SIGNAL(rejected()), this, SLOT(reject()));
- QHBoxLayout *internal_name_layout = new QHBoxLayout();
+ auto *internal_name_layout = new QHBoxLayout();
internal_name_layout -> addWidget(m_file_name);
internal_name_layout -> addWidget(m_file_line_edit);
Modified: trunk/sources/elementsmover.cpp
===================================================================
--- trunk/sources/elementsmover.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/elementsmover.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -128,7 +128,7 @@
if (!movement_running_) return;
//empty command to be used has parent of commands below
- QUndoCommand *undo_object = new QUndoCommand();
+ auto *undo_object = new QUndoCommand();
//Create undo move if there is a movement
if (!current_movement_.isNull()) {
@@ -151,7 +151,7 @@
{
QPair <Terminal *, Terminal *> pair = elmt -> AlignedFreeTerminals().takeFirst();
- Conductor *conductor = new Conductor(pair.first, pair.second);
+ auto *conductor = new Conductor(pair.first, pair.second);
//Create an undo object for each new auto conductor, with undo_object for parent
new AddItemCommand<Conductor *>(conductor, diagram_, QPointF(), undo_object);
Modified: trunk/sources/elementspanel.cpp
===================================================================
--- trunk/sources/elementspanel.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/elementspanel.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -98,11 +98,11 @@
void ElementsPanel::startTitleBlockTemplateDrag(const TitleBlockTemplateLocation &location) {
QString location_string = location.toString();
- QMimeData *mime_data = new QMimeData();
+ auto *mime_data = new QMimeData();
mime_data -> setText(location_string);
mime_data -> setData("application/x-qet-titleblock-uri", location_string.toLatin1());
- QDrag *drag = new QDrag(this);
+ auto *drag = new QDrag(this);
drag -> setMimeData(mime_data);
drag -> setPixmap(QET::Icons::TitleBlock.pixmap(22, 16));
drag -> start(Qt::CopyAction);
@@ -232,10 +232,10 @@
void ElementsPanel::slot_doubleClick(QTreeWidgetItem *qtwi, int) {
int qtwi_type = qtwi -> type();
if (qtwi_type == QET::Project) {
- QETProject *project = valueForItem<QETProject *>(qtwi);
+ auto *project = valueForItem<QETProject *>(qtwi);
emit(requestForProject(project));
} else if (qtwi_type == QET::Diagram) {
- Diagram *diagram = valueForItem<Diagram *>(qtwi);
+ auto *diagram = valueForItem<Diagram *>(qtwi);
emit(requestForDiagram(diagram));
} else if (qtwi_type == QET::TitleBlockTemplate) {
TitleBlockTemplateLocation tbt = valueForItem<TitleBlockTemplateLocation>(qtwi);
Modified: trunk/sources/elementspanelwidget.cpp
===================================================================
--- trunk/sources/elementspanelwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/elementspanelwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -99,7 +99,7 @@
);
// disposition verticale
- QVBoxLayout *vlayout = new QVBoxLayout(this);
+ auto *vlayout = new QVBoxLayout(this);
vlayout -> setMargin(0);
vlayout -> setSpacing(0);
vlayout -> addWidget(filter_textfield);
Modified: trunk/sources/elementtextpattern.cpp
===================================================================
--- trunk/sources/elementtextpattern.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/elementtextpattern.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -238,7 +238,7 @@
//Add the texts to element
for(const QDomElement& text : texts)
{
- DynamicElementTextItem *deti = new DynamicElementTextItem(m_element);
+ auto *deti = new DynamicElementTextItem(m_element);
undo_stack.push(new AddElementTextCommand(m_element, deti));
deti->fromXml(text);
}
Modified: trunk/sources/elementtextsmover.cpp
===================================================================
--- trunk/sources/elementtextsmover.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/elementtextsmover.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -119,7 +119,7 @@
for (QGraphicsItem *qgi : m_items_hash.keys())
{
- if(QObject *object = dynamic_cast<QObject *>(qgi))
+ if(auto *object = dynamic_cast<QObject *>(qgi))
{
QPropertyUndoCommand *child_undo = new QPropertyUndoCommand(object, "pos", m_items_hash.value(qgi), qgi->pos(), undo);
child_undo->enableAnimation();
Modified: trunk/sources/exportdialog.cpp
===================================================================
--- trunk/sources/exportdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/exportdialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -71,7 +71,7 @@
// disposition des elements
- QHBoxLayout *hLayout = new QHBoxLayout();
+ auto *hLayout = new QHBoxLayout();
hLayout -> addWidget(new QLabel(tr("Choisissez les folios que vous désirez exporter ainsi que leurs dimensions :")));
selectAll = new QPushButton();
deSelectAll = new QPushButton();
@@ -83,7 +83,7 @@
connect(deSelectAll, SIGNAL(clicked()), this, SLOT(slot_deSelectAllClicked()));
- QVBoxLayout *layout = new QVBoxLayout(this);
+ auto *layout = new QVBoxLayout(this);
layout -> addLayout(hLayout);
layout -> addWidget(initDiagramsListPart(), 1);
layout -> addWidget(epw);
@@ -177,7 +177,7 @@
QWidget *widget_diagrams_list = new QWidget();
widget_diagrams_list -> setLayout(diagrams_list_layout_);
- QScrollArea *scroll_diagrams_list = new QScrollArea();
+ auto *scroll_diagrams_list = new QScrollArea();
scroll_diagrams_list -> setWidget(widget_diagrams_list);
return(scroll_diagrams_list);
@@ -426,7 +426,7 @@
//QList<QRectF *> list_ellipses;
QList <QetShapeItem *> list_shapes;
- DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diagram);
+ auto *ptr = dynamic_cast<DiagramFolioList *>(diagram);
if (ptr) {
list_lines = ptr -> lines();
list_rectangles = ptr -> rectangles();
@@ -469,15 +469,15 @@
} else {
// Determine les elements a "XMLiser"
foreach(QGraphicsItem *qgi, diagram -> items()) {
- if (Element *elmt = qgraphicsitem_cast<Element *>(qgi)) {
+ if (auto *elmt = qgraphicsitem_cast<Element *>(qgi)) {
list_elements << elmt;
- } else if (Conductor *f = qgraphicsitem_cast<Conductor *>(qgi)) {
+ } else if (auto *f = qgraphicsitem_cast<Conductor *>(qgi)) {
list_conductors << f;
- } else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
+ } else if (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
list_texts << iti;
- } else if (DiagramImageItem *dii = qgraphicsitem_cast<DiagramImageItem *>(qgi)) {
+ } else if (auto *dii = qgraphicsitem_cast<DiagramImageItem *>(qgi)) {
list_images << dii;
- } else if (QetShapeItem *dii = qgraphicsitem_cast<QetShapeItem *>(qgi)) {
+ } else if (auto *dii = qgraphicsitem_cast<QetShapeItem *>(qgi)) {
list_shapes << dii;
}
}
@@ -909,14 +909,14 @@
preview_dialog.setWindowTitle(tr("Aperçu"));
preview_dialog.setWindowState(preview_dialog.windowState() | Qt::WindowMaximized);
- QGraphicsScene *preview_scene = new QGraphicsScene();
+ auto *preview_scene = new QGraphicsScene();
preview_scene -> setBackgroundBrush(Qt::lightGray);
- QGraphicsView *preview_view = new QGraphicsView(preview_scene);
+ auto *preview_view = new QGraphicsView(preview_scene);
preview_view -> setDragMode(QGraphicsView::ScrollHandDrag);
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok);
connect(buttons, SIGNAL(accepted()), &preview_dialog, SLOT(accept()));
- QVBoxLayout *vboxlayout1 = new QVBoxLayout();
+ auto *vboxlayout1 = new QVBoxLayout();
vboxlayout1 -> addWidget(preview_view);
vboxlayout1 -> addWidget(buttons);
preview_dialog.setLayout(vboxlayout1);
@@ -1050,7 +1050,7 @@
taille d'un schema avant son export.
*/
QBoxLayout *ExportDialog::ExportDiagramLine::sizeLayout() {
- QHBoxLayout *layout = new QHBoxLayout();
+ auto *layout = new QHBoxLayout();
layout -> addWidget(width);
layout -> addWidget(x_label);
layout -> addWidget(height);
Modified: trunk/sources/exportpropertieswidget.cpp
===================================================================
--- trunk/sources/exportpropertieswidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/exportpropertieswidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -118,14 +118,14 @@
*/
void ExportPropertiesWidget::build() {
// le dialogue est un empilement vertical d'elements
- QVBoxLayout *vboxLayout = new QVBoxLayout();
+ auto *vboxLayout = new QVBoxLayout();
vboxLayout -> setContentsMargins(0, 0, 0, 0);
/* le dialogue comprend une ligne permettant d'indiquer un chemin de dossier (hboxLayout) */
- QHBoxLayout *hboxLayout = new QHBoxLayout();
+ auto *hboxLayout = new QHBoxLayout();
dirpath_label = new QLabel(tr("Dossier cible :"), this);
dirpath = new QLineEdit(this);
- QCompleter *completer = new QCompleter(this);
+ auto *completer = new QCompleter(this);
completer -> setModel(new QDirModel(completer));
dirpath -> setCompleter(completer);
button_browse = new QPushButton(tr("Parcourir"), this);
@@ -137,7 +137,7 @@
vboxLayout -> addLayout(hboxLayout);
/* une ligne permettant de choisir le format (hboxLayout1) */
- QHBoxLayout *hboxLayout1 = new QHBoxLayout();
+ auto *hboxLayout1 = new QHBoxLayout();
format_label = new QLabel(tr("Format :"), this);
hboxLayout1 -> addWidget(format_label);
hboxLayout1 -> addWidget(format = new QComboBox(this));
@@ -152,7 +152,7 @@
/* un cadre permettant de specifier les options de l'image finale */
QGroupBox *groupbox_options = new QGroupBox(tr("Options de rendu", "groupbox title"));
- QGridLayout *optionshlayout = new QGridLayout(groupbox_options);
+ auto *optionshlayout = new QGridLayout(groupbox_options);
// Choix de la zone du schema a exporter
exported_content_choices = new QButtonGroup(groupbox_options);
Modified: trunk/sources/genericpanel.cpp
===================================================================
--- trunk/sources/genericpanel.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/genericpanel.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -579,7 +579,7 @@
QTreeWidgetItem *qtwi_diagram = qtwi_project -> child(i);
if (!qtwi_diagram) continue;
- Diagram *diagram = valueForItem<Diagram *>(qtwi_diagram);
+ auto *diagram = valueForItem<Diagram *>(qtwi_diagram);
if (diagram)
updateDiagramItem(qtwi_diagram, diagram);
}
@@ -665,7 +665,7 @@
@return the create QTreeWidgetItem
*/
QTreeWidgetItem *GenericPanel::makeItem(QET::ItemType type, QTreeWidgetItem *parent, const QString &label, const QIcon &icon) {
- QTreeWidgetItem *qtwi = new QTreeWidgetItem(parent, type);
+ auto *qtwi = new QTreeWidgetItem(parent, type);
qtwi -> setText(0, label.isEmpty() ? defaultText(type) : label);
qtwi -> setIcon(0, icon.isNull() ? defaultIcon(type) : icon);
return(qtwi);
@@ -745,7 +745,7 @@
void GenericPanel::removeObsoleteItems(const QList<T> &expected_items, QTreeWidgetItem *item, QET::ItemType type, bool recursive) {
// remove items not found in expected_items
foreach (QTreeWidgetItem *child_item, childItems(item, type, recursive)) {
- T child_value = valueForItem<T>(child_item);
+ auto child_value = valueForItem<T>(child_item);
if (!expected_items.contains(child_value)) {
deleteItem(child_item);
}
Modified: trunk/sources/nameslistwidget.cpp
===================================================================
--- trunk/sources/nameslistwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/nameslistwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -24,7 +24,7 @@
@param parent QWidget parent de la liste de noms
*/
NamesListWidget::NamesListWidget(QWidget *parent) : QWidget(parent), read_only(false) {
- QVBoxLayout *names_list_layout = new QVBoxLayout();
+ auto *names_list_layout = new QVBoxLayout();
setLayout(names_list_layout);
tree_names = new QTreeWidget();
@@ -70,7 +70,7 @@
void NamesListWidget::addLine() {
clean();
if (read_only) return;
- QTreeWidgetItem *qtwi = new QTreeWidgetItem();
+ auto *qtwi = new QTreeWidgetItem();
qtwi -> setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
tree_names -> addTopLevelItem(qtwi);
tree_names -> setCurrentItem(qtwi);
@@ -137,7 +137,7 @@
QString value = provided_names[lang];
QStringList values;
values << lang << value;
- QTreeWidgetItem *qtwi = new QTreeWidgetItem(values);
+ auto *qtwi = new QTreeWidgetItem(values);
if (!read_only) qtwi -> setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
tree_names -> addTopLevelItem(qtwi);
tree_names -> sortItems(0, Qt::AscendingOrder);
Modified: trunk/sources/newelementwizard.cpp
===================================================================
--- trunk/sources/newelementwizard.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/newelementwizard.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -74,11 +74,11 @@
*/
QWizardPage *NewElementWizard::buildStep1()
{
- QWizardPage *page = new QWizardPage();
+ auto *page = new QWizardPage();
page -> setProperty("WizardState", Category);
page -> setTitle(tr("Étape 1/3 : Catégorie parente", "wizard page title"));
page -> setSubTitle(tr("Sélectionnez une catégorie dans laquelle enregistrer le nouvel élément.", "wizard page subtitle"));
- QVBoxLayout *layout = new QVBoxLayout();
+ auto *layout = new QVBoxLayout();
m_tree_view = new QTreeView(this);
@@ -100,11 +100,11 @@
* @return
*/
QWizardPage *NewElementWizard::buildStep2() {
- QWizardPage *page = new QWizardPage();
+ auto *page = new QWizardPage();
page -> setProperty("WizardState", Filename);
page -> setTitle(tr("Étape 2/3 : Nom du fichier", "wizard page title"));
page -> setSubTitle(tr("Indiquez le nom du fichier dans lequel enregistrer le nouvel élément.", "wizard page subtitle"));
- QVBoxLayout *layout = new QVBoxLayout();
+ auto *layout = new QVBoxLayout();
m_qle_filename = new QFileNameEdit(tr("nouvel_element"));
m_qle_filename -> selectAll();
@@ -124,11 +124,11 @@
* @return
*/
QWizardPage *NewElementWizard::buildStep3() {
- QWizardPage *page = new QWizardPage();
+ auto *page = new QWizardPage();
page -> setProperty("WizardState", Names);
page -> setTitle(tr("Étape 3/3 : Noms de l'élément", "wizard page title"));
page -> setSubTitle(tr("Indiquez le ou les noms de l'élément.", "wizard page subtitle"));
- QVBoxLayout *layout = new QVBoxLayout();
+ auto *layout = new QVBoxLayout();
m_names_list = new NamesListWidget();
NamesList hash_name;
@@ -170,7 +170,7 @@
QModelIndex index = m_tree_view->currentIndex();
if (index.isValid()) {
- ElementCollectionItem *eci = static_cast<ElementCollectionItem*>(m_model->itemFromIndex(index));
+ auto *eci = static_cast<ElementCollectionItem*>(m_model->itemFromIndex(index));
if (eci && eci->isDir()) {
ElementsLocation loc(eci->collectionPath());
if (loc.exist()) {
@@ -226,7 +226,7 @@
* Lauch an element editor for create the new element
*/
void NewElementWizard::createNewElement() {
- QETElementEditor *edit_new_element = new QETElementEditor(parentWidget());
+ auto *edit_new_element = new QETElementEditor(parentWidget());
edit_new_element -> setNames(m_names_list -> names());
ElementsLocation loc_ = m_chosen_location;
Modified: trunk/sources/projectconfigpages.cpp
===================================================================
--- trunk/sources/projectconfigpages.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/projectconfigpages.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -179,8 +179,8 @@
Initialize the layout of this page.
*/
void ProjectMainConfigPage::initLayout() {
- QVBoxLayout *main_layout0 = new QVBoxLayout();
- QHBoxLayout *title_layout0 = new QHBoxLayout();
+ auto *main_layout0 = new QVBoxLayout();
+ auto *title_layout0 = new QHBoxLayout();
title_layout0 -> addWidget(title_label_);
title_layout0 -> addWidget(title_value_);
main_layout0 -> addLayout(title_layout0);
@@ -255,7 +255,7 @@
*/
void ProjectAutoNumConfigPage::initWidgets()
{
- QTabWidget *tab_widget = new QTabWidget(this);
+ auto *tab_widget = new QTabWidget(this);
//Management tab
m_amw = new AutoNumberingManagementW(project());
@@ -277,7 +277,7 @@
m_faw = new FolioAutonumberingW(project());
tab_widget->addTab(m_faw, tr("Folio autonumérotation"));
- QHBoxLayout *main_layout = new QHBoxLayout();
+ auto *main_layout = new QHBoxLayout();
main_layout->addWidget(tab_widget);
setLayout(main_layout);
}
Modified: trunk/sources/projectview.cpp
===================================================================
--- trunk/sources/projectview.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/projectview.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -348,7 +348,7 @@
if (m_project -> isReadOnly()) return;
Diagram *new_diagram = m_project -> addNewDiagram();
- DiagramView *new_diagram_view = new DiagramView(new_diagram);
+ auto *new_diagram_view = new DiagramView(new_diagram);
addDiagram(new_diagram_view);
if (m_project -> diagrams().size() % 58 == 1 && m_project -> getFolioSheetsQuantity() != 0)
@@ -365,7 +365,7 @@
int i = 1; //< Each new diagram is added to the end of the project.
//< We use @i to move the folio list at second position in the project
foreach (Diagram *d, m_project -> addNewDiagramFolioList()) {
- DiagramView *new_diagram_view = new DiagramView(d);
+ auto *new_diagram_view = new DiagramView(d);
addDiagram(new_diagram_view);
showDiagram(new_diagram_view);
m_tab->tabBar()->moveTab(diagram_views().size()-1, i);
@@ -751,7 +751,7 @@
#endif
clean_dialog.setWindowTitle(tr("Nettoyer le projet", "window title"));
- QVBoxLayout *clean_dialog_layout = new QVBoxLayout();
+ auto *clean_dialog_layout = new QVBoxLayout();
clean_dialog_layout -> addWidget(clean_tbt);
clean_dialog_layout -> addWidget(clean_elements);
clean_dialog_layout -> addWidget(clean_categories);
@@ -807,7 +807,7 @@
m_tab = new QTabWidget(this);
m_tab -> setMovable(true);
- QToolButton *add_new_diagram_button = new QToolButton;
+ auto *add_new_diagram_button = new QToolButton;
add_new_diagram_button -> setDefaultAction(add_new_diagram_);
add_new_diagram_button -> setAutoRaise(true);
m_tab -> setCornerWidget(add_new_diagram_button, Qt::TopRightCorner);
@@ -824,7 +824,7 @@
Initialize layout for this widget.
*/
void ProjectView::initLayout() {
- QVBoxLayout *fallback_widget_layout_ = new QVBoxLayout(fallback_widget_);
+ auto *fallback_widget_layout_ = new QVBoxLayout(fallback_widget_);
fallback_widget_layout_ -> addWidget(fallback_label_);
layout_ = new QVBoxLayout(this);
@@ -868,7 +868,7 @@
dialog->setProgressBar(dialog->progressBarValue()+1);
}
- DiagramView *sv = new DiagramView(diagram);
+ auto *sv = new DiagramView(diagram);
addDiagram(sv);
}
Modified: trunk/sources/qet.cpp
===================================================================
--- trunk/sources/qet.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qet.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -626,7 +626,7 @@
*/
QActionGroup *QET::depthActionGroup(QObject *parent)
{
- QActionGroup *action_group = new QActionGroup(parent);
+ auto *action_group = new QActionGroup(parent);
QAction *edit_forward = new QAction(QET::Icons::BringForward, QObject::tr("Amener au premier plan"), action_group);
QAction *edit_raise = new QAction(QET::Icons::Raise, QObject::tr("Rapprocher"), action_group);
Modified: trunk/sources/qetapp.cpp
===================================================================
--- trunk/sources/qetapp.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetapp.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -440,7 +440,7 @@
@return le nom de l'utilisateur courant
*/
QString QETApp::userName() {
- QProcess * process = new QProcess();
+ auto * process = new QProcess();
QString str;
#ifndef Q_OS_WIN32
// return(QString(getenv("USER")));
@@ -907,7 +907,7 @@
@see QTextOrientationSpinBoxWidget
*/
QTextOrientationSpinBoxWidget *QETApp::createTextOrientationSpinBoxWidget() {
- QTextOrientationSpinBoxWidget *widget = new QTextOrientationSpinBoxWidget();
+ auto *widget = new QTextOrientationSpinBoxWidget();
widget -> orientationWidget() -> setFont(QETApp::diagramTextsFont());
widget -> orientationWidget() -> setUsableTexts(QList<QString>()
<< QETApp::tr("Q", "Single-letter example text - translate length, not meaning")
@@ -924,7 +924,7 @@
*/
TitleBlockTemplate *QETApp::defaultTitleBlockTemplate() {
if (!QETApp::default_titleblock_template_) {
- TitleBlockTemplate *titleblock_template = new TitleBlockTemplate(QETApp::instance());
+ auto *titleblock_template = new TitleBlockTemplate(QETApp::instance());
if (titleblock_template -> loadFromXmlFile(":/titleblocks/default.titleblock")) {
QETApp::default_titleblock_template_ = titleblock_template;
}
@@ -1034,7 +1034,7 @@
@param window fenetre a afficher / cacher
*/
void QETApp::invertMainWindowVisibility(QWidget *window) {
- if (QMainWindow *w = qobject_cast<QMainWindow *>(window)) setMainWindowVisible(w, !w -> isVisible());
+ if (auto *w = qobject_cast<QMainWindow *>(window)) setMainWindowVisible(w, !w -> isVisible());
}
/**
@@ -1206,7 +1206,7 @@
}
if (!already_opened_in_existing_element_editor) {
// ce fichier n'est ouvert dans aucun editeur
- QETElementEditor *element_editor = new QETElementEditor();
+ auto *element_editor = new QETElementEditor();
element_editor -> fromFile(element_file);
}
}
@@ -1238,7 +1238,7 @@
}
if (!already_opened_in_existing_element_editor) {
// cet emplacement n'est ouvert dans aucun editeur
- QETElementEditor *element_editor = new QETElementEditor();
+ auto *element_editor = new QETElementEditor();
element_editor -> fromLocation(element_location);
}
}
@@ -1253,7 +1253,7 @@
@see QETTitleBlockTemplateEditor::setOpenForDuplication()
*/
void QETApp::openTitleBlockTemplate(const TitleBlockTemplateLocation &location, bool duplicate) {
- QETTitleBlockTemplateEditor *qet_template_editor = new QETTitleBlockTemplateEditor();
+ auto *qet_template_editor = new QETTitleBlockTemplateEditor();
qet_template_editor -> setOpenForDuplication(duplicate);
qet_template_editor -> edit(location);
qet_template_editor -> show();
@@ -1264,7 +1264,7 @@
@param filepath Path of the .titleblock file to be opened
*/
void QETApp::openTitleBlockTemplate(const QString &filepath) {
- QETTitleBlockTemplateEditor *qet_template_editor = new QETTitleBlockTemplateEditor();
+ auto *qet_template_editor = new QETTitleBlockTemplateEditor();
qet_template_editor -> edit(filepath);
qet_template_editor -> show();
}
Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetdiagrameditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -184,7 +184,7 @@
*/
void QETDiagramEditor::setUpUndoStack() {
- QUndoView *undo_view = new QUndoView(&undo_group, this);
+ auto *undo_view = new QUndoView(&undo_group, this);
undo_view -> setEmptyLabel (tr("Aucune modification"));
undo_view -> setStatusTip (tr("Cliquez sur une action pour revenir en arrière dans l'édition de votre schéma", "Status tip"));
@@ -849,7 +849,7 @@
*/
bool QETDiagramEditor::newProject() {
// create new project without diagram
- QETProject *new_project = new QETProject(0);
+ auto *new_project = new QETProject(0);
// Set default properties for new diagram
new_project -> setDefaultBorderProperties (BorderProperties:: defaultProperties());
@@ -1009,7 +1009,7 @@
//Create the project
DialogWaiting::instance(this);
- QETProject *project = new QETProject(filepath);
+ auto *project = new QETProject(filepath);
if (project -> state() != QETProject::Ok)
{
if (interactive && project -> state() != QETProject::FileOpenDiscard)
@@ -1048,7 +1048,7 @@
QETApp::registerProject(project);
// cree un ProjectView pour visualiser le projet
- ProjectView *project_view = new ProjectView(project);
+ auto *project_view = new ProjectView(project);
addProjectView(project_view);
undo_group.addStack(project -> undoStack());
@@ -1072,7 +1072,7 @@
QList<ProjectView *> result;
QList<QMdiSubWindow *> window_list(m_workspace.subWindowList());
foreach(QMdiSubWindow *window, window_list) {
- if (ProjectView *project_view = qobject_cast<ProjectView *>(window -> widget())) {
+ if (auto *project_view = qobject_cast<ProjectView *>(window -> widget())) {
result << project_view;
}
}
@@ -1090,7 +1090,7 @@
QWidget *current_widget = current_window -> widget();
if (!current_widget) return(nullptr);
- if (ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) {
+ if (auto *project_view = qobject_cast<ProjectView *>(current_widget)) {
return(project_view);
}
return(nullptr);
@@ -1284,7 +1284,7 @@
diagram_event = new DiagramEventAddShape (d, QetShapeItem::Polygon);
else if (value == "image")
{
- DiagramEventAddImage *deai = new DiagramEventAddImage(d);
+ auto *deai = new DiagramEventAddImage(d);
if (deai->isNull())
{
delete deai;
@@ -1326,7 +1326,7 @@
}
else if (value == "rotate_selection")
{
- RotateSelectionCommand *c = new RotateSelectionCommand(diagram);
+ auto *c = new RotateSelectionCommand(diagram);
if(c->isValid())
diagram->undoStack().push(c);
}
@@ -1697,7 +1697,7 @@
QWidget *current_widget = current_window -> widget();
if (!current_widget) return(nullptr);
- if (ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) {
+ if (auto *project_view = qobject_cast<ProjectView *>(current_widget)) {
return(project_view);
}
return(nullptr);
@@ -1752,7 +1752,7 @@
m_previous_window -> setEnabled(windows.count() > 1);
if (!windows.isEmpty()) windows_menu -> addSeparator();
- QActionGroup *windows_actions = new QActionGroup(this);
+ auto *windows_actions = new QActionGroup(this);
foreach(ProjectView *project_view, windows) {
QString pv_title = project_view -> windowTitle();
QAction *action = windows_menu -> addAction(pv_title);
@@ -2072,7 +2072,7 @@
// remove one (last) folio sheet.
} else if (current_project -> diagram_views().size() % 58 == 0) {
foreach (DiagramView *diag, current_project -> diagram_views()) {
- DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diag -> diagram());
+ auto *ptr = dynamic_cast<DiagramFolioList *>(diag -> diagram());
if (ptr && ptr -> getId() == current_project -> project() -> getFolioSheetsQuantity() - 1) {
current_project -> removeDiagram(diag);
}
@@ -2170,7 +2170,7 @@
void QETDiagramEditor::generateTerminalBlock()
{
bool success;
- QProcess *process = new QProcess(qApp);
+ auto *process = new QProcess(qApp);
// If launched under control:
//connect(process, SIGNAL(errorOcurred(int error)), this, SLOT(slot_generateTerminalBlock_error()));
Modified: trunk/sources/qetgraphicsitem/conductor.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/conductor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetgraphicsitem/conductor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -696,7 +696,7 @@
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
- QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
+ auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{
@@ -1352,7 +1352,7 @@
conductor_profiles[current_path_type].fromConductor(this);
Diagram *dia = diagram();
if (undo && dia) {
- ChangeConductorCommand *undo_object = new ChangeConductorCommand(
+ auto *undo_object = new ChangeConductorCommand(
this,
old_profile,
conductor_profiles[current_path_type],
Modified: trunk/sources/qetgraphicsitem/conductortextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/conductortextitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetgraphicsitem/conductortextitem.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -205,7 +205,7 @@
if (!applied_movement.isNull()) {
//Create an undo object
- MoveConductorsTextsCommand *undo_object = new MoveConductorsTextsCommand(diagram_ptr);
+ auto *undo_object = new MoveConductorsTextsCommand(diagram_ptr);
undo_object -> addTextMovement(this, before_mov_pos_, pos(), moved_by_user_);
moved_by_user_ = true;
Modified: trunk/sources/qetgraphicsitem/customelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/customelement.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetgraphicsitem/customelement.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -370,7 +370,7 @@
if (addtolist){
//Add line to the list
- QLineF *newLine = new QLineF(line);
+ auto *newLine = new QLineF(line);
m_lines << newLine;
}
@@ -475,7 +475,7 @@
if (addtolist){
//Add rectangle to the list
- QRectF *rect = new QRectF(rect_x, rect_y, rect_w, rect_h);
+ auto *rect = new QRectF(rect_x, rect_y, rect_w, rect_h);
m_rectangles << rect;
}
@@ -516,7 +516,7 @@
if (addtolist){
// Add circle to list
- QRectF *circle = new QRectF(circle_bounding_rect);
+ auto *circle = new QRectF(circle_bounding_rect);
m_circles << circle;
}
@@ -549,7 +549,7 @@
setPainterStyle(e, qp);
if (addtolist){
- QVector<qreal> *arc = new QVector<qreal>;
+ auto *arc = new QVector<qreal>;
arc -> push_back(ellipse_x);
arc -> push_back(ellipse_y);
arc -> push_back(ellipse_l);
@@ -592,7 +592,7 @@
setPainterStyle(e, qp);
if (addtolist){
- QVector<qreal> *arc = new QVector<qreal>;
+ auto *arc = new QVector<qreal>;
arc -> push_back(arc_x);
arc -> push_back(arc_y);
arc -> push_back(arc_l);
@@ -647,7 +647,7 @@
}
if (addtolist){
// Add to list of polygons.
- QVector<QPointF> *poly = new QVector<QPointF>(points);
+ auto *poly = new QVector<QPointF>(points);
m_polygons << poly;
}
@@ -743,7 +743,7 @@
) return(false);
else
{
- DynamicElementTextItem *deti = new DynamicElementTextItem(this);
+ auto *deti = new DynamicElementTextItem(this);
deti->setText(dom_element.attribute("text", "_"));
deti->setFontSize(dom_element.attribute("size", QString::number(9)).toInt());
deti->setRotation(dom_element.attribute("rotation", QString::number(0)).toDouble());
@@ -782,7 +782,7 @@
*/
DynamicElementTextItem *CustomElement::parseDynamicText(QDomElement &dom_element)
{
- DynamicElementTextItem *deti = new DynamicElementTextItem(this);
+ auto *deti = new DynamicElementTextItem(this);
//Because the xml description of a .elmt file is the same as how a dynamic text field is save to xml in a .qet file
//wa call fromXml, we just change the tagg name (.elmt = dynamic_text, .qet = dynamic_elmt_text)
//and the uuid (because the uuid, is the uuid of the descritpion and not the uuid of instantiated dynamic text field)
@@ -817,7 +817,7 @@
else if (e.attribute("orientation") == "e") terminalo = Qet::East;
else if (e.attribute("orientation") == "w") terminalo = Qet::West;
else return(nullptr);
- Terminal *new_terminal = new Terminal(terminalx, terminaly, terminalo, this);
+ auto *new_terminal = new Terminal(terminalx, terminaly, terminalo, this);
m_terminals << new_terminal;
//Sort from top to bottom and left to rigth
Modified: trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -218,7 +218,7 @@
{
if(parentItem())
{
- if(ElementTextItemGroup *grp = dynamic_cast<ElementTextItemGroup *>(parentItem()))
+ if(auto *grp = dynamic_cast<ElementTextItemGroup *>(parentItem()))
return grp;
}
Modified: trunk/sources/qetgraphicsitem/element.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/element.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetgraphicsitem/element.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -78,7 +78,7 @@
connect(this, &Element::rotationChanged, [this]() {
for(QGraphicsItem *qgi : childItems())
{
- if (Terminal *t = qgraphicsitem_cast<Terminal *>(qgi))
+ if (auto *t = qgraphicsitem_cast<Terminal *>(qgi))
t->updateConductor();
}
});
@@ -96,7 +96,7 @@
{
if (diagram() && !diagram()->isReadOnly())
{
- ElementPropertiesWidget *epw = new ElementPropertiesWidget(this);
+ auto *epw = new ElementPropertiesWidget(this);
PropertiesEditorDialog dialog(epw, QApplication::activeWindow());
connect(epw, &ElementPropertiesWidget::findEditClicked, &dialog, &QDialog::reject);
//Must be windowModal, else when user do a drag and drop
@@ -370,7 +370,7 @@
QHash<int, Terminal *> priv_id_adr;
int terminals_non_trouvees = 0;
foreach(QGraphicsItem *qgi, childItems()) {
- if (Terminal *p = qgraphicsitem_cast<Terminal *>(qgi)) {
+ if (auto *p = qgraphicsitem_cast<Terminal *>(qgi)) {
bool terminal_trouvee = false;
foreach(QDomElement qde, liste_terminals) {
if (p -> fromXml(qde)) {
@@ -454,7 +454,7 @@
//************************//
for (const QDomElement& qde : QET::findInDomElement(e, "dynamic_texts", DynamicElementTextItem::xmlTaggName()))
{
- DynamicElementTextItem *deti = new DynamicElementTextItem(this);
+ auto *deti = new DynamicElementTextItem(this);
addDynamicTextItem(deti);
deti->fromXml(qde);
}
@@ -856,7 +856,7 @@
}
else
{
- DynamicElementTextItem *text = new DynamicElementTextItem(this);
+ auto *text = new DynamicElementTextItem(this);
m_dynamic_text_list.append(text);
emit textAdded(text);
}
@@ -911,7 +911,7 @@
{
if(m_texts_group.isEmpty())
{
- ElementTextItemGroup *group = new ElementTextItemGroup(name, this);
+ auto *group = new ElementTextItemGroup(name, this);
m_texts_group << group;
emit textsGroupAdded(group);
return group;
@@ -927,7 +927,7 @@
}
//Create the group
- ElementTextItemGroup *group = new ElementTextItemGroup(rename, this);
+ auto *group = new ElementTextItemGroup(rename, this);
m_texts_group << group;
emit textsGroupAdded(group);
return group;
@@ -966,7 +966,7 @@
{
if(qgi->type() == DynamicElementTextItem::Type)
{
- DynamicElementTextItem *deti = static_cast<DynamicElementTextItem *>(qgi);
+ auto *deti = static_cast<DynamicElementTextItem *>(qgi);
removeTextFromGroup(deti, group);
}
}
Modified: trunk/sources/qetgraphicsitem/elementtextitemgroup.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/elementtextitemgroup.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetgraphicsitem/elementtextitemgroup.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -66,7 +66,7 @@
QGraphicsItemGroup::addToGroup(item);
updateAlignment();
- DynamicElementTextItem *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item);
+ auto *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item);
connect(deti, &DynamicElementTextItem::fontSizeChanged, this, &ElementTextItemGroup::updateAlignment);
connect(deti, &DynamicElementTextItem::textChanged, this, &ElementTextItemGroup::updateAlignment);
connect(deti, &DynamicElementTextItem::textFromChanged, this, &ElementTextItemGroup::updateAlignment);
@@ -96,7 +96,7 @@
item->setFlag(QGraphicsItem::ItemIsSelectable, true);
updateAlignment();
- if(DynamicElementTextItem *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item))
+ if(auto *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item))
{
disconnect(deti, &DynamicElementTextItem::fontSizeChanged, this, &ElementTextItemGroup::updateAlignment);
disconnect(deti, &DynamicElementTextItem::textChanged, this, &ElementTextItemGroup::updateAlignment);
@@ -780,7 +780,7 @@
if(!diagram())
return;
- MasterElement *master = static_cast<MasterElement *>(m_parent_element);
+ auto *master = static_cast<MasterElement *>(m_parent_element);
XRefProperties xrp = diagram()->project()->defaultXRefProperties(master->kindInformations()["type"].toString());
if(xrp.snapTo() == XRefProperties::Bottom)
{
Modified: trunk/sources/qetgraphicsitem/qetshapeitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/qetshapeitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetgraphicsitem/qetshapeitem.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -408,7 +408,7 @@
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
- QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
+ auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{
Modified: trunk/sources/qetgraphicsitem/terminal.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/terminal.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetgraphicsitem/terminal.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -150,7 +150,7 @@
@return L'orientation actuelle de la Terminal.
*/
Qet::Orientation Terminal::orientation() const {
- if (Element *elt = qgraphicsitem_cast<Element *>(parentItem())) {
+ if (auto *elt = qgraphicsitem_cast<Element *>(parentItem())) {
// orientations actuelle et par defaut de l'element
int ori_cur = elt -> orientation();
if (ori_cur == 0) return(ori_);
@@ -431,7 +431,7 @@
QList <Terminal *> available_terminals;
foreach (QGraphicsItem *qgi, qgi_list)
{
- if (Terminal *tt = qgraphicsitem_cast <Terminal *> (qgi))
+ if (auto *tt = qgraphicsitem_cast <Terminal *> (qgi))
{
//Call QET::lineContainsPoint to be sure the line intersect
//the dock point and not an other part of terminal
@@ -539,7 +539,7 @@
// sinon on prend le deuxieme element de la liste et on verifie s'il s'agit d'une borne
QGraphicsItem *qgi = qgis.at(1);
// si le qgi est une borne...
- Terminal *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
+ auto *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
if (!other_terminal) return;
previous_terminal_ = other_terminal;
@@ -576,7 +576,7 @@
if (!qgi) return;
//Element must be a terminal
- Terminal *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
+ auto *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
if (!other_terminal) return;
other_terminal -> hovered_color_ = neutralColor;
@@ -586,7 +586,7 @@
if (!canBeLinkedTo(other_terminal)) return;
//Create conductor
- Conductor *new_conductor = new Conductor(this, other_terminal);
+ auto *new_conductor = new Conductor(this, other_terminal);
//Get all conductors at the same potential of new conductors
QSet <Conductor *> conductors_list = new_conductor->relatedPotentialConductors();
@@ -606,7 +606,7 @@
}
- QUndoCommand *undo = new QUndoCommand();
+ auto *undo = new QUndoCommand();
QUndoCommand *aic = new AddItemCommand<Conductor *>(new_conductor, diagram(), QPointF(), undo);
undo->setText(aic->text());
Modified: trunk/sources/qetprintpreviewdialog.cpp
===================================================================
--- trunk/sources/qetprintpreviewdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetprintpreviewdialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -392,7 +392,7 @@
void QETPrintPreviewDialog::updateZoomList() {
// recupere le zooom courant
qreal current_zoom = preview_ -> zoomFactor();
- bool current_zoom_is_not_null = bool(int(current_zoom * 100.0));
+ auto current_zoom_is_not_null = bool(int(current_zoom * 100.0));
// liste des zooms par defaut
QList<qreal> zooms_real;
Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qetproject.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -817,7 +817,7 @@
for(Diagram *diagram : diagrams_list)
{
// Write the diagram to XML only if it is not of type DiagramFolioList.
- DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diagram);
+ auto *ptr = dynamic_cast<DiagramFolioList *>(diagram);
if ( !ptr )
{
qDebug() << qPrintable(QString("QETProject::toXml() : exporting diagram \"%1\"").arg(diagram -> title())) << "[" << diagram << "]";
@@ -1099,7 +1099,7 @@
if (isReadOnly()) return(nullptr);
// cree un nouveau schema
- Diagram *diagram = new Diagram(this);
+ auto *diagram = new Diagram(this);
// lui transmet les parametres par defaut
diagram -> border_and_titleblock.importBorder(defaultBorderProperties());
@@ -1325,7 +1325,7 @@
if (diagram_nodes.at(i).isElement())
{
QDomElement diagram_xml_element = diagram_nodes.at(i).toElement();
- Diagram *diagram = new Diagram(this);
+ auto *diagram = new Diagram(this);
bool diagram_loading = diagram -> initFromXml(diagram_xml_element);
if (diagram_loading)
{
Modified: trunk/sources/qtextorientationspinboxwidget.cpp
===================================================================
--- trunk/sources/qtextorientationspinboxwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/qtextorientationspinboxwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -117,7 +117,7 @@
connect(spin_box_, SIGNAL(editingFinished()), this, SLOT(emitChangeSignals()));
// dispose les widgets : le QTextOrientationWidget a gauche, le SpinBox a droite
- QHBoxLayout *main_layout = new QHBoxLayout();
+ auto *main_layout = new QHBoxLayout();
main_layout -> addWidget(orientation_widget_);
main_layout -> addWidget(spin_box_);
main_layout -> addStretch();
Modified: trunk/sources/recentfiles.cpp
===================================================================
--- trunk/sources/recentfiles.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/recentfiles.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -175,7 +175,7 @@
// remplit le menu
foreach (QString filepath, list_) {
// creee une nouvelle action pour le fichier
- QAction *action = new QAction(filepath, this);
+ auto *action = new QAction(filepath, this);
if (!files_icon_.isNull()) {
action -> setIcon(files_icon_);
}
Modified: trunk/sources/richtext/richtexteditor.cpp
===================================================================
--- trunk/sources/richtext/richtexteditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/richtext/richtexteditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -417,7 +417,7 @@
QObject *receiver, const char *slot,
QObject *parent = nullptr)
{
- QAction *result = new QAction(parent);
+ auto *result = new QAction(parent);
result->setIcon(icon);
result->setText(text);
result->setCheckable(true);
@@ -471,7 +471,7 @@
// Left, center, right and justified alignment buttons
- QActionGroup *alignment_group = new QActionGroup(this);
+ auto *alignment_group = new QActionGroup(this);
connect(alignment_group, SIGNAL(triggered(QAction*)),
SLOT(alignmentActionTriggered(QAction*)));
@@ -767,12 +767,12 @@
tool_bar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
QWidget *rich_edit = new QWidget;
- QVBoxLayout *rich_edit_layout = new QVBoxLayout(rich_edit);
+ auto *rich_edit_layout = new QVBoxLayout(rich_edit);
rich_edit_layout->addWidget(tool_bar);
rich_edit_layout->addWidget(m_editor);
QWidget *plain_edit = new QWidget;
- QVBoxLayout *plain_edit_layout = new QVBoxLayout(plain_edit);
+ auto *plain_edit_layout = new QVBoxLayout(plain_edit);
plain_edit_layout->addWidget(m_text_edit);
m_tab_widget->setTabPosition(QTabWidget::South);
@@ -789,7 +789,7 @@
connect(buttonBox, SIGNAL(accepted()), this, SLOT(on_buttonBox_accepted()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
- QVBoxLayout *layout = new QVBoxLayout(this);
+ auto *layout = new QVBoxLayout(this);
layout->addWidget(m_tab_widget);
layout->addWidget(buttonBox);
Modified: trunk/sources/titleblock/dimensionwidget.cpp
===================================================================
--- trunk/sources/titleblock/dimensionwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/titleblock/dimensionwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -145,10 +145,10 @@
Initialize the layout of the dialog.
*/
void TitleBlockDimensionWidget::initLayouts() {
- QHBoxLayout *hlayout0 = new QHBoxLayout();
+ auto *hlayout0 = new QHBoxLayout();
hlayout0 -> addWidget(spinbox_label_);
hlayout0 -> addWidget(spinbox_);
- QVBoxLayout *vlayout0 = new QVBoxLayout();
+ auto *vlayout0 = new QVBoxLayout();
vlayout0 -> addLayout(hlayout0);
if (complete_) {
vlayout0 -> addWidget(absolute_button_);
Modified: trunk/sources/titleblock/qettemplateeditor.cpp
===================================================================
--- trunk/sources/titleblock/qettemplateeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/titleblock/qettemplateeditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -246,7 +246,7 @@
*/
bool QETTitleBlockTemplateEditor::edit(const QString &file_path) {
// get title block template object from the file, edit it
- TitleBlockTemplate *tbt = new TitleBlockTemplate();
+ auto *tbt = new TitleBlockTemplate();
bool loading = tbt -> loadFromXmlFile(file_path);
if (!loading) {
/// TODO the file opening failed, warn the user?
@@ -301,7 +301,7 @@
logo_manager_ -> layout() -> setContentsMargins(0, 0, 0, 0);
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Close);
- QVBoxLayout *vlayout0 = new QVBoxLayout();
+ auto *vlayout0 = new QVBoxLayout();
vlayout0 -> addWidget(logo_manager_);
vlayout0 -> addWidget(buttons);
@@ -320,7 +320,7 @@
Launch a new title block template editor.
*/
void QETTitleBlockTemplateEditor::newTemplate() {
- QETTitleBlockTemplateEditor *qet_template_editor = new QETTitleBlockTemplateEditor();
+ auto *qet_template_editor = new QETTitleBlockTemplateEditor();
qet_template_editor -> edit(TitleBlockTemplateLocation());
qet_template_editor -> show();
}
@@ -882,7 +882,7 @@
}
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- QVBoxLayout *dialog_layout = new QVBoxLayout();
+ auto *dialog_layout = new QVBoxLayout();
dialog_layout -> addWidget(widget);
dialog_layout -> addWidget(buttons);
@@ -932,7 +932,7 @@
#endif
dialog_author.setMinimumSize(400, 260);
dialog_author.setWindowTitle(tr("Éditer les informations complémentaires", "window title"));
- QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog_author);
+ auto *dialog_layout = new QVBoxLayout(&dialog_author);
// explanation label
QLabel *information_label = new QLabel(tr("Vous pouvez utiliser ce champ libre pour mentionner les auteurs du cartouche, sa licence, ou tout autre renseignement que vous jugerez utile."));
@@ -941,7 +941,7 @@
dialog_layout -> addWidget(information_label);
// add a QTextEdit to the dialog
- QTextEdit *text_field = new QTextEdit();
+ auto *text_field = new QTextEdit();
text_field -> setAcceptRichText(false);
text_field -> setPlainText(tb_template_ -> information());
text_field -> setReadOnly(read_only_);
Modified: trunk/sources/titleblock/templatecellwidget.cpp
===================================================================
--- trunk/sources/titleblock/templatecellwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/titleblock/templatecellwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -96,11 +96,11 @@
font_adjust_input_ = new QCheckBox(tr("Ajuster la taille de police si besoin"));
// layout
- QHBoxLayout *label_edition = new QHBoxLayout();
+ auto *label_edition = new QHBoxLayout();
label_edition -> addWidget(label_input_);
label_edition -> addWidget(label_edit_);
- QHBoxLayout *value_edition = new QHBoxLayout();
+ auto *value_edition = new QHBoxLayout();
value_edition -> addWidget(value_input_);
value_edition -> addWidget(value_edit_);
@@ -375,7 +375,7 @@
@param title Title of the dialog window
*/
void TitleBlockTemplateCellWidget::editTranslatableValue(NamesList &names, const QString &attribute, const QString &title) const {
- NamesListWidget *names_widget = new NamesListWidget();
+ auto *names_widget = new NamesListWidget();
names_widget -> setNames(names);
QDialogButtonBox * buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
@@ -386,7 +386,7 @@
QLabel *def_var_label = new QLabel(defaultVariablesString());
def_var_label -> setTextFormat(Qt::RichText);
- QVBoxLayout *editor_layout = new QVBoxLayout();
+ auto *editor_layout = new QVBoxLayout();
editor_layout -> addWidget(information);
editor_layout -> addWidget(names_widget);
editor_layout -> addWidget(def_var_label);
@@ -416,7 +416,7 @@
// avoid creating a QUndoCommand object when no modification was actually done
if (edited_cell_ -> attribute(attribute) == new_value) return;
- ModifyTitleBlockCellCommand *command = new ModifyTitleBlockCellCommand(edited_cell_);
+ auto *command = new ModifyTitleBlockCellCommand(edited_cell_);
command -> addModification(attribute, new_value);
command -> setText(
tr("Édition d'une cellule : %1", "label of and undo command when editing a cell")
Modified: trunk/sources/titleblock/templatecommands.cpp
===================================================================
--- trunk/sources/titleblock/templatecommands.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/titleblock/templatecommands.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -55,7 +55,7 @@
@return true on success, false otherwise
*/
bool ModifyTitleBlockCellCommand::mergeWith(const QUndoCommand *command) {
- const ModifyTitleBlockCellCommand *other = static_cast<const ModifyTitleBlockCellCommand *>(command);
+ const auto *other = static_cast<const ModifyTitleBlockCellCommand *>(command);
if (other) {
if (other -> modified_cell_ == modified_cell_) {
if (other -> new_values_.keys() == new_values_.keys()) {
@@ -226,7 +226,7 @@
if (!tbtemplate) return(nullptr);
// create the command itself
- ModifyTemplateGridCommand *add_row_command = new ModifyTemplateGridCommand(tbtemplate);
+ auto *add_row_command = new ModifyTemplateGridCommand(tbtemplate);
add_row_command -> setInsertion(true);
add_row_command -> setType(true);
add_row_command -> setCells(tbtemplate -> createRow());
@@ -247,7 +247,7 @@
if (!tbtemplate) return(nullptr);
// create the command itself
- ModifyTemplateGridCommand *add_column_command = new ModifyTemplateGridCommand(tbtemplate);
+ auto *add_column_command = new ModifyTemplateGridCommand(tbtemplate);
add_column_command -> setInsertion(true);
add_column_command -> setType(false);
add_column_command -> setCells(tbtemplate -> createColumn());
@@ -268,7 +268,7 @@
if (!tbtemplate) return(nullptr);
// create the command itself
- ModifyTemplateGridCommand *del_row_command = new ModifyTemplateGridCommand(tbtemplate);
+ auto *del_row_command = new ModifyTemplateGridCommand(tbtemplate);
del_row_command -> setInsertion(false);
del_row_command -> setType(true);
del_row_command -> setIndex(index);
@@ -287,7 +287,7 @@
if (!tbtemplate) return(nullptr);
// create the command itself
- ModifyTemplateGridCommand *del_column_command = new ModifyTemplateGridCommand(tbtemplate);
+ auto *del_column_command = new ModifyTemplateGridCommand(tbtemplate);
del_column_command -> setInsertion(false);
del_column_command -> setType(false);
del_column_command -> setIndex(index);
Modified: trunk/sources/titleblock/templatelogomanager.cpp
===================================================================
--- trunk/sources/titleblock/templatelogomanager.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/titleblock/templatelogomanager.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -154,7 +154,7 @@
current_icon = QIcon(*svg_pixmap);
}
}
- QListWidgetItem *qlwi = new QListWidgetItem(current_icon, logo_name);
+ auto *qlwi = new QListWidgetItem(current_icon, logo_name);
qlwi -> setTextAlignment(Qt::AlignBottom | Qt::AlignHCenter);
logos_view_ -> insertItem(0, qlwi);
}
@@ -192,18 +192,18 @@
rd_label = new QLabel();
rd_label -> setWordWrap(true);
rd_input = new QLineEdit();
- QDialogButtonBox *rd_buttons = new QDialogButtonBox();
+ auto *rd_buttons = new QDialogButtonBox();
QPushButton *replace_button = rd_buttons -> addButton(tr("Remplacer"), QDialogButtonBox::YesRole);
QPushButton *rename_button = rd_buttons -> addButton(tr("Renommer"), QDialogButtonBox::NoRole);
QPushButton *cancel_button = rd_buttons -> addButton(QDialogButtonBox::Cancel);
- QVBoxLayout *rd_vlayout0 = new QVBoxLayout();
+ auto *rd_vlayout0 = new QVBoxLayout();
rd_vlayout0 -> addWidget(rd_label);
rd_vlayout0 -> addWidget(rd_input);
rd_vlayout0 -> addWidget(rd_buttons);
rename_dialog -> setLayout(rd_vlayout0);
- QSignalMapper *signal_mapper = new QSignalMapper(rename_dialog);
+ auto *signal_mapper = new QSignalMapper(rename_dialog);
signal_mapper -> setMapping(replace_button, QDialogButtonBox::YesRole);
signal_mapper -> setMapping(rename_button, QDialogButtonBox::NoRole);
signal_mapper -> setMapping(cancel_button, QDialogButtonBox::RejectRole);
Modified: trunk/sources/titleblock/templatescollection.cpp
===================================================================
--- trunk/sources/titleblock/templatescollection.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/titleblock/templatescollection.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -199,7 +199,7 @@
}
// Ok, we have its XML description, we have to generate a TitleBlockTemplate object
- TitleBlockTemplate *titleblock_template = new TitleBlockTemplate(this);
+ auto *titleblock_template = new TitleBlockTemplate(this);
if (titleblock_template -> loadFromXmlElement(titleblock_templates_xml_[template_name])) {
titleblock_templates_.insert(template_name, titleblock_template);
return(titleblock_template);
@@ -403,7 +403,7 @@
TitleBlockTemplate *TitleBlockTemplatesFilesCollection::getTemplate(const QString &template_name) {
if (!templates().contains(template_name)) return(nullptr);
- TitleBlockTemplate *tbtemplate = new TitleBlockTemplate();
+ auto *tbtemplate = new TitleBlockTemplate();
QString tbt_file_path = path(template_name);
bool loading = tbtemplate -> loadFromXmlFile(tbt_file_path);
@@ -431,7 +431,7 @@
return(QDomElement());
}
- QDomDocument *xml_document = new QDomDocument();
+ auto *xml_document = new QDomDocument();
bool xml_parsing = xml_document -> setContent(&xml_file);
if (!xml_parsing) {
delete xml_document;
Modified: trunk/sources/titleblock/templateview.cpp
===================================================================
--- trunk/sources/titleblock/templateview.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/titleblock/templateview.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -140,7 +140,7 @@
QList<TitleBlockCell *> copied_cells = copy();
if (!copied_cells.isEmpty()) {
- CutTemplateCellsCommand *cut_command = new CutTemplateCellsCommand(tbtemplate_);
+ auto *cut_command = new CutTemplateCellsCommand(tbtemplate_);
cut_command -> setCutCells(copied_cells);
requestGridModification(cut_command);
}
@@ -247,7 +247,7 @@
// change num_row and num_col attributes of pasted cells so they get positionned relatively to selected_cell
normalizeCells(pasted_cells, erased_cell -> num_row, erased_cell -> num_col);
- PasteTemplateCellsCommand *paste_command = new PasteTemplateCellsCommand(tbtemplate_);
+ auto *paste_command = new PasteTemplateCellsCommand(tbtemplate_);
foreach (TitleBlockCell cell, pasted_cells) {
TitleBlockCell *erased_cell = tbtemplate_ -> cell(cell.num_row, cell.num_col);
if (!erased_cell) continue;
@@ -334,7 +334,7 @@
dialog.setValue(dimension_before);
int user_answer = dialog.exec();
if (!read_only_ && user_answer == QDialog::Accepted) {
- ModifyTemplateDimension *command = new ModifyTemplateDimension(tbtemplate_);
+ auto *command = new ModifyTemplateDimension(tbtemplate_);
command -> setType(false);
command -> setIndex(index);
command -> setDimensionBefore(dimension_before);
@@ -360,7 +360,7 @@
dialog.setValue(dimension_before);
int user_answer = dialog.exec();
if (!read_only_ && user_answer == QDialog::Accepted) {
- ModifyTemplateDimension *command = new ModifyTemplateDimension(tbtemplate_);
+ auto *command = new ModifyTemplateDimension(tbtemplate_);
command -> setType(true);
command -> setIndex(index);
command -> setDimensionBefore(dimension_before);
@@ -394,7 +394,7 @@
// retrieve the selected cells
TitleBlockTemplateCellsSet selected_cells = selectedCellsSet();
- MergeCellsCommand *merge_command = new MergeCellsCommand(selected_cells, tbtemplate_);
+ auto *merge_command = new MergeCellsCommand(selected_cells, tbtemplate_);
if (merge_command -> isValid()) requestGridModification(merge_command);
}
@@ -405,7 +405,7 @@
// retrieve the selected cells
TitleBlockTemplateCellsSet selected_cells = selectedCellsSet();
- SplitCellsCommand *split_command = new SplitCellsCommand(selected_cells, tbtemplate_);
+ auto *split_command = new SplitCellsCommand(selected_cells, tbtemplate_);
if (split_command -> isValid()) requestGridModification(split_command);
}
@@ -578,7 +578,7 @@
// no animation on first call
tbgrid_ -> setColumnFixedWidth(COL_OFFSET + i, widths.at(i));
} else {
- GridLayoutAnimation *animation = new GridLayoutAnimation(tbgrid_, form_);
+ auto *animation = new GridLayoutAnimation(tbgrid_, form_);
animation -> setIndex(COL_OFFSET + i);
animation -> setActsOnRows(false);
animation -> setStartValue(QVariant(tbgrid_ -> columnMinimumWidth(COL_OFFSET + i)));
@@ -643,7 +643,7 @@
// no animation on first call
tbgrid_ -> setRowFixedHeight(ROW_OFFSET + i, heights.at(i));
} else {
- GridLayoutAnimation *animation = new GridLayoutAnimation(tbgrid_, form_);
+ auto *animation = new GridLayoutAnimation(tbgrid_, form_);
animation -> setIndex(ROW_OFFSET + i);
animation -> setActsOnRows(true);
animation -> setStartValue(QVariant(tbgrid_ -> rowMinimumHeight(ROW_OFFSET + i)));
@@ -665,7 +665,7 @@
int row_count = tbtemplate_ -> rowsCount();
QList<int> heights = tbtemplate_ -> rowsHeights();
for (int i = 0 ; i < row_count ; ++ i) {
- HelperCell *current_row_cell = static_cast<HelperCell *>(tbgrid_ -> itemAt(ROW_OFFSET + i, 0));
+ auto *current_row_cell = static_cast<HelperCell *>(tbgrid_ -> itemAt(ROW_OFFSET + i, 0));
if (current_row_cell) {
current_row_cell -> setType(QET::Absolute); // rows always have absolute heights
current_row_cell -> setLabel(QString(tr("%1px", "format displayed in rows helper cells")).arg(heights.at(i)));
@@ -680,7 +680,7 @@
int col_count = tbtemplate_ -> columnsCount();
for (int i = 0 ; i < col_count ; ++ i) {
TitleBlockDimension current_col_dim = tbtemplate_ -> columnDimension(i);
- HelperCell *current_col_cell = static_cast<HelperCell *>(tbgrid_ -> itemAt(1, COL_OFFSET + i));
+ auto *current_col_cell = static_cast<HelperCell *>(tbgrid_ -> itemAt(1, COL_OFFSET + i));
if (current_col_cell) {
current_col_cell -> setType(current_col_dim.type);
current_col_cell -> setLabel(current_col_dim.toString());
@@ -714,7 +714,7 @@
// we add one cell per column to show their respective width
for (int i = 0 ; i < col_count ; ++ i) {
TitleBlockDimension current_col_dim = tbtemplate_ -> columnDimension(i);
- HelperCell *current_col_cell = new HelperCell();
+ auto *current_col_cell = new HelperCell();
current_col_cell -> setType(current_col_dim.type);
current_col_cell -> setLabel(current_col_dim.toString());
current_col_cell -> setActions(columnsActions());
@@ -728,7 +728,7 @@
// we add one cell per row to show their respective height
QList<int> heights = tbtemplate_ -> rowsHeights();
for (int i = 0 ; i < row_count ; ++ i) {
- HelperCell *current_row_cell = new HelperCell();
+ auto *current_row_cell = new HelperCell();
current_row_cell -> setType(QET::Absolute); // rows always have absolute heights
current_row_cell -> setLabel(QString(tr("%1px")).arg(heights.at(i)));
current_row_cell -> orientation = Qt::Vertical;
@@ -744,7 +744,7 @@
for (int j = 0 ; j < row_count ; ++ j) {
TitleBlockCell *cell = tbtemplate_ -> cell(j, i);
if (cell -> spanner_cell) continue;
- TitleBlockTemplateVisualCell *cell_item = new TitleBlockTemplateVisualCell();
+ auto *cell_item = new TitleBlockTemplateVisualCell();
cell_item -> setTemplateCell(tbtemplate_, cell);
int row_span = 0, col_span = 0;
@@ -768,7 +768,7 @@
for (int i = 0 ; i < col_count ; ++ i) {
for (int j = 0 ; j < row_count ; ++ j) {
if (QGraphicsLayoutItem *item = tbgrid_ -> itemAt(ROW_OFFSET + j, COL_OFFSET + i)) {
- if (QGraphicsItem *qgi = dynamic_cast<QGraphicsItem *>(item)) {
+ if (auto *qgi = dynamic_cast<QGraphicsItem *>(item)) {
qgi -> update();
}
}
@@ -800,7 +800,7 @@
for (int i = 0 ; i < col_count ; ++ i) {
for (int j = 0 ; j < row_count ; ++ j) {
if (tbgrid_ -> itemAt(ROW_OFFSET + j, COL_OFFSET + i)) continue;
- TitleBlockTemplateVisualCell *cell_item = new TitleBlockTemplateVisualCell();
+ auto *cell_item = new TitleBlockTemplateVisualCell();
if (TitleBlockCell *target_cell = tbtemplate_ -> cell(j, i)) {
qDebug() << Q_FUNC_INFO << "target_cell" << target_cell;
cell_item -> setTemplateCell(tbtemplate_, target_cell);
@@ -1057,7 +1057,7 @@
TitleBlockTemplateCellsSet TitleBlockTemplateView::makeCellsSetFromGraphicsItems(const QList<QGraphicsItem *> &items) const {
TitleBlockTemplateCellsSet set(this);
foreach (QGraphicsItem *item, items) {
- if (TitleBlockTemplateVisualCell *cell_view = dynamic_cast<TitleBlockTemplateVisualCell *>(item)) {
+ if (auto *cell_view = dynamic_cast<TitleBlockTemplateVisualCell *>(item)) {
if (cell_view -> cell() && cell_view -> cell() -> num_row != -1) {
set << cell_view;
}
Modified: trunk/sources/titleblocktemplate.cpp
===================================================================
--- trunk/sources/titleblocktemplate.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/titleblocktemplate.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -167,7 +167,7 @@
cells are duplicated too and associated with their parent template).
*/
TitleBlockTemplate *TitleBlockTemplate::clone() const {
- TitleBlockTemplate *copy = new TitleBlockTemplate();
+ auto *copy = new TitleBlockTemplate();
copy -> name_ = name_;
copy -> information_ = information_;
@@ -1030,7 +1030,7 @@
// we can now create our image object from the byte array
if (logo_type == "svg") {
// SVG format is handled by the QSvgRenderer class
- QSvgRenderer *svg = new QSvgRenderer();
+ auto *svg = new QSvgRenderer();
if (!svg -> load(*logo_data)) {
return(false);
}
Modified: trunk/sources/ui/conductorpropertiesdialog.cpp
===================================================================
--- trunk/sources/ui/conductorpropertiesdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/conductorpropertiesdialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -68,7 +68,7 @@
old_value.setValue(conductor->properties());
new_value.setValue(cpd.properties());
- QPropertyUndoCommand *undo = new QPropertyUndoCommand(conductor, "properties", old_value, new_value);
+ auto *undo = new QPropertyUndoCommand(conductor, "properties", old_value, new_value);
undo->setText(tr("Modifier les propriétés d'un conducteur", "undo caption"));
if (!conductor->relatedPotentialConductors().isEmpty() && cpd.applyAll())
Modified: trunk/sources/ui/diagrampropertiesdialog.cpp
===================================================================
--- trunk/sources/ui/diagrampropertiesdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/diagrampropertiesdialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -48,7 +48,7 @@
setWindowTitle(tr("Propriétés du folio", "window title"));
//Border widget
- BorderPropertiesWidget *border_infos = new BorderPropertiesWidget(border, this);
+ auto *border_infos = new BorderPropertiesWidget(border, this);
border_infos -> setReadOnly(diagram_is_read_only);
//Title block widget
@@ -78,7 +78,7 @@
connect(&boutons, SIGNAL(accepted()), this, SLOT(accept()));
connect(&boutons, SIGNAL(rejected()), this, SLOT(reject()));
- QGridLayout *glayout = new QGridLayout;
+ auto *glayout = new QGridLayout;
glayout->addWidget(border_infos,0,0);
glayout->addWidget(titleblock_infos, 1, 0);
glayout->addWidget(m_cpw, 0, 1, 0, 1);
Modified: trunk/sources/ui/diagrampropertieseditordockwidget.cpp
===================================================================
--- trunk/sources/ui/diagrampropertieseditordockwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/diagrampropertieseditordockwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -127,7 +127,7 @@
}
case DynamicElementTextItem::Type:
{
- DynamicElementTextItem *deti = static_cast<DynamicElementTextItem *>(item);
+ auto *deti = static_cast<DynamicElementTextItem *>(item);
//For dynamic element text, we open the element editor to edit it
//If we already edit an element, just update the editor with a new element
@@ -144,7 +144,7 @@
}
case QGraphicsItemGroup::Type:
{
- if(ElementTextItemGroup *group = dynamic_cast<ElementTextItemGroup *>(item))
+ if(auto *group = dynamic_cast<ElementTextItemGroup *>(item))
{
//For element text item group, we open the element editor to edit it
//If we already edit an element, just update the editor with a new element
Modified: trunk/sources/ui/diagramselection.cpp
===================================================================
--- trunk/sources/ui/diagramselection.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/diagramselection.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -62,8 +62,8 @@
// List Diagrams
for(int i=0,j=0; i<list_diagram_.count(); i++,j++){
- QTableWidgetItem *item_Name = new QTableWidgetItem();
- QTableWidgetItem *item_State = new QTableWidgetItem();
+ auto *item_Name = new QTableWidgetItem();
+ auto *item_State = new QTableWidgetItem();
QString diagram_title = list_diagram_.at(i) -> title();
if (diagram_title.isEmpty()) diagram_title = tr("Folio sans titre");
Modified: trunk/sources/ui/dynamicelementtextitemeditor.cpp
===================================================================
--- trunk/sources/ui/dynamicelementtextitemeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/dynamicelementtextitemeditor.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -86,7 +86,7 @@
if (undo->childCount() == 1)
{
- QPropertyUndoCommand *quc = new QPropertyUndoCommand(static_cast<const QPropertyUndoCommand *>(undo->child(0)));
+ auto *quc = new QPropertyUndoCommand(static_cast<const QPropertyUndoCommand *>(undo->child(0)));
if (quc->text().isEmpty())
quc->setText(undo->text());
undo_list << quc;
@@ -105,7 +105,7 @@
if (undo->childCount() == 1)
{
- QPropertyUndoCommand *quc = new QPropertyUndoCommand(static_cast<const QPropertyUndoCommand *>(undo->child(0)));
+ auto *quc = new QPropertyUndoCommand(static_cast<const QPropertyUndoCommand *>(undo->child(0)));
if (quc->text().isEmpty())
quc->setText(undo->text());
undo_list << quc;
@@ -201,7 +201,7 @@
if (!m_element)
return;
- DynamicElementTextItem *deti = new DynamicElementTextItem(m_element);
+ auto *deti = new DynamicElementTextItem(m_element);
if (m_element->diagram())
{
m_element->diagram()->undoStack().push(new AddElementTextCommand(m_element, deti));
Modified: trunk/sources/ui/dynamicelementtextmodel.cpp
===================================================================
--- trunk/sources/ui/dynamicelementtextmodel.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/dynamicelementtextmodel.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -138,7 +138,7 @@
if (deti->textFrom() == DynamicElementTextItem::UserText) title = tr("Texte utilisateur");
else if (deti->textFrom() == DynamicElementTextItem::ElementInfo) title = tr("Information de l'élément");
else title = tr("Texte composé");
- QStandardItem *srca = new QStandardItem(title);
+ auto *srca = new QStandardItem(title);
srca->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
srca->setData(textFrom, Qt::UserRole+1);
@@ -192,7 +192,7 @@
QStandardItem *size = new QStandardItem(tr("Taille"));
size->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *siza = new QStandardItem();
+ auto *siza = new QStandardItem();
siza->setData(deti->fontSize(), Qt::EditRole);
siza->setData(DynamicElementTextModel::size, Qt::UserRole+1);
siza->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -205,7 +205,7 @@
QStandardItem *color = new QStandardItem(tr("Couleur"));
color->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *colora = new QStandardItem;
+ auto *colora = new QStandardItem;
colora->setData(deti->color(), Qt::ForegroundRole);
colora->setData(deti->color(), Qt::EditRole);
colora->setData(DynamicElementTextModel::color, Qt::UserRole+1);
@@ -219,7 +219,7 @@
QStandardItem *frame = new QStandardItem(tr("Cadre"));
frame->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *frame_a = new QStandardItem;
+ auto *frame_a = new QStandardItem;
frame_a->setCheckable(true);
frame_a->setCheckState(deti->frame()? Qt::Checked : Qt::Unchecked);
frame_a->setData(DynamicElementTextModel::frame, Qt::UserRole+1);
@@ -233,7 +233,7 @@
QStandardItem *width = new QStandardItem(tr("Largeur"));
width->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *width_a = new QStandardItem;
+ auto *width_a = new QStandardItem;
width_a->setData(deti->textWidth(), Qt::EditRole);
width_a->setData(DynamicElementTextModel::textWidth, Qt::UserRole+1);
width_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -248,7 +248,7 @@
QStandardItem *x_pos = new QStandardItem(tr("Position X"));
x_pos->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *x_pos_a = new QStandardItem;
+ auto *x_pos_a = new QStandardItem;
x_pos_a->setData(deti->pos().x(), Qt::EditRole);
x_pos_a->setData(DynamicElementTextModel::pos, Qt::UserRole+1);
x_pos_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -261,7 +261,7 @@
QStandardItem *y_pos = new QStandardItem(tr("Position Y"));
y_pos->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *y_pos_a = new QStandardItem;
+ auto *y_pos_a = new QStandardItem;
y_pos_a->setData(deti->pos().y(), Qt::EditRole);
y_pos_a->setData(DynamicElementTextModel::pos, Qt::UserRole+1);
y_pos_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -274,7 +274,7 @@
QStandardItem *rot = new QStandardItem(tr("Rotation"));
rot->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *rot_a = new QStandardItem;
+ auto *rot_a = new QStandardItem;
rot_a->setData(deti->rotation(), Qt::EditRole);
rot_a->setData(DynamicElementTextModel::rotation, Qt::UserRole+1);
rot_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -299,7 +299,7 @@
qsi_list.clear();
- QStandardItem *empty_qsi = new QStandardItem(0);
+ auto *empty_qsi = new QStandardItem(0);
empty_qsi->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
qsi_list << qsi << empty_qsi;
@@ -620,7 +620,7 @@
grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEditable);
grp->setIcon(QET::Icons::textGroup);
- QStandardItem *empty_qsi = new QStandardItem(0);
+ auto *empty_qsi = new QStandardItem(0);
empty_qsi->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
QList<QStandardItem *> qsi_list;
@@ -640,7 +640,7 @@
case Qt::AlignVCenter: text = tr("Centre"); break;
default: break;}
- QStandardItem *alignment_a = new QStandardItem(text);
+ auto *alignment_a = new QStandardItem(text);
alignment_a->setData(DynamicElementTextModel::grpAlignment, Qt::UserRole+1);
alignment_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
qsi_list.clear();
@@ -651,7 +651,7 @@
QStandardItem *x_pos = new QStandardItem(tr("Position X"));
x_pos->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *x_pos_a = new QStandardItem;
+ auto *x_pos_a = new QStandardItem;
x_pos_a->setData(group->pos().x(), Qt::EditRole);
x_pos_a->setData(DynamicElementTextModel::grpPos, Qt::UserRole+1);
x_pos_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -664,7 +664,7 @@
QStandardItem *y_pos = new QStandardItem(tr("Position Y"));
y_pos->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *y_pos_a = new QStandardItem;
+ auto *y_pos_a = new QStandardItem;
y_pos_a->setData(group->pos().y(), Qt::EditRole);
y_pos_a->setData(DynamicElementTextModel::grpPos, Qt::UserRole+1);
y_pos_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -677,7 +677,7 @@
QStandardItem *rot = new QStandardItem(tr("Rotation"));
rot->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- QStandardItem *rot_a = new QStandardItem;
+ auto *rot_a = new QStandardItem;
rot_a->setData(group->rotation(), Qt::EditRole);
rot_a->setData(DynamicElementTextModel::grpRotation, Qt::UserRole+1);
rot_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -689,7 +689,7 @@
QStandardItem *v_adj = new QStandardItem(tr("Ajustement vertical"));
v_adj->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
- QStandardItem *v_adj_a = new QStandardItem;
+ auto *v_adj_a = new QStandardItem;
v_adj_a->setData(group->verticalAdjustment(), Qt::EditRole);
v_adj_a->setData(DynamicElementTextModel::grpVAdjust, Qt::UserRole+1);
v_adj_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -701,7 +701,7 @@
QStandardItem *frame_ = new QStandardItem(tr("Cadre"));
frame_->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
- QStandardItem *frame_a = new QStandardItem;
+ auto *frame_a = new QStandardItem;
frame_a->setCheckable(true);
frame_a->setCheckState(group->frame()? Qt::Checked : Qt::Unchecked);
frame_a->setData(DynamicElementTextModel::grpFrame, Qt::UserRole+1);
@@ -715,7 +715,7 @@
QStandardItem *hold_bottom = new QStandardItem(tr("Maintenir en bas de page"));
hold_bottom->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
- QStandardItem *hold_bottom_a = new QStandardItem();
+ auto *hold_bottom_a = new QStandardItem();
hold_bottom_a->setCheckable(true);
hold_bottom_a->setCheckState(group->holdToBottomPage() ? Qt::Checked : Qt::Unchecked);
hold_bottom_a->setData(DynamicElementTextModel::grpHoldBottom, Qt::UserRole+1);
@@ -1046,7 +1046,7 @@
DynamicElementTextItem *deti = m_texts_list.key(item);
if(deti)
{
- QMimeData *mime_data = new QMimeData();
+ auto *mime_data = new QMimeData();
mime_data->setText(deti->uuid().toString());
mime_data->setData("application/x-qet-element-text-uuid", deti->uuid().toString().toLatin1());
return mime_data;
@@ -1421,7 +1421,7 @@
{
case DynamicElementTextModel::textFrom:
{
- QComboBox *qcb = new QComboBox(parent);
+ auto *qcb = new QComboBox(parent);
qcb->setObjectName("text_from");
qcb->addItem(tr("Texte utilisateur"));
qcb->addItem(tr("Information de l'élément"));
@@ -1430,7 +1430,7 @@
}
case DynamicElementTextModel::infoText:
{
- const DynamicElementTextModel *detm = static_cast<const DynamicElementTextModel *>(index.model());
+ const auto *detm = static_cast<const DynamicElementTextModel *>(index.model());
QStandardItem *qsi = detm->itemFromIndex(index);
if(!qsi)
@@ -1447,7 +1447,7 @@
info_map.insert(QETApp::elementTranslatedInfoKey(str), str);
}
- QComboBox *qcb = new QComboBox(parent);
+ auto *qcb = new QComboBox(parent);
qcb->setObjectName("info_text");
for (const QString& key : info_map.keys()) {
qcb->addItem(key, info_map.value(key));
@@ -1456,7 +1456,7 @@
}
case DynamicElementTextModel::compositeText:
{
- const DynamicElementTextModel *detm = static_cast<const DynamicElementTextModel *>(index.model());
+ const auto *detm = static_cast<const DynamicElementTextModel *>(index.model());
QStandardItem *qsi = detm->itemFromIndex(index);
if(!qsi)
@@ -1466,13 +1466,13 @@
if(!deti)
break;
- CompositeTextEditDialog *cted = new CompositeTextEditDialog(deti, parent);
+ auto *cted = new CompositeTextEditDialog(deti, parent);
cted->setObjectName("composite_text");
return cted;
}
case DynamicElementTextModel::txtAlignment:
{
- const DynamicElementTextModel *detm = static_cast<const DynamicElementTextModel *>(index.model());
+ const auto *detm = static_cast<const DynamicElementTextModel *>(index.model());
QStandardItem *qsi = detm->itemFromIndex(index);
if(!qsi)
@@ -1488,7 +1488,7 @@
}
case DynamicElementTextModel::size:
{
- QSpinBox *sb = new QSpinBox(parent);
+ auto *sb = new QSpinBox(parent);
sb->setObjectName("font_size");
sb->setFrame(false);
return sb;
@@ -1501,7 +1501,7 @@
}
case DynamicElementTextModel::pos:
{
- QSpinBox *sb = new QSpinBox(parent);
+ auto *sb = new QSpinBox(parent);
sb->setObjectName("pos_dialog");
sb->setRange(-1000,10000);
sb->setFrame(false);
@@ -1510,7 +1510,7 @@
}
case DynamicElementTextModel::rotation:
{
- QSpinBox *sb = new QSpinBox(parent);
+ auto *sb = new QSpinBox(parent);
sb->setObjectName("rot_spinbox");
sb->setRange(0, 359);
sb->setWrapping(true);
@@ -1520,7 +1520,7 @@
}
case DynamicElementTextModel::textWidth:
{
- QSpinBox *sb = new QSpinBox(parent);
+ auto *sb = new QSpinBox(parent);
sb->setObjectName("width_spinbox");
sb->setRange(-1, 500);
sb->setFrame(false);
@@ -1529,7 +1529,7 @@
}
case DynamicElementTextModel::grpAlignment:
{
- QComboBox *qcb = new QComboBox(parent);
+ auto *qcb = new QComboBox(parent);
qcb->setFrame(false);
qcb->setObjectName("group_alignment");
qcb->addItem(tr("Gauche"));
@@ -1539,7 +1539,7 @@
}
case DynamicElementTextModel::grpPos:
{
- QSpinBox *sb = new QSpinBox(parent);
+ auto *sb = new QSpinBox(parent);
sb->setObjectName("group_pos");
sb->setRange(-1000,10000);
sb->setFrame(false);
@@ -1548,7 +1548,7 @@
}
case DynamicElementTextModel::grpRotation:
{
- QSpinBox *sb = new QSpinBox(parent);
+ auto *sb = new QSpinBox(parent);
sb->setObjectName("group_rotation");
sb->setRange(0, 359);
sb->setWrapping(true);
@@ -1558,7 +1558,7 @@
}
case DynamicElementTextModel::grpVAdjust:
{
- QSpinBox *sb = new QSpinBox(parent);
+ auto *sb = new QSpinBox(parent);
sb->setObjectName("group_v_adjustment");
sb->setRange(-20, 20);
sb->setFrame(false);
@@ -1575,11 +1575,11 @@
{
if(editor->objectName() == "color_dialog")
{
- if (QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
+ if (auto *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
- QColorDialog *cd = static_cast<QColorDialog *> (editor);
+ auto *cd = static_cast<QColorDialog *> (editor);
qsi->setData(cd->selectedColor(), Qt::EditRole);
qsi->setData(cd->selectedColor(), Qt::ForegroundRole);
return;
@@ -1589,11 +1589,11 @@
}
else if (editor->objectName() == "info_text")
{
- if (QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
+ if (auto *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
- QComboBox *cb = static_cast<QComboBox *>(editor);
+ auto *cb = static_cast<QComboBox *>(editor);
qsi->setData(cb->currentText(), Qt::DisplayRole);
qsi->setData(cb->currentData(), Qt::UserRole+2);
return;
@@ -1603,17 +1603,17 @@
}
else if (editor->objectName() == "composite_text")
{
- if (QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
+ if (auto *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
- CompositeTextEditDialog *cted = static_cast<CompositeTextEditDialog *>(editor);
+ auto *cted = static_cast<CompositeTextEditDialog *>(editor);
QString edited_text = cted->plainText();
QString assigned_text;
- const DynamicElementTextModel *detm = static_cast<const DynamicElementTextModel *>(index.model());
+ const auto *detm = static_cast<const DynamicElementTextModel *>(index.model());
DynamicElementTextItem *deti = detm->textFromIndex(index);
if(deti)
{
@@ -1631,11 +1631,11 @@
}
else if (editor->objectName() == "alignment_text")
{
- if(QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
+ if(auto *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
- AlignmentTextDialog *atd = static_cast<AlignmentTextDialog *>(editor);
+ auto *atd = static_cast<AlignmentTextDialog *>(editor);
Qt::Alignment align = atd->alignment();
qsi->setData(QVariant::fromValue(align), Qt::UserRole+2);
return;
@@ -1644,11 +1644,11 @@
}
else if (editor->objectName() == "group_alignment")
{
- if(QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
+ if(auto *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
- QComboBox *cb = static_cast<QComboBox *>(editor);
+ auto *cb = static_cast<QComboBox *>(editor);
qsi->setData(cb->currentText(), Qt::DisplayRole);
}
}
@@ -1671,7 +1671,7 @@
{
object->event(event);
- QSpinBox *sb = static_cast<QSpinBox *>(object);
+ auto *sb = static_cast<QSpinBox *>(object);
switch (event->type()) {
case QEvent::KeyPress:
emit commitData(sb); break;
@@ -1691,7 +1691,7 @@
//Like the hack above, change the current index of the combobox, apply the change immediately, no need to lose focus or press enter.
if((object->objectName() == "text_from" || object->objectName() == "info_text" || object->objectName() == "group_alignment") && event->type() == QEvent::FocusIn)
{
- QComboBox *qcb = static_cast<QComboBox *>(object);
+ auto *qcb = static_cast<QComboBox *>(object);
connect(qcb, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [this,qcb](){emit commitData(qcb);});
}
Modified: trunk/sources/ui/elementpropertieswidget.cpp
===================================================================
--- trunk/sources/ui/elementpropertieswidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/elementpropertieswidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -84,7 +84,7 @@
{
if(group->parentItem() && group->parentItem()->type() == Element::Type)
{
- Element *elmt = static_cast<Element *>(group->parentItem());
+ auto *elmt = static_cast<Element *>(group->parentItem());
m_diagram = elmt->diagram();
buildGui();
setTextsGroup(group);
@@ -133,7 +133,7 @@
{
if (QString(aepew->metaObject()->className()) == "DynamicElementTextItemEditor")
{
- DynamicElementTextItemEditor *detie = static_cast<DynamicElementTextItemEditor *>(aepew);
+ auto *detie = static_cast<DynamicElementTextItemEditor *>(aepew);
m_tab->setCurrentWidget(detie);
detie->setCurrentText(text);
}
@@ -156,7 +156,7 @@
{
if (QString(aepew->metaObject()->className()) == "DynamicElementTextItemEditor")
{
- DynamicElementTextItemEditor *detie = static_cast<DynamicElementTextItemEditor *>(aepew);
+ auto *detie = static_cast<DynamicElementTextItemEditor *>(aepew);
m_tab->setCurrentWidget(detie);
detie->setCurrentGroup(group);
}
@@ -216,7 +216,7 @@
*/
void ElementPropertiesWidget::findInPanel()
{
- CustomElement *custom_element = qobject_cast<CustomElement *>(m_element);
+ auto *custom_element = qobject_cast<CustomElement *>(m_element);
if (custom_element && m_diagram)
{
m_diagram->findElementRequired(custom_element->location());
@@ -230,7 +230,7 @@
*/
void ElementPropertiesWidget::editElement()
{
- CustomElement *custom_element = qobject_cast<CustomElement *>(m_element);
+ auto *custom_element = qobject_cast<CustomElement *>(m_element);
if (custom_element && m_diagram)
{
m_diagram->findElementRequired(custom_element->location());
@@ -246,7 +246,7 @@
void ElementPropertiesWidget::buildGui()
{
m_tab = new QTabWidget(this);
- QVBoxLayout *main_layout = new QVBoxLayout(this);
+ auto *main_layout = new QVBoxLayout(this);
main_layout -> addWidget(m_tab);
setLayout(main_layout);
}
@@ -342,8 +342,8 @@
*/
QWidget *ElementPropertiesWidget::generalWidget()
{
- CustomElement *custom_element = qobject_cast<CustomElement *>(m_element);
- GhostElement *ghost_element = qobject_cast<GhostElement *>(m_element);
+ auto *custom_element = qobject_cast<CustomElement *>(m_element);
+ auto *ghost_element = qobject_cast<GhostElement *>(m_element);
// type de l'element
QString description_string;
@@ -371,7 +371,7 @@
// widget himself
QWidget *general_widget = new QWidget (m_tab);
- QVBoxLayout *vlayout_ = new QVBoxLayout (general_widget);
+ auto *vlayout_ = new QVBoxLayout (general_widget);
general_widget -> setLayout(vlayout_);
//widget for the text
@@ -389,7 +389,7 @@
connect(find_in_panel, SIGNAL(clicked()), this, SLOT(findInPanel()));
QPushButton *edit_element = new QPushButton(QET::Icons::ElementEdit, tr("Éditer l'élément"), general_widget);
connect(edit_element, SIGNAL(clicked()), this, SLOT(editElement()));
- QHBoxLayout *hlayout_ = new QHBoxLayout;
+ auto *hlayout_ = new QHBoxLayout;
hlayout_->addWidget(find_in_panel);
hlayout_->addWidget(edit_element);
vlayout_->addLayout(hlayout_);
Modified: trunk/sources/ui/importelementdialog.cpp
===================================================================
--- trunk/sources/ui/importelementdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/importelementdialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -42,10 +42,10 @@
void ImportElementDialog::setUpWidget()
{
- QButtonGroup *button_group = new QButtonGroup(this);
+ auto *button_group = new QButtonGroup(this);
button_group->addButton(ui->m_use_actual_rd);
button_group->addButton(ui->m_use_drop_rb);
- QButtonGroup *button_group_drop = new QButtonGroup(this);
+ auto *button_group_drop = new QButtonGroup(this);
button_group_drop->addButton(ui->m_erase_actual_rb);
button_group_drop->addButton(ui->m_use_both_rb);
Modified: trunk/sources/ui/linksingleelementwidget.cpp
===================================================================
--- trunk/sources/ui/linksingleelementwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/linksingleelementwidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -157,7 +157,7 @@
*/
QUndoCommand *LinkSingleElementWidget::associatedUndo() const
{
- LinkElementCommand *undo = new LinkElementCommand(m_element);
+ auto *undo = new LinkElementCommand(m_element);
if (m_element_to_link || m_unlink)
{
@@ -257,7 +257,7 @@
qDebug() << "In method void LinkSingleElementWidget::updateUi(), provided element must be in a diagram";
}
- QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_tree_widget, str_list);
+ auto *qtwi = new QTreeWidgetItem(ui->m_tree_widget, str_list);
m_qtwi_elmt_hash.insert(qtwi, elmt);
m_qtwi_strl_hash.insert(qtwi, search_list);
}
@@ -311,7 +311,7 @@
qDebug() << "In method void LinkSingleElementWidget::updateUi(), provided element must be in a diagram";
}
- QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_tree_widget, str_list);
+ auto *qtwi = new QTreeWidgetItem(ui->m_tree_widget, str_list);
m_qtwi_elmt_hash.insert(qtwi, elmt);
m_qtwi_strl_hash.insert(qtwi, search_list);
}
@@ -381,7 +381,7 @@
foreach(QStringList strl , m_qtwi_strl_hash.values())
search.append(strl);
- QCompleter *c = new QCompleter(search, ui->m_search_field);
+ auto *c = new QCompleter(search, ui->m_search_field);
c->setCaseSensitivity(Qt::CaseInsensitive);
ui->m_search_field->setCompleter(c);
}
Modified: trunk/sources/ui/masterpropertieswidget.cpp
===================================================================
--- trunk/sources/ui/masterpropertieswidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/masterpropertieswidget.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -196,7 +196,7 @@
return nullptr;
}
- LinkElementCommand *undo = new LinkElementCommand(m_element);
+ auto *undo = new LinkElementCommand(m_element);
if (to_link.isEmpty())
undo->unlinkAll();
@@ -239,7 +239,7 @@
const QList<Element *> free_list = elmt_prov.freeElement(Element::Slave);
for(Element *elmt : free_list)
{
- QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_free_tree_widget);
+ auto *qtwi = new QTreeWidgetItem(ui->m_free_tree_widget);
qtwi->setIcon(0, elmt->pixmap());
if(settings.value("genericpanel/folio", false).toBool())
@@ -267,7 +267,7 @@
const QList<Element *> link_list = m_element->linkedElements();
for(Element *elmt : link_list)
{
- QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_link_tree_widget);
+ auto *qtwi = new QTreeWidgetItem(ui->m_link_tree_widget);
qtwi->setIcon(0, elmt->pixmap());
if(settings.value("genericpanel/folio", false).toBool())
Modified: trunk/sources/ui/multipastedialog.cpp
===================================================================
--- trunk/sources/ui/multipastedialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/multipastedialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -126,7 +126,7 @@
{
QPair <Terminal *, Terminal *> pair = elmt->AlignedFreeTerminals().takeFirst();
- Conductor *conductor = new Conductor(pair.first, pair.second);
+ auto *conductor = new Conductor(pair.first, pair.second);
m_diagram->undoStack().push(new AddItemCommand<Conductor *>(conductor, m_diagram, QPointF()));
//Autonum the new conductor, the undo command associated for this, have for parent undo_object
Modified: trunk/sources/ui/potentialselectordialog.cpp
===================================================================
--- trunk/sources/ui/potentialselectordialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/potentialselectordialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -240,8 +240,8 @@
if(!cp2.m_tension_protocol.isEmpty())
text2.append(tr("\nTension/protocole : %1").arg(cp2.m_tension_protocol));
- QRadioButton *rb1 = new QRadioButton(text1, this);
- QRadioButton *rb2 = new QRadioButton(text2, this);
+ auto *rb1 = new QRadioButton(text1, this);
+ auto *rb2 = new QRadioButton(text2, this);
connect(rb1, &QRadioButton::toggled, [this](bool t)
{
Modified: trunk/sources/ui/projectpropertiesdialog.cpp
===================================================================
--- trunk/sources/ui/projectpropertiesdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/ui/projectpropertiesdialog.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -28,8 +28,8 @@
* @param parent : parent widget of this dialog
*/
ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *parent) {
- NewDiagramPage *newDiagramPage = new NewDiagramPage(project,parent,this);
- ProjectAutoNumConfigPage *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project);
+ auto *newDiagramPage = new NewDiagramPage(project,parent,this);
+ auto *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project);
m_properties_dialog = new ConfigDialog (parent);
m_properties_dialog -> setWindowTitle(QObject::tr("Propriétés du projet", "window title"));
m_properties_dialog -> addPage(new ProjectMainConfigPage (project));
@@ -72,6 +72,6 @@
* Change the current displayed tab to folio tab.
*/
void ProjectPropertiesDialog::changeToFolio() {
- ProjectAutoNumConfigPage *autoNumPage = static_cast <ProjectAutoNumConfigPage*>(m_properties_dialog->pages.at(2));
+ auto *autoNumPage = static_cast <ProjectAutoNumConfigPage*>(m_properties_dialog->pages.at(2));
autoNumPage->changeToTab(3);
}
Modified: trunk/sources/undocommand/addelementtextcommand.cpp
===================================================================
--- trunk/sources/undocommand/addelementtextcommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/undocommand/addelementtextcommand.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -349,7 +349,7 @@
if (id() != other->id() || other->childCount())
return false;
- AlignmentTextsGroupCommand const *undo = static_cast<const AlignmentTextsGroupCommand *>(other);
+ auto const *undo = static_cast<const AlignmentTextsGroupCommand *>(other);
if (m_group != undo->m_group)
return false;
Modified: trunk/sources/undocommand/changeelementinformationcommand.cpp
===================================================================
--- trunk/sources/undocommand/changeelementinformationcommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/undocommand/changeelementinformationcommand.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -38,7 +38,7 @@
bool ChangeElementInformationCommand::mergeWith(const QUndoCommand *other)
{
if (id() != other->id()) return false;
- ChangeElementInformationCommand const *undo = static_cast<const ChangeElementInformationCommand*>(other);
+ auto const *undo = static_cast<const ChangeElementInformationCommand*>(other);
if (m_element != undo->m_element) return false;
m_new_info = undo->m_new_info;
return true;
Modified: trunk/sources/undocommand/linkelementcommand.cpp
===================================================================
--- trunk/sources/undocommand/linkelementcommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/undocommand/linkelementcommand.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -45,7 +45,7 @@
bool LinkElementCommand::mergeWith(const QUndoCommand *other)
{
if (id() != other->id() || other->childCount()) return false;
- LinkElementCommand const *undo = static_cast<const LinkElementCommand *> (other);
+ auto const *undo = static_cast<const LinkElementCommand *> (other);
if (m_element != undo->m_element) return false;
m_linked_after = undo->m_linked_after;
return true;
Modified: trunk/sources/undocommand/rotateselectioncommand.cpp
===================================================================
--- trunk/sources/undocommand/rotateselectioncommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/undocommand/rotateselectioncommand.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -61,7 +61,7 @@
break;
case QGraphicsItemGroup::Type:
{
- if(ElementTextItemGroup *grp = dynamic_cast<ElementTextItemGroup *>(item))
+ if(auto *grp = dynamic_cast<ElementTextItemGroup *>(item))
if(grp->parentElement() && !grp->parentElement()->isSelected())
m_undo << new QPropertyUndoCommand(grp, "rotation", QVariant(item->rotation()), QVariant(item->rotation()+angle), this);
}
Modified: trunk/sources/undocommand/rotatetextscommand.cpp
===================================================================
--- trunk/sources/undocommand/rotatetextscommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
+++ trunk/sources/undocommand/rotatetextscommand.cpp 2018-07-19 16:27:20 UTC (rev 5449)
@@ -43,7 +43,7 @@
texts_list << dti;
if(dti->type() == ConductorTextItem::Type)
{
- ConductorTextItem *cti = static_cast<ConductorTextItem *>(dti);
+ auto *cti = static_cast<ConductorTextItem *>(dti);
m_cond_texts.insert(cti, cti->wasRotateByUser());
}
}
@@ -143,7 +143,7 @@
if(m_anim_group == nullptr)
m_anim_group = new QParallelAnimationGroup();
- QPropertyAnimation *animation = new QPropertyAnimation(target, propertyName);
+ auto *animation = new QPropertyAnimation(target, propertyName);
animation->setDuration(300);
animation->setStartValue(start);
animation->setEndValue(end);