diff --git a/src/Gui/DlgRunExternal.cpp b/src/Gui/DlgRunExternal.cpp index 42fb48fa0b..f48721447d 100644 --- a/src/Gui/DlgRunExternal.cpp +++ b/src/Gui/DlgRunExternal.cpp @@ -116,7 +116,7 @@ void DlgRunExternal::finished (int exitCode, QProcess::ExitStatus exitStatus) ui->buttonAbort->setEnabled(false); } -void DlgRunExternal::on_chooseProgram_clicked() +void DlgRunExternal::onChooseProgramClicked() { QString fn; fn = QFileDialog::getOpenFileName(this, tr("Select a file"), ui->programPath->text()); diff --git a/src/Gui/DlgRunExternal.h b/src/Gui/DlgRunExternal.h index 2dbbd03372..2d0014027e 100644 --- a/src/Gui/DlgRunExternal.h +++ b/src/Gui/DlgRunExternal.h @@ -55,7 +55,7 @@ protected Q_SLOTS: virtual void abort(); virtual void advanced(); void finished (int exitCode, QProcess::ExitStatus exitStatus); - void on_chooseProgram_clicked(); + void onChooseProgramClicked(); protected: QProcess process; diff --git a/src/Gui/Widgets.cpp b/src/Gui/Widgets.cpp index 1379f52ebc..c1ffa091b3 100644 --- a/src/Gui/Widgets.cpp +++ b/src/Gui/Widgets.cpp @@ -261,16 +261,16 @@ void ActionSelector::keyPressEvent(QKeyEvent* event) switch (event->key()) { case Qt::Key_Right: - on_addButton_clicked(); + onAddButtonClicked(); break; case Qt::Key_Left: - on_removeButton_clicked(); + onRemoveButtonClicked(); break; case Qt::Key_Up: - on_upButton_clicked(); + onUpButtonClicked(); break; case Qt::Key_Down: - on_downButton_clicked(); + onDownButtonClicked(); break; default: event->ignore(); @@ -313,7 +313,7 @@ void ActionSelector::onItemDoubleClicked(QTreeWidgetItem * item, int column) } } -void ActionSelector::on_addButton_clicked() +void ActionSelector::onAddButtonClicked() { QTreeWidgetItem* item = availableWidget->currentItem(); if (item) { @@ -325,7 +325,7 @@ void ActionSelector::on_addButton_clicked() } } -void ActionSelector::on_removeButton_clicked() +void ActionSelector::onRemoveButtonClicked() { QTreeWidgetItem* item = selectedWidget->currentItem(); if (item) { @@ -337,7 +337,7 @@ void ActionSelector::on_removeButton_clicked() } } -void ActionSelector::on_upButton_clicked() +void ActionSelector::onUpButtonClicked() { QTreeWidgetItem* item = selectedWidget->currentItem(); if (item && item->isSelected()) { @@ -350,7 +350,7 @@ void ActionSelector::on_upButton_clicked() } } -void ActionSelector::on_downButton_clicked() +void ActionSelector::onDownButtonClicked() { QTreeWidgetItem* item = selectedWidget->currentItem(); if (item && item->isSelected()) { @@ -421,7 +421,7 @@ void AccelLineEdit::keyPressEvent (QKeyEvent * e) } // 4 keys are allowed for QShortcut - switch(keyPressedCount) { + switch (keyPressedCount) { case 4: keyPressedCount = 0; txtLine.clear(); @@ -482,7 +482,7 @@ void ModifierLineEdit::keyPressEvent (QKeyEvent * e) int key = e->key(); Qt::KeyboardModifiers state = e->modifiers(); - switch(key) { + switch (key) { case Qt::Key_Backspace: case Qt::Key_Delete: clear(); diff --git a/src/Gui/Widgets.h b/src/Gui/Widgets.h index 09b69388d6..e0f9b2a07c 100644 --- a/src/Gui/Widgets.h +++ b/src/Gui/Widgets.h @@ -103,10 +103,10 @@ private: void setButtonsEnabled(); private Q_SLOTS: - void on_addButton_clicked(); - void on_removeButton_clicked(); - void on_upButton_clicked(); - void on_downButton_clicked(); + void onAddButtonClicked(); + void onRemoveButtonClicked(); + void onUpButtonClicked(); + void onDownButtonClicked(); void onCurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*); void onItemDoubleClicked(QTreeWidgetItem * item, int column); diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index c07b3560a6..bff331c532 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -94,17 +94,17 @@ void finishDatumConstraint (Gui::Command* cmd, Sketcher::SketchObject* sketch, b // Get the latest constraint const std::vector &ConStr = sketch->Constraints.getValues(); - int lastConstraintIndex = ConStr.size() - 1; + auto lastConstraintIndex = ConStr.size() - 1; Sketcher::Constraint *constr = ConStr[lastConstraintIndex]; auto lastConstraintType = constr->Type; // Guess some reasonable distance for placing the datum text Gui::Document *doc = cmd->getActiveGuiDocument(); - float scaleFactor = 1.f; - float labelPosition = 0.f; - float labelPositionRandomness = 0.f; + float scaleFactor = 1.0; + double labelPosition = 0.0; + float labelPositionRandomness = 0.0; - if(lastConstraintType == Radius || lastConstraintType == Diameter) { + if (lastConstraintType == Radius || lastConstraintType == Diameter) { labelPosition = hGrp->GetFloat("RadiusDiameterConstraintDisplayBaseAngle", 15.0) * (M_PI / 180); // Get radius/diameter constraint display angle labelPositionRandomness = hGrp->GetFloat("RadiusDiameterConstraintDisplayAngleRandomness", 0.0) * (M_PI / 180); // Get randomness @@ -1996,7 +1996,7 @@ void CmdSketcherConstrainCoincident::activated(int iMsg) getIdsFromName(SubNames[i], Obj, GeoId2, PosId2); // check if the edge already has a Block constraint - if ( areBothPointsOrSegmentsFixed(Obj,GeoId1,GeoId2) ) { + if (areBothPointsOrSegmentsFixed(Obj,GeoId1,GeoId2)) { showNoConstraintBetweenFixedGeometry(); return; } @@ -2005,7 +2005,7 @@ void CmdSketcherConstrainCoincident::activated(int iMsg) // arise and substitute them with more appropriate counterparts, examples: // - coincidence + tangency on edge // - point on object + tangency on edge - if(substituteConstraintCombinations(Obj, GeoId1, PosId1,GeoId2, PosId2)) { + if (substituteConstraintCombinations(Obj, GeoId1, PosId1,GeoId2, PosId2)) { constraintsAdded = true; break; } @@ -2045,7 +2045,7 @@ void CmdSketcherConstrainCoincident::applyConstraint(std::vector &sel Sketcher::PointPos PosId1 = selSeq.at(0).PosId, PosId2 = selSeq.at(1).PosId; // check if the edge already has a Block constraint - if ( areBothPointsOrSegmentsFixed(Obj, GeoId1, GeoId2) ) { + if (areBothPointsOrSegmentsFixed(Obj, GeoId1, GeoId2)) { showNoConstraintBetweenFixedGeometry(); return; }