mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
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:
@@ -150,7 +150,7 @@ Terminal::~Terminal() {
|
||||
@return L'orientation actuelle de la Terminal.
|
||||
*/
|
||||
Qet::Orientation Terminal::orientation() const {
|
||||
if (Element *elt = qgraphicsitem_cast<Element *>(parentItem())) {
|
||||
if (auto *elt = qgraphicsitem_cast<Element *>(parentItem())) {
|
||||
// orientations actuelle et par defaut de l'element
|
||||
int ori_cur = elt -> orientation();
|
||||
if (ori_cur == 0) return(ori_);
|
||||
@@ -431,7 +431,7 @@ Terminal* Terminal::alignedWithTerminal() const
|
||||
QList <Terminal *> available_terminals;
|
||||
foreach (QGraphicsItem *qgi, qgi_list)
|
||||
{
|
||||
if (Terminal *tt = qgraphicsitem_cast <Terminal *> (qgi))
|
||||
if (auto *tt = qgraphicsitem_cast <Terminal *> (qgi))
|
||||
{
|
||||
//Call QET::lineContainsPoint to be sure the line intersect
|
||||
//the dock point and not an other part of terminal
|
||||
@@ -539,7 +539,7 @@ 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...
|
||||
Terminal *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
|
||||
auto *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
|
||||
if (!other_terminal) return;
|
||||
previous_terminal_ = other_terminal;
|
||||
|
||||
@@ -576,7 +576,7 @@ void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
|
||||
if (!qgi) return;
|
||||
|
||||
//Element must be a terminal
|
||||
Terminal *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
|
||||
auto *other_terminal = qgraphicsitem_cast<Terminal *>(qgi);
|
||||
if (!other_terminal) return;
|
||||
|
||||
other_terminal -> hovered_color_ = neutralColor;
|
||||
@@ -586,7 +586,7 @@ void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
|
||||
if (!canBeLinkedTo(other_terminal)) return;
|
||||
|
||||
//Create conductor
|
||||
Conductor *new_conductor = new Conductor(this, other_terminal);
|
||||
auto *new_conductor = new Conductor(this, other_terminal);
|
||||
|
||||
//Get all conductors at the same potential of new conductors
|
||||
QSet <Conductor *> conductors_list = new_conductor->relatedPotentialConductors();
|
||||
@@ -606,7 +606,7 @@ void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
|
||||
}
|
||||
|
||||
|
||||
QUndoCommand *undo = new QUndoCommand();
|
||||
auto *undo = new QUndoCommand();
|
||||
QUndoCommand *aic = new AddItemCommand<Conductor *>(new_conductor, diagram(), QPointF(), undo);
|
||||
undo->setText(aic->text());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user