Apply clang-tidy's modernize-use-auto

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5449 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810
2018-07-19 16:27:20 +00:00
parent e4b1ba9797
commit b97b01d63c
98 changed files with 427 additions and 427 deletions

View File

@@ -68,7 +68,7 @@ void ConductorPropertiesDialog::PropertiesDialog(Conductor *conductor, QWidget *
old_value.setValue(conductor->properties());
new_value.setValue(cpd.properties());
QPropertyUndoCommand *undo = new QPropertyUndoCommand(conductor, "properties", old_value, new_value);
auto *undo = new QPropertyUndoCommand(conductor, "properties", old_value, new_value);
undo->setText(tr("Modifier les propriétés d'un conducteur", "undo caption"));
if (!conductor->relatedPotentialConductors().isEmpty() && cpd.applyAll())

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

View File

@@ -126,7 +126,7 @@ void MultiPasteDialog::on_m_button_box_accepted()
{
QPair <Terminal *, Terminal *> pair = elmt->AlignedFreeTerminals().takeFirst();
Conductor *conductor = new Conductor(pair.first, pair.second);
auto *conductor = new Conductor(pair.first, pair.second);
m_diagram->undoStack().push(new AddItemCommand<Conductor *>(conductor, m_diagram, QPointF()));
//Autonum the new conductor, the undo command associated for this, have for parent undo_object

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));
QRadioButton *rb1 = new QRadioButton(text1, this);
QRadioButton *rb2 = new QRadioButton(text2, this);
auto *rb1 = new QRadioButton(text1, this);
auto *rb2 = new QRadioButton(text2, this);
connect(rb1, &QRadioButton::toggled, [this](bool t)
{

View File

@@ -28,8 +28,8 @@
* @param parent : parent widget of this dialog
*/
ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *parent) {
NewDiagramPage *newDiagramPage = new NewDiagramPage(project,parent,this);
ProjectAutoNumConfigPage *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project);
auto *newDiagramPage = new NewDiagramPage(project,parent,this);
auto *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project);
m_properties_dialog = new ConfigDialog (parent);
m_properties_dialog -> setWindowTitle(QObject::tr("Propriétés du projet", "window title"));
m_properties_dialog -> addPage(new ProjectMainConfigPage (project));
@@ -72,6 +72,6 @@ void ProjectPropertiesDialog::setCurrentPage(ProjectPropertiesDialog::Page p) {
* Change the current displayed tab to folio tab.
*/
void ProjectPropertiesDialog::changeToFolio() {
ProjectAutoNumConfigPage *autoNumPage = static_cast <ProjectAutoNumConfigPage*>(m_properties_dialog->pages.at(2));
auto *autoNumPage = static_cast <ProjectAutoNumConfigPage*>(m_properties_dialog->pages.at(2));
autoNumPage->changeToTab(3);
}