Revert r5449 and disable r5452 momentary : Load time from elements is

very slow


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5461 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810
2018-07-30 15:24:29 +00:00
parent 52e941f0fc
commit 30bee81432
101 changed files with 514 additions and 514 deletions

View File

@@ -75,7 +75,7 @@ ElementCollectionItem *ElementCollectionItem::childWithCollectionName(const QStr
{
rowCount();
foreach (QStandardItem *qsi, directChilds()) {
auto *eci = static_cast<ElementCollectionItem *>(qsi);
ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsi);
if (eci->name() == name)
return eci;
}
@@ -167,7 +167,7 @@ QList<ElementCollectionItem *> ElementCollectionItem::elementsDirectChild() cons
QList <ElementCollectionItem *> element_child;
foreach (QStandardItem *qsi, directChilds()) {
auto *eci = static_cast<ElementCollectionItem *>(qsi);
ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsi);
if (eci->isElement())
element_child.append(eci);
}
@@ -184,7 +184,7 @@ QList<ElementCollectionItem *> ElementCollectionItem::directoriesDirectChild() c
QList <ElementCollectionItem *> dir_child;
foreach (QStandardItem *qsi, directChilds()) {
auto *eci = static_cast<ElementCollectionItem *>(qsi);
ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsi);
if (eci->isDir())
dir_child.append(eci);
}
@@ -231,7 +231,7 @@ QList<ElementCollectionItem *> ElementCollectionItem::items() const
QList <ElementCollectionItem *> list;
for (int i=0 ; i<rowCount() ; i++) {
auto *eci = static_cast<ElementCollectionItem *>(child(i));
ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(child(i));
list.append(eci);
list.append(eci->items());
}

View File

@@ -68,9 +68,9 @@ QMimeData *ElementsCollectionModel::mimeData(const QModelIndexList &indexes) con
QModelIndex index = indexes.first();
if (index.isValid())
{
auto *item = static_cast<ElementCollectionItem*>(itemFromIndex(index));
ElementCollectionItem *item = static_cast<ElementCollectionItem*>(itemFromIndex(index));
auto *mime_data = new QMimeData();
QMimeData *mime_data = new QMimeData();
mime_data->setText(item->collectionPath());
if (item->isElement())
@@ -120,7 +120,7 @@ bool ElementsCollectionModel::canDropMimeData(const QMimeData *data, Qt::DropAct
if (static_cast<FileElementCollectionItem *>(qsi)->isCommonCollection())
return false;
auto *eci = static_cast<ElementCollectionItem *>(qsi);
ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsi);
if (data->hasFormat("application/x-qet-element-uri") || data->hasFormat("application/x-qet-category-uri"))
{
@@ -156,7 +156,7 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data, Qt::DropAction
if (qsi->type() == FileElementCollectionItem::Type)
{
auto *feci = static_cast<FileElementCollectionItem *>(qsi);
FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(qsi);
if (feci->isCommonCollection())
return false;
@@ -185,7 +185,7 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data, Qt::DropAction
return false;
}
else if (qsi->type() == XmlProjectElementCollectionItem::Type) {
auto *xpeci = static_cast<XmlProjectElementCollectionItem*>(qsi);
XmlProjectElementCollectionItem *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::loadCollections(bool common_collection, bool custo
*/
void ElementsCollectionModel::addCommonCollection(bool set_data)
{
auto *feci = new FileElementCollectionItem();
FileElementCollectionItem *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::addCommonCollection(bool set_data)
*/
void ElementsCollectionModel::addCustomCollection(bool set_data)
{
auto *feci = new FileElementCollectionItem();
FileElementCollectionItem *feci = new FileElementCollectionItem();
if (feci->setRootPath(QETApp::customElementsDirN(), set_data, m_hide_element)) {
invisibleRootItem()->appendRow(feci);
if (set_data)
@@ -313,7 +313,7 @@ void ElementsCollectionModel::addLocation(const ElementsLocation& location)
foreach(ElementCollectionItem *eci, child_list) {
if (eci->type() == FileElementCollectionItem::Type) {
auto *feci = static_cast<FileElementCollectionItem *>(eci);
FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(eci);
if (feci->isCustomCollection()) {
last_item = feci->lastItemForPath(location.collectionPath(false), collection_name);
@@ -341,7 +341,7 @@ void ElementsCollectionModel::addProject(QETProject *project, bool set_data)
m_project_list.append(project);
int row = m_project_list.indexOf(project);
auto *xpeci = new XmlProjectElementCollectionItem();
XmlProjectElementCollectionItem *xpeci = new XmlProjectElementCollectionItem();
m_project_hash.insert(project, xpeci);
xpeci->setProject(project, set_data);
@@ -419,7 +419,7 @@ QList <ElementCollectionItem *> ElementsCollectionModel::items() const
QList <ElementCollectionItem *> list;
for (int i=0 ; i<rowCount() ; i++) {
auto *eci = static_cast<ElementCollectionItem *>(item(i));
ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(item(i));
list.append(eci);
list.append(eci->items());
}
@@ -478,7 +478,7 @@ QModelIndex ElementsCollectionModel::indexFromLocation(const ElementsLocation &l
ElementCollectionItem *match_eci = nullptr;
if (eci->type() == FileElementCollectionItem::Type) {
if (auto *feci = static_cast<FileElementCollectionItem *>(eci)) {
if (FileElementCollectionItem *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 @@ QModelIndex ElementsCollectionModel::indexFromLocation(const ElementsLocation &l
}
}
else if (eci->type() == XmlProjectElementCollectionItem::Type) {
if (auto *xpeci = static_cast<XmlProjectElementCollectionItem *>(eci)) {
if (XmlProjectElementCollectionItem *xpeci = static_cast<XmlProjectElementCollectionItem *>(eci)) {
match_eci = xpeci->itemAtPath(location.collectionPath(false));
}
}
@@ -507,7 +507,7 @@ QModelIndex ElementsCollectionModel::indexFromLocation(const ElementsLocation &l
void ElementsCollectionModel::elementIntegratedToCollection(const QString& path)
{
QObject *object = sender();
auto *collection = static_cast<XmlElementCollection *> (object);
XmlElementCollection *collection = static_cast<XmlElementCollection *> (object);
if (!collection)
return;
@@ -540,7 +540,7 @@ void ElementsCollectionModel::elementIntegratedToCollection(const QString& path)
void ElementsCollectionModel::itemRemovedFromCollection(const QString& path)
{
QObject *object = sender();
auto *collection = static_cast<XmlElementCollection *> (object);
XmlElementCollection *collection = static_cast<XmlElementCollection *> (object);
if (!collection)
return;
@@ -568,7 +568,7 @@ void ElementsCollectionModel::itemRemovedFromCollection(const QString& path)
void ElementsCollectionModel::updateItem(const QString& path)
{
QObject *object = sender();
auto *collection = static_cast<XmlElementCollection *> (object);
XmlElementCollection *collection = static_cast<XmlElementCollection *> (object);
if (!collection)
return;

View File

@@ -242,7 +242,7 @@ void ElementsCollectionWidget::customContextMenu(const QPoint &point)
if (eci->type() == FileElementCollectionItem::Type)
{
add_open_dir = true;
auto *feci = static_cast<FileElementCollectionItem*>(eci);
FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
if (!feci->isCommonCollection())
{
if (feci->isDir())
@@ -261,7 +261,7 @@ void ElementsCollectionWidget::customContextMenu(const QPoint &point)
}
if (eci->type() == XmlProjectElementCollectionItem::Type)
{
auto *xpeci = static_cast<XmlProjectElementCollectionItem *>(eci);
XmlProjectElementCollectionItem *xpeci = static_cast<XmlProjectElementCollectionItem *>(eci);
if (xpeci->isCollectionRoot())
add_open_dir = true;
}
@@ -404,7 +404,7 @@ void ElementsCollectionWidget::editDirectory()
if (eci->type() != FileElementCollectionItem::Type) return;
auto *feci = static_cast<FileElementCollectionItem*>(eci);
FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
if(feci->isCommonCollection()) return;
ElementsLocation location(feci->collectionPath());
@@ -424,7 +424,7 @@ void ElementsCollectionWidget::newDirectory()
if (eci->type() != FileElementCollectionItem::Type) return;
auto *feci = static_cast<FileElementCollectionItem*>(eci);
FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
if(feci->isCommonCollection()) return;
ElementsLocation location(feci->collectionPath());
@@ -445,7 +445,7 @@ void ElementsCollectionWidget::newElement()
return;
}
auto *feci = static_cast<FileElementCollectionItem*>(eci);
FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
if(feci->isCommonCollection()) {
return;
}
@@ -533,7 +533,7 @@ void ElementsCollectionWidget::dirProperties()
void ElementsCollectionWidget::reload()
{
m_progress_bar->show();
auto *new_model = new ElementsCollectionModel(m_tree_view);
ElementsCollectionModel *new_model = new ElementsCollectionModel(m_tree_view);
QList <QETProject *> project_list;
project_list.append(m_waiting_project);

View File

@@ -50,8 +50,8 @@ void ElementsTreeView::startDrag(Qt::DropActions supportedActions)
return;
}
if (auto *qsim = static_cast<QStandardItemModel *>(model())) {
if (auto *eci = static_cast<ElementCollectionItem *>(qsim->itemFromIndex(index))) {
if (QStandardItemModel *qsim = static_cast<QStandardItemModel *>(model())) {
if (ElementCollectionItem *eci = static_cast<ElementCollectionItem *>(qsim->itemFromIndex(index))) {
ElementsLocation loc (eci->collectionPath());
if (loc.exist()) {
startElementDrag(loc);
@@ -72,10 +72,10 @@ void ElementsTreeView::startElementDrag(const ElementsLocation &location)
if (!location.exist())
return;
auto *drag = new QDrag(this);
QDrag *drag = new QDrag(this);
QString location_str = location.toString();
auto *mime_data = new QMimeData();
QMimeData *mime_data = new QMimeData();
mime_data->setText(location_str);
if (location.isDirectory())

View File

@@ -58,7 +58,7 @@ QString FileElementCollectionItem::fileSystemPath() const
if (isCollectionRoot())
return m_path;
auto *feci = static_cast<FileElementCollectionItem *> (parent());
FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *> (parent());
if (feci)
return feci->fileSystemPath() + "/" + m_path;
else
@@ -172,7 +172,7 @@ QString FileElementCollectionItem::collectionPath() const
return "custom://";
}
else if (parent() && parent()->type() == FileElementCollectionItem::Type) {
auto *eci = static_cast<ElementCollectionItem*>(parent());
ElementCollectionItem *eci = static_cast<ElementCollectionItem*>(parent());
if (eci->isCollectionRoot())
return eci->collectionPath() + m_path;
else
@@ -222,7 +222,7 @@ void FileElementCollectionItem::addChildAtPath(const QString &collection_name)
if (collection_name.isEmpty())
return;
auto *feci = new FileElementCollectionItem();
FileElementCollectionItem *feci = new FileElementCollectionItem();
insertRow(rowForInsertItem(collection_name), feci);
feci->setPathName(collection_name);
feci->setUpData();
@@ -299,7 +299,7 @@ void FileElementCollectionItem::populate(bool set_data, bool hide_element)
//Get all directory in this directory.
foreach(QString str, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name))
{
auto *feci = new FileElementCollectionItem();
FileElementCollectionItem *feci = new FileElementCollectionItem();
appendRow(feci);
feci->setPathName(str, set_data, hide_element);
if (set_data)
@@ -313,7 +313,7 @@ void FileElementCollectionItem::populate(bool set_data, bool hide_element)
dir.setNameFilters(QStringList() << "*.elmt");
foreach(QString str, dir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name))
{
auto *feci = new FileElementCollectionItem();
FileElementCollectionItem *feci = new FileElementCollectionItem();
appendRow(feci);
feci->setPathName(str, set_data);
if (set_data)

View File

@@ -102,7 +102,7 @@ QString XmlProjectElementCollectionItem::embeddedPath() const
if (isCollectionRoot())
return "embed://";
else if (parent()){
auto *xpeci = static_cast<XmlProjectElementCollectionItem *>(parent());
XmlProjectElementCollectionItem *xpeci = static_cast<XmlProjectElementCollectionItem *>(parent());
if (xpeci->isCollectionRoot())
return xpeci->embeddedPath() + name();
@@ -143,7 +143,7 @@ void XmlProjectElementCollectionItem::addChildAtPath(const QString &collection_n
while (!child_element.isNull()) {
if (child_element.attribute("name") == collection_name) {
auto *xpeci = new XmlProjectElementCollectionItem ();
XmlProjectElementCollectionItem *xpeci = new XmlProjectElementCollectionItem ();
insertRow(rowForInsertItem(collection_name), xpeci);
xpeci->setXmlElement(child_element, m_project);
xpeci->setUpData();
@@ -229,7 +229,7 @@ void XmlProjectElementCollectionItem::populate(bool set_data, bool hide_element)
foreach (QDomElement element, dom_category)
{
auto *xpeci = new XmlProjectElementCollectionItem();
XmlProjectElementCollectionItem *xpeci = new XmlProjectElementCollectionItem();
appendRow(xpeci);
xpeci->setXmlElement(element, m_project, set_data, hide_element);
if (set_data)
@@ -244,7 +244,7 @@ void XmlProjectElementCollectionItem::populate(bool set_data, bool hide_element)
foreach (QDomElement element, dom_elements)
{
auto *xpeci = new XmlProjectElementCollectionItem();
XmlProjectElementCollectionItem *xpeci = new XmlProjectElementCollectionItem();
appendRow(xpeci);
xpeci->setXmlElement(element, m_project, set_data);
if (set_data)

View File

@@ -100,7 +100,7 @@ void QPropertyUndoCommand::setAnimated(bool animate, bool first_time)
bool QPropertyUndoCommand::mergeWith(const QUndoCommand *other)
{
if (id() != other->id() || other->childCount()) return false;
auto const *undo = static_cast<const QPropertyUndoCommand *>(other);
QPropertyUndoCommand 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;

View File

@@ -82,7 +82,7 @@ QVector<QetGraphicsHandlerItem *> QetGraphicsHandlerItem::handlerForPoint(const
QVector <QetGraphicsHandlerItem *> list_;
for (QPointF point : points)
{
auto *qghi = new QetGraphicsHandlerItem(size);
QetGraphicsHandlerItem *qghi = new QetGraphicsHandlerItem(size);
qghi->setPos(point);
list_ << qghi;
}

View File

@@ -40,7 +40,7 @@ AboutQET::AboutQET(QWidget *parent) :
setModal(true);
auto *tabs = new QTabWidget();
QTabWidget *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 @@ AboutQET::AboutQET(QWidget *parent) :
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), this, SLOT(accept()));
auto *vlayout = new QVBoxLayout(this);
QVBoxLayout *vlayout = new QVBoxLayout(this);
vlayout->addWidget(tabs);
vlayout->addWidget(buttons);
auto* scrollArea = new QScrollArea(this);
QScrollArea* scrollArea = new QScrollArea(this);
scrollArea->setWidgetResizable(true);
scrollArea->setFixedSize (590, 590);
scrollArea->setWidget(tabs);
@@ -135,7 +135,7 @@ QWidget *AboutQET::authorsTab() const {
authors -> setTextFormat(Qt::RichText);
QWidget *authors_widget = new QWidget();
auto *authors_layout = new QHBoxLayout(authors_widget);
QHBoxLayout *authors_layout = new QHBoxLayout(authors_widget);
authors_layout -> addWidget(authors, 0, Qt::AlignCenter);
return(authors_widget);
}
@@ -175,7 +175,7 @@ QWidget *AboutQET::translatorsTab() const {
translators -> setTextFormat(Qt::RichText);
QWidget *translators_widget = new QWidget();
auto *translators_layout = new QHBoxLayout(translators_widget);
QHBoxLayout *translators_layout = new QHBoxLayout(translators_widget);
translators_layout -> addWidget(translators, 0, Qt::AlignCenter);
return(translators_widget);
}
@@ -207,7 +207,7 @@ QWidget *AboutQET::contributorsTab() const {
contributors -> setTextFormat(Qt::RichText);
QWidget *contributors_widget = new QWidget();
auto *contributors_layout = new QHBoxLayout(contributors_widget);
QHBoxLayout *contributors_layout = new QHBoxLayout(contributors_widget);
contributors_layout -> addWidget(contributors, 0, Qt::AlignCenter);
return(contributors_widget);
}
@@ -221,12 +221,12 @@ QWidget *AboutQET::licenseTab() const {
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
auto *text_license = new QTextEdit();
QTextEdit *text_license = new QTextEdit();
text_license -> setPlainText(QET::license());
text_license -> setReadOnly(true);
// All in a vertical arrangement
auto *license_layout = new QVBoxLayout();
QVBoxLayout *license_layout = new QVBoxLayout();
license_layout -> addWidget(title_license);
license_layout -> addWidget(text_license);
license -> setLayout(license_layout);

View File

@@ -94,7 +94,7 @@ void SelectAutonumW::setContext(const NumerotationContext &context) {
}
else {
for (int i=0; i<m_context.size(); ++i) { //build with the content of @context
auto *part= new NumPartEditorW(m_context, i, m_edited_type, this);
NumPartEditorW *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 @@ NumerotationContext SelectAutonumW::toNumContext() const {
void SelectAutonumW::on_add_button_clicked()
{
applyEnable(false);
auto *part = new NumPartEditorW(m_edited_type, this);
NumPartEditorW *part = new NumPartEditorW(m_edited_type, this);
connect (part, SIGNAL(changed()), this, SLOT(applyEnable()));
num_part_list_ << part;
ui -> editor_layout -> addWidget(part);

View File

@@ -673,8 +673,8 @@ DiagramPosition BorderTitleBlock::convertPosition(const QPointF &pos)
return (DiagramPosition("", 0));
QPointF relative_pos = pos - insideBorderRect().topLeft();
auto row_number = int(ceil(relative_pos.x() / columnsWidth()));
auto column_number = int(ceil(relative_pos.y() / rowsHeight()));
int row_number = int(ceil(relative_pos.x() / columnsWidth()));
int column_number = int(ceil(relative_pos.y() / rowsHeight()));
QString letter = "A";
for (int i = 1 ; i < column_number ; ++ i)

View File

@@ -41,11 +41,11 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
// layouts
auto *hlayout1 = new QHBoxLayout();
QHBoxLayout *hlayout1 = new QHBoxLayout();
hlayout1 -> addWidget(pages_list);
hlayout1 -> addWidget(pages_widget);
auto *vlayout1 = new QVBoxLayout();
QVBoxLayout *vlayout1 = new QVBoxLayout();
vlayout1 -> addLayout(hlayout1);
vlayout1 -> addWidget(buttons);
setLayout(vlayout1);
@@ -80,7 +80,7 @@ void ConfigDialog::buildPagesList() {
Add the \a page ConfigPage to this configuration dialog.
*/
void ConfigDialog::addPageToList(ConfigPage *page) {
auto *new_button = new QListWidgetItem(pages_list);
QListWidgetItem *new_button = new QListWidgetItem(pages_list);
new_button -> setIcon(page -> icon());
new_button -> setText(page -> title());
new_button -> setTextAlignment(Qt::AlignHCenter);

View File

@@ -73,9 +73,9 @@ NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent, ProjectProp
connect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab()));
// main tab widget
auto *tab_widget = new QTabWidget(this);
QTabWidget *tab_widget = new QTabWidget(this);
QWidget *diagram_widget = new QWidget();
auto *diagram_layout = new QVBoxLayout(diagram_widget);
QVBoxLayout *diagram_layout = new QVBoxLayout(diagram_widget);
diagram_layout -> addWidget(bpw);
diagram_layout -> addWidget(ipw);
@@ -85,7 +85,7 @@ NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent, ProjectProp
tab_widget -> addTab (rpw, tr("Reports de folio"));
tab_widget -> addTab (xrefpw, tr("Références croisées"));
auto *vlayout1 = new QVBoxLayout();
QVBoxLayout *vlayout1 = new QVBoxLayout();
vlayout1->addWidget(tab_widget);
setLayout(vlayout1);
@@ -235,7 +235,7 @@ ExportConfigPage::ExportConfigPage(QWidget *parent) : ConfigPage(parent) {
epw = new ExportPropertiesWidget(ExportProperties::defaultExportProperties());
// layout vertical contenant le titre, une ligne horizontale et epw
auto *vlayout1 = new QVBoxLayout();
QVBoxLayout *vlayout1 = new QVBoxLayout();
QLabel *title = new QLabel(this -> title());
vlayout1 -> addWidget(title);
@@ -283,7 +283,7 @@ PrintConfigPage::PrintConfigPage(QWidget *parent) : ConfigPage(parent) {
epw -> setPrintingMode(true);
// layout vertical contenant le titre, une ligne horizontale et epw
auto *vlayout1 = new QVBoxLayout();
QVBoxLayout *vlayout1 = new QVBoxLayout();
QLabel *title = new QLabel(this -> title());
vlayout1 -> addWidget(title);

View File

@@ -36,13 +36,13 @@ Createdxf::Createdxf()
Createdxf::~Createdxf()
{
}
/* Header section of every DXF file.*/
void Createdxf::dxfBegin (const QString& fileName)
{
// Creation of an output stream object in text mode.
}
/* Header section of every DXF file.*/
void Createdxf::dxfBegin (const QString& fileName)
{
// Creation of an output stream object in text mode.
// Header section of every dxf file.
if (!fileName.isEmpty()) {
QFile file(fileName);
@@ -226,13 +226,13 @@ void Createdxf::dxfBegin (const QString& fileName)
file.close();
}
}
}
/* End Section of every DXF File*/
void Createdxf::dxfEnd (const QString& fileName)
{
// Creation of an output stream object in text mode.
if (!fileName.isEmpty()) {
}
/* End Section of every DXF File*/
void Createdxf::dxfEnd (const QString& fileName)
{
// Creation of an output stream object in text mode.
if (!fileName.isEmpty()) {
QFile file(fileName);
if (!file.open(QFile::Append)) {
// error message
@@ -250,13 +250,13 @@ void Createdxf::dxfEnd (const QString& fileName)
}
}
}
/* draw circle in dxf format*/
void Createdxf::drawCircle (const QString& fileName, double radius, double x, double y, int colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
/* draw circle in dxf format*/
void Createdxf::drawCircle (const QString& fileName, double radius, double x, double y, int colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
if (!file.open(QFile::Append)) {
// error message
QMessageBox errorFileOpen;
@@ -665,13 +665,13 @@ void Createdxf::drawRectangle(const QString &filepath, const QRectF &rect, const
rect.width() * xScale,
rect.height() * yScale,
colorcode);
}
/* draw arc in dx format */
void Createdxf::drawArc(const QString& fileName,double x,double y,double rad,double startAngle,double endAngle,int color)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
}
/* draw arc in dx format */
void Createdxf::drawArc(const QString& fileName,double x,double y,double rad,double startAngle,double endAngle,int color)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
if (!file.open(QFile::Append)) {
// error message
QMessageBox errorFileOpen;
@@ -702,13 +702,13 @@ void Createdxf::drawArc(const QString& fileName,double x,double y,double rad,dou
file.close();
}
}
}
/* draw simple text in dxf format without any alignment specified */
void Createdxf::drawText(const QString& fileName, const QString& text,double x, double y, double height, double rotation, int colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
}
/* draw simple text in dxf format without any alignment specified */
void Createdxf::drawText(const QString& fileName, const QString& text,double x, double y, double height, double rotation, int colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
if (!file.open(QFile::Append)) {
// error message
QMessageBox errorFileOpen;
@@ -741,13 +741,13 @@ void Createdxf::drawText(const QString& fileName, const QString& text,double x,
}
}
/* draw aligned text in DXF Format */
// leftAlign flag added. If the alignment requested is 'fit to width' and the text length is very small,
// then the text is either centered or left-aligned, depnding on the value of leftAlign.
void Createdxf::drawTextAligned(const QString& fileName, const QString& text,double x, double y, double height, double rotation, double oblique,int hAlign, int vAlign, double xAlign,int colour,
bool leftAlign, float scale)
{
Q_UNUSED(scale);
/* draw aligned text in DXF Format */
// leftAlign flag added. If the alignment requested is 'fit to width' and the text length is very small,
// then the text is either centered or left-aligned, depnding on the value of leftAlign.
void Createdxf::drawTextAligned(const QString& fileName, const QString& text,double x, double y, double height, double rotation, double oblique,int hAlign, int vAlign, double xAlign,int colour,
bool leftAlign, float scale)
{
Q_UNUSED(scale);
if (!fileName.isEmpty()) {
QFile file(fileName);

View File

@@ -25,31 +25,31 @@
/* This class exports the project to DXF Format */
class Createdxf
{
public:
Createdxf();
~Createdxf();
static void dxfBegin (const QString&);
static void dxfEnd(const QString&);
// you can add more functions to create more drawings.
static void drawCircle(const QString&,double,double,double,int);
static void drawArc(const QString&,double x,double y,double rad,double startAngle,double endAngle,int color);
static void drawDonut(QString,double,double,double,int);
static void drawArcEllipse (const QString &file_path, qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal spanAngle, qreal hotspot_x, qreal hotspot_y, qreal rotation_angle, const int &colorcode);
public:
Createdxf();
~Createdxf();
static void dxfBegin (const QString&);
static void dxfEnd(const QString&);
// you can add more functions to create more drawings.
static void drawCircle(const QString&,double,double,double,int);
static void drawArc(const QString&,double x,double y,double rad,double startAngle,double endAngle,int color);
static void drawDonut(QString,double,double,double,int);
static void drawArcEllipse (const QString &file_path, qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal spanAngle, qreal hotspot_x, qreal hotspot_y, qreal rotation_angle, const int &colorcode);
static void drawEllipse (const QString &filepath, const QRectF &rect, const int &colorcode);
static void drawRectangle(const QString &filepath,double,double,double,double,const int &colorcode);
static void drawRectangle(const QString &filepath, const QRectF &rect, const int &colorcode);
static void drawLine(const QString &filapath,double,double,double,double, const int &clorcode);
static void drawLine(const QString &filepath, const QLineF &line,const int &colorcode);
static void drawText(const QString&,const QString&,double,double,double,double,int);
static void drawTextAligned(const QString& fileName, const QString& text,double x, double y, double height, double rotation, double oblique,int hAlign, int vAlign, double xAlign, int colour, bool leftAlign = false, float scale = 0);
static int getcolorCode (const long red, const long green, const long blue);
static void drawLine(const QString &filapath,double,double,double,double, const int &clorcode);
static void drawLine(const QString &filepath, const QLineF &line,const int &colorcode);
static void drawText(const QString&,const QString&,double,double,double,double,int);
static void drawTextAligned(const QString& fileName, const QString& text,double x, double y, double height, double rotation, double oblique,int hAlign, int vAlign, double xAlign, int colour, bool leftAlign = false, float scale = 0);
static int getcolorCode (const long red, const long green, const long blue);
static long RGBcodeTable[];
static const double sheetWidth;

View File

@@ -159,9 +159,9 @@ void Diagram::drawBackground(QPainter *p, const QRectF &r) {
qreal limite_x = rect.x() + rect.width();
qreal limite_y = rect.y() + rect.height();
auto g_x = (int)ceil(rect.x());
int g_x = (int)ceil(rect.x());
while (g_x % xGrid) ++ g_x;
auto g_y = (int)ceil(rect.y());
int g_y = (int)ceil(rect.y());
while (g_y % yGrid) ++ g_y;
QPolygon points;
@@ -649,23 +649,23 @@ QDomDocument Diagram::toXml(bool whole_content) {
;
// Determine les elements a "XMLiser"
foreach(QGraphicsItem *qgi, list_items) {
if (auto *elmt = qgraphicsitem_cast<Element *>(qgi)) {
if (Element *elmt = qgraphicsitem_cast<Element *>(qgi)) {
if (whole_content) list_elements << elmt;
else if (elmt -> isSelected()) list_elements << elmt;
} else if (auto *f = qgraphicsitem_cast<Conductor *>(qgi)) {
} else if (Conductor *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
else if (f -> terminal1 -> parentItem() -> isSelected() && f -> terminal2 -> parentItem() -> isSelected()) {
list_conductors << f;
}
} else if (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
} else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
if (whole_content) list_texts << iti;
else if (iti -> isSelected()) list_texts << iti;
} else if (auto *dii = qgraphicsitem_cast<DiagramImageItem *>(qgi)) {
} else if (DiagramImageItem *dii = qgraphicsitem_cast<DiagramImageItem *>(qgi)) {
if (whole_content) list_images << dii;
else if (dii -> isSelected()) list_images << dii;
} else if (auto *dsi = qgraphicsitem_cast<QetShapeItem *>(qgi)) {
} else if (QetShapeItem *dsi = qgraphicsitem_cast<QetShapeItem *>(qgi)) {
if (whole_content) list_shapes << dsi;
else if (dsi -> isSelected()) list_shapes << dsi;
}
@@ -920,7 +920,7 @@ bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_inf
// Load text
QList<IndependentTextItem *> added_texts;
foreach (QDomElement text_xml, QET::findInDomElement(root, "inputs", "input")) {
auto *iti = new IndependentTextItem();
IndependentTextItem *iti = new IndependentTextItem();
iti -> fromXml(text_xml);
addItem(iti);
added_texts << iti;
@@ -929,7 +929,7 @@ bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_inf
// Load image
QList<DiagramImageItem *> added_images;
foreach (QDomElement image_xml, QET::findInDomElement(root, "images", "image")) {
auto *dii = new DiagramImageItem ();
DiagramImageItem *dii = new DiagramImageItem ();
dii -> fromXml(image_xml);
addItem(dii);
added_images << dii;
@@ -959,7 +959,7 @@ bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_inf
Terminal *p2 = table_adr_id.value(id_p2);
if (p1 != p2)
{
auto *c = new Conductor(p1, p2);
Conductor *c = new Conductor(p1, p2);
if (c->isValid())
{
addItem(c);
@@ -1069,7 +1069,7 @@ void Diagram::addItem(QGraphicsItem *item)
{
case Conductor::Type:
{
auto *conductor = static_cast<Conductor *>(item);
Conductor *conductor = static_cast<Conductor *>(item);
conductor->terminal1->addConductor(conductor);
conductor->terminal2->addConductor(conductor);
conductor->calculateTextItemPosition();
@@ -1078,7 +1078,7 @@ void Diagram::addItem(QGraphicsItem *item)
case IndependentTextItem::Type:
{
const auto *text = static_cast<const IndependentTextItem *>(item);
const IndependentTextItem *text = static_cast<const IndependentTextItem *>(item);
connect(text, &IndependentTextItem::diagramTextChanged, this, &Diagram::diagramTextChanged);
}
}
@@ -1098,13 +1098,13 @@ void Diagram::removeItem(QGraphicsItem *item)
{
case Element::Type:
{
auto *elmt = static_cast<Element*>(item);
Element *elmt = static_cast<Element*>(item);
elmt->unlinkAllElements();
}
break;
case Conductor::Type:
{
auto *conductor = static_cast<Conductor *>(item);
Conductor *conductor = static_cast<Conductor *>(item);
conductor->terminal1->removeConductor(conductor);
conductor->terminal2->removeConductor(conductor);
}
@@ -1112,7 +1112,7 @@ void Diagram::removeItem(QGraphicsItem *item)
case IndependentTextItem::Type:
{
const auto *text = static_cast<const IndependentTextItem *>(item);
const IndependentTextItem *text = static_cast<const IndependentTextItem *>(item);
disconnect(text, &IndependentTextItem::diagramTextChanged, this, &Diagram::diagramTextChanged);
}
}
@@ -1456,7 +1456,7 @@ QString Diagram::title() const {
QList<CustomElement *> Diagram::customElements() const {
QList<CustomElement *> elements_list;
foreach(QGraphicsItem *qgi, items()) {
if (auto *elmt = qgraphicsitem_cast<CustomElement *>(qgi)) {
if (CustomElement *elmt = qgraphicsitem_cast<CustomElement *>(qgi)) {
elements_list << elmt;
}
}
@@ -1466,7 +1466,7 @@ QList<CustomElement *> Diagram::customElements() const {
QList <Element *> Diagram::elements() const {
QList<Element *> element_list;
foreach (QGraphicsItem *qgi, items()) {
if (auto *elmt = qgraphicsitem_cast<Element *>(qgi))
if (Element *elmt = qgraphicsitem_cast<Element *>(qgi))
element_list <<elmt;
}
return (element_list);
@@ -1479,7 +1479,7 @@ QList <Element *> Diagram::elements() const {
QList <Conductor *> Diagram::conductors() const {
QList<Conductor *> cnd_list;
foreach (QGraphicsItem *qgi, items()) {
if (auto *cnd = qgraphicsitem_cast<Conductor *>(qgi))
if (Conductor *cnd = qgraphicsitem_cast<Conductor *>(qgi))
cnd_list <<cnd;
}
return (cnd_list);
@@ -1662,7 +1662,7 @@ QPointF Diagram::snapToGrid(const QPointF &p)
*/
void Diagram::setDrawTerminals(bool dt) {
foreach(QGraphicsItem *qgi, items()) {
if (auto *t = qgraphicsitem_cast<Terminal *>(qgi)) {
if (Terminal *t = qgraphicsitem_cast<Terminal *>(qgi)) {
t -> setVisible(dt);
}
}
@@ -1683,7 +1683,7 @@ void Diagram::setDrawColoredConductors(bool dcc) {
QSet<Conductor *> Diagram::selectedConductors() const {
QSet<Conductor *> conductors_set;
foreach(QGraphicsItem *qgi, selectedItems()) {
if (auto *c = qgraphicsitem_cast<Conductor *>(qgi)) {
if (Conductor *c = qgraphicsitem_cast<Conductor *>(qgi)) {
conductors_set << c;
}
}
@@ -1761,11 +1761,11 @@ bool Diagram::isReadOnly() const
DiagramContent Diagram::content() const {
DiagramContent dc;
foreach(QGraphicsItem *qgi, items()) {
if (auto *e = qgraphicsitem_cast<Element *>(qgi)) {
if (Element *e = qgraphicsitem_cast<Element *>(qgi)) {
dc.m_elements << e;
} else if (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
} else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
dc.m_text_fields << iti;
} else if (auto *c = qgraphicsitem_cast<Conductor *>(qgi)) {
} else if (Conductor *c = qgraphicsitem_cast<Conductor *>(qgi)) {
dc.m_conductors_to_move << c;
}
}

View File

@@ -260,7 +260,7 @@ void MoveElementsCommand::move(const QPointF &actual_movement)
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(auto *etig = dynamic_cast<ElementTextItemGroup *>(qgi))
if(ElementTextItemGroup *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::move(const QPointF &actual_movement)
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();
auto *animation = new QPropertyAnimation(target, propertyName);
QPropertyAnimation *animation = new QPropertyAnimation(target, propertyName);
animation->setDuration(300);
animation->setStartValue(start);
animation->setEndValue(end);

View File

@@ -44,11 +44,11 @@ DiagramContent::DiagramContent(Diagram *diagram) :
//Get the selected items
for (QGraphicsItem *item : m_selected_items)
{
if (auto *elmt = qgraphicsitem_cast<Element *>(item))
if (Element *elmt = qgraphicsitem_cast<Element *>(item))
m_elements << elmt;
else if (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
m_text_fields << iti;
else if (auto *c = qgraphicsitem_cast<Conductor *>(item))
else if (Conductor *c = qgraphicsitem_cast<Conductor *>(item))
{
//Get the isolated selected conductor (= not movable, but deletable)
if (!c->terminal1->parentItem()->isSelected() &&\
@@ -56,14 +56,14 @@ DiagramContent::DiagramContent(Diagram *diagram) :
m_other_conductors << c;
}
}
else if (auto *dii = qgraphicsitem_cast<DiagramImageItem *>(item))
else if (DiagramImageItem *dii = qgraphicsitem_cast<DiagramImageItem *>(item))
m_images << dii;
else if (auto *dsi = qgraphicsitem_cast<QetShapeItem *>(item))
else if (QetShapeItem *dsi = qgraphicsitem_cast<QetShapeItem *>(item))
m_shapes << dsi;
else if (auto *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item))
else if (DynamicElementTextItem *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item))
m_element_texts << deti;
else if (auto *group = qgraphicsitem_cast<QGraphicsItemGroup *>(item))
if(auto *etig = dynamic_cast<ElementTextItemGroup *>(group))
else if (QGraphicsItemGroup *group = qgraphicsitem_cast<QGraphicsItemGroup *>(item))
if(ElementTextItemGroup *etig = dynamic_cast<ElementTextItemGroup *>(group))
m_texts_groups << etig;
}
@@ -147,7 +147,7 @@ QList<ElementTextItemGroup *> DiagramContent::selectedTextsGroup() const
for(QGraphicsItem *qgi : m_selected_items)
if(qgi->type() == QGraphicsItemGroup::Type)
if(auto *grp = dynamic_cast<ElementTextItemGroup *>(qgi))
if(ElementTextItemGroup *grp = dynamic_cast<ElementTextItemGroup *>(qgi))
groups << grp;
return groups;

View File

@@ -183,7 +183,7 @@ void DiagramContextWidget::initWidgets() {
Initialize the layout of this widget.
*/
void DiagramContextWidget::initLayout() {
auto *vlayout0 = new QVBoxLayout();
QVBoxLayout *vlayout0 = new QVBoxLayout();
vlayout0 -> setContentsMargins(0, 0, 0, 0);
vlayout0 -> addWidget(format_label);
vlayout0 -> addWidget(table_);

View File

@@ -230,7 +230,7 @@ void DiagramEventAddElement::addElement()
{
QPair <Terminal *, Terminal *> pair = element -> AlignedFreeTerminals().takeFirst();
auto *conductor = new Conductor(pair.first, pair.second);
Conductor *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

View File

@@ -45,7 +45,7 @@ bool DiagramEventAddText::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
auto *text = new IndependentTextItem();
IndependentTextItem *text = new IndependentTextItem();
m_diagram -> undoStack().push(new AddItemCommand<IndependentTextItem *>(text, m_diagram, event->scenePos()));
text->setTextInteractionFlags(Qt::TextEditorInteraction);
text->setFocus(Qt::MouseFocusReason);

View File

@@ -236,16 +236,16 @@ void DiagramFolioList::buildGrid(QPainter *qp, const QRectF &rect, int rows, int
qreal y0 = tablesSpacing + rect.topLeft().y();
for (int i = 0; i < tables; ++i) {
auto *tableRect = new QRectF(x0, y0, tableWidth, rect.height() - 2*tablesSpacing);
QRectF *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) {
auto *line = new QLineF(x0, y0 + j*rowHeight, x0 + tableWidth,y0 + j*rowHeight);
QLineF *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) {
auto *line = new QLineF(x0 + colWidths[j]*tableWidth, y0, x0 + colWidths[j]*tableWidth,y0 + rows*rowHeight);
QLineF *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;

View File

@@ -187,7 +187,7 @@ int DiagramPrintDialog::horizontalPagesCount(Diagram *diagram, const ExportPrope
QRect printable_area = fullpage ? printer_ -> paperRect() : printer_ -> pageRect();
QRect diagram_rect = diagramRect(diagram, options);
auto h_pages_count = int(ceil(qreal(diagram_rect.width()) / qreal(printable_area.width())));
int h_pages_count = int(ceil(qreal(diagram_rect.width()) / qreal(printable_area.width())));
return(h_pages_count);
}
@@ -203,7 +203,7 @@ int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, const ExportPropert
QRect printable_area = fullpage ? printer_ -> paperRect() : printer_ -> pageRect();
QRect diagram_rect = diagramRect(diagram, options);
auto v_pages_count = int(ceil(qreal(diagram_rect.height()) / qreal(printable_area.height())));
int v_pages_count = int(ceil(qreal(diagram_rect.height()) / qreal(printable_area.height())));
return(v_pages_count);
}

View File

@@ -164,7 +164,7 @@ void DiagramsChooser::updateList() {
QString diagram_title = diagram -> title();
if (diagram_title.isEmpty()) diagram_title = tr("Folio sans titre");
auto *checkbox = new QCheckBox(diagram_title);
QCheckBox *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()));

View File

@@ -227,7 +227,7 @@ void DiagramView::handleTitleBlockDrop(QDropEvent *e) {
QString integrated_template_name = tbt_loc.name();
if (mustIntegrateTitleBlockTemplate(tbt_loc))
{
auto *handler = new IntegrationMoveTitleBlockTemplatesHandler(this);
IntegrationMoveTitleBlockTemplatesHandler *handler = new IntegrationMoveTitleBlockTemplatesHandler(this);
//QString error_message;
integrated_template_name = m_diagram->project()->integrateTitleBlockTemplate(tbt_loc, handler);
@@ -507,7 +507,7 @@ bool DiagramView::gestureEvent(QGestureEvent *event)
{
if (QGesture *gesture = event->gesture(Qt::PinchGesture))
{
auto *pinch = static_cast<QPinchGesture *>(gesture);
QPinchGesture *pinch = static_cast<QPinchGesture *>(gesture);
if (pinch->changeFlags() & QPinchGesture::ScaleFactorChanged)
{
qreal value = gesture->property("scaleFactor").toReal();
@@ -831,7 +831,7 @@ void DiagramView::editConductorColor(Conductor *edited_conductor)
ConductorProperties initial_properties = edited_conductor -> properties();
// prepare a color dialog showing the initial conductor color
auto *color_dialog = new QColorDialog(this);
QColorDialog *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 @@ void DiagramView::editConductorColor(Conductor *edited_conductor)
initial_properties.color = new_color;
new_value.setValue(initial_properties);
auto *undo = new QPropertyUndoCommand(edited_conductor, "properties", old_value, new_value);
QPropertyUndoCommand *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 @@ bool DiagramView::isCtrlShifting(QInputEvent *e) {
// 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 (auto *ke = static_cast<QKeyEvent *>(e)) {
if (QKeyEvent *ke = static_cast<QKeyEvent *>(e)) {
result = (ke -> modifiers() == (Qt::ControlModifier | Qt::ShiftModifier));
}
} else if (e -> type() >= QEvent::MouseButtonPress && e -> type() <= QEvent::MouseMove) {
if (auto *me = static_cast<QMouseEvent *>(e)) {
if (QMouseEvent *me = static_cast<QMouseEvent *>(e)) {
result = (me -> modifiers() == (Qt::ControlModifier | Qt::ShiftModifier));
}
}
@@ -992,11 +992,11 @@ void DiagramView::editSelection() {
//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 (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(item))
iti -> edit();
else if (auto *qgi = dynamic_cast<QetGraphicsItem *> (item))
else if (QetGraphicsItem *qgi = dynamic_cast<QetGraphicsItem *> (item))
qgi -> editProperty();
else if (auto *c = qgraphicsitem_cast<Conductor *>(item))
else if (Conductor *c = qgraphicsitem_cast<Conductor *>(item))
c -> editProperty();
}
@@ -1084,7 +1084,7 @@ void DiagramView::contextMenuEvent(QContextMenuEvent *e)
QList <QAction *> list = contextMenuActions();
if(!list.isEmpty())
{
auto *context_menu = new QMenu(this);
QMenu *context_menu = new QMenu(this);
context_menu->addActions(list);
context_menu->popup(e->globalPos());
e->accept();

View File

@@ -47,9 +47,9 @@ ArcEditor::ArcEditor(QETElementEditor *editor, PartArc *arc, QWidget *parent) :
h->setRange(-5000, 5000);
v->setRange(-5000, 5000);
auto *v_layout = new QVBoxLayout(this);
QVBoxLayout *v_layout = new QVBoxLayout(this);
auto *grid = new QGridLayout();
QGridLayout *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 @@ bool ArcEditor::setPart(CustomElementPart *new_part)
return(true);
}
if (auto *part_arc = dynamic_cast<PartArc *>(new_part))
if (PartArc *part_arc = dynamic_cast<PartArc *>(new_part))
{
if (part == part_arc) return true;
if (part)

View File

@@ -122,7 +122,7 @@ void ElementPrimitiveDecorator::setItems(const QList<QGraphicsItem *> &items)
QList<CustomElementPart *> primitives;
for(QGraphicsItem *item : items)
{
if (auto *part_item = dynamic_cast<CustomElementPart *>(item))
if (CustomElementPart *part_item = dynamic_cast<CustomElementPart *>(item))
{
primitives << part_item;
}
@@ -143,7 +143,7 @@ QList<CustomElementPart *> ElementPrimitiveDecorator::items() const {
QList<QGraphicsItem *> ElementPrimitiveDecorator::graphicsItems() const {
QList<QGraphicsItem *> list;
foreach (CustomElementPart *part_item, decorated_items_) {
if (auto *item = dynamic_cast<QGraphicsItem *>(part_item)) {
if (QGraphicsItem *item = dynamic_cast<QGraphicsItem *>(part_item)) {
list << item;
}
}
@@ -555,7 +555,7 @@ void ElementPrimitiveDecorator::handlerMouseReleaseEvent(QetGraphicsHandlerItem
ElementEditionCommand *command = nullptr;
if (current_operation_square_ > QET::NoOperation)
{
auto *scale_command = new ScalePartsCommand();
ScalePartsCommand *scale_command = new ScalePartsCommand();
scale_command -> setScaledPrimitives(items());
scale_command -> setTransformation(
mapToScene(original_bounding_rect_).boundingRect(),
@@ -717,7 +717,7 @@ bool ElementPrimitiveDecorator::sceneEventFilter(QGraphicsItem *watched, QEvent
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{

View File

@@ -416,7 +416,7 @@ const QDomDocument ElementScene::toXml(bool all_parts)
{
//If the export concerns only the selection, the not selected part is ignored
if (!all_parts && !qgi -> isSelected()) continue;
if (auto *ce = dynamic_cast<CustomElementPart *>(qgi))
if (CustomElementPart *ce = dynamic_cast<CustomElementPart *>(qgi))
{
if (ce -> isUseless()) continue;
description.appendChild(ce -> toXml(xml_document));
@@ -492,7 +492,7 @@ QRectF ElementScene::elementSceneGeometricRect() const{
if (qgi->type() == ElementPrimitiveDecorator::Type) continue;
if (qgi->type() == QGraphicsRectItem::Type) continue;
if (qgi->type() == PartDynamicTextField::Type) continue;
if (auto *cep = dynamic_cast <CustomElementPart*> (qgi)) {
if (CustomElementPart *cep = dynamic_cast <CustomElementPart*> (qgi)) {
esgr |= cep -> sceneGeometricRect();
}
}
@@ -675,7 +675,7 @@ void ElementScene::slot_editAuthorInformations() {
#endif
dialog_author.setMinimumSize(400, 260);
dialog_author.setWindowTitle(tr("Éditer les informations sur l'auteur", "window title"));
auto *dialog_layout = new QVBoxLayout(&dialog_author);
QVBoxLayout *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 @@ void ElementScene::slot_editAuthorInformations() {
dialog_layout -> addWidget(information_label);
// ajoute un QTextEdit au dialogue
auto *text_field = new QTextEdit();
QTextEdit *text_field = new QTextEdit();
text_field -> setAcceptRichText(false);
text_field -> setPlainText(informations());
text_field -> setReadOnly(is_read_only);
@@ -738,7 +738,7 @@ void ElementScene::slot_editNames() {
dialog.setModal(true);
dialog.setMinimumSize(400, 330);
dialog.setWindowTitle(tr("Éditer les noms", "window title"));
auto *dialog_layout = new QVBoxLayout(&dialog);
QVBoxLayout *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 @@ void ElementScene::slot_editNames() {
dialog_layout -> addWidget(information_label);
// ajoute un NamesListWidget au dialogue
auto *names_widget = new NamesListWidget();
NamesListWidget *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 @@ void ElementScene::slot_editNames() {
QList<CustomElementPart *> ElementScene::primitives() const {
QList<CustomElementPart *> primitives_list;
foreach (QGraphicsItem *item, items()) {
if (auto *primitive = dynamic_cast<CustomElementPart *>(item)) {
if (CustomElementPart *primitive = dynamic_cast<CustomElementPart *>(item)) {
primitives_list << primitive;
}
}
@@ -1001,7 +1001,7 @@ ElementContent ElementScene::loadContent(const QDomDocument &xml_document)
else if (qde.tagName() == "input") cep = pdtf = new PartDynamicTextField(m_element_editor);
else continue;
if (auto *qgi = dynamic_cast<QGraphicsItem *>(cep))
if (QGraphicsItem *qgi = dynamic_cast<QGraphicsItem *>(cep))
{
if (!qgi->zValue())
qgi->setZValue(z++);
@@ -1180,7 +1180,7 @@ void ElementScene::stackAction(ElementEditionCommand *command) {
if (!command -> elementView()) {
foreach (QGraphicsView *view, views()) {
if (auto *element_view = dynamic_cast<ElementView *>(view)) {
if (ElementView *element_view = dynamic_cast<ElementView *>(view)) {
command -> setElementView(element_view);
break;
}

View File

@@ -296,7 +296,7 @@ ElementContent ElementView::paste(const QDomDocument &xml_document, const QPoint
// si quelque chose a effectivement ete ajoute au schema, on cree un objet d'annulation
if (content_pasted.count()) {
m_scene -> clearSelection();
auto *undo_object = new PastePartsCommand(this, content_pasted);
PastePartsCommand *undo_object = new PastePartsCommand(this, content_pasted);
m_scene -> undoStack().push(undo_object);
}
return(content_pasted);
@@ -343,7 +343,7 @@ ElementContent ElementView::pasteWithOffset(const QDomDocument &xml_document) {
// si quelque chose a effectivement ete ajoute au schema, on cree un objet d'annulation
if (content_pasted.count()) {
m_scene -> clearSelection();
auto *undo_object = new PastePartsCommand(this, content_pasted);
PastePartsCommand *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::event(QEvent *e) {
*/
bool ElementView::gestureEvent(QGestureEvent *event){
if (QGesture *gesture = event->gesture(Qt::PinchGesture)) {
auto *pinch = static_cast<QPinchGesture *>(gesture);
QPinchGesture *pinch = static_cast<QPinchGesture *>(gesture);
if (pinch->changeFlags() & QPinchGesture::ScaleFactorChanged){
qreal value = gesture->property("scaleFactor").toReal();
if (value > 1){
@@ -515,9 +515,9 @@ void ElementView::drawBackground(QPainter *p, const QRectF &r) {
qreal limite_x = r.x() + r.width();
qreal limite_y = r.y() + r.height();
auto g_x = (int)ceil(r.x());
int g_x = (int)ceil(r.x());
while (g_x % drawn_x_grid) ++ g_x;
auto g_y = (int)ceil(r.y());
int 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) {

View File

@@ -44,9 +44,9 @@ EllipseEditor::EllipseEditor(QETElementEditor *editor, PartEllipse *ellipse, QWi
h->setRange(-5000, 5000);
v->setRange(-5000, 5000);
auto *v_layout = new QVBoxLayout(this);
QVBoxLayout *v_layout = new QVBoxLayout(this);
auto *grid = new QGridLayout();
QGridLayout *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 @@ bool EllipseEditor::setPart(CustomElementPart *new_part)
style_ -> setPart(nullptr);
return(true);
}
if (auto *part_ellipse = dynamic_cast<PartEllipse *>(new_part))
if (PartEllipse *part_ellipse = dynamic_cast<PartEllipse *>(new_part))
{
if (part == part_ellipse) return true;
if (part)

View File

@@ -218,7 +218,7 @@ bool PartArc::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{

View File

@@ -214,7 +214,7 @@ bool PartEllipse::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{

View File

@@ -190,7 +190,7 @@ bool PartLine::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{

View File

@@ -308,7 +308,7 @@ bool PartPolygon::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{

View File

@@ -322,7 +322,7 @@ bool PartRectangle::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{

View File

@@ -62,7 +62,7 @@ LineEditor::LineEditor(QETElementEditor *editor, PartLine *line, QWidget *parent
end1_length = new QDoubleSpinBox();
end2_length = new QDoubleSpinBox();
auto *grid = new QGridLayout();
QGridLayout *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 @@ LineEditor::LineEditor(QETElementEditor *editor, PartLine *line, QWidget *parent
grid -> addWidget(new QLabel("y2"), 1, 2);
grid -> addWidget(y2, 1, 3);
auto *grid2 = new QGridLayout();
QGridLayout *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 @@ LineEditor::LineEditor(QETElementEditor *editor, PartLine *line, QWidget *parent
grid2 -> addWidget(end2_type, 1, 1);
grid2 -> addWidget(end2_length, 1, 2);
auto *v_layout = new QVBoxLayout(this);
QVBoxLayout *v_layout = new QVBoxLayout(this);
v_layout -> addWidget(style_);
v_layout -> addLayout(grid);
v_layout -> addLayout(grid2);
@@ -115,7 +115,7 @@ bool LineEditor::setPart(CustomElementPart *new_part)
style_ -> setPart(nullptr);
return(true);
}
if (auto *part_line = dynamic_cast<PartLine *>(new_part))
if (PartLine *part_line = dynamic_cast<PartLine *>(new_part))
{
if (part == part_line) return true;
if (part)

View File

@@ -45,7 +45,7 @@ PolygonEditor::PolygonEditor(QETElementEditor *editor, PartPolygon *p, QWidget *
updateForm();
// layout
auto *layout = new QVBoxLayout(this);
QVBoxLayout *layout = new QVBoxLayout(this);
layout -> addWidget(style_);
layout -> addWidget(new QLabel(tr("Points du polygone :")));
layout -> addWidget(&points_list);
@@ -106,7 +106,7 @@ void PolygonEditor::updateForm() {
point = part -> mapToScene(point);
QStringList qsl;
qsl << QString("%1").arg(point.x()) << QString("%1").arg(point.y());
auto *qtwi = new QTreeWidgetItem(qsl);
QTreeWidgetItem *qtwi = new QTreeWidgetItem(qsl);
qtwi -> setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable);
points_list.addTopLevelItem(qtwi);
}
@@ -135,7 +135,7 @@ bool PolygonEditor::setPart(CustomElementPart *new_part)
style_ -> setPart(nullptr);
return(true);
}
if (auto *part_polygon = dynamic_cast<PartPolygon *>(new_part))
if (PartPolygon *part_polygon = dynamic_cast<PartPolygon *>(new_part))
{
if (part == part_polygon) return true;
if (part)

View File

@@ -537,7 +537,7 @@ void QETElementEditor::setupInterface()
m_undo_dock -> setFeatures(QDockWidget::AllDockWidgetFeatures);
m_undo_dock -> setMinimumWidth(290);
addDockWidget(Qt::RightDockWidgetArea, m_undo_dock);
auto* undo_view = new QUndoView(&(m_elmt_scene -> undoStack()), this);
QUndoView* 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 @@ void QETElementEditor::slot_updateInformations()
style_editable = true;
foreach (QGraphicsItem *qgi, selected_qgis)
{
if (auto *cep = dynamic_cast<CustomElementPart *>(qgi))
if (CustomElementPart *cep = dynamic_cast<CustomElementPart *>(qgi))
cep_list << cep;
else
style_editable = false;
@@ -609,11 +609,11 @@ void QETElementEditor::slot_updateInformations()
if(selected_qgis.size() == 1)
{
QGraphicsItem *qgi = selected_qgis.first();
if (auto *selection = dynamic_cast<CustomElementPart *>(qgi))
if (CustomElementPart *selection = dynamic_cast<CustomElementPart *>(qgi))
{
if (QWidget *widget = m_tools_dock_stack->widget(1))
{
if (auto *editor = dynamic_cast<ElementItemEditor *>(widget))
if (ElementItemEditor *editor = dynamic_cast<ElementItemEditor *>(widget))
{
if(editor->currentPart() == selection)
return;
@@ -626,11 +626,11 @@ void QETElementEditor::slot_updateInformations()
if (selected_qgis.size() == 1)
{
QGraphicsItem *qgi = selected_qgis.first();
if (auto *selection = dynamic_cast<CustomElementPart *>(qgi))
if (CustomElementPart *selection = dynamic_cast<CustomElementPart *>(qgi))
{
//The current editor already edit the selected part
if (QWidget *widget = m_tools_dock_stack->widget(1))
if (auto *editor = dynamic_cast<ElementItemEditor *>(widget))
if (ElementItemEditor *editor = dynamic_cast<ElementItemEditor *>(widget))
if(editor->currentPart() == selection)
return;
@@ -1065,7 +1065,7 @@ QString program = (QDir::homePath() + "/.qet/DXFtoQET.app");
QString program = (QDir::homePath() + "/.qet/DXFtoQET");
#endif
QStringList arguments;
auto *DXF = new QProcess(qApp);
QProcess *DXF = new QProcess(qApp);
DXF->start(program,arguments);
}
@@ -1336,9 +1336,9 @@ void QETElementEditor::slot_createPartsList() {
if (qgis.count() <= QET_MAX_PARTS_IN_ELEMENT_EDITOR_LIST) {
for (int j = qgis.count() - 1 ; j >= 0 ; -- j) {
QGraphicsItem *qgi = qgis[j];
if (auto *cep = dynamic_cast<CustomElementPart *>(qgi)) {
if (CustomElementPart *cep = dynamic_cast<CustomElementPart *>(qgi)) {
QString part_desc = cep -> name();
auto *qlwi = new QListWidgetItem(part_desc);
QListWidgetItem *qlwi = new QListWidgetItem(part_desc);
QVariant v;
v.setValue<QGraphicsItem *>(qgi);
qlwi -> setData(42, v);
@@ -1382,7 +1382,7 @@ void QETElementEditor::slot_updateSelectionFromPartsList() {
m_parts_list -> blockSignals(true);
for (int i = 0 ; i < m_parts_list -> count() ; ++ i) {
QListWidgetItem *qlwi = m_parts_list -> item(i);
auto *qgi = qlwi -> data(42).value<QGraphicsItem *>();
QGraphicsItem *qgi = qlwi -> data(42).value<QGraphicsItem *>();
if (qgi) {
qgi -> setSelected(qlwi -> isSelected());
}
@@ -1578,7 +1578,7 @@ void QETElementEditor::updateCurrentPartEditor() {
if (!m_tools_dock_stack -> currentIndex()) return;
// s'il y a un widget d'edition affiche, on le met a jour
if (auto *current_editor = dynamic_cast<ElementItemEditor *>(m_tools_dock_stack->widget(1))) {
if (ElementItemEditor *current_editor = dynamic_cast<ElementItemEditor *>(m_tools_dock_stack->widget(1))) {
current_editor -> updateForm();
}
}

View File

@@ -98,7 +98,7 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
main_layout -> addWidget(new QLabel("<u>" + tr("Apparence :") + "</u> "));
auto *color_layout = new QHBoxLayout();
QHBoxLayout *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 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
color_layout -> addWidget(filling_color);
main_layout -> addLayout(color_layout);
auto *style_layout = new QHBoxLayout();
QHBoxLayout *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 @@ bool StyleEditor::setPart(CustomElementPart *new_part) {
return(true);
}
if (auto *part_graphic = dynamic_cast<CustomElementGraphicPart *>(new_part))
if (CustomElementGraphicPart *part_graphic = dynamic_cast<CustomElementGraphicPart *>(new_part))
{
part = part_graphic;
updateForm();
@@ -237,7 +237,7 @@ bool StyleEditor::setParts(QList<CustomElementPart *> part_list)
foreach (CustomElementPart *cep, part_list)
{
if (auto *cegp = dynamic_cast<CustomElementGraphicPart *>(cep))
if (CustomElementGraphicPart *cegp = dynamic_cast<CustomElementGraphicPart *>(cep))
m_part_list << cegp;
else
return false;

View File

@@ -48,17 +48,17 @@ TerminalEditor::TerminalEditor(QETElementEditor *editor, PartTerminal *term, QWi
orientation -> addItem(QET::Icons::South, tr("Sud"), Qet::South);
orientation -> addItem(QET::Icons::West, tr("Ouest"), Qet::West);
auto *main_layout = new QVBoxLayout();
QVBoxLayout *main_layout = new QVBoxLayout();
main_layout -> addWidget(new QLabel(tr("Position : ")));
auto *position = new QHBoxLayout();
QHBoxLayout *position = new QHBoxLayout();
position -> addWidget(new QLabel(tr("x : ")));
position -> addWidget(qle_x );
position -> addWidget(new QLabel(tr("y : ")));
position -> addWidget(qle_y );
main_layout -> addLayout(position);
auto *ori = new QHBoxLayout();
QHBoxLayout *ori = new QHBoxLayout();
ori -> addWidget(new QLabel(tr("Orientation : ")));
ori -> addWidget(orientation );
main_layout -> addLayout(ori);
@@ -91,7 +91,7 @@ bool TerminalEditor::setPart(CustomElementPart *new_part)
part = nullptr;
return(true);
}
if (auto *part_terminal = dynamic_cast<PartTerminal *>(new_part))
if (PartTerminal *part_terminal = dynamic_cast<PartTerminal *>(new_part))
{
if(part == part_terminal) return true;
if (part)

View File

@@ -51,33 +51,33 @@ TextEditor::TextEditor(QETElementEditor *editor, PartText *text, QWidget *parent
qle_x -> setRange(-5000, 5000);
qle_y -> setRange(-5000, 5000);
auto *main_layout = new QVBoxLayout();
QVBoxLayout *main_layout = new QVBoxLayout();
main_layout -> addWidget(new QLabel(tr("Position : ")));
auto *position = new QHBoxLayout();
QHBoxLayout *position = new QHBoxLayout();
position -> addWidget(new QLabel(tr("x : ")));
position -> addWidget(qle_x );
position -> addWidget(new QLabel(tr("y : ")));
position -> addWidget(qle_y );
main_layout -> addLayout(position);
auto *fs = new QHBoxLayout();
QHBoxLayout *fs = new QHBoxLayout();
fs -> addWidget(new QLabel(tr("Taille : ")));
fs -> addWidget(font_size);
main_layout -> addLayout(fs);
auto *color_layout = new QHBoxLayout();
QHBoxLayout *color_layout = new QHBoxLayout();
color_layout -> addWidget(new QLabel(tr("Couleur : ")));
color_layout -> addWidget(black_color_);
color_layout -> addWidget(white_color_);
color_layout -> addStretch();
main_layout -> addLayout(color_layout);
auto *t = new QHBoxLayout();
QHBoxLayout *t = new QHBoxLayout();
t -> addWidget(new QLabel(tr("Texte : ")));
t -> addWidget(qle_text);
auto *rotation_angle_layout = new QHBoxLayout();
QHBoxLayout *rotation_angle_layout = new QHBoxLayout();
rotation_angle_layout -> addWidget(rotation_angle_label);
rotation_angle_layout -> addWidget(rotation_angle_);
@@ -110,7 +110,7 @@ bool TextEditor::setPart(CustomElementPart *new_part)
part = nullptr;
return(true);
}
if (auto *part_text = dynamic_cast<PartText *>(new_part))
if (PartText *part_text = dynamic_cast<PartText *>(new_part))
{
if (part == part_text) return true;
part = part_text;

View File

@@ -228,7 +228,7 @@ void DynamicTextFieldEditor::on_m_frame_cb_clicked()
void DynamicTextFieldEditor::on_m_width_sb_editingFinished()
{
auto width = (qreal)ui->m_width_sb->value();
qreal width = (qreal)ui->m_width_sb->value();
if(width != m_text_field.data()->textWidth())
{

View File

@@ -156,7 +156,7 @@ void ElementPropertiesEditorWidget::populateTree()
for(const QString& key : keys)
{
auto *qtwi = new QTreeWidgetItem(ui->m_tree);
QTreeWidgetItem *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);

View File

@@ -68,7 +68,7 @@ bool RectangleEditor::setPart(CustomElementPart *part)
return(true);
}
if (auto *part_rectangle = dynamic_cast<PartRectangle *>(part))
if (PartRectangle *part_rectangle = dynamic_cast<PartRectangle *>(part))
{
if (m_part == part_rectangle) {
return true;
@@ -147,7 +147,7 @@ void RectangleEditor::editingFinished()
}
m_locked = true;
auto *undo = new QUndoCommand();
QUndoCommand *undo = new QUndoCommand();
undo->setText(tr("Modifier un rectangle"));
QRectF rect(editedTopLeft(), QSizeF(ui->m_width_sb->value(), ui->m_height_sb->value()));

View File

@@ -53,7 +53,7 @@ void ElementDialog::setUpWidget()
setWindowFlags(Qt::Sheet);
#endif
auto *layout = new QVBoxLayout(this);
QVBoxLayout *layout = new QVBoxLayout(this);
QString title_, label_;
switch (m_mode)
@@ -142,7 +142,7 @@ void ElementDialog::setUpConnection()
*/
void ElementDialog::indexClicked(const QModelIndex &index)
{
auto *eci = static_cast<ElementCollectionItem*> (m_model->itemFromIndex(index));
ElementCollectionItem *eci = static_cast<ElementCollectionItem*> (m_model->itemFromIndex(index));
m_location = ElementsLocation(eci->collectionPath());
checkCurrentLocation();
}
@@ -300,7 +300,7 @@ ElementsLocation ElementDialog::getSaveElementLocation(QWidget *parentWidget) {
*/
ElementsLocation ElementDialog::execConfiguredDialog(int mode, QWidget *parentWidget)
{
auto *element_dialog = new ElementDialog(mode, parentWidget);
ElementDialog *element_dialog = new ElementDialog(mode, parentWidget);
element_dialog->exec();
ElementsLocation location = element_dialog->location();
delete element_dialog;

View File

@@ -99,7 +99,7 @@ ElementsLocation ElementsCategoryEditor::createdLocation() const
*/
void ElementsCategoryEditor::setUpWidget()
{
auto *editor_layout = new QVBoxLayout();
QVBoxLayout *editor_layout = new QVBoxLayout();
setLayout(editor_layout);
m_names_list = new NamesListWidget();
@@ -109,7 +109,7 @@ void ElementsCategoryEditor::setUpWidget()
m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(m_buttons, SIGNAL(rejected()), this, SLOT(reject()));
auto *internal_name_layout = new QHBoxLayout();
QHBoxLayout *internal_name_layout = new QHBoxLayout();
internal_name_layout -> addWidget(m_file_name);
internal_name_layout -> addWidget(m_file_line_edit);

View File

@@ -128,7 +128,7 @@ void ElementsMover::endMovement()
if (!movement_running_) return;
//empty command to be used has parent of commands below
auto *undo_object = new QUndoCommand();
QUndoCommand *undo_object = new QUndoCommand();
//Create undo move if there is a movement
if (!current_movement_.isNull()) {
@@ -151,7 +151,7 @@ void ElementsMover::endMovement()
{
QPair <Terminal *, Terminal *> pair = elmt -> AlignedFreeTerminals().takeFirst();
auto *conductor = new Conductor(pair.first, pair.second);
Conductor *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);

View File

@@ -98,11 +98,11 @@ void ElementsPanel::startDrag(Qt::DropActions supportedActions) {
void ElementsPanel::startTitleBlockTemplateDrag(const TitleBlockTemplateLocation &location) {
QString location_string = location.toString();
auto *mime_data = new QMimeData();
QMimeData *mime_data = new QMimeData();
mime_data -> setText(location_string);
mime_data -> setData("application/x-qet-titleblock-uri", location_string.toLatin1());
auto *drag = new QDrag(this);
QDrag *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::reload(bool reload_collections) {
void ElementsPanel::slot_doubleClick(QTreeWidgetItem *qtwi, int) {
int qtwi_type = qtwi -> type();
if (qtwi_type == QET::Project) {
auto *project = valueForItem<QETProject *>(qtwi);
QETProject *project = valueForItem<QETProject *>(qtwi);
emit(requestForProject(project));
} else if (qtwi_type == QET::Diagram) {
auto *diagram = valueForItem<Diagram *>(qtwi);
Diagram *diagram = valueForItem<Diagram *>(qtwi);
emit(requestForDiagram(diagram));
} else if (qtwi_type == QET::TitleBlockTemplate) {
TitleBlockTemplateLocation tbt = valueForItem<TitleBlockTemplateLocation>(qtwi);

View File

@@ -99,7 +99,7 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
);
// disposition verticale
auto *vlayout = new QVBoxLayout(this);
QVBoxLayout *vlayout = new QVBoxLayout(this);
vlayout -> setMargin(0);
vlayout -> setSpacing(0);
vlayout -> addWidget(filter_textfield);

View File

@@ -238,7 +238,7 @@ void ImportElementTextPattern::apply(QString name) const
//Add the texts to element
for(const QDomElement& text : texts)
{
auto *deti = new DynamicElementTextItem(m_element);
DynamicElementTextItem *deti = new DynamicElementTextItem(m_element);
undo_stack.push(new AddElementTextCommand(m_element, deti));
deti->fromXml(text);
}

View File

@@ -119,7 +119,7 @@ void ElementTextsMover::endMovement()
for (QGraphicsItem *qgi : m_items_hash.keys())
{
if(auto *object = dynamic_cast<QObject *>(qgi))
if(QObject *object = dynamic_cast<QObject *>(qgi))
{
QPropertyUndoCommand *child_undo = new QPropertyUndoCommand(object, "pos", m_items_hash.value(qgi), qgi->pos(), undo);
child_undo->enableAnimation();

View File

@@ -71,7 +71,7 @@ ExportDialog::ExportDialog(QETProject *project, QWidget *parent) : QDialog(paren
// disposition des elements
auto *hLayout = new QHBoxLayout();
QHBoxLayout *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 @@ ExportDialog::ExportDialog(QETProject *project, QWidget *parent) : QDialog(paren
connect(deSelectAll, SIGNAL(clicked()), this, SLOT(slot_deSelectAllClicked()));
auto *layout = new QVBoxLayout(this);
QVBoxLayout *layout = new QVBoxLayout(this);
layout -> addLayout(hLayout);
layout -> addWidget(initDiagramsListPart(), 1);
layout -> addWidget(epw);
@@ -177,7 +177,7 @@ QWidget *ExportDialog::initDiagramsListPart() {
QWidget *widget_diagrams_list = new QWidget();
widget_diagrams_list -> setLayout(diagrams_list_layout_);
auto *scroll_diagrams_list = new QScrollArea();
QScrollArea *scroll_diagrams_list = new QScrollArea();
scroll_diagrams_list -> setWidget(widget_diagrams_list);
return(scroll_diagrams_list);
@@ -426,7 +426,7 @@ void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool kee
//QList<QRectF *> list_ellipses;
QList <QetShapeItem *> list_shapes;
auto *ptr = dynamic_cast<DiagramFolioList *>(diagram);
DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diagram);
if (ptr) {
list_lines = ptr -> lines();
list_rectangles = ptr -> rectangles();
@@ -469,15 +469,15 @@ void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool kee
} else {
// Determine les elements a "XMLiser"
foreach(QGraphicsItem *qgi, diagram -> items()) {
if (auto *elmt = qgraphicsitem_cast<Element *>(qgi)) {
if (Element *elmt = qgraphicsitem_cast<Element *>(qgi)) {
list_elements << elmt;
} else if (auto *f = qgraphicsitem_cast<Conductor *>(qgi)) {
} else if (Conductor *f = qgraphicsitem_cast<Conductor *>(qgi)) {
list_conductors << f;
} else if (auto *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
} else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(qgi)) {
list_texts << iti;
} else if (auto *dii = qgraphicsitem_cast<DiagramImageItem *>(qgi)) {
} else if (DiagramImageItem *dii = qgraphicsitem_cast<DiagramImageItem *>(qgi)) {
list_images << dii;
} else if (auto *dii = qgraphicsitem_cast<QetShapeItem *>(qgi)) {
} else if (QetShapeItem *dii = qgraphicsitem_cast<QetShapeItem *>(qgi)) {
list_shapes << dii;
}
}
@@ -909,14 +909,14 @@ void ExportDialog::slot_previewDiagram(int diagram_id) {
preview_dialog.setWindowTitle(tr("Aperçu"));
preview_dialog.setWindowState(preview_dialog.windowState() | Qt::WindowMaximized);
auto *preview_scene = new QGraphicsScene();
QGraphicsScene *preview_scene = new QGraphicsScene();
preview_scene -> setBackgroundBrush(Qt::lightGray);
auto *preview_view = new QGraphicsView(preview_scene);
QGraphicsView *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()));
auto *vboxlayout1 = new QVBoxLayout();
QVBoxLayout *vboxlayout1 = new QVBoxLayout();
vboxlayout1 -> addWidget(preview_view);
vboxlayout1 -> addWidget(buttons);
preview_dialog.setLayout(vboxlayout1);
@@ -1050,7 +1050,7 @@ ExportDialog::ExportDiagramLine::~ExportDiagramLine() {
taille d'un schema avant son export.
*/
QBoxLayout *ExportDialog::ExportDiagramLine::sizeLayout() {
auto *layout = new QHBoxLayout();
QHBoxLayout *layout = new QHBoxLayout();
layout -> addWidget(width);
layout -> addWidget(x_label);
layout -> addWidget(height);

View File

@@ -118,14 +118,14 @@ void ExportPropertiesWidget::slot_chooseADirectory() {
*/
void ExportPropertiesWidget::build() {
// le dialogue est un empilement vertical d'elements
auto *vboxLayout = new QVBoxLayout();
QVBoxLayout *vboxLayout = new QVBoxLayout();
vboxLayout -> setContentsMargins(0, 0, 0, 0);
/* le dialogue comprend une ligne permettant d'indiquer un chemin de dossier (hboxLayout) */
auto *hboxLayout = new QHBoxLayout();
QHBoxLayout *hboxLayout = new QHBoxLayout();
dirpath_label = new QLabel(tr("Dossier cible :"), this);
dirpath = new QLineEdit(this);
auto *completer = new QCompleter(this);
QCompleter *completer = new QCompleter(this);
completer -> setModel(new QDirModel(completer));
dirpath -> setCompleter(completer);
button_browse = new QPushButton(tr("Parcourir"), this);
@@ -137,7 +137,7 @@ void ExportPropertiesWidget::build() {
vboxLayout -> addLayout(hboxLayout);
/* une ligne permettant de choisir le format (hboxLayout1) */
auto *hboxLayout1 = new QHBoxLayout();
QHBoxLayout *hboxLayout1 = new QHBoxLayout();
format_label = new QLabel(tr("Format :"), this);
hboxLayout1 -> addWidget(format_label);
hboxLayout1 -> addWidget(format = new QComboBox(this));
@@ -152,7 +152,7 @@ void ExportPropertiesWidget::build() {
/* un cadre permettant de specifier les options de l'image finale */
QGroupBox *groupbox_options = new QGroupBox(tr("Options de rendu", "groupbox title"));
auto *optionshlayout = new QGridLayout(groupbox_options);
QGridLayout *optionshlayout = new QGridLayout(groupbox_options);
// Choix de la zone du schema a exporter
exported_content_choices = new QButtonGroup(groupbox_options);

View File

@@ -579,7 +579,7 @@ void GenericPanel::projectDiagramsOrderChanged(QETProject *project, int from, in
QTreeWidgetItem *qtwi_diagram = qtwi_project -> child(i);
if (!qtwi_diagram) continue;
auto *diagram = valueForItem<Diagram *>(qtwi_diagram);
Diagram *diagram = valueForItem<Diagram *>(qtwi_diagram);
if (diagram)
updateDiagramItem(qtwi_diagram, diagram);
}
@@ -665,7 +665,7 @@ QIcon GenericPanel::defaultIcon(QET::ItemType type) {
@return the create QTreeWidgetItem
*/
QTreeWidgetItem *GenericPanel::makeItem(QET::ItemType type, QTreeWidgetItem *parent, const QString &label, const QIcon &icon) {
auto *qtwi = new QTreeWidgetItem(parent, type);
QTreeWidgetItem *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 @@ template<typename T>
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)) {
auto child_value = valueForItem<T>(child_item);
T child_value = valueForItem<T>(child_item);
if (!expected_items.contains(child_value)) {
deleteItem(child_item);
}

View File

@@ -24,7 +24,7 @@
@param parent QWidget parent de la liste de noms
*/
NamesListWidget::NamesListWidget(QWidget *parent) : QWidget(parent), read_only(false) {
auto *names_list_layout = new QVBoxLayout();
QVBoxLayout *names_list_layout = new QVBoxLayout();
setLayout(names_list_layout);
tree_names = new QTreeWidget();
@@ -70,7 +70,7 @@ NamesListWidget::~NamesListWidget() {
void NamesListWidget::addLine() {
clean();
if (read_only) return;
auto *qtwi = new QTreeWidgetItem();
QTreeWidgetItem *qtwi = new QTreeWidgetItem();
qtwi -> setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
tree_names -> addTopLevelItem(qtwi);
tree_names -> setCurrentItem(qtwi);
@@ -137,7 +137,7 @@ void NamesListWidget::setNames(const NamesList &provided_names) {
QString value = provided_names[lang];
QStringList values;
values << lang << value;
auto *qtwi = new QTreeWidgetItem(values);
QTreeWidgetItem *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);

View File

@@ -74,11 +74,11 @@ void NewElementWizard::preselectedLocation(const ElementsLocation &location)
*/
QWizardPage *NewElementWizard::buildStep1()
{
auto *page = new QWizardPage();
QWizardPage *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"));
auto *layout = new QVBoxLayout();
QVBoxLayout *layout = new QVBoxLayout();
m_tree_view = new QTreeView(this);
@@ -100,11 +100,11 @@ QWizardPage *NewElementWizard::buildStep1()
* @return
*/
QWizardPage *NewElementWizard::buildStep2() {
auto *page = new QWizardPage();
QWizardPage *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"));
auto *layout = new QVBoxLayout();
QVBoxLayout *layout = new QVBoxLayout();
m_qle_filename = new QFileNameEdit(tr("nouvel_element"));
m_qle_filename -> selectAll();
@@ -124,11 +124,11 @@ QWizardPage *NewElementWizard::buildStep2() {
* @return
*/
QWizardPage *NewElementWizard::buildStep3() {
auto *page = new QWizardPage();
QWizardPage *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"));
auto *layout = new QVBoxLayout();
QVBoxLayout *layout = new QVBoxLayout();
m_names_list = new NamesListWidget();
NamesList hash_name;
@@ -170,7 +170,7 @@ bool NewElementWizard::validStep1()
QModelIndex index = m_tree_view->currentIndex();
if (index.isValid()) {
auto *eci = static_cast<ElementCollectionItem*>(m_model->itemFromIndex(index));
ElementCollectionItem *eci = static_cast<ElementCollectionItem*>(m_model->itemFromIndex(index));
if (eci && eci->isDir()) {
ElementsLocation loc(eci->collectionPath());
if (loc.exist()) {
@@ -226,7 +226,7 @@ bool NewElementWizard::validStep2() {
* Lauch an element editor for create the new element
*/
void NewElementWizard::createNewElement() {
auto *edit_new_element = new QETElementEditor(parentWidget());
QETElementEditor *edit_new_element = new QETElementEditor(parentWidget());
edit_new_element -> setNames(m_names_list -> names());
ElementsLocation loc_ = m_chosen_location;

View File

@@ -179,8 +179,8 @@ void ProjectMainConfigPage::initWidgets() {
Initialize the layout of this page.
*/
void ProjectMainConfigPage::initLayout() {
auto *main_layout0 = new QVBoxLayout();
auto *title_layout0 = new QHBoxLayout();
QVBoxLayout *main_layout0 = new QVBoxLayout();
QHBoxLayout *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::applyProjectConf() {}
*/
void ProjectAutoNumConfigPage::initWidgets()
{
auto *tab_widget = new QTabWidget(this);
QTabWidget *tab_widget = new QTabWidget(this);
//Management tab
m_amw = new AutoNumberingManagementW(project());
@@ -277,7 +277,7 @@ void ProjectAutoNumConfigPage::initWidgets()
m_faw = new FolioAutonumberingW(project());
tab_widget->addTab(m_faw, tr("Folio autonumérotation"));
auto *main_layout = new QHBoxLayout();
QHBoxLayout *main_layout = new QHBoxLayout();
main_layout->addWidget(tab_widget);
setLayout(main_layout);
}

View File

@@ -348,7 +348,7 @@ void ProjectView::addNewDiagram() {
if (m_project -> isReadOnly()) return;
Diagram *new_diagram = m_project -> addNewDiagram();
auto *new_diagram_view = new DiagramView(new_diagram);
DiagramView *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 @@ void ProjectView::addNewDiagramFolioList() {
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()) {
auto *new_diagram_view = new DiagramView(d);
DiagramView *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 @@ int ProjectView::cleanProject() {
#endif
clean_dialog.setWindowTitle(tr("Nettoyer le projet", "window title"));
auto *clean_dialog_layout = new QVBoxLayout();
QVBoxLayout *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 @@ void ProjectView::initWidgets() {
m_tab = new QTabWidget(this);
m_tab -> setMovable(true);
auto *add_new_diagram_button = new QToolButton;
QToolButton *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 @@ void ProjectView::initWidgets() {
Initialize layout for this widget.
*/
void ProjectView::initLayout() {
auto *fallback_widget_layout_ = new QVBoxLayout(fallback_widget_);
QVBoxLayout *fallback_widget_layout_ = new QVBoxLayout(fallback_widget_);
fallback_widget_layout_ -> addWidget(fallback_label_);
layout_ = new QVBoxLayout(this);
@@ -868,7 +868,7 @@ void ProjectView::loadDiagrams()
dialog->setProgressBar(dialog->progressBarValue()+1);
}
auto *sv = new DiagramView(diagram);
DiagramView *sv = new DiagramView(diagram);
addDiagram(sv);
}

View File

@@ -626,7 +626,7 @@ QET::QetCollection QET::qetCollectionFromString(const QString &str)
*/
QActionGroup *QET::depthActionGroup(QObject *parent)
{
auto *action_group = new QActionGroup(parent);
QActionGroup *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);

View File

@@ -441,7 +441,7 @@ TitleBlockTemplatesCollection *QETApp::titleBlockTemplatesCollection(const QStri
@return le nom de l'utilisateur courant
*/
QString QETApp::userName() {
auto * process = new QProcess();
QProcess * process = new QProcess();
QString str;
#ifndef Q_OS_WIN32
// return(QString(getenv("USER")));
@@ -463,18 +463,18 @@ QString QETApp::userName() {
*/
QString QETApp::commonElementsDir()
{
#ifndef Q_OS_MAC
QSettings settings;
QString path = settings.value("elements-collections/common-collection-path", "default").toString();
if (path != "default" && !path.isEmpty())
{
QDir dir(path);
if (dir.exists()) {
return path;
}
}
#endif
//@todo: fix me " Load time from elements is very slow "
// QSettings settings;
// QString path = settings.value("elements-collections/common-collection-path", "default").toString();
// if (path != "default" && !path.isEmpty())
// {
// QDir dir(path);
// if (dir.exists()) {
// return path;
// }
// }
#ifdef QET_ALLOW_OVERRIDE_CED_OPTION
if (common_elements_dir != QString()) return(common_elements_dir);
#endif
@@ -498,17 +498,18 @@ QString QETApp::commonElementsDir()
*/
QString QETApp::customElementsDir()
{
#ifndef Q_OS_MAC
QSettings settings;
QString path = settings.value("elements-collections/custom-collection-path", "default").toString();
if (path != "default" && !path.isEmpty())
{
QDir dir(path);
if (dir.exists()) {
return path;
}
}
#endif
//@todo: fix me " Load time from elements is very slow "
// QSettings settings;
// QString path = settings.value("elements-collections/custom-collection-path", "default").toString();
// if (path != "default" && !path.isEmpty())
// {
// QDir dir(path);
// if (dir.exists()) {
// return path;
// }
// }
return(configDir() + "elements/");
}
@@ -931,7 +932,7 @@ QList<QETTitleBlockTemplateEditor *> QETApp::titleBlockTemplateEditors(QETProjec
@see QTextOrientationSpinBoxWidget
*/
QTextOrientationSpinBoxWidget *QETApp::createTextOrientationSpinBoxWidget() {
auto *widget = new QTextOrientationSpinBoxWidget();
QTextOrientationSpinBoxWidget *widget = new QTextOrientationSpinBoxWidget();
widget -> orientationWidget() -> setFont(QETApp::diagramTextsFont());
widget -> orientationWidget() -> setUsableTexts(QList<QString>()
<< QETApp::tr("Q", "Single-letter example text - translate length, not meaning")
@@ -948,7 +949,7 @@ QTextOrientationSpinBoxWidget *QETApp::createTextOrientationSpinBoxWidget() {
*/
TitleBlockTemplate *QETApp::defaultTitleBlockTemplate() {
if (!QETApp::default_titleblock_template_) {
auto *titleblock_template = new TitleBlockTemplate(QETApp::instance());
TitleBlockTemplate *titleblock_template = new TitleBlockTemplate(QETApp::instance());
if (titleblock_template -> loadFromXmlFile(":/titleblocks/default.titleblock")) {
QETApp::default_titleblock_template_ = titleblock_template;
}
@@ -1058,7 +1059,7 @@ void QETApp::setMainWindowVisible(QMainWindow *window, bool visible) {
@param window fenetre a afficher / cacher
*/
void QETApp::invertMainWindowVisibility(QWidget *window) {
if (auto *w = qobject_cast<QMainWindow *>(window)) setMainWindowVisible(w, !w -> isVisible());
if (QMainWindow *w = qobject_cast<QMainWindow *>(window)) setMainWindowVisible(w, !w -> isVisible());
}
/**
@@ -1230,7 +1231,7 @@ void QETApp::openElementFiles(const QStringList &files_list) {
}
if (!already_opened_in_existing_element_editor) {
// ce fichier n'est ouvert dans aucun editeur
auto *element_editor = new QETElementEditor();
QETElementEditor *element_editor = new QETElementEditor();
element_editor -> fromFile(element_file);
}
}
@@ -1262,7 +1263,7 @@ void QETApp::openElementLocations(const QList<ElementsLocation> &locations_list)
}
if (!already_opened_in_existing_element_editor) {
// cet emplacement n'est ouvert dans aucun editeur
auto *element_editor = new QETElementEditor();
QETElementEditor *element_editor = new QETElementEditor();
element_editor -> fromLocation(element_location);
}
}
@@ -1277,7 +1278,7 @@ void QETApp::openElementLocations(const QList<ElementsLocation> &locations_list)
@see QETTitleBlockTemplateEditor::setOpenForDuplication()
*/
void QETApp::openTitleBlockTemplate(const TitleBlockTemplateLocation &location, bool duplicate) {
auto *qet_template_editor = new QETTitleBlockTemplateEditor();
QETTitleBlockTemplateEditor *qet_template_editor = new QETTitleBlockTemplateEditor();
qet_template_editor -> setOpenForDuplication(duplicate);
qet_template_editor -> edit(location);
qet_template_editor -> show();
@@ -1288,7 +1289,7 @@ void QETApp::openTitleBlockTemplate(const TitleBlockTemplateLocation &location,
@param filepath Path of the .titleblock file to be opened
*/
void QETApp::openTitleBlockTemplate(const QString &filepath) {
auto *qet_template_editor = new QETTitleBlockTemplateEditor();
QETTitleBlockTemplateEditor *qet_template_editor = new QETTitleBlockTemplateEditor();
qet_template_editor -> edit(filepath);
qet_template_editor -> show();
}

View File

@@ -184,7 +184,7 @@ void QETDiagramEditor::setUpElementsCollectionWidget()
*/
void QETDiagramEditor::setUpUndoStack() {
auto *undo_view = new QUndoView(&undo_group, this);
QUndoView *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 @@ void QETDiagramEditor::saveAs() {
*/
bool QETDiagramEditor::newProject() {
// create new project without diagram
auto *new_project = new QETProject(0);
QETProject *new_project = new QETProject(0);
// Set default properties for new diagram
new_project -> setDefaultBorderProperties (BorderProperties:: defaultProperties());
@@ -1009,7 +1009,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
//Create the project
DialogWaiting::instance(this);
auto *project = new QETProject(filepath);
QETProject *project = new QETProject(filepath);
if (project -> state() != QETProject::Ok)
{
if (interactive && project -> state() != QETProject::FileOpenDiscard)
@@ -1048,7 +1048,7 @@ bool QETDiagramEditor::addProject(QETProject *project, bool update_panel) {
QETApp::registerProject(project);
// cree un ProjectView pour visualiser le projet
auto *project_view = new ProjectView(project);
ProjectView *project_view = new ProjectView(project);
addProjectView(project_view);
undo_group.addStack(project -> undoStack());
@@ -1072,7 +1072,7 @@ QList<ProjectView *> QETDiagramEditor::openedProjects() const {
QList<ProjectView *> result;
QList<QMdiSubWindow *> window_list(m_workspace.subWindowList());
foreach(QMdiSubWindow *window, window_list) {
if (auto *project_view = qobject_cast<ProjectView *>(window -> widget())) {
if (ProjectView *project_view = qobject_cast<ProjectView *>(window -> widget())) {
result << project_view;
}
}
@@ -1090,7 +1090,7 @@ ProjectView *QETDiagramEditor::currentProjectView() const {
QWidget *current_widget = current_window -> widget();
if (!current_widget) return(nullptr);
if (auto *project_view = qobject_cast<ProjectView *>(current_widget)) {
if (ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) {
return(project_view);
}
return(nullptr);
@@ -1284,7 +1284,7 @@ void QETDiagramEditor::addItemGroupTriggered(QAction *action)
diagram_event = new DiagramEventAddShape (d, QetShapeItem::Polygon);
else if (value == "image")
{
auto *deai = new DiagramEventAddImage(d);
DiagramEventAddImage *deai = new DiagramEventAddImage(d);
if (deai->isNull())
{
delete deai;
@@ -1326,7 +1326,7 @@ void QETDiagramEditor::selectionGroupTriggered(QAction *action)
}
else if (value == "rotate_selection")
{
auto *c = new RotateSelectionCommand(diagram);
RotateSelectionCommand *c = new RotateSelectionCommand(diagram);
if(c->isValid())
diagram->undoStack().push(c);
}
@@ -1697,7 +1697,7 @@ ProjectView *QETDiagramEditor::acessCurrentProject (){
QWidget *current_widget = current_window -> widget();
if (!current_widget) return(nullptr);
if (auto *project_view = qobject_cast<ProjectView *>(current_widget)) {
if (ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) {
return(project_view);
}
return(nullptr);
@@ -1752,7 +1752,7 @@ void QETDiagramEditor::slot_updateWindowsMenu() {
m_previous_window -> setEnabled(windows.count() > 1);
if (!windows.isEmpty()) windows_menu -> addSeparator();
auto *windows_actions = new QActionGroup(this);
QActionGroup *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 @@ void QETDiagramEditor::removeDiagramFromProject() {
// remove one (last) folio sheet.
} else if (current_project -> diagram_views().size() % 58 == 0) {
foreach (DiagramView *diag, current_project -> diagram_views()) {
auto *ptr = dynamic_cast<DiagramFolioList *>(diag -> diagram());
DiagramFolioList *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::selectionChanged()
void QETDiagramEditor::generateTerminalBlock()
{
bool success;
auto *process = new QProcess(qApp);
QProcess *process = new QProcess(qApp);
// If launched under control:
//connect(process, SIGNAL(errorOcurred(int error)), this, SLOT(slot_generateTerminalBlock_error()));

View File

@@ -696,7 +696,7 @@ bool Conductor::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
QetGraphicsHandlerItem *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 @@ void Conductor::saveProfile(bool undo) {
conductor_profiles[current_path_type].fromConductor(this);
Diagram *dia = diagram();
if (undo && dia) {
auto *undo_object = new ChangeConductorCommand(
ChangeConductorCommand *undo_object = new ChangeConductorCommand(
this,
old_profile,
conductor_profiles[current_path_type],

View File

@@ -205,7 +205,7 @@ void ConductorTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
if (!applied_movement.isNull()) {
//Create an undo object
auto *undo_object = new MoveConductorsTextsCommand(diagram_ptr);
MoveConductorsTextsCommand *undo_object = new MoveConductorsTextsCommand(diagram_ptr);
undo_object -> addTextMovement(this, before_mov_pos_, pos(), moved_by_user_);
moved_by_user_ = true;

View File

@@ -370,7 +370,7 @@ bool CustomElement::parseLine(QDomElement &e, QPainter &qp, bool addtolist) {
if (addtolist){
//Add line to the list
auto *newLine = new QLineF(line);
QLineF *newLine = new QLineF(line);
m_lines << newLine;
}
@@ -475,7 +475,7 @@ bool CustomElement::parseRect(QDomElement &e, QPainter &qp, bool addtolist)
if (addtolist){
//Add rectangle to the list
auto *rect = new QRectF(rect_x, rect_y, rect_w, rect_h);
QRectF *rect = new QRectF(rect_x, rect_y, rect_w, rect_h);
m_rectangles << rect;
}
@@ -516,7 +516,7 @@ bool CustomElement::parseCircle(QDomElement &e, QPainter &qp, bool addtolist) {
if (addtolist){
// Add circle to list
auto *circle = new QRectF(circle_bounding_rect);
QRectF *circle = new QRectF(circle_bounding_rect);
m_circles << circle;
}
@@ -549,7 +549,7 @@ bool CustomElement::parseEllipse(QDomElement &e, QPainter &qp, bool addtolist) {
setPainterStyle(e, qp);
if (addtolist){
auto *arc = new QVector<qreal>;
QVector<qreal> *arc = new QVector<qreal>;
arc -> push_back(ellipse_x);
arc -> push_back(ellipse_y);
arc -> push_back(ellipse_l);
@@ -592,7 +592,7 @@ bool CustomElement::parseArc(QDomElement &e, QPainter &qp, bool addtolist) {
setPainterStyle(e, qp);
if (addtolist){
auto *arc = new QVector<qreal>;
QVector<qreal> *arc = new QVector<qreal>;
arc -> push_back(arc_x);
arc -> push_back(arc_y);
arc -> push_back(arc_l);
@@ -647,7 +647,7 @@ bool CustomElement::parsePolygon(QDomElement &e, QPainter &qp, bool addtolist) {
}
if (addtolist){
// Add to list of polygons.
auto *poly = new QVector<QPointF>(points);
QVector<QPointF> *poly = new QVector<QPointF>(points);
m_polygons << poly;
}
@@ -743,7 +743,7 @@ bool CustomElement::parseInput(QDomElement &dom_element) {
) return(false);
else
{
auto *deti = new DynamicElementTextItem(this);
DynamicElementTextItem *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 @@ bool CustomElement::parseInput(QDomElement &dom_element) {
*/
DynamicElementTextItem *CustomElement::parseDynamicText(QDomElement &dom_element)
{
auto *deti = new DynamicElementTextItem(this);
DynamicElementTextItem *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 @@ Terminal *CustomElement::parseTerminal(QDomElement &e) {
else if (e.attribute("orientation") == "e") terminalo = Qet::East;
else if (e.attribute("orientation") == "w") terminalo = Qet::West;
else return(nullptr);
auto *new_terminal = new Terminal(terminalx, terminaly, terminalo, this);
Terminal *new_terminal = new Terminal(terminalx, terminaly, terminalo, this);
m_terminals << new_terminal;
//Sort from top to bottom and left to rigth

View File

@@ -218,7 +218,7 @@ ElementTextItemGroup *DynamicElementTextItem::parentGroup() const
{
if(parentItem())
{
if(auto *grp = dynamic_cast<ElementTextItemGroup *>(parentItem()))
if(ElementTextItemGroup *grp = dynamic_cast<ElementTextItemGroup *>(parentItem()))
return grp;
}

View File

@@ -78,7 +78,7 @@ Element::Element(QGraphicsItem *parent) :
connect(this, &Element::rotationChanged, [this]() {
for(QGraphicsItem *qgi : childItems())
{
if (auto *t = qgraphicsitem_cast<Terminal *>(qgi))
if (Terminal *t = qgraphicsitem_cast<Terminal *>(qgi))
t->updateConductor();
}
});
@@ -96,7 +96,7 @@ void Element::editProperty()
{
if (diagram() && !diagram()->isReadOnly())
{
auto *epw = new ElementPropertiesWidget(this);
ElementPropertiesWidget *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 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
QHash<int, Terminal *> priv_id_adr;
int terminals_non_trouvees = 0;
foreach(QGraphicsItem *qgi, childItems()) {
if (auto *p = qgraphicsitem_cast<Terminal *>(qgi)) {
if (Terminal *p = qgraphicsitem_cast<Terminal *>(qgi)) {
bool terminal_trouvee = false;
foreach(QDomElement qde, liste_terminals) {
if (p -> fromXml(qde)) {
@@ -454,7 +454,7 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
//************************//
for (const QDomElement& qde : QET::findInDomElement(e, "dynamic_texts", DynamicElementTextItem::xmlTaggName()))
{
auto *deti = new DynamicElementTextItem(this);
DynamicElementTextItem *deti = new DynamicElementTextItem(this);
addDynamicTextItem(deti);
deti->fromXml(qde);
}
@@ -856,7 +856,7 @@ void Element::addDynamicTextItem(DynamicElementTextItem *deti)
}
else
{
auto *text = new DynamicElementTextItem(this);
DynamicElementTextItem *text = new DynamicElementTextItem(this);
m_dynamic_text_list.append(text);
emit textAdded(text);
}
@@ -911,7 +911,7 @@ ElementTextItemGroup *Element::addTextGroup(const QString &name)
{
if(m_texts_group.isEmpty())
{
auto *group = new ElementTextItemGroup(name, this);
ElementTextItemGroup *group = new ElementTextItemGroup(name, this);
m_texts_group << group;
emit textsGroupAdded(group);
return group;
@@ -927,7 +927,7 @@ ElementTextItemGroup *Element::addTextGroup(const QString &name)
}
//Create the group
auto *group = new ElementTextItemGroup(rename, this);
ElementTextItemGroup *group = new ElementTextItemGroup(rename, this);
m_texts_group << group;
emit textsGroupAdded(group);
return group;
@@ -966,7 +966,7 @@ void Element::removeTextGroup(ElementTextItemGroup *group)
{
if(qgi->type() == DynamicElementTextItem::Type)
{
auto *deti = static_cast<DynamicElementTextItem *>(qgi);
DynamicElementTextItem *deti = static_cast<DynamicElementTextItem *>(qgi);
removeTextFromGroup(deti, group);
}
}

View File

@@ -66,7 +66,7 @@ void ElementTextItemGroup::addToGroup(QGraphicsItem *item)
QGraphicsItemGroup::addToGroup(item);
updateAlignment();
auto *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item);
DynamicElementTextItem *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 @@ void ElementTextItemGroup::removeFromGroup(QGraphicsItem *item)
item->setFlag(QGraphicsItem::ItemIsSelectable, true);
updateAlignment();
if(auto *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item))
if(DynamicElementTextItem *deti = qgraphicsitem_cast<DynamicElementTextItem *>(item))
{
disconnect(deti, &DynamicElementTextItem::fontSizeChanged, this, &ElementTextItemGroup::updateAlignment);
disconnect(deti, &DynamicElementTextItem::textChanged, this, &ElementTextItemGroup::updateAlignment);
@@ -780,7 +780,7 @@ void ElementTextItemGroup::autoPos()
if(!diagram())
return;
auto *master = static_cast<MasterElement *>(m_parent_element);
MasterElement *master = static_cast<MasterElement *>(m_parent_element);
XRefProperties xrp = diagram()->project()->defaultXRefProperties(master->kindInformations()["type"].toString());
if(xrp.snapTo() == XRefProperties::Bottom)
{

View File

@@ -408,7 +408,7 @@ bool QetShapeItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
//Watched must be an handler
if(watched->type() == QetGraphicsHandlerItem::Type)
{
auto *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
QetGraphicsHandlerItem *qghi = qgraphicsitem_cast<QetGraphicsHandlerItem *>(watched);
if(m_handler_vector.contains(qghi)) //Handler must be in m_vector_index, then we can start resize
{

View File

@@ -150,7 +150,7 @@ Terminal::~Terminal() {
@return L'orientation actuelle de la Terminal.
*/
Qet::Orientation Terminal::orientation() const {
if (auto *elt = qgraphicsitem_cast<Element *>(parentItem())) {
if (Element *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 @@ Terminal* Terminal::alignedWithTerminal() const
QList <Terminal *> available_terminals;
foreach (QGraphicsItem *qgi, qgi_list)
{
if (auto *tt = qgraphicsitem_cast <Terminal *> (qgi))
if (Terminal *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 @@ void Terminal::mouseMoveEvent(QGraphicsSceneMouseEvent *e) {
// 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...
auto *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
Terminal *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
if (!other_terminal) return;
previous_terminal_ = other_terminal;
@@ -576,7 +576,7 @@ void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
if (!qgi) return;
//Element must be a terminal
auto *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
Terminal *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
if (!other_terminal) return;
other_terminal -> hovered_color_ = neutralColor;
@@ -586,7 +586,7 @@ void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
if (!canBeLinkedTo(other_terminal)) return;
//Create conductor
auto *new_conductor = new Conductor(this, other_terminal);
Conductor *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 @@ void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
}
auto *undo = new QUndoCommand();
QUndoCommand *undo = new QUndoCommand();
QUndoCommand *aic = new AddItemCommand<Conductor *>(new_conductor, diagram(), QPointF(), undo);
undo->setText(aic->text());

View File

@@ -392,7 +392,7 @@ void QETPrintPreviewDialog::setPrintOptionsVisible(bool display) {
void QETPrintPreviewDialog::updateZoomList() {
// recupere le zooom courant
qreal current_zoom = preview_ -> zoomFactor();
auto current_zoom_is_not_null = bool(int(current_zoom * 100.0));
bool current_zoom_is_not_null = bool(int(current_zoom * 100.0));
// liste des zooms par defaut
QList<qreal> zooms_real;

View File

@@ -817,7 +817,7 @@ QDomDocument QETProject::toXml() {
for(Diagram *diagram : diagrams_list)
{
// Write the diagram to XML only if it is not of type DiagramFolioList.
auto *ptr = dynamic_cast<DiagramFolioList *>(diagram);
DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diagram);
if ( !ptr )
{
qDebug() << qPrintable(QString("QETProject::toXml() : exporting diagram \"%1\"").arg(diagram -> title())) << "[" << diagram << "]";
@@ -1099,7 +1099,7 @@ Diagram *QETProject::addNewDiagram() {
if (isReadOnly()) return(nullptr);
// cree un nouveau schema
auto *diagram = new Diagram(this);
Diagram *diagram = new Diagram(this);
// lui transmet les parametres par defaut
diagram -> border_and_titleblock.importBorder(defaultBorderProperties());
@@ -1325,7 +1325,7 @@ void QETProject::readDiagramsXml(QDomDocument &xml_project)
if (diagram_nodes.at(i).isElement())
{
QDomElement diagram_xml_element = diagram_nodes.at(i).toElement();
auto *diagram = new Diagram(this);
Diagram *diagram = new Diagram(this);
bool diagram_loading = diagram -> initFromXml(diagram_xml_element);
if (diagram_loading)
{

View File

@@ -117,7 +117,7 @@ void QTextOrientationSpinBoxWidget::build() {
connect(spin_box_, SIGNAL(editingFinished()), this, SLOT(emitChangeSignals()));
// dispose les widgets : le QTextOrientationWidget a gauche, le SpinBox a droite
auto *main_layout = new QHBoxLayout();
QHBoxLayout *main_layout = new QHBoxLayout();
main_layout -> addWidget(orientation_widget_);
main_layout -> addWidget(spin_box_);
main_layout -> addStretch();

View File

@@ -175,7 +175,7 @@ void RecentFiles::buildMenu() {
// remplit le menu
foreach (QString filepath, list_) {
// creee une nouvelle action pour le fichier
auto *action = new QAction(filepath, this);
QAction *action = new QAction(filepath, this);
if (!files_icon_.isNull()) {
action -> setIcon(files_icon_);
}

View File

@@ -417,7 +417,7 @@ static QAction *createCheckableAction(const QIcon &icon, const QString &text,
QObject *receiver, const char *slot,
QObject *parent = nullptr)
{
auto *result = new QAction(parent);
QAction *result = new QAction(parent);
result->setIcon(icon);
result->setText(text);
result->setCheckable(true);
@@ -471,7 +471,7 @@ RichTextEditorToolBar::RichTextEditorToolBar(RichTextEditor *editor,
// Left, center, right and justified alignment buttons
auto *alignment_group = new QActionGroup(this);
QActionGroup *alignment_group = new QActionGroup(this);
connect(alignment_group, SIGNAL(triggered(QAction*)),
SLOT(alignmentActionTriggered(QAction*)));
@@ -767,12 +767,12 @@ RichTextEditorDialog::RichTextEditorDialog(QWidget *parent) :
tool_bar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
QWidget *rich_edit = new QWidget;
auto *rich_edit_layout = new QVBoxLayout(rich_edit);
QVBoxLayout *rich_edit_layout = new QVBoxLayout(rich_edit);
rich_edit_layout->addWidget(tool_bar);
rich_edit_layout->addWidget(m_editor);
QWidget *plain_edit = new QWidget;
auto *plain_edit_layout = new QVBoxLayout(plain_edit);
QVBoxLayout *plain_edit_layout = new QVBoxLayout(plain_edit);
plain_edit_layout->addWidget(m_text_edit);
m_tab_widget->setTabPosition(QTabWidget::South);
@@ -789,7 +789,7 @@ RichTextEditorDialog::RichTextEditorDialog(QWidget *parent) :
connect(buttonBox, SIGNAL(accepted()), this, SLOT(on_buttonBox_accepted()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
auto *layout = new QVBoxLayout(this);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(m_tab_widget);
layout->addWidget(buttonBox);

View File

@@ -145,10 +145,10 @@ void TitleBlockDimensionWidget::initWidgets() {
Initialize the layout of the dialog.
*/
void TitleBlockDimensionWidget::initLayouts() {
auto *hlayout0 = new QHBoxLayout();
QHBoxLayout *hlayout0 = new QHBoxLayout();
hlayout0 -> addWidget(spinbox_label_);
hlayout0 -> addWidget(spinbox_);
auto *vlayout0 = new QVBoxLayout();
QVBoxLayout *vlayout0 = new QVBoxLayout();
vlayout0 -> addLayout(hlayout0);
if (complete_) {
vlayout0 -> addWidget(absolute_button_);

View File

@@ -246,7 +246,7 @@ bool QETTitleBlockTemplateEditor::edit(QETProject *project, const QString &templ
*/
bool QETTitleBlockTemplateEditor::edit(const QString &file_path) {
// get title block template object from the file, edit it
auto *tbt = new TitleBlockTemplate();
TitleBlockTemplate *tbt = new TitleBlockTemplate();
bool loading = tbt -> loadFromXmlFile(file_path);
if (!loading) {
/// TODO the file opening failed, warn the user?
@@ -301,7 +301,7 @@ void QETTitleBlockTemplateEditor::editLogos() {
logo_manager_ -> layout() -> setContentsMargins(0, 0, 0, 0);
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Close);
auto *vlayout0 = new QVBoxLayout();
QVBoxLayout *vlayout0 = new QVBoxLayout();
vlayout0 -> addWidget(logo_manager_);
vlayout0 -> addWidget(buttons);
@@ -320,7 +320,7 @@ void QETTitleBlockTemplateEditor::editLogos() {
Launch a new title block template editor.
*/
void QETTitleBlockTemplateEditor::newTemplate() {
auto *qet_template_editor = new QETTitleBlockTemplateEditor();
QETTitleBlockTemplateEditor *qet_template_editor = new QETTitleBlockTemplateEditor();
qet_template_editor -> edit(TitleBlockTemplateLocation());
qet_template_editor -> show();
}
@@ -882,7 +882,7 @@ TitleBlockTemplateLocation QETTitleBlockTemplateEditor::getTitleBlockTemplateLoc
}
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
auto *dialog_layout = new QVBoxLayout();
QVBoxLayout *dialog_layout = new QVBoxLayout();
dialog_layout -> addWidget(widget);
dialog_layout -> addWidget(buttons);
@@ -932,7 +932,7 @@ void QETTitleBlockTemplateEditor::editTemplateInformation() {
#endif
dialog_author.setMinimumSize(400, 260);
dialog_author.setWindowTitle(tr("Éditer les informations complémentaires", "window title"));
auto *dialog_layout = new QVBoxLayout(&dialog_author);
QVBoxLayout *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 @@ void QETTitleBlockTemplateEditor::editTemplateInformation() {
dialog_layout -> addWidget(information_label);
// add a QTextEdit to the dialog
auto *text_field = new QTextEdit();
QTextEdit *text_field = new QTextEdit();
text_field -> setAcceptRichText(false);
text_field -> setPlainText(tb_template_ -> information());
text_field -> setReadOnly(read_only_);

View File

@@ -96,11 +96,11 @@ void TitleBlockTemplateCellWidget::initWidgets() {
font_adjust_input_ = new QCheckBox(tr("Ajuster la taille de police si besoin"));
// layout
auto *label_edition = new QHBoxLayout();
QHBoxLayout *label_edition = new QHBoxLayout();
label_edition -> addWidget(label_input_);
label_edition -> addWidget(label_edit_);
auto *value_edition = new QHBoxLayout();
QHBoxLayout *value_edition = new QHBoxLayout();
value_edition -> addWidget(value_input_);
value_edition -> addWidget(value_edit_);
@@ -375,7 +375,7 @@ bool TitleBlockTemplateCellWidget::isReadOnly() const {
@param title Title of the dialog window
*/
void TitleBlockTemplateCellWidget::editTranslatableValue(NamesList &names, const QString &attribute, const QString &title) const {
auto *names_widget = new NamesListWidget();
NamesListWidget *names_widget = new NamesListWidget();
names_widget -> setNames(names);
QDialogButtonBox * buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
@@ -386,7 +386,7 @@ void TitleBlockTemplateCellWidget::editTranslatableValue(NamesList &names, const
QLabel *def_var_label = new QLabel(defaultVariablesString());
def_var_label -> setTextFormat(Qt::RichText);
auto *editor_layout = new QVBoxLayout();
QVBoxLayout *editor_layout = new QVBoxLayout();
editor_layout -> addWidget(information);
editor_layout -> addWidget(names_widget);
editor_layout -> addWidget(def_var_label);
@@ -416,7 +416,7 @@ void TitleBlockTemplateCellWidget::emitModification(const QString &attribute, co
// avoid creating a QUndoCommand object when no modification was actually done
if (edited_cell_ -> attribute(attribute) == new_value) return;
auto *command = new ModifyTitleBlockCellCommand(edited_cell_);
ModifyTitleBlockCellCommand *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")

View File

@@ -55,7 +55,7 @@ int ModifyTitleBlockCellCommand::id() const {
@return true on success, false otherwise
*/
bool ModifyTitleBlockCellCommand::mergeWith(const QUndoCommand *command) {
const auto *other = static_cast<const ModifyTitleBlockCellCommand *>(command);
const ModifyTitleBlockCellCommand *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 @@ ModifyTemplateGridCommand *ModifyTemplateGridCommand::addRow(TitleBlockTemplate
if (!tbtemplate) return(nullptr);
// create the command itself
auto *add_row_command = new ModifyTemplateGridCommand(tbtemplate);
ModifyTemplateGridCommand *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 @@ ModifyTemplateGridCommand *ModifyTemplateGridCommand::addColumn(TitleBlockTempla
if (!tbtemplate) return(nullptr);
// create the command itself
auto *add_column_command = new ModifyTemplateGridCommand(tbtemplate);
ModifyTemplateGridCommand *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 @@ ModifyTemplateGridCommand *ModifyTemplateGridCommand::deleteRow(TitleBlockTempla
if (!tbtemplate) return(nullptr);
// create the command itself
auto *del_row_command = new ModifyTemplateGridCommand(tbtemplate);
ModifyTemplateGridCommand *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 @@ ModifyTemplateGridCommand *ModifyTemplateGridCommand::deleteColumn(TitleBlockTem
if (!tbtemplate) return(nullptr);
// create the command itself
auto *del_column_command = new ModifyTemplateGridCommand(tbtemplate);
ModifyTemplateGridCommand *del_column_command = new ModifyTemplateGridCommand(tbtemplate);
del_column_command -> setInsertion(false);
del_column_command -> setType(false);
del_column_command -> setIndex(index);

View File

@@ -154,7 +154,7 @@ void TitleBlockTemplateLogoManager::fillView() {
current_icon = QIcon(*svg_pixmap);
}
}
auto *qlwi = new QListWidgetItem(current_icon, logo_name);
QListWidgetItem *qlwi = new QListWidgetItem(current_icon, logo_name);
qlwi -> setTextAlignment(Qt::AlignBottom | Qt::AlignHCenter);
logos_view_ -> insertItem(0, qlwi);
}
@@ -192,18 +192,18 @@ QString TitleBlockTemplateLogoManager::confirmLogoName(const QString &initial_na
rd_label = new QLabel();
rd_label -> setWordWrap(true);
rd_input = new QLineEdit();
auto *rd_buttons = new QDialogButtonBox();
QDialogButtonBox *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);
auto *rd_vlayout0 = new QVBoxLayout();
QVBoxLayout *rd_vlayout0 = new QVBoxLayout();
rd_vlayout0 -> addWidget(rd_label);
rd_vlayout0 -> addWidget(rd_input);
rd_vlayout0 -> addWidget(rd_buttons);
rename_dialog -> setLayout(rd_vlayout0);
auto *signal_mapper = new QSignalMapper(rename_dialog);
QSignalMapper *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);

View File

@@ -199,7 +199,7 @@ TitleBlockTemplate *TitleBlockTemplatesProjectCollection::getTemplate(const QStr
}
// Ok, we have its XML description, we have to generate a TitleBlockTemplate object
auto *titleblock_template = new TitleBlockTemplate(this);
TitleBlockTemplate *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 @@ QStringList TitleBlockTemplatesFilesCollection::templates() {
TitleBlockTemplate *TitleBlockTemplatesFilesCollection::getTemplate(const QString &template_name) {
if (!templates().contains(template_name)) return(nullptr);
auto *tbtemplate = new TitleBlockTemplate();
TitleBlockTemplate *tbtemplate = new TitleBlockTemplate();
QString tbt_file_path = path(template_name);
bool loading = tbtemplate -> loadFromXmlFile(tbt_file_path);
@@ -431,7 +431,7 @@ QDomElement TitleBlockTemplatesFilesCollection::getTemplateXmlDescription(const
return(QDomElement());
}
auto *xml_document = new QDomDocument();
QDomDocument *xml_document = new QDomDocument();
bool xml_parsing = xml_document -> setContent(&xml_file);
if (!xml_parsing) {
delete xml_document;

View File

@@ -140,7 +140,7 @@ QList<TitleBlockCell *> TitleBlockTemplateView::cut() {
QList<TitleBlockCell *> copied_cells = copy();
if (!copied_cells.isEmpty()) {
auto *cut_command = new CutTemplateCellsCommand(tbtemplate_);
CutTemplateCellsCommand *cut_command = new CutTemplateCellsCommand(tbtemplate_);
cut_command -> setCutCells(copied_cells);
requestGridModification(cut_command);
}
@@ -247,7 +247,7 @@ void TitleBlockTemplateView::paste() {
// 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);
auto *paste_command = new PasteTemplateCellsCommand(tbtemplate_);
PasteTemplateCellsCommand *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 @@ void TitleBlockTemplateView::editColumn(HelperCell *cell) {
dialog.setValue(dimension_before);
int user_answer = dialog.exec();
if (!read_only_ && user_answer == QDialog::Accepted) {
auto *command = new ModifyTemplateDimension(tbtemplate_);
ModifyTemplateDimension *command = new ModifyTemplateDimension(tbtemplate_);
command -> setType(false);
command -> setIndex(index);
command -> setDimensionBefore(dimension_before);
@@ -360,7 +360,7 @@ void TitleBlockTemplateView::editRow(HelperCell *cell) {
dialog.setValue(dimension_before);
int user_answer = dialog.exec();
if (!read_only_ && user_answer == QDialog::Accepted) {
auto *command = new ModifyTemplateDimension(tbtemplate_);
ModifyTemplateDimension *command = new ModifyTemplateDimension(tbtemplate_);
command -> setType(true);
command -> setIndex(index);
command -> setDimensionBefore(dimension_before);
@@ -394,7 +394,7 @@ void TitleBlockTemplateView::mergeSelectedCells() {
// retrieve the selected cells
TitleBlockTemplateCellsSet selected_cells = selectedCellsSet();
auto *merge_command = new MergeCellsCommand(selected_cells, tbtemplate_);
MergeCellsCommand *merge_command = new MergeCellsCommand(selected_cells, tbtemplate_);
if (merge_command -> isValid()) requestGridModification(merge_command);
}
@@ -405,7 +405,7 @@ void TitleBlockTemplateView::splitSelectedCell() {
// retrieve the selected cells
TitleBlockTemplateCellsSet selected_cells = selectedCellsSet();
auto *split_command = new SplitCellsCommand(selected_cells, tbtemplate_);
SplitCellsCommand *split_command = new SplitCellsCommand(selected_cells, tbtemplate_);
if (split_command -> isValid()) requestGridModification(split_command);
}
@@ -578,7 +578,7 @@ void TitleBlockTemplateView::applyColumnsWidths(bool animate) {
// no animation on first call
tbgrid_ -> setColumnFixedWidth(COL_OFFSET + i, widths.at(i));
} else {
auto *animation = new GridLayoutAnimation(tbgrid_, form_);
GridLayoutAnimation *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 @@ void TitleBlockTemplateView::applyRowsHeights(bool animate) {
// no animation on first call
tbgrid_ -> setRowFixedHeight(ROW_OFFSET + i, heights.at(i));
} else {
auto *animation = new GridLayoutAnimation(tbgrid_, form_);
GridLayoutAnimation *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 @@ void TitleBlockTemplateView::updateRowsHelperCells() {
int row_count = tbtemplate_ -> rowsCount();
QList<int> heights = tbtemplate_ -> rowsHeights();
for (int i = 0 ; i < row_count ; ++ i) {
auto *current_row_cell = static_cast<HelperCell *>(tbgrid_ -> itemAt(ROW_OFFSET + i, 0));
HelperCell *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 @@ void TitleBlockTemplateView::updateColumnsHelperCells() {
int col_count = tbtemplate_ -> columnsCount();
for (int i = 0 ; i < col_count ; ++ i) {
TitleBlockDimension current_col_dim = tbtemplate_ -> columnDimension(i);
auto *current_col_cell = static_cast<HelperCell *>(tbgrid_ -> itemAt(1, COL_OFFSET + i));
HelperCell *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 @@ void TitleBlockTemplateView::addCells() {
// 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);
auto *current_col_cell = new HelperCell();
HelperCell *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 @@ void TitleBlockTemplateView::addCells() {
// we add one cell per row to show their respective height
QList<int> heights = tbtemplate_ -> rowsHeights();
for (int i = 0 ; i < row_count ; ++ i) {
auto *current_row_cell = new HelperCell();
HelperCell *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 @@ void TitleBlockTemplateView::addCells() {
for (int j = 0 ; j < row_count ; ++ j) {
TitleBlockCell *cell = tbtemplate_ -> cell(j, i);
if (cell -> spanner_cell) continue;
auto *cell_item = new TitleBlockTemplateVisualCell();
TitleBlockTemplateVisualCell *cell_item = new TitleBlockTemplateVisualCell();
cell_item -> setTemplateCell(tbtemplate_, cell);
int row_span = 0, col_span = 0;
@@ -768,7 +768,7 @@ void TitleBlockTemplateView::refresh() {
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 (auto *qgi = dynamic_cast<QGraphicsItem *>(item)) {
if (QGraphicsItem *qgi = dynamic_cast<QGraphicsItem *>(item)) {
qgi -> update();
}
}
@@ -800,7 +800,7 @@ void TitleBlockTemplateView::fillWithEmptyCells() {
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;
auto *cell_item = new TitleBlockTemplateVisualCell();
TitleBlockTemplateVisualCell *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 @@ void TitleBlockTemplateView::removeItem(QGraphicsLayoutItem *item) {
TitleBlockTemplateCellsSet TitleBlockTemplateView::makeCellsSetFromGraphicsItems(const QList<QGraphicsItem *> &items) const {
TitleBlockTemplateCellsSet set(this);
foreach (QGraphicsItem *item, items) {
if (auto *cell_view = dynamic_cast<TitleBlockTemplateVisualCell *>(item)) {
if (TitleBlockTemplateVisualCell *cell_view = dynamic_cast<TitleBlockTemplateVisualCell *>(item)) {
if (cell_view -> cell() && cell_view -> cell() -> num_row != -1) {
set << cell_view;
}

View File

@@ -167,7 +167,7 @@ void TitleBlockTemplate::exportCellToXml(TitleBlockCell *cell, QDomElement &xml_
cells are duplicated too and associated with their parent template).
*/
TitleBlockTemplate *TitleBlockTemplate::clone() const {
auto *copy = new TitleBlockTemplate();
TitleBlockTemplate *copy = new TitleBlockTemplate();
copy -> name_ = name_;
copy -> information_ = information_;
@@ -1030,7 +1030,7 @@ bool TitleBlockTemplate::addLogo(const QString &logo_name, QByteArray *logo_data
// we can now create our image object from the byte array
if (logo_type == "svg") {
// SVG format is handled by the QSvgRenderer class
auto *svg = new QSvgRenderer();
QSvgRenderer *svg = new QSvgRenderer();
if (!svg -> load(*logo_data)) {
return(false);
}

View File

@@ -68,7 +68,7 @@ void ConductorPropertiesDialog::PropertiesDialog(Conductor *conductor, QWidget *
old_value.setValue(conductor->properties());
new_value.setValue(cpd.properties());
auto *undo = new QPropertyUndoCommand(conductor, "properties", old_value, new_value);
QPropertyUndoCommand *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())

View File

@@ -40,7 +40,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
if(tabbed)
ui->m_use_tab_mode_rb->setChecked(true);
else
ui->m_use_windows_mode_rb->setChecked(true);
ui->m_use_windows_mode_rb->setChecked(true);
ui->m_zoom_out_beyond_folio->setChecked(settings.value("diagrameditor/zoom-out-beyond-of-folio", false).toBool());
ui->m_use_gesture_trackpad->setChecked(settings.value("diagramview/gestures", false).toBool());
ui->m_save_label_paste->setChecked(settings.value("diagramcommands/erase-label-on-copy", true).toBool());
@@ -81,10 +81,9 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
fillLang();
#ifdef Q_OS_MACOS
//@todo: fix me " Load time from elements is very slow " -> Disable dialog buttons for define the file system path of the common and custom elements
ui->m_common_elmt_path_cb ->setDisabled(true);
ui->m_custom_elmt_path_cb ->setDisabled(true);
#endif
}

View File

@@ -48,7 +48,7 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
setWindowTitle(tr("Propriétés du folio", "window title"));
//Border widget
auto *border_infos = new BorderPropertiesWidget(border, this);
BorderPropertiesWidget *border_infos = new BorderPropertiesWidget(border, this);
border_infos -> setReadOnly(diagram_is_read_only);
//Title block widget
@@ -78,7 +78,7 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
connect(&boutons, SIGNAL(accepted()), this, SLOT(accept()));
connect(&boutons, SIGNAL(rejected()), this, SLOT(reject()));
auto *glayout = new QGridLayout;
QGridLayout *glayout = new QGridLayout;
glayout->addWidget(border_infos,0,0);
glayout->addWidget(titleblock_infos, 1, 0);
glayout->addWidget(m_cpw, 0, 1, 0, 1);

View File

@@ -127,7 +127,7 @@ void DiagramPropertiesEditorDockWidget::selectionChanged()
}
case DynamicElementTextItem::Type:
{
auto *deti = static_cast<DynamicElementTextItem *>(item);
DynamicElementTextItem *deti = static_cast<DynamicElementTextItem *>(item);
//For dynamic element text, we open the element editor to edit it
//If we already edit an element, just update the editor with a new element
@@ -144,7 +144,7 @@ void DiagramPropertiesEditorDockWidget::selectionChanged()
}
case QGraphicsItemGroup::Type:
{
if(auto *group = dynamic_cast<ElementTextItemGroup *>(item))
if(ElementTextItemGroup *group = dynamic_cast<ElementTextItemGroup *>(item))
{
//For element text item group, we open the element editor to edit it
//If we already edit an element, just update the editor with a new element

View File

@@ -62,8 +62,8 @@ void diagramselection::load_TableDiagram() {
// List Diagrams
for(int i=0,j=0; i<list_diagram_.count(); i++,j++){
auto *item_Name = new QTableWidgetItem();
auto *item_State = new QTableWidgetItem();
QTableWidgetItem *item_Name = new QTableWidgetItem();
QTableWidgetItem *item_State = new QTableWidgetItem();
QString diagram_title = list_diagram_.at(i) -> title();
if (diagram_title.isEmpty()) diagram_title = tr("Folio sans titre");

View File

@@ -86,7 +86,7 @@ void DynamicElementTextItemEditor::apply()
if (undo->childCount() == 1)
{
auto *quc = new QPropertyUndoCommand(static_cast<const QPropertyUndoCommand *>(undo->child(0)));
QPropertyUndoCommand *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 @@ void DynamicElementTextItemEditor::apply()
if (undo->childCount() == 1)
{
auto *quc = new QPropertyUndoCommand(static_cast<const QPropertyUndoCommand *>(undo->child(0)));
QPropertyUndoCommand *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 @@ void DynamicElementTextItemEditor::on_m_add_text_clicked()
if (!m_element)
return;
auto *deti = new DynamicElementTextItem(m_element);
DynamicElementTextItem *deti = new DynamicElementTextItem(m_element);
if (m_element->diagram())
{
m_element->diagram()->undoStack().push(new AddElementTextCommand(m_element, deti));

View File

@@ -138,7 +138,7 @@ QList<QStandardItem *> DynamicElementTextModel::itemsForText(DynamicElementTextI
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é");
auto *srca = new QStandardItem(title);
QStandardItem *srca = new QStandardItem(title);
srca->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
srca->setData(textFrom, Qt::UserRole+1);
@@ -192,7 +192,7 @@ QList<QStandardItem *> DynamicElementTextModel::itemsForText(DynamicElementTextI
QStandardItem *size = new QStandardItem(tr("Taille"));
size->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *siza = new QStandardItem();
QStandardItem *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 @@ QList<QStandardItem *> DynamicElementTextModel::itemsForText(DynamicElementTextI
QStandardItem *color = new QStandardItem(tr("Couleur"));
color->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *colora = new QStandardItem;
QStandardItem *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 @@ QList<QStandardItem *> DynamicElementTextModel::itemsForText(DynamicElementTextI
QStandardItem *frame = new QStandardItem(tr("Cadre"));
frame->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *frame_a = new QStandardItem;
QStandardItem *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 @@ QList<QStandardItem *> DynamicElementTextModel::itemsForText(DynamicElementTextI
QStandardItem *width = new QStandardItem(tr("Largeur"));
width->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *width_a = new QStandardItem;
QStandardItem *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 @@ QList<QStandardItem *> DynamicElementTextModel::itemsForText(DynamicElementTextI
QStandardItem *x_pos = new QStandardItem(tr("Position X"));
x_pos->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *x_pos_a = new QStandardItem;
QStandardItem *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 @@ QList<QStandardItem *> DynamicElementTextModel::itemsForText(DynamicElementTextI
QStandardItem *y_pos = new QStandardItem(tr("Position Y"));
y_pos->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *y_pos_a = new QStandardItem;
QStandardItem *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 @@ QList<QStandardItem *> DynamicElementTextModel::itemsForText(DynamicElementTextI
QStandardItem *rot = new QStandardItem(tr("Rotation"));
rot->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *rot_a = new QStandardItem;
QStandardItem *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 @@ QList<QStandardItem *> DynamicElementTextModel::itemsForText(DynamicElementTextI
qsi_list.clear();
auto *empty_qsi = new QStandardItem(0);
QStandardItem *empty_qsi = new QStandardItem(0);
empty_qsi->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
qsi_list << qsi << empty_qsi;
@@ -620,7 +620,7 @@ void DynamicElementTextModel::addGroup(ElementTextItemGroup *group)
grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEditable);
grp->setIcon(QET::Icons::textGroup);
auto *empty_qsi = new QStandardItem(0);
QStandardItem *empty_qsi = new QStandardItem(0);
empty_qsi->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
QList<QStandardItem *> qsi_list;
@@ -640,7 +640,7 @@ void DynamicElementTextModel::addGroup(ElementTextItemGroup *group)
case Qt::AlignVCenter: text = tr("Centre"); break;
default: break;}
auto *alignment_a = new QStandardItem(text);
QStandardItem *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 @@ void DynamicElementTextModel::addGroup(ElementTextItemGroup *group)
QStandardItem *x_pos = new QStandardItem(tr("Position X"));
x_pos->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *x_pos_a = new QStandardItem;
QStandardItem *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 @@ void DynamicElementTextModel::addGroup(ElementTextItemGroup *group)
QStandardItem *y_pos = new QStandardItem(tr("Position Y"));
y_pos->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *y_pos_a = new QStandardItem;
QStandardItem *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 @@ void DynamicElementTextModel::addGroup(ElementTextItemGroup *group)
QStandardItem *rot = new QStandardItem(tr("Rotation"));
rot->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
auto *rot_a = new QStandardItem;
QStandardItem *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 @@ void DynamicElementTextModel::addGroup(ElementTextItemGroup *group)
QStandardItem *v_adj = new QStandardItem(tr("Ajustement vertical"));
v_adj->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
auto *v_adj_a = new QStandardItem;
QStandardItem *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 @@ void DynamicElementTextModel::addGroup(ElementTextItemGroup *group)
QStandardItem *frame_ = new QStandardItem(tr("Cadre"));
frame_->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
auto *frame_a = new QStandardItem;
QStandardItem *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 @@ void DynamicElementTextModel::addGroup(ElementTextItemGroup *group)
QStandardItem *hold_bottom = new QStandardItem(tr("Maintenir en bas de page"));
hold_bottom->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
auto *hold_bottom_a = new QStandardItem();
QStandardItem *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 @@ QMimeData *DynamicElementTextModel::mimeData(const QModelIndexList &indexes) con
DynamicElementTextItem *deti = m_texts_list.key(item);
if(deti)
{
auto *mime_data = new QMimeData();
QMimeData *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 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
{
case DynamicElementTextModel::textFrom:
{
auto *qcb = new QComboBox(parent);
QComboBox *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 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::infoText:
{
const auto *detm = static_cast<const DynamicElementTextModel *>(index.model());
const DynamicElementTextModel *detm = static_cast<const DynamicElementTextModel *>(index.model());
QStandardItem *qsi = detm->itemFromIndex(index);
if(!qsi)
@@ -1447,7 +1447,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
info_map.insert(QETApp::elementTranslatedInfoKey(str), str);
}
auto *qcb = new QComboBox(parent);
QComboBox *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 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::compositeText:
{
const auto *detm = static_cast<const DynamicElementTextModel *>(index.model());
const DynamicElementTextModel *detm = static_cast<const DynamicElementTextModel *>(index.model());
QStandardItem *qsi = detm->itemFromIndex(index);
if(!qsi)
@@ -1466,13 +1466,13 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
if(!deti)
break;
auto *cted = new CompositeTextEditDialog(deti, parent);
CompositeTextEditDialog *cted = new CompositeTextEditDialog(deti, parent);
cted->setObjectName("composite_text");
return cted;
}
case DynamicElementTextModel::txtAlignment:
{
const auto *detm = static_cast<const DynamicElementTextModel *>(index.model());
const DynamicElementTextModel *detm = static_cast<const DynamicElementTextModel *>(index.model());
QStandardItem *qsi = detm->itemFromIndex(index);
if(!qsi)
@@ -1488,7 +1488,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::size:
{
auto *sb = new QSpinBox(parent);
QSpinBox *sb = new QSpinBox(parent);
sb->setObjectName("font_size");
sb->setFrame(false);
return sb;
@@ -1501,7 +1501,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::pos:
{
auto *sb = new QSpinBox(parent);
QSpinBox *sb = new QSpinBox(parent);
sb->setObjectName("pos_dialog");
sb->setRange(-1000,10000);
sb->setFrame(false);
@@ -1510,7 +1510,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::rotation:
{
auto *sb = new QSpinBox(parent);
QSpinBox *sb = new QSpinBox(parent);
sb->setObjectName("rot_spinbox");
sb->setRange(0, 359);
sb->setWrapping(true);
@@ -1520,7 +1520,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::textWidth:
{
auto *sb = new QSpinBox(parent);
QSpinBox *sb = new QSpinBox(parent);
sb->setObjectName("width_spinbox");
sb->setRange(-1, 500);
sb->setFrame(false);
@@ -1529,7 +1529,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::grpAlignment:
{
auto *qcb = new QComboBox(parent);
QComboBox *qcb = new QComboBox(parent);
qcb->setFrame(false);
qcb->setObjectName("group_alignment");
qcb->addItem(tr("Gauche"));
@@ -1539,7 +1539,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::grpPos:
{
auto *sb = new QSpinBox(parent);
QSpinBox *sb = new QSpinBox(parent);
sb->setObjectName("group_pos");
sb->setRange(-1000,10000);
sb->setFrame(false);
@@ -1548,7 +1548,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::grpRotation:
{
auto *sb = new QSpinBox(parent);
QSpinBox *sb = new QSpinBox(parent);
sb->setObjectName("group_rotation");
sb->setRange(0, 359);
sb->setWrapping(true);
@@ -1558,7 +1558,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
}
case DynamicElementTextModel::grpVAdjust:
{
auto *sb = new QSpinBox(parent);
QSpinBox *sb = new QSpinBox(parent);
sb->setObjectName("group_v_adjustment");
sb->setRange(-20, 20);
sb->setFrame(false);
@@ -1575,11 +1575,11 @@ void DynamicTextItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *
{
if(editor->objectName() == "color_dialog")
{
if (auto *qsim = dynamic_cast<QStandardItemModel *>(model))
if (QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
auto *cd = static_cast<QColorDialog *> (editor);
QColorDialog *cd = static_cast<QColorDialog *> (editor);
qsi->setData(cd->selectedColor(), Qt::EditRole);
qsi->setData(cd->selectedColor(), Qt::ForegroundRole);
return;
@@ -1589,11 +1589,11 @@ void DynamicTextItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *
}
else if (editor->objectName() == "info_text")
{
if (auto *qsim = dynamic_cast<QStandardItemModel *>(model))
if (QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
auto *cb = static_cast<QComboBox *>(editor);
QComboBox *cb = static_cast<QComboBox *>(editor);
qsi->setData(cb->currentText(), Qt::DisplayRole);
qsi->setData(cb->currentData(), Qt::UserRole+2);
return;
@@ -1603,17 +1603,17 @@ void DynamicTextItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *
}
else if (editor->objectName() == "composite_text")
{
if (auto *qsim = dynamic_cast<QStandardItemModel *>(model))
if (QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
auto *cted = static_cast<CompositeTextEditDialog *>(editor);
CompositeTextEditDialog *cted = static_cast<CompositeTextEditDialog *>(editor);
QString edited_text = cted->plainText();
QString assigned_text;
const auto *detm = static_cast<const DynamicElementTextModel *>(index.model());
const DynamicElementTextModel *detm = static_cast<const DynamicElementTextModel *>(index.model());
DynamicElementTextItem *deti = detm->textFromIndex(index);
if(deti)
{
@@ -1631,11 +1631,11 @@ void DynamicTextItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *
}
else if (editor->objectName() == "alignment_text")
{
if(auto *qsim = dynamic_cast<QStandardItemModel *>(model))
if(QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
auto *atd = static_cast<AlignmentTextDialog *>(editor);
AlignmentTextDialog *atd = static_cast<AlignmentTextDialog *>(editor);
Qt::Alignment align = atd->alignment();
qsi->setData(QVariant::fromValue(align), Qt::UserRole+2);
return;
@@ -1644,11 +1644,11 @@ void DynamicTextItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *
}
else if (editor->objectName() == "group_alignment")
{
if(auto *qsim = dynamic_cast<QStandardItemModel *>(model))
if(QStandardItemModel *qsim = dynamic_cast<QStandardItemModel *>(model))
{
if(QStandardItem *qsi = qsim->itemFromIndex(index))
{
auto *cb = static_cast<QComboBox *>(editor);
QComboBox *cb = static_cast<QComboBox *>(editor);
qsi->setData(cb->currentText(), Qt::DisplayRole);
}
}
@@ -1671,7 +1671,7 @@ bool DynamicTextItemDelegate::eventFilter(QObject *object, QEvent *event)
{
object->event(event);
auto *sb = static_cast<QSpinBox *>(object);
QSpinBox *sb = static_cast<QSpinBox *>(object);
switch (event->type()) {
case QEvent::KeyPress:
emit commitData(sb); break;
@@ -1691,7 +1691,7 @@ bool DynamicTextItemDelegate::eventFilter(QObject *object, QEvent *event)
//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)
{
auto *qcb = static_cast<QComboBox *>(object);
QComboBox *qcb = static_cast<QComboBox *>(object);
connect(qcb, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [this,qcb](){emit commitData(qcb);});
}

View File

@@ -84,7 +84,7 @@ ElementPropertiesWidget::ElementPropertiesWidget(ElementTextItemGroup *group, QW
{
if(group->parentItem() && group->parentItem()->type() == Element::Type)
{
auto *elmt = static_cast<Element *>(group->parentItem());
Element *elmt = static_cast<Element *>(group->parentItem());
m_diagram = elmt->diagram();
buildGui();
setTextsGroup(group);
@@ -133,7 +133,7 @@ void ElementPropertiesWidget::setDynamicText(DynamicElementTextItem *text)
{
if (QString(aepew->metaObject()->className()) == "DynamicElementTextItemEditor")
{
auto *detie = static_cast<DynamicElementTextItemEditor *>(aepew);
DynamicElementTextItemEditor *detie = static_cast<DynamicElementTextItemEditor *>(aepew);
m_tab->setCurrentWidget(detie);
detie->setCurrentText(text);
}
@@ -156,7 +156,7 @@ void ElementPropertiesWidget::setTextsGroup(ElementTextItemGroup *group)
{
if (QString(aepew->metaObject()->className()) == "DynamicElementTextItemEditor")
{
auto *detie = static_cast<DynamicElementTextItemEditor *>(aepew);
DynamicElementTextItemEditor *detie = static_cast<DynamicElementTextItemEditor *>(aepew);
m_tab->setCurrentWidget(detie);
detie->setCurrentGroup(group);
}
@@ -216,7 +216,7 @@ bool ElementPropertiesWidget::setLiveEdit(bool live_edit)
*/
void ElementPropertiesWidget::findInPanel()
{
auto *custom_element = qobject_cast<CustomElement *>(m_element);
CustomElement *custom_element = qobject_cast<CustomElement *>(m_element);
if (custom_element && m_diagram)
{
m_diagram->findElementRequired(custom_element->location());
@@ -230,7 +230,7 @@ void ElementPropertiesWidget::findInPanel()
*/
void ElementPropertiesWidget::editElement()
{
auto *custom_element = qobject_cast<CustomElement *>(m_element);
CustomElement *custom_element = qobject_cast<CustomElement *>(m_element);
if (custom_element && m_diagram)
{
m_diagram->findElementRequired(custom_element->location());
@@ -246,7 +246,7 @@ void ElementPropertiesWidget::editElement()
void ElementPropertiesWidget::buildGui()
{
m_tab = new QTabWidget(this);
auto *main_layout = new QVBoxLayout(this);
QVBoxLayout *main_layout = new QVBoxLayout(this);
main_layout -> addWidget(m_tab);
setLayout(main_layout);
}
@@ -342,8 +342,8 @@ void ElementPropertiesWidget::addGeneralWidget()
*/
QWidget *ElementPropertiesWidget::generalWidget()
{
auto *custom_element = qobject_cast<CustomElement *>(m_element);
auto *ghost_element = qobject_cast<GhostElement *>(m_element);
CustomElement *custom_element = qobject_cast<CustomElement *>(m_element);
GhostElement *ghost_element = qobject_cast<GhostElement *>(m_element);
// type de l'element
QString description_string;
@@ -371,7 +371,7 @@ QWidget *ElementPropertiesWidget::generalWidget()
// widget himself
QWidget *general_widget = new QWidget (m_tab);
auto *vlayout_ = new QVBoxLayout (general_widget);
QVBoxLayout *vlayout_ = new QVBoxLayout (general_widget);
general_widget -> setLayout(vlayout_);
//widget for the text
@@ -389,7 +389,7 @@ QWidget *ElementPropertiesWidget::generalWidget()
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()));
auto *hlayout_ = new QHBoxLayout;
QHBoxLayout *hlayout_ = new QHBoxLayout;
hlayout_->addWidget(find_in_panel);
hlayout_->addWidget(edit_element);
vlayout_->addLayout(hlayout_);

View File

@@ -42,10 +42,10 @@ QET::Action ImportElementDialog::action() const
void ImportElementDialog::setUpWidget()
{
auto *button_group = new QButtonGroup(this);
QButtonGroup *button_group = new QButtonGroup(this);
button_group->addButton(ui->m_use_actual_rd);
button_group->addButton(ui->m_use_drop_rb);
auto *button_group_drop = new QButtonGroup(this);
QButtonGroup *button_group_drop = new QButtonGroup(this);
button_group_drop->addButton(ui->m_erase_actual_rb);
button_group_drop->addButton(ui->m_use_both_rb);

View File

@@ -157,7 +157,7 @@ void LinkSingleElementWidget::apply()
*/
QUndoCommand *LinkSingleElementWidget::associatedUndo() const
{
auto *undo = new LinkElementCommand(m_element);
LinkElementCommand *undo = new LinkElementCommand(m_element);
if (m_element_to_link || m_unlink)
{
@@ -257,7 +257,7 @@ void LinkSingleElementWidget::buildTree()
qDebug() << "In method void LinkSingleElementWidget::updateUi(), provided element must be in a diagram";
}
auto *qtwi = new QTreeWidgetItem(ui->m_tree_widget, str_list);
QTreeWidgetItem *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 @@ void LinkSingleElementWidget::buildTree()
qDebug() << "In method void LinkSingleElementWidget::updateUi(), provided element must be in a diagram";
}
auto *qtwi = new QTreeWidgetItem(ui->m_tree_widget, str_list);
QTreeWidgetItem *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 @@ void LinkSingleElementWidget::setUpCompleter()
foreach(QStringList strl , m_qtwi_strl_hash.values())
search.append(strl);
auto *c = new QCompleter(search, ui->m_search_field);
QCompleter *c = new QCompleter(search, ui->m_search_field);
c->setCaseSensitivity(Qt::CaseInsensitive);
ui->m_search_field->setCompleter(c);
}

View File

@@ -196,7 +196,7 @@ QUndoCommand* MasterPropertiesWidget::associatedUndo() const
return nullptr;
}
auto *undo = new LinkElementCommand(m_element);
LinkElementCommand *undo = new LinkElementCommand(m_element);
if (to_link.isEmpty())
undo->unlinkAll();
@@ -239,7 +239,7 @@ void MasterPropertiesWidget::updateUi()
const QList<Element *> free_list = elmt_prov.freeElement(Element::Slave);
for(Element *elmt : free_list)
{
auto *qtwi = new QTreeWidgetItem(ui->m_free_tree_widget);
QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_free_tree_widget);
qtwi->setIcon(0, elmt->pixmap());
if(settings.value("genericpanel/folio", false).toBool())
@@ -267,7 +267,7 @@ void MasterPropertiesWidget::updateUi()
const QList<Element *> link_list = m_element->linkedElements();
for(Element *elmt : link_list)
{
auto *qtwi = new QTreeWidgetItem(ui->m_link_tree_widget);
QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_link_tree_widget);
qtwi->setIcon(0, elmt->pixmap());
if(settings.value("genericpanel/folio", false).toBool())

View File

@@ -126,7 +126,7 @@ void MultiPasteDialog::on_m_button_box_accepted()
{
QPair <Terminal *, Terminal *> pair = elmt->AlignedFreeTerminals().takeFirst();
auto *conductor = new Conductor(pair.first, pair.second);
Conductor *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

View File

@@ -240,8 +240,8 @@ void PotentialSelectorDialog::buildWidget()
if(!cp2.m_tension_protocol.isEmpty())
text2.append(tr("\nTension/protocole : %1").arg(cp2.m_tension_protocol));
auto *rb1 = new QRadioButton(text1, this);
auto *rb2 = new QRadioButton(text2, this);
QRadioButton *rb1 = new QRadioButton(text1, this);
QRadioButton *rb2 = new QRadioButton(text2, this);
connect(rb1, &QRadioButton::toggled, [this](bool t)
{

View File

@@ -28,8 +28,8 @@
* @param parent : parent widget of this dialog
*/
ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *parent) {
auto *newDiagramPage = new NewDiagramPage(project,parent,this);
auto *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project);
NewDiagramPage *newDiagramPage = new NewDiagramPage(project,parent,this);
ProjectAutoNumConfigPage *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 @@ void ProjectPropertiesDialog::setCurrentPage(ProjectPropertiesDialog::Page p) {
* Change the current displayed tab to folio tab.
*/
void ProjectPropertiesDialog::changeToFolio() {
auto *autoNumPage = static_cast <ProjectAutoNumConfigPage*>(m_properties_dialog->pages.at(2));
ProjectAutoNumConfigPage *autoNumPage = static_cast <ProjectAutoNumConfigPage*>(m_properties_dialog->pages.at(2));
autoNumPage->changeToTab(3);
}

View File

@@ -349,7 +349,7 @@ bool AlignmentTextsGroupCommand::mergeWith(const QUndoCommand *other)
if (id() != other->id() || other->childCount())
return false;
auto const *undo = static_cast<const AlignmentTextsGroupCommand *>(other);
AlignmentTextsGroupCommand const *undo = static_cast<const AlignmentTextsGroupCommand *>(other);
if (m_group != undo->m_group)
return false;

View File

@@ -38,7 +38,7 @@ ChangeElementInformationCommand::ChangeElementInformationCommand(Element *elmt,
bool ChangeElementInformationCommand::mergeWith(const QUndoCommand *other)
{
if (id() != other->id()) return false;
auto const *undo = static_cast<const ChangeElementInformationCommand*>(other);
ChangeElementInformationCommand const *undo = static_cast<const ChangeElementInformationCommand*>(other);
if (m_element != undo->m_element) return false;
m_new_info = undo->m_new_info;
return true;

View File

@@ -45,7 +45,7 @@ LinkElementCommand::LinkElementCommand(Element *element_, QUndoCommand *parent):
bool LinkElementCommand::mergeWith(const QUndoCommand *other)
{
if (id() != other->id() || other->childCount()) return false;
auto const *undo = static_cast<const LinkElementCommand *> (other);
LinkElementCommand const *undo = static_cast<const LinkElementCommand *> (other);
if (m_element != undo->m_element) return false;
m_linked_after = undo->m_linked_after;
return true;

View File

@@ -61,7 +61,7 @@ m_diagram(diagram)
break;
case QGraphicsItemGroup::Type:
{
if(auto *grp = dynamic_cast<ElementTextItemGroup *>(item))
if(ElementTextItemGroup *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);
}

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