From 86330282be7b429e39583a494481cffff9016761 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 20 Dec 2016 20:18:36 +0200 Subject: [PATCH 01/26] Fix potential vulnerabilities. --HG-- branch : develop --- src/libs/vdxf/dxflib/dl_dxf.cpp | 23 ++-- src/libs/vdxf/dxflib/dl_writer_ascii.cpp | 10 +- src/libs/vdxf/dxflib/strlcpy.h | 143 +++++++++++++++++++++++ src/libs/vdxf/vdxf.pri | 3 +- 4 files changed, 157 insertions(+), 22 deletions(-) create mode 100644 src/libs/vdxf/dxflib/strlcpy.h diff --git a/src/libs/vdxf/dxflib/dl_dxf.cpp b/src/libs/vdxf/dxflib/dl_dxf.cpp index 07c227692..5a245c236 100644 --- a/src/libs/vdxf/dxflib/dl_dxf.cpp +++ b/src/libs/vdxf/dxflib/dl_dxf.cpp @@ -49,6 +49,7 @@ #include "dl_creationinterface.h" #include "dl_entities.h" #include "iostream" +#include "strlcpy.h" /** * Default constructor. @@ -2554,10 +2555,7 @@ void DL_Dxf::endSequence(DL_CreationInterface* creationInterface) DL_WriterA* DL_Dxf::out(const char* file, DL_Codes::version version) { char* f = new char[strlen(file)+1]; -QT_WARNING_PUSH -QT_WARNING_DISABLE_MSVC(4996) - strcpy(f, file); -QT_WARNING_POP + strlcpy(f, file, sizeof(f)); this->version = version; DL_WriterA* dw = new DL_WriterA(f, version); @@ -5864,7 +5862,7 @@ int DL_Dxf::getLibVersion(const std::string& str) // double ret; // if (strchr(value, ',') != NULL) { // char* tmp = new char[strlen(value)+1]; -// strcpy(tmp, value); +// strlcpy(tmp, value, sizeof(tmp)); // DL_WriterA::strReplace(tmp, ',', '.'); // ret = atof(tmp); // delete[] tmp; @@ -5891,15 +5889,12 @@ void DL_Dxf::test() char* buf5 = new char[10]; char* buf6 = new char[10]; -QT_WARNING_PUSH -QT_WARNING_DISABLE_MSVC(4996) - strcpy(buf1, " 10\n"); - strcpy(buf2, "10"); - strcpy(buf3, "10\n"); - strcpy(buf4, " 10 \n"); - strcpy(buf5, " 10 \r"); - strcpy(buf6, "\t10 \n"); -QT_WARNING_POP + strlcpy(buf1, " 10\n", sizeof(buf1)); + strlcpy(buf2, "10", sizeof(buf2)); + strlcpy(buf3, "10\n", sizeof(buf3)); + strlcpy(buf4, " 10 \n", sizeof(buf4)); + strlcpy(buf5, " 10 \r", sizeof(buf5)); + strlcpy(buf6, "\t10 \n", sizeof(buf6)); // Try to avoid deleting array from an offset char* buf1Copy = buf1; diff --git a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp index 5f4e51839..bc5555f6e 100644 --- a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp +++ b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp @@ -66,17 +66,16 @@ void DL_WriterA::dxfReal(int gc, double value) const { char str[256]; QT_WARNING_PUSH -QT_WARNING_DISABLE_MSVC(4996) #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 408 QT_WARNING_DISABLE_GCC("-Wformat") #endif if (version==DL_Codes::AC1009_MIN) { - sprintf(str, "%.6lf", value); + snprintf(str, sizeof(str), "%.6lf", value); } else { - sprintf(str, "%.16lf", value); + snprintf(str, sizeof(str), "%.16lf", value); } QT_WARNING_POP @@ -132,10 +131,7 @@ void DL_WriterA::dxfInt(int gc, int value) const void DL_WriterA::dxfHex(int gc, int value) const { char str[12]; -QT_WARNING_PUSH -QT_WARNING_DISABLE_MSVC(4996) - sprintf(str, "%0X", value); -QT_WARNING_POP + snprintf(str, sizeof(str), "%0X", value); dxfString(gc, str); } diff --git a/src/libs/vdxf/dxflib/strlcpy.h b/src/libs/vdxf/dxflib/strlcpy.h new file mode 100644 index 000000000..f56914445 --- /dev/null +++ b/src/libs/vdxf/dxflib/strlcpy.h @@ -0,0 +1,143 @@ +/************************************************************************ + ** + ** @file strlcpy.h + ** @author Roman Telezhynskyi + ** @date December 20, 2016 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013-2016 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +/* + * Copyright (c) 1998 Todd C. Miller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef VALENTINA_STRLCPY_H +#define VALENTINA_STRLCPY_H + +/* This function comes from BSD */ +#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \ + !defined(__bsdi__) && !defined(__APPLE__) +#include +#include + +/* + * Copy src to string dst of size siz. At most siz-1 characters + * will be copied. Always NUL terminates (unless siz == 0). + * Returns strlen(src); if retval >= siz, truncation occurred. + */ +inline size_t strlcpy(char *dst, const char *src, size_t siz) +{ + char *d = dst; + const char *s = src; + size_t n = siz; + + /* Copy as many bytes as will fit */ + if (n != 0) + { + while (--n != 0) + { + if ((*d++ = *s++) == '\0') + { + break; + } + } + } + + /* Not enough room in dst, add NUL and traverse rest of src */ + if (n == 0) + { + if (siz != 0) + { + *d = '\0'; /* NUL-terminate dst */ + } + while (*s++) + ; + } + + return(s - src - 1); /* count does not include NUL */ +} + +/* + * Appends src to string dst of size siz (unlike strncat, siz is the + * full size of dst, not space left). At most siz-1 characters + * will be copied. Always NUL terminates (unless siz <= strlen(dst)). + * Returns strlen(src) + MIN(siz, strlen(initial dst)). + * If retval >= siz, truncation occurred. + */ +inline size_t strlcat(char *dst, const char *src, size_t siz) +{ + char *d = dst; + const char *s = src; + size_t n = siz; + size_t dlen; + + /* Find the end of dst and adjust bytes left but don't go past end */ + while (n-- != 0 && *d != '\0') + { + d++; + } + dlen = d - dst; + n = siz - dlen; + + if (n == 0) + { + return(dlen + strlen(s)); + } + while (*s != '\0') + { + if (n != 1) + { + *d++ = *s; + n--; + } + s++; + } + *d = '\0'; + + return(dlen + (s - src)); /* count does not include NUL */ +} + +#endif /* ! __*BSD__ */ +#endif // VALENTINA_STRLCPY_H diff --git a/src/libs/vdxf/vdxf.pri b/src/libs/vdxf/vdxf.pri index b2eb8ce71..81c17f424 100644 --- a/src/libs/vdxf/vdxf.pri +++ b/src/libs/vdxf/vdxf.pri @@ -24,4 +24,5 @@ HEADERS += \ $$PWD/dxflib/dl_writer_ascii.h \ $$PWD/vdxfengine.h \ $$PWD/vdxfpaintdevice.h \ - $$PWD/dxfdef.h + $$PWD/dxfdef.h \ + $$PWD/dxflib/strlcpy.h From ffab000e0fceb25ae4dd3def8162126682f560f5 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 20 Dec 2016 20:57:20 +0200 Subject: [PATCH 02/26] Remove empty statement. --HG-- branch : develop --- .../tape/dialogs/configpages/tapepathpage.cpp | 6 +- src/app/tape/dialogs/dialogabouttape.cpp | 2 +- src/app/tape/dialogs/dialogexporttocsv.cpp | 2 +- src/app/tape/mapplication.cpp | 2 +- src/app/tape/tmainwindow.cpp | 14 +-- src/app/valentina/core/vapplication.cpp | 2 +- .../core/vtooloptionspropertybrowser.cpp | 48 ++++---- .../dialogs/configpages/configurationpage.cpp | 2 +- .../dialogs/configpages/pathpage.cpp | 6 +- src/app/valentina/dialogs/dialogaboutapp.cpp | 2 +- src/app/valentina/dialogs/dialoghistory.cpp | 24 ++-- .../valentina/dialogs/dialogincrements.cpp | 10 +- .../dialogs/dialoglayoutprogress.cpp | 2 +- .../valentina/dialogs/dialognewpattern.cpp | 2 +- .../dialogs/dialogpatternproperties.cpp | 6 +- .../dialogs/dialogpatternxmledit.cpp | 14 +-- .../valentina/dialogs/dialogsavelayout.cpp | 4 +- src/app/valentina/mainwindow.cpp | 28 ++--- src/app/valentina/mainwindowsnogui.cpp | 4 +- src/app/valentina/xml/vpattern.cpp | 114 +++++++++--------- src/libs/ifc/xml/vabstractpattern.cpp | 4 +- src/libs/vformat/vmeasurements.cpp | 4 +- src/libs/vlayout/vposter.cpp | 4 +- src/libs/vmisc/def.cpp | 4 +- src/libs/vmisc/vabstractapplication.cpp | 2 +- src/libs/vmisc/vtablesearch.cpp | 6 +- src/libs/vpatterndb/variables/varcradius.cpp | 2 +- src/libs/vpatterndb/variables/vcurveangle.cpp | 2 +- .../vpatterndb/variables/vcurveclength.cpp | 2 +- .../vpatterndb/variables/vcurvelength.cpp | 2 +- .../variables/vellipticalarcradius.cpp | 2 +- src/libs/vpatterndb/variables/vlineangle.cpp | 8 +- src/libs/vpatterndb/variables/vlinelength.cpp | 8 +- src/libs/vpatterndb/vcontainer.cpp | 8 +- src/libs/vpatterndb/vcontainer.h | 6 +- .../support/dialogeditwrongformula.cpp | 8 +- .../vtools/dialogs/tools/dialogalongline.cpp | 10 +- src/libs/vtools/dialogs/tools/dialogarc.cpp | 12 +- .../dialogs/tools/dialogarcwithlength.cpp | 10 +- .../vtools/dialogs/tools/dialogbisector.cpp | 12 +- .../dialogs/tools/dialogcubicbezier.cpp | 6 +- .../dialogs/tools/dialogcubicbezierpath.cpp | 8 +- .../tools/dialogcurveintersectaxis.cpp | 16 +-- .../vtools/dialogs/tools/dialogcutarc.cpp | 6 +- .../vtools/dialogs/tools/dialogcutspline.cpp | 6 +- .../dialogs/tools/dialogcutsplinepath.cpp | 6 +- .../vtools/dialogs/tools/dialogdetail.cpp | 24 ++-- .../dialogs/tools/dialogellipticalarc.cpp | 16 +-- .../vtools/dialogs/tools/dialogendline.cpp | 14 +-- .../dialogs/tools/dialogflippingbyaxis.cpp | 18 +-- .../dialogs/tools/dialogflippingbyline.cpp | 16 +-- .../vtools/dialogs/tools/dialogheight.cpp | 10 +- src/libs/vtools/dialogs/tools/dialogline.cpp | 6 +- .../dialogs/tools/dialoglineintersect.cpp | 14 +-- .../dialogs/tools/dialoglineintersectaxis.cpp | 18 +-- src/libs/vtools/dialogs/tools/dialogmove.cpp | 18 +-- .../vtools/dialogs/tools/dialognormal.cpp | 12 +- .../tools/dialogpointfromarcandtangent.cpp | 10 +- .../tools/dialogpointfromcircleandtangent.cpp | 14 +-- .../dialogs/tools/dialogpointofcontact.cpp | 12 +- .../tools/dialogpointofintersection.cpp | 8 +- .../tools/dialogpointofintersectionarcs.cpp | 10 +- .../dialogpointofintersectioncircles.cpp | 16 +-- .../tools/dialogpointofintersectioncurves.cpp | 14 +-- .../vtools/dialogs/tools/dialogrotation.cpp | 22 ++-- .../dialogs/tools/dialogshoulderpoint.cpp | 12 +- .../vtools/dialogs/tools/dialogspline.cpp | 14 +-- .../vtools/dialogs/tools/dialogsplinepath.cpp | 32 ++--- src/libs/vtools/dialogs/tools/dialogtool.cpp | 90 +++++++------- src/libs/vtools/dialogs/tools/dialogtool.h | 12 +- .../vtools/dialogs/tools/dialogtriangle.cpp | 12 +- .../vtools/dialogs/tools/dialogtruedarts.cpp | 26 ++-- .../flipping/vtoolflippingbyaxis.cpp | 14 +-- .../flipping/vtoolflippingbyline.cpp | 14 +-- .../operation/vabstractoperation.cpp | 36 +++--- .../drawTools/operation/vabstractoperation.h | 4 +- .../tools/drawTools/operation/vtoolmove.cpp | 14 +-- .../drawTools/operation/vtoolrotation.cpp | 14 +-- .../drawTools/toolcurve/vabstractspline.h | 16 +-- .../tools/drawTools/toolcurve/vtoolarc.cpp | 24 ++-- .../toolcurve/vtoolarcwithlength.cpp | 24 ++-- .../drawTools/toolcurve/vtoolcubicbezier.cpp | 18 +-- .../toolcurve/vtoolcubicbezierpath.cpp | 18 +-- .../toolcurve/vtoolellipticalarc.cpp | 28 ++--- .../tools/drawTools/toolcurve/vtoolspline.cpp | 20 +-- .../drawTools/toolcurve/vtoolsplinepath.cpp | 20 +-- .../tooldoublepoint/vtooldoublepoint.cpp | 4 +- .../tooldoublepoint/vtooltruedarts.cpp | 14 +-- .../toolsinglepoint/toolcut/vtoolcutarc.cpp | 14 +-- .../toolcut/vtoolcutspline.cpp | 14 +-- .../toolcut/vtoolcutsplinepath.cpp | 24 ++-- .../toollinepoint/vtoolalongline.cpp | 10 +- .../toollinepoint/vtoolbisector.cpp | 14 +-- .../toollinepoint/vtoolcurveintersectaxis.cpp | 18 +-- .../toollinepoint/vtoolendline.cpp | 14 +-- .../toollinepoint/vtoolheight.cpp | 14 +-- .../toollinepoint/vtoollineintersectaxis.cpp | 14 +-- .../toollinepoint/vtoolnormal.cpp | 14 +-- .../toollinepoint/vtoolshoulderpoint.cpp | 14 +-- .../toolsinglepoint/vtoolbasepoint.cpp | 14 +-- .../toolsinglepoint/vtoollineintersect.cpp | 14 +-- .../vtoolpointfromarcandtangent.cpp | 14 +-- .../vtoolpointfromcircleandtangent.cpp | 14 +-- .../toolsinglepoint/vtoolpointofcontact.cpp | 14 +-- .../vtoolpointofintersection.cpp | 14 +-- .../vtoolpointofintersectionarcs.cpp | 14 +-- .../vtoolpointofintersectioncircles.cpp | 14 +-- .../vtoolpointofintersectioncurves.cpp | 14 +-- .../toolsinglepoint/vtoolsinglepoint.cpp | 2 +- .../toolsinglepoint/vtooltriangle.cpp | 14 +-- .../drawTools/toolpoint/vabstractpoint.h | 4 +- src/libs/vtools/tools/drawTools/vdrawtool.h | 10 +- src/libs/vtools/tools/drawTools/vtoolline.cpp | 20 +-- .../vtools/tools/nodeDetails/vnodearc.cpp | 2 +- .../tools/nodeDetails/vnodeellipticalarc.cpp | 2 +- .../vtools/tools/nodeDetails/vnodepoint.cpp | 2 +- .../vtools/tools/nodeDetails/vnodespline.cpp | 2 +- .../tools/nodeDetails/vnodesplinepath.cpp | 2 +- src/libs/vtools/tools/vabstracttool.cpp | 8 +- src/libs/vtools/tools/vtooldetail.cpp | 18 +-- src/libs/vtools/tools/vtooluniondetails.cpp | 14 +-- .../vtools/undocommands/addpatternpiece.cpp | 2 +- src/libs/vtools/undocommands/deletedetail.cpp | 4 +- .../undocommands/label/movedoublelabel.cpp | 2 +- .../vtools/undocommands/label/movelabel.cpp | 2 +- .../undocommands/label/operationmovelabel.cpp | 2 +- src/libs/vtools/undocommands/movedetail.cpp | 4 +- src/libs/vtools/undocommands/movespline.cpp | 4 +- .../vtools/undocommands/movesplinepath.cpp | 4 +- src/libs/vtools/undocommands/movespoint.cpp | 4 +- src/libs/vtools/undocommands/renamepp.cpp | 4 +- .../vtools/undocommands/savedetailoptions.cpp | 2 +- .../vtools/undocommands/savetooloptions.cpp | 2 +- src/libs/vtools/undocommands/vundocommand.cpp | 2 +- .../line/operation/visoperation.cpp | 2 +- .../vtools/visualization/line/visline.cpp | 2 +- .../vtools/visualization/line/vistoolline.cpp | 2 +- .../line/vistoolpointofintersectionarcs.cpp | 2 +- .../vistoolpointofintersectioncircles.cpp | 2 +- .../visualization/line/vistooltriangle.cpp | 2 +- .../path/vistoolcutsplinepath.cpp | 6 +- .../path/vistoolpointofintersectioncurves.cpp | 2 +- .../vtools/visualization/visualization.cpp | 8 +- src/libs/vtools/visualization/visualization.h | 4 +- src/libs/vwidgets/vabstractsimple.h | 2 +- src/libs/vwidgets/vcontrolpointspline.cpp | 2 +- src/libs/vwidgets/vgraphicssimpletextitem.cpp | 2 +- src/libs/vwidgets/vmaingraphicsview.cpp | 20 +-- src/libs/vwidgets/vwidgetpopup.cpp | 2 +- 149 files changed, 849 insertions(+), 849 deletions(-) diff --git a/src/app/tape/dialogs/configpages/tapepathpage.cpp b/src/app/tape/dialogs/configpages/tapepathpage.cpp index 0aff9cf42..659e03ec6 100644 --- a/src/app/tape/dialogs/configpages/tapepathpage.cpp +++ b/src/app/tape/dialogs/configpages/tapepathpage.cpp @@ -54,7 +54,7 @@ TapePathPage::TapePathPage(QWidget *parent) pathGroup(nullptr) { QGroupBox *pathGroup = PathGroup(); - SCASSERT(pathGroup != nullptr); + SCASSERT(pathGroup != nullptr) QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(pathGroup); @@ -76,7 +76,7 @@ void TapePathPage::DefaultPath() { const int row = pathTable->currentRow(); QTableWidgetItem *item = pathTable->item(row, 1); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) switch (row) { @@ -102,7 +102,7 @@ void TapePathPage::EditPath() { const int row = pathTable->currentRow(); QTableWidgetItem *item = pathTable->item(row, 1); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) QString path; switch (row) diff --git a/src/app/tape/dialogs/dialogabouttape.cpp b/src/app/tape/dialogs/dialogabouttape.cpp index 808c6a338..6bcc8e0b9 100644 --- a/src/app/tape/dialogs/dialogabouttape.cpp +++ b/src/app/tape/dialogs/dialogabouttape.cpp @@ -112,7 +112,7 @@ void DialogAboutTape::showEvent(QShowEvent *event) //--------------------------------------------------------------------------------------------------------------------- void DialogAboutTape::FontPointSize(QWidget *w, int pointSize) { - SCASSERT(w != nullptr); + SCASSERT(w != nullptr) QFont font = w->font(); font.setPointSize(pointSize); diff --git a/src/app/tape/dialogs/dialogexporttocsv.cpp b/src/app/tape/dialogs/dialogexporttocsv.cpp index b00b67bf1..e0e2024b0 100644 --- a/src/app/tape/dialogs/dialogexporttocsv.cpp +++ b/src/app/tape/dialogs/dialogexporttocsv.cpp @@ -56,7 +56,7 @@ DialogExportToCSV::DialogExportToCSV(QWidget *parent) SetSeparator(qApp->TapeSettings()->GetCSVSeparator()); QPushButton *bDefaults = ui->buttonBox->button(QDialogButtonBox::RestoreDefaults); - SCASSERT(bDefaults != nullptr); + SCASSERT(bDefaults != nullptr) connect(bDefaults, &QPushButton::clicked, [this]() { ui->checkBoxWithHeader->setChecked(qApp->TapeSettings()->GetDefCSVWithHeader()); diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index cad65dc98..78ec2335b 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -479,7 +479,7 @@ void MApplication::OpenSettings() //--------------------------------------------------------------------------------------------------------------------- VTapeSettings *MApplication::TapeSettings() { - SCASSERT(settings != nullptr); + SCASSERT(settings != nullptr) return qobject_cast(settings); } diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 57f57c10e..5d1b11cd9 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1446,8 +1446,8 @@ void TMainWindow::ShowMDiagram(const QString &name) //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::DeployFormula() { - SCASSERT(ui->plainTextEditFormula != nullptr); - SCASSERT(ui->pushButtonGrow != nullptr); + SCASSERT(ui->plainTextEditFormula != nullptr) + SCASSERT(ui->pushButtonGrow != nullptr) const QTextCursor cursor = ui->plainTextEditFormula->textCursor(); @@ -1844,7 +1844,7 @@ void TMainWindow::SetupMenu() //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::InitWindow() { - SCASSERT(m != nullptr); + SCASSERT(m != nullptr) ui->labelToolTip->setVisible(false); ui->tabWidget->setVisible(true); ui->dockWidgetDiagram->setVisible(dockDiagramVisible); @@ -2052,7 +2052,7 @@ void TMainWindow::ShowUnits() //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::ShowHeaderUnits(QTableWidget *table, int column, const QString &unit) { - SCASSERT(table != nullptr); + SCASSERT(table != nullptr) QString header = table->horizontalHeaderItem(column)->text(); const int index = header.indexOf(QLatin1String("(")); @@ -2819,7 +2819,7 @@ void TMainWindow::UpdateRecentFileActions() //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::CreateWindowMenu(QMenu *menu) { - SCASSERT(menu != nullptr); + SCASSERT(menu != nullptr) QAction *action = menu->addAction(tr("&New Window")); connect(action, &QAction::triggered, [this]() @@ -2990,7 +2990,7 @@ void TMainWindow::InitUnits() //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::InitComboBoxUnits() { - SCASSERT(comboBoxUnits != nullptr); + SCASSERT(comboBoxUnits != nullptr) comboBoxUnits->addItem(VDomDocument::UnitsToStr(Unit::Cm, true), QVariant(static_cast(Unit::Cm))); comboBoxUnits->addItem(VDomDocument::UnitsToStr(Unit::Mm, true), QVariant(static_cast(Unit::Mm))); comboBoxUnits->addItem(VDomDocument::UnitsToStr(Unit::Inch, true), QVariant(static_cast(Unit::Inch))); @@ -2999,7 +2999,7 @@ void TMainWindow::InitComboBoxUnits() //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::InitGender(QComboBox *gender) { - SCASSERT(gender != nullptr); + SCASSERT(gender != nullptr) gender->addItem(tr("unknown", "gender"), QVariant(static_cast(GenderType::Unknown))); gender->addItem(tr("male", "gender"), QVariant(static_cast(GenderType::Male))); gender->addItem(tr("female", "gender"), QVariant(static_cast(GenderType::Female))); diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index 8c9130e04..31e54bbf2 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -683,7 +683,7 @@ void VApplication::OpenSettings() //--------------------------------------------------------------------------------------------------------------------- VSettings *VApplication::ValentinaSettings() { - SCASSERT(settings != nullptr); + SCASSERT(settings != nullptr) return qobject_cast(settings); } diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp index e32df2705..0d1f90cfc 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp +++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp @@ -873,7 +873,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property) const QString id = propertyToId[property]; VToolEndLine *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -906,7 +906,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property) const QString id = propertyToId[property]; VToolAlongLine *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -936,7 +936,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property) const QString id = propertyToId[property]; VToolArc *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 8: // AttrRadius @@ -966,7 +966,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *propert const QString id = propertyToId[property]; VToolArcWithLength *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 8: // AttrRadius @@ -996,7 +996,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property) const QString id = propertyToId[property]; VToolBisector *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1048,7 +1048,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property) const QString id = propertyToId[property]; VToolCutArc *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1072,7 +1072,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property) const QString id = propertyToId[property]; VToolCutSpline *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1096,7 +1096,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *propert const QString id = propertyToId[property]; VToolCutSplinePath *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1120,7 +1120,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property) const QString id = propertyToId[property]; VToolHeight *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1147,7 +1147,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property) const QString id = propertyToId[property]; VToolLine *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 3: // AttrTypeLine @@ -1190,7 +1190,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property) const QString id = propertyToId[property]; VToolNormal *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 4: // AttrLength @@ -1223,7 +1223,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *proper const QString id = propertyToId[property]; VToolPointOfContact *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 8: // AttrRadius @@ -1291,7 +1291,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProp const QString id = propertyToId[property]; VToolPointOfIntersectionCircles *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1355,7 +1355,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPrope const QString id = propertyToId[property]; VToolPointFromCircleAndTangent *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1410,7 +1410,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *propert const QString id = propertyToId[property]; VToolShoulderPoint *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 4: // AttrLength @@ -1440,7 +1440,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property) const QString id = propertyToId[property]; auto i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) VSpline spl = i->getSpline(); const VFormula f = value.value(); @@ -1496,7 +1496,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VProperty *property) const QString id = propertyToId[property]; auto i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { @@ -1521,7 +1521,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property) const QString id = propertyToId[property]; VToolSplinePath *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1545,7 +1545,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VProperty *prope const QString id = propertyToId[property]; VToolCubicBezierPath *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1588,7 +1588,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *pro const QString id = propertyToId[property]; VToolLineIntersectAxis *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1618,7 +1618,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *pr const QString id = propertyToId[property]; VToolCurveIntersectAxis *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 0: // AttrName @@ -1648,7 +1648,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VProperty *property) const QString id = propertyToId[property]; VToolRotation *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 38: // AttrSuffix @@ -1672,7 +1672,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolMove(VProperty *property) const QString id = propertyToId[property]; VToolMove *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 38: // AttrSuffix @@ -1743,7 +1743,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VProperty *propert const QString id = propertyToId[property]; VToolEllipticalArc *i = qgraphicsitem_cast(currentItem); - SCASSERT(i != nullptr); + SCASSERT(i != nullptr) switch (PropertiesList().indexOf(id)) { case 40://AttrRadius1 diff --git a/src/app/valentina/dialogs/configpages/configurationpage.cpp b/src/app/valentina/dialogs/configpages/configurationpage.cpp index e0d2428b8..306c2262c 100644 --- a/src/app/valentina/dialogs/configpages/configurationpage.cpp +++ b/src/app/valentina/dialogs/configpages/configurationpage.cpp @@ -106,7 +106,7 @@ void ConfigurationPage::Apply() settings->SetAutosaveTime(autoTime->value()); QTimer *autoSaveTimer = qApp->getAutoSaveTimer(); - SCASSERT(autoSaveTimer); + SCASSERT(autoSaveTimer) autoSaveCheck->isChecked() ? autoSaveTimer->start(autoTime->value()*60000) : autoSaveTimer->stop(); diff --git a/src/app/valentina/dialogs/configpages/pathpage.cpp b/src/app/valentina/dialogs/configpages/pathpage.cpp index 97128b929..9c9dd34e1 100644 --- a/src/app/valentina/dialogs/configpages/pathpage.cpp +++ b/src/app/valentina/dialogs/configpages/pathpage.cpp @@ -51,7 +51,7 @@ PathPage::PathPage(QWidget *parent) : QWidget(parent), defaultButton(nullptr), editButton(nullptr), pathTable(nullptr), pathGroup(nullptr) { QGroupBox *pathGroup = PathGroup(); - SCASSERT(pathGroup != nullptr); + SCASSERT(pathGroup != nullptr) QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(pathGroup); @@ -75,7 +75,7 @@ void PathPage::DefaultPath() { const int row = pathTable->currentRow(); QTableWidgetItem *item = pathTable->item(row, 1); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) switch (row) { @@ -103,7 +103,7 @@ void PathPage::EditPath() { const int row = pathTable->currentRow(); QTableWidgetItem *item = pathTable->item(row, 1); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) QString path; switch (row) diff --git a/src/app/valentina/dialogs/dialogaboutapp.cpp b/src/app/valentina/dialogs/dialogaboutapp.cpp index 1e5c3683d..987065a9b 100644 --- a/src/app/valentina/dialogs/dialogaboutapp.cpp +++ b/src/app/valentina/dialogs/dialogaboutapp.cpp @@ -110,7 +110,7 @@ void DialogAboutApp::showEvent(QShowEvent *event) //--------------------------------------------------------------------------------------------------------------------- void DialogAboutApp::FontPointSize(QWidget *w, int pointSize) { - SCASSERT(w != nullptr); + SCASSERT(w != nullptr) QFont font = w->font(); font.setPointSize(pointSize); diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index 34a779bdb..f2ff02db3 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -190,7 +190,7 @@ void DialogHistory::FillTable() { cursorRow = CursorRow(); QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setIcon(QIcon("://icon/32x32/put_after.png")); } ui->tableWidget->resizeColumnsToContents(); @@ -270,25 +270,25 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::Spline: { const QSharedPointer spl = data->GeometricObject(tool.getId()); - SCASSERT(not spl.isNull()); + SCASSERT(not spl.isNull()) return spl->NameForHistory(tr("Curve")); } case Tool::CubicBezier: { const QSharedPointer spl = data->GeometricObject(tool.getId()); - SCASSERT(not spl.isNull()); + SCASSERT(not spl.isNull()) return spl->NameForHistory(tr("Cubic bezier curve")); } case Tool::Arc: { const QSharedPointer arc = data->GeometricObject(tool.getId()); - SCASSERT(not arc.isNull()); + SCASSERT(not arc.isNull()) return arc->NameForHistory(tr("Arc")); } case Tool::ArcWithLength: { const QSharedPointer arc = data->GeometricObject(tool.getId()); - SCASSERT(not arc.isNull()); + SCASSERT(not arc.isNull()) return tr("%1 with length %2") .arg(arc->NameForHistory(tr("Arc"))) .arg(arc->GetLength()); @@ -296,13 +296,13 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::SplinePath: { const QSharedPointer splPath = data->GeometricObject(tool.getId()); - SCASSERT(not splPath.isNull()); + SCASSERT(not splPath.isNull()) return splPath->NameForHistory(tr("Spline path")); } case Tool::CubicBezierPath: { const QSharedPointer splPath = data->GeometricObject(tool.getId()); - SCASSERT(not splPath.isNull()); + SCASSERT(not splPath.isNull()) return splPath->NameForHistory(tr("Cubic bezier curve path")); } case Tool::PointOfContact: @@ -330,7 +330,7 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::CutArc: { const QSharedPointer arc = data->GeometricObject(AttrUInt(domElem, AttrArc)); - SCASSERT(not arc.isNull()); + SCASSERT(not arc.isNull()) return tr("%1 - cut %2") .arg(PointName(tool.getId())) .arg(arc->NameForHistory(tr("arc"))); @@ -339,7 +339,7 @@ QString DialogHistory::Record(const VToolRecord &tool) { const quint32 splineId = AttrUInt(domElem, VToolCutSpline::AttrSpline); const QSharedPointer spl = data->GeometricObject(splineId); - SCASSERT(not spl.isNull()); + SCASSERT(not spl.isNull()) return tr("%1 - cut %2") .arg(PointName(tool.getId())) .arg(spl->NameForHistory(tr("curve"))); @@ -349,7 +349,7 @@ QString DialogHistory::Record(const VToolRecord &tool) const quint32 splinePathId = AttrUInt(domElem, VToolCutSplinePath::AttrSplinePath); const QSharedPointer splPath = data->GeometricObject(splinePathId); - SCASSERT(not splPath.isNull()); + SCASSERT(not splPath.isNull()) return tr("%1 - cut %2") .arg(PointName(tool.getId())) .arg(splPath->NameForHistory(tr("curve path"))); @@ -382,7 +382,7 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::EllipticalArc: { const QSharedPointer elArc = data->GeometricObject(tool.getId()); - SCASSERT(not elArc.isNull()); + SCASSERT(not elArc.isNull()) return tr("%1 with length %2") .arg(elArc->NameForHistory(tr("Elliptical arc"))) .arg(elArc->GetLength()); @@ -497,7 +497,7 @@ void DialogHistory::RetranslateUi() UpdateHistory(); QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setIcon(QIcon("")); cursorRow = currentRow; diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index 93ba69a91..7bebdfb62 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -184,7 +184,7 @@ void DialogIncrements::FillIncrements() template void DialogIncrements::FillTable(const QMap &varTable, QTableWidget *table) { - SCASSERT(table != nullptr); + SCASSERT(table != nullptr) qint32 currentRow = -1; QMapIterator i(varTable); @@ -270,7 +270,7 @@ void DialogIncrements::ShowUnits() //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column, const QString &unit) { - SCASSERT(table != nullptr); + SCASSERT(table != nullptr) const QString header = table->horizontalHeaderItem(column)->text(); const QString unitHeader = QString("%1 (%2)").arg(header).arg(unit); @@ -280,7 +280,7 @@ void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column, const QS //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::AddCell(QTableWidget *table, const QString &text, int row, int column, int aligment, bool ok) { - SCASSERT(table != nullptr); + SCASSERT(table != nullptr) QTableWidgetItem *item = new QTableWidgetItem(text); item->setTextAlignment(aligment); @@ -664,8 +664,8 @@ void DialogIncrements::SaveIncrFormula() //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::DeployFormula() { - SCASSERT(ui->plainTextEditFormula != nullptr); - SCASSERT(ui->pushButtonGrow != nullptr); + SCASSERT(ui->plainTextEditFormula != nullptr) + SCASSERT(ui->pushButtonGrow != nullptr) const QTextCursor cursor = ui->plainTextEditFormula->textCursor(); diff --git a/src/app/valentina/dialogs/dialoglayoutprogress.cpp b/src/app/valentina/dialogs/dialoglayoutprogress.cpp index 2419403f5..b22d0b0de 100644 --- a/src/app/valentina/dialogs/dialoglayoutprogress.cpp +++ b/src/app/valentina/dialogs/dialoglayoutprogress.cpp @@ -54,7 +54,7 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) movie->start (); QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel); - SCASSERT(bCancel != nullptr); + SCASSERT(bCancel != nullptr) connect(bCancel, &QPushButton::clicked, [this](){emit Abort();}); setModal(true); diff --git a/src/app/valentina/dialogs/dialognewpattern.cpp b/src/app/valentina/dialogs/dialognewpattern.cpp index fa7e4882a..e71185f69 100644 --- a/src/app/valentina/dialogs/dialognewpattern.cpp +++ b/src/app/valentina/dialogs/dialognewpattern.cpp @@ -85,7 +85,7 @@ void DialogNewPattern::CheckState() } QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagName); } diff --git a/src/app/valentina/dialogs/dialogpatternproperties.cpp b/src/app/valentina/dialogs/dialogpatternproperties.cpp index c406548cf..995e039da 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.cpp +++ b/src/app/valentina/dialogs/dialogpatternproperties.cpp @@ -69,7 +69,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte ui->lineEditAuthor->setClearButtonEnabled(true); #endif - SCASSERT(doc != nullptr); + SCASSERT(doc != nullptr) qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c()); @@ -108,7 +108,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte &DialogPatternProperties::Apply); QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel); - SCASSERT(bCancel != nullptr); + SCASSERT(bCancel != nullptr) connect(bCancel, &QPushButton::clicked, this, &DialogPatternProperties::close); ui->tabWidget->setCurrentIndex(0); @@ -689,7 +689,7 @@ void DialogPatternProperties::SetOptions(const QMap &option) template void DialogPatternProperties::InitComboBox(QComboBox *box, const QMap &option) { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->clear(); diff --git a/src/app/valentina/dialogs/dialogpatternxmledit.cpp b/src/app/valentina/dialogs/dialogpatternxmledit.cpp index d2509f6e1..5defcf7ec 100644 --- a/src/app/valentina/dialogs/dialogpatternxmledit.cpp +++ b/src/app/valentina/dialogs/dialogpatternxmledit.cpp @@ -130,7 +130,7 @@ bool DialogPatternXmlEdit::ApplyNodeChange(QDomNode domElement, QString name, QS bool DialogPatternXmlEdit::ApplyNodeAdd(QDomNode domElement, VXMLTreeElement* treeElement, QString name, QString value) { QDomElement newnode = domElement.ownerDocument().createElement(name); - //SCASSERT(newnode != nullptr); + //SCASSERT(newnode != nullptr) newnode.setNodeValue(value); domElement.appendChild(newnode); treeElement->SetDocNode(newnode); @@ -285,7 +285,7 @@ bool DialogPatternXmlEdit::DeleteNodeAndSons(VXMLTreeElement * currentNode, bool } if (index < 0) { - SCASSERT(index==0); + SCASSERT(index==0) return false; } parent->removeRow(index); @@ -321,7 +321,7 @@ DialogPatternXmlEdit::ChangesStackElement* DialogPatternXmlEdit::CreateStackElem //--------------------------------------------------------------------------------------------------------------------- bool DialogPatternXmlEdit::UndoChange(DialogPatternXmlEdit::ChangesStackElement* current) { - SCASSERT(current != nullptr); + SCASSERT(current != nullptr) VXMLTreeElement * currentNode = current->element; @@ -374,7 +374,7 @@ bool DialogPatternXmlEdit::UndoChange(DialogPatternXmlEdit::ChangesStackElement* } if (index < 0) { - SCASSERT(index==0); + SCASSERT(index==0) return false; } parent->removeRow(index); @@ -612,7 +612,7 @@ void DialogPatternXmlEdit::RemoveChangeStackElement(ChangesStackElement* elmt) } if (index->next == nullptr) { - SCASSERT(index->next != nullptr); + SCASSERT(index->next != nullptr) return; } delete index->next->newText; @@ -813,7 +813,7 @@ void DialogPatternXmlEdit::ButtonSetClicked() { // If node was created or edited previously, rewrite if (this->currentNodeEditedStatus == DialogPatternXmlEdit::ChangeTypeDelete) { // You shouldn't be able to edit a deleted node... - SCASSERT(this->currentNodeEditedStatus != DialogPatternXmlEdit::ChangeTypeDelete); + SCASSERT(this->currentNodeEditedStatus != DialogPatternXmlEdit::ChangeTypeDelete) ClearEditData(); return; } @@ -933,7 +933,7 @@ void DialogPatternXmlEdit::BaseSelectionChanged(int value) ui->pushButton_Apply_Changes->setEnabled(false); index = ui->comboBox_Base_Selection->itemData(value).toInt(); //.convert(QVariant::Int); - SCASSERT(value < rootBasesNum); + SCASSERT(value < rootBasesNum) // QMessageBox::information(this, "test", QString("%1:%2").arg(value).arg(index)); // Clear all tree info and nodes diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index c6300a2f3..ab9a2505d 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -59,7 +59,7 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget * qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c()); QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(false); #if QT_VERSION > QT_VERSION_CHECK(5, 1, 0) @@ -229,7 +229,7 @@ void DialogSaveLayout::Save() void DialogSaveLayout::PathChanged(const QString &text) { QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) QPalette palette = ui->lineEditPath->palette(); diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 2aca6bd2c..488977290 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -550,7 +550,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons dialogTool = new Dialog(pattern, 0, this); VMainGraphicsScene *scene = qobject_cast(currentScene); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) connect(scene, &VMainGraphicsScene::ChoosedObject, dialogTool.data(), &DialogTool::ChosenObject); connect(scene, &VMainGraphicsScene::SelectedObject, dialogTool.data(), &DialogTool::SelectedObject); @@ -609,7 +609,7 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur } VMainGraphicsScene *scene = qobject_cast(currentScene); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) connect(scene, &VMainGraphicsScene::ChoosedObject, dialogTool.data(), &DialogTool::ChosenObject); connect(scene, &VMainGraphicsScene::SelectedObject, dialogTool.data(), &DialogTool::SelectedObject); @@ -635,11 +635,11 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur template void MainWindow::ClosedDialog(int result) { - SCASSERT(not dialogTool.isNull()); + SCASSERT(not dialogTool.isNull()) if (result == QDialog::Accepted) { VMainGraphicsScene *scene = qobject_cast(currentScene); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) QGraphicsItem *tool = dynamic_cast(DrawTool::Create(dialogTool, scene, doc, pattern)); ui->view->itemClicked(tool); @@ -655,14 +655,14 @@ void MainWindow::ClosedDialog(int result) template void MainWindow::ClosedDialogWithApply(int result) { - SCASSERT(not dialogTool.isNull()); + SCASSERT(not dialogTool.isNull()) if (result == QDialog::Accepted) { // Only create tool if not already created with apply if (dialogTool->GetAssociatedTool() == nullptr) { VMainGraphicsScene *scene = qobject_cast(currentScene); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) dialogTool->SetAssociatedTool( dynamic_cast (DrawTool::Create(dialogTool, scene, doc, pattern))); @@ -673,7 +673,7 @@ void MainWindow::ClosedDialogWithApply(int result) vtool->FullUpdateFromGuiApply(); } } - SCASSERT(not dialogTool.isNull()); + SCASSERT(not dialogTool.isNull()) QGraphicsItem *tool = dynamic_cast(dialogTool->GetAssociatedTool()); ui->view->itemClicked(tool); if (dialogTool->GetAssociatedTool() != nullptr) @@ -701,13 +701,13 @@ void MainWindow::ClosedDialogWithApply(int result) template void MainWindow::ApplyDialog() { - SCASSERT(not dialogTool.isNull()); + SCASSERT(not dialogTool.isNull()) // Only create tool if not already created with apply if (dialogTool->GetAssociatedTool() == nullptr) { VMainGraphicsScene *scene = qobject_cast(currentScene); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) dialogTool->SetAssociatedTool( static_cast (DrawTool::Create(dialogTool, scene, doc, pattern))); @@ -715,7 +715,7 @@ void MainWindow::ApplyDialog() else { // Or update associated tool with data VDrawTool * vtool= static_cast(dialogTool->GetAssociatedTool()); - SCASSERT(vtool != nullptr); + SCASSERT(vtool != nullptr) vtool->FullUpdateFromGuiApply(); } } @@ -1091,11 +1091,11 @@ void MainWindow::ToolMove(bool checked) //--------------------------------------------------------------------------------------------------------------------- void MainWindow::ClosedDialogGroup(int result) { - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) if (result == QDialog::Accepted) { DialogGroup *dialog = qobject_cast(dialogTool); - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) const QDomElement group = doc->CreateGroup(pattern->getNextId(), dialog->GetName(), dialog->GetGroup()); if (not group.isNull()) { @@ -2039,7 +2039,7 @@ void MainWindow::SaveCurrentScene() if (mode == Draw::Calculation || mode == Draw::Modeling) { VMainGraphicsScene *scene = qobject_cast(currentScene); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) /*Save transform*/ scene->setTransform(ui->view->transform()); @@ -2058,7 +2058,7 @@ void MainWindow::SaveCurrentScene() void MainWindow::RestoreCurrentScene() { VMainGraphicsScene *scene = qobject_cast(currentScene); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) /*Set transform for current scene*/ ui->view->setTransform(scene->transform()); diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index 8bcdbe851..cd6d7c46d 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -1153,7 +1153,7 @@ bool MainWindowsNoGUI::IsPagesFit(const QSizeF &printPaper) const // On previous stage already was checked if pages have uniform size // Enough will be to check only one page QGraphicsRectItem *p = qgraphicsitem_cast(papers.at(0)); - SCASSERT(p != nullptr); + SCASSERT(p != nullptr) const QSizeF pSize = p->rect().size(); if (pSize.height() <= printPaper.height() && pSize.width() <= printPaper.width()) { @@ -1182,7 +1182,7 @@ int MainWindowsNoGUI::ContinueIfLayoutStale() msgBox.setDefaultButton(QMessageBox::No); QSpacerItem* horizontalSpacer = new QSpacerItem(500, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); QGridLayout* layout = static_cast(msgBox.layout()); - SCASSERT(layout != nullptr); + SCASSERT(layout != nullptr) layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount()); msgBox.exec(); return msgBox.result(); diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index c5f2fb433..fe2bc9d8d 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -67,8 +67,8 @@ VPattern::VPattern(VContainer *data, Draw *mode, VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail, QObject *parent) : VAbstractPattern(parent), data(data), mode(mode), sceneDraw(sceneDraw), sceneDetail(sceneDetail) { - SCASSERT(sceneDraw != nullptr); - SCASSERT(sceneDetail != nullptr); + SCASSERT(sceneDraw != nullptr) + SCASSERT(sceneDetail != nullptr) } //--------------------------------------------------------------------------------------------------------------------- @@ -134,8 +134,8 @@ void VPattern::Parse(const Document &parse) break; } - SCASSERT(sceneDraw != nullptr); - SCASSERT(sceneDetail != nullptr); + SCASSERT(sceneDraw != nullptr) + SCASSERT(sceneDetail != nullptr) QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes << TagMeasurements << TagVersion << TagGradation << TagImage << TagUnit << TagPatternName << TagPatternNum << TagCompanyName << TagCustomerName @@ -314,10 +314,10 @@ void VPattern::setCurrentData() void VPattern::UpdateToolData(const quint32 &id, VContainer *data) { Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0"); //-V712 //-V654 - SCASSERT(data != nullptr); + SCASSERT(data != nullptr) ToolExists(id); VDataTool *tool = tools.value(id); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) tool->VDataTool::setData(data); } @@ -548,8 +548,8 @@ void VPattern::ParseDrawElement(const QDomNode &node, const Document &parse) */ void VPattern::ParseDrawMode(const QDomNode &node, const Document &parse, const Draw &mode) { - SCASSERT(sceneDraw != nullptr); - SCASSERT(sceneDetail != nullptr); + SCASSERT(sceneDraw != nullptr) + SCASSERT(sceneDetail != nullptr) VMainGraphicsScene *scene = nullptr; if (mode == Draw::Calculation) { @@ -820,7 +820,7 @@ void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse, const QString &type) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of point is empty"); @@ -934,7 +934,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try { @@ -1053,7 +1053,7 @@ QString VPattern::GetLabelBase(quint32 index) const //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolBasePoint(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); VToolBasePoint *spoint = nullptr; @@ -1084,7 +1084,7 @@ void VPattern::ParseToolBasePoint(VMainGraphicsScene *scene, const QDomElement & //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1134,7 +1134,7 @@ void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domEleme //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolAlongLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1179,7 +1179,7 @@ void VPattern::ParseToolAlongLine(VMainGraphicsScene *scene, QDomElement &domEle //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolShoulderPoint(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1225,7 +1225,7 @@ void VPattern::ParseToolShoulderPoint(VMainGraphicsScene *scene, QDomElement &do //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolNormal(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1271,7 +1271,7 @@ void VPattern::ParseToolNormal(VMainGraphicsScene *scene, QDomElement &domElemen //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolBisector(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1317,7 +1317,7 @@ void VPattern::ParseToolBisector(VMainGraphicsScene *scene, QDomElement &domElem //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolLineIntersect(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1347,7 +1347,7 @@ void VPattern::ParseToolLineIntersect(VMainGraphicsScene *scene, const QDomEleme //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolPointOfContact(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1426,7 +1426,7 @@ void VPattern::ParseNodePoint(const QDomElement &domElement, const Document &par //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolHeight(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1457,7 +1457,7 @@ void VPattern::ParseToolHeight(VMainGraphicsScene *scene, const QDomElement &dom //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolTriangle(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1488,7 +1488,7 @@ void VPattern::ParseToolTriangle(VMainGraphicsScene *scene, const QDomElement &d void VPattern::ParseToolPointOfIntersection(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1516,7 +1516,7 @@ void VPattern::ParseToolPointOfIntersection(VMainGraphicsScene *scene, const QDo //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolCutSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1557,7 +1557,7 @@ void VPattern::ParseToolCutSpline(VMainGraphicsScene *scene, QDomElement &domEle //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolCutSplinePath(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1599,7 +1599,7 @@ void VPattern::ParseToolCutSplinePath(VMainGraphicsScene *scene, QDomElement &do //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolCutArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1641,7 +1641,7 @@ void VPattern::ParseToolCutArc(VMainGraphicsScene *scene, QDomElement &domElemen void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1692,7 +1692,7 @@ void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1741,7 +1741,7 @@ void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElemen void VPattern::ParseToolPointOfIntersectionArcs(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1773,7 +1773,7 @@ void VPattern::ParseToolPointOfIntersectionArcs(VMainGraphicsScene *scene, const void VPattern::ParseToolPointOfIntersectionCircles(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1816,7 +1816,7 @@ void VPattern::ParseToolPointOfIntersectionCircles(VMainGraphicsScene *scene, QD void VPattern::ParseToolPointOfIntersectionCurves(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1847,7 +1847,7 @@ void VPattern::ParseToolPointOfIntersectionCurves(VMainGraphicsScene *scene, QDo void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1888,7 +1888,7 @@ void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDo void VPattern::ParseToolPointFromArcAndTangent(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1919,7 +1919,7 @@ void VPattern::ParseToolPointFromArcAndTangent(VMainGraphicsScene *scene, const //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -1962,7 +1962,7 @@ void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement & // TODO. Delete if minimal supported version is 0.2.7 void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -2002,7 +2002,7 @@ void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement & //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -2034,7 +2034,7 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen if (spl != nullptr) { VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow()); - SCASSERT(window != nullptr); + SCASSERT(window != nullptr) connect(spl, &VToolSpline::ToolTip, window, &VAbstractMainWindow::ShowToolTip); } @@ -2066,7 +2066,7 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -2106,7 +2106,7 @@ void VPattern::ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -2167,7 +2167,7 @@ void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomEleme //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -2223,7 +2223,7 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement if (spl != nullptr) { VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow()); - SCASSERT(window != nullptr); + SCASSERT(window != nullptr) connect(spl, &VToolSplinePath::ToolTip, window, &VAbstractMainWindow::ShowToolTip); } @@ -2265,7 +2265,7 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolCubicBezierPath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); try @@ -2408,7 +2408,7 @@ void VPattern::ParseNodeSplinePath(const QDomElement &domElement, const Document //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); try @@ -2453,7 +2453,7 @@ void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement, //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolEllipticalArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); try @@ -2575,7 +2575,7 @@ void VPattern::ParseNodeArc(const QDomElement &domElement, const Document &parse //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); try @@ -2621,7 +2621,7 @@ void VPattern::ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &do //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolRotation(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); try @@ -2664,7 +2664,7 @@ void VPattern::ParseToolRotation(VMainGraphicsScene *scene, QDomElement &domElem //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolFlippingByLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); try @@ -2694,7 +2694,7 @@ void VPattern::ParseToolFlippingByLine(VMainGraphicsScene *scene, QDomElement &d //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolFlippingByAxis(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); try @@ -2724,7 +2724,7 @@ void VPattern::ParseToolFlippingByAxis(VMainGraphicsScene *scene, QDomElement &d //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseToolMove(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); try @@ -2876,7 +2876,7 @@ void VPattern::GarbageCollector() void VPattern::ParseSplineElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse, const QString &type) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty"); @@ -2939,7 +2939,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, QDomElement &domEle void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse, const QString &type) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of arc is empty"); @@ -2975,7 +2975,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen void VPattern::ParseEllipticalArcElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse, const QString &type) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of elliptical arc is empty"); @@ -3007,7 +3007,7 @@ void VPattern::ParseEllipticalArcElement(VMainGraphicsScene *scene, QDomElement void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse, const QString &type) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty"); @@ -3044,7 +3044,7 @@ void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &d void VPattern::ParseOperationElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse, const QString &type) { - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of operation is empty"); @@ -3527,8 +3527,8 @@ void VPattern::SetReadOnly(bool rOnly) //--------------------------------------------------------------------------------------------------------------------- void VPattern::PrepareForParse(const Document &parse) { - SCASSERT(sceneDraw != nullptr); - SCASSERT(sceneDetail != nullptr); + SCASSERT(sceneDraw != nullptr) + SCASSERT(sceneDetail != nullptr) if (parse == Document::FullParse) { TestUniqueId(); @@ -3723,7 +3723,7 @@ QRectF VPattern::ToolBoundingRect(const QRectF &rec, const quint32 &id) const if (tools.contains(id)) { const T *vTool = qobject_cast(tools.value(id)); - SCASSERT(vTool != nullptr); + SCASSERT(vTool != nullptr) QRectF childrenRect = vTool->childrenBoundingRect(); //map to scene coordinate. @@ -3749,7 +3749,7 @@ void VPattern::IncrementReferens(quint32 id) const Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0"); ToolExists(id); VDataTool *tool = tools.value(id); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) tool->incrementReferens(); } @@ -3763,6 +3763,6 @@ void VPattern::DecrementReferens(quint32 id) const Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0"); ToolExists(id); VDataTool *tool = tools.value(id); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) tool->decrementReferens(); } diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 787cfbbd8..169abd868 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -535,14 +535,14 @@ VDataTool *VAbstractPattern::getTool(const quint32 &id) void VAbstractPattern::AddTool(const quint32 &id, VDataTool *tool) { Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0"); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) tools.insert(id, tool); } //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::AddToolOnRemove(VDataTool *tool) { - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) toolsOnRemove.append(tool); } diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp index a7c4857ec..62ead1f98 100644 --- a/src/libs/vformat/vmeasurements.cpp +++ b/src/libs/vformat/vmeasurements.cpp @@ -101,7 +101,7 @@ VMeasurements::VMeasurements(Unit unit, VContainer *data) data(data), type(MeasurementsType::Individual) { - SCASSERT(data != nullptr); + SCASSERT(data != nullptr) CreateEmptyIndividualFile(unit); } @@ -112,7 +112,7 @@ VMeasurements::VMeasurements(Unit unit, int baseSize, int baseHeight, VContainer data(data), type(MeasurementsType::Standard) { - SCASSERT(data != nullptr); + SCASSERT(data != nullptr) CreateEmptyStandardFile(unit, baseSize, baseHeight); } diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp index 79f5d2fbf..a59e16898 100644 --- a/src/libs/vlayout/vposter.cpp +++ b/src/libs/vlayout/vposter.cpp @@ -249,8 +249,8 @@ PosterData VPoster::Cut(int i, int j, const QRect &imageRect) const const int x = j*PageRect().width() - j*static_cast(allowence); const int y = i*PageRect().height() - i*static_cast(allowence); - SCASSERT(x <= imageRect.width()); - SCASSERT(y <= imageRect.height()); + SCASSERT(x <= imageRect.width()) + SCASSERT(y <= imageRect.height()) PosterData data; data.row = static_cast(i); diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index a21e9e2eb..14ee3f3b1 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -1071,7 +1071,7 @@ void InitPMSystems(QComboBox *systemCombo) // * The default option (blank field or 'None') should appear at the top of the list. // * The list should be sorted alphabetically so users can find their system easily. - SCASSERT(systemCombo != nullptr); + SCASSERT(systemCombo != nullptr) systemCombo->addItem(qApp->TrVars()->PMSystemName(listSystems.at(listSystems.size()-1)), listSystems.at(listSystems.size()-1)); @@ -1150,7 +1150,7 @@ QStringList ListPMSystems() //--------------------------------------------------------------------------------------------------------------------- QStringList ListNumbers(const VTranslateMeasurements *trM, const QStringList &listMeasurements) { - SCASSERT(trM != nullptr); + SCASSERT(trM != nullptr) QStringList numbers; for (int i=0; i < listMeasurements.size(); ++i) diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 2acf0a9f3..b2a43ad27 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -283,7 +283,7 @@ void VAbstractApplication::setPatternUnit(const Unit &patternUnit) */ VCommonSettings *VAbstractApplication::Settings() { - SCASSERT(settings != nullptr); + SCASSERT(settings != nullptr) return settings; } diff --git a/src/libs/vmisc/vtablesearch.cpp b/src/libs/vmisc/vtablesearch.cpp index b03cc4f83..976ffa719 100644 --- a/src/libs/vmisc/vtablesearch.cpp +++ b/src/libs/vmisc/vtablesearch.cpp @@ -48,7 +48,7 @@ VTableSearch::VTableSearch(QTableWidget *table, QObject *parent) //--------------------------------------------------------------------------------------------------------------------- void VTableSearch::Clear() { - SCASSERT(table != nullptr); + SCASSERT(table != nullptr) for(int i = 0; i < table->rowCount(); ++i) { @@ -96,7 +96,7 @@ void VTableSearch::ShowNext(int newIndex) //--------------------------------------------------------------------------------------------------------------------- void VTableSearch::Find(const QString &term) { - SCASSERT(table != nullptr); + SCASSERT(table != nullptr) Clear(); @@ -194,7 +194,7 @@ void VTableSearch::AddRow(int row) //--------------------------------------------------------------------------------------------------------------------- void VTableSearch::RefreshList(const QString &term) { - SCASSERT(table != nullptr); + SCASSERT(table != nullptr) if (term.isEmpty()) { diff --git a/src/libs/vpatterndb/variables/varcradius.cpp b/src/libs/vpatterndb/variables/varcradius.cpp index ca023d2c3..2366552a1 100644 --- a/src/libs/vpatterndb/variables/varcradius.cpp +++ b/src/libs/vpatterndb/variables/varcradius.cpp @@ -46,7 +46,7 @@ VArcRadius::VArcRadius() VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc, Unit patternUnit) :VCurveVariable(id, parentId) { - SCASSERT(arc != nullptr); + SCASSERT(arc != nullptr) SetType(VarType::ArcRadius); SetName(QString(radius_V+"%1").arg(arc->name())); diff --git a/src/libs/vpatterndb/variables/vcurveangle.cpp b/src/libs/vpatterndb/variables/vcurveangle.cpp index 576d49543..f36ae42cc 100644 --- a/src/libs/vpatterndb/variables/vcurveangle.cpp +++ b/src/libs/vpatterndb/variables/vcurveangle.cpp @@ -49,7 +49,7 @@ VCurveAngle::VCurveAngle(const quint32 &id, const quint32 &parentId, const VAbst :VCurveVariable(id, parentId) { SetType(VarType::CurveAngle); - SCASSERT(curve != nullptr); + SCASSERT(curve != nullptr) if (angle == CurveAngle::StartAngle) { SetValue(curve->GetStartAngle()); diff --git a/src/libs/vpatterndb/variables/vcurveclength.cpp b/src/libs/vpatterndb/variables/vcurveclength.cpp index 1262cd832..ca4f09880 100644 --- a/src/libs/vpatterndb/variables/vcurveclength.cpp +++ b/src/libs/vpatterndb/variables/vcurveclength.cpp @@ -50,7 +50,7 @@ VCurveCLength::VCurveCLength(const quint32 &id, const quint32 &parentId, const V : VCurveVariable(id, parentId) { SetType(VarType::CurveCLength); - SCASSERT(curve != nullptr); + SCASSERT(curve != nullptr) if (cType == CurveCLength::C1) { SetValue(FromPixel(curve->GetC1Length(), patternUnit)); diff --git a/src/libs/vpatterndb/variables/vcurvelength.cpp b/src/libs/vpatterndb/variables/vcurvelength.cpp index 6fbab9ee9..2809c9e4d 100644 --- a/src/libs/vpatterndb/variables/vcurvelength.cpp +++ b/src/libs/vpatterndb/variables/vcurvelength.cpp @@ -48,7 +48,7 @@ VCurveLength::VCurveLength(const quint32 &id, const quint32 &parentId, const VAb :VCurveVariable(id, parentId) { SetType(VarType::CurveLength); - SCASSERT(curve != nullptr); + SCASSERT(curve != nullptr) SetName(curve->name()); SetValue(FromPixel(curve->GetLength(), patternUnit)); } diff --git a/src/libs/vpatterndb/variables/vellipticalarcradius.cpp b/src/libs/vpatterndb/variables/vellipticalarcradius.cpp index aa900362f..0503ee75c 100644 --- a/src/libs/vpatterndb/variables/vellipticalarcradius.cpp +++ b/src/libs/vpatterndb/variables/vellipticalarcradius.cpp @@ -45,7 +45,7 @@ VEllipticalArcRadius::VEllipticalArcRadius() VEllipticalArcRadius::VEllipticalArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc, const int numberRadius, Unit patternUnit) : VCurveVariable(id, parentId) { - SCASSERT(elArc != nullptr); + SCASSERT(elArc != nullptr) SetType(VarType::ArcRadius); SetName(QString(radius_V+"%1"+"%2").arg(numberRadius).arg(elArc->name())); diff --git a/src/libs/vpatterndb/variables/vlineangle.cpp b/src/libs/vpatterndb/variables/vlineangle.cpp index 9f92841e8..bbb7f1e26 100644 --- a/src/libs/vpatterndb/variables/vlineangle.cpp +++ b/src/libs/vpatterndb/variables/vlineangle.cpp @@ -53,8 +53,8 @@ VLineAngle::VLineAngle(const VPointF *p1, const quint32 &p1Id, const VPointF *p2 { SetType(VarType::LineAngle); - SCASSERT(p1 != nullptr); - SCASSERT(p2 != nullptr); + SCASSERT(p1 != nullptr) + SCASSERT(p2 != nullptr) SetName(QString(angleLine_+"%1_%2").arg(p1->name(), p2->name())); SetValue(p1, p2); @@ -90,8 +90,8 @@ bool VLineAngle::Filter(quint32 id) //--------------------------------------------------------------------------------------------------------------------- void VLineAngle::SetValue(const VPointF *p1, const VPointF *p2) { - SCASSERT(p1 != nullptr); - SCASSERT(p2 != nullptr); + SCASSERT(p1 != nullptr) + SCASSERT(p2 != nullptr) //Correct angle. Try avoid results like 6,7563e-15. const qreal angle = qFloor(QLineF(*p1, *p2).angle() * 100000.) / 100000.; VInternalVariable::SetValue(angle); diff --git a/src/libs/vpatterndb/variables/vlinelength.cpp b/src/libs/vpatterndb/variables/vlinelength.cpp index bd014f65e..8fe836157 100644 --- a/src/libs/vpatterndb/variables/vlinelength.cpp +++ b/src/libs/vpatterndb/variables/vlinelength.cpp @@ -50,8 +50,8 @@ VLengthLine::VLengthLine(const VPointF *p1, const quint32 &p1Id, const VPointF * Unit patternUnit) :VInternalVariable(), d(new VLengthLineData(p1Id, p2Id, patternUnit)) { - SCASSERT(p1 != nullptr); - SCASSERT(p2 != nullptr); + SCASSERT(p1 != nullptr) + SCASSERT(p2 != nullptr) SetType(VarType::LineLength); SetName(QString(line_+"%1_%2").arg(p1->name(), p2->name())); @@ -88,8 +88,8 @@ bool VLengthLine::Filter(quint32 id) //--------------------------------------------------------------------------------------------------------------------- void VLengthLine::SetValue(const VPointF *p1, const VPointF *p2) { - SCASSERT(p1 != nullptr); - SCASSERT(p2 != nullptr); + SCASSERT(p1 != nullptr) + SCASSERT(p2 != nullptr) VInternalVariable::SetValue(FromPixel(QLineF(*p1, *p2).length(), d->patternUnit)); } diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index 0daeac738..12e070407 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -176,7 +176,7 @@ const VDetail VContainer::GetDetail(quint32 id) const */ quint32 VContainer::AddGObject(VGObject *obj) { - SCASSERT(obj != nullptr); + SCASSERT(obj != nullptr) QSharedPointer pointer(obj); uniqueNames.insert(obj->name()); return AddObject(d->gObjects, pointer); @@ -243,7 +243,7 @@ template void VContainer::UpdateObject(QHash &obj, const quint32 &id, val point) { Q_ASSERT_X(id != NULL_ID, Q_FUNC_INFO, "id == 0"); //-V654 //-V712 - SCASSERT(point.isNull() == false); + SCASSERT(point.isNull() == false) point->setId(id); if (d->gObjects.contains(id)) { @@ -483,7 +483,7 @@ void VContainer::RemoveVariable(const QString &name) template quint32 VContainer::AddObject(QHash &obj, val value) { - SCASSERT(value != nullptr); + SCASSERT(value != nullptr) const quint32 id = getNextId(); value->setId(id); obj[id] = value; @@ -498,7 +498,7 @@ quint32 VContainer::AddObject(QHash &obj, val value) */ void VContainer::UpdateGObject(quint32 id, VGObject* obj) { - SCASSERT(obj != nullptr); + SCASSERT(obj != nullptr) QSharedPointer pointer(obj); UpdateObject(d->gObjects, id, pointer); uniqueNames.insert(obj->name()); diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h index d181677fa..845808ac1 100644 --- a/src/libs/vpatterndb/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -251,7 +251,7 @@ const QSharedPointer VContainer::GeometricObject(const quint32 &id) const try { QSharedPointer obj = qSharedPointerDynamicCast(gObj); - SCASSERT(obj.isNull() == false); + SCASSERT(obj.isNull() == false) return obj; } catch (const std::bad_alloc &) @@ -270,13 +270,13 @@ const QSharedPointer VContainer::GeometricObject(const quint32 &id) const template QSharedPointer VContainer::GetVariable(QString name) const { - SCASSERT(name.isEmpty()==false); + SCASSERT(name.isEmpty()==false) if (d->variables.contains(name)) { try { QSharedPointer value = qSharedPointerDynamicCast(d->variables.value(name)); - SCASSERT(value.isNull() == false); + SCASSERT(value.isNull() == false) return value; } catch (const std::bad_alloc &) diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index 1b0057949..f00a16936 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -154,8 +154,8 @@ void DialogEditWrongFormula::DeployFormulaTextEdit() //--------------------------------------------------------------------------------------------------------------------- void DialogEditWrongFormula::EvalFormula() { - SCASSERT(plainTextEditFormula != nullptr); - SCASSERT(labelResultCalculation != nullptr); + SCASSERT(plainTextEditFormula != nullptr) + SCASSERT(labelResultCalculation != nullptr) Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix, checkZero); } @@ -252,7 +252,7 @@ void DialogEditWrongFormula::PutHere() */ void DialogEditWrongFormula::PutVal(QTableWidgetItem *item) { - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) QTextCursor cursor = ui->plainTextEditFormula->textCursor(); cursor.insertText(ui->tableWidget->item(item->row(), ColumnName)->text()); ui->plainTextEditFormula->setTextCursor(cursor); @@ -339,7 +339,7 @@ void DialogEditWrongFormula::Functions() //--------------------------------------------------------------------------------------------------------------------- void DialogEditWrongFormula::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagFormula); } diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.cpp b/src/libs/vtools/dialogs/tools/dialogalongline.cpp index 93909f136..be87b34b4 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogalongline.cpp @@ -180,7 +180,7 @@ void DialogAlongLine::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolAlongLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) const QString toolTip = tr("Select second point of line"); switch (number) @@ -229,7 +229,7 @@ void DialogAlongLine::SaveData() formula.replace("\n", " "); VisToolAlongLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetFirstPointId()); line->setObject2Id(GetSecondPointId()); @@ -269,7 +269,7 @@ void DialogAlongLine::SetSecondPointId(const quint32 &value) setCurrentPointId(ui->comboBoxSecondPoint, value); VisToolAlongLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject2Id(value); } @@ -292,7 +292,7 @@ void DialogAlongLine::SetFirstPointId(const quint32 &value) setCurrentPointId(ui->comboBoxFirstPoint, value); VisToolAlongLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -312,7 +312,7 @@ void DialogAlongLine::SetFormula(const QString &value) ui->plainTextEditFormula->setPlainText(formula); VisToolAlongLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLength(formula); MoveCursorToEnd(ui->plainTextEditFormula); diff --git a/src/libs/vtools/dialogs/tools/dialogarc.cpp b/src/libs/vtools/dialogs/tools/dialogarc.cpp index 435cbccbc..172f19098 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarc.cpp @@ -155,7 +155,7 @@ void DialogArc::SetF2(const QString &value) ui->plainTextEditF2->setPlainText(f2); VisToolArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setF2(f2); MoveCursorToEnd(ui->plainTextEditF2); @@ -189,7 +189,7 @@ void DialogArc::SetF1(const QString &value) ui->plainTextEditF1->setPlainText(f1); VisToolArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setF1(f1); MoveCursorToEnd(ui->plainTextEditF1); @@ -211,7 +211,7 @@ void DialogArc::SetRadius(const QString &value) ui->plainTextEditFormula->setPlainText(radius); VisToolArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setRadius(radius); MoveCursorToEnd(ui->plainTextEditFormula); @@ -257,7 +257,7 @@ void DialogArc::SaveData() f2.replace("\n", " "); VisToolArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(GetCenter()); path->setRadius(radius); @@ -357,9 +357,9 @@ void DialogArc::FXF2() */ void DialogArc::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagRadius && flagF1 && flagF2); - SCASSERT(bApply != nullptr); + SCASSERT(bApply != nullptr) bApply->setEnabled(flagRadius && flagF1 && flagF2); } diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp index d283430ad..abf6bafca 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp @@ -136,7 +136,7 @@ void DialogArcWithLength::SetRadius(const QString &value) ui->plainTextEditRadius->setPlainText(radius); VisToolArcWithLength *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setRadius(radius); MoveCursorToEnd(ui->plainTextEditRadius); @@ -159,7 +159,7 @@ void DialogArcWithLength::SetF1(const QString &value) ui->plainTextEditF1->setPlainText(f1); VisToolArcWithLength *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setF1(f1); MoveCursorToEnd(ui->plainTextEditF1); @@ -183,7 +183,7 @@ void DialogArcWithLength::SetLength(const QString &value) ui->plainTextEditLength->setPlainText(length); VisToolArcWithLength *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setLength(radius); MoveCursorToEnd(ui->plainTextEditLength); @@ -308,7 +308,7 @@ void DialogArcWithLength::FXLength() //--------------------------------------------------------------------------------------------------------------------- void DialogArcWithLength::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagRadius && flagF1 && flagLength); // In case dialog hasn't apply button if ( bApply != nullptr) @@ -336,7 +336,7 @@ void DialogArcWithLength::SaveData() length.replace("\n", " "); VisToolArcWithLength *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(GetCenter()); path->setRadius(radius); diff --git a/src/libs/vtools/dialogs/tools/dialogbisector.cpp b/src/libs/vtools/dialogs/tools/dialogbisector.cpp index 76e617c6d..1b9615a25 100644 --- a/src/libs/vtools/dialogs/tools/dialogbisector.cpp +++ b/src/libs/vtools/dialogs/tools/dialogbisector.cpp @@ -175,7 +175,7 @@ void DialogBisector::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolBisector *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -262,7 +262,7 @@ void DialogBisector::SetFormula(const QString &value) ui->plainTextEditFormula->setPlainText(formula); VisToolBisector *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLength(formula); MoveCursorToEnd(ui->plainTextEditFormula); @@ -278,7 +278,7 @@ void DialogBisector::SetFirstPointId(const quint32 &value) setCurrentPointId(ui->comboBoxFirstPoint, value); VisToolBisector *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -292,7 +292,7 @@ void DialogBisector::SetSecondPointId(const quint32 &value) setCurrentPointId(ui->comboBoxSecondPoint, value); VisToolBisector *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject2Id(value); } @@ -306,7 +306,7 @@ void DialogBisector::SetThirdPointId(const quint32 &value) setCurrentPointId(ui->comboBoxThirdPoint, value); VisToolBisector *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject3Id(value); } @@ -331,7 +331,7 @@ void DialogBisector::SaveData() formula.replace("\n", " "); VisToolBisector *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetFirstPointId()); line->setObject2Id(GetSecondPointId()); diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp b/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp index 0558c91e4..0665f0e30 100644 --- a/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcubicbezier.cpp @@ -99,7 +99,7 @@ void DialogCubicBezier::SetSpline(const VCubicBezier &spline) ui->lineEditSplineName->setText(spl.name()); auto path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(spl.GetP1().id()); path->setObject2Id(spl.GetP2().id()); @@ -127,7 +127,7 @@ void DialogCubicBezier::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { auto *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) switch (number) { @@ -239,7 +239,7 @@ void DialogCubicBezier::SaveData() newDuplicate <= -1 ? spl.SetDuplicate(d) : spl.SetDuplicate(static_cast(newDuplicate)); auto path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(p1->id()); path->setObject2Id(p2->id()); diff --git a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp index cf8a1f340..678658224 100644 --- a/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcubicbezierpath.cpp @@ -104,7 +104,7 @@ void DialogCubicBezierPath::SetPath(const VCubicBezierPath &value) ui->lineEditSplPathName->setText(path.name()); auto visPath = qobject_cast(vis); - SCASSERT(visPath != nullptr); + SCASSERT(visPath != nullptr) visPath->setPath(path); ui->listWidget->blockSignals(false); @@ -142,14 +142,14 @@ void DialogCubicBezierPath::ChosenObject(quint32 id, const SceneObject &type) SavePath(); auto visPath = qobject_cast(vis); - SCASSERT(visPath != nullptr); + SCASSERT(visPath != nullptr) visPath->setPath(path); if (path.CountPoints() == 1) { visPath->VisualMode(NULL_ID); VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow()); - SCASSERT(window != nullptr); + SCASSERT(window != nullptr) connect(visPath, &VisToolCubicBezierPath::ToolTip, window, &VAbstractMainWindow::ShowToolTip); } else @@ -196,7 +196,7 @@ void DialogCubicBezierPath::SaveData() newDuplicate <= -1 ? path.SetDuplicate(d) : path.SetDuplicate(static_cast(newDuplicate)); auto visPath = qobject_cast(vis); - SCASSERT(visPath != nullptr); + SCASSERT(visPath != nullptr) visPath->setPath(path); visPath->SetMode(Mode::Show); visPath->RefreshGeometry(); diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp index 272dae97c..0e9346659 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp @@ -137,7 +137,7 @@ void DialogCurveIntersectAxis::SetAngle(const QString &value) ui->plainTextEditFormula->setPlainText(formulaAngle); VisToolCurveIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditFormula); @@ -155,7 +155,7 @@ void DialogCurveIntersectAxis::SetBasePointId(const quint32 &value) setCurrentPointId(ui->comboBoxAxisPoint, value); VisToolCurveIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setAxisPointId(value); } @@ -171,7 +171,7 @@ void DialogCurveIntersectAxis::setCurveId(const quint32 &value) setCurrentCurveId(ui->comboBoxCurve, value); VisToolCurveIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -196,7 +196,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click) { /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) const QSharedPointer point = data->GeometricObject(GetBasePointId()); QLineF line = QLineF(*point, scene->getScenePos()); @@ -209,7 +209,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click) } VisToolCurveIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) this->SetAngle(line->Angle());//Show in dialog angle what user choose emit ToolTip(""); @@ -224,7 +224,7 @@ void DialogCurveIntersectAxis::ChosenObject(quint32 id, const SceneObject &type) if (prepare == false)// After first choose we ignore all objects { VisToolCurveIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -239,7 +239,7 @@ void DialogCurveIntersectAxis::ChosenObject(quint32 id, const SceneObject &type) number++; line->VisualMode(id); VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow()); - SCASSERT(window != nullptr); + SCASSERT(window != nullptr) connect(line, &VisToolCurveIntersectAxis::ToolTip, window, &VAbstractMainWindow::ShowToolTip); } @@ -309,7 +309,7 @@ void DialogCurveIntersectAxis::SaveData() formulaAngle.replace("\n", " "); VisToolCurveIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(getCurveId()); line->setAxisPointId(GetBasePointId()); diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp index 46f9846f4..000e74512 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp @@ -153,7 +153,7 @@ void DialogCutArc::SaveData() formula.replace("\n", " "); VisToolCutArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(getArcId()); path->setLength(formula); @@ -177,7 +177,7 @@ void DialogCutArc::setArcId(const quint32 &value) setCurrentArcId(ui->comboBoxArc, value); VisToolCutArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(value); } @@ -197,7 +197,7 @@ void DialogCutArc::SetFormula(const QString &value) ui->plainTextEditFormula->setPlainText(formula); VisToolCutArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setLength(formula); MoveCursorToEnd(ui->plainTextEditFormula); diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp index c7ea264af..75b28b483 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp @@ -118,7 +118,7 @@ void DialogCutSpline::SetFormula(const QString &value) ui->plainTextEditFormula->setPlainText(formula); VisToolCutSpline *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setLength(formula); MoveCursorToEnd(ui->plainTextEditFormula); @@ -134,7 +134,7 @@ void DialogCutSpline::setSplineId(const quint32 &value) setCurrentSplineId(ui->comboBoxSpline, value); VisToolCutSpline *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(value); } @@ -169,7 +169,7 @@ void DialogCutSpline::SaveData() formula.replace("\n", " "); VisToolCutSpline *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(getSplineId()); path->setLength(formula); diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp index d0f0b5729..33d4d96ad 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp @@ -118,7 +118,7 @@ void DialogCutSplinePath::SetFormula(const QString &value) ui->plainTextEditFormula->setPlainText(formula); VisToolCutSplinePath *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setLength(formula); MoveCursorToEnd(ui->plainTextEditFormula); @@ -134,7 +134,7 @@ void DialogCutSplinePath::setSplinePathId(const quint32 &value) setCurrentSplinePathId(ui->comboBoxSplinePath, value); VisToolCutSplinePath *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(value); } @@ -169,7 +169,7 @@ void DialogCutSplinePath::SaveData() formula.replace("\n", " "); VisToolCutSplinePath *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(getSplinePathId()); path->setLength(formula); diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index 1475c6f29..2a6667ddb 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -104,10 +104,10 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge ui.doubleSpinBoxSeams->setValue(UnitConvertor(1, Unit::Cm, qApp->patternUnit())); bOk = ui.buttonBox->button(QDialogButtonBox::Ok); - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted); QPushButton *bCancel = ui.buttonBox->button(QDialogButtonBox::Cancel); - SCASSERT(bCancel != nullptr); + SCASSERT(bCancel != nullptr) connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected); flagName = true;//We have default name of detail. @@ -235,7 +235,7 @@ void DialogDetail::SaveData() //--------------------------------------------------------------------------------------------------------------------- void DialogDetail::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagFormula && flagName && flagError && flagWidth); // In case dialog hasn't apply button if ( bApply != nullptr) @@ -321,7 +321,7 @@ void DialogDetail::AddUpdate() else { int iR = ui.listWidgetMCP->currentRow(); - SCASSERT(iR >= 0); + SCASSERT(iR >= 0) m_conMCP[iR] = mcp; SetAddMode(); } @@ -340,7 +340,7 @@ void DialogDetail::Cancel() void DialogDetail::Remove() { int iR = ui.listWidgetMCP->currentRow(); - SCASSERT(iR >= 0); + SCASSERT(iR >= 0) m_conMCP.removeAt(iR); UpdateList(); ClearFields(); @@ -350,7 +350,7 @@ void DialogDetail::Remove() //--------------------------------------------------------------------------------------------------------------------- void DialogDetail::NameDetailChanged() { - SCASSERT(labelEditNamePoint != nullptr); + SCASSERT(labelEditNamePoint != nullptr) QLineEdit* edit = qobject_cast(sender()); if (edit) { @@ -391,7 +391,7 @@ void DialogDetail::MaterialChanged() void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode, qreal mx, qreal my, bool reverse) { - SCASSERT(id > NULL_ID); + SCASSERT(id > NULL_ID) QString name; switch (typeTool) { @@ -524,7 +524,7 @@ void DialogDetail::EnableObjectGUI(bool value) quint32 DialogDetail::RowId(int i) const { const QListWidgetItem *rowItem = ui.listWidget->item(i); - SCASSERT(rowItem != nullptr); + SCASSERT(rowItem != nullptr) const VNodeDetail rowNode = qvariant_cast(rowItem->data(Qt::UserRole)); return rowNode.getId(); } @@ -589,7 +589,7 @@ void DialogDetail::BiasXChanged(qreal d) { qint32 row = ui.listWidget->currentRow(); QListWidgetItem *item = ui.listWidget->item( row ); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VNodeDetail node = qvariant_cast(item->data(Qt::UserRole)); node.setMx(qApp->toPixel(d)); item->setData(Qt::UserRole, QVariant::fromValue(node)); @@ -604,7 +604,7 @@ void DialogDetail::BiasYChanged(qreal d) { qint32 row = ui.listWidget->currentRow(); QListWidgetItem *item = ui.listWidget->item( row ); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VNodeDetail node = qvariant_cast(item->data(Qt::UserRole)); node.setMy(qApp->toPixel(d)); item->setData(Qt::UserRole, QVariant::fromValue(node)); @@ -668,7 +668,7 @@ void DialogDetail::ClickedReverse(bool checked) { qint32 row = ui.listWidget->currentRow(); QListWidgetItem *item = ui.listWidget->item( row ); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VNodeDetail node = qvariant_cast(item->data(Qt::UserRole)); node.setReverse(checked); item->setData(Qt::UserRole, QVariant::fromValue(node)); @@ -687,7 +687,7 @@ void DialogDetail::ObjectChanged(int row) return; } const QListWidgetItem *item = ui.listWidget->item( row ); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) const VNodeDetail node = qvariant_cast(item->data(Qt::UserRole)); ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx())); ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy())); diff --git a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp index 841768ca2..88bb8ed78 100644 --- a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp @@ -196,7 +196,7 @@ void DialogEllipticalArc::SetRadius1(const QString &value) ui->plainTextEditRadius1->setPlainText(radius1); VisToolEllipticalArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setRadius1(radius1); MoveCursorToEnd(ui->plainTextEditRadius1); @@ -228,7 +228,7 @@ void DialogEllipticalArc::SetRadius2(const QString &value) ui->plainTextEditRadius2->setPlainText(radius2); VisToolEllipticalArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setRadius2(radius2); MoveCursorToEnd(ui->plainTextEditRadius2); @@ -260,7 +260,7 @@ void DialogEllipticalArc::SetF1(const QString &value) ui->plainTextEditF1->setPlainText(f1); VisToolEllipticalArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setF1(f1); MoveCursorToEnd(ui->plainTextEditF1); @@ -292,7 +292,7 @@ void DialogEllipticalArc::SetF2(const QString &value) ui->plainTextEditF2->setPlainText(f2); VisToolEllipticalArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setF2(f2); MoveCursorToEnd(ui->plainTextEditF2); @@ -324,7 +324,7 @@ void DialogEllipticalArc::SetRotationAngle(const QString &value) ui->plainTextEditRotationAngle->setPlainText(rotationAngle); VisToolEllipticalArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setRotationAngle(rotationAngle); MoveCursorToEnd(ui->plainTextEditRotationAngle); @@ -612,9 +612,9 @@ void DialogEllipticalArc::ChosenObject(quint32 id, const SceneObject &type) */ void DialogEllipticalArc::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagRadius1 && flagRadius2 && flagF1 && flagF2 && flagRotationAngle); - SCASSERT(bApply != nullptr); + SCASSERT(bApply != nullptr) bApply->setEnabled(flagRadius1 && flagRadius2 && flagF1 && flagF2 && flagRotationAngle); } @@ -639,7 +639,7 @@ void DialogEllipticalArc::SaveData() rotationAngle.replace("\n", " "); VisToolEllipticalArc *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(GetCenter()); path->setRadius1(radius1); diff --git a/src/libs/vtools/dialogs/tools/dialogendline.cpp b/src/libs/vtools/dialogs/tools/dialogendline.cpp index 73a098eed..d95a190af 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogendline.cpp @@ -188,7 +188,7 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type) { vis->VisualMode(id); VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow()); - SCASSERT(window != nullptr); + SCASSERT(window != nullptr) connect(vis.data(), &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip); prepare = true; } @@ -235,7 +235,7 @@ void DialogEndLine::SetFormula(const QString &value) ui->plainTextEditFormula->setPlainText(formulaLength); VisToolEndLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLength(formulaLength); MoveCursorToEnd(ui->plainTextEditFormula); @@ -258,7 +258,7 @@ void DialogEndLine::SetAngle(const QString &value) ui->plainTextEditAngle->setPlainText(formulaAngle); VisToolEndLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditAngle); @@ -274,7 +274,7 @@ void DialogEndLine::SetBasePointId(const quint32 &value) setCurrentPointId(ui->comboBoxBasePoint, value); VisToolEndLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -303,7 +303,7 @@ void DialogEndLine::ShowDialog(bool click) { /*We will ignore click if pointer is in point circle*/ VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) const QSharedPointer point = data->GeometricObject(GetBasePointId()); QLineF line = QLineF(*point, scene->getScenePos()); @@ -317,7 +317,7 @@ void DialogEndLine::ShowDialog(bool click) this->setModal(true); VisToolEndLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) this->SetAngle(line->Angle());//Show in dialog angle what user choose this->SetFormula(line->Length()); @@ -345,7 +345,7 @@ void DialogEndLine::SaveData() formulaAngle.replace("\n", " "); VisToolEndLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetBasePointId()); line->setLength(formulaLength); diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp index 2939be0ad..66928d72a 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp @@ -101,7 +101,7 @@ void DialogFlippingByAxis::SetOriginPointId(quint32 value) { ChangeCurrentData(ui->comboBoxOriginPoint, value); VisToolFlippingByAxis *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetOriginPointId(value); } @@ -120,7 +120,7 @@ void DialogFlippingByAxis::SetAxisType(AxisType type) ui->comboBoxAxisType->setCurrentIndex(index); auto operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetAxisType(type); } } @@ -157,11 +157,11 @@ void DialogFlippingByAxis::ShowDialog(bool click) stage1 = false; VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) scene->clearSelection(); VisToolFlippingByAxis *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetObjects(objects.toVector()); operation->VisualMode(); @@ -201,7 +201,7 @@ void DialogFlippingByAxis::ChosenObject(quint32 id, const SceneObject &type) if (SetObject(id, ui->comboBoxOriginPoint, "")) { VisToolFlippingByAxis *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetOriginPointId(id); operation->RefreshGeometry(); @@ -274,9 +274,9 @@ void DialogFlippingByAxis::SuffixChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogFlippingByAxis::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagError && flagName); - SCASSERT(bApply != nullptr); + SCASSERT(bApply != nullptr) bApply->setEnabled(bOk->isEnabled()); } @@ -292,7 +292,7 @@ void DialogFlippingByAxis::SaveData() m_suffix = ui->lineEditSuffix->text(); VisToolFlippingByAxis *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetObjects(objects.toVector()); operation->SetOriginPointId(GetOriginPointId()); @@ -321,7 +321,7 @@ void DialogFlippingByAxis::PointChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogFlippingByAxis::FillComboBoxAxisType(QComboBox *box) { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->addItem(tr("Vertical axis"), QVariant(static_cast(AxisType::VerticalAxis))); box->addItem(tr("Horizontal axis"), QVariant(static_cast(AxisType::HorizontalAxis))); diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp index 3565eea83..79eb1fb0b 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp @@ -105,7 +105,7 @@ void DialogFlippingByLine::SetFirstLinePointId(quint32 value) { ChangeCurrentData(ui->comboBoxFirstLinePoint, value); VisToolFlippingByLine *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetFirstLinePointId(value); } @@ -156,11 +156,11 @@ void DialogFlippingByLine::ShowDialog(bool click) stage1 = false; VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) scene->clearSelection(); VisToolFlippingByLine *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetObjects(objects.toVector()); operation->VisualMode(); @@ -204,7 +204,7 @@ void DialogFlippingByLine::ChosenObject(quint32 id, const SceneObject &type) { number++; VisToolFlippingByLine *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetFirstLinePointId(id); operation->RefreshGeometry(); } @@ -226,7 +226,7 @@ void DialogFlippingByLine::ChosenObject(quint32 id, const SceneObject &type) prepare = true; VisToolFlippingByLine *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetSecondLinePointId(id); operation->RefreshGeometry(); } @@ -303,9 +303,9 @@ void DialogFlippingByLine::SuffixChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogFlippingByLine::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagError && flagName); - SCASSERT(bApply != nullptr); + SCASSERT(bApply != nullptr) bApply->setEnabled(bOk->isEnabled()); } @@ -321,7 +321,7 @@ void DialogFlippingByLine::SaveData() m_suffix = ui->lineEditSuffix->text(); VisToolFlippingByLine *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetObjects(objects.toVector()); operation->SetFirstLinePointId(GetFirstLinePointId()); diff --git a/src/libs/vtools/dialogs/tools/dialogheight.cpp b/src/libs/vtools/dialogs/tools/dialogheight.cpp index cd710a1dd..1e3127cf8 100644 --- a/src/libs/vtools/dialogs/tools/dialogheight.cpp +++ b/src/libs/vtools/dialogs/tools/dialogheight.cpp @@ -129,7 +129,7 @@ void DialogHeight::SetBasePointId(const quint32 &value) setCurrentPointId(ui->comboBoxBasePoint, value); VisToolHeight *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -143,7 +143,7 @@ void DialogHeight::SetP1LineId(const quint32 &value) setCurrentPointId(ui->comboBoxP1Line, value); VisToolHeight *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLineP1Id(value); } @@ -157,7 +157,7 @@ void DialogHeight::SetP2LineId(const quint32 &value) setCurrentPointId(ui->comboBoxP2Line, value); VisToolHeight *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLineP2Id(value); } @@ -186,7 +186,7 @@ void DialogHeight::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolHeight *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -240,7 +240,7 @@ void DialogHeight::SaveData() pointName = ui->lineEditNamePoint->text(); VisToolHeight *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetBasePointId()); line->setLineP1Id(GetP1LineId()); diff --git a/src/libs/vtools/dialogs/tools/dialogline.cpp b/src/libs/vtools/dialogs/tools/dialogline.cpp index 69801ed13..923091334 100644 --- a/src/libs/vtools/dialogs/tools/dialogline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogline.cpp @@ -92,7 +92,7 @@ void DialogLine::SetSecondPoint(const quint32 &value) setCurrentPointId(ui->comboBoxSecondPoint, value); VisToolLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setPoint2Id(value); } @@ -129,7 +129,7 @@ void DialogLine::SetFirstPoint(const quint32 &value) setCurrentPointId(ui->comboBoxFirstPoint, value); VisToolLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -162,7 +162,7 @@ void DialogLine::ShowVisualization() void DialogLine::SaveData() { VisToolLine *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetFirstPoint()); line->setPoint2Id(GetSecondPoint()); diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp index 0cc166f31..3e82cd601 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp @@ -109,7 +109,7 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolLineIntersect *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -194,7 +194,7 @@ void DialogLineIntersect::SaveData() pointName = ui->lineEditNamePoint->text(); VisToolLineIntersect *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetP1Line1()); line->setLine1P2Id(GetP2Line1()); @@ -267,7 +267,7 @@ void DialogLineIntersect::ShowVisualization() */ void DialogLineIntersect::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagName && flagPoint); } @@ -307,7 +307,7 @@ void DialogLineIntersect::SetP2Line2(const quint32 &value) setCurrentPointId(ui->comboBoxP2Line2, value); VisToolLineIntersect *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLine2P2Id(value); } @@ -321,7 +321,7 @@ void DialogLineIntersect::SetP1Line2(const quint32 &value) setCurrentPointId(ui->comboBoxP1Line2, value); VisToolLineIntersect *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLine2P1Id(value); } @@ -335,7 +335,7 @@ void DialogLineIntersect::SetP2Line1(const quint32 &value) setCurrentPointId(ui->comboBoxP2Line1, value); VisToolLineIntersect *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLine1P2Id(value); } @@ -349,7 +349,7 @@ void DialogLineIntersect::SetP1Line1(const quint32 &value) setCurrentPointId(ui->comboBoxP1Line1, value); VisToolLineIntersect *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp index 698403ef7..4fae732a5 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp @@ -150,7 +150,7 @@ void DialogLineIntersectAxis::SetAngle(const QString &value) ui->plainTextEditFormula->setPlainText(formulaAngle); VisToolLineIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditFormula); @@ -168,7 +168,7 @@ void DialogLineIntersectAxis::SetBasePointId(const quint32 &value) setCurrentPointId(ui->comboBoxAxisPoint, value); VisToolLineIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setAxisPointId(value); } @@ -184,7 +184,7 @@ void DialogLineIntersectAxis::SetFirstPointId(const quint32 &value) setCurrentPointId(ui->comboBoxFirstLinePoint, value); VisToolLineIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -200,7 +200,7 @@ void DialogLineIntersectAxis::SetSecondPointId(const quint32 &value) setCurrentPointId(ui->comboBoxSecondLinePoint, value); VisToolLineIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setPoint2Id(value); } @@ -225,7 +225,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click) { /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) const QSharedPointer point = data->GeometricObject(GetBasePointId()); QLineF line = QLineF(*point, scene->getScenePos()); @@ -238,7 +238,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click) } VisToolLineIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) this->SetAngle(line->Angle());//Show in dialog angle what user choose emit ToolTip(""); @@ -255,7 +255,7 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolLineIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -265,7 +265,7 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type) number++; line->VisualMode(id); VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow()); - SCASSERT(window != nullptr); + SCASSERT(window != nullptr) connect(line, &VisToolLineIntersectAxis::ToolTip, window, &VAbstractMainWindow::ShowToolTip); } break; @@ -377,7 +377,7 @@ void DialogLineIntersectAxis::SaveData() formulaAngle.replace("\n", " "); VisToolLineIntersectAxis *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetFirstPointId()); line->setPoint2Id(GetSecondPointId()); diff --git a/src/libs/vtools/dialogs/tools/dialogmove.cpp b/src/libs/vtools/dialogs/tools/dialogmove.cpp index 9ed45b505..a2f3ba643 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.cpp +++ b/src/libs/vtools/dialogs/tools/dialogmove.cpp @@ -137,7 +137,7 @@ void DialogMove::SetAngle(const QString &value) ui->plainTextEditAngle->setPlainText(formulaAngle); VisToolMove *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditAngle); @@ -161,7 +161,7 @@ void DialogMove::SetLength(const QString &value) ui->plainTextEditLength->setPlainText(formulaLength); VisToolMove *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetLength(formulaLength); MoveCursorToEnd(ui->plainTextEditLength); @@ -200,16 +200,16 @@ void DialogMove::ShowDialog(bool click) prepare = true; VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) scene->clearSelection(); VisToolMove *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetObjects(objects.toVector()); operation->VisualMode(); VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow()); - SCASSERT(window != nullptr); + SCASSERT(window != nullptr) connect(operation, &VisToolMove::ToolTip, window, &VAbstractMainWindow::ShowToolTip); scene->ToggleArcSelection(false); @@ -225,7 +225,7 @@ void DialogMove::ShowDialog(bool click) else if (not stage1 && prepare && click) { VisToolMove *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) if (operation->LengthValue() > 0) { @@ -367,9 +367,9 @@ void DialogMove::SuffixChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogMove::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagAngle && flagLength && flagName); - SCASSERT(bApply != nullptr); + SCASSERT(bApply != nullptr) bApply->setEnabled(bOk->isEnabled()); } @@ -391,7 +391,7 @@ void DialogMove::SaveData() formulaLength.replace("\n", " "); VisToolMove *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetObjects(objects.toVector()); operation->SetAngle(formulaAngle); diff --git a/src/libs/vtools/dialogs/tools/dialognormal.cpp b/src/libs/vtools/dialogs/tools/dialognormal.cpp index 992f25314..cc4f9c9a9 100644 --- a/src/libs/vtools/dialogs/tools/dialognormal.cpp +++ b/src/libs/vtools/dialogs/tools/dialognormal.cpp @@ -168,7 +168,7 @@ void DialogNormal::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolNormal *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -208,7 +208,7 @@ void DialogNormal::SaveData() angle = ui->doubleSpinBoxAngle->value(); VisToolNormal *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetFirstPointId()); line->setObject2Id(GetSecondPointId()); @@ -235,7 +235,7 @@ void DialogNormal::SetSecondPointId(const quint32 &value) setCurrentPointId(ui->comboBoxSecondPoint, value); VisToolNormal *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject2Id(value); } @@ -261,7 +261,7 @@ void DialogNormal::SetFirstPointId(const quint32 &value) setCurrentPointId(ui->comboBoxFirstPoint, value); VisToolNormal *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -276,7 +276,7 @@ void DialogNormal::SetAngle(const qreal &value) ui->doubleSpinBoxAngle->setValue(angle); VisToolNormal *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->SetAngle(angle); } @@ -296,7 +296,7 @@ void DialogNormal::SetFormula(const QString &value) ui->plainTextEditFormula->setPlainText(formula); VisToolNormal *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLength(formula); MoveCursorToEnd(ui->plainTextEditFormula); diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp index 3872c8465..7e6dc55c4 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp @@ -92,7 +92,7 @@ void DialogPointFromArcAndTangent::SetArcId(const quint32 &value) setCurrentArcId(ui->comboBoxArc, value); VisToolPointFromArcAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setArcId(value); } @@ -108,7 +108,7 @@ void DialogPointFromArcAndTangent::SetTangentPointId(const quint32 &value) setCurrentPointId(ui->comboBoxTangentPoint, value); VisToolPointFromArcAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject1Id(value); } @@ -127,7 +127,7 @@ void DialogPointFromArcAndTangent::SetCrossCirclesPoint(const CrossCirclesPoint ui->comboBoxResult->setCurrentIndex(index); VisToolPointFromArcAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setCrossPoint(p); } } @@ -140,7 +140,7 @@ void DialogPointFromArcAndTangent::ChosenObject(quint32 id, const SceneObject &t if (type == SceneObject::Point || type == SceneObject::Arc) { VisToolPointFromArcAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) switch (number) { @@ -186,7 +186,7 @@ void DialogPointFromArcAndTangent::SaveData() pointName = ui->lineEditNamePoint->text(); VisToolPointFromArcAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject1Id(GetTangentPointId()); point->setArcId(GetArcId()); diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp index 05a14d45f..605571dfd 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -126,7 +126,7 @@ void DialogPointFromCircleAndTangent::SetCircleCenterId(const quint32 &value) setCurrentPointId(ui->comboBoxCircleCenter, value); VisToolPointFromCircleAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject2Id(value); } @@ -149,7 +149,7 @@ void DialogPointFromCircleAndTangent::SetCircleRadius(const QString &value) ui->plainTextEditRadius->setPlainText(formula); VisToolPointFromCircleAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setCRadius(formula); MoveCursorToEnd(ui->plainTextEditRadius); @@ -167,7 +167,7 @@ void DialogPointFromCircleAndTangent::SetTangentPointId(const quint32 &value) setCurrentPointId(ui->comboBoxTangentPoint, value); VisToolPointFromCircleAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject1Id(value); } @@ -186,7 +186,7 @@ void DialogPointFromCircleAndTangent::SetCrossCirclesPoint(const CrossCirclesPoi ui->comboBoxResult->setCurrentIndex(index); VisToolPointFromCircleAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setCrossPoint(p); } } @@ -199,7 +199,7 @@ void DialogPointFromCircleAndTangent::ChosenObject(quint32 id, const SceneObject if (type == SceneObject::Point) { VisToolPointFromCircleAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) switch (number) { @@ -313,7 +313,7 @@ void DialogPointFromCircleAndTangent::SaveData() radius.replace("\n", " "); VisToolPointFromCircleAndTangent *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject1Id(GetTangentPointId()); point->setObject2Id(GetCircleCenterId()); @@ -332,7 +332,7 @@ void DialogPointFromCircleAndTangent::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void DialogPointFromCircleAndTangent::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagFormula && flagName && flagError && flagCircleRadius); // In case dialog hasn't apply button if ( bApply != nullptr) diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp index 633c7f966..9d684c2be 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp @@ -172,7 +172,7 @@ void DialogPointOfContact::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolPointOfContact *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -229,7 +229,7 @@ void DialogPointOfContact::SaveData() radius.replace("\n", " "); VisToolPointOfContact *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetFirstPoint()); line->setLineP2Id(GetSecondPoint()); @@ -255,7 +255,7 @@ void DialogPointOfContact::SetSecondPoint(const quint32 &value) setCurrentPointId(ui->comboBoxSecondPoint, value); VisToolPointOfContact *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLineP2Id(value); } @@ -269,7 +269,7 @@ void DialogPointOfContact::SetFirstPoint(const quint32 &value) setCurrentPointId(ui->comboBoxFirstPoint, value); VisToolPointOfContact *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -283,7 +283,7 @@ void DialogPointOfContact::setCenter(const quint32 &value) setCurrentPointId(ui->comboBoxCenter, value); VisToolPointOfContact *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setRadiusId(value); } @@ -303,7 +303,7 @@ void DialogPointOfContact::setRadius(const QString &value) ui->plainTextEditFormula->setPlainText(radius); VisToolPointOfContact *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setRadius(radius); MoveCursorToEnd(ui->plainTextEditFormula); diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp index 60c4da141..f9a2936ca 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp @@ -95,7 +95,7 @@ void DialogPointOfIntersection::SetSecondPointId(const quint32 &value) setCurrentPointId(ui->comboBoxSecondPoint, value); VisToolPointOfIntersection *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setPoint2Id(value); } @@ -112,7 +112,7 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type if (type == SceneObject::Point) { VisToolPointOfIntersection *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -149,7 +149,7 @@ void DialogPointOfIntersection::SaveData() pointName = ui->lineEditNamePoint->text(); VisToolPointOfIntersection *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetFirstPointId()); line->setPoint2Id(GetSecondPointId()); @@ -191,7 +191,7 @@ void DialogPointOfIntersection::SetFirstPointId(const quint32 &value) setCurrentPointId(ui->comboBoxFirstPoint, value); VisToolPointOfIntersection *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp index 298d922d7..7ca16810b 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp @@ -98,7 +98,7 @@ void DialogPointOfIntersectionArcs::SetFirstArcId(const quint32 &value) setCurrentArcId(ui->comboBoxArc1, value); VisToolPointOfIntersectionArcs *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setArc1Id(value); } @@ -114,7 +114,7 @@ void DialogPointOfIntersectionArcs::SetSecondArcId(const quint32 &value) setCurrentArcId(ui->comboBoxArc2, value); VisToolPointOfIntersectionArcs *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setArc2Id(value); } @@ -133,7 +133,7 @@ void DialogPointOfIntersectionArcs::SetCrossArcPoint(const CrossCirclesPoint &p) ui->comboBoxResult->setCurrentIndex(index); VisToolPointOfIntersectionArcs *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setCrossPoint(p); } } @@ -146,7 +146,7 @@ void DialogPointOfIntersectionArcs::ChosenObject(quint32 id, const SceneObject & if (type == SceneObject::Arc) { VisToolPointOfIntersectionArcs *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) switch (number) { @@ -208,7 +208,7 @@ void DialogPointOfIntersectionArcs::SaveData() pointName = ui->lineEditNamePoint->text(); VisToolPointOfIntersectionArcs *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setArc1Id(GetFirstArcId()); point->setArc2Id(GetSecondArcId()); diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp index c50f45957..fc4c56d79 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -142,7 +142,7 @@ void DialogPointOfIntersectionCircles::SetFirstCircleCenterId(const quint32 &val setCurrentPointId(ui->comboBoxCircle1Center, value); VisToolPointOfIntersectionCircles *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject1Id(value); } @@ -158,7 +158,7 @@ void DialogPointOfIntersectionCircles::SetSecondCircleCenterId(const quint32 &va setCurrentPointId(ui->comboBoxCircle2Center, value); VisToolPointOfIntersectionCircles *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject2Id(value); } @@ -181,7 +181,7 @@ void DialogPointOfIntersectionCircles::SetFirstCircleRadius(const QString &value ui->plainTextEditCircle1Radius->setPlainText(formula); VisToolPointOfIntersectionCircles *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setC1Radius(formula); MoveCursorToEnd(ui->plainTextEditCircle1Radius); @@ -206,7 +206,7 @@ void DialogPointOfIntersectionCircles::SetSecondCircleRadius(const QString &valu ui->plainTextEditCircle2Radius->setPlainText(formula); VisToolPointOfIntersectionCircles *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setC2Radius(formula); MoveCursorToEnd(ui->plainTextEditCircle2Radius); @@ -227,7 +227,7 @@ void DialogPointOfIntersectionCircles::SetCrossCirclesPoint(const CrossCirclesPo ui->comboBoxResult->setCurrentIndex(index); VisToolPointOfIntersectionCircles *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setCrossPoint(p); } } @@ -240,7 +240,7 @@ void DialogPointOfIntersectionCircles::ChosenObject(quint32 id, const SceneObjec if (type == SceneObject::Point) { VisToolPointOfIntersectionCircles *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) switch (number) { @@ -405,7 +405,7 @@ void DialogPointOfIntersectionCircles::SaveData() c2Radius.replace("\n", " "); VisToolPointOfIntersectionCircles *point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject1Id(GetFirstCircleCenterId()); point->setObject2Id(GetSecondCircleCenterId()); @@ -426,7 +426,7 @@ void DialogPointOfIntersectionCircles::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void DialogPointOfIntersectionCircles::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagFormula && flagName && flagError && flagCircle1Radius && flagCircle2Radius); // In case dialog hasn't apply button if ( bApply != nullptr) diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp index 9d26ad3b2..1beca4ce3 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp @@ -101,7 +101,7 @@ void DialogPointOfIntersectionCurves::SetFirstCurveId(const quint32 &value) setCurrentCurveId(ui->comboBoxCurve1, value); auto point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject1Id(value); } @@ -117,7 +117,7 @@ void DialogPointOfIntersectionCurves::SetSecondCurveId(const quint32 &value) setCurrentCurveId(ui->comboBoxCurve2, value); auto point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject2Id(value); } @@ -136,7 +136,7 @@ void DialogPointOfIntersectionCurves::SetVCrossPoint(const VCrossCurvesPoint &vP ui->comboBoxVCorrection->setCurrentIndex(index); auto point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setVCrossPoint(vP); } } @@ -156,7 +156,7 @@ void DialogPointOfIntersectionCurves::SetHCrossPoint(const HCrossCurvesPoint &hP ui->comboBoxHCorrection->setCurrentIndex(index); auto point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setHCrossPoint(hP); } } @@ -172,7 +172,7 @@ void DialogPointOfIntersectionCurves::ChosenObject(quint32 id, const SceneObject || type == SceneObject::SplinePath) { auto point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) switch (number) { @@ -215,7 +215,7 @@ void DialogPointOfIntersectionCurves::SaveData() pointName = ui->lineEditNamePoint->text(); auto point = qobject_cast(vis); - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) point->setObject1Id(GetFirstCurveId()); point->setObject2Id(GetSecondCurveId()); @@ -227,7 +227,7 @@ void DialogPointOfIntersectionCurves::SaveData() //--------------------------------------------------------------------------------------------------------------------- void DialogPointOfIntersectionCurves::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagName && flagError); // In case dialog hasn't apply button if ( bApply != nullptr) diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.cpp b/src/libs/vtools/dialogs/tools/dialogrotation.cpp index 4e7a6bb2f..f130e6371 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.cpp +++ b/src/libs/vtools/dialogs/tools/dialogrotation.cpp @@ -121,7 +121,7 @@ void DialogRotation::SetOrigPointId(const quint32 &value) { ChangeCurrentData(ui->comboBoxOriginPoint, value); VisToolRotation *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetOriginPointId(value); } @@ -143,7 +143,7 @@ void DialogRotation::SetAngle(const QString &value) ui->plainTextEditFormula->setPlainText(formulaAngle); VisToolRotation *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditFormula); @@ -181,11 +181,11 @@ void DialogRotation::ShowDialog(bool click) stage1 = false; VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) scene->clearSelection(); VisToolRotation *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetObjects(objects.toVector()); operation->VisualMode(); @@ -205,7 +205,7 @@ void DialogRotation::ShowDialog(bool click) { /*We will ignore click if pointer is in point circle*/ VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) const QSharedPointer point = data->GeometricObject(GetOrigPointId()); const QLineF line = QLineF(*point, scene->getScenePos()); @@ -217,7 +217,7 @@ void DialogRotation::ShowDialog(bool click) } VisToolRotation *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) SetAngle(operation->Angle());//Show in dialog angle that a user choose setModal(true); @@ -243,9 +243,9 @@ void DialogRotation::ChosenObject(quint32 id, const SceneObject &type) if (SetObject(id, ui->comboBoxOriginPoint, "")) { VisToolRotation *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow()); - SCASSERT(window != nullptr); + SCASSERT(window != nullptr) connect(operation, &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip); operation->SetOriginPointId(id); @@ -348,9 +348,9 @@ void DialogRotation::SuffixChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogRotation::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagAngle && flagName && flagError); - SCASSERT(bApply != nullptr); + SCASSERT(bApply != nullptr) bApply->setEnabled(bOk->isEnabled()); } @@ -369,7 +369,7 @@ void DialogRotation::SaveData() formulaAngle.replace("\n", " "); VisToolRotation *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetObjects(objects.toVector()); operation->SetOriginPointId(GetOrigPointId()); diff --git a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp index b25739dd8..0b4d9ed11 100644 --- a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp @@ -176,7 +176,7 @@ void DialogShoulderPoint::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolShoulderPoint *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -233,7 +233,7 @@ void DialogShoulderPoint::SaveData() formula.replace("\n", " "); VisToolShoulderPoint *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetP3()); line->setLineP1Id(GetP1Line()); @@ -260,7 +260,7 @@ void DialogShoulderPoint::SetP3(const quint32 &value) setCurrentPointId(ui->comboBoxP3, value); VisToolShoulderPoint *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } @@ -286,7 +286,7 @@ void DialogShoulderPoint::SetP2Line(const quint32 &value) setCurrentPointId(ui->comboBoxP2Line, value); VisToolShoulderPoint *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLineP2Id(value); } @@ -300,7 +300,7 @@ void DialogShoulderPoint::SetP1Line(const quint32 &value) setCurrentPointId(ui->comboBoxP1Line, value); VisToolShoulderPoint *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLineP1Id(value); } @@ -320,7 +320,7 @@ void DialogShoulderPoint::SetFormula(const QString &value) ui->plainTextEditFormula->setPlainText(formula); VisToolShoulderPoint *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setLength(formula); MoveCursorToEnd(ui->plainTextEditFormula); } diff --git a/src/libs/vtools/dialogs/tools/dialogspline.cpp b/src/libs/vtools/dialogs/tools/dialogspline.cpp index f1075487b..e89d1db5b 100644 --- a/src/libs/vtools/dialogs/tools/dialogspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogspline.cpp @@ -132,10 +132,10 @@ DialogSpline::DialogSpline(const VContainer *data, const quint32 &toolId, QWidge vis = new VisToolSpline(data); auto path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) auto scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) connect(scene, &VMainGraphicsScene::MouseLeftPressed, path, &VisToolSpline::MouseLeftPressed); connect(scene, &VMainGraphicsScene::MouseLeftReleased, path, &VisToolSpline::MouseLeftReleased); } @@ -159,7 +159,7 @@ void DialogSpline::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { auto *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) switch (number) { @@ -201,7 +201,7 @@ void DialogSpline::SaveData() newDuplicate <= -1 ? spl.SetDuplicate(d) : spl.SetDuplicate(static_cast(newDuplicate)); auto path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(GetP1()->id()); path->setObject4Id(GetP4()->id()); @@ -523,7 +523,7 @@ void DialogSpline::ShowDialog(bool click) if (prepare && click) { auto *path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) spl = VSpline(*GetP1(), path->GetP2(), path->GetP3(), *GetP4()); @@ -553,7 +553,7 @@ void DialogSpline::ShowDialog(bool click) //--------------------------------------------------------------------------------------------------------------------- void DialogSpline::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagAngle1 && flagAngle2 && flagLength1 && flagLength2 && flagError); // In case dialog hasn't apply button if ( bApply != nullptr) @@ -600,7 +600,7 @@ void DialogSpline::SetSpline(const VSpline &spline) ui->lineEditSplineName->setText(spl.name()); auto path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) path->setObject1Id(spl.GetP1().id()); path->setObject4Id(spl.GetP4().id()); diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp index 5d1aad667..ac35e9874 100644 --- a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp @@ -127,10 +127,10 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, const quint32 &toolId vis = new VisToolSplinePath(data); auto path = qobject_cast(vis); - SCASSERT(path != nullptr); + SCASSERT(path != nullptr) auto scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) connect(scene, &VMainGraphicsScene::MouseLeftPressed, path, &VisToolSplinePath::MouseLeftPressed); connect(scene, &VMainGraphicsScene::MouseLeftReleased, path, &VisToolSplinePath::MouseLeftReleased); } @@ -164,7 +164,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value) ui->lineEditSplPathName->setText(path.name()); auto visPath = qobject_cast(vis); - SCASSERT(visPath != nullptr); + SCASSERT(visPath != nullptr) visPath->setPath(path); ui->listWidget->blockSignals(false); } @@ -205,14 +205,14 @@ void DialogSplinePath::ChosenObject(quint32 id, const SceneObject &type) SavePath(); auto visPath = qobject_cast(vis); - SCASSERT(visPath != nullptr); + SCASSERT(visPath != nullptr) visPath->setPath(path); if (path.CountPoints() == 1) { visPath->VisualMode(NULL_ID); VAbstractMainWindow *window = qobject_cast(qApp->getMainWindow()); - SCASSERT(window != nullptr); + SCASSERT(window != nullptr) connect(visPath, &VisToolSplinePath::ToolTip, window, &VAbstractMainWindow::ShowToolTip); connect(visPath, &VisToolSplinePath::PathChanged, this, &DialogSplinePath::PathUpdated); @@ -235,7 +235,7 @@ void DialogSplinePath::SaveData() newDuplicate <= -1 ? path.SetDuplicate(d) : path.SetDuplicate(static_cast(newDuplicate)); auto visPath = qobject_cast(vis); - SCASSERT(visPath != nullptr); + SCASSERT(visPath != nullptr) visPath->setPath(path); visPath->SetMode(Mode::Show); visPath->RefreshGeometry(); @@ -244,7 +244,7 @@ void DialogSplinePath::SaveData() //--------------------------------------------------------------------------------------------------------------------- void DialogSplinePath::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bool fAngle1 = true, fAngle2 = true, fLength1 = true, fLength2 = true; @@ -310,7 +310,7 @@ void DialogSplinePath::Angle1Changed() if (row != 0) { QListWidgetItem *item = ui->listWidget->item(row); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VSplinePoint p = qvariant_cast(item->data(Qt::UserRole)); const QString angle1F = ui->plainTextEditAngle1F->toPlainText().replace("\n", " "); @@ -353,7 +353,7 @@ void DialogSplinePath::Angle2Changed() if (row != ui->listWidget->count()-1) { QListWidgetItem *item = ui->listWidget->item(row); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VSplinePoint p = qvariant_cast(item->data(Qt::UserRole)); const QString angle2F = ui->plainTextEditAngle2F->toPlainText().replace("\n", " "); @@ -396,7 +396,7 @@ void DialogSplinePath::Length1Changed() if (row != 0) { QListWidgetItem *item = ui->listWidget->item(row); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VSplinePoint p = qvariant_cast(item->data(Qt::UserRole)); const QString length1F = ui->plainTextEditLength1F->toPlainText().replace("\n", " "); @@ -430,7 +430,7 @@ void DialogSplinePath::Length2Changed() if (row != ui->listWidget->count()-1) { QListWidgetItem *item = ui->listWidget->item(row); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VSplinePoint p = qvariant_cast(item->data(Qt::UserRole)); const QString length2F = ui->plainTextEditLength2F->toPlainText().replace("\n", " "); @@ -565,7 +565,7 @@ void DialogSplinePath::EvalAngle1() Eval(ui->plainTextEditAngle1F->toPlainText(), flagAngle1[row], ui->labelResultAngle1, degreeSymbol, false); QListWidgetItem *item = ui->listWidget->item(row); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VSplinePoint p = qvariant_cast(item->data(Qt::UserRole)); ShowPointIssue(p.P().name()); @@ -584,7 +584,7 @@ void DialogSplinePath::EvalAngle2() Eval(ui->plainTextEditAngle2F->toPlainText(), flagAngle2[row], ui->labelResultAngle2, degreeSymbol, false); QListWidgetItem *item = ui->listWidget->item(row); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VSplinePoint p = qvariant_cast(item->data(Qt::UserRole)); ShowPointIssue(p.P().name()); @@ -615,7 +615,7 @@ void DialogSplinePath::EvalLength1() } QListWidgetItem *item = ui->listWidget->item(row); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VSplinePoint p = qvariant_cast(item->data(Qt::UserRole)); ShowPointIssue(p.P().name()); @@ -646,7 +646,7 @@ void DialogSplinePath::EvalLength2() } QListWidgetItem *item = ui->listWidget->item(row); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VSplinePoint p = qvariant_cast(item->data(Qt::UserRole)); ShowPointIssue(p.P().name()); @@ -959,7 +959,7 @@ void DialogSplinePath::ShowPointIssue(const QString &pName) } QListWidgetItem *item = ui->listWidget->item(row); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) if (flagAngle1.at(row) && flagAngle2.at(row) && flagLength1.at(row) && flagLength2.at(row)) { diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index c2146dc8b..3b577fe76 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -93,7 +93,7 @@ DialogTool::DialogTool(const VContainer *data, const quint32 &toolId, QWidget *p okColor(QColor(76, 76, 76)), errorColor(Qt::red), associatedTool(nullptr), toolId(toolId), prepare(false), pointName(QString()), number(0), vis(nullptr) { - SCASSERT(data != nullptr); + SCASSERT(data != nullptr) timerFormula = new QTimer(this); connect(timerFormula, &QTimer::timeout, this, &DialogTool::EvalFormula); } @@ -165,7 +165,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, FillComboBox rule, const quint //--------------------------------------------------------------------------------------------------------------------- void DialogTool::FillComboBoxSplines(QComboBox *box) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->blockSignals(true); const auto objs = data->DataGObjects(); @@ -189,7 +189,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box) const //--------------------------------------------------------------------------------------------------------------------- void DialogTool::FillComboBoxSplinesPath(QComboBox *box) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->blockSignals(true); const auto objs = data->DataGObjects(); @@ -213,7 +213,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box) const //--------------------------------------------------------------------------------------------------------------------- void DialogTool::FillComboBoxCurves(QComboBox *box) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) const auto objs = data->DataGObjects(); QMap list; QHash >::const_iterator i; @@ -243,7 +243,7 @@ void DialogTool::FillComboBoxCurves(QComboBox *box) const */ void DialogTool::FillComboBoxTypeLine(QComboBox *box, const QMap &stylesPics) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) QMap::const_iterator i = stylesPics.constBegin(); while (i != stylesPics.constEnd()) { @@ -257,7 +257,7 @@ void DialogTool::FillComboBoxTypeLine(QComboBox *box, const QMap //--------------------------------------------------------------------------------------------------------------------- void DialogTool::FillComboBoxLineColors(QComboBox *box) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->clear(); int size = box->iconSize().height(); @@ -280,7 +280,7 @@ void DialogTool::FillComboBoxLineColors(QComboBox *box) const //--------------------------------------------------------------------------------------------------------------------- void DialogTool::FillComboBoxCrossCirclesPoints(QComboBox *box) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->addItem(tr("First point"), QVariant(static_cast(CrossCirclesPoint::FirstPoint))); box->addItem(tr("Second point"), QVariant(static_cast(CrossCirclesPoint::SecondPoint))); @@ -289,7 +289,7 @@ void DialogTool::FillComboBoxCrossCirclesPoints(QComboBox *box) const //--------------------------------------------------------------------------------------------------------------------- void DialogTool::FillComboBoxVCrossCurvesPoint(QComboBox *box) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->addItem(tr("Highest point"), QVariant(static_cast(VCrossCurvesPoint::HighestPoint))); box->addItem(tr("Lowest point"), QVariant(static_cast(VCrossCurvesPoint::LowestPoint))); @@ -298,7 +298,7 @@ void DialogTool::FillComboBoxVCrossCurvesPoint(QComboBox *box) const //--------------------------------------------------------------------------------------------------------------------- void DialogTool::FillComboBoxHCrossCurvesPoint(QComboBox *box) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->addItem(tr("Leftmost point"), QVariant(static_cast(HCrossCurvesPoint::LeftmostPoint))); box->addItem(tr("Rightmost point"), QVariant(static_cast(HCrossCurvesPoint::RightmostPoint))); @@ -340,7 +340,7 @@ void DialogTool::ChangeCurrentData(QComboBox *box, const QVariant &value) const //--------------------------------------------------------------------------------------------------------------------- void DialogTool::MoveCursorToEnd(QPlainTextEdit *plainTextEdit) { - SCASSERT(plainTextEdit != nullptr); + SCASSERT(plainTextEdit != nullptr) QTextCursor cursor = plainTextEdit->textCursor(); cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor); plainTextEdit->setTextCursor(cursor); @@ -411,10 +411,10 @@ bool DialogTool::IsSplinePath(const QSharedPointer &obj) const */ void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer, const QString& postfix) { - SCASSERT(edit != nullptr); - SCASSERT(timer != nullptr); - SCASSERT(labelEditFormula != nullptr); - SCASSERT(labelResultCalculation != nullptr); + SCASSERT(edit != nullptr) + SCASSERT(timer != nullptr) + SCASSERT(labelEditFormula != nullptr) + SCASSERT(labelResultCalculation != nullptr) if (edit->text().isEmpty()) { flag = false; @@ -436,10 +436,10 @@ void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer, c //--------------------------------------------------------------------------------------------------------------------- void DialogTool::ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer *timer, const QString& postfix) { - SCASSERT(edit != nullptr); - SCASSERT(timer != nullptr); - SCASSERT(labelEditFormula != nullptr); - SCASSERT(labelResultCalculation != nullptr); + SCASSERT(edit != nullptr) + SCASSERT(timer != nullptr) + SCASSERT(labelEditFormula != nullptr) + SCASSERT(labelResultCalculation != nullptr) if (edit->toPlainText().isEmpty()) { flag = false; @@ -473,9 +473,9 @@ void DialogTool::ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer *tim qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QString& postfix, bool checkZero) { qDebug() << "Eval started"; - SCASSERT(label != nullptr); + SCASSERT(label != nullptr) qDebug() << "Label ok"; - SCASSERT(labelEditFormula != nullptr); + SCASSERT(labelEditFormula != nullptr) qDebug() << "lef ok"; qreal result = INT_MIN;//Value can be 0, so use max imposible value @@ -548,7 +548,7 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt void DialogTool::setCurrentPointId(QComboBox *box, const quint32 &value, FillComboBox rule, const quint32 &ch1, const quint32 &ch2) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->blockSignals(true); @@ -564,7 +564,7 @@ void DialogTool::setCurrentPointId(QComboBox *box, const quint32 &value, FillCom */ void DialogTool::setCurrentSplineId(QComboBox *box, const quint32 &value) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) FillComboBoxSplines(box); ChangeCurrentData(box, value); } @@ -576,7 +576,7 @@ void DialogTool::setCurrentSplineId(QComboBox *box, const quint32 &value) const void DialogTool::setCurrentArcId(QComboBox *box, const quint32 &value, FillComboBox rule, const quint32 &ch1, const quint32 &ch2) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) FillComboBoxArcs(box, rule, ch1, ch2); ChangeCurrentData(box, value); } @@ -589,7 +589,7 @@ void DialogTool::setCurrentArcId(QComboBox *box, const quint32 &value, FillCombo */ void DialogTool::setCurrentSplinePathId(QComboBox *box, const quint32 &value) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) FillComboBoxSplinesPath(box); ChangeCurrentData(box, value); } @@ -597,7 +597,7 @@ void DialogTool::setCurrentSplinePathId(QComboBox *box, const quint32 &value) co //--------------------------------------------------------------------------------------------------------------------- void DialogTool::setCurrentCurveId(QComboBox *box, const quint32 &value) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) FillComboBoxCurves(box); ChangeCurrentData(box, value); } @@ -610,7 +610,7 @@ void DialogTool::setCurrentCurveId(QComboBox *box, const quint32 &value) const */ quint32 DialogTool::getCurrentObjectId(QComboBox *box) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) qint32 index = box->currentIndex(); if (index != -1) { @@ -625,7 +625,7 @@ quint32 DialogTool::getCurrentObjectId(QComboBox *box) const //--------------------------------------------------------------------------------------------------------------------- bool DialogTool::SetObject(const quint32 &id, QComboBox *box, const QString &toolTip) { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) const qint32 index = box->findData(id); if ( index != -1 ) { // -1 for not found @@ -643,8 +643,8 @@ bool DialogTool::SetObject(const quint32 &id, QComboBox *box, const QString &too //--------------------------------------------------------------------------------------------------------------------- void DialogTool::DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight) { - SCASSERT(formula != nullptr); - SCASSERT(buttonGrowLength != nullptr); + SCASSERT(formula != nullptr) + SCASSERT(buttonGrowLength != nullptr) const QTextCursor cursor = formula->textCursor(); @@ -687,7 +687,7 @@ void DialogTool::DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowL */ void DialogTool::FillList(QComboBox *box, const QMap &list) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->clear(); QMapIterator iter(list); @@ -703,7 +703,7 @@ template void DialogTool::PrepareList(QMap &list, quint32 id) const { const auto obj = data->GeometricObject(id); - SCASSERT(obj != nullptr); + SCASSERT(obj != nullptr) QString newName = obj->name(); int bias = 0; @@ -730,7 +730,7 @@ bool DialogTool::IsSpline(const QSharedPointer &obj) const */ void DialogTool::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagFormula && flagName && flagError); // In case dialog hasn't apply button if ( bApply != nullptr) @@ -765,7 +765,7 @@ void DialogTool::SelectedObject(bool selected, quint32 object, quint32 tool) */ void DialogTool::NamePointChanged() { - SCASSERT(labelEditNamePoint != nullptr); + SCASSERT(labelEditNamePoint != nullptr) QLineEdit* edit = qobject_cast(sender()); if (edit) { @@ -789,7 +789,7 @@ void DialogTool::NamePointChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogTool::ChangeColor(QWidget *widget, const QColor &color) { - SCASSERT(widget != nullptr); + SCASSERT(widget != nullptr) QPalette palette = widget->palette(); palette.setColor(widget->foregroundRole(), color); widget->setPalette(palette); @@ -849,7 +849,7 @@ void DialogTool::FormulaChangedPlainText() //-V524 */ void DialogTool::ArrowUp() { - SCASSERT(spinBoxAngle != nullptr); + SCASSERT(spinBoxAngle != nullptr) spinBoxAngle->setValue(90); } @@ -859,7 +859,7 @@ void DialogTool::ArrowUp() */ void DialogTool::ArrowDown() { - SCASSERT(spinBoxAngle != nullptr); + SCASSERT(spinBoxAngle != nullptr) spinBoxAngle->setValue(270); } @@ -869,7 +869,7 @@ void DialogTool::ArrowDown() */ void DialogTool::ArrowLeft() { - SCASSERT(spinBoxAngle != nullptr); + SCASSERT(spinBoxAngle != nullptr) spinBoxAngle->setValue(180); } @@ -879,7 +879,7 @@ void DialogTool::ArrowLeft() */ void DialogTool::ArrowRight() { - SCASSERT(spinBoxAngle != nullptr); + SCASSERT(spinBoxAngle != nullptr) spinBoxAngle->setValue(0); } @@ -889,7 +889,7 @@ void DialogTool::ArrowRight() */ void DialogTool::ArrowLeftUp() { - SCASSERT(spinBoxAngle != nullptr); + SCASSERT(spinBoxAngle != nullptr) spinBoxAngle->setValue(135); } @@ -899,7 +899,7 @@ void DialogTool::ArrowLeftUp() */ void DialogTool::ArrowLeftDown() { - SCASSERT(spinBoxAngle != nullptr); + SCASSERT(spinBoxAngle != nullptr) spinBoxAngle->setValue(225); } @@ -909,7 +909,7 @@ void DialogTool::ArrowLeftDown() */ void DialogTool::ArrowRightUp() { - SCASSERT(spinBoxAngle != nullptr); + SCASSERT(spinBoxAngle != nullptr) spinBoxAngle->setValue(45); } @@ -919,7 +919,7 @@ void DialogTool::ArrowRightUp() */ void DialogTool::ArrowRightDown() { - SCASSERT(spinBoxAngle != nullptr); + SCASSERT(spinBoxAngle != nullptr) spinBoxAngle->setValue(315); } @@ -929,8 +929,8 @@ void DialogTool::ArrowRightDown() */ void DialogTool::EvalFormula() { - SCASSERT(plainTextEditFormula != nullptr); - SCASSERT(labelResultCalculation != nullptr); + SCASSERT(plainTextEditFormula != nullptr) + SCASSERT(labelResultCalculation != nullptr) const QString postfix = VDomDocument::UnitsToStr(qApp->patternUnit());//Show unit in dialog lable (cm, mm or inch) Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix, false); } @@ -986,7 +986,7 @@ template void DialogTool::FillCombo(QComboBox *box, GOType gType, FillComboBox rule, const quint32 &ch1, const quint32 &ch2) const { - SCASSERT(box != nullptr); + SCASSERT(box != nullptr) box->blockSignals(true); const QHash > *objs = data->DataGObjects(); diff --git a/src/libs/vtools/dialogs/tools/dialogtool.h b/src/libs/vtools/dialogs/tools/dialogtool.h index cc5d29af8..388832a0d 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.h +++ b/src/libs/vtools/dialogs/tools/dialogtool.h @@ -300,7 +300,7 @@ inline VAbstractTool *DialogTool::GetAssociatedTool() template inline void DialogTool::InitArrow(T *ui) { - SCASSERT(ui != nullptr); + SCASSERT(ui != nullptr) spinBoxAngle = ui->doubleSpinBoxAngle; connect(ui->toolButtonArrowDown, &QPushButton::clicked, this, &DialogTool::ArrowDown); connect(ui->toolButtonArrowUp, &QPushButton::clicked, this, &DialogTool::ArrowUp); @@ -322,7 +322,7 @@ inline void DialogTool::InitOkCancelApply(T *ui) { InitOkCancel(ui); bApply = ui->buttonBox->button(QDialogButtonBox::Apply); - SCASSERT(bApply != nullptr); + SCASSERT(bApply != nullptr) connect(bApply, &QPushButton::clicked, this, &DialogTool::DialogApply); } @@ -335,11 +335,11 @@ template inline void DialogTool::InitOkCancel(T *ui) { bOk = ui->buttonBox->button(QDialogButtonBox::Ok); - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted); QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel); - SCASSERT(bCancel != nullptr); + SCASSERT(bCancel != nullptr) connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected); qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c()); @@ -365,10 +365,10 @@ inline void DialogTool::AddVisualization() if (prepare == false) { VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) T *toolVis = qobject_cast(vis); - SCASSERT(toolVis != nullptr); + SCASSERT(toolVis != nullptr) if (not scene->items().contains(toolVis)) { diff --git a/src/libs/vtools/dialogs/tools/dialogtriangle.cpp b/src/libs/vtools/dialogs/tools/dialogtriangle.cpp index f8e52f700..d9c4be59f 100644 --- a/src/libs/vtools/dialogs/tools/dialogtriangle.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtriangle.cpp @@ -103,7 +103,7 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolTriangle *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) switch (number) { @@ -176,7 +176,7 @@ void DialogTriangle::SaveData() pointName = ui->lineEditNamePoint->text(); VisToolTriangle *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(GetAxisP1Id()); line->setObject2Id(GetAxisP2Id()); @@ -239,7 +239,7 @@ void DialogTriangle::SetSecondPointId(const quint32 &value) setCurrentPointId(ui->comboBoxSecondPoint, value); VisToolTriangle *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setHypotenuseP2Id(value); } @@ -253,7 +253,7 @@ void DialogTriangle::SetFirstPointId(const quint32 &value) setCurrentPointId(ui->comboBoxFirstPoint, value); VisToolTriangle *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setHypotenuseP1Id(value); } @@ -267,7 +267,7 @@ void DialogTriangle::SetAxisP2Id(const quint32 &value) setCurrentPointId(ui->comboBoxAxisP2, value); VisToolTriangle *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject2Id(value); } @@ -281,7 +281,7 @@ void DialogTriangle::SetAxisP1Id(const quint32 &value) setCurrentPointId(ui->comboBoxAxisP1, value); VisToolTriangle *line = qobject_cast(vis); - SCASSERT(line != nullptr); + SCASSERT(line != nullptr) line->setObject1Id(value); } diff --git a/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp b/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp index dd4152eab..a0d4ba69f 100644 --- a/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp @@ -145,7 +145,7 @@ void DialogTrueDarts::SetFirstBasePointId(const quint32 &value) setCurrentPointId(ui->comboBoxFirstBasePoint, value, FillComboBox::NoChildren, ch1, ch2); VisToolTrueDarts *points = qobject_cast(vis); - SCASSERT(points != nullptr); + SCASSERT(points != nullptr) points->setObject1Id(value); } @@ -161,7 +161,7 @@ void DialogTrueDarts::SetSecondBasePointId(const quint32 &value) setCurrentPointId(ui->comboBoxSecondBasePoint, value, FillComboBox::NoChildren, ch1, ch2); VisToolTrueDarts *points = qobject_cast(vis); - SCASSERT(points != nullptr); + SCASSERT(points != nullptr) points->setObject2Id(value); } @@ -177,7 +177,7 @@ void DialogTrueDarts::SetFirstDartPointId(const quint32 &value) setCurrentPointId(ui->comboBoxFirstDartPoint, value, FillComboBox::NoChildren, ch1, ch2); VisToolTrueDarts *points = qobject_cast(vis); - SCASSERT(points != nullptr); + SCASSERT(points != nullptr) points->setD1PointId(value); } @@ -193,7 +193,7 @@ void DialogTrueDarts::SetSecondDartPointId(const quint32 &value) setCurrentPointId(ui->comboBoxSecondDartPoint, value, FillComboBox::NoChildren, ch1, ch2); VisToolTrueDarts *points = qobject_cast(vis); - SCASSERT(points != nullptr); + SCASSERT(points != nullptr) points->setD2PointId(value); } @@ -209,7 +209,7 @@ void DialogTrueDarts::SetThirdDartPointId(const quint32 &value) setCurrentPointId(ui->comboBoxThirdDartPoint, value, FillComboBox::NoChildren, ch1, ch2); VisToolTrueDarts *points = qobject_cast(vis); - SCASSERT(points != nullptr); + SCASSERT(points != nullptr) points->setD3PointId(value); } @@ -229,7 +229,7 @@ void DialogTrueDarts::ChosenObject(quint32 id, const SceneObject &type) if (type == SceneObject::Point) { VisToolTrueDarts *points = qobject_cast(vis); - SCASSERT(points != nullptr); + SCASSERT(points != nullptr) switch (number) { @@ -370,7 +370,7 @@ void DialogTrueDarts::SaveData() d2PointName = ui->lineEditSecondNewDartPoint->text(); VisToolTrueDarts *points = qobject_cast(vis); - SCASSERT(points != nullptr); + SCASSERT(points != nullptr) points->setObject1Id(GetFirstBasePointId()); points->setObject2Id(GetSecondBasePointId()); @@ -383,7 +383,7 @@ void DialogTrueDarts::SaveData() //--------------------------------------------------------------------------------------------------------------------- void DialogTrueDarts::CheckState() { - SCASSERT(bOk != nullptr); + SCASSERT(bOk != nullptr) bOk->setEnabled(flagName1 && flagName2 && flagError); // In case dialog hasn't apply button if ( bApply != nullptr) @@ -396,8 +396,8 @@ void DialogTrueDarts::CheckState() void DialogTrueDarts::NameChanged(QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name, QLineEdit* secondPointName, bool &flagName) { - SCASSERT(labelEditNamePoint != nullptr); - SCASSERT(secondPointName != nullptr); + SCASSERT(labelEditNamePoint != nullptr) + SCASSERT(secondPointName != nullptr) QLineEdit* edit = qobject_cast(sender()); if (edit) { @@ -420,9 +420,9 @@ void DialogTrueDarts::FillComboBoxs(const quint32 &ch1, const quint32 &ch2) void DialogTrueDarts::CheckName(QLineEdit *edit, QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name, QLineEdit *secondPointName, bool &flagName) { - SCASSERT(labelEditNamePoint != nullptr); - SCASSERT(secondPointName != nullptr); - SCASSERT(edit != nullptr); + SCASSERT(labelEditNamePoint != nullptr) + SCASSERT(secondPointName != nullptr) + SCASSERT(edit != nullptr) const QString name = edit->text(); const QString secondName = secondPointName->text(); diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index efebbbfa4..f160fb284 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -79,9 +79,9 @@ VToolFlippingByAxis::~VToolFlippingByAxis() //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByAxis::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogFlippingByAxis *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) dialogTool->SetOriginPointId(m_originPointId); dialogTool->SetAxisType(m_axisType); dialogTool->SetSuffix(suffix); @@ -91,9 +91,9 @@ void VToolFlippingByAxis::setDialog() VToolFlippingByAxis *VToolFlippingByAxis::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogFlippingByAxis *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 originPointId = dialogTool->GetOriginPointId(); const AxisType axisType = dialogTool->GetAxisType(); const QString suffix = dialogTool->GetSuffix(); @@ -177,7 +177,7 @@ void VToolFlippingByAxis::SetVisualization() if (not vis.isNull()) { VisToolFlippingByAxis *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->SetObjects(source); visual->SetOriginPointId(m_originPointId); @@ -189,9 +189,9 @@ void VToolFlippingByAxis::SetVisualization() //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByAxis::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogFlippingByAxis *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOriginPointId())); doc->SetAttribute(domElement, AttrAxisType, QString().setNum(static_cast(dialogTool->GetAxisType()))); diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index 3d0a9c443..fc35a2836 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -79,9 +79,9 @@ VToolFlippingByLine::~VToolFlippingByLine() //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByLine::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogFlippingByLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) dialogTool->SetFirstLinePointId(m_firstLinePointId); dialogTool->SetSecondLinePointId(m_secondLinePointId); dialogTool->SetSuffix(suffix); @@ -91,9 +91,9 @@ void VToolFlippingByLine::setDialog() VToolFlippingByLine *VToolFlippingByLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogFlippingByLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 firstLinePointId = dialogTool->GetFirstLinePointId(); const quint32 secondLinePointId = dialogTool->GetSecondLinePointId(); const QString suffix = dialogTool->GetSuffix(); @@ -157,7 +157,7 @@ void VToolFlippingByLine::SetVisualization() if (not vis.isNull()) { VisToolFlippingByLine *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->SetObjects(source); visual->SetFirstLinePointId(m_firstLinePointId); @@ -169,9 +169,9 @@ void VToolFlippingByLine::SetVisualization() //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByLine::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogFlippingByLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstLinePointId())); doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondLinePointId())); diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index 8949b583e..3c38954f1 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -75,13 +75,13 @@ void VAbstractOperation::GroupVisibility(quint32 object, bool visible) if (obj->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(obj); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setVisible(visible); } else { VSimpleCurve *item = qobject_cast(obj); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setVisible(visible); } } @@ -149,13 +149,13 @@ void VAbstractOperation::FullUpdateFromFile() if (i.value()->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->RefreshGeometry(*VAbstractTool::data.GeometricObject(i.key())); } else { VSimpleCurve *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->RefreshGeometry(VAbstractTool::data.GeometricObject(i.key())); } } @@ -173,13 +173,13 @@ void VAbstractOperation::SetFactor(qreal factor) if (i.value()->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->RefreshGeometry(*VAbstractTool::data.GeometricObject(i.key())); } else { VSimpleCurve *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->RefreshGeometry(VAbstractTool::data.GeometricObject(i.key())); } } @@ -195,13 +195,13 @@ void VAbstractOperation::AllowHover(bool enabled) if (i.value()->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setAcceptHoverEvents(enabled); } else { VSimpleCurve *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setAcceptHoverEvents(enabled); } } @@ -217,13 +217,13 @@ void VAbstractOperation::AllowSelecting(bool enabled) if (i.value()->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setFlag(QGraphicsItem::ItemIsSelectable, enabled); } else { VSimpleCurve *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setFlag(QGraphicsItem::ItemIsSelectable, enabled); } } @@ -239,7 +239,7 @@ void VAbstractOperation::AllowPointHover(bool enabled) if (i.value()->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setAcceptHoverEvents(enabled); } } @@ -255,7 +255,7 @@ void VAbstractOperation::AllowPointSelecting(bool enabled) if (i.value()->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->setFlag(QGraphicsItem::ItemIsSelectable, enabled); } } @@ -271,7 +271,7 @@ void VAbstractOperation::AllowPointLabelHover(bool enabled) if (i.value()->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->AllowLabelHover(enabled); } } @@ -287,7 +287,7 @@ void VAbstractOperation::AllowPointLabelSelecting(bool enabled) if (i.value()->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->AllowLabelSelecting(enabled); } } @@ -384,7 +384,7 @@ void VAbstractOperation::LabelChangePosition(const QPointF &pos, quint32 labelId if (obj->GetType() == GOType::Point) { VSimplePoint *item = qobject_cast(obj); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) ChangePosition(item, labelId, pos); } } @@ -496,7 +496,7 @@ void VAbstractOperation::DoChangePosition(quint32 id, qreal mx, qreal my) VAbstractTool::data.UpdateGObject(id, point); VSimplePoint *item = qobject_cast(operatedObjects.value(id)); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) item->RefreshGeometry(*point); } @@ -512,7 +512,7 @@ void VAbstractOperation::AllowCurveHover(bool enabled, GOType type) if (i.value()->GetType() != GOType::Point) { VSimpleCurve *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) if (item->GetType() == type) { item->setAcceptHoverEvents(enabled); @@ -531,7 +531,7 @@ void VAbstractOperation::AllowCurveSelecting(bool enabled, GOType type) if (i.value()->GetType() != GOType::Point) { VSimpleCurve *item = qobject_cast(i.value()); - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) if (item->GetType() == type) { item->setFlag(QGraphicsItem::ItemIsSelectable, enabled); diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h index 2d525f5cb..40c85247a 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h @@ -182,8 +182,8 @@ void VAbstractOperation::ShowToolVisualization(bool show) template void VAbstractOperation::InitOperationToolConnections(VMainGraphicsScene *scene, T *tool) { - SCASSERT(scene != nullptr); - SCASSERT(tool != nullptr); + SCASSERT(scene != nullptr) + SCASSERT(tool != nullptr) InitDrawToolConnections(scene, tool); diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp index 16cf893f3..931c2beba 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp @@ -87,9 +87,9 @@ VToolMove::~VToolMove() //--------------------------------------------------------------------------------------------------------------------- void VToolMove::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogMove *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) dialogTool->SetAngle(formulaAngle); dialogTool->SetLength(formulaLength); dialogTool->SetSuffix(suffix); @@ -99,9 +99,9 @@ void VToolMove::setDialog() VToolMove *VToolMove::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogMove *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) QString angle = dialogTool->GetAngle(); QString length = dialogTool->GetLength(); const QString suffix = dialogTool->GetSuffix(); @@ -300,7 +300,7 @@ void VToolMove::SetVisualization() if (not vis.isNull()) { VisToolMove *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->SetObjects(source); visual->SetAngle(qApp->TrVars()->FormulaToUser(formulaAngle, qApp->Settings()->GetOsSeparator())); @@ -312,9 +312,9 @@ void VToolMove::SetVisualization() //--------------------------------------------------------------------------------------------------------------------- void VToolMove::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogMove *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); QString length = dialogTool->GetLength(); diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index 010d961d1..889d0b81f 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -99,9 +99,9 @@ VToolRotation::~VToolRotation() //--------------------------------------------------------------------------------------------------------------------- void VToolRotation::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogRotation *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) dialogTool->SetOrigPointId(origPointId); dialogTool->SetAngle(formulaAngle); dialogTool->SetSuffix(suffix); @@ -111,9 +111,9 @@ void VToolRotation::setDialog() VToolRotation *VToolRotation::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogRotation *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 originPointId = dialogTool->GetOrigPointId(); QString angle = dialogTool->GetAngle(); const QString suffix = dialogTool->GetSuffix(); @@ -289,7 +289,7 @@ void VToolRotation::SetVisualization() if (not vis.isNull()) { VisToolRotation *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->SetObjects(source); visual->SetOriginPointId(origPointId); @@ -301,9 +301,9 @@ void VToolRotation::SetVisualization() //--------------------------------------------------------------------------------------------------------------------- void VToolRotation::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogRotation *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOrigPointId())); doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h index b72b55fa8..2c6e7f31f 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h @@ -183,8 +183,8 @@ inline void VAbstractSpline::ShowToolVisualization(bool show) template void VAbstractSpline::InitSplineToolConnections(VMainGraphicsScene *scene, T *tool) { - SCASSERT(scene != nullptr); - SCASSERT(tool != nullptr); + SCASSERT(scene != nullptr) + SCASSERT(tool != nullptr) InitDrawToolConnections(scene, tool); QObject::connect(scene, &VMainGraphicsScene::EnableSplineItemHover, tool, &T::AllowHover); @@ -195,8 +195,8 @@ void VAbstractSpline::InitSplineToolConnections(VMainGraphicsScene *scene, T *to template void VAbstractSpline::InitSplinePathToolConnections(VMainGraphicsScene *scene, T *tool) { - SCASSERT(scene != nullptr); - SCASSERT(tool != nullptr); + SCASSERT(scene != nullptr) + SCASSERT(tool != nullptr) InitDrawToolConnections(scene, tool); QObject::connect(scene, &VMainGraphicsScene::EnableSplinePathItemHover, tool, &T::AllowHover); @@ -207,8 +207,8 @@ void VAbstractSpline::InitSplinePathToolConnections(VMainGraphicsScene *scene, T template void VAbstractSpline::InitArcToolConnections(VMainGraphicsScene *scene, T *tool) { - SCASSERT(scene != nullptr); - SCASSERT(tool != nullptr); + SCASSERT(scene != nullptr) + SCASSERT(tool != nullptr) InitDrawToolConnections(scene, tool); QObject::connect(scene, &VMainGraphicsScene::EnableArcItemHover, tool, &T::AllowHover); @@ -219,8 +219,8 @@ void VAbstractSpline::InitArcToolConnections(VMainGraphicsScene *scene, T *tool) template void VAbstractSpline::InitElArcToolConnections(VMainGraphicsScene *scene, T *tool) { - SCASSERT(scene != nullptr); - SCASSERT(tool != nullptr); + SCASSERT(scene != nullptr) + SCASSERT(tool != nullptr) InitDrawToolConnections(scene, tool); QObject::connect(scene, &VMainGraphicsScene::EnableElArcItemHover, tool, &T::AllowHover); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp index 39327b779..2ef780a52 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp @@ -89,9 +89,9 @@ VToolArc::VToolArc(VAbstractPattern *doc, VContainer *data, quint32 id, const So */ void VToolArc::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogArc *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer arc = VAbstractTool::data.GeometricObject(id); dialogTool->SetCenter(arc->GetCenter().id()); dialogTool->SetF1(arc->GetFormulaF1()); @@ -110,9 +110,9 @@ void VToolArc::setDialog() */ VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogArc *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 center = dialogTool->GetCenter(); QString radius = dialogTool->GetRadius(); QString f1 = dialogTool->GetF1(); @@ -193,7 +193,7 @@ QString VToolArc::getTagName() const quint32 VToolArc::getCenter() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) return arc->GetCenter().id(); } @@ -216,7 +216,7 @@ void VToolArc::setCenter(const quint32 &value) VFormula VToolArc::GetFormulaRadius() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) VFormula radius(arc->GetFormulaRadius(), getData()); radius.setCheckZero(true); @@ -244,7 +244,7 @@ void VToolArc::SetFormulaRadius(const VFormula &value) VFormula VToolArc::GetFormulaF1() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) VFormula f1(arc->GetFormulaF1(), getData()); f1.setCheckZero(false); @@ -273,7 +273,7 @@ void VToolArc::SetFormulaF1(const VFormula &value) VFormula VToolArc::GetFormulaF2() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) VFormula f2(arc->GetFormulaF2(), getData()); f2.setCheckZero(false); @@ -337,9 +337,9 @@ void VToolArc::RemoveReferens() */ void VToolArc::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogArc *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter())); doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius()); doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1()); @@ -353,7 +353,7 @@ void VToolArc::SaveOptions(QDomElement &tag, QSharedPointer &obj) VAbstractSpline::SaveOptions(tag, obj); QSharedPointer arc = qSharedPointerDynamicCast(obj); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) doc->SetAttribute(tag, AttrType, ToolType); doc->SetAttribute(tag, AttrCenter, arc->GetCenter().id()); @@ -369,7 +369,7 @@ void VToolArc::SetVisualization() { const QSharedPointer arc = VAbstractTool::data.GeometricObject(id); VisToolArc *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) const VTranslateVars *trVars = qApp->TrVars(); visual->setObject1Id(arc->GetCenter().id()); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp index 03ce82bdb..ee4e4e215 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp @@ -78,9 +78,9 @@ VToolArcWithLength::VToolArcWithLength(VAbstractPattern *doc, VContainer *data, //--------------------------------------------------------------------------------------------------------------------- void VToolArcWithLength::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogArcWithLength *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer arc = VAbstractTool::data.GeometricObject(id); dialogTool->SetCenter(arc->GetCenter().id()); dialogTool->SetF1(arc->GetFormulaF1()); @@ -93,9 +93,9 @@ void VToolArcWithLength::setDialog() VToolArcWithLength *VToolArcWithLength::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogArcWithLength *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 center = dialogTool->GetCenter(); QString radius = dialogTool->GetRadius(); QString f1 = dialogTool->GetF1(); @@ -163,7 +163,7 @@ QString VToolArcWithLength::getTagName() const quint32 VToolArcWithLength::getCenter() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) return arc->GetCenter().id(); } @@ -186,7 +186,7 @@ void VToolArcWithLength::setCenter(const quint32 &value) VFormula VToolArcWithLength::GetFormulaRadius() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) VFormula radius(arc->GetFormulaRadius(), getData()); radius.setCheckZero(true); @@ -214,7 +214,7 @@ void VToolArcWithLength::SetFormulaRadius(const VFormula &value) VFormula VToolArcWithLength::GetFormulaF1() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) VFormula f1(arc->GetFormulaF1(), getData()); f1.setCheckZero(false); @@ -243,7 +243,7 @@ void VToolArcWithLength::SetFormulaF1(const VFormula &value) VFormula VToolArcWithLength::GetFormulaLength() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) VFormula radius(arc->GetFormulaLength(), getData()); radius.setCheckZero(true); @@ -294,9 +294,9 @@ void VToolArcWithLength::RemoveReferens() //--------------------------------------------------------------------------------------------------------------------- void VToolArcWithLength::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogArcWithLength *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter())); doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius()); doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1()); @@ -310,7 +310,7 @@ void VToolArcWithLength::SaveOptions(QDomElement &tag, QSharedPointer VAbstractSpline::SaveOptions(tag, obj); QSharedPointer arc = qSharedPointerDynamicCast(obj); - SCASSERT(arc.isNull() == false); + SCASSERT(arc.isNull() == false) doc->SetAttribute(tag, AttrType, ToolType); doc->SetAttribute(tag, AttrCenter, arc->GetCenter().id()); @@ -326,7 +326,7 @@ void VToolArcWithLength::SetVisualization() { const QSharedPointer arc = VAbstractTool::data.GeometricObject(id); VisToolArcWithLength *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) const VTranslateVars *trVars = qApp->TrVars(); visual->setObject1Id(arc->GetCenter().id()); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp index 6da275d30..46fba40c4 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp @@ -81,9 +81,9 @@ VToolCubicBezier::~VToolCubicBezier() //--------------------------------------------------------------------------------------------------------------------- void VToolCubicBezier::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const auto spl = VAbstractTool::data.GeometricObject(id); dialogTool->SetSpline(*spl); dialogTool->SetColor(spl->GetColor()); @@ -93,9 +93,9 @@ void VToolCubicBezier::setDialog() VToolCubicBezier *VToolCubicBezier::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) auto spl = Create(0, new VCubicBezier(dialogTool->GetSpline()), dialogTool->GetColor(), scene, doc, data, Document::FullParse, Source::FromGui); @@ -193,9 +193,9 @@ void VToolCubicBezier::RemoveReferens() //--------------------------------------------------------------------------------------------------------------------- void VToolCubicBezier::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const VCubicBezier spl = dialogTool->GetSpline(); @@ -209,7 +209,7 @@ void VToolCubicBezier::SaveOptions(QDomElement &tag, QSharedPointer &o VAbstractSpline::SaveOptions(tag, obj); auto spl = qSharedPointerDynamicCast(obj); - SCASSERT(spl.isNull() == false); + SCASSERT(spl.isNull() == false) SetSplineAttributes(tag, *spl); } @@ -219,7 +219,7 @@ void VToolCubicBezier::SetVisualization() if (not vis.isNull()) { auto visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) const QSharedPointer spl = VAbstractTool::data.GeometricObject(id); visual->setObject1Id(spl->GetP1().id()); @@ -252,7 +252,7 @@ void VToolCubicBezier::RefreshGeometry() //--------------------------------------------------------------------------------------------------------------------- void VToolCubicBezier::SetSplineAttributes(QDomElement &domElement, const VCubicBezier &spl) { - SCASSERT(doc != nullptr); + SCASSERT(doc != nullptr) doc->SetAttribute(domElement, AttrType, ToolType); doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id()); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp index 89b5dafac..df6976627 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp @@ -83,9 +83,9 @@ VToolCubicBezierPath::~VToolCubicBezierPath() //--------------------------------------------------------------------------------------------------------------------- void VToolCubicBezierPath::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); dialogTool->SetPath(*splPath); dialogTool->SetColor(splPath->GetColor()); @@ -95,9 +95,9 @@ void VToolCubicBezierPath::setDialog() VToolCubicBezierPath *VToolCubicBezierPath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) auto path = new VCubicBezierPath(dialogTool->GetPath()); const QString color = dialogTool->GetColor(); for (qint32 i = 0; i < path->CountPoints(); ++i) @@ -204,9 +204,9 @@ void VToolCubicBezierPath::RemoveReferens() //--------------------------------------------------------------------------------------------------------------------- void VToolCubicBezierPath::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) const auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); SetSplinePathAttributes(domElement, dialogTool->GetPath()); @@ -218,7 +218,7 @@ void VToolCubicBezierPath::SaveOptions(QDomElement &tag, QSharedPointer splPath = qSharedPointerDynamicCast(obj); - SCASSERT(splPath.isNull() == false); + SCASSERT(splPath.isNull() == false) SetSplinePathAttributes(tag, *splPath); } @@ -229,7 +229,7 @@ void VToolCubicBezierPath::SetVisualization() if (not vis.isNull()) { auto visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); visual->setPath(*splPath.data()); @@ -253,7 +253,7 @@ void VToolCubicBezierPath::RefreshGeometry() //--------------------------------------------------------------------------------------------------------------------- void VToolCubicBezierPath::AddPathPoint(VAbstractPattern *doc, QDomElement &domElement, const VPointF &splPoint) { - SCASSERT(doc != nullptr); + SCASSERT(doc != nullptr) QDomElement pathPoint = doc->createElement(AttrPathPoint); doc->SetAttribute(pathPoint, AttrPSpline, splPoint.id()); domElement.appendChild(pathPoint); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp index defc9bc0e..ec2a03131 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp @@ -89,9 +89,9 @@ VToolEllipticalArc::VToolEllipticalArc(VAbstractPattern *doc, VContainer *data, */ void VToolEllipticalArc::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogEllipticalArc *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer elArc = VAbstractTool::data.GeometricObject(id); dialogTool->SetCenter(elArc->GetCenter().id()); dialogTool->SetF1(elArc->GetFormulaF1()); @@ -114,9 +114,9 @@ void VToolEllipticalArc::setDialog() VToolEllipticalArc* VToolEllipticalArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogEllipticalArc *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 center = dialogTool->GetCenter(); QString radius1 = dialogTool->GetRadius1(); @@ -208,7 +208,7 @@ QString VToolEllipticalArc::getTagName() const quint32 VToolEllipticalArc::getCenter() const { QSharedPointer elArc = VAbstractTool::data.GeometricObject(id); - SCASSERT(elArc.isNull() == false); + SCASSERT(elArc.isNull() == false) return elArc->GetCenter().id(); } @@ -231,7 +231,7 @@ void VToolEllipticalArc::setCenter(const quint32 &value) VFormula VToolEllipticalArc::GetFormulaRadius1() const { QSharedPointer elArc = VAbstractTool::data.GeometricObject(id); - SCASSERT(elArc.isNull() == false); + SCASSERT(elArc.isNull() == false) VFormula radius1(elArc->GetFormulaRadius1(), getData()); radius1.setCheckZero(true); @@ -259,7 +259,7 @@ void VToolEllipticalArc::SetFormulaRadius1(const VFormula &value) VFormula VToolEllipticalArc::GetFormulaRadius2() const { QSharedPointer elArc = VAbstractTool::data.GeometricObject(id); - SCASSERT(elArc.isNull() == false); + SCASSERT(elArc.isNull() == false) VFormula radius2(elArc->GetFormulaRadius2(), getData()); radius2.setCheckZero(true); @@ -287,7 +287,7 @@ void VToolEllipticalArc::SetFormulaRadius2(const VFormula &value) VFormula VToolEllipticalArc::GetFormulaF1() const { QSharedPointer elArc = VAbstractTool::data.GeometricObject(id); - SCASSERT(elArc.isNull() == false); + SCASSERT(elArc.isNull() == false) VFormula f1(elArc->GetFormulaF1(), getData()); f1.setCheckZero(false); @@ -316,7 +316,7 @@ void VToolEllipticalArc::SetFormulaF1(const VFormula &value) VFormula VToolEllipticalArc::GetFormulaF2() const { QSharedPointer elArc = VAbstractTool::data.GeometricObject(id); - SCASSERT(elArc.isNull() == false); + SCASSERT(elArc.isNull() == false) VFormula f2(elArc->GetFormulaF2(), getData()); f2.setCheckZero(false); @@ -344,7 +344,7 @@ void VToolEllipticalArc::SetFormulaF2(const VFormula &value) VFormula VToolEllipticalArc::GetFormulaRotationAngle() const { QSharedPointer elArc = VAbstractTool::data.GeometricObject(id); - SCASSERT(elArc.isNull() == false); + SCASSERT(elArc.isNull() == false) VFormula rotationAngle(elArc->GetFormulaRotationAngle(), getData()); rotationAngle.setCheckZero(false); @@ -405,9 +405,9 @@ void VToolEllipticalArc::RemoveReferens() */ void VToolEllipticalArc::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogEllipticalArc *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter())); doc->SetAttribute(domElement, AttrRadius1, dialogTool->GetRadius1()); doc->SetAttribute(domElement, AttrRadius2, dialogTool->GetRadius2()); @@ -423,7 +423,7 @@ void VToolEllipticalArc::SaveOptions(QDomElement &tag, QSharedPointer VAbstractSpline::SaveOptions(tag, obj); QSharedPointer elArc = qSharedPointerDynamicCast(obj); - SCASSERT(elArc.isNull() == false); + SCASSERT(elArc.isNull() == false) doc->SetAttribute(tag, AttrType, ToolType); doc->SetAttribute(tag, AttrCenter, elArc->GetCenter().id()); @@ -441,7 +441,7 @@ void VToolEllipticalArc::SetVisualization() { const QSharedPointer elArc = VAbstractTool::data.GeometricObject(id); VisToolEllipticalArc *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) const VTranslateVars *trVars = qApp->TrVars(); visual->setObject1Id(elArc->GetCenter().id()); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index 1ae884da6..ed60820d5 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -141,9 +141,9 @@ VToolSpline::~VToolSpline() */ void VToolSpline::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogSpline *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const auto spl = VAbstractTool::data.GeometricObject(id); dialogTool->SetSpline(*spl); dialogTool->SetColor(spl->GetColor()); @@ -160,9 +160,9 @@ void VToolSpline::setDialog() */ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) VSpline *spline = new VSpline(dialogTool->GetSpline()); @@ -327,9 +327,9 @@ void VToolSpline::RemoveReferens() */ void VToolSpline::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const VSpline spl = dialogTool->GetSpline(); @@ -352,7 +352,7 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) VAbstractSpline::SaveOptions(tag, obj); auto spl = qSharedPointerDynamicCast(obj); - SCASSERT(spl.isNull() == false); + SCASSERT(spl.isNull() == false) SetSplineAttributes(tag, *spl); } @@ -458,7 +458,7 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event) if (QGraphicsView *view = viewList.at(0)) { VMainGraphicsScene *currentScene = qobject_cast(scene()); - SCASSERT(currentScene); + SCASSERT(currentScene) const QPointF cursorPosition = currentScene->getScenePos(); view->ensureVisible(QRectF(cursorPosition.x()-5, cursorPosition.y()-5, 10, 10)); } @@ -503,7 +503,7 @@ void VToolSpline::SetVisualization() if (not vis.isNull()) { VisToolSpline *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) const QSharedPointer spl = VAbstractTool::data.GeometricObject(id); visual->setObject1Id(spl->GetP1().id()); @@ -589,7 +589,7 @@ void VToolSpline::RefreshGeometry() //--------------------------------------------------------------------------------------------------------------------- void VToolSpline::SetSplineAttributes(QDomElement &domElement, const VSpline &spl) { - SCASSERT(doc != nullptr); + SCASSERT(doc != nullptr) doc->SetAttribute(domElement, AttrType, ToolType); doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id()); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index 0da7aa71f..270ffa1c4 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -151,9 +151,9 @@ VToolSplinePath::~VToolSplinePath() */ void VToolSplinePath::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogSplinePath *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); dialogTool->SetPath(*splPath); dialogTool->SetColor(splPath->GetColor()); @@ -170,9 +170,9 @@ void VToolSplinePath::setDialog() VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogSplinePath *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) VSplinePath *path = new VSplinePath(dialogTool->GetPath()); for (qint32 i = 0; i < path->CountPoints(); ++i) { @@ -390,7 +390,7 @@ void VToolSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) */ void VToolSplinePath::AddPathPoint(VAbstractPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint) { - SCASSERT(doc != nullptr); + SCASSERT(doc != nullptr) QDomElement pathPoint = doc->createElement(AttrPathPoint); doc->SetAttribute(pathPoint, AttrPSpline, splPoint.P().id()); @@ -436,9 +436,9 @@ void VToolSplinePath::RemoveReferens() */ void VToolSplinePath::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogSplinePath *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const VSplinePath splPath = dialogTool->GetPath(); for (qint32 i = 1; i <= splPath.CountSubSpl(); ++i) @@ -466,7 +466,7 @@ void VToolSplinePath::SaveOptions(QDomElement &tag, QSharedPointer &ob VAbstractSpline::SaveOptions(tag, obj); QSharedPointer splPath = qSharedPointerDynamicCast(obj); - SCASSERT(splPath.isNull() == false); + SCASSERT(splPath.isNull() == false) SetSplinePathAttributes(tag, *splPath); } @@ -578,7 +578,7 @@ void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event) if (QGraphicsView *view = viewList.at(0)) { VMainGraphicsScene *currentScene = qobject_cast(scene()); - SCASSERT(currentScene); + SCASSERT(currentScene) const QPointF cursorPosition = currentScene->getScenePos(); view->ensureVisible(QRectF(cursorPosition.x()-5, cursorPosition.y()-5, 10, 10)); } @@ -624,7 +624,7 @@ void VToolSplinePath::SetVisualization() if (not vis.isNull()) { VisToolSplinePath *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); visual->setPath(*splPath.data()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp index 1bb4f61be..d530583f8 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp @@ -354,7 +354,7 @@ void VToolDoublePoint::SaveOptions(QDomElement &tag, QSharedPointer &o if (obj->id() == p1id) { QSharedPointer point = qSharedPointerDynamicCast(obj); - SCASSERT(point.isNull() == false); + SCASSERT(point.isNull() == false) doc->SetAttribute(tag, AttrName1, point->name()); doc->SetAttribute(tag, AttrMx1, qApp->fromPixel(point->mx())); @@ -363,7 +363,7 @@ void VToolDoublePoint::SaveOptions(QDomElement &tag, QSharedPointer &o else if (obj->id() == p2id) { QSharedPointer point = qSharedPointerDynamicCast(obj); - SCASSERT(point.isNull() == false); + SCASSERT(point.isNull() == false) doc->SetAttribute(tag, AttrName2, point->name()); doc->SetAttribute(tag, AttrMx2, qApp->fromPixel(point->mx())); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp index 8b5d9187b..e612748ef 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp @@ -107,9 +107,9 @@ void VToolTrueDarts::FindPoint(const QPointF &baseLineP1, const QPointF &baseLin //--------------------------------------------------------------------------------------------------------------------- void VToolTrueDarts::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogTrueDarts *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p1 = VAbstractTool::data.GeometricObject(p1id); const QSharedPointer p2 = VAbstractTool::data.GeometricObject(p2id); @@ -127,9 +127,9 @@ void VToolTrueDarts::setDialog() VToolTrueDarts *VToolTrueDarts::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogTrueDarts *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QString point1Name = dialogTool->GetFirstNewDartPointName(); const QString point2Name = dialogTool->GetSecondNewDartPointName(); @@ -337,9 +337,9 @@ void VToolTrueDarts::RemoveReferens() //--------------------------------------------------------------------------------------------------------------------- void VToolTrueDarts::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogTrueDarts *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName1, dialogTool->GetFirstNewDartPointName()); doc->SetAttribute(domElement, AttrName2, dialogTool->GetSecondNewDartPointName()); @@ -379,7 +379,7 @@ void VToolTrueDarts::SetVisualization() if (not vis.isNull()) { VisToolTrueDarts *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(baseLineP1Id); visual->setObject2Id(baseLineP2Id); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp index b3ee69974..78e880945 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp @@ -83,9 +83,9 @@ VToolCutArc::VToolCutArc(VAbstractPattern *doc, VContainer *data, const quint32 */ void VToolCutArc::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCutArc *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer point = VAbstractTool::data.GeometricObject(id); dialogTool->SetFormula(formula); dialogTool->setArcId(curveCutId); @@ -102,9 +102,9 @@ void VToolCutArc::setDialog() */ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCutArc *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QString pointName = dialogTool->getPointName(); QString formula = dialogTool->GetFormula(); const quint32 arcId = dialogTool->getArcId(); @@ -213,9 +213,9 @@ void VToolCutArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) */ void VToolCutArc::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCutArc *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId())); @@ -244,7 +244,7 @@ void VToolCutArc::SetVisualization() if (not vis.isNull()) { VisToolCutArc *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(curveCutId); visual->setLength(qApp->TrVars()->FormulaToUser(formula, qApp->Settings()->GetOsSeparator())); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp index 2e29d3e90..1a9435b7c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp @@ -86,9 +86,9 @@ VToolCutSpline::VToolCutSpline(VAbstractPattern *doc, VContainer *data, const qu */ void VToolCutSpline::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCutSpline *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer point = VAbstractTool::data.GeometricObject(id); dialogTool->SetFormula(formula); dialogTool->setSplineId(curveCutId); @@ -106,9 +106,9 @@ void VToolCutSpline::setDialog() VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCutSpline *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QString pointName = dialogTool->getPointName(); QString formula = dialogTool->GetFormula(); const quint32 splineId = dialogTool->getSplineId(); @@ -213,9 +213,9 @@ void VToolCutSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) */ void VToolCutSpline::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCutSpline *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId())); @@ -244,7 +244,7 @@ void VToolCutSpline::SetVisualization() if (not vis.isNull()) { VisToolCutSpline *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(curveCutId); visual->setLength(qApp->TrVars()->FormulaToUser(formula, qApp->Settings()->GetOsSeparator())); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp index d300c3d02..bb044d606 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp @@ -90,9 +90,9 @@ VToolCutSplinePath::VToolCutSplinePath(VAbstractPattern *doc, VContainer *data, */ void VToolCutSplinePath::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCutSplinePath *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer point = VAbstractTool::data.GeometricObject(id); dialogTool->SetFormula(formula); dialogTool->setSplinePathId(curveCutId); @@ -110,9 +110,9 @@ void VToolCutSplinePath::setDialog() VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCutSplinePath *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QString pointName = dialogTool->getPointName(); QString formula = dialogTool->GetFormula(); const quint32 splinePathId = dialogTool->getSplinePathId(); @@ -146,7 +146,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString VContainer *data, const Document &parse, const Source &typeCreation) { const auto splPath = data->GeometricObject(splinePathId); - SCASSERT(splPath != nullptr); + SCASSERT(splPath != nullptr) const qreal result = CheckFormula(_id, formula, data); @@ -155,9 +155,9 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString VSplinePath *splPath2 = nullptr; VPointF *p = VToolCutSplinePath::CutSplinePath(qApp->toPixel(result), splPath, pointName, &splPath1, &splPath2); - SCASSERT(splPath1 != nullptr); - SCASSERT(splPath2 != nullptr); - SCASSERT(p != nullptr); + SCASSERT(splPath1 != nullptr) + SCASSERT(splPath2 != nullptr) + SCASSERT(p != nullptr) p->setMx(mx); p->setMy(my); @@ -205,7 +205,7 @@ void VToolCutSplinePath::ShowVisualization(bool show) VPointF *VToolCutSplinePath::CutSplinePath(qreal length, const QSharedPointer &splPath, const QString &pName, VSplinePath **splPath1, VSplinePath **splPath2) { - SCASSERT(splPath != nullptr); + SCASSERT(splPath != nullptr) QPointF spl1p2, spl1p3, spl2p2, spl2p3; qint32 p1 = 0, p2 = 0; @@ -301,9 +301,9 @@ void VToolCutSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) */ void VToolCutSplinePath::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCutSplinePath *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId())); @@ -332,7 +332,7 @@ void VToolCutSplinePath::SetVisualization() if (not vis.isNull()) { VisToolCutSplinePath *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(curveCutId); visual->setLength(qApp->TrVars()->FormulaToUser(formula, qApp->Settings()->GetOsSeparator())); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp index 2963d28b5..adf05921a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp @@ -129,9 +129,9 @@ void VToolAlongLine::RemoveReferens() */ void VToolAlongLine::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogAlongLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); @@ -208,7 +208,7 @@ void VToolAlongLine::setDialog() { SCASSERT(dialog != nullptr); DialogAlongLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); dialogTool->SetLineColor(lineColor); @@ -229,9 +229,9 @@ void VToolAlongLine::setDialog() VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogAlongLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) QString formula = dialogTool->GetFormula(); const quint32 firstPointId = dialogTool->GetFirstPointId(); const quint32 secondPointId = dialogTool->GetSecondPointId(); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp index 93eb1e5cc..1f8fee2c9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp @@ -127,9 +127,9 @@ QPointF VToolBisector::FindPoint(const QPointF &firstPoint, const QPointF &secon */ void VToolBisector::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogBisector *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); dialogTool->SetLineColor(lineColor); @@ -151,9 +151,9 @@ void VToolBisector::setDialog() VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogBisector *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) QString formula = dialogTool->GetFormula(); const quint32 firstPointId = dialogTool->GetFirstPointId(); const quint32 secondPointId = dialogTool->GetSecondPointId(); @@ -282,9 +282,9 @@ void VToolBisector::RemoveReferens() */ void VToolBisector::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogBisector *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); @@ -323,7 +323,7 @@ void VToolBisector::SetVisualization() if (not vis.isNull()) { VisToolBisector *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(firstPointId); visual->setObject2Id(basePointId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp index 4ccbba610..dde7fd06b 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -91,10 +91,10 @@ VToolCurveIntersectAxis::~VToolCurveIntersectAxis() //--------------------------------------------------------------------------------------------------------------------- void VToolCurveIntersectAxis::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) dialog->setModal(true); DialogCurveIntersectAxis *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); dialogTool->SetLineColor(lineColor); @@ -109,9 +109,9 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMa VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCurveIntersectAxis *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool); + SCASSERT(dialogTool) const QString pointName = dialogTool->getPointName(); const QString typeLine = dialogTool->GetTypeLine(); const QString lineColor = dialogTool->GetLineColor(); @@ -279,9 +279,9 @@ void VToolCurveIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *e //--------------------------------------------------------------------------------------------------------------------- void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogCurveIntersectAxis *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); @@ -317,7 +317,7 @@ void VToolCurveIntersectAxis::SetVisualization() if (not vis.isNull()) { VisToolCurveIntersectAxis *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(curveId); visual->setAxisPointId(basePointId); @@ -446,8 +446,8 @@ void VToolCurveIntersectAxis::InitSegments(const GOType &curveType, qreal segLen delete pC; } - SCASSERT(splPath1 != nullptr); - SCASSERT(splPath2 != nullptr); + SCASSERT(splPath1 != nullptr) + SCASSERT(splPath2 != nullptr) if (not VFuzzyComparePossibleNulls(segLength, -1)) { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp index 75d8e0057..d4dae1598 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp @@ -91,10 +91,10 @@ VToolEndLine::~VToolEndLine() */ void VToolEndLine::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) dialog->setModal(true); DialogEndLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); dialogTool->SetLineColor(lineColor); @@ -116,9 +116,9 @@ void VToolEndLine::setDialog() VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogEndLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool); + SCASSERT(dialogTool) const QString pointName = dialogTool->getPointName(); const QString typeLine = dialogTool->GetTypeLine(); const QString lineColor = dialogTool->GetLineColor(); @@ -219,9 +219,9 @@ void VToolEndLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) */ void VToolEndLine::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogEndLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); @@ -257,7 +257,7 @@ void VToolEndLine::SetVisualization() if (not vis.isNull()) { VisToolEndLine *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(basePointId); visual->setLength(qApp->TrVars()->FormulaToUser(formulaLength, qApp->Settings()->GetOsSeparator())); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp index dc9842c52..872cf464e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp @@ -84,9 +84,9 @@ VToolHeight::VToolHeight(VAbstractPattern *doc, VContainer *data, const quint32 */ void VToolHeight::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogHeight *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); dialogTool->SetLineColor(lineColor); @@ -107,9 +107,9 @@ void VToolHeight::setDialog() */ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogHeight *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QString pointName = dialogTool->getPointName(); const QString typeLine = dialogTool->GetTypeLine(); const QString lineColor = dialogTool->GetLineColor(); @@ -226,9 +226,9 @@ void VToolHeight::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) */ void VToolHeight::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogHeight *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); @@ -264,7 +264,7 @@ void VToolHeight::SetVisualization() if (not vis.isNull()) { VisToolHeight *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(basePointId); visual->setLineP1Id(p1LineId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp index 507babace..21463f151 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp @@ -77,10 +77,10 @@ VToolLineIntersectAxis::~VToolLineIntersectAxis() //--------------------------------------------------------------------------------------------------------------------- void VToolLineIntersectAxis::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) dialog->setModal(true); DialogLineIntersectAxis *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); dialogTool->SetLineColor(lineColor); @@ -96,9 +96,9 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMain VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogLineIntersectAxis *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool); + SCASSERT(dialogTool) const QString pointName = dialogTool->getPointName(); const QString typeLine = dialogTool->GetTypeLine(); const QString lineColor = dialogTool->GetLineColor(); @@ -275,9 +275,9 @@ void VToolLineIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *ev //--------------------------------------------------------------------------------------------------------------------- void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogLineIntersectAxis *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); @@ -316,7 +316,7 @@ void VToolLineIntersectAxis::SetVisualization() if (not vis.isNull()) { VisToolLineIntersectAxis *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(firstPointId); visual->setPoint2Id(secondPointId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp index 4257ffc96..8facfde80 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp @@ -90,9 +90,9 @@ VToolNormal::VToolNormal(VAbstractPattern *doc, VContainer *data, const quint32 */ void VToolNormal::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogNormal *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); dialogTool->SetFormula(formulaLength); @@ -112,9 +112,9 @@ void VToolNormal::setDialog() */ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogNormal *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) QString formula = dialogTool->GetFormula(); const quint32 firstPointId = dialogTool->GetFirstPointId(); const quint32 secondPointId = dialogTool->GetSecondPointId(); @@ -257,9 +257,9 @@ void VToolNormal::RemoveReferens() */ void VToolNormal::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogNormal *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); @@ -298,7 +298,7 @@ void VToolNormal::SetVisualization() if (not vis.isNull()) { VisToolNormal *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(basePointId); visual->setObject2Id(secondPointId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp index 7c73bb109..478434f82 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp @@ -92,9 +92,9 @@ VToolShoulderPoint::VToolShoulderPoint(VAbstractPattern *doc, VContainer *data, */ void VToolShoulderPoint::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogShoulderPoint *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetTypeLine(typeLine); dialogTool->SetLineColor(lineColor); @@ -154,9 +154,9 @@ QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Li VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogShoulderPoint *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool); + SCASSERT(dialogTool) QString formula = dialogTool->GetFormula(); const quint32 p1Line = dialogTool->GetP1Line(); const quint32 p2Line = dialogTool->GetP2Line(); @@ -288,9 +288,9 @@ void VToolShoulderPoint::RemoveReferens() */ void VToolShoulderPoint::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogShoulderPoint *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); @@ -329,7 +329,7 @@ void VToolShoulderPoint::SetVisualization() if (not vis.isNull()) { VisToolShoulderPoint *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(pShoulder); visual->setLineP1Id(basePointId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp index 80f84d56d..540f989fc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp @@ -109,9 +109,9 @@ VToolBasePoint::~VToolBasePoint() */ void VToolBasePoint::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogSinglePoint *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetData(p->name(), *p); } @@ -121,7 +121,7 @@ VToolBasePoint *VToolBasePoint::Create(quint32 _id, const QString &nameActivPP, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { - SCASSERT(point != nullptr); + SCASSERT(point != nullptr) quint32 id = _id; if (typeCreation == Source::FromGui) @@ -229,7 +229,7 @@ QVariant VToolBasePoint::itemChange(QGraphicsItem::GraphicsItemChange change, co { // Ensure visible only small rect around a cursor VMainGraphicsScene *currentScene = qobject_cast(scene()); - SCASSERT(currentScene); + SCASSERT(currentScene) const QPointF cursorPosition = currentScene->getScenePos(); view->ensureVisible(QRectF(cursorPosition.x()-5, cursorPosition.y()-5, 10, 10)); } @@ -284,9 +284,9 @@ void VToolBasePoint::DeleteTool(bool ask) */ void VToolBasePoint::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogSinglePoint *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) QPointF p = dialogTool->GetPoint(); QString name = dialogTool->getPointName(); doc->SetAttribute(domElement, AttrName, name); @@ -361,7 +361,7 @@ void VToolBasePoint::SaveOptions(QDomElement &tag, QSharedPointer &obj VToolSinglePoint::SaveOptions(tag, obj); QSharedPointer point = qSharedPointerDynamicCast(obj); - SCASSERT(point.isNull() == false); + SCASSERT(point.isNull() == false) doc->SetAttribute(tag, AttrType, ToolType); doc->SetAttribute(tag, AttrX, qApp->fromPixel(point->x())); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp index 482f6d69e..ff97a2bfa 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp @@ -86,9 +86,9 @@ VToolLineIntersect::VToolLineIntersect(VAbstractPattern *doc, VContainer *data, */ void VToolLineIntersect::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogLineIntersect *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetP1Line1(p1Line1); dialogTool->SetP2Line1(p2Line1); @@ -109,9 +109,9 @@ void VToolLineIntersect::setDialog() VToolLineIntersect* VToolLineIntersect::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogLineIntersect *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 p1Line1Id = dialogTool->GetP1Line1(); const quint32 p2Line1Id = dialogTool->GetP2Line1(); const quint32 p1Line2Id = dialogTool->GetP1Line2(); @@ -252,9 +252,9 @@ void VToolLineIntersect::RemoveReferens() */ void VToolLineIntersect::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogLineIntersect *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrP1Line1, QString().setNum(dialogTool->GetP1Line1())); doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->GetP2Line1())); @@ -289,7 +289,7 @@ void VToolLineIntersect::SetVisualization() if (not vis.isNull()) { VisToolLineIntersect *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(p1Line1); visual->setLine1P2Id(p2Line1); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp index 91f02cb89..2c4422aab 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp @@ -70,9 +70,9 @@ VToolPointFromArcAndTangent::VToolPointFromArcAndTangent(VAbstractPattern *doc, //--------------------------------------------------------------------------------------------------------------------- void VToolPointFromArcAndTangent::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointFromArcAndTangent *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetArcId(arcId); dialogTool->SetCrossCirclesPoint(crossPoint); @@ -84,9 +84,9 @@ void VToolPointFromArcAndTangent::setDialog() VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointFromArcAndTangent *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 arcId = dialogTool->GetArcId(); const quint32 tangentPointId = dialogTool->GetTangentPointId(); const CrossCirclesPoint pType = dialogTool->GetCrossCirclesPoint(); @@ -304,9 +304,9 @@ void VToolPointFromArcAndTangent::contextMenuEvent(QGraphicsSceneContextMenuEven //--------------------------------------------------------------------------------------------------------------------- void VToolPointFromArcAndTangent::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointFromArcAndTangent *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->GetArcId())); doc->SetAttribute(domElement, AttrTangent, QString().setNum(dialogTool->GetTangentPointId())); @@ -339,7 +339,7 @@ void VToolPointFromArcAndTangent::SetVisualization() if (not vis.isNull()) { VisToolPointFromArcAndTangent *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(tangentPointId); visual->setArcId(arcId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp index 88384ff46..e33140bd9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp @@ -73,9 +73,9 @@ VToolPointFromCircleAndTangent::VToolPointFromCircleAndTangent(VAbstractPattern //--------------------------------------------------------------------------------------------------------------------- void VToolPointFromCircleAndTangent::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointFromCircleAndTangent *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetCircleCenterId(circleCenterId); dialogTool->SetCircleRadius(circleRadius); @@ -88,9 +88,9 @@ void VToolPointFromCircleAndTangent::setDialog() VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointFromCircleAndTangent *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 circleCenterId = dialogTool->GetCircleCenterId(); QString circleRadius = dialogTool->GetCircleRadius(); const quint32 tangentPointId = dialogTool->GetTangentPointId(); @@ -288,9 +288,9 @@ void VToolPointFromCircleAndTangent::contextMenuEvent(QGraphicsSceneContextMenuE //--------------------------------------------------------------------------------------------------------------------- void VToolPointFromCircleAndTangent::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointFromCircleAndTangent *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrCCenter, QString().setNum(dialogTool->GetCircleCenterId())); doc->SetAttribute(domElement, AttrTangent, QString().setNum(dialogTool->GetTangentPointId())); @@ -326,7 +326,7 @@ void VToolPointFromCircleAndTangent::SetVisualization() if (not vis.isNull()) { VisToolPointFromCircleAndTangent *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(tangentPointId); visual->setObject2Id(circleCenterId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp index 40d4ae4e0..a93c79f4d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp @@ -92,9 +92,9 @@ VToolPointOfContact::VToolPointOfContact(VAbstractPattern *doc, VContainer *data */ void VToolPointOfContact::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfContact *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->setRadius(arcRadius); dialogTool->setCenter(center); @@ -173,9 +173,9 @@ QPointF VToolPointOfContact::FindPoint(const qreal &radius, const QPointF ¢e VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfContact *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) QString radius = dialogTool->getRadius(); const quint32 center = dialogTool->getCenter(); const quint32 firstPointId = dialogTool->GetFirstPoint(); @@ -305,9 +305,9 @@ void VToolPointOfContact::RemoveReferens() */ void VToolPointOfContact::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfContact *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrRadius, dialogTool->getRadius()); doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->getCenter())); @@ -342,7 +342,7 @@ void VToolPointOfContact::SetVisualization() if (not vis.isNull()) { VisToolPointOfContact *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(firstPointId); visual->setLineP2Id(secondPointId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp index b66c963e5..c113e0bda 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp @@ -80,9 +80,9 @@ VToolPointOfIntersection::VToolPointOfIntersection(VAbstractPattern *doc, VConta */ void VToolPointOfIntersection::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfIntersection *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetFirstPointId(firstPointId); dialogTool->SetSecondPointId(secondPointId); @@ -102,9 +102,9 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(DialogTool *dialog, V VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfIntersection *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 firstPointId = dialogTool->GetFirstPointId(); const quint32 secondPointId = dialogTool->GetSecondPointId(); const QString pointName = dialogTool->getPointName(); @@ -209,9 +209,9 @@ void VToolPointOfIntersection::contextMenuEvent(QGraphicsSceneContextMenuEvent * */ void VToolPointOfIntersection::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfIntersection *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); @@ -240,7 +240,7 @@ void VToolPointOfIntersection::SetVisualization() if (not vis.isNull()) { VisToolPointOfIntersection *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(firstPointId); visual->setPoint2Id(secondPointId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp index de622aa9f..d2c6f1f16 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp @@ -69,9 +69,9 @@ VToolPointOfIntersectionArcs::VToolPointOfIntersectionArcs(VAbstractPattern *doc //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionArcs::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfIntersectionArcs *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetFirstArcId(firstArcId); dialogTool->SetSecondArcId(secondArcId); @@ -83,9 +83,9 @@ void VToolPointOfIntersectionArcs::setDialog() VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfIntersectionArcs *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 firstArcId = dialogTool->GetFirstArcId(); const quint32 secondArcId = dialogTool->GetSecondArcId(); const CrossCirclesPoint pType = dialogTool->GetCrossArcPoint(); @@ -310,9 +310,9 @@ void VToolPointOfIntersectionArcs::contextMenuEvent(QGraphicsSceneContextMenuEve //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionArcs::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfIntersectionArcs *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrFirstArc, QString().setNum(dialogTool->GetFirstArcId())); doc->SetAttribute(domElement, AttrSecondArc, QString().setNum(dialogTool->GetSecondArcId())); @@ -344,7 +344,7 @@ void VToolPointOfIntersectionArcs::SetVisualization() if (not vis.isNull()) { VisToolPointOfIntersectionArcs *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setArc1Id(firstArcId); visual->setArc2Id(secondArcId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp index c85818732..b717dccbf 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp @@ -77,9 +77,9 @@ VToolPointOfIntersectionCircles::VToolPointOfIntersectionCircles(VAbstractPatter //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionCircles::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfIntersectionCircles *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetFirstCircleCenterId(firstCircleCenterId); dialogTool->SetSecondCircleCenterId(secondCircleCenterId); @@ -93,9 +93,9 @@ void VToolPointOfIntersectionCircles::setDialog() VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfIntersectionCircles *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 firstCircleCenterId = dialogTool->GetFirstCircleCenterId(); const quint32 secondCircleCenterId = dialogTool->GetSecondCircleCenterId(); QString firstCircleRadius = dialogTool->GetFirstCircleRadius(); @@ -324,9 +324,9 @@ void VToolPointOfIntersectionCircles::contextMenuEvent(QGraphicsSceneContextMenu //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionCircles::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogPointOfIntersectionCircles *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrC1Center, QString().setNum(dialogTool->GetFirstCircleCenterId())); doc->SetAttribute(domElement, AttrC2Center, QString().setNum(dialogTool->GetSecondCircleCenterId())); @@ -365,7 +365,7 @@ void VToolPointOfIntersectionCircles::SetVisualization() if (not vis.isNull()) { VisToolPointOfIntersectionCircles *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(firstCircleCenterId); visual->setObject2Id(secondCircleCenterId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index a26745a25..a4785addd 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -75,9 +75,9 @@ VToolPointOfIntersectionCurves::VToolPointOfIntersectionCurves(VAbstractPattern //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionCurves::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) auto p = VAbstractTool::data.GeometricObject(id); dialogTool->SetFirstCurveId(firstCurveId); dialogTool->SetSecondCurveId(secondCurveId); @@ -90,9 +90,9 @@ void VToolPointOfIntersectionCurves::setDialog() VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 firstCurveId = dialogTool->GetFirstCurveId(); const quint32 secondCurveId = dialogTool->GetSecondCurveId(); const VCrossCurvesPoint vCrossPoint = dialogTool->GetVCrossPoint(); @@ -370,9 +370,9 @@ void VToolPointOfIntersectionCurves::contextMenuEvent(QGraphicsSceneContextMenuE //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionCurves::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) auto dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrCurve1, QString().setNum(dialogTool->GetFirstCurveId())); doc->SetAttribute(domElement, AttrCurve2, QString().setNum(dialogTool->GetSecondCurveId())); @@ -407,7 +407,7 @@ void VToolPointOfIntersectionCurves::SetVisualization() if (not vis.isNull()) { auto visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(firstCurveId); visual->setObject2Id(secondCurveId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index 3ed3d2860..403fe7742 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -362,7 +362,7 @@ void VToolSinglePoint::SaveOptions(QDomElement &tag, QSharedPointer &o VDrawTool::SaveOptions(tag, obj); QSharedPointer point = qSharedPointerDynamicCast(obj); - SCASSERT(point.isNull() == false); + SCASSERT(point.isNull() == false) doc->SetAttribute(tag, AttrName, point->name()); doc->SetAttribute(tag, AttrMx, qApp->fromPixel(point->mx())); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp index e0ef255f4..fd85d5e74 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp @@ -86,9 +86,9 @@ VToolTriangle::VToolTriangle(VAbstractPattern *doc, VContainer *data, const quin */ void VToolTriangle::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogTriangle *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->SetAxisP1Id(axisP1Id); dialogTool->SetAxisP2Id(axisP2Id); @@ -109,9 +109,9 @@ void VToolTriangle::setDialog() VToolTriangle* VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogTriangle *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 axisP1Id = dialogTool->GetAxisP1Id(); const quint32 axisP2Id = dialogTool->GetAxisP2Id(); const quint32 firstPointId = dialogTool->GetFirstPointId(); @@ -273,9 +273,9 @@ void VToolTriangle::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) */ void VToolTriangle::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogTriangle *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrAxisP1, QString().setNum(dialogTool->GetAxisP1Id())); doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->GetAxisP2Id())); @@ -310,7 +310,7 @@ void VToolTriangle::SetVisualization() if (not vis.isNull()) { VisToolTriangle * visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(axisP1Id); visual->setObject2Id(axisP2Id); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h b/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h index 226fb2db2..c59fc0334 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h @@ -143,8 +143,8 @@ void VAbstractPoint::ChangePosition(T *item, quint32 id, const QPointF &pos) template void VAbstractPoint::InitToolConnections(VMainGraphicsScene *scene, T *tool) { - SCASSERT(scene != nullptr); - SCASSERT(tool != nullptr); + SCASSERT(scene != nullptr) + SCASSERT(tool != nullptr) InitDrawToolConnections(scene, tool); QObject::connect(scene, &VMainGraphicsScene::EnablePointItemHover, tool, &T::AllowHover); diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.h b/src/libs/vtools/tools/drawTools/vdrawtool.h index 4399e3807..cbb1281aa 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.h +++ b/src/libs/vtools/tools/drawTools/vdrawtool.h @@ -154,8 +154,8 @@ template void VDrawTool::ContextMenu(Tool *tool, QGraphicsSceneContextMenuEvent *event, const RemoveOption &showRemove, const Referens &ref) { - SCASSERT(tool != nullptr); - SCASSERT(event != nullptr); + SCASSERT(tool != nullptr) + SCASSERT(event != nullptr) qCDebug(vTool, "Creating tool context menu."); QMenu menu; @@ -221,7 +221,7 @@ template */ void VDrawTool::ShowItem(Item *item, quint32 id, bool enable) { - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) if (id == item->id) { ShowVisualization(enable); @@ -253,8 +253,8 @@ QString VDrawTool::ObjectName(quint32 id) const template void VDrawTool::InitDrawToolConnections(VMainGraphicsScene *scene, T *tool) { - SCASSERT(scene != nullptr); - SCASSERT(tool != nullptr); + SCASSERT(scene != nullptr) + SCASSERT(tool != nullptr) QObject::connect(tool, &T::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); QObject::connect(tool, &T::ChangedToolSelection, scene, &VMainGraphicsScene::SelectedItem); diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index ca0a1ec36..559772cbd 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -97,9 +97,9 @@ VToolLine::VToolLine(VAbstractPattern *doc, VContainer *data, quint32 id, quint3 */ void VToolLine::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) dialogTool->SetFirstPoint(firstPoint); dialogTool->SetSecondPoint(secondPoint); dialogTool->SetTypeLine(typeLine); @@ -116,9 +116,9 @@ void VToolLine::setDialog() */ VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const quint32 firstPoint = dialogTool->GetFirstPoint(); const quint32 secondPoint = dialogTool->GetSecondPoint(); const QString typeLine = dialogTool->GetTypeLine(); @@ -151,9 +151,9 @@ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, con VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { - SCASSERT(scene != nullptr); - SCASSERT(doc != nullptr); - SCASSERT(data != nullptr); + SCASSERT(scene != nullptr) + SCASSERT(doc != nullptr) + SCASSERT(data != nullptr) quint32 id = _id; if (typeCreation == Source::FromGui) { @@ -389,9 +389,9 @@ void VToolLine::keyReleaseEvent(QKeyEvent *event) */ void VToolLine::SaveDialog(QDomElement &domElement) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogLine *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint())); doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint())); doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); @@ -424,7 +424,7 @@ void VToolLine::SetVisualization() if (not vis.isNull()) { VisToolLine *visual = qobject_cast(vis); - SCASSERT(visual != nullptr); + SCASSERT(visual != nullptr) visual->setObject1Id(firstPoint); visual->setPoint2Id(secondPoint); diff --git a/src/libs/vtools/tools/nodeDetails/vnodearc.cpp b/src/libs/vtools/tools/nodeDetails/vnodearc.cpp index dba366d37..a8bce4185 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodearc.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodearc.cpp @@ -83,7 +83,7 @@ void VNodeArc::Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint { //Some nodes we don't show on scene. Tool that create this nodes must free memory. VDataTool *tool = doc->getTool(idTool); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) arc->setParent(tool);// Adopted by a tool } else diff --git a/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp b/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp index 482a6ce11..2b5d48027 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp @@ -56,7 +56,7 @@ void VNodeEllipticalArc::Create(VAbstractPattern *doc, VContainer *data, quint32 { //Some nodes we don't show on scene. Tool that create this nodes must free memory. VDataTool *tool = doc->getTool(idTool); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) arc->setParent(tool);// Adopted by a tool } else diff --git a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index 33a3e0fcb..27e3b9861 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -127,7 +127,7 @@ void VNodePoint::Create(VAbstractPattern *doc, VContainer *data, VMainGraphicsSc { //Some nodes we don't show on scene. Tool that create this nodes must free memory. VDataTool *tool = doc->getTool(idTool); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) point->setParent(tool);// Adopted by a tool } else diff --git a/src/libs/vtools/tools/nodeDetails/vnodespline.cpp b/src/libs/vtools/tools/nodeDetails/vnodespline.cpp index 6b607a6e6..945e4b34e 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodespline.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodespline.cpp @@ -88,7 +88,7 @@ VNodeSpline *VNodeSpline::Create(VAbstractPattern *doc, VContainer *data, quint3 { //Some nodes we don't show on scene. Tool that create this nodes must free memory. VDataTool *tool = doc->getTool(idTool); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) spl->setParent(tool);// Adopted by a tool } else diff --git a/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp b/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp index c6ab8d453..bdff4786a 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp @@ -87,7 +87,7 @@ void VNodeSplinePath::Create(VAbstractPattern *doc, VContainer *data, quint32 id { //Some nodes we don't show on scene. Tool that create this nodes must free memory. VDataTool *tool = doc->getTool(idTool); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) splPath->setParent(tool);// Adopted by a tool } else diff --git a/src/libs/vtools/tools/vabstracttool.cpp b/src/libs/vtools/tools/vabstracttool.cpp index 98c06914a..e77c516e5 100644 --- a/src/libs/vtools/tools/vabstracttool.cpp +++ b/src/libs/vtools/tools/vabstracttool.cpp @@ -86,7 +86,7 @@ VAbstractTool::VAbstractTool(VAbstractPattern *doc, VContainer *data, quint32 id :VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), vis(), selectionType(SelectionType::ByMouseRelease) { - SCASSERT(doc != nullptr); + SCASSERT(doc != nullptr) connect(this, &VAbstractTool::toolhaveChange, this->doc, &VAbstractPattern::haveLiteChange); connect(this->doc, &VAbstractPattern::FullUpdateFromFile, this, &VAbstractTool::FullUpdateFromFile); connect(this, &VAbstractTool::LiteUpdateTree, this->doc, &VAbstractPattern::LiteParseTree); @@ -402,9 +402,9 @@ void VAbstractTool::AddRecord(const quint32 id, const Tool &toolType, VAbstractP void VAbstractTool::RefreshLine(QGraphicsEllipseItem *point, VGraphicsSimpleTextItem *namePoint, QGraphicsLineItem *lineName, const qreal radius) { - SCASSERT(point != nullptr); - SCASSERT(namePoint != nullptr); - SCASSERT(lineName != nullptr); + SCASSERT(point != nullptr) + SCASSERT(namePoint != nullptr) + SCASSERT(lineName != nullptr) QRectF nRec = namePoint->sceneBoundingRect(); nRec.translate(- point->scenePos()); diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index ed3ef504e..f0345a571 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -235,9 +235,9 @@ VToolDetail::~VToolDetail() */ void VToolDetail::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogDetail *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) dialogTool->setDetail(VAbstractTool::data.GetDetail(id)); } @@ -251,9 +251,9 @@ void VToolDetail::setDialog() */ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogDetail *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) VDetail detail = dialogTool->getDetail(); VDetail det; qApp->getUndoStack()->beginMacro("add detail"); @@ -402,9 +402,9 @@ void VToolDetail::FullUpdateFromGuiOk(int result) { if (result == QDialog::Accepted) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogDetail *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) const VDetail newDet = dialogTool->getDetail(); const VDetail oldDet = VAbstractTool::data.GetDetail(id); @@ -651,7 +651,7 @@ QVariant VToolDetail::itemChange(QGraphicsItem::GraphicsItemChange change, const { // Ensure visible only small rect around a cursor VMainGraphicsScene *currentScene = qobject_cast(scene()); - SCASSERT(currentScene); + SCASSERT(currentScene) const QPointF cursorPosition = currentScene->getScenePos(); view->ensureVisible(QRectF(cursorPosition.x()-5, cursorPosition.y()-5, 10, 10)); } @@ -1252,9 +1252,9 @@ template Tool* VToolDetail::InitTool(VMainGraphicsScene *scene, const VNodeDetail &node) { QHash* tools = doc->getTools(); - SCASSERT(tools != nullptr); + SCASSERT(tools != nullptr) Tool *tool = qobject_cast(tools->value(node.getId())); - SCASSERT(tool != nullptr); + SCASSERT(tool != nullptr) connect(tool, &Tool::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); tool->setParentItem(this); tool->SetParentType(ParentType::Item); diff --git a/src/libs/vtools/tools/vtooluniondetails.cpp b/src/libs/vtools/tools/vtooluniondetails.cpp index 27aa19baa..fe65a630c 100644 --- a/src/libs/vtools/tools/vtooluniondetails.cpp +++ b/src/libs/vtools/tools/vtooluniondetails.cpp @@ -435,7 +435,7 @@ void VToolUnionDetails::UpdatePoints(VContainer *data, const VDetail &det, const path->setMode(Draw::Modeling); const QSharedPointer splinePath = data->GeometricObject(det.at(i).getId()); - SCASSERT(splinePath != nullptr); + SCASSERT(splinePath != nullptr) for (qint32 i = 1; i <= splinePath->CountSubSpl(); ++i) { const VSpline spline = splinePath->GetSpline(i); @@ -575,9 +575,9 @@ void VToolUnionDetails::GroupVisibility(quint32 object, bool visible) VToolUnionDetails* VToolUnionDetails::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogUnionDetails *dialogTool = qobject_cast(dialog); - SCASSERT(dialogTool != nullptr); + SCASSERT(dialogTool != nullptr) VDetail d1 = data->GetDetail(dialogTool->getD1()); VDetail d2 = data->GetDetail(dialogTool->getD2()); quint32 indexD1 = static_cast(dialogTool->getIndexD1()); @@ -619,7 +619,7 @@ VToolUnionDetails* VToolUnionDetails::Create(const quint32 _id, const VDetail &d { id = data->getNextId(); drawName = DrawName(doc, d1id, d2id); - SCASSERT(not drawName.isEmpty()); + SCASSERT(not drawName.isEmpty()) } else { @@ -704,20 +704,20 @@ VToolUnionDetails* VToolUnionDetails::Create(const quint32 _id, const VDetail &d newDetail.setMy(d1.getMy()); VToolDetail::Create(0, newDetail, scene, doc, data, parse, Source::FromTool, drawName); QHash* tools = doc->getTools(); - SCASSERT(tools != nullptr); + SCASSERT(tools != nullptr) if (not retainPieces) { { VToolDetail *toolDet = qobject_cast(tools->value(d1id)); - SCASSERT(toolDet != nullptr); + SCASSERT(toolDet != nullptr) bool ask = false; toolDet->Remove(ask); } { VToolDetail *toolDet = qobject_cast(tools->value(d2id)); - SCASSERT(toolDet != nullptr); + SCASSERT(toolDet != nullptr) const bool ask = false; toolDet->Remove(ask); } diff --git a/src/libs/vtools/undocommands/addpatternpiece.cpp b/src/libs/vtools/undocommands/addpatternpiece.cpp index 1e27b917c..9f9e89a55 100644 --- a/src/libs/vtools/undocommands/addpatternpiece.cpp +++ b/src/libs/vtools/undocommands/addpatternpiece.cpp @@ -41,7 +41,7 @@ AddPatternPiece::AddPatternPiece(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) : VUndoCommand(xml, doc, parent), namePP(namePP) { - SCASSERT(namePP.isEmpty() == false); + SCASSERT(namePP.isEmpty() == false) setText(tr("add pattern piece %1").arg(namePP)); } diff --git a/src/libs/vtools/undocommands/deletedetail.cpp b/src/libs/vtools/undocommands/deletedetail.cpp index 50140d16a..a9f375b26 100644 --- a/src/libs/vtools/undocommands/deletedetail.cpp +++ b/src/libs/vtools/undocommands/deletedetail.cpp @@ -97,9 +97,9 @@ void DeleteDetail::redo() // UnionDetails delete two old details and create one new. // So when UnionDetail delete detail we can't use FullParsing. So we hide detail on scene directly. QHash* tools = doc->getTools(); - SCASSERT(tools != nullptr); + SCASSERT(tools != nullptr) VToolDetail *toolDet = qobject_cast(tools->value(nodeId)); - SCASSERT(toolDet != nullptr); + SCASSERT(toolDet != nullptr) toolDet->hide(); DecrementReferences(detail.getNodes()); diff --git a/src/libs/vtools/undocommands/label/movedoublelabel.cpp b/src/libs/vtools/undocommands/label/movedoublelabel.cpp index a782f19df..c8a35a7f9 100644 --- a/src/libs/vtools/undocommands/label/movedoublelabel.cpp +++ b/src/libs/vtools/undocommands/label/movedoublelabel.cpp @@ -91,7 +91,7 @@ MoveDoubleLabel::~MoveDoubleLabel() bool MoveDoubleLabel::mergeWith(const QUndoCommand *command) { const MoveDoubleLabel *moveCommand = static_cast(command); - SCASSERT(moveCommand != nullptr); + SCASSERT(moveCommand != nullptr) if (moveCommand->GetPointId() != nodeId || moveCommand->GetPointType() != m_type || diff --git a/src/libs/vtools/undocommands/label/movelabel.cpp b/src/libs/vtools/undocommands/label/movelabel.cpp index ecef0a8bc..28a4e18b5 100644 --- a/src/libs/vtools/undocommands/label/movelabel.cpp +++ b/src/libs/vtools/undocommands/label/movelabel.cpp @@ -70,7 +70,7 @@ MoveLabel::~MoveLabel() bool MoveLabel::mergeWith(const QUndoCommand *command) { const MoveLabel *moveCommand = static_cast(command); - SCASSERT(moveCommand != nullptr); + SCASSERT(moveCommand != nullptr) if (moveCommand->GetPointId() != nodeId) { diff --git a/src/libs/vtools/undocommands/label/operationmovelabel.cpp b/src/libs/vtools/undocommands/label/operationmovelabel.cpp index d83066110..1d2db9c06 100644 --- a/src/libs/vtools/undocommands/label/operationmovelabel.cpp +++ b/src/libs/vtools/undocommands/label/operationmovelabel.cpp @@ -77,7 +77,7 @@ OperationMoveLabel::~OperationMoveLabel() bool OperationMoveLabel::mergeWith(const QUndoCommand *command) { const OperationMoveLabel *moveCommand = static_cast(command); - SCASSERT(moveCommand != nullptr); + SCASSERT(moveCommand != nullptr) if (moveCommand->GetToolId() != m_idTool && moveCommand->GetPointId() != nodeId) { diff --git a/src/libs/vtools/undocommands/movedetail.cpp b/src/libs/vtools/undocommands/movedetail.cpp index f06fd568d..333c331a0 100644 --- a/src/libs/vtools/undocommands/movedetail.cpp +++ b/src/libs/vtools/undocommands/movedetail.cpp @@ -49,7 +49,7 @@ MoveDetail::MoveDetail(VAbstractPattern *doc, const double &x, const double &y, setText(QObject::tr("move detail")); nodeId = id; - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { @@ -118,7 +118,7 @@ void MoveDetail::redo() bool MoveDetail::mergeWith(const QUndoCommand *command) { const MoveDetail *moveCommand = static_cast(command); - SCASSERT(moveCommand != nullptr); + SCASSERT(moveCommand != nullptr) const quint32 id = moveCommand->getDetId(); if (id != nodeId) diff --git a/src/libs/vtools/undocommands/movespline.cpp b/src/libs/vtools/undocommands/movespline.cpp index a36dc6467..64de80e40 100644 --- a/src/libs/vtools/undocommands/movespline.cpp +++ b/src/libs/vtools/undocommands/movespline.cpp @@ -53,7 +53,7 @@ MoveSpline::MoveSpline(VAbstractPattern *doc, const VSpline *oldSpl, const VSpli setText(tr("move spline")); nodeId = id; - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) } //--------------------------------------------------------------------------------------------------------------------- @@ -82,7 +82,7 @@ void MoveSpline::redo() bool MoveSpline::mergeWith(const QUndoCommand *command) { const MoveSpline *moveCommand = static_cast(command); - SCASSERT(moveCommand != nullptr); + SCASSERT(moveCommand != nullptr) const quint32 id = moveCommand->getSplineId(); if (id != nodeId) diff --git a/src/libs/vtools/undocommands/movesplinepath.cpp b/src/libs/vtools/undocommands/movesplinepath.cpp index 12e9188f8..0cc0626b3 100644 --- a/src/libs/vtools/undocommands/movesplinepath.cpp +++ b/src/libs/vtools/undocommands/movesplinepath.cpp @@ -52,7 +52,7 @@ MoveSplinePath::MoveSplinePath(VAbstractPattern *doc, const VSplinePath &oldSplP setText(tr("move spline path")); nodeId = id; - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) } //--------------------------------------------------------------------------------------------------------------------- @@ -81,7 +81,7 @@ void MoveSplinePath::redo() bool MoveSplinePath::mergeWith(const QUndoCommand *command) { const MoveSplinePath *moveCommand = static_cast(command); - SCASSERT(moveCommand != nullptr); + SCASSERT(moveCommand != nullptr) const quint32 id = moveCommand->getSplinePathId(); if (id != nodeId) diff --git a/src/libs/vtools/undocommands/movespoint.cpp b/src/libs/vtools/undocommands/movespoint.cpp index baf9ceba5..3180715ef 100644 --- a/src/libs/vtools/undocommands/movespoint.cpp +++ b/src/libs/vtools/undocommands/movespoint.cpp @@ -51,7 +51,7 @@ MoveSPoint::MoveSPoint(VAbstractPattern *doc, const double &x, const double &y, qCDebug(vUndo, "SPoint newX %f", newX); qCDebug(vUndo, "SPoint newY %f", newY); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { @@ -92,7 +92,7 @@ void MoveSPoint::redo() bool MoveSPoint::mergeWith(const QUndoCommand *command) { const MoveSPoint *moveCommand = static_cast(command); - SCASSERT(moveCommand != nullptr); + SCASSERT(moveCommand != nullptr) const quint32 id = moveCommand->getSPointId(); qCDebug(vUndo, "Mergin."); diff --git a/src/libs/vtools/undocommands/renamepp.cpp b/src/libs/vtools/undocommands/renamepp.cpp index afc0025d0..d2c53c5d9 100644 --- a/src/libs/vtools/undocommands/renamepp.cpp +++ b/src/libs/vtools/undocommands/renamepp.cpp @@ -43,7 +43,7 @@ RenamePP::RenamePP(VAbstractPattern *doc, const QString &newPPname, QComboBox *c :VUndoCommand(QDomElement(), doc, parent), combo(combo), newPPname(newPPname), oldPPname(QString()) { setText(tr("rename pattern piece")); - SCASSERT(combo != nullptr); + SCASSERT(combo != nullptr) oldPPname = doc->GetNameActivPP(); } @@ -71,7 +71,7 @@ void RenamePP::redo() bool RenamePP::mergeWith(const QUndoCommand *command) { const RenamePP *renameCommand = static_cast(command); - SCASSERT(renameCommand != nullptr); + SCASSERT(renameCommand != nullptr) const QString oldName = renameCommand->getOldPPname(); if (newPPname != oldName) diff --git a/src/libs/vtools/undocommands/savedetailoptions.cpp b/src/libs/vtools/undocommands/savedetailoptions.cpp index 032db725e..fa8ae38e9 100644 --- a/src/libs/vtools/undocommands/savedetailoptions.cpp +++ b/src/libs/vtools/undocommands/savedetailoptions.cpp @@ -120,7 +120,7 @@ void SaveDetailOptions::redo() bool SaveDetailOptions::mergeWith(const QUndoCommand *command) { const SaveDetailOptions *saveCommand = static_cast(command); - SCASSERT(saveCommand != nullptr); + SCASSERT(saveCommand != nullptr) const quint32 id = saveCommand->getDetId(); if (id != nodeId || text() != command->text()) diff --git a/src/libs/vtools/undocommands/savetooloptions.cpp b/src/libs/vtools/undocommands/savetooloptions.cpp index 492de6fc5..6ec7b4fed 100644 --- a/src/libs/vtools/undocommands/savetooloptions.cpp +++ b/src/libs/vtools/undocommands/savetooloptions.cpp @@ -93,7 +93,7 @@ void SaveToolOptions::redo() bool SaveToolOptions::mergeWith(const QUndoCommand *command) { const SaveToolOptions *saveCommand = static_cast(command); - SCASSERT(saveCommand != nullptr); + SCASSERT(saveCommand != nullptr) const quint32 id = saveCommand->getToolId(); if (id != nodeId) diff --git a/src/libs/vtools/undocommands/vundocommand.cpp b/src/libs/vtools/undocommands/vundocommand.cpp index a9b56b076..2e52a502c 100644 --- a/src/libs/vtools/undocommands/vundocommand.cpp +++ b/src/libs/vtools/undocommands/vundocommand.cpp @@ -44,7 +44,7 @@ Q_LOGGING_CATEGORY(vUndo, "v.undo") VUndoCommand::VUndoCommand(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) :QObject(), QUndoCommand(parent), xml(xml), doc(doc), nodeId(NULL_ID), redoFlag(false) { - SCASSERT(doc != nullptr); + SCASSERT(doc != nullptr) } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/visualization/line/operation/visoperation.cpp b/src/libs/vtools/visualization/line/operation/visoperation.cpp index c581fc91e..39877ade0 100644 --- a/src/libs/vtools/visualization/line/operation/visoperation.cpp +++ b/src/libs/vtools/visualization/line/operation/visoperation.cpp @@ -67,7 +67,7 @@ void VisOperation::VisualMode(const quint32 &pointId) { Q_UNUSED(pointId); VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) Visualization::scenePos = scene->getScenePos(); RefreshGeometry(); diff --git a/src/libs/vtools/visualization/line/visline.cpp b/src/libs/vtools/visualization/line/visline.cpp index b193352a0..1bb8e1b68 100644 --- a/src/libs/vtools/visualization/line/visline.cpp +++ b/src/libs/vtools/visualization/line/visline.cpp @@ -155,7 +155,7 @@ void VisLine::AddOnScene() void VisLine::DrawRay(QGraphicsLineItem *lineItem, const QPointF &p, const QPointF &pTangent, const QColor &color, Qt::PenStyle style) { - SCASSERT (lineItem != nullptr); + SCASSERT (lineItem != nullptr) const qreal angle = QLineF(p, pTangent).angle(); const QPointF endRay = Ray(p, angle); diff --git a/src/libs/vtools/visualization/line/vistoolline.cpp b/src/libs/vtools/visualization/line/vistoolline.cpp index 0a420e8af..032d3c74f 100644 --- a/src/libs/vtools/visualization/line/vistoolline.cpp +++ b/src/libs/vtools/visualization/line/vistoolline.cpp @@ -80,7 +80,7 @@ void VisToolLine::setPoint2Id(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- void VisToolLine::DrawLine(QGraphicsLineItem *lineItem, const QLineF &line, const QColor &color, Qt::PenStyle style) { - SCASSERT (lineItem != nullptr); + SCASSERT (lineItem != nullptr) lineItem->setPen(QPen(color, qApp->toPixel(WidthMainLine(*Visualization::data->GetPatternUnit()))/factor, style)); lineItem->setLine(line); diff --git a/src/libs/vtools/visualization/line/vistoolpointofintersectionarcs.cpp b/src/libs/vtools/visualization/line/vistoolpointofintersectionarcs.cpp index 0a830674d..8924bbd83 100644 --- a/src/libs/vtools/visualization/line/vistoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointofintersectionarcs.cpp @@ -92,7 +92,7 @@ void VisToolPointOfIntersectionArcs::RefreshGeometry() void VisToolPointOfIntersectionArcs::VisualMode(const quint32 &id) { VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) this->arc1Id = id; Visualization::scenePos = scene->getScenePos(); diff --git a/src/libs/vtools/visualization/line/vistoolpointofintersectioncircles.cpp b/src/libs/vtools/visualization/line/vistoolpointofintersectioncircles.cpp index 7af20ea96..b70fb4393 100644 --- a/src/libs/vtools/visualization/line/vistoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointofintersectioncircles.cpp @@ -96,7 +96,7 @@ void VisToolPointOfIntersectionCircles::RefreshGeometry() void VisToolPointOfIntersectionCircles::VisualMode(const quint32 &id) { VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) this->object1Id = id; Visualization::scenePos = scene->getScenePos(); diff --git a/src/libs/vtools/visualization/line/vistooltriangle.cpp b/src/libs/vtools/visualization/line/vistooltriangle.cpp index 71feb80c0..4df5c29bb 100644 --- a/src/libs/vtools/visualization/line/vistooltriangle.cpp +++ b/src/libs/vtools/visualization/line/vistooltriangle.cpp @@ -146,7 +146,7 @@ void VisToolTriangle::setHypotenuseP2Id(const quint32 &value) void VisToolTriangle::DrawAimedAxis(QGraphicsPathItem *item, const QLineF &line, const QColor &color, Qt::PenStyle style) { - SCASSERT (item != nullptr); + SCASSERT (item != nullptr) item->setPen(QPen(color, qApp->toPixel(WidthHairLine(*Visualization::data->GetPatternUnit()))/factor, style)); diff --git a/src/libs/vtools/visualization/path/vistoolcutsplinepath.cpp b/src/libs/vtools/visualization/path/vistoolcutsplinepath.cpp index 93d68519c..253bdbb25 100644 --- a/src/libs/vtools/visualization/path/vistoolcutsplinepath.cpp +++ b/src/libs/vtools/visualization/path/vistoolcutsplinepath.cpp @@ -76,9 +76,9 @@ void VisToolCutSplinePath::RefreshGeometry() VSplinePath *spPath1 = nullptr; VSplinePath *spPath2 = nullptr; VPointF *p = VToolCutSplinePath::CutSplinePath(length, splPath, "X", &spPath1, &spPath2); - SCASSERT(p != nullptr); - SCASSERT(spPath1 != nullptr); - SCASSERT(spPath2 != nullptr); + SCASSERT(p != nullptr) + SCASSERT(spPath1 != nullptr) + SCASSERT(spPath2 != nullptr) DrawPoint(point, *p, mainColor); delete p; diff --git a/src/libs/vtools/visualization/path/vistoolpointofintersectioncurves.cpp b/src/libs/vtools/visualization/path/vistoolpointofintersectioncurves.cpp index bee369c4d..345440287 100644 --- a/src/libs/vtools/visualization/path/vistoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/visualization/path/vistoolpointofintersectioncurves.cpp @@ -81,7 +81,7 @@ void VisToolPointOfIntersectionCurves::RefreshGeometry() void VisToolPointOfIntersectionCurves::VisualMode(const quint32 &id) { auto scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) this->object1Id = id; Visualization::scenePos = scene->getScenePos(); diff --git a/src/libs/vtools/visualization/visualization.cpp b/src/libs/vtools/visualization/visualization.cpp index fabfca5f5..d6bd123e7 100644 --- a/src/libs/vtools/visualization/visualization.cpp +++ b/src/libs/vtools/visualization/visualization.cpp @@ -103,7 +103,7 @@ void Visualization::setScenePos(const QPointF &value) void Visualization::VisualMode(const quint32 &pointId) { VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) this->object1Id = pointId; this->scenePos = scene->getScenePos(); @@ -207,7 +207,7 @@ qreal Visualization::FindVal(const QString &expression, const QHashsetPos(pos); point->setPen(QPen(color, qApp->toPixel(WidthMainLine(*Visualization::data->GetPatternUnit()))/factor, style)); @@ -217,7 +217,7 @@ void Visualization::DrawPoint(QGraphicsEllipseItem *point, const QPointF &pos, c //--------------------------------------------------------------------------------------------------------------------- void Visualization::DrawLine(QGraphicsLineItem *lineItem, const QLineF &line, const QColor &color, Qt::PenStyle style) { - SCASSERT (lineItem != nullptr); + SCASSERT (lineItem != nullptr) lineItem->setPen(QPen(color, qApp->toPixel(WidthHairLine(*Visualization::data->GetPatternUnit()))/factor, style)); lineItem->setLine(line); @@ -228,7 +228,7 @@ void Visualization::DrawLine(QGraphicsLineItem *lineItem, const QLineF &line, co void Visualization::DrawPath(QGraphicsPathItem *pathItem, const QPainterPath &path, const QColor &color, Qt::PenStyle style, Qt::PenCapStyle cap) { - SCASSERT (pathItem != nullptr); + SCASSERT (pathItem != nullptr) pathItem->setPen(QPen(color, qApp->toPixel(WidthMainLine(*Visualization::data->GetPatternUnit()))/factor, style, cap)); diff --git a/src/libs/vtools/visualization/visualization.h b/src/libs/vtools/visualization/visualization.h index d2e08ccd0..13124732b 100644 --- a/src/libs/vtools/visualization/visualization.h +++ b/src/libs/vtools/visualization/visualization.h @@ -105,9 +105,9 @@ private: template inline void Visualization::AddItem(Item *item) { - SCASSERT(item != nullptr); + SCASSERT(item != nullptr) VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); - SCASSERT(scene != nullptr); + SCASSERT(scene != nullptr) scene->addItem(item); connect(scene, &VMainGraphicsScene::NewFactor, item, &Visualization::SetFactor); diff --git a/src/libs/vwidgets/vabstractsimple.h b/src/libs/vwidgets/vabstractsimple.h index 8181168b6..fa1decd95 100644 --- a/src/libs/vwidgets/vabstractsimple.h +++ b/src/libs/vwidgets/vabstractsimple.h @@ -101,7 +101,7 @@ private: template void VAbstractSimple::SetPen(T *item, const QColor &color, qreal width) { - SCASSERT(item); + SCASSERT(item) item->setPen(QPen(CorrectColor(color), ToPixel(width, patternUnit)/ *factor, Qt::SolidLine, Qt::RoundCap)); } diff --git a/src/libs/vwidgets/vcontrolpointspline.cpp b/src/libs/vwidgets/vcontrolpointspline.cpp index e500b8ed4..a0b63df36 100644 --- a/src/libs/vwidgets/vcontrolpointspline.cpp +++ b/src/libs/vwidgets/vcontrolpointspline.cpp @@ -201,7 +201,7 @@ QVariant VControlPointSpline::itemChange(QGraphicsItem::GraphicsItemChange chang { // Ensure visible only small rect around a cursor VMainGraphicsScene *currentScene = qobject_cast(scene()); - SCASSERT(currentScene); + SCASSERT(currentScene) const QPointF cursorPosition = currentScene->getScenePos(); view->ensureVisible(QRectF(cursorPosition.x()-5, cursorPosition.y()-5, 10, 10)); } diff --git a/src/libs/vwidgets/vgraphicssimpletextitem.cpp b/src/libs/vwidgets/vgraphicssimpletextitem.cpp index 8a4c89393..2f95261ff 100644 --- a/src/libs/vwidgets/vgraphicssimpletextitem.cpp +++ b/src/libs/vwidgets/vgraphicssimpletextitem.cpp @@ -155,7 +155,7 @@ QVariant VGraphicsSimpleTextItem::itemChange(GraphicsItemChange change, const QV { // Ensure visible only small rect around a cursor VMainGraphicsScene *currentScene = qobject_cast(scene()); - SCASSERT(currentScene); + SCASSERT(currentScene) const QPointF cursorPosition = currentScene->getScenePos(); view->ensureVisible(QRectF(cursorPosition.x()-5, cursorPosition.y()-5, 10, 10)); } diff --git a/src/libs/vwidgets/vmaingraphicsview.cpp b/src/libs/vwidgets/vmaingraphicsview.cpp index eb73dae62..8e68bc497 100644 --- a/src/libs/vwidgets/vmaingraphicsview.cpp +++ b/src/libs/vwidgets/vmaingraphicsview.cpp @@ -213,7 +213,7 @@ bool GraphicsViewZoom::eventFilter(QObject *object, QEvent *event) else if (event->type() == QEvent::Wheel) { QWheelEvent* wheel_event = static_cast(event); - SCASSERT(wheel_event != nullptr); + SCASSERT(wheel_event != nullptr) if (QApplication::keyboardModifiers() == _modifiers) { if (wheel_event->orientation() == Qt::Vertical) @@ -243,8 +243,8 @@ bool GraphicsViewZoom::eventFilter(QObject *object, QEvent *event) //--------------------------------------------------------------------------------------------------------------------- void GraphicsViewZoom::FictiveSceneRect(QGraphicsScene *sc, QGraphicsView *view) { - SCASSERT(sc != nullptr); - SCASSERT(view != nullptr); + SCASSERT(sc != nullptr) + SCASSERT(view != nullptr) //Calculate view rect //to receive the currently visible area, map the widgets bounds to the scene @@ -273,7 +273,7 @@ void GraphicsViewZoom::FictiveSceneRect(QGraphicsScene *sc, QGraphicsView *view) //--------------------------------------------------------------------------------------------------------------------- bool GraphicsViewZoom::StartVerticalScrollings(QWheelEvent *wheel_event) { - SCASSERT(wheel_event != nullptr); + SCASSERT(wheel_event != nullptr) const QPoint numPixels = wheel_event->pixelDelta(); const QPoint numDegrees = wheel_event->angleDelta() / 8; @@ -308,7 +308,7 @@ bool GraphicsViewZoom::StartVerticalScrollings(QWheelEvent *wheel_event) //--------------------------------------------------------------------------------------------------------------------- bool GraphicsViewZoom::StartHorizontalScrollings(QWheelEvent *wheel_event) { - SCASSERT(wheel_event != nullptr); + SCASSERT(wheel_event != nullptr) const QPoint numPixels = wheel_event->pixelDelta(); const QPoint numDegrees = wheel_event->angleDelta() / 8; @@ -396,7 +396,7 @@ void VMainGraphicsView::ZoomOriginal() void VMainGraphicsView::ZoomFitBest() { VMainGraphicsScene *currentScene = qobject_cast(scene()); - SCASSERT(currentScene); + SCASSERT(currentScene) currentScene->SetOriginsVisible(false); const QRectF rect = currentScene->VisibleItemsBoundingRect(); currentScene->SetOriginsVisible(true); @@ -531,15 +531,15 @@ void VMainGraphicsView::AllowRubberBand(bool value) */ void VMainGraphicsView::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view) { - SCASSERT(sc != nullptr); - SCASSERT(view != nullptr); + SCASSERT(sc != nullptr) + SCASSERT(view != nullptr) //Calculate view rect const QRectF viewRect = SceneVisibleArea(view); //Calculate scene rect VMainGraphicsScene *currentScene = qobject_cast(sc); - SCASSERT(currentScene); + SCASSERT(currentScene) const QRectF itemsRect = currentScene->VisibleItemsBoundingRect(); //Unite two rects @@ -549,7 +549,7 @@ void VMainGraphicsView::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view) //--------------------------------------------------------------------------------------------------------------------- QRectF VMainGraphicsView::SceneVisibleArea(QGraphicsView *view) { - SCASSERT(view != nullptr); + SCASSERT(view != nullptr) //to receive the currently visible area, map the widgets bounds to the scene return QRectF(view->mapToScene(0, 0), view->mapToScene(view->width(), view->height())); } diff --git a/src/libs/vwidgets/vwidgetpopup.cpp b/src/libs/vwidgets/vwidgetpopup.cpp index 9d67790b3..a7357ad70 100644 --- a/src/libs/vwidgets/vwidgetpopup.cpp +++ b/src/libs/vwidgets/vwidgetpopup.cpp @@ -90,7 +90,7 @@ void VWidgetPopup::SetWidget(QWidget *widget, bool own) //--------------------------------------------------------------------------------------------------------------------- void VWidgetPopup::PopupMessage(QWidget *w, const QString &msg) { - SCASSERT(w != nullptr); + SCASSERT(w != nullptr) VWidgetPopup *popup = new VWidgetPopup(); QLabel *label = new QLabel(msg); From 2d61b8725640881c77381e778de536d9a4db2027 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 20 Dec 2016 21:19:21 +0200 Subject: [PATCH 03/26] Remove empty statement. --HG-- branch : develop --- src/app/tape/dialogs/dialognewmeasurements.cpp | 2 +- src/app/tape/dialogs/tapeconfigdialog.cpp | 2 +- src/app/tape/tmainwindow.cpp | 10 +++++----- src/app/valentina/core/vformulaproperty.cpp | 4 ++-- src/app/valentina/dialogs/configdialog.cpp | 2 +- src/app/valentina/dialogs/dialogincrements.cpp | 6 +++--- src/app/valentina/mainwindow.cpp | 6 +++--- src/app/valentina/xml/vpattern.cpp | 12 ++++++------ src/libs/fervor/fvupdater.cpp | 4 ++-- src/libs/ifc/xml/vabstractconverter.cpp | 2 +- src/libs/ifc/xml/vdomdocument.cpp | 4 ++-- src/libs/qmuparser/qmuparser.cpp | 6 +++--- src/libs/qmuparser/qmuparserbase.cpp | 6 +++--- src/libs/vdxf/dxflib/dl_dxf.cpp | 4 ++-- src/libs/vlayout/vgraphicsfillitem.cpp | 4 ++-- src/libs/vlayout/vposter.cpp | 2 +- src/libs/vmisc/backport/qcommandlineparser.cpp | 2 +- src/libs/vmisc/def.cpp | 12 ++++++------ src/libs/vmisc/vlockguard.h | 6 +++--- .../vpatterndb/variables/vinternalvariable.cpp | 2 +- .../vpropertyexplorer/plugins/vcolorproperty.cpp | 4 ++-- .../vpropertyexplorer/plugins/vemptyproperty.cpp | 10 +++++----- .../vpropertyexplorer/plugins/venumproperty.cpp | 4 ++-- .../vpropertyexplorer/plugins/vfileproperty.cpp | 2 +- .../plugins/vlinecolorproperty.cpp | 4 ++-- .../plugins/vlinetypeproperty.cpp | 4 ++-- .../plugins/vnumberproperty.cpp | 8 ++++---- .../plugins/vobjectproperty.cpp | 4 ++-- .../plugins/vshortcutproperty.cpp | 2 +- .../plugins/vstringproperty.cpp | 4 ++-- src/libs/vpropertyexplorer/vproperty.cpp | 14 +++++++------- src/libs/vpropertyexplorer/vpropertymodel.cpp | 2 +- src/libs/vtools/dialogs/tools/dialogmove.cpp | 4 ++-- src/libs/vtools/dialogs/tools/dialogtool.cpp | 14 +++++++------- .../operation/flipping/vtoolflippingbyaxis.cpp | 2 +- .../operation/flipping/vtoolflippingbyline.cpp | 2 +- .../drawTools/operation/vabstractoperation.cpp | 8 ++++---- .../tools/drawTools/operation/vtoolmove.cpp | 2 +- .../tools/drawTools/operation/vtoolrotation.cpp | 2 +- .../drawTools/toolcurve/vabstractspline.cpp | 8 ++++---- .../tools/drawTools/toolcurve/vtoolarc.cpp | 2 +- .../drawTools/toolcurve/vtoolarcwithlength.cpp | 2 +- .../drawTools/toolcurve/vtoolcubicbezier.cpp | 2 +- .../drawTools/toolcurve/vtoolcubicbezierpath.cpp | 2 +- .../drawTools/toolcurve/vtoolellipticalarc.cpp | 2 +- .../tools/drawTools/toolcurve/vtoolspline.cpp | 4 ++-- .../drawTools/toolcurve/vtoolsplinepath.cpp | 2 +- .../tooldoublepoint/vtooldoublepoint.cpp | 2 +- .../toolpoint/tooldoublepoint/vtooltruedarts.cpp | 2 +- .../toolsinglepoint/toolcut/vtoolcutarc.cpp | 2 +- .../toolsinglepoint/toolcut/vtoolcutspline.cpp | 2 +- .../toolcut/vtoolcutsplinepath.cpp | 2 +- .../toollinepoint/vtoolalongline.cpp | 2 +- .../toollinepoint/vtoolbisector.cpp | 2 +- .../toollinepoint/vtoolcurveintersectaxis.cpp | 2 +- .../toollinepoint/vtoolendline.cpp | 2 +- .../toollinepoint/vtoolheight.cpp | 2 +- .../toollinepoint/vtoollineintersectaxis.cpp | 2 +- .../toollinepoint/vtoolnormal.cpp | 2 +- .../toollinepoint/vtoolshoulderpoint.cpp | 2 +- .../toolpoint/toolsinglepoint/vtoolbasepoint.cpp | 6 +++--- .../toolsinglepoint/vtoollineintersect.cpp | 2 +- .../vtoolpointfromarcandtangent.cpp | 2 +- .../vtoolpointfromcircleandtangent.cpp | 2 +- .../toolsinglepoint/vtoolpointofcontact.cpp | 2 +- .../toolsinglepoint/vtoolpointofintersection.cpp | 2 +- .../vtoolpointofintersectionarcs.cpp | 2 +- .../vtoolpointofintersectioncircles.cpp | 2 +- .../vtoolpointofintersectioncurves.cpp | 2 +- .../toolsinglepoint/vtoolsinglepoint.cpp | 8 ++++---- .../toolpoint/toolsinglepoint/vtooltriangle.cpp | 2 +- .../tools/drawTools/toolpoint/vabstractpoint.cpp | 2 +- src/libs/vtools/tools/drawTools/vdrawtool.cpp | 4 ++-- src/libs/vtools/tools/drawTools/vtoolline.cpp | 10 +++++----- .../vtools/tools/nodeDetails/vabstractnode.cpp | 4 ++-- src/libs/vtools/tools/nodeDetails/vnodepoint.cpp | 4 ++-- src/libs/vtools/tools/vgrainlineitem.cpp | 4 ++-- src/libs/vtools/tools/vtextgraphicsitem.cpp | 6 +++--- src/libs/vtools/tools/vtooldetail.cpp | 16 ++++++++-------- src/libs/vtools/tools/vtooluniondetails.cpp | 10 +++++----- .../line/operation/visoperation.cpp | 2 +- src/libs/vwidgets/vgraphicssimpletextitem.cpp | 2 +- src/libs/vwidgets/vmaingraphicsview.cpp | 4 ++-- 83 files changed, 172 insertions(+), 172 deletions(-) diff --git a/src/app/tape/dialogs/dialognewmeasurements.cpp b/src/app/tape/dialogs/dialognewmeasurements.cpp index 897af7bb7..11dbfa6bf 100644 --- a/src/app/tape/dialogs/dialognewmeasurements.cpp +++ b/src/app/tape/dialogs/dialognewmeasurements.cpp @@ -172,7 +172,7 @@ void DialogNewMeasurements::CurrentTypeChanged(int index) //--------------------------------------------------------------------------------------------------------------------- void DialogNewMeasurements::CurrentUnitChanged(int index) { - Q_UNUSED(index); + Q_UNUSED(index) if (MUnit() != Unit::Inch) { diff --git a/src/app/tape/dialogs/tapeconfigdialog.cpp b/src/app/tape/dialogs/tapeconfigdialog.cpp index 457a79e4c..fc8eb4fe1 100644 --- a/src/app/tape/dialogs/tapeconfigdialog.cpp +++ b/src/app/tape/dialogs/tapeconfigdialog.cpp @@ -160,7 +160,7 @@ void TapeConfigDialog::showEvent(QShowEvent *event) //--------------------------------------------------------------------------------------------------------------------- void TapeConfigDialog::resizeEvent(QResizeEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) // remember the size for the next time this dialog is opened, but only // if widget was already initialized, which rules out the resize at // dialog creating, which would diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 5d1b11cd9..532cb0834 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1344,7 +1344,7 @@ void TMainWindow::ShowMData() } catch(const VExceptionBadId &e) { - Q_UNUSED(e); + Q_UNUSED(e) MFields(false); return; } @@ -1403,7 +1403,7 @@ void TMainWindow::ShowMData() } catch (qmu::QmuParserError &e) { - Q_UNUSED(e); + Q_UNUSED(e) formula = meash->GetFormula(); } @@ -2309,7 +2309,7 @@ void TMainWindow::RefreshTable() } catch (qmu::QmuParserError &e) { - Q_UNUSED(e); + Q_UNUSED(e) formula = meash->GetFormula(); } @@ -2919,8 +2919,8 @@ bool TMainWindow::IgnoreLocking(int error, const QString &path) } return true; #else - Q_UNUSED(error); - Q_UNUSED(path); + Q_UNUSED(error) + Q_UNUSED(path) return true;// On older Qt lock assumed always taken. Allow user to ignore warning. #endif // QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) } diff --git a/src/app/valentina/core/vformulaproperty.cpp b/src/app/valentina/core/vformulaproperty.cpp index 1686dc6d8..0b61498ac 100644 --- a/src/app/valentina/core/vformulaproperty.cpp +++ b/src/app/valentina/core/vformulaproperty.cpp @@ -94,8 +94,8 @@ Qt::ItemFlags VFormulaProperty::flags(int column) const QWidget* VFormulaProperty::createEditor(QWidget* parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) VFormula formula = VProperty::d_ptr->VariantValue.value(); VFormulaPropertyEditor* tmpEditor = new VFormulaPropertyEditor(parent); diff --git a/src/app/valentina/dialogs/configdialog.cpp b/src/app/valentina/dialogs/configdialog.cpp index 5e12c1c10..fea931e05 100644 --- a/src/app/valentina/dialogs/configdialog.cpp +++ b/src/app/valentina/dialogs/configdialog.cpp @@ -149,7 +149,7 @@ void ConfigDialog::showEvent(QShowEvent *event) //--------------------------------------------------------------------------------------------------------------------- void ConfigDialog::resizeEvent(QResizeEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) // remember the size for the next time this dialog is opened, but only // if widget was already initialized, which rules out the resize at // dialog creating, which would diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index 7bebdfb62..2894f4d65 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -168,7 +168,7 @@ void DialogIncrements::FillIncrements() } catch (qmu::QmuParserError &e) { - Q_UNUSED(e); + Q_UNUSED(e) formula = incr->GetFormula(); } @@ -797,7 +797,7 @@ void DialogIncrements::ShowIncrementDetails() } catch(const VExceptionBadId &e) { - Q_UNUSED(e); + Q_UNUSED(e) EnableDetails(false); return; } @@ -820,7 +820,7 @@ void DialogIncrements::ShowIncrementDetails() } catch (qmu::QmuParserError &e) { - Q_UNUSED(e); + Q_UNUSED(e) formula = incr->GetFormula(); } diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 488977290..baae011ef 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -2558,7 +2558,7 @@ void MainWindow::FullParseFile() } catch (const VExceptionUndo &e) { - Q_UNUSED(e); + Q_UNUSED(e) /* If user want undo last operation before undo we need finish broken redo operation. For those we post event * myself. Later in method customEvent call undo.*/ QApplication::postEvent(this, new UndoEvent()); @@ -4704,8 +4704,8 @@ bool MainWindow::IgnoreLocking(int error, const QString &path) } return true; #else - Q_UNUSED(error); - Q_UNUSED(path); + Q_UNUSED(error) + Q_UNUSED(path) return true;// On older Qt lock assumed always taken. Allow user to ignore warning. #endif // QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) } diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index fe2bc9d8d..7f4e79e9d 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -400,7 +400,7 @@ void VPattern::LiteParseTree(const Document &parse) } catch (const VExceptionUndo &e) { - Q_UNUSED(e); + Q_UNUSED(e) /* If user want undo last operation before undo we need finish broken redo operation. For those we post event * myself. Later in method customEvent call undo.*/ QApplication::postEvent(this, new UndoEvent()); @@ -1409,7 +1409,7 @@ void VPattern::ParseNodePoint(const QDomElement &domElement, const Document &par } catch (const VExceptionBadId &e) { // Possible case. Parent was deleted, but the node object is still here. - Q_UNUSED(e); + Q_UNUSED(e) return;// Just ignore } data->UpdateGObject(id, new VPointF(*point, point->name(), mx, my, idObject, Draw::Modeling)); @@ -2346,7 +2346,7 @@ void VPattern::ParseNodeSpline(const QDomElement &domElement, const Document &pa } catch (const VExceptionBadId &e) { // Possible case. Parent was deleted, but the node object is still here. - Q_UNUSED(e); + Q_UNUSED(e) return;// Just ignore } @@ -2392,7 +2392,7 @@ void VPattern::ParseNodeSplinePath(const QDomElement &domElement, const Document } catch (const VExceptionBadId &e) { // Possible case. Parent was deleted, but the node object is still here. - Q_UNUSED(e); + Q_UNUSED(e) return;// Just ignore } VNodeSplinePath::Create(this, data, id, idObject, parse, Source::FromFile, "", idTool); @@ -2521,7 +2521,7 @@ void VPattern::ParseNodeEllipticalArc(const QDomElement &domElement, const Docum } catch (const VExceptionBadId &e) { // Possible case. Parent was deleted, but the node object is still here. - Q_UNUSED(e); + Q_UNUSED(e) return;// Just ignore } arc->setIdObject(idObject); @@ -2556,7 +2556,7 @@ void VPattern::ParseNodeArc(const QDomElement &domElement, const Document &parse } catch (const VExceptionBadId &e) { // Possible case. Parent was deleted, but the node object is still here. - Q_UNUSED(e); + Q_UNUSED(e) return;// Just ignore } arc->setIdObject(idObject); diff --git a/src/libs/fervor/fvupdater.cpp b/src/libs/fervor/fvupdater.cpp index 9339eb5d8..cc9211c55 100644 --- a/src/libs/fervor/fvupdater.cpp +++ b/src/libs/fervor/fvupdater.cpp @@ -291,8 +291,8 @@ void FvUpdater::startDownloadFeed(const QUrl &url) }); connect(m_reply, &QNetworkReply::downloadProgress, [this](qint64 bytesRead, qint64 totalBytes) { - Q_UNUSED(bytesRead); - Q_UNUSED(totalBytes); + Q_UNUSED(bytesRead) + Q_UNUSED(totalBytes) if (m_httpRequestAborted) { diff --git a/src/libs/ifc/xml/vabstractconverter.cpp b/src/libs/ifc/xml/vabstractconverter.cpp index 5bbcef7c9..aa1a2be00 100644 --- a/src/libs/ifc/xml/vabstractconverter.cpp +++ b/src/libs/ifc/xml/vabstractconverter.cpp @@ -307,7 +307,7 @@ void VAbstractConverter::ValidateInputFile(const QString ¤tSchema) const } catch(const VException &exp) { // Nope, we can't. - Q_UNUSED(exp); + Q_UNUSED(exp) throw e; } } diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index d2499b4fd..aff76405c 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -105,8 +105,8 @@ inline qint64 MessageHandler::column() const void MessageHandler::handleMessage(QtMsgType type, const QString &description, const QUrl &identifier, const QSourceLocation &sourceLocation) { - Q_UNUSED(type); - Q_UNUSED(identifier); + Q_UNUSED(type) + Q_UNUSED(identifier) m_messageType = type; m_description = description; diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index 68f8dccc3..807104844 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -348,9 +348,9 @@ void QmuParser::InitOprt() //--------------------------------------------------------------------------------------------------------------------- void QmuParser::OnDetectVar(const QString &pExpr, int &nStart, int &nEnd) { - Q_UNUSED(pExpr); - Q_UNUSED(nStart); - Q_UNUSED(nEnd); + Q_UNUSED(pExpr) + Q_UNUSED(nStart) + Q_UNUSED(nEnd) // this is just sample code to illustrate modifying variable names on the fly. // I'm not sure anyone really needs such a feature... /* diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index 6c61fa9b2..0facdfd49 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -218,9 +218,9 @@ void QmuParserBase::ReInit() const //--------------------------------------------------------------------------------------------------------------------- void QmuParserBase::OnDetectVar(const QString &pExpr, int &nStart, int &nEnd) { - Q_UNUSED(pExpr); - Q_UNUSED(nStart); - Q_UNUSED(nEnd); + Q_UNUSED(pExpr) + Q_UNUSED(nStart) + Q_UNUSED(nEnd) } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vdxf/dxflib/dl_dxf.cpp b/src/libs/vdxf/dxflib/dl_dxf.cpp index 5a245c236..01ed1b1f4 100644 --- a/src/libs/vdxf/dxflib/dl_dxf.cpp +++ b/src/libs/vdxf/dxflib/dl_dxf.cpp @@ -3846,7 +3846,7 @@ void DL_Dxf::writeHatch2(DL_WriterA& dw, const DL_Attributes& attrib) const { - Q_UNUSED(attrib); + Q_UNUSED(attrib) dw.dxfInt(75, 0); // odd parity dw.dxfInt(76, 1); // pattern type @@ -3904,7 +3904,7 @@ void DL_Dxf::writeHatchLoop1(DL_WriterA& dw, void DL_Dxf::writeHatchLoop2(DL_WriterA& dw, const DL_HatchLoopData& data) { - Q_UNUSED(data); + Q_UNUSED(data) dw.dxfInt(97, 0); } diff --git a/src/libs/vlayout/vgraphicsfillitem.cpp b/src/libs/vlayout/vgraphicsfillitem.cpp index 4edcb17cb..d619b1278 100644 --- a/src/libs/vlayout/vgraphicsfillitem.cpp +++ b/src/libs/vlayout/vgraphicsfillitem.cpp @@ -40,8 +40,8 @@ VGraphicsFillItem::~VGraphicsFillItem() //--------------------------------------------------------------------------------------------------------------------- void VGraphicsFillItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { - Q_UNUSED(option); - Q_UNUSED(widget); + Q_UNUSED(option) + Q_UNUSED(widget) painter->save(); painter->setBrush(painter->pen().color()); painter->drawPath(path()); diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp index a59e16898..5f52cb1b5 100644 --- a/src/libs/vlayout/vposter.cpp +++ b/src/libs/vlayout/vposter.cpp @@ -244,7 +244,7 @@ int VPoster::CountColumns(int width) const //--------------------------------------------------------------------------------------------------------------------- PosterData VPoster::Cut(int i, int j, const QRect &imageRect) const { - Q_UNUSED(imageRect); + Q_UNUSED(imageRect) const int x = j*PageRect().width() - j*static_cast(allowence); const int y = i*PageRect().height() - i*static_cast(allowence); diff --git a/src/libs/vmisc/backport/qcommandlineparser.cpp b/src/libs/vmisc/backport/qcommandlineparser.cpp index ff70eaae1..0294ceb0a 100644 --- a/src/libs/vmisc/backport/qcommandlineparser.cpp +++ b/src/libs/vmisc/backport/qcommandlineparser.cpp @@ -426,7 +426,7 @@ void QCommandLineParser::process(const QStringList &arguments) void QCommandLineParser::process(const QCoreApplication &app) { // QCoreApplication::arguments() is static, but the app instance must exist so we require it as parameter - Q_UNUSED(app); + Q_UNUSED(app) process(QCoreApplication::arguments()); } diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index 14ee3f3b1..8eba5da5e 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -454,9 +454,9 @@ void SetOverrideCursor(const QString &pixmapPath, int hotX, int hotY) QApplication::setOverrideCursor(QCursor(newPixmap, hotX, hotY)); } #else - Q_UNUSED(pixmapPath); - Q_UNUSED(hotX); - Q_UNUSED(hotY); + Q_UNUSED(pixmapPath) + Q_UNUSED(hotX) + Q_UNUSED(hotY) #endif } @@ -478,7 +478,7 @@ void SetOverrideCursor(Qt::CursorShape shape) } #else - Q_UNUSED(shape); + Q_UNUSED(shape) #endif } @@ -501,7 +501,7 @@ void RestoreOverrideCursor(const QString &pixmapPath) QApplication::restoreOverrideCursor(); } #else - Q_UNUSED(pixmapPath); + Q_UNUSED(pixmapPath) #endif } @@ -523,7 +523,7 @@ void RestoreOverrideCursor(Qt::CursorShape shape) } #else - Q_UNUSED(shape); + Q_UNUSED(shape) #endif } diff --git a/src/libs/vmisc/vlockguard.h b/src/libs/vmisc/vlockguard.h index c6864ac52..fcbf57e65 100644 --- a/src/libs/vmisc/vlockguard.h +++ b/src/libs/vmisc/vlockguard.h @@ -189,9 +189,9 @@ bool VLockGuard::TryLock(const QString &lockName, int stale, int timeou #endif } #else - Q_UNUSED(lockName); - Q_UNUSED(stale); - Q_UNUSED(timeout); + Q_UNUSED(lockName) + Q_UNUSED(stale) + Q_UNUSED(timeout) #endif return res; } diff --git a/src/libs/vpatterndb/variables/vinternalvariable.cpp b/src/libs/vpatterndb/variables/vinternalvariable.cpp index fe7c7a28f..d22cfa9bd 100644 --- a/src/libs/vpatterndb/variables/vinternalvariable.cpp +++ b/src/libs/vpatterndb/variables/vinternalvariable.cpp @@ -57,7 +57,7 @@ VInternalVariable::~VInternalVariable() //--------------------------------------------------------------------------------------------------------------------- bool VInternalVariable::Filter(quint32 id) { - Q_UNUSED(id); + Q_UNUSED(id) return false; } diff --git a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp index e0eb6fc4c..948a2879d 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp @@ -62,8 +62,8 @@ QVariant VColorProperty::data (int column, int role) const QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) VColorPropertyEditor* tmpWidget = new VColorPropertyEditor(parent); tmpWidget->setLocale(parent->locale()); diff --git a/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp b/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp index 38ba60ee7..b1e71c06a 100644 --- a/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp @@ -77,9 +77,9 @@ QVariant VEmptyProperty::data (int column, int role) const QWidget* VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); - Q_UNUSED(parent); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(parent) + Q_UNUSED(delegate) return NULL; } @@ -88,7 +88,7 @@ QWidget* VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewIt //! Gets the data from the widget QVariant VEmptyProperty::getEditorData(const QWidget *editor) const { - Q_UNUSED(editor); + Q_UNUSED(editor) return QVariant(); } @@ -96,7 +96,7 @@ QVariant VEmptyProperty::getEditorData(const QWidget *editor) const //! Returns item flags Qt::ItemFlags VEmptyProperty::flags(int column) const { - Q_UNUSED(column); + Q_UNUSED(column) return Qt::ItemIsEnabled | Qt::ItemIsSelectable; } diff --git a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp index 24495253b..4851d2086 100644 --- a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp @@ -72,8 +72,8 @@ QVariant VEnumProperty::data (int column, int role) const QWidget* VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) QComboBox* tmpEditor = new QComboBox(parent); tmpEditor->clear(); tmpEditor->setLocale(parent->locale()); diff --git a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp index e5f900321..7fb301912 100644 --- a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp @@ -84,7 +84,7 @@ QVariant VFileProperty::data (int column, int role) const QWidget* VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); + Q_UNUSED(options) VFileEditWidget* tmpWidget = new VFileEditWidget(parent); if (delegate) diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp index c2f04a636..968b0f792 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp @@ -85,8 +85,8 @@ QVariant VLineColorProperty::data(int column, int role) const QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) QComboBox* tmpEditor = new QComboBox(parent); int size = tmpEditor->iconSize().height(); diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp index ece3d58bd..2aa93e811 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp @@ -82,8 +82,8 @@ QVariant VLineTypeProperty::data(int column, int role) const QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) QComboBox* tmpEditor = new QComboBox(parent); tmpEditor->clear(); tmpEditor->setLocale(parent->locale()); diff --git a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp index b1524d5e6..be1102820 100644 --- a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp @@ -58,8 +58,8 @@ VIntegerProperty::VIntegerProperty(const QString &name) QWidget* VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) QSpinBox* tmpEditor = new QSpinBox(parent); tmpEditor->setLocale(parent->locale()); @@ -166,8 +166,8 @@ VDoubleProperty::VDoubleProperty(const QString &name) QWidget* VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) QDoubleSpinBox* tmpEditor = new QDoubleSpinBox(parent); tmpEditor->setLocale(parent->locale()); tmpEditor->setMinimum(minValue); diff --git a/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp b/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp index 0ed8c347f..ab3839f70 100644 --- a/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp @@ -65,8 +65,8 @@ QVariant VObjectProperty::data (int column, int role) const QWidget* VObjectProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) QComboBox* tmpEditor = new QComboBox(parent); tmpEditor->clear(); tmpEditor->setLocale(parent->locale()); diff --git a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp index 2a7e60400..811569d39 100644 --- a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp @@ -58,7 +58,7 @@ QVariant VShortcutProperty::data (int column, int role) const QWidget* VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); + Q_UNUSED(options) VShortcutEditWidget* tmpWidget = new VShortcutEditWidget(parent); if (delegate) diff --git a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp index 692297516..1fd2774ca 100644 --- a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp @@ -56,8 +56,8 @@ VPE::VStringProperty::VStringProperty(const QString &name) QWidget *VPE::VStringProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) QLineEdit* tmpEditor = new QLineEdit(parent); tmpEditor->setLocale(parent->locale()); diff --git a/src/libs/vpropertyexplorer/vproperty.cpp b/src/libs/vpropertyexplorer/vproperty.cpp index 17b06bba3..9ba92349d 100644 --- a/src/libs/vpropertyexplorer/vproperty.cpp +++ b/src/libs/vpropertyexplorer/vproperty.cpp @@ -105,10 +105,10 @@ bool VProperty::setData(const QVariant &data, int role) bool VProperty::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const QAbstractItemDelegate *delegate) const { - Q_UNUSED(painter); - Q_UNUSED(option); - Q_UNUSED(index); - Q_UNUSED(delegate); + Q_UNUSED(painter) + Q_UNUSED(option) + Q_UNUSED(index) + Q_UNUSED(delegate) return false; } @@ -117,8 +117,8 @@ bool VProperty::paint(QPainter *painter, const QStyleOptionViewItem &option, con QWidget* VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { - Q_UNUSED(options); - Q_UNUSED(delegate); + Q_UNUSED(options) + Q_UNUSED(delegate) QItemEditorFactory *factory = new QItemEditorFactory; QItemEditorCreatorBase *lineCreator = new QStandardItemEditorCreator(); @@ -419,7 +419,7 @@ void VProperty::setPropertyType(const Property &type) void VProperty::UpdateParent(const QVariant &value) { - Q_UNUSED(value); + Q_UNUSED(value) } void VProperty::ValueChildChanged(const QVariant &value, int typeForParent) diff --git a/src/libs/vpropertyexplorer/vpropertymodel.cpp b/src/libs/vpropertyexplorer/vpropertymodel.cpp index 9dd573963..95d6978e0 100644 --- a/src/libs/vpropertyexplorer/vpropertymodel.cpp +++ b/src/libs/vpropertyexplorer/vpropertymodel.cpp @@ -251,7 +251,7 @@ int VPropertyModel::rowCount ( const QModelIndex & parent ) const //! Returns the number of columns int VPropertyModel::columnCount ( const QModelIndex & parent) const { - Q_UNUSED(parent); + Q_UNUSED(parent) return 2; } diff --git a/src/libs/vtools/dialogs/tools/dialogmove.cpp b/src/libs/vtools/dialogs/tools/dialogmove.cpp index a2f3ba643..eaf85799b 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.cpp +++ b/src/libs/vtools/dialogs/tools/dialogmove.cpp @@ -243,8 +243,8 @@ void DialogMove::ShowDialog(bool click) //--------------------------------------------------------------------------------------------------------------------- void DialogMove::ChosenObject(quint32 id, const SceneObject &type) { - Q_UNUSED(id); - Q_UNUSED(type); + Q_UNUSED(id) + Q_UNUSED(type) // do nothing } diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index 3b577fe76..cb7759961 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -747,16 +747,16 @@ void DialogTool::CheckState() */ void DialogTool::ChosenObject(quint32 id, const SceneObject &type) { - Q_UNUSED(id); - Q_UNUSED(type); + Q_UNUSED(id) + Q_UNUSED(type) } //--------------------------------------------------------------------------------------------------------------------- void DialogTool::SelectedObject(bool selected, quint32 object, quint32 tool) { - Q_UNUSED(selected); - Q_UNUSED(object); - Q_UNUSED(tool); + Q_UNUSED(selected) + Q_UNUSED(object) + Q_UNUSED(tool) } //--------------------------------------------------------------------------------------------------------------------- @@ -957,13 +957,13 @@ QString DialogTool::getPointName() const //--------------------------------------------------------------------------------------------------------------------- void DialogTool::ShowDialog(bool click) { - Q_UNUSED(click); + Q_UNUSED(click) } //--------------------------------------------------------------------------------------------------------------------- void DialogTool::Build(const Tool &type) { - Q_UNUSED(type); + Q_UNUSED(type) } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index f160fb284..9751a2dc5 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -228,7 +228,7 @@ void VToolFlippingByAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *event } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index fc35a2836..af27d8410 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -208,7 +208,7 @@ void VToolFlippingByLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index 3c38954f1..3d10e3fcc 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -90,9 +90,9 @@ void VAbstractOperation::GroupVisibility(quint32 object, bool visible) //--------------------------------------------------------------------------------------------------------------------- void VAbstractOperation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(painter); - Q_UNUSED(option); - Q_UNUSED(widget); + Q_UNUSED(painter) + Q_UNUSED(option) + Q_UNUSED(widget) } //--------------------------------------------------------------------------------------------------------------------- @@ -370,7 +370,7 @@ void VAbstractOperation::DeleteFromLabel() } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp index 931c2beba..0e6617b06 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp @@ -352,7 +352,7 @@ void VToolMove::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index 889d0b81f..20d31eb22 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -340,7 +340,7 @@ void VToolRotation::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp index 4eb084624..b075557b0 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp @@ -150,7 +150,7 @@ void VAbstractSpline::SetFactor(qreal factor) // cppcheck-suppress unusedFunction void VAbstractSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) const QSharedPointer curve = VAbstractTool::data.GeometricObject(id); this->setPen(QPen(CorrectColor(curve->GetColor()), qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit()))/factor, Qt::SolidLine, @@ -168,7 +168,7 @@ void VAbstractSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) // cppcheck-suppress unusedFunction void VAbstractSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) const QSharedPointer curve = VAbstractTool::data.GeometricObject(id); this->setPen(QPen(CorrectColor(curve->GetColor()), qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); @@ -217,7 +217,7 @@ void VAbstractSpline::keyReleaseEvent(QKeyEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } break; @@ -400,6 +400,6 @@ QString VAbstractSpline::name() const //--------------------------------------------------------------------------------------------------------------------- void VAbstractSpline::GroupVisibility(quint32 object, bool visible) { - Q_UNUSED(object); + Q_UNUSED(object) setVisible(visible); } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp index 2ef780a52..25d7dfdd9 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp @@ -316,7 +316,7 @@ void VToolArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp index ee4e4e215..dd76cad3b 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp @@ -279,7 +279,7 @@ void VToolArcWithLength::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp index 46fba40c4..b178efc2f 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp @@ -175,7 +175,7 @@ void VToolCubicBezier::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp index df6976627..a144235f9 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp @@ -186,7 +186,7 @@ void VToolCubicBezierPath::contextMenuEvent(QGraphicsSceneContextMenuEvent *even } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp index ec2a03131..20ca1b786 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp @@ -384,7 +384,7 @@ void VToolEllipticalArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index ed60820d5..975986592 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -277,7 +277,7 @@ void VToolSpline::ShowVisualization(bool show) void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const SplinePointPosition &position, const QPointF &pos) { - Q_UNUSED(indexSpline); + Q_UNUSED(indexSpline) const QSharedPointer spline = VAbstractTool::data.GeometricObject(id); const VSpline spl = CorrectedSpline(*spline, position, pos); @@ -305,7 +305,7 @@ void VToolSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index 270ffa1c4..d6110f6b3 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -377,7 +377,7 @@ void VToolSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp index d530583f8..eefa4484f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp @@ -330,7 +330,7 @@ void VToolDoublePoint::keyReleaseEvent(QKeyEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } break; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp index e612748ef..24f2521d0 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp @@ -312,7 +312,7 @@ void VToolTrueDarts::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp index 78e880945..4c9392d43 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp @@ -202,7 +202,7 @@ void VToolCutArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp index 1a9435b7c..433f29bea 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp @@ -202,7 +202,7 @@ void VToolCutSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp index bb044d606..a9256571f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp @@ -290,7 +290,7 @@ void VToolCutSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp index adf05921a..6fb21587a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp @@ -107,7 +107,7 @@ void VToolAlongLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp index 1f8fee2c9..ff670bb90 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp @@ -257,7 +257,7 @@ void VToolBisector::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp index dde7fd06b..478033be4 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -271,7 +271,7 @@ void VToolCurveIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *e } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp index d4dae1598..828b5c12c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp @@ -208,7 +208,7 @@ void VToolEndLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp index 872cf464e..83a79bef4 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp @@ -215,7 +215,7 @@ void VToolHeight::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp index 21463f151..6a145ed1f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp @@ -267,7 +267,7 @@ void VToolLineIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *ev } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp index 8facfde80..f9fb7335b 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp @@ -235,7 +235,7 @@ void VToolNormal::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp index 478434f82..ae5b1b6ea 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp @@ -263,7 +263,7 @@ void VToolShoulderPoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp index 540f989fc..04cd385ca 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp @@ -151,7 +151,7 @@ VToolBasePoint *VToolBasePoint::Create(quint32 _id, const QString &nameActivPP, //--------------------------------------------------------------------------------------------------------------------- void VToolBasePoint::ShowVisualization(bool show) { - Q_UNUSED(show); //don't have any visualization for base point yet + Q_UNUSED(show) //don't have any visualization for base point yet } //--------------------------------------------------------------------------------------------------------------------- @@ -371,7 +371,7 @@ void VToolBasePoint::SaveOptions(QDomElement &tag, QSharedPointer &obj //--------------------------------------------------------------------------------------------------------------------- void VToolBasePoint::ReadToolAttributes(const QDomElement &domElement) { - Q_UNUSED(domElement); + Q_UNUSED(domElement) // This tool doesn't need read attributes from file. } @@ -404,7 +404,7 @@ void VToolBasePoint::contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) catch(const VExceptionToolWasDeleted &e) { qCDebug(vTool, "Tool was deleted. Immediately leave method."); - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } qCDebug(vTool, "Context menu closed. Tool was not deleted."); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp index ff97a2bfa..54f54d459 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp @@ -224,7 +224,7 @@ void VToolLineIntersect::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp index 2c4422aab..73abb59e1 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp @@ -296,7 +296,7 @@ void VToolPointFromArcAndTangent::contextMenuEvent(QGraphicsSceneContextMenuEven } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp index e33140bd9..828ae6053 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp @@ -280,7 +280,7 @@ void VToolPointFromCircleAndTangent::contextMenuEvent(QGraphicsSceneContextMenuE } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp index a93c79f4d..cd010e3d9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp @@ -279,7 +279,7 @@ void VToolPointOfContact::contextMenuEvent(QGraphicsSceneContextMenuEvent *event } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp index c113e0bda..54646ddae 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp @@ -198,7 +198,7 @@ void VToolPointOfIntersection::contextMenuEvent(QGraphicsSceneContextMenuEvent * } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp index d2c6f1f16..31718d1e6 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp @@ -302,7 +302,7 @@ void VToolPointOfIntersectionArcs::contextMenuEvent(QGraphicsSceneContextMenuEve } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp index b717dccbf..b5b11e80d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp @@ -316,7 +316,7 @@ void VToolPointOfIntersectionCircles::contextMenuEvent(QGraphicsSceneContextMenu } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index a4785addd..d754ef988 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -362,7 +362,7 @@ void VToolPointOfIntersectionCurves::contextMenuEvent(QGraphicsSceneContextMenuE } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index 403fe7742..d34df795d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -124,7 +124,7 @@ void VToolSinglePoint::SetEnabled(bool enabled) //--------------------------------------------------------------------------------------------------------------------- void VToolSinglePoint::GroupVisibility(quint32 object, bool visible) { - Q_UNUSED(object); + Q_UNUSED(object) setVisible(visible); } @@ -247,7 +247,7 @@ void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) */ void VToolSinglePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit()))/factor)); QGraphicsEllipseItem::hoverEnterEvent(event); @@ -260,7 +260,7 @@ void VToolSinglePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) */ void VToolSinglePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); QGraphicsEllipseItem::hoverLeaveEvent(event); @@ -340,7 +340,7 @@ void VToolSinglePoint::keyReleaseEvent(QKeyEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } break; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp index fd85d5e74..e9cdfe780 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp @@ -262,7 +262,7 @@ void VToolTriangle::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp index c87076dc3..fe68f5daf 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp @@ -70,7 +70,7 @@ void VAbstractPoint::DeleteFromLabel() } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.cpp b/src/libs/vtools/tools/drawTools/vdrawtool.cpp index 2cdb5fc2f..4de01fb70 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.cpp +++ b/src/libs/vtools/tools/drawTools/vdrawtool.cpp @@ -88,8 +88,8 @@ VDrawTool::~VDrawTool() */ void VDrawTool::ShowTool(quint32 id, bool enable) { - Q_UNUSED(id); - Q_UNUSED(enable); + Q_UNUSED(id) + Q_UNUSED(enable) } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index 559772cbd..a759265f9 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -263,7 +263,7 @@ void VToolLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } @@ -305,7 +305,7 @@ void VToolLine::RefreshDataInFile() */ void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit()))/factor, LineStyleToPenStyle(typeLine))); @@ -318,7 +318,7 @@ void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) */ void VToolLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) if (vis.isNull()) { this->setPen(QPen(CorrectColor(lineColor), @@ -373,7 +373,7 @@ void VToolLine::keyReleaseEvent(QKeyEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } break; @@ -503,7 +503,7 @@ void VToolLine::SetLineColor(const QString &value) //--------------------------------------------------------------------------------------------------------------------- void VToolLine::GroupVisibility(quint32 object, bool visible) { - Q_UNUSED(object); + Q_UNUSED(object) setVisible(visible); } diff --git a/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp b/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp index 21e4c9d5d..381509163 100644 --- a/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp +++ b/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp @@ -141,8 +141,8 @@ void VAbstractNode::SetParentType(const ParentType &value) //--------------------------------------------------------------------------------------------------------------------- void VAbstractNode::GroupVisibility(quint32 object, bool visible) { - Q_UNUSED(object); - Q_UNUSED(visible); + Q_UNUSED(object) + Q_UNUSED(visible) } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index 27e3b9861..e693d1b27 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -243,7 +243,7 @@ void VNodePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) */ void VNodePoint::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) this->setPen(QPen(currentColor, qApp->toPixel(WidthMainLine(*VAbstractTool::data.GetPatternUnit())))); } @@ -254,7 +254,7 @@ void VNodePoint::hoverMoveEvent(QGraphicsSceneHoverEvent *event) */ void VNodePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) this->setPen(QPen(currentColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); } diff --git a/src/libs/vtools/tools/vgrainlineitem.cpp b/src/libs/vtools/tools/vgrainlineitem.cpp index 29a91e81e..4fea3b503 100644 --- a/src/libs/vtools/tools/vgrainlineitem.cpp +++ b/src/libs/vtools/tools/vgrainlineitem.cpp @@ -94,8 +94,8 @@ VGrainlineItem::~VGrainlineItem() */ void VGrainlineItem::paint(QPainter* pP, const QStyleOptionGraphicsItem* pOption, QWidget* pWidget) { - Q_UNUSED(pOption); - Q_UNUSED(pWidget); + Q_UNUSED(pOption) + Q_UNUSED(pWidget) pP->save(); QColor clr = Qt::black; pP->setPen(QPen(clr, 3)); diff --git a/src/libs/vtools/tools/vtextgraphicsitem.cpp b/src/libs/vtools/tools/vtextgraphicsitem.cpp index 850c87abc..d9b815266 100644 --- a/src/libs/vtools/tools/vtextgraphicsitem.cpp +++ b/src/libs/vtools/tools/vtextgraphicsitem.cpp @@ -109,8 +109,8 @@ void VTextGraphicsItem::SetFont(const QFont& fnt) */ void VTextGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(widget); - Q_UNUSED(option); + Q_UNUSED(widget) + Q_UNUSED(option) painter->fillRect(m_rectBoundingBox, QColor(251, 251, 175)); painter->setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); @@ -579,7 +579,7 @@ void VTextGraphicsItem::hoverMoveEvent(QGraphicsSceneHoverEvent* pHE) */ void VTextGraphicsItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* pHE) { - Q_UNUSED(pHE); + Q_UNUSED(pHE) RestoreOverrideCursor(Qt::SizeFDiagCursor); } diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index f0345a571..1814548fa 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -379,7 +379,7 @@ void VToolDetail::Remove(bool ask) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } } @@ -695,7 +695,7 @@ void VToolDetail::keyReleaseEvent(QKeyEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } break; @@ -752,7 +752,7 @@ void VToolDetail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolDetail::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) if (flags() & QGraphicsItem::ItemIsMovable) { SetOverrideCursor(cursorArrowOpenHand, 1, 1); @@ -762,7 +762,7 @@ void VToolDetail::hoverMoveEvent(QGraphicsSceneHoverEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolDetail::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) if (flags() & QGraphicsItem::ItemIsMovable) { SetOverrideCursor(cursorArrowOpenHand, 1, 1); @@ -772,7 +772,7 @@ void VToolDetail::hoverEnterEvent(QGraphicsSceneHoverEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolDetail::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) //Disable cursor-arrow-openhand if (flags() & QGraphicsItem::ItemIsMovable) { @@ -824,7 +824,7 @@ void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } catch(const VExceptionToolWasDeleted &e) { - Q_UNUSED(e); + Q_UNUSED(e) return;//Leave this method immediately!!! } return; //Leave this method immediately after call!!! @@ -1195,8 +1195,8 @@ void VToolDetail::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolDetail::GroupVisibility(quint32 object, bool visible) { - Q_UNUSED(object); - Q_UNUSED(visible); + Q_UNUSED(object) + Q_UNUSED(visible) } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/vtooluniondetails.cpp b/src/libs/vtools/tools/vtooluniondetails.cpp index fe65a630c..fc1b961ef 100644 --- a/src/libs/vtools/tools/vtooluniondetails.cpp +++ b/src/libs/vtools/tools/vtooluniondetails.cpp @@ -176,7 +176,7 @@ void VToolUnionDetails::AddToNewDetail(VMainGraphicsScene *scene, VAbstractPatte QLineF l2(*center, p2); center->setMode(Draw::Modeling); quint32 idCenter = data->AddGObject(center); - Q_UNUSED(idCenter); + Q_UNUSED(idCenter) VArc *arc1 = new VArc(*center, arc->GetRadius(), arc->GetFormulaRadius(), l1.angle(), QString().setNum(l1.angle()), l2.angle(), QString().setNum(l2.angle())); arc1->setMode(Draw::Modeling); @@ -210,7 +210,7 @@ void VToolUnionDetails::AddToNewDetail(VMainGraphicsScene *scene, VAbstractPatte QLineF l2(*center, p2); center->setMode(Draw::Modeling); quint32 idCenter = data->AddGObject(center); - Q_UNUSED(idCenter); + Q_UNUSED(idCenter) VEllipticalArc *arc1 = new VEllipticalArc (*center, arc->GetRadius1(), arc->GetRadius2(), arc->GetFormulaRadius1(), arc->GetFormulaRadius2(), l1.angle(), QString().setNum(l1.angle()), l2.angle(), @@ -561,8 +561,8 @@ void VToolUnionDetails::decrementReferens() //--------------------------------------------------------------------------------------------------------------------- void VToolUnionDetails::GroupVisibility(quint32 object, bool visible) { - Q_UNUSED(object); - Q_UNUSED(visible); + Q_UNUSED(object) + Q_UNUSED(visible) } //--------------------------------------------------------------------------------------------------------------------- @@ -643,7 +643,7 @@ VToolUnionDetails* VToolUnionDetails::Create(const quint32 _id, const VDetail &d VNodeDetail det1p1; VNodeDetail det1p2; d1.NodeOnEdge(indexD1, det1p1, det1p2); - Q_UNUSED(det1p2); + Q_UNUSED(det1p2) VPointF point1; VPointF point2; diff --git a/src/libs/vtools/visualization/line/operation/visoperation.cpp b/src/libs/vtools/visualization/line/operation/visoperation.cpp index 39877ade0..4cc52b06e 100644 --- a/src/libs/vtools/visualization/line/operation/visoperation.cpp +++ b/src/libs/vtools/visualization/line/operation/visoperation.cpp @@ -65,7 +65,7 @@ void VisOperation::SetObjects(QVector objects) //--------------------------------------------------------------------------------------------------------------------- void VisOperation::VisualMode(const quint32 &pointId) { - Q_UNUSED(pointId); + Q_UNUSED(pointId) VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); SCASSERT(scene != nullptr) diff --git a/src/libs/vwidgets/vgraphicssimpletextitem.cpp b/src/libs/vwidgets/vgraphicssimpletextitem.cpp index 2f95261ff..270ac192c 100644 --- a/src/libs/vwidgets/vgraphicssimpletextitem.cpp +++ b/src/libs/vwidgets/vgraphicssimpletextitem.cpp @@ -194,7 +194,7 @@ void VGraphicsSimpleTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) */ void VGraphicsSimpleTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) if (flags() & QGraphicsItem::ItemIsMovable) { //Disable cursor-arrow-openhand diff --git a/src/libs/vwidgets/vmaingraphicsview.cpp b/src/libs/vwidgets/vmaingraphicsview.cpp index 8e68bc497..936afd478 100644 --- a/src/libs/vwidgets/vmaingraphicsview.cpp +++ b/src/libs/vwidgets/vmaingraphicsview.cpp @@ -130,7 +130,7 @@ void GraphicsViewZoom::set_zoom_factor_base(double value) //--------------------------------------------------------------------------------------------------------------------- void GraphicsViewZoom::VerticalScrollingTime(qreal x) { - Q_UNUSED(x); + Q_UNUSED(x) // Try to adapt scrolling to speed of rotating mouse wheel and scale factor // Value of _numScheduledScrollings is too short, so we scale the value @@ -151,7 +151,7 @@ void GraphicsViewZoom::VerticalScrollingTime(qreal x) //--------------------------------------------------------------------------------------------------------------------- void GraphicsViewZoom::HorizontalScrollingTime(qreal x) { - Q_UNUSED(x); + Q_UNUSED(x) // Try to adapt scrolling to speed of rotating mouse wheel and scale factor // Value of _numScheduledScrollings is too short, so we scale the value From 049a72ff20a4798ae27170b4de885443838dc168 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 20 Dec 2016 22:55:40 +0200 Subject: [PATCH 04/26] "C3861: 'snprintf': identifier not found" with VS2013 and prior. --HG-- branch : develop --- src/libs/vdxf/dxflib/dl_writer_ascii.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libs/vdxf/dxflib/dl_writer_ascii.h b/src/libs/vdxf/dxflib/dl_writer_ascii.h index 04ef3b0df..9d7084e9f 100644 --- a/src/libs/vdxf/dxflib/dl_writer_ascii.h +++ b/src/libs/vdxf/dxflib/dl_writer_ascii.h @@ -33,6 +33,10 @@ #if (_MSC_VER > 1000) #pragma once #endif // _MSC_VER > 1000 + + #if _MSC_VER < 1900 + #define snprintf _snprintf + #endif #endif // Q_CC_MSVC #include From bba88c108f54f274e91e2928ee2c9b84c8c56c6c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 12:32:38 +0200 Subject: [PATCH 05/26] Fix possible use of uninitialized value. --HG-- branch : develop --- src/libs/vmisc/backport/qmarginsf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/vmisc/backport/qmarginsf.cpp b/src/libs/vmisc/backport/qmarginsf.cpp index b683ba242..e57c4b3ee 100644 --- a/src/libs/vmisc/backport/qmarginsf.cpp +++ b/src/libs/vmisc/backport/qmarginsf.cpp @@ -355,7 +355,7 @@ QDataStream &operator<<(QDataStream &s, const QMarginsF &m) QDataStream &operator>>(QDataStream &s, QMarginsF &m) { - double left, top, right, bottom; + double left = 0, top = 0, right = 0, bottom = 0; s >> left; s >> top; s >> right; From 5153e997d1a279f1a21fa1a624cc9129ce88686c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 14:02:55 +0200 Subject: [PATCH 06/26] Fix warning "using-directive shall not be used.". --HG-- branch : develop --- src/app/valentina/core/vformulaproperty.cpp | 10 +- .../valentina/core/vformulapropertyeditor.cpp | 4 +- .../core/vtooloptionspropertybrowser.cpp | 251 +++++++++--------- src/libs/qmuparser/qmuparser.cpp | 2 - src/libs/qmuparser/qmuparserbase.cpp | 4 +- src/libs/qmuparser/qmuparsertest.cpp | 2 - src/libs/vpatterndb/calculator.cpp | 4 +- .../vpatterndb/vtranslatemeasurements.cpp | 119 ++++----- src/libs/vpatterndb/vtranslatevars.cpp | 46 ++-- .../plugins/Vector3d/vvector3dproperty.cpp | 22 +- .../plugins/vboolproperty.cpp | 17 +- .../plugins/vcolorproperty.cpp | 18 +- .../plugins/vcolorpropertyeditor.cpp | 18 +- .../plugins/vemptyproperty.cpp | 22 +- .../plugins/venumproperty.cpp | 30 +-- .../plugins/vfileproperty.cpp | 36 ++- .../plugins/vfilepropertyeditor.cpp | 32 ++- .../plugins/vlinecolorproperty.cpp | 26 +- .../plugins/vlinetypeproperty.cpp | 24 +- .../plugins/vnumberproperty.cpp | 51 ++-- .../plugins/vobjectproperty.cpp | 26 +- .../plugins/vpointfproperty.cpp | 20 +- .../plugins/vshortcutproperty.cpp | 23 +- .../plugins/vshortcutpropertyeditor.cpp | 18 +- .../plugins/vstringproperty.cpp | 15 +- .../plugins/vwidgetproperty.cpp | 14 +- src/libs/vpropertyexplorer/vproperty.cpp | 90 +++---- .../vpropertyexplorer/vpropertydelegate.cpp | 22 +- .../vpropertyfactorymanager.cpp | 25 +- .../vpropertyexplorer/vpropertyformview.cpp | 36 ++- .../vpropertyexplorer/vpropertyformwidget.cpp | 32 ++- src/libs/vpropertyexplorer/vpropertymodel.cpp | 52 ++-- src/libs/vpropertyexplorer/vpropertyset.cpp | 44 ++- .../vpropertyexplorer/vpropertytreeview.cpp | 14 +- .../vpropertyexplorer/vserializedproperty.cpp | 12 +- .../vstandardpropertyfactory.cpp | 9 +- src/test/ParserTest/main.cpp | 5 +- 37 files changed, 562 insertions(+), 633 deletions(-) diff --git a/src/app/valentina/core/vformulaproperty.cpp b/src/app/valentina/core/vformulaproperty.cpp index 0b61498ac..0cf7da219 100644 --- a/src/app/valentina/core/vformulaproperty.cpp +++ b/src/app/valentina/core/vformulaproperty.cpp @@ -37,22 +37,20 @@ enum class ChildType : char {Invalid = 0, Value = 1, Formula = 2}; -using namespace VPE; - //--------------------------------------------------------------------------------------------------------------------- VFormulaProperty::VFormulaProperty(const QString &name) : VProperty(name, static_cast(VFormula::FormulaTypeId())) { - d_ptr->type = Property::Complex; + d_ptr->type = VPE::Property::Complex; - VStringProperty* tmpValue = new VStringProperty(tr("Value")); + VPE::VStringProperty* tmpValue = new VPE::VStringProperty(tr("Value")); addChild(tmpValue); tmpValue->setUpdateBehaviour(true, false); tmpValue->setReadOnly(true); tmpValue->setOsSeparator(qApp->Settings()->GetOsSeparator()); tmpValue->setTypeForParent(static_cast(ChildType::Value)); - VStringProperty* tmpFormula = new VStringProperty(tr("Formula")); + VPE::VStringProperty* tmpFormula = new VPE::VStringProperty(tr("Formula")); addChild(tmpFormula); tmpFormula->setClearButtonEnable(true); tmpFormula->setUpdateBehaviour(true, false); @@ -143,7 +141,7 @@ QString VFormulaProperty::type() const } //--------------------------------------------------------------------------------------------------------------------- -VProperty *VFormulaProperty::clone(bool include_children, VProperty *container) const +VPE::VProperty *VFormulaProperty::clone(bool include_children, VProperty *container) const { if (!container) { diff --git a/src/app/valentina/core/vformulapropertyeditor.cpp b/src/app/valentina/core/vformulapropertyeditor.cpp index 0100c8741..ad894f790 100644 --- a/src/app/valentina/core/vformulapropertyeditor.cpp +++ b/src/app/valentina/core/vformulapropertyeditor.cpp @@ -39,8 +39,6 @@ #include "../vpropertyexplorer/vproperty.h" #include "../vtools/dialogs/support/dialogeditwrongformula.h" -using namespace VPE; - // VFormulaPropertyEditor //--------------------------------------------------------------------------------------------------------------------- VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent) @@ -100,7 +98,7 @@ void VFormulaPropertyEditor::onToolButtonClicked() TextLabel->setText(formula.getStringValue()); delete tmpWidget; emit dataChangedByUser(formula, this); - UserChangeEvent *event = new UserChangeEvent(); + VPE::UserChangeEvent *event = new VPE::UserChangeEvent(); QCoreApplication::postEvent ( this, event ); } } diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp index 0d1f90cfc..2703d6644 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp +++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp @@ -43,16 +43,14 @@ #include #include -using namespace VPE; - //--------------------------------------------------------------------------------------------------------------------- VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent) :QObject(parent), PropertyModel(nullptr), formView(nullptr), currentItem(nullptr), - propertyToId(QMap()), - idToProperty(QMap()) + propertyToId(QMap()), + idToProperty(QMap()) { - PropertyModel = new VPropertyModel(this); - formView = new VPropertyFormView(PropertyModel, parent); + PropertyModel = new VPE::VPropertyModel(this); + formView = new VPE::VPropertyFormView(PropertyModel, parent); formView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QScrollArea *scroll = new QScrollArea(parent); @@ -61,7 +59,8 @@ VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent) parent->setWidget(scroll); - connect(PropertyModel, &VPropertyModel::onDataChangedByEditor, this, &VToolOptionsPropertyBrowser::userChangedData); + connect(PropertyModel, &VPE::VPropertyModel::onDataChangedByEditor, this, + &VToolOptionsPropertyBrowser::userChangedData); } //--------------------------------------------------------------------------------------------------------------------- @@ -339,9 +338,9 @@ void VToolOptionsPropertyBrowser::RefreshOptions() } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::userChangedData(VProperty *property) +void VToolOptionsPropertyBrowser::userChangedData(VPE::VProperty *property) { - VProperty *prop = property; + VPE::VProperty *prop = property; if (!propertyToId.contains(prop)) { if (!propertyToId.contains(prop->getParent()))// Maybe we know parent @@ -526,7 +525,7 @@ void VToolOptionsPropertyBrowser::AddPropertyFormula(const QString &propertyName template void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly) { - auto itemName = new VStringProperty(propertyName); + auto itemName = new VPE::VStringProperty(propertyName); itemName->setClearButtonEnable(true); itemName->setValue(i->name()); itemName->setReadOnly(readOnly); @@ -537,7 +536,7 @@ void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString & template void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString &propertyName) { - VStringProperty *itemName = new VStringProperty(propertyName); + VPE::VStringProperty *itemName = new VPE::VStringProperty(propertyName); itemName->setClearButtonEnable(true); itemName->setValue(i->nameP1()); AddProperty(itemName, AttrName1); @@ -547,7 +546,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString & template void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString &propertyName) { - VStringProperty *itemName = new VStringProperty(propertyName); + VPE::VStringProperty *itemName = new VPE::VStringProperty(propertyName); itemName->setClearButtonEnable(true); itemName->setValue(i->nameP2()); AddProperty(itemName, AttrName2); @@ -557,7 +556,7 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString & template void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QString &propertyName, bool readOnly) { - auto itemSuffix = new VStringProperty(propertyName); + auto itemSuffix = new VPE::VStringProperty(propertyName); itemSuffix->setClearButtonEnable(true); itemSuffix->setValue(i->Suffix()); itemSuffix->setReadOnly(readOnly); @@ -568,7 +567,7 @@ void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QStr template void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString &propertyName) { - VEnumProperty* itemProperty = new VEnumProperty(propertyName); + VPE::VEnumProperty* itemProperty = new VPE::VEnumProperty(propertyName); itemProperty->setLiterals(QStringList()<< tr("First point") << tr("Second point")); itemProperty->setValue(static_cast(i->GetCrossCirclesPoint())-1); AddProperty(itemProperty, AttrCrossPoint); @@ -578,7 +577,7 @@ void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString & template void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString &propertyName) { - auto itemProperty = new VEnumProperty(propertyName); + auto itemProperty = new VPE::VEnumProperty(propertyName); itemProperty->setLiterals(QStringList()<< tr("Highest point") << tr("Lowest point")); itemProperty->setValue(static_cast(i->GetVCrossPoint())-1); AddProperty(itemProperty, AttrVCrossPoint); @@ -588,7 +587,7 @@ void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString template void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString &propertyName) { - auto itemProperty = new VEnumProperty(propertyName); + auto itemProperty = new VPE::VEnumProperty(propertyName); itemProperty->setLiterals(QStringList()<< tr("Leftmost point") << tr("Rightmost point")); itemProperty->setValue(static_cast(i->GetHCrossPoint())-1); AddProperty(itemProperty, AttrHCrossPoint); @@ -598,7 +597,7 @@ void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString template void VToolOptionsPropertyBrowser::AddPropertyAxisType(Tool *i, const QString &propertyName) { - auto itemProperty = new VEnumProperty(propertyName); + auto itemProperty = new VPE::VEnumProperty(propertyName); itemProperty->setLiterals(QStringList()<< tr("Vertical axis") << tr("Horizontal axis")); itemProperty->setValue(static_cast(i->GetAxisType())-1); AddProperty(itemProperty, AttrAxisType); @@ -609,9 +608,9 @@ template void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName, const QMap &styles) { - VLineTypeProperty *lineTypeProperty = new VLineTypeProperty(propertyName); + VPE::VLineTypeProperty *lineTypeProperty = new VPE::VLineTypeProperty(propertyName); lineTypeProperty->setStyles(styles); - const qint32 index = VLineTypeProperty::IndexOfStyle(styles, i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(styles, i->getLineType()); if (index == -1) { qWarning()<<"Can't find line style" << i->getLineType()<<"in list"; @@ -625,9 +624,9 @@ template void VToolOptionsPropertyBrowser::AddPropertyLineColor(Tool *i, const QString &propertyName, const QMap &colors, const QString &id) { - VLineColorProperty *lineColorProperty = new VLineColorProperty(propertyName); + VPE::VLineColorProperty *lineColorProperty = new VPE::VLineColorProperty(propertyName); lineColorProperty->setColors(colors); - const qint32 index = VLineColorProperty::IndexOfColor(colors, i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(colors, i->GetLineColor()); if (index == -1) { qWarning()<<"Can't find line style" << i->GetLineColor()<<"in list"; @@ -835,7 +834,7 @@ void VToolOptionsPropertyBrowser::SetAxisType(const QVariant &value) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::AddProperty(VProperty *property, const QString &id) +void VToolOptionsPropertyBrowser::AddProperty(VPE::VProperty *property, const QString &id) { propertyToId[property] = id; idToProperty[id] = property; @@ -843,11 +842,11 @@ void VToolOptionsPropertyBrowser::AddProperty(VProperty *property, const QString } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) @@ -865,11 +864,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolEndLine *i = qgraphicsitem_cast(currentItem); @@ -898,11 +897,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolAlongLine *i = qgraphicsitem_cast(currentItem); @@ -928,11 +927,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolArc(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolArc *i = qgraphicsitem_cast(currentItem); @@ -958,11 +957,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolArcWithLength *i = qgraphicsitem_cast(currentItem); @@ -988,11 +987,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *propert } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolBisector *i = qgraphicsitem_cast(currentItem); @@ -1018,11 +1017,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) @@ -1040,11 +1039,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolCutArc *i = qgraphicsitem_cast(currentItem); @@ -1064,11 +1063,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolCutSpline *i = qgraphicsitem_cast(currentItem); @@ -1088,11 +1087,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolCutSplinePath *i = qgraphicsitem_cast(currentItem); @@ -1112,11 +1111,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *propert } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolHeight *i = qgraphicsitem_cast(currentItem); @@ -1139,11 +1138,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolLine(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolLine *i = qgraphicsitem_cast(currentItem); @@ -1163,11 +1162,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) @@ -1182,11 +1181,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VProperty *propert } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolNormal *i = qgraphicsitem_cast(currentItem); @@ -1215,11 +1214,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolPointOfContact *i = qgraphicsitem_cast(currentItem); @@ -1239,11 +1238,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *proper } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) @@ -1258,11 +1257,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VProperty *p } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPE::VProperty *property) { SCASSERT(property != nullptr) - const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) @@ -1272,7 +1271,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPropert break; case 28: // AttrCrossPoint { - const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); SetCrossCirclesPoint(value); break; } @@ -1283,11 +1282,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPropert } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VPE::VProperty *property) { SCASSERT(property != nullptr) - const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolPointOfIntersectionCircles *i = qgraphicsitem_cast(currentItem); @@ -1299,7 +1298,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProp break; case 28: // AttrCrossPoint { - const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); SetCrossCirclesPoint(value); break; } @@ -1316,11 +1315,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProp } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPE::VProperty *property) { SCASSERT(property != nullptr) - const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) @@ -1330,13 +1329,13 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPrope break; case 34: // AttrVCrossPoint { - const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); SetVCrossCurvesPoint(value); break; } case 35: // AttrHCrossPoint { - const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); SetHCrossCurvesPoint(value); break; } @@ -1347,11 +1346,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPrope } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPE::VProperty *property) { SCASSERT(property != nullptr) - const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolPointFromCircleAndTangent *i = qgraphicsitem_cast(currentItem); @@ -1366,7 +1365,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPrope break; case 28: // AttrCrossPoint { - const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); SetCrossCirclesPoint(value); break; } @@ -1377,11 +1376,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPrope } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VPE::VProperty *property) { SCASSERT(property != nullptr) - const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) @@ -1391,7 +1390,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty break; case 28: // AttrCrossPoint { - const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); SetCrossCirclesPoint(value); break; } @@ -1402,11 +1401,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolShoulderPoint *i = qgraphicsitem_cast(currentItem); @@ -1432,11 +1431,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *propert } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; auto i = qgraphicsitem_cast(currentItem); @@ -1488,11 +1487,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VPE::VProperty *property) { SCASSERT(property != nullptr) - const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; auto i = qgraphicsitem_cast(currentItem); @@ -1513,11 +1512,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolSplinePath *i = qgraphicsitem_cast(currentItem); @@ -1537,11 +1536,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolCubicBezierPath *i = qgraphicsitem_cast(currentItem); @@ -1561,11 +1560,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VProperty *prope } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) @@ -1580,11 +1579,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolLineIntersectAxis *i = qgraphicsitem_cast(currentItem); @@ -1610,11 +1609,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *pro } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolCurveIntersectAxis *i = qgraphicsitem_cast(currentItem); @@ -1640,11 +1639,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *pr } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolRotation *i = qgraphicsitem_cast(currentItem); @@ -1664,11 +1663,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolMove(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolMove(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolMove *i = qgraphicsitem_cast(currentItem); @@ -1691,11 +1690,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolMove(VProperty *property) } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) @@ -1710,18 +1709,18 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VProperty *proper } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; switch (PropertiesList().indexOf(id)) { case 39: // AttrAxisType { - const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole); + const QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::EditRole); SetAxisType(value); break; } @@ -1735,11 +1734,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VProperty *proper } //--------------------------------------------------------------------------------------------------------------------- -void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VProperty *property) +void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VPE::VProperty *property) { SCASSERT(property != nullptr) - QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole); + QVariant value = property->data(VPE::VProperty::DPC_Data, Qt::DisplayRole); const QString id = propertyToId[property]; VToolEllipticalArc *i = qgraphicsitem_cast(currentItem); @@ -1779,7 +1778,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSinglePoint(QGraphicsItem *item AddPropertyObjectName(i, tr("Point label")); - VPointFProperty* itemPosition = new VPointFProperty(tr("Position")); + VPE::VPointFProperty* itemPosition = new VPE::VPointFProperty(tr("Position")); itemPosition->setValue(i->pos()); AddProperty(itemPosition, QLatin1String("position")); } @@ -1941,7 +1940,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item) AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); - VDoubleProperty* itemAngle = new VDoubleProperty(tr("Additional angle degrees")); + VPE::VDoubleProperty* itemAngle = new VPE::VDoubleProperty(tr("Additional angle degrees")); itemAngle->setValue(i->GetAngle()); itemAngle->setSetting("Min", -360); itemAngle->setSetting("Max", 360); @@ -2223,12 +2222,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine() idToProperty[AttrName]->setValue(i->name()); { - const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[AttrTypeLine]->setValue(index); } { - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } @@ -2248,12 +2247,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine() idToProperty[AttrName]->setValue(i->name()); { - const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[AttrTypeLine]->setValue(index); } { - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } @@ -2279,7 +2278,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArc() valueSecondAngle.setValue(i->GetFormulaF2()); idToProperty[AttrAngle2]->setValue(valueSecondAngle); - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrColor]->setValue(index); } @@ -2300,7 +2299,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArcWithLength() valueLength.setValue(i->GetFormulaLength()); idToProperty[AttrLength]->setValue(valueLength); - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrColor]->setValue(index); } @@ -2316,12 +2315,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector() idToProperty[AttrLength]->setValue(valueFormula); { - const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[AttrTypeLine]->setValue(index); } { - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } } @@ -2379,12 +2378,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight() idToProperty[AttrName]->setValue(i->name()); { - const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[AttrTypeLine]->setValue(index); } { - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } } @@ -2395,12 +2394,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLine() VToolLine *i = qgraphicsitem_cast(currentItem); { - const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[AttrTypeLine]->setValue(index); } { - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } } @@ -2427,12 +2426,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal() idToProperty[AttrAngle]->setValue( i->GetAngle()); { - const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[AttrTypeLine]->setValue(index); } { - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } } @@ -2527,12 +2526,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint() idToProperty[AttrName]->setValue(i->name()); { - const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[AttrTypeLine]->setValue(index); } { - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } } @@ -2577,7 +2576,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSpline() length2.setValue(length2F); idToProperty[AttrLength2]->setValue(length2); - idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor())); + idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), + i->GetLineColor())); } //--------------------------------------------------------------------------------------------------------------------- @@ -2586,7 +2586,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezier() auto i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); - idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor())); + idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), + i->GetLineColor())); } //--------------------------------------------------------------------------------------------------------------------- @@ -2595,7 +2596,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath() auto i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); - idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor())); + idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), + i->GetLineColor())); } //--------------------------------------------------------------------------------------------------------------------- @@ -2604,7 +2606,8 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezierPath() auto i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); - idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor())); + idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), + i->GetLineColor())); } //--------------------------------------------------------------------------------------------------------------------- @@ -2622,12 +2625,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis() idToProperty[AttrName]->setValue(i->name()); { - const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[AttrTypeLine]->setValue(index); } { - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } @@ -2643,12 +2646,12 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis() idToProperty[AttrName]->setValue(i->name()); { - const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); + const qint32 index = VPE::VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[AttrTypeLine]->setValue(index); } { - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } @@ -2723,7 +2726,7 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEllipticalArc() valueFormulaRotationAngle.setValue(i->GetFormulaRotationAngle()); idToProperty[AttrRotationAngle]->setValue(valueFormulaRotationAngle); - const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrColor]->setValue(index); } diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index 807104844..707d35271 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -33,8 +33,6 @@ #include "qmuparsererror.h" #include "../vmisc/vmath.h" -using namespace std; - /** * @file * @brief Implementation of the standard floating point QmuParser. diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index 0facdfd49..04994717c 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -36,8 +36,6 @@ #include "qmudef.h" #include "../vmisc/vmath.h" -using namespace std; - /** * @file * @brief This file contains the basic implementation of the muparser engine. @@ -396,7 +394,7 @@ void QmuParserBase::SetExpr(const QString &a_sExpr) { // Check locale compatibility std::locale loc; - if (m_pTokenReader->GetArgSep()==std::use_facet >(loc).decimal_point()) + if (m_pTokenReader->GetArgSep()==std::use_facet >(loc).decimal_point()) { Error(ecLOCALE); } diff --git a/src/libs/qmuparser/qmuparsertest.cpp b/src/libs/qmuparser/qmuparsertest.cpp index 84cdb1128..e20d56c6f 100644 --- a/src/libs/qmuparser/qmuparsertest.cpp +++ b/src/libs/qmuparser/qmuparsertest.cpp @@ -41,8 +41,6 @@ #include "qmuparsererror.h" #include "../vmisc/vmath.h" -using namespace std; - /** * @file * @brief This file contains the implementation of parser test cases. diff --git a/src/libs/vpatterndb/calculator.cpp b/src/libs/vpatterndb/calculator.cpp index c17d5351b..0ab8c11f8 100644 --- a/src/libs/vpatterndb/calculator.cpp +++ b/src/libs/vpatterndb/calculator.cpp @@ -36,8 +36,6 @@ #include "../vmisc/def.h" #include "../qmuparser/qmuparsererror.h" -using namespace qmu; - //--------------------------------------------------------------------------------------------------------------------- /** * @brief Calculator class wraper for QMuParser. Make easy initialization math parser. @@ -142,7 +140,7 @@ void Calculator::InitVariables(const QHash &vars, const QMap()), - guiTexts(QMap()), - descriptions(QMap()), + :measurements(QMap()), + guiTexts(QMap()), + descriptions(QMap()), numbers(QMap()), formulas(QMap()) { @@ -60,7 +58,7 @@ VTranslateMeasurements::~VTranslateMeasurements() bool VTranslateMeasurements::MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const { - QMap::const_iterator i = measurements.constBegin(); + QMap::const_iterator i = measurements.constBegin(); while (i != measurements.constEnd()) { if (token == i.value().translate()) @@ -166,8 +164,9 @@ void VTranslateMeasurements::InitMeasurements() } //--------------------------------------------------------------------------------------------------------------------- -void VTranslateMeasurements::InitMeasurement(const QString &name, const QmuTranslation &m, const QmuTranslation &g, - const QmuTranslation &d, const QString &number, const QString &formula) +void VTranslateMeasurements::InitMeasurement(const QString &name, const qmu::QmuTranslation &m, + const qmu::QmuTranslation &g, const qmu::QmuTranslation &d, + const QString &number, const QString &formula) { measurements.insert(name, m); guiTexts.insert(name, g); @@ -176,16 +175,16 @@ void VTranslateMeasurements::InitMeasurement(const QString &name, const QmuTrans formulas.insert(name, formula); } -#define translate(context, source, disambiguation) QmuTranslation::translate((context), (source), (disambiguation)) +#define translate(context, source, disambiguation) qmu::QmuTranslation::translate((context), (source), (disambiguation)) //--------------------------------------------------------------------------------------------------------------------- void VTranslateMeasurements::InitGroupA() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "height", @@ -357,9 +356,9 @@ void VTranslateMeasurements::InitGroupB() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "width_shoulder", @@ -404,9 +403,9 @@ void VTranslateMeasurements::InitGroupC() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "indent_neck_back", @@ -437,9 +436,9 @@ void VTranslateMeasurements::InitGroupD() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "hand_palm_length", @@ -482,9 +481,9 @@ void VTranslateMeasurements::InitGroupE() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "foot_width", @@ -521,9 +520,9 @@ void VTranslateMeasurements::InitGroupF() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "head_circ", @@ -576,9 +575,9 @@ void VTranslateMeasurements::InitGroupG() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "neck_mid_circ", @@ -928,9 +927,9 @@ void VTranslateMeasurements::InitGroupH() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "neck_front_to_waist_f", @@ -1233,9 +1232,9 @@ void VTranslateMeasurements::InitGroupI() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "shoulder_length", @@ -1344,9 +1343,9 @@ void VTranslateMeasurements::InitGroupJ() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "bustpoint_to_bustpoint", @@ -1425,9 +1424,9 @@ void VTranslateMeasurements::InitGroupK() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "shoulder_tip_to_waist_front", @@ -1529,9 +1528,9 @@ void VTranslateMeasurements::InitGroupL() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "arm_shoulder_tip_to_wrist_bent", @@ -1697,9 +1696,9 @@ void VTranslateMeasurements::InitGroupM() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "leg_crotch_to_floor", @@ -1808,9 +1807,9 @@ void VTranslateMeasurements::InitGroupN() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "crotch_length", @@ -1880,9 +1879,9 @@ void VTranslateMeasurements::InitGroupO() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "neck_back_to_waist_front", @@ -1996,9 +1995,9 @@ void VTranslateMeasurements::InitGroupP() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "neck_back_to_bust_front", @@ -2098,9 +2097,9 @@ void VTranslateMeasurements::InitGroupQ() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation m; - QmuTranslation g; - QmuTranslation d; + qmu::QmuTranslation m; + qmu::QmuTranslation g; + qmu::QmuTranslation d; //================================================================================================================= m = translate("VTranslateMeasurements", "dart_width_shoulder", diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp index 51dca3fe9..17b71bafe 100644 --- a/src/libs/vpatterndb/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -44,19 +44,17 @@ #include "../vmisc/vabstractapplication.h" #include "vtranslatemeasurements.h" -using namespace qmu; - //--------------------------------------------------------------------------------------------------------------------- VTranslateVars::VTranslateVars() :VTranslateMeasurements(), - PMSystemNames(QMap()), - PMSystemAuthors(QMap()), - PMSystemBooks(QMap()), - variables(QMap()), - functions(QMap()), - postfixOperators(QMap()), - placeholders(QMap()), - stDescriptions(QMap()) + PMSystemNames(QMap()), + PMSystemAuthors(QMap()), + PMSystemBooks(QMap()), + variables(QMap()), + functions(QMap()), + postfixOperators(QMap()), + placeholders(QMap()), + stDescriptions(QMap()) { InitPatternMakingSystems(); InitVariables(); @@ -69,16 +67,16 @@ VTranslateVars::VTranslateVars() VTranslateVars::~VTranslateVars() {} -#define translate(context, source, disambiguation) QmuTranslation::translate((context), (source), (disambiguation)) +#define translate(context, source, disambiguation) qmu::QmuTranslation::translate((context), (source), (disambiguation)) //--------------------------------------------------------------------------------------------------------------------- void VTranslateVars::InitPatternMakingSystems() { //Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't //mark such string to translation. - QmuTranslation name; - QmuTranslation author; - QmuTranslation book; + qmu::QmuTranslation name; + qmu::QmuTranslation author; + qmu::QmuTranslation book; //================================================================================================================= name = translate("VTranslateVars", "Bunka", "System name"); @@ -448,8 +446,8 @@ void VTranslateVars::InitPlaceholder() #undef translate //--------------------------------------------------------------------------------------------------------------------- -void VTranslateVars::InitSystem(const QString &code, const QmuTranslation &name, const QmuTranslation &author, - const QmuTranslation &book) +void VTranslateVars::InitSystem(const QString &code, const qmu::QmuTranslation &name, const qmu::QmuTranslation &author, + const qmu::QmuTranslation &book) { PMSystemNames.insert(code, name); PMSystemAuthors.insert(code, author); @@ -519,10 +517,10 @@ void VTranslateVars::BiasTokens(int position, int bias, QMap &toke */ bool VTranslateVars::VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const { - QMap::const_iterator i = variables.constBegin(); + QMap::const_iterator i = variables.constBegin(); while (i != variables.constEnd()) { - const QmuTranslation &var = i.value(); + const qmu::QmuTranslation &var = i.value(); if (token.indexOf( var.translate() ) == 0) { newFormula.replace(position, var.translate().length(), i.key()); @@ -547,7 +545,7 @@ bool VTranslateVars::VariablesFromUser(QString &newFormula, int position, const */ bool VTranslateVars::PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const { - QMap::const_iterator i = postfixOperators.constBegin(); + QMap::const_iterator i = postfixOperators.constBegin(); while (i != postfixOperators.constEnd()) { if (token == i.value().translate()) @@ -572,7 +570,7 @@ bool VTranslateVars::PostfixOperatorsFromUser(QString &newFormula, int position, */ bool VTranslateVars::FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const { - QMap::const_iterator i = functions.constBegin(); + QMap::const_iterator i = functions.constBegin(); while (i != functions.constEnd()) { if (token == i.value().translate()) @@ -597,7 +595,7 @@ bool VTranslateVars::FunctionsFromUser(QString &newFormula, int position, const */ bool VTranslateVars::VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const { - QMap::const_iterator i = variables.constBegin(); + QMap::const_iterator i = variables.constBegin(); while (i != variables.constEnd()) { if (token.indexOf( i.key() ) == 0) @@ -729,7 +727,7 @@ QString VTranslateVars::FormulaFromUser(const QString &formula, bool osSeparator } QString newFormula = formula;// Local copy for making changes - QmuTokenParser *cal = new QmuTokenParser(formula, osSeparator);// Eval formula + qmu::QmuTokenParser *cal = new qmu::QmuTokenParser(formula, osSeparator);// Eval formula QMap tokens = cal->GetTokens();// Tokens (variables, measurements) QMap numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator delete cal; @@ -850,7 +848,7 @@ QString VTranslateVars::FormulaToUser(const QString &formula, bool osSeparator) QMap numbers; try { - QmuTokenParser *cal = new QmuTokenParser(formula, false);// Eval formula + qmu::QmuTokenParser *cal = new qmu::QmuTokenParser(formula, false);// Eval formula tokens = cal->GetTokens();// Tokens (variables, measurements) numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator delete cal; @@ -979,7 +977,7 @@ void VTranslateVars::Retranslate() } //--------------------------------------------------------------------------------------------------------------------- -QMap VTranslateVars::GetFunctions() const +QMap VTranslateVars::GetFunctions() const { return functions; } diff --git a/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.cpp b/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.cpp index fd24a78c3..ed4316d5b 100644 --- a/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.cpp @@ -20,8 +20,6 @@ #include "vvector3dproperty.h" -using namespace VPE; - #include #include #include @@ -30,7 +28,7 @@ using namespace VPE; #include "../../vproperty_p.h" #include "../vnumberproperty.h" -QVector3DProperty::QVector3DProperty(const QString& name) +VPE::QVector3DProperty::QVector3DProperty(const QString& name) : VProperty(name, QVariant::String) // todo: QVariant::Vector3D?? { QVariant tmpFloat(0); tmpFloat.convert(QVariant::Double); @@ -42,7 +40,7 @@ QVector3DProperty::QVector3DProperty(const QString& name) //! Get the data how it should be displayed -QVariant QVector3DProperty::data (int column, int role) const +QVariant VPE::QVector3DProperty::data (int column, int role) const { if (column == DPC_Data && Qt::DisplayRole == role) { @@ -56,7 +54,7 @@ QVariant QVector3DProperty::data (int column, int role) const } //! Returns item flags -Qt::ItemFlags QVector3DProperty::flags(int column) const +Qt::ItemFlags VPE::QVector3DProperty::flags(int column) const { if (column == DPC_Name || column == DPC_Data) { @@ -68,7 +66,7 @@ Qt::ItemFlags QVector3DProperty::flags(int column) const //! Returns the Vector3d -Vector3D QVector3DProperty::getVector() const +VPE::Vector3D VPE::QVector3DProperty::getVector() const { Vector3D tmpVect; @@ -85,12 +83,12 @@ Vector3D QVector3DProperty::getVector() const } //! Sets the Vector3d -void QVector3DProperty::setVector(const Vector3D &vect) +void VPE::QVector3DProperty::setVector(const Vector3D &vect) { setVector(vect.X, vect.Y, vect.Z); } -void QVector3DProperty::setVector(double x, double y, double z) +void VPE::QVector3DProperty::setVector(double x, double y, double z) { if (d_ptr->Children.count() < 3) { @@ -105,12 +103,12 @@ void QVector3DProperty::setVector(double x, double y, double z) d_ptr->Children.at(2)->setValue(tmpZ); } -QString QVector3DProperty::type() const +QString VPE::QVector3DProperty::type() const { return "vector3d"; } -VProperty* QVector3DProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::QVector3DProperty::clone(bool include_children, VProperty* container) const { if (!container) { @@ -130,7 +128,7 @@ VProperty* QVector3DProperty::clone(bool include_children, VProperty* container) return VProperty::clone(false, container); // Child } -void QVector3DProperty::setValue(const QVariant &value) +void VPE::QVector3DProperty::setValue(const QVariant &value) { QStringList tmpStrings = value.toString().split(","); if (tmpStrings.count() == 3) @@ -140,7 +138,7 @@ void QVector3DProperty::setValue(const QVariant &value) } -QVariant QVector3DProperty::getValue() const +QVariant VPE::QVector3DProperty::getValue() const { Vector3D tmpVect = getVector(); return QString("%1,%2,%3").arg(QString::number(tmpVect.X), QString::number(tmpVect.Y), QString::number(tmpVect.Z)); diff --git a/src/libs/vpropertyexplorer/plugins/vboolproperty.cpp b/src/libs/vpropertyexplorer/plugins/vboolproperty.cpp index 6d14192c7..2e776c036 100644 --- a/src/libs/vpropertyexplorer/plugins/vboolproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vboolproperty.cpp @@ -25,12 +25,11 @@ #include "../vproperty_p.h" -using namespace VPE; -QVariant VBoolProperty::TrueText; -QVariant VBoolProperty::FalseText; +QVariant VPE::VBoolProperty::TrueText; +QVariant VPE::VBoolProperty::FalseText; -VBoolProperty::VBoolProperty(const QString& name) : +VPE::VBoolProperty::VBoolProperty(const QString& name) : VProperty(name, QVariant::Bool) { d_ptr->VariantValue.setValue(false); @@ -49,7 +48,7 @@ VBoolProperty::VBoolProperty(const QString& name) : //! Get the data how it should be displayed -QVariant VBoolProperty::data (int column, int role) const +QVariant VPE::VBoolProperty::data (int column, int role) const { if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role)) { @@ -63,7 +62,7 @@ QVariant VBoolProperty::data (int column, int role) const return VProperty::data(column, role); } -bool VBoolProperty::setData(const QVariant &data, int role) +bool VPE::VBoolProperty::setData(const QVariant &data, int role) { if (Qt::CheckStateRole == role) { @@ -75,7 +74,7 @@ bool VBoolProperty::setData(const QVariant &data, int role) } //! Returns item flags -Qt::ItemFlags VBoolProperty::flags(int column) const +Qt::ItemFlags VPE::VBoolProperty::flags(int column) const { if (column == DPC_Data) { @@ -85,12 +84,12 @@ Qt::ItemFlags VBoolProperty::flags(int column) const return VProperty::flags(column); } -QString VBoolProperty::type() const +QString VPE::VBoolProperty::type() const { return "bool"; } -VProperty *VBoolProperty::clone(bool include_children, VProperty *container) const +VPE::VProperty *VPE::VBoolProperty::clone(bool include_children, VProperty *container) const { return VProperty::clone(include_children, container ? container : new VBoolProperty(getName())); } diff --git a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp index 948a2879d..b68175186 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp @@ -31,16 +31,14 @@ class QAbstractItemDelegate; class QStyleOptionViewItem; -using namespace VPE; - -VColorProperty::VColorProperty(const QString &name) : +VPE::VColorProperty::VColorProperty(const QString &name) : VProperty(name, QVariant::Color) { } //! Get the data how it should be displayed -QVariant VColorProperty::data (int column, int role) const +QVariant VPE::VColorProperty::data (int column, int role) const { if (column == DPC_Data && (Qt::DisplayRole == role)) { @@ -59,8 +57,8 @@ QVariant VColorProperty::data (int column, int role) const } //! Returns an editor widget, or NULL if it doesn't supply one -QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewItem& options, - const QAbstractItemDelegate* delegate) +QWidget* VPE::VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate) { Q_UNUSED(options) Q_UNUSED(delegate) @@ -72,7 +70,7 @@ QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewIte } //! Sets the property's data to the editor (returns false, if the standard delegate should do that) -bool VColorProperty::setEditorData(QWidget* editor) +bool VPE::VColorProperty::setEditorData(QWidget* editor) { VColorPropertyEditor* tmpWidget = qobject_cast(editor); if (tmpWidget) @@ -86,7 +84,7 @@ bool VColorProperty::setEditorData(QWidget* editor) } //! Gets the data from the widget -QVariant VColorProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VColorProperty::getEditorData(const QWidget *editor) const { const VColorPropertyEditor* tmpWidget = qobject_cast(editor); if (tmpWidget) @@ -97,12 +95,12 @@ QVariant VColorProperty::getEditorData(const QWidget *editor) const return QVariant(); } -QString VColorProperty::type() const +QString VPE::VColorProperty::type() const { return "color"; } -VProperty *VColorProperty::clone(bool include_children, VProperty *container) const +VPE::VProperty *VPE::VColorProperty::clone(bool include_children, VProperty *container) const { return VProperty::clone(include_children, container ? container : new VColorProperty(getName())); } diff --git a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp index cc68925f0..5ee58279f 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp @@ -35,9 +35,7 @@ class QHBoxLayout; -using namespace VPE; - -VColorPropertyEditor::VColorPropertyEditor(QWidget *parent) +VPE::VColorPropertyEditor::VColorPropertyEditor(QWidget *parent) : QWidget(parent), Color(), ToolButton(nullptr), TextLabel(nullptr), ColorLabel(nullptr), Spacer(nullptr) { setAutoFillBackground(true); @@ -75,7 +73,7 @@ VColorPropertyEditor::VColorPropertyEditor(QWidget *parent) //ColorLabel->hide(); // for now, we just use the standard display and only add the button } -void VColorPropertyEditor::SetColor(const QColor& color_) +void VPE::VColorPropertyEditor::SetColor(const QColor& color_) { if (Color != color_) { @@ -85,7 +83,7 @@ void VColorPropertyEditor::SetColor(const QColor& color_) } } -QPixmap VColorPropertyEditor::GetColorPixmap(const QColor& color, quint32 size) +QPixmap VPE::VColorPropertyEditor::GetColorPixmap(const QColor& color, quint32 size) { QImage tmpImgage(static_cast(size), static_cast(size), QImage::Format_ARGB32_Premultiplied); tmpImgage.fill(static_cast(color.rgb())); @@ -93,12 +91,12 @@ QPixmap VColorPropertyEditor::GetColorPixmap(const QColor& color, quint32 size) // todo: support alpha channel } -QString VColorPropertyEditor::GetColorString(const QColor& color) +QString VPE::VColorPropertyEditor::GetColorString(const QColor& color) { return QString("[%1, %2, %3] (%4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(color.alpha()); } -void VColorPropertyEditor::onToolButtonClicked() +void VPE::VColorPropertyEditor::onToolButtonClicked() { bool ok = false; QRgb oldRgba = Color.rgba(); @@ -112,7 +110,7 @@ void VColorPropertyEditor::onToolButtonClicked() } } -bool VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev) +bool VPE::VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev) { if (obj == ToolButton && ev->type() == QEvent::KeyPress) { @@ -125,12 +123,12 @@ bool VColorPropertyEditor::eventFilter(QObject *obj, QEvent *ev) } -VColorPropertyEditor::~VColorPropertyEditor() +VPE::VColorPropertyEditor::~VColorPropertyEditor() { // } -QColor VColorPropertyEditor::GetColor() const +QColor VPE::VColorPropertyEditor::GetColor() const { return Color; } diff --git a/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp b/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp index b1e71c06a..924c191da 100644 --- a/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vemptyproperty.cpp @@ -35,27 +35,25 @@ namespace VPE { class VPropertyPrivate; } // namespace VPE -using namespace VPE; - -VEmptyProperty::VEmptyProperty(const QString& name) +VPE::VEmptyProperty::VEmptyProperty(const QString& name) : VProperty(name, QVariant::Invalid) { } -VEmptyProperty::VEmptyProperty(VPropertyPrivate *d) +VPE::VEmptyProperty::VEmptyProperty(VPropertyPrivate *d) : VProperty(d) { } -VEmptyProperty::~VEmptyProperty() +VPE::VEmptyProperty::~VEmptyProperty() { // } //! Get the data how it should be displayed -QVariant VEmptyProperty::data (int column, int role) const +QVariant VPE::VEmptyProperty::data (int column, int role) const { if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role)) { @@ -74,8 +72,8 @@ QVariant VEmptyProperty::data (int column, int role) const } //! Returns an editor widget, or NULL if it doesn't supply one -QWidget* VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, - const QAbstractItemDelegate* delegate) +QWidget* VPE::VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate) { Q_UNUSED(options) Q_UNUSED(parent) @@ -86,7 +84,7 @@ QWidget* VEmptyProperty::createEditor(QWidget * parent, const QStyleOptionViewIt //! Gets the data from the widget -QVariant VEmptyProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VEmptyProperty::getEditorData(const QWidget *editor) const { Q_UNUSED(editor) @@ -94,19 +92,19 @@ QVariant VEmptyProperty::getEditorData(const QWidget *editor) const } //! Returns item flags -Qt::ItemFlags VEmptyProperty::flags(int column) const +Qt::ItemFlags VPE::VEmptyProperty::flags(int column) const { Q_UNUSED(column) return Qt::ItemIsEnabled | Qt::ItemIsSelectable; } -QString VEmptyProperty::type() const +QString VPE::VEmptyProperty::type() const { return "empty"; } -VProperty* VEmptyProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::VEmptyProperty::clone(bool include_children, VProperty* container) const { return VProperty::clone(include_children, container ? container : new VEmptyProperty(getName())); } diff --git a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp index 4851d2086..02d2b37c4 100644 --- a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp @@ -30,9 +30,7 @@ class QAbstractItemDelegate; class QStyleOptionViewItem; -using namespace VPE; - -VEnumProperty::VEnumProperty(const QString& name) +VPE::VEnumProperty::VEnumProperty(const QString& name) : VProperty(name, QVariant::Int), EnumerationLiterals() { VProperty::d_ptr->VariantValue = 0; @@ -41,7 +39,7 @@ VEnumProperty::VEnumProperty(const QString& name) //! Get the data how it should be displayed -QVariant VEnumProperty::data (int column, int role) const +QVariant VPE::VEnumProperty::data (int column, int role) const { if (EnumerationLiterals.empty()) { @@ -69,8 +67,8 @@ QVariant VEnumProperty::data (int column, int role) const //! Returns an editor widget, or NULL if it doesn't supply one -QWidget* VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, - const QAbstractItemDelegate* delegate) +QWidget* VPE::VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate) { Q_UNUSED(options) Q_UNUSED(delegate) @@ -87,7 +85,7 @@ QWidget* VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewIte } //! Gets the data from the widget -QVariant VEnumProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VEnumProperty::getEditorData(const QWidget *editor) const { const QComboBox* tmpEditor = qobject_cast(editor); if (tmpEditor) @@ -99,19 +97,19 @@ QVariant VEnumProperty::getEditorData(const QWidget *editor) const } //! Sets the enumeration literals -void VEnumProperty::setLiterals(const QStringList& literals) +void VPE::VEnumProperty::setLiterals(const QStringList& literals) { EnumerationLiterals = literals; } //! Get the settings. This function has to be implemented in a subclass in order to have an effect -QStringList VEnumProperty::getLiterals() const +QStringList VPE::VEnumProperty::getLiterals() const { return EnumerationLiterals; } //! Sets the value of the property -void VEnumProperty::setValue(const QVariant& value) +void VPE::VEnumProperty::setValue(const QVariant& value) { int tmpIndex = value.toInt(); @@ -129,17 +127,17 @@ void VEnumProperty::setValue(const QVariant& value) } } -QString VEnumProperty::type() const +QString VPE::VEnumProperty::type() const { return "enum"; } -VProperty* VEnumProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::VEnumProperty::clone(bool include_children, VProperty* container) const { return VProperty::clone(include_children, container ? container : new VEnumProperty(getName())); } -void VEnumProperty::setSetting(const QString& key, const QVariant& value) +void VPE::VEnumProperty::setSetting(const QString& key, const QVariant& value) { if (key == "literals") { @@ -147,7 +145,7 @@ void VEnumProperty::setSetting(const QString& key, const QVariant& value) } } -QVariant VEnumProperty::getSetting(const QString& key) const +QVariant VPE::VEnumProperty::getSetting(const QString& key) const { if (key == "literals") { @@ -157,12 +155,12 @@ QVariant VEnumProperty::getSetting(const QString& key) const return VProperty::getSetting(key); } -QStringList VEnumProperty::getSettingKeys() const +QStringList VPE::VEnumProperty::getSettingKeys() const { return QStringList("literals"); } -void VEnumProperty::currentIndexChanged(int index) +void VPE::VEnumProperty::currentIndexChanged(int index) { Q_UNUSED(index) UserChangeEvent *event = new UserChangeEvent(); diff --git a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp index 7fb301912..9406b3e7b 100644 --- a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp @@ -31,45 +31,43 @@ class QStyleOptionViewItem; -using namespace VPE; - -VFileProperty::VFileProperty(const QString& name) +VPE::VFileProperty::VFileProperty(const QString& name) : VProperty(new VFilePropertyPrivate(name, QVariant::String)) { } -VFileProperty::~VFileProperty() +VPE::VFileProperty::~VFileProperty() { // } -void VFileProperty::setFileFilters(const QString& filefilters) +void VPE::VFileProperty::setFileFilters(const QString& filefilters) { static_cast(d_ptr)->FileFilters = filefilters; } -QString VFileProperty::getFileFilters() const +QString VPE::VFileProperty::getFileFilters() const { return static_cast(d_ptr)->FileFilters; } -void VFileProperty::setFile(const QString& file) +void VPE::VFileProperty::setFile(const QString& file) { d_ptr->VariantValue.setValue(file); } -QString VFileProperty::getFile() const +QString VPE::VFileProperty::getFile() const { return d_ptr->VariantValue.toString(); } -QVariant VFileProperty::data (int column, int role) const +QVariant VPE::VFileProperty::data (int column, int role) const { if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role)) { @@ -81,7 +79,7 @@ QVariant VFileProperty::data (int column, int role) const } -QWidget* VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, +QWidget* VPE::VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { Q_UNUSED(options) @@ -100,7 +98,7 @@ QWidget* VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewIte } -bool VFileProperty::setEditorData(QWidget* editor) +bool VPE::VFileProperty::setEditorData(QWidget* editor) { VFileEditWidget* tmpWidget = qobject_cast(editor); if (tmpWidget) @@ -114,7 +112,7 @@ bool VFileProperty::setEditorData(QWidget* editor) } -QVariant VFileProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VFileProperty::getEditorData(const QWidget *editor) const { const VFileEditWidget* tmpWidget = qobject_cast(editor); if (tmpWidget) @@ -125,7 +123,7 @@ QVariant VFileProperty::getEditorData(const QWidget *editor) const return QVariant(); } -void VFileProperty::setSetting(const QString& key, const QVariant& value) +void VPE::VFileProperty::setSetting(const QString& key, const QVariant& value) { if (key == "FileFilters") { @@ -137,7 +135,7 @@ void VFileProperty::setSetting(const QString& key, const QVariant& value) } } -QVariant VFileProperty::getSetting(const QString& key) const +QVariant VPE::VFileProperty::getSetting(const QString& key) const { if (key == "FileFilters") { @@ -151,28 +149,28 @@ QVariant VFileProperty::getSetting(const QString& key) const return VProperty::getSetting(key); } -QStringList VFileProperty::getSettingKeys() const +QStringList VPE::VFileProperty::getSettingKeys() const { return QStringList("FileFilters") << "Directory"; } -QString VFileProperty::type() const +QString VPE::VFileProperty::type() const { return "file"; } -VProperty* VFileProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::VFileProperty::clone(bool include_children, VProperty* container) const { return VProperty::clone(include_children, container ? container : new VFileProperty(getName())); } -bool VFileProperty::isDirectory() const +bool VPE::VFileProperty::isDirectory() const { return static_cast(d_ptr)->Directory; } -void VFileProperty::setDirectory(bool is_directory) +void VPE::VFileProperty::setDirectory(bool is_directory) { static_cast(d_ptr)->Directory = is_directory; } diff --git a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp index 942c976b8..1a8a6f94d 100644 --- a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp @@ -45,9 +45,7 @@ class QDragMoveEvent; class QDropEvent; class QHBoxLayout; -using namespace VPE; - -VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory) +VPE::VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory) : QWidget(parent), CurrentFilePath(), ToolButton(nullptr), FileLineEdit(nullptr), FileDialogFilter(), FilterList(), Directory(is_directory) { @@ -79,13 +77,13 @@ VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory) } -VFileEditWidget::~VFileEditWidget() +VPE::VFileEditWidget::~VFileEditWidget() { // nothing needs to be done here } -void VFileEditWidget::setFile(const QString &value, bool emit_signal) +void VPE::VFileEditWidget::setFile(const QString &value, bool emit_signal) { if (CurrentFilePath != value) { @@ -101,24 +99,24 @@ void VFileEditWidget::setFile(const QString &value, bool emit_signal) } -void VFileEditWidget::setFilter(const QString &dialog_filter, const QStringList& filter_list) +void VPE::VFileEditWidget::setFilter(const QString &dialog_filter, const QStringList& filter_list) { FileDialogFilter = dialog_filter; FilterList = filter_list; } -void VFileEditWidget::setDirectory(bool dir) +void VPE::VFileEditWidget::setDirectory(bool dir) { Directory = dir; } -QString VFileEditWidget::getFile() const +QString VPE::VFileEditWidget::getFile() const { return CurrentFilePath; } -void VFileEditWidget::onToolButtonClicked() +void VPE::VFileEditWidget::onToolButtonClicked() { QString filepath = (Directory ? QFileDialog::getExistingDirectory(0, tr("Directory"), CurrentFilePath) : QFileDialog::getOpenFileName(0, tr("Open File"), CurrentFilePath, @@ -130,7 +128,7 @@ void VFileEditWidget::onToolButtonClicked() } -bool VFileEditWidget::eventFilter(QObject *obj, QEvent *ev) +bool VPE::VFileEditWidget::eventFilter(QObject *obj, QEvent *ev) { if (ev->type() == QEvent::DragEnter || ev->type() == QEvent::Drop) { @@ -170,13 +168,13 @@ bool VFileEditWidget::eventFilter(QObject *obj, QEvent *ev) return QWidget::eventFilter(obj, ev); } -bool VFileEditWidget::isDirectory() +bool VPE::VFileEditWidget::isDirectory() { return Directory; } -void VFileEditWidget::dragEnterEvent(QDragEnterEvent* event) +void VPE::VFileEditWidget::dragEnterEvent(QDragEnterEvent* event) { QString tmpFileName; if (checkMimeData(event->mimeData(), tmpFileName)) @@ -187,18 +185,18 @@ void VFileEditWidget::dragEnterEvent(QDragEnterEvent* event) } // cppcheck-suppress unusedFunction -void VFileEditWidget::dragMoveEvent(QDragMoveEvent* event) +void VPE::VFileEditWidget::dragMoveEvent(QDragMoveEvent* event) { event->acceptProposedAction(); } // cppcheck-suppress unusedFunction -void VFileEditWidget::dragLeaveEvent(QDragLeaveEvent* event) +void VPE::VFileEditWidget::dragLeaveEvent(QDragLeaveEvent* event) { event->accept(); } -void VFileEditWidget::dropEvent(QDropEvent* event) +void VPE::VFileEditWidget::dropEvent(QDropEvent* event) { QString tmpFileName; if (checkMimeData(event->mimeData(), tmpFileName)) @@ -212,7 +210,7 @@ void VFileEditWidget::dropEvent(QDropEvent* event) } -bool VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) const +bool VPE::VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) const { if (data->hasUrls()) { @@ -235,7 +233,7 @@ bool VFileEditWidget::checkMimeData(const QMimeData* data, QString& file) const return false; } -bool VFileEditWidget::checkFileFilter(const QString& file) const +bool VPE::VFileEditWidget::checkFileFilter(const QString& file) const { if (FilterList.isEmpty()) { diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp index 968b0f792..970a8e590 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp @@ -45,16 +45,14 @@ class QAbstractItemDelegate; class QStyleOptionViewItem; -using namespace VPE; - -VLineColorProperty::VLineColorProperty(const QString &name) +VPE::VLineColorProperty::VLineColorProperty(const QString &name) : VProperty(name, QVariant::Int), colors(), indexList() { VProperty::d_ptr->VariantValue = 0; VProperty::d_ptr->VariantValue.convert(QVariant::Int); } -QVariant VLineColorProperty::data(int column, int role) const +QVariant VPE::VLineColorProperty::data(int column, int role) const { if (colors.empty()) { @@ -82,8 +80,8 @@ QVariant VLineColorProperty::data(int column, int role) const } } -QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, - const QAbstractItemDelegate *delegate) +QWidget *VPE::VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, + const QAbstractItemDelegate *delegate) { Q_UNUSED(options) Q_UNUSED(delegate) @@ -113,7 +111,7 @@ QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionVie return VProperty::d_ptr->editor; } -QVariant VLineColorProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VLineColorProperty::getEditorData(const QWidget *editor) const { const QComboBox* tmpEditor = qobject_cast(editor); if (tmpEditor) @@ -124,7 +122,7 @@ QVariant VLineColorProperty::getEditorData(const QWidget *editor) const return QVariant(0); } -void VLineColorProperty::setColors(const QMap &colors) +void VPE::VLineColorProperty::setColors(const QMap &colors) { this->colors = colors; indexList.clear(); @@ -137,12 +135,12 @@ void VLineColorProperty::setColors(const QMap &colors) } // cppcheck-suppress unusedFunction -QMap VLineColorProperty::getColors() const +QMap VPE::VLineColorProperty::getColors() const { return colors; } -void VLineColorProperty::setValue(const QVariant &value) +void VPE::VLineColorProperty::setValue(const QVariant &value) { int tmpIndex = value.toInt(); @@ -160,17 +158,17 @@ void VLineColorProperty::setValue(const QVariant &value) } } -QString VLineColorProperty::type() const +QString VPE::VLineColorProperty::type() const { return QStringLiteral("lineColor"); } -VProperty *VLineColorProperty::clone(bool include_children, VProperty *container) const +VPE::VProperty *VPE::VLineColorProperty::clone(bool include_children, VProperty *container) const { return VProperty::clone(include_children, container ? container : new VLineColorProperty(getName())); } -int VLineColorProperty::IndexOfColor(const QMap &colors, const QString &color) +int VPE::VLineColorProperty::IndexOfColor(const QMap &colors, const QString &color) { QVector indexList; QMap::const_iterator i = colors.constBegin(); @@ -182,7 +180,7 @@ int VLineColorProperty::IndexOfColor(const QMap &colors, const return indexList.indexOf(color); } -void VLineColorProperty::currentIndexChanged(int index) +void VPE::VLineColorProperty::currentIndexChanged(int index) { Q_UNUSED(index) UserChangeEvent *event = new UserChangeEvent(); diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp index 2aa93e811..277281ee6 100644 --- a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp @@ -42,16 +42,14 @@ class QAbstractItemDelegate; class QStyleOptionViewItem; -using namespace VPE; - -VLineTypeProperty::VLineTypeProperty(const QString &name) +VPE::VLineTypeProperty::VLineTypeProperty(const QString &name) : VProperty(name, QVariant::Int), styles(), indexList() { VProperty::d_ptr->VariantValue = 0; VProperty::d_ptr->VariantValue.convert(QVariant::Int); } -QVariant VLineTypeProperty::data(int column, int role) const +QVariant VPE::VLineTypeProperty::data(int column, int role) const { if (styles.empty()) { @@ -79,7 +77,7 @@ QVariant VLineTypeProperty::data(int column, int role) const } } -QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, +QWidget *VPE::VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate) { Q_UNUSED(options) @@ -106,7 +104,7 @@ QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionView return VProperty::d_ptr->editor; } -QVariant VLineTypeProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VLineTypeProperty::getEditorData(const QWidget *editor) const { const QComboBox* tmpEditor = qobject_cast(editor); if (tmpEditor) @@ -117,7 +115,7 @@ QVariant VLineTypeProperty::getEditorData(const QWidget *editor) const return QVariant(0); } -void VLineTypeProperty::setStyles(const QMap &styles) +void VPE::VLineTypeProperty::setStyles(const QMap &styles) { this->styles = styles; indexList.clear(); @@ -130,12 +128,12 @@ void VLineTypeProperty::setStyles(const QMap &styles) } // cppcheck-suppress unusedFunction -QMap VLineTypeProperty::getStyles() const +QMap VPE::VLineTypeProperty::getStyles() const { return styles; } -void VLineTypeProperty::setValue(const QVariant &value) +void VPE::VLineTypeProperty::setValue(const QVariant &value) { int tmpIndex = value.toInt(); @@ -153,17 +151,17 @@ void VLineTypeProperty::setValue(const QVariant &value) } } -QString VLineTypeProperty::type() const +QString VPE::VLineTypeProperty::type() const { return QStringLiteral("lineType"); } -VProperty *VLineTypeProperty::clone(bool include_children, VProperty *container) const +VPE::VProperty *VPE::VLineTypeProperty::clone(bool include_children, VProperty *container) const { return VProperty::clone(include_children, container ? container : new VLineTypeProperty(getName())); } -int VLineTypeProperty::IndexOfStyle(const QMap &styles, const QString &style) +int VPE::VLineTypeProperty::IndexOfStyle(const QMap &styles, const QString &style) { QVector indexList; QMap::const_iterator i = styles.constBegin(); @@ -175,7 +173,7 @@ int VLineTypeProperty::IndexOfStyle(const QMap &styles, const QS return indexList.indexOf(style); } -void VLineTypeProperty::currentIndexChanged(int index) +void VPE::VLineTypeProperty::currentIndexChanged(int index) { Q_UNUSED(index) UserChangeEvent *event = new UserChangeEvent(); diff --git a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp index be1102820..cfeef02ce 100644 --- a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp @@ -33,13 +33,10 @@ class QAbstractItemDelegate; class QStyleOptionViewItem; -using namespace VPE; +const int VPE::VIntegerProperty::StandardMin = -1000000; +const int VPE::VIntegerProperty::StandardMax = 1000000; - -const int VIntegerProperty::StandardMin = -1000000; -const int VIntegerProperty::StandardMax = 1000000; - -VIntegerProperty::VIntegerProperty(const QString& name, const QMap& settings) +VPE::VIntegerProperty::VIntegerProperty(const QString& name, const QMap& settings) : VProperty(name, QVariant::Int), minValue(StandardMin), maxValue(StandardMax), singleStep(1.0) { VProperty::setSettings(settings); @@ -47,7 +44,7 @@ VIntegerProperty::VIntegerProperty(const QString& name, const QMapVariantValue.convert(QVariant::Int); } -VIntegerProperty::VIntegerProperty(const QString &name) +VPE::VIntegerProperty::VIntegerProperty(const QString &name) : VProperty(name), minValue(StandardMin), maxValue(StandardMax), singleStep(1.0) { VProperty::d_ptr->VariantValue.setValue(0); @@ -55,8 +52,8 @@ VIntegerProperty::VIntegerProperty(const QString &name) } //! Returns an editor widget, or NULL if it doesn't supply one -QWidget* VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, - const QAbstractItemDelegate* delegate) +QWidget* VPE::VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate) { Q_UNUSED(options) Q_UNUSED(delegate) @@ -76,7 +73,7 @@ QWidget* VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionView } //! Gets the data from the widget -QVariant VIntegerProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VIntegerProperty::getEditorData(const QWidget *editor) const { const QSpinBox* tmpEditor = qobject_cast(editor); if (tmpEditor) @@ -87,7 +84,7 @@ QVariant VIntegerProperty::getEditorData(const QWidget *editor) const return QVariant(0); } -void VIntegerProperty::setSetting(const QString& key, const QVariant& value) +void VPE::VIntegerProperty::setSetting(const QString& key, const QVariant& value) { if (key == QLatin1String("Min")) { @@ -103,7 +100,7 @@ void VIntegerProperty::setSetting(const QString& key, const QVariant& value) } } -QVariant VIntegerProperty::getSetting(const QString& key) const +QVariant VPE::VIntegerProperty::getSetting(const QString& key) const { if (key == QLatin1String("Min")) { @@ -121,31 +118,31 @@ QVariant VIntegerProperty::getSetting(const QString& key) const return VProperty::getSetting(key); } -QStringList VIntegerProperty::getSettingKeys() const +QStringList VPE::VIntegerProperty::getSettingKeys() const { return (QStringList("Min") << "Max" << "Step"); } -QString VIntegerProperty::type() const +QString VPE::VIntegerProperty::type() const { return "integer"; } -VProperty* VIntegerProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::VIntegerProperty::clone(bool include_children, VProperty* container) const { return VProperty::clone(include_children, container ? container : new VIntegerProperty(getName())); } -void VIntegerProperty::valueChanged(int i) +void VPE::VIntegerProperty::valueChanged(int i) { Q_UNUSED(i) UserChangeEvent *event = new UserChangeEvent(); QCoreApplication::postEvent ( VProperty::d_ptr->editor, event ); } -const double VDoubleProperty::StandardPrecision = 5; +const double VPE::VDoubleProperty::StandardPrecision = 5; -VDoubleProperty::VDoubleProperty(const QString& name, const QMap& settings) +VPE::VDoubleProperty::VDoubleProperty(const QString& name, const QMap& settings) : VIntegerProperty(name), Precision(static_cast(StandardPrecision)) { VProperty::setSettings(settings); @@ -154,7 +151,7 @@ VDoubleProperty::VDoubleProperty(const QString& name, const QMapPropertyVariantType = QVariant::Double; } -VDoubleProperty::VDoubleProperty(const QString &name) +VPE::VDoubleProperty::VDoubleProperty(const QString &name) : VIntegerProperty(name), Precision(static_cast(StandardPrecision)) { VProperty::d_ptr->VariantValue.setValue(0); @@ -163,8 +160,8 @@ VDoubleProperty::VDoubleProperty(const QString &name) } //! Returns an editor widget, or NULL if it doesn't supply one -QWidget* VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, - const QAbstractItemDelegate* delegate) +QWidget* VPE::VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate) { Q_UNUSED(options) Q_UNUSED(delegate) @@ -184,7 +181,7 @@ QWidget* VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewI } //! Gets the data from the widget -QVariant VDoubleProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VDoubleProperty::getEditorData(const QWidget *editor) const { const QDoubleSpinBox* tmpEditor = qobject_cast(editor); if (tmpEditor) @@ -195,7 +192,7 @@ QVariant VDoubleProperty::getEditorData(const QWidget *editor) const return QVariant(0); } -void VDoubleProperty::setSetting(const QString& key, const QVariant& value) +void VPE::VDoubleProperty::setSetting(const QString& key, const QVariant& value) { if (key == QLatin1String("Min")) { @@ -215,7 +212,7 @@ void VDoubleProperty::setSetting(const QString& key, const QVariant& value) } } -QVariant VDoubleProperty::getSetting(const QString& key) const +QVariant VPE::VDoubleProperty::getSetting(const QString& key) const { if (key == QLatin1String("Min")) { @@ -237,17 +234,17 @@ QVariant VDoubleProperty::getSetting(const QString& key) const return VProperty::getSetting(key); } -QStringList VDoubleProperty::getSettingKeys() const +QStringList VPE::VDoubleProperty::getSettingKeys() const { return (QStringList("Min") << "Max" << "Step" << "Precision"); } -QString VDoubleProperty::type() const +QString VPE::VDoubleProperty::type() const { return "double"; } -VProperty* VDoubleProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::VDoubleProperty::clone(bool include_children, VProperty* container) const { return VIntegerProperty::clone(include_children, container ? container : new VDoubleProperty(getName())); } diff --git a/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp b/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp index ab3839f70..f269b38ab 100644 --- a/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp @@ -30,9 +30,7 @@ class QAbstractItemDelegate; class QStyleOptionViewItem; -using namespace VPE; - -VObjectProperty::VObjectProperty(const QString& name) +VPE::VObjectProperty::VObjectProperty(const QString& name) : VProperty(name, QVariant::Int), objects() { VProperty::d_ptr->VariantValue = 0; @@ -40,7 +38,7 @@ VObjectProperty::VObjectProperty(const QString& name) } //! Get the data how it should be displayed -QVariant VObjectProperty::data (int column, int role) const +QVariant VPE::VObjectProperty::data (int column, int role) const { if (objects.empty()) { @@ -62,7 +60,7 @@ QVariant VObjectProperty::data (int column, int role) const } //! Returns an editor widget, or NULL if it doesn't supply one -QWidget* VObjectProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, +QWidget* VPE::VObjectProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, const QAbstractItemDelegate* delegate) { Q_UNUSED(options) @@ -79,7 +77,7 @@ QWidget* VObjectProperty::createEditor(QWidget * parent, const QStyleOptionViewI return VProperty::d_ptr->editor; } -bool VObjectProperty::setEditorData(QWidget *editor) +bool VPE::VObjectProperty::setEditorData(QWidget *editor) { if (!editor) { @@ -106,7 +104,7 @@ bool VObjectProperty::setEditorData(QWidget *editor) } //! Gets the data from the widget -QVariant VObjectProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VObjectProperty::getEditorData(const QWidget *editor) const { const QComboBox* tmpEditor = qobject_cast(editor); if (tmpEditor) @@ -119,20 +117,20 @@ QVariant VObjectProperty::getEditorData(const QWidget *editor) const //! Sets the objects list // cppcheck-suppress unusedFunction -void VObjectProperty::setObjectsList(const QMap &objects) +void VPE::VObjectProperty::setObjectsList(const QMap &objects) { this->objects = objects; } //! Get the settings. This function has to be implemented in a subclass in order to have an effect // cppcheck-suppress unusedFunction -QMap VObjectProperty::getObjects() const +QMap VPE::VObjectProperty::getObjects() const { return objects; } //! Sets the value of the property -void VObjectProperty::setValue(const QVariant& value) +void VPE::VObjectProperty::setValue(const QVariant& value) { VProperty::d_ptr->VariantValue = value; VProperty::d_ptr->VariantValue.convert(QVariant::UInt); @@ -143,24 +141,24 @@ void VObjectProperty::setValue(const QVariant& value) } } -QString VObjectProperty::type() const +QString VPE::VObjectProperty::type() const { return "objectList"; } -VProperty* VObjectProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::VObjectProperty::clone(bool include_children, VProperty* container) const { return VProperty::clone(include_children, container ? container : new VObjectProperty(getName())); } -void VObjectProperty::currentIndexChanged(int index) +void VPE::VObjectProperty::currentIndexChanged(int index) { Q_UNUSED(index) UserChangeEvent *event = new UserChangeEvent(); QCoreApplication::postEvent ( VProperty::d_ptr->editor, event ); } -void VObjectProperty::FillList(QComboBox *box, const QMap &list) const +void VPE::VObjectProperty::FillList(QComboBox *box, const QMap &list) const { box->clear(); diff --git a/src/libs/vpropertyexplorer/plugins/vpointfproperty.cpp b/src/libs/vpropertyexplorer/plugins/vpointfproperty.cpp index 4074beacb..d6030c933 100644 --- a/src/libs/vpropertyexplorer/plugins/vpointfproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vpointfproperty.cpp @@ -20,8 +20,6 @@ #include "vpointfproperty.h" -using namespace VPE; - #include #include #include @@ -49,7 +47,7 @@ VPE::VPointFProperty::VPointFProperty(const QString &name) setValue(QPointF()); } -QVariant VPointFProperty::data(int column, int role) const +QVariant VPE::VPointFProperty::data(int column, int role) const { if (column == DPC_Data && Qt::DisplayRole == role) { @@ -59,7 +57,7 @@ QVariant VPointFProperty::data(int column, int role) const return VProperty::data(column, role); } -Qt::ItemFlags VPointFProperty::flags(int column) const +Qt::ItemFlags VPE::VPointFProperty::flags(int column) const { if (column == DPC_Name || column == DPC_Data) { @@ -69,7 +67,7 @@ Qt::ItemFlags VPointFProperty::flags(int column) const return Qt::NoItemFlags; } -QPointF VPointFProperty::getPointF() const +QPointF VPE::VPointFProperty::getPointF() const { QPointF tmpValue; @@ -84,12 +82,12 @@ QPointF VPointFProperty::getPointF() const return tmpValue; } -void VPointFProperty::setPointF(const QPointF &point) +void VPE::VPointFProperty::setPointF(const QPointF &point) { setPointF(point.x(), point.y()); } -void VPointFProperty::setPointF(qreal x, qreal y) +void VPE::VPointFProperty::setPointF(qreal x, qreal y) { if (d_ptr->Children.count() < 2) { @@ -106,12 +104,12 @@ void VPointFProperty::setPointF(qreal x, qreal y) d_ptr->Children.at(1)->setValue(tmpY); } -QString VPointFProperty::type() const +QString VPE::VPointFProperty::type() const { return "pointF"; } -VProperty *VPointFProperty::clone(bool include_children, VProperty *container) const +VPE::VProperty *VPE::VPointFProperty::clone(bool include_children, VProperty *container) const { if (!container) { @@ -131,13 +129,13 @@ VProperty *VPointFProperty::clone(bool include_children, VProperty *container) c return VProperty::clone(false, container); // Child } -void VPointFProperty::setValue(const QVariant &value) +void VPE::VPointFProperty::setValue(const QVariant &value) { QPointF tmpPoint = value.toPointF(); setPointF(tmpPoint); } -QVariant VPointFProperty::getValue() const +QVariant VPE::VPointFProperty::getValue() const { QPointF tmpValue = getPointF(); return QString("%1,%2").arg(QString::number(tmpValue.x()), QString::number(tmpValue.y())); diff --git a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp index 811569d39..74d86f3d9 100644 --- a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp @@ -30,21 +30,18 @@ class QStyleOptionViewItem; - -using namespace VPE; - -VShortcutProperty::VShortcutProperty(const QString& name) +VPE::VShortcutProperty::VShortcutProperty(const QString& name) : VProperty(name, QVariant::String) { } -VShortcutProperty::~VShortcutProperty() +VPE::VShortcutProperty::~VShortcutProperty() { // } -QVariant VShortcutProperty::data (int column, int role) const +QVariant VPE::VShortcutProperty::data (int column, int role) const { if (column == DPC_Data && (Qt::DisplayRole == role || Qt::EditRole == role)) { @@ -55,8 +52,8 @@ QVariant VShortcutProperty::data (int column, int role) const } -QWidget* VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, - const QAbstractItemDelegate* delegate) +QWidget* VPE::VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate) { Q_UNUSED(options) @@ -70,7 +67,7 @@ QWidget* VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionVie } -bool VShortcutProperty::setEditorData(QWidget* editor) +bool VPE::VShortcutProperty::setEditorData(QWidget* editor) { VShortcutEditWidget* tmpWidget = qobject_cast(editor); if (tmpWidget) @@ -84,7 +81,7 @@ bool VShortcutProperty::setEditorData(QWidget* editor) } -QVariant VShortcutProperty::getEditorData(const QWidget *editor) const +QVariant VPE::VShortcutProperty::getEditorData(const QWidget *editor) const { const VShortcutEditWidget* tmpWidget = qobject_cast(editor); if (tmpWidget) @@ -96,17 +93,17 @@ QVariant VShortcutProperty::getEditorData(const QWidget *editor) const } -QString VShortcutProperty::type() const +QString VPE::VShortcutProperty::type() const { return "shortcut"; } -VProperty* VShortcutProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::VShortcutProperty::clone(bool include_children, VProperty* container) const { return VProperty::clone(include_children, container ? container : new VShortcutProperty(getName())); } -void VShortcutProperty::setValue(const QVariant &value) +void VPE::VShortcutProperty::setValue(const QVariant &value) { VProperty::setValue(QKeySequence::fromString(value.toString()).toString()); } diff --git a/src/libs/vpropertyexplorer/plugins/vshortcutpropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vshortcutpropertyeditor.cpp index 7137d40ae..93e2426df 100644 --- a/src/libs/vpropertyexplorer/plugins/vshortcutpropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vshortcutpropertyeditor.cpp @@ -30,9 +30,7 @@ class QHBoxLayout; class QKeyEvent; -using namespace VPE; - -VShortcutEditWidget::VShortcutEditWidget(QWidget *parent) +VPE::VShortcutEditWidget::VShortcutEditWidget(QWidget *parent) : QWidget(parent), CurrentKeySequence(), LineEdit(nullptr) { // Create the line edit widget @@ -51,12 +49,12 @@ VShortcutEditWidget::VShortcutEditWidget(QWidget *parent) } -VShortcutEditWidget::~VShortcutEditWidget() +VPE::VShortcutEditWidget::~VShortcutEditWidget() { // nothing needs to be done here } -bool VShortcutEditWidget::eventFilter(QObject *obj, QEvent *event) +bool VPE::VShortcutEditWidget::eventFilter(QObject *obj, QEvent *event) { if (obj == LineEdit) { @@ -82,23 +80,23 @@ bool VShortcutEditWidget::eventFilter(QObject *obj, QEvent *event) return QWidget::eventFilter(obj, event); } -QString VShortcutEditWidget::getShortcutAsString() const +QString VPE::VShortcutEditWidget::getShortcutAsString() const { return CurrentKeySequence.toString(); } // cppcheck-suppress unusedFunction -QKeySequence VShortcutEditWidget::getShortcut() +QKeySequence VPE::VShortcutEditWidget::getShortcut() { return CurrentKeySequence; } -void VShortcutEditWidget::setShortcut(const QString &shortcut, bool emit_signal) +void VPE::VShortcutEditWidget::setShortcut(const QString &shortcut, bool emit_signal) { setShortcut(QKeySequence::fromString(shortcut), emit_signal); } -void VShortcutEditWidget::setShortcut(const QKeySequence &shortcut, bool emit_signal) +void VPE::VShortcutEditWidget::setShortcut(const QKeySequence &shortcut, bool emit_signal) { if (shortcut != CurrentKeySequence) { @@ -111,7 +109,7 @@ void VShortcutEditWidget::setShortcut(const QKeySequence &shortcut, bool emit_si } } -void VShortcutEditWidget::onTextEdited(const QString &text) +void VPE::VShortcutEditWidget::onTextEdited(const QString &text) { setShortcut(text, true); } diff --git a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp index 1fd2774ca..0b2a82707 100644 --- a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp @@ -35,9 +35,6 @@ class QAbstractItemDelegate; class QStyleOptionViewItem; -using namespace VPE; - - VPE::VStringProperty::VStringProperty(const QString &name, const QMap &settings) : VProperty(name, QVariant::String), readOnly(false), typeForParent(0), clearButton(false), m_osSeparator(false) { @@ -89,12 +86,12 @@ void VPE::VStringProperty::setReadOnly(bool readOnly) this->readOnly = readOnly; } -void VStringProperty::setOsSeparator(bool separator) +void VPE::VStringProperty::setOsSeparator(bool separator) { m_osSeparator = separator; } -void VStringProperty::setClearButtonEnable(bool value) +void VPE::VStringProperty::setClearButtonEnable(bool value) { this->clearButton = value; } @@ -142,23 +139,23 @@ VPE::VProperty *VPE::VStringProperty::clone(bool include_children, VPE::VPropert return VProperty::clone(include_children, container ? container : new VStringProperty(getName(), getSettings())); } -void VStringProperty::UpdateParent(const QVariant &value) +void VPE::VStringProperty::UpdateParent(const QVariant &value) { emit childChanged(value, typeForParent); } // cppcheck-suppress unusedFunction -int VStringProperty::getTypeForParent() const +int VPE::VStringProperty::getTypeForParent() const { return typeForParent; } -void VStringProperty::setTypeForParent(int value) +void VPE::VStringProperty::setTypeForParent(int value) { typeForParent = value; } -bool VStringProperty::eventFilter(QObject *object, QEvent *event) +bool VPE::VStringProperty::eventFilter(QObject *object, QEvent *event) { if (QLineEdit *textEdit = qobject_cast(object)) { diff --git a/src/libs/vpropertyexplorer/plugins/vwidgetproperty.cpp b/src/libs/vpropertyexplorer/plugins/vwidgetproperty.cpp index 985626b90..856a91e71 100644 --- a/src/libs/vpropertyexplorer/plugins/vwidgetproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vwidgetproperty.cpp @@ -28,24 +28,22 @@ #include "vemptyproperty.h" #include "../vproperty.h" -using namespace VPE; - -VWidgetProperty::VWidgetProperty(const QString& name, QWidget* widget) +VPE::VWidgetProperty::VWidgetProperty(const QString& name, QWidget* widget) : VEmptyProperty(new VWidgetPropertyPrivate(name, QVariant::Invalid, widget)) { } -VWidgetProperty::~VWidgetProperty() +VPE::VWidgetProperty::~VWidgetProperty() { // } -QWidget *VWidgetProperty::getWidget() const +QWidget *VPE::VWidgetProperty::getWidget() const { return static_cast(d_ptr)->Widget.data(); } -void VWidgetProperty::setWidget(QWidget* widget) +void VPE::VWidgetProperty::setWidget(QWidget* widget) { VWidgetPropertyPrivate* tmpDPtr = static_cast(d_ptr); QWidget* tmpOldWidget = tmpDPtr->Widget.data(); @@ -58,12 +56,12 @@ void VWidgetProperty::setWidget(QWidget* widget) } -QString VWidgetProperty::type() const +QString VPE::VWidgetProperty::type() const { return "widget"; } -VProperty* VWidgetProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::VWidgetProperty::clone(bool include_children, VProperty* container) const { /* todo: This is a tricky one to clone... don't know what would be the best way to do so... Maybe serialize the * widget somehow? diff --git a/src/libs/vpropertyexplorer/vproperty.cpp b/src/libs/vpropertyexplorer/vproperty.cpp index 9ba92349d..de53c9ac3 100644 --- a/src/libs/vpropertyexplorer/vproperty.cpp +++ b/src/libs/vpropertyexplorer/vproperty.cpp @@ -38,22 +38,20 @@ class QModelIndex; class QPainter; class QStyleOptionViewItem; -using namespace VPE; - //! Standard constructor, takes a name and a parent property as argument -VProperty::VProperty(const QString& name, QVariant::Type type) +VPE::VProperty::VProperty(const QString& name, QVariant::Type type) : QObject(), d_ptr(new VPropertyPrivate(name, type)) { } -VProperty::VProperty(VPropertyPrivate *d) +VPE::VProperty::VProperty(VPropertyPrivate *d) : d_ptr(d) { } -VProperty::~VProperty() +VPE::VProperty::~VProperty() { setParent(nullptr); @@ -66,13 +64,13 @@ VProperty::~VProperty() delete d_ptr; } -QString VProperty::type() const +QString VPE::VProperty::type() const { return "string"; } //! Get the data how it should be displayed -QVariant VProperty::data (int column, int role) const +QVariant VPE::VProperty::data (int column, int role) const { if (column == DPC_Name && Qt::DisplayRole == role) { @@ -90,7 +88,7 @@ QVariant VProperty::data (int column, int role) const return QVariant(); } -bool VProperty::setData(const QVariant &data, int role) +bool VPE::VProperty::setData(const QVariant &data, int role) { bool tmpResult = false; if (Qt::EditRole == role) @@ -102,8 +100,8 @@ bool VProperty::setData(const QVariant &data, int role) return tmpResult; } -bool VProperty::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, - const QAbstractItemDelegate *delegate) const +bool VPE::VProperty::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, + const QAbstractItemDelegate *delegate) const { Q_UNUSED(painter) Q_UNUSED(option) @@ -114,8 +112,8 @@ bool VProperty::paint(QPainter *painter, const QStyleOptionViewItem &option, con } //! Returns an editor widget, or NULL if it doesn't supply one -QWidget* VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, - const QAbstractItemDelegate* delegate) +QWidget* VPE::VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate) { Q_UNUSED(options) Q_UNUSED(delegate) @@ -129,7 +127,7 @@ QWidget* VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& o return d_ptr->editor; } -bool VProperty::setEditorData(QWidget* editor) +bool VPE::VProperty::setEditorData(QWidget* editor) { if (!editor) { @@ -150,7 +148,7 @@ bool VProperty::setEditorData(QWidget* editor) } //! Gets the data from the widget -QVariant VProperty::getEditorData(const QWidget* editor) const +QVariant VPE::VProperty::getEditorData(const QWidget* editor) const { if (!editor) { @@ -168,7 +166,7 @@ QVariant VProperty::getEditorData(const QWidget* editor) const } //! Returns item flags -Qt::ItemFlags VProperty::flags(int column) const +Qt::ItemFlags VPE::VProperty::flags(int column) const { if (column == DPC_Name) { @@ -183,7 +181,7 @@ Qt::ItemFlags VProperty::flags(int column) const } -void VProperty::setValue(const QVariant &value) +void VPE::VProperty::setValue(const QVariant &value) { d_ptr->VariantValue = value; d_ptr->VariantValue.convert(static_cast(d_ptr->PropertyVariantType)); @@ -193,60 +191,60 @@ void VProperty::setValue(const QVariant &value) } } -QVariant VProperty::getValue() const +QVariant VPE::VProperty::getValue() const { return d_ptr->VariantValue; } // cppcheck-suppress unusedFunction -QString VProperty::serialize() const +QString VPE::VProperty::serialize() const { return getValue().toString(); } -void VProperty::deserialize(const QString& value) +void VPE::VProperty::deserialize(const QString& value) { setValue(QVariant(value)); } -void VProperty::setName(const QString& name) +void VPE::VProperty::setName(const QString& name) { d_ptr->Name = name; } -QString VProperty::getName() const +QString VPE::VProperty::getName() const { return d_ptr->Name; } -void VProperty::setDescription(const QString& desc) +void VPE::VProperty::setDescription(const QString& desc) { d_ptr->Description = desc; } -QString VProperty::getDescription() const +QString VPE::VProperty::getDescription() const { return d_ptr->Description; } //! Returns a reference to the list of children -QList& VProperty::getChildren() +QList& VPE::VProperty::getChildren() { return d_ptr->Children; } //! Returns a reference to the list of children -const QList& VProperty::getChildren() const +const QList& VPE::VProperty::getChildren() const { return d_ptr->Children; } //! Returns the child at a certain row -VProperty* VProperty::getChild(int row) const +VPE::VProperty* VPE::VProperty::getChild(int row) const { if (row >= 0 && row < getRowCount()) { @@ -257,19 +255,19 @@ VProperty* VProperty::getChild(int row) const } //! Gets the number of children -int VProperty::getRowCount() const +int VPE::VProperty::getRowCount() const { return d_ptr->Children.count(); } //! Gets the parent of this property -VProperty* VProperty::getParent() const +VPE::VProperty* VPE::VProperty::getParent() const { return d_ptr->Parent; } //! Sets the parent of this property -void VProperty::setParent(VProperty* parent) +void VPE::VProperty::setParent(VProperty* parent) { if (d_ptr->Parent == parent) { @@ -290,7 +288,7 @@ void VProperty::setParent(VProperty* parent) } } -int VProperty::addChild(VProperty *child) +int VPE::VProperty::addChild(VProperty *child) { if (child && child->getParent() != this) { @@ -309,7 +307,7 @@ int VProperty::addChild(VProperty *child) } //! Removes a child from the children list -void VProperty::removeChild(VProperty* child) +void VPE::VProperty::removeChild(VProperty* child) { d_ptr->Children.removeAll(child); @@ -320,32 +318,32 @@ void VProperty::removeChild(VProperty* child) } //! Returns the row the child has -int VProperty::getChildRow(VProperty* child) const +int VPE::VProperty::getChildRow(VProperty* child) const { return d_ptr->Children.indexOf(child); } //! Returns whether the views have to update the parent of this property if it changes -bool VProperty::getUpdateParent() const +bool VPE::VProperty::getUpdateParent() const { return d_ptr->UpdateParent; } //! Returns whether the views have to update the children of this property if it changes -bool VProperty::getUpdateChildren() const +bool VPE::VProperty::getUpdateChildren() const { return d_ptr->UpdateChildren; } //! Sets whether the views should update Parents or children after this property changes -void VProperty::setUpdateBehaviour(bool update_parent, bool update_children) +void VPE::VProperty::setUpdateBehaviour(bool update_parent, bool update_children) { d_ptr->UpdateParent = update_parent; d_ptr->UpdateChildren = update_children; } -void VProperty::setSettings(const QMap& settings) +void VPE::VProperty::setSettings(const QMap& settings) { QMap::const_iterator tmpIterator = settings.constBegin(); for (; tmpIterator != settings.constEnd(); ++tmpIterator) @@ -354,7 +352,7 @@ void VProperty::setSettings(const QMap& settings) } } -QMap VProperty::getSettings() const +QMap VPE::VProperty::getSettings() const { QMap tmpResult; @@ -365,26 +363,26 @@ QMap VProperty::getSettings() const return tmpResult; } -void VProperty::setSetting(const QString& key, const QVariant& value) +void VPE::VProperty::setSetting(const QString& key, const QVariant& value) { Q_UNUSED(key) Q_UNUSED(value) // Not needed in the Standard property } -QVariant VProperty::getSetting(const QString& key) const +QVariant VPE::VProperty::getSetting(const QString& key) const { // Not needed in the Standard property Q_UNUSED(key) return QVariant(); } -QStringList VProperty::getSettingKeys() const +QStringList VPE::VProperty::getSettingKeys() const { return QStringList(); } -VProperty* VProperty::clone(bool include_children, VProperty* container) const +VPE::VProperty* VPE::VProperty::clone(bool include_children, VProperty* container) const { if (!container) { @@ -407,28 +405,28 @@ VProperty* VProperty::clone(bool include_children, VProperty* container) const return container; } -Property VProperty::propertyType() const +VPE::Property VPE::VProperty::propertyType() const { return d_ptr->type; } -void VProperty::setPropertyType(const Property &type) +void VPE::VProperty::setPropertyType(const Property &type) { d_ptr->type = type; } -void VProperty::UpdateParent(const QVariant &value) +void VPE::VProperty::UpdateParent(const QVariant &value) { Q_UNUSED(value) } -void VProperty::ValueChildChanged(const QVariant &value, int typeForParent) +void VPE::VProperty::ValueChildChanged(const QVariant &value, int typeForParent) { Q_UNUSED(value) Q_UNUSED(typeForParent) } -UserChangeEvent::~UserChangeEvent() +VPE::UserChangeEvent::~UserChangeEvent() {} VPE::VPropertyPrivate::~VPropertyPrivate() diff --git a/src/libs/vpropertyexplorer/vpropertydelegate.cpp b/src/libs/vpropertyexplorer/vpropertydelegate.cpp index b2aa21a37..6bac9501e 100644 --- a/src/libs/vpropertyexplorer/vpropertydelegate.cpp +++ b/src/libs/vpropertyexplorer/vpropertydelegate.cpp @@ -36,20 +36,18 @@ class QStyleOptionViewItem; class QWidget; -using namespace VPE; - -VPropertyDelegate::VPropertyDelegate(QObject *parent) : +VPE::VPropertyDelegate::VPropertyDelegate(QObject *parent) : QStyledItemDelegate(parent), RowHeight(0), AddRowHeight(false) { } -VPropertyDelegate::~VPropertyDelegate() +VPE::VPropertyDelegate::~VPropertyDelegate() { // } -QWidget* VPropertyDelegate::createEditor (QWidget* parent, const QStyleOptionViewItem& option, - const QModelIndex& index) const +QWidget* VPE::VPropertyDelegate::createEditor (QWidget* parent, const QStyleOptionViewItem& option, + const QModelIndex& index) const { QWidget* tmpWidget = nullptr; if (index.isValid()) @@ -63,7 +61,7 @@ QWidget* VPropertyDelegate::createEditor (QWidget* parent, const QStyleOptionVie //! Sets the index data to the editor -void VPropertyDelegate::setEditorData (QWidget * editor, const QModelIndex & index) const +void VPE::VPropertyDelegate::setEditorData (QWidget * editor, const QModelIndex & index) const { bool done = false; if (index.isValid() && editor) @@ -79,7 +77,8 @@ void VPropertyDelegate::setEditorData (QWidget * editor, const QModelIndex & ind } //! Updates the index data -void VPropertyDelegate::setModelData (QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const +void VPE::VPropertyDelegate::setModelData (QWidget * editor, QAbstractItemModel * model, + const QModelIndex & index) const { QVariant tmpData; if (index.isValid() && editor) @@ -96,7 +95,7 @@ void VPropertyDelegate::setModelData (QWidget * editor, QAbstractItemModel * mod model->setData(index, tmpData); } -QSize VPropertyDelegate::sizeHint (const QStyleOptionViewItem& option, const QModelIndex& index) const +QSize VPE::VPropertyDelegate::sizeHint (const QStyleOptionViewItem& option, const QModelIndex& index) const { QSize tmpStandardSizeHint = QStyledItemDelegate::sizeHint(option, index); tmpStandardSizeHint.setHeight(tmpStandardSizeHint.height() + 1); @@ -109,13 +108,14 @@ QSize VPropertyDelegate::sizeHint (const QStyleOptionViewItem& option, const QMo return tmpStandardSizeHint; } -void VPropertyDelegate::setRowHeight(int height, bool add_to_standard) +void VPE::VPropertyDelegate::setRowHeight(int height, bool add_to_standard) { RowHeight = height; AddRowHeight = add_to_standard; } -void VPropertyDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const +void VPE::VPropertyDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, + const QModelIndex& index ) const { bool done = false; if (index.isValid() && index.column() == 1) diff --git a/src/libs/vpropertyexplorer/vpropertyfactorymanager.cpp b/src/libs/vpropertyexplorer/vpropertyfactorymanager.cpp index 6b7edf89e..0fdc1ad09 100644 --- a/src/libs/vpropertyexplorer/vpropertyfactorymanager.cpp +++ b/src/libs/vpropertyexplorer/vpropertyfactorymanager.cpp @@ -30,18 +30,15 @@ #include "vpropertyfactorymanager_p.h" #include "vstandardpropertyfactory.h" -using namespace VPE; +VPE::VPropertyFactoryManager* VPE::VPropertyFactoryManager::DefaultManager = NULL; - -VPropertyFactoryManager* VPropertyFactoryManager::DefaultManager = NULL; - -VPropertyFactoryManager::VPropertyFactoryManager(QObject *parent) +VPE::VPropertyFactoryManager::VPropertyFactoryManager(QObject *parent) : QObject(parent), d_ptr(new VPropertyFactoryManagerPrivate()) { } -VPropertyFactoryManager::~VPropertyFactoryManager() +VPE::VPropertyFactoryManager::~VPropertyFactoryManager() { // Delete all factories QList tmpFactories = d_ptr->Factories.values(); @@ -60,7 +57,7 @@ VPropertyFactoryManager::~VPropertyFactoryManager() } } -void VPropertyFactoryManager::registerFactory(const QString& type, VAbstractPropertyFactory* factory) +void VPE::VPropertyFactoryManager::registerFactory(const QString& type, VAbstractPropertyFactory* factory) { if (type.isEmpty()) { @@ -73,7 +70,7 @@ void VPropertyFactoryManager::registerFactory(const QString& type, VAbstractProp d_ptr->Factories[type] = factory; } -void VPropertyFactoryManager::unregisterFactory(VAbstractPropertyFactory* factory, const QString& type, +void VPE::VPropertyFactoryManager::unregisterFactory(VAbstractPropertyFactory* factory, const QString& type, bool delete_if_unused) { if (!factory) @@ -109,19 +106,19 @@ void VPropertyFactoryManager::unregisterFactory(VAbstractPropertyFactory* factor } } -bool VPropertyFactoryManager::isRegistered(VAbstractPropertyFactory* factory) +bool VPE::VPropertyFactoryManager::isRegistered(VAbstractPropertyFactory* factory) { return (!d_ptr->Factories.key(factory, QString()).isEmpty()); } -VAbstractPropertyFactory* VPropertyFactoryManager::getFactory(const QString& type) +VPE::VAbstractPropertyFactory* VPE::VPropertyFactoryManager::getFactory(const QString& type) { return d_ptr->Factories.value(type, NULL); } -VProperty* VPropertyFactoryManager::createProperty(const QString& type, const QString& name, const QString& description, - const QString &default_value) +VPE::VProperty* VPE::VPropertyFactoryManager::createProperty(const QString& type, const QString& name, + const QString& description, const QString &default_value) { VAbstractPropertyFactory* tmpFactory = getFactory(type); VProperty* tmpResult = NULL; @@ -144,7 +141,7 @@ VProperty* VPropertyFactoryManager::createProperty(const QString& type, const QS } // cppcheck-suppress unusedFunction -VPropertyFactoryManager *VPropertyFactoryManager::getDefaultManager() +VPE::VPropertyFactoryManager *VPE::VPropertyFactoryManager::getDefaultManager() { if (!DefaultManager) { @@ -156,7 +153,7 @@ VPropertyFactoryManager *VPropertyFactoryManager::getDefaultManager() } // cppcheck-suppress unusedFunction -QStringList VPropertyFactoryManager::getSupportedTypes() +QStringList VPE::VPropertyFactoryManager::getSupportedTypes() { return d_ptr->Factories.keys(); } diff --git a/src/libs/vpropertyexplorer/vpropertyformview.cpp b/src/libs/vpropertyexplorer/vpropertyformview.cpp index f83db5897..e22851bf4 100644 --- a/src/libs/vpropertyexplorer/vpropertyformview.cpp +++ b/src/libs/vpropertyexplorer/vpropertyformview.cpp @@ -33,32 +33,30 @@ class QModelIndex; class QShowEvent; class QWidget; -using namespace VPE; - -VPropertyFormView::VPropertyFormView(QWidget* parent) +VPE::VPropertyFormView::VPropertyFormView(QWidget* parent) : VPropertyFormWidget(new VPropertyFormViewPrivate(), parent) { // } -VPropertyFormView::VPropertyFormView(VPropertyModel* model, QWidget *parent) +VPE::VPropertyFormView::VPropertyFormView(VPropertyModel* model, QWidget *parent) : VPropertyFormWidget(new VPropertyFormViewPrivate(), parent) { setModel(model); } -VPropertyFormView::VPropertyFormView(VPropertySet* property_set, QWidget *parent) +VPE::VPropertyFormView::VPropertyFormView(VPropertySet* property_set, QWidget *parent) : VPropertyFormWidget(new VPropertyFormViewPrivate(), parent) { setPropertySet(property_set); } -VPropertyFormView::~VPropertyFormView() +VPE::VPropertyFormView::~VPropertyFormView() { // Nothing to do } -void VPropertyFormView::build() +void VPE::VPropertyFormView::build() { VPropertyFormWidget::build(); @@ -66,7 +64,7 @@ void VPropertyFormView::build() connectPropertyFormWidget(this); } -void VPropertyFormView::setModel(VPropertyModel *model) +void VPE::VPropertyFormView::setModel(VPropertyModel *model) { // Remove old model or set removeModelAndSet(); @@ -92,7 +90,7 @@ void VPropertyFormView::setModel(VPropertyModel *model) updatePropertyList(); } -void VPropertyFormView::setPropertySet(VPropertySet* property_set) +void VPE::VPropertyFormView::setPropertySet(VPropertySet* property_set) { // Remove old model or set removeModelAndSet(); @@ -109,7 +107,7 @@ void VPropertyFormView::setPropertySet(VPropertySet* property_set) updatePropertyList(); } -void VPropertyFormView::rowsRemoved(const QModelIndex &parent, int start, int end) +void VPE::VPropertyFormView::rowsRemoved(const QModelIndex &parent, int start, int end) { // todo: Only rebuild the neccessary parts Q_UNUSED(parent) @@ -118,7 +116,7 @@ void VPropertyFormView::rowsRemoved(const QModelIndex &parent, int start, int en updatePropertyList(); } -void VPropertyFormView::rowsInserted(const QModelIndex &parent, int start, int end) //-V524 +void VPE::VPropertyFormView::rowsInserted(const QModelIndex &parent, int start, int end) //-V524 { // todo: Only rebuild the neccessary parts Q_UNUSED(parent) @@ -127,18 +125,18 @@ void VPropertyFormView::rowsInserted(const QModelIndex &parent, int start, int e updatePropertyList(); } -void VPropertyFormView::modelReset() +void VPE::VPropertyFormView::modelReset() { updatePropertyList(); } -void VPropertyFormView::modelDestroyed() +void VPE::VPropertyFormView::modelDestroyed() { removeModelAndSet(); updatePropertyList(); } -void VPropertyFormView::dataChanged(const QModelIndex &top_left, const QModelIndex &bottom_right) +void VPE::VPropertyFormView::dataChanged(const QModelIndex &top_left, const QModelIndex &bottom_right) { Q_UNUSED(top_left) Q_UNUSED(bottom_right) @@ -149,7 +147,7 @@ void VPropertyFormView::dataChanged(const QModelIndex &top_left, const QModelInd // todo: handle data changes } -void VPropertyFormView::dataSubmitted(VProperty *property) +void VPE::VPropertyFormView::dataSubmitted(VProperty *property) { VPropertyModel* tmpModel = static_cast(d_ptr)->Model; @@ -161,7 +159,7 @@ void VPropertyFormView::dataSubmitted(VProperty *property) } } -void VPropertyFormView::showEvent(QShowEvent *event) +void VPE::VPropertyFormView::showEvent(QShowEvent *event) { Q_UNUSED(event) if (static_cast(d_ptr)->NeedsRebuild) @@ -171,7 +169,7 @@ void VPropertyFormView::showEvent(QShowEvent *event) static_cast(d_ptr)->NeedsRebuild = false; } -void VPropertyFormView::updatePropertyList() +void VPE::VPropertyFormView::updatePropertyList() { VPropertyModel* tmpModel = static_cast(d_ptr)->Model; VPropertySet* tmpSet = static_cast(d_ptr)->PropertySet; @@ -195,7 +193,7 @@ void VPropertyFormView::updatePropertyList() static_cast(d_ptr)->NeedsRebuild = true; } -void VPropertyFormView::removeModelAndSet() +void VPE::VPropertyFormView::removeModelAndSet() { if (static_cast(d_ptr)->Model) { @@ -208,7 +206,7 @@ void VPropertyFormView::removeModelAndSet() static_cast(d_ptr)->PropertySet = nullptr; } -void VPropertyFormView::connectPropertyFormWidget(VPropertyFormWidget *widget) +void VPE::VPropertyFormView::connectPropertyFormWidget(VPropertyFormWidget *widget) { if (!widget) { diff --git a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp index b442d5cb2..f694737e8 100644 --- a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp +++ b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp @@ -38,9 +38,7 @@ class QKeyEvent; -using namespace VPE; - -VPropertyFormWidget::VPropertyFormWidget(const QString &title, const QString &description, +VPE::VPropertyFormWidget::VPropertyFormWidget(const QString &title, const QString &description, const QList& properties, QWidget *parent) : QGroupBox(title, parent), d_ptr(new VPropertyFormWidgetPrivate(properties)) { @@ -49,7 +47,7 @@ VPropertyFormWidget::VPropertyFormWidget(const QString &title, const QString &de setWhatsThis(description); } -VPropertyFormWidget::VPropertyFormWidget(VProperty *parent_property, QWidget *parent) +VPE::VPropertyFormWidget::VPropertyFormWidget(VProperty *parent_property, QWidget *parent) : QGroupBox(parent), d_ptr(new VPropertyFormWidgetPrivate()) { if (parent_property) @@ -62,8 +60,8 @@ VPropertyFormWidget::VPropertyFormWidget(VProperty *parent_property, QWidget *pa } } -VPropertyFormWidget::VPropertyFormWidget(VPropertyFormWidgetPrivate *d_pointer, QWidget *parent, const QString &title, - const QString &description) +VPE::VPropertyFormWidget::VPropertyFormWidget(VPropertyFormWidgetPrivate *d_pointer, QWidget *parent, + const QString &title, const QString &description) : QGroupBox(title, parent), d_ptr(d_pointer) { build(); @@ -71,13 +69,13 @@ VPropertyFormWidget::VPropertyFormWidget(VPropertyFormWidgetPrivate *d_pointer, setWhatsThis(description); } -VPropertyFormWidget::~VPropertyFormWidget() +VPE::VPropertyFormWidget::~VPropertyFormWidget() { delete d_ptr; } -void VPropertyFormWidget::build() +void VPE::VPropertyFormWidget::build() { // Clear the old content, delete old widgets d_ptr->EditorWidgets.clear(); @@ -160,7 +158,7 @@ void VPropertyFormWidget::build() } } -void VPropertyFormWidget::buildEditor(VProperty* property, QFormLayout* formLayout, Property type) +void VPE::VPropertyFormWidget::buildEditor(VProperty* property, QFormLayout* formLayout, Property type) { // Add property (no child properties) // Create the editor (if it doesn't work, create empty widget) @@ -194,7 +192,7 @@ void VPropertyFormWidget::buildEditor(VProperty* property, QFormLayout* formLayo d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpEditor)); } -void VPropertyFormWidget::commitData() +void VPE::VPropertyFormWidget::commitData() { for (int i = 0; i < d_ptr->Properties.count(); ++i) { @@ -202,7 +200,7 @@ void VPropertyFormWidget::commitData() } } -void VPropertyFormWidget::loadData() +void VPE::VPropertyFormWidget::loadData() { for (int i = 0; i < d_ptr->Properties.count(); ++i) { @@ -210,7 +208,7 @@ void VPropertyFormWidget::loadData() } } -void VPropertyFormWidget::commitData(int row) +void VPE::VPropertyFormWidget::commitData(int row) { if (row < 0 || row >= d_ptr->EditorWidgets.count() || row >= d_ptr->Properties.count()) { @@ -249,7 +247,7 @@ void VPropertyFormWidget::commitData(int row) } } -void VPropertyFormWidget::loadData(int row) +void VPE::VPropertyFormWidget::loadData(int row) { if (row < 0 || row >= d_ptr->EditorWidgets.count() || row >= d_ptr->Properties.count()) { @@ -268,7 +266,7 @@ void VPropertyFormWidget::loadData(int row) } } -void VPropertyFormWidget::setCommitBehaviour(bool auto_commit) +void VPE::VPropertyFormWidget::setCommitBehaviour(bool auto_commit) { d_ptr->UpdateEditors = auto_commit; @@ -282,7 +280,7 @@ void VPropertyFormWidget::setCommitBehaviour(bool auto_commit) } } -QList VPropertyFormWidget::getChildPropertyFormWidgets() const +QList VPE::VPropertyFormWidget::getChildPropertyFormWidgets() const { QList tmpResult; foreach(const VPropertyFormWidgetPrivate::SEditorWidget& tmpEditorWidget, d_ptr->EditorWidgets) @@ -296,7 +294,7 @@ QList VPropertyFormWidget::getChildPropertyFormWidgets() return tmpResult; } -bool VPropertyFormWidget::eventFilter(QObject *object, QEvent *event) +bool VPE::VPropertyFormWidget::eventFilter(QObject *object, QEvent *event) { if (!d_ptr->UpdateEditors) { @@ -354,7 +352,7 @@ bool VPropertyFormWidget::eventFilter(QObject *object, QEvent *event) return false; } -void VPropertyFormWidget::commitData(const QWidget *editor) +void VPE::VPropertyFormWidget::commitData(const QWidget *editor) { if (!editor) { diff --git a/src/libs/vpropertyexplorer/vpropertymodel.cpp b/src/libs/vpropertyexplorer/vpropertymodel.cpp index 95d6978e0..04eb66d7a 100644 --- a/src/libs/vpropertyexplorer/vpropertymodel.cpp +++ b/src/libs/vpropertyexplorer/vpropertymodel.cpp @@ -25,29 +25,27 @@ #include "vproperty.h" #include "vpropertyset.h" -using namespace VPE; - #include "vpropertymodel_p.h" -VPropertyModel::VPropertyModel(VPropertyModelPrivate *d, QObject *parent) +VPE::VPropertyModel::VPropertyModel(VPropertyModelPrivate *d, QObject *parent) : QAbstractItemModel(parent), d_ptr(d) { } -VPropertyModel::VPropertyModel(QObject * parent) : +VPE::VPropertyModel::VPropertyModel(QObject * parent) : QAbstractItemModel(parent), d_ptr(new VPropertyModelPrivate()) { } -VPropertyModel::~VPropertyModel() +VPE::VPropertyModel::~VPropertyModel() { delete d_ptr->Properties; delete d_ptr; } //! Adds the property to the model and attaches it to the parentid -bool VPropertyModel::addProperty(VProperty* property, const QString& id, const QString &parentid, bool emitsignals) +bool VPE::VPropertyModel::addProperty(VProperty* property, const QString& id, const QString &parentid, bool emitsignals) { if (!property) { @@ -78,8 +76,8 @@ bool VPropertyModel::addProperty(VProperty* property, const QString& id, const Q } //! Creates a property and adds it to the model -VProperty* VPropertyModel::createProperty(const QString& id, const QString& name, const QString& parentid, - const QVariant& data) +VPE::VProperty* VPE::VPropertyModel::createProperty(const QString& id, const QString& name, const QString& parentid, + const QVariant& data) { VProperty* tmpProp = new VProperty(name); tmpProp->setValue(data); @@ -92,13 +90,13 @@ VProperty* VPropertyModel::createProperty(const QString& id, const QString& name } //! Gets a property by it's ID -VProperty* VPropertyModel::getProperty(const QString& id) +VPE::VProperty* VPE::VPropertyModel::getProperty(const QString& id) { return d_ptr->Properties != nullptr ? d_ptr->Properties->getProperty(id) : nullptr; } //! Returns the model index at row/column -QModelIndex VPropertyModel::index(int row, int column, const QModelIndex& parent) const +QModelIndex VPE::VPropertyModel::index(int row, int column, const QModelIndex& parent) const { if (d_ptr->Properties == nullptr || (parent.isValid() && parent.column() > 1)) { @@ -127,7 +125,7 @@ QModelIndex VPropertyModel::index(int row, int column, const QModelIndex& parent } //! Returns the parent of one model index -QModelIndex VPropertyModel::parent ( const QModelIndex & index ) const +QModelIndex VPE::VPropertyModel::parent ( const QModelIndex & index ) const { if (!index.isValid()) { @@ -155,7 +153,7 @@ QModelIndex VPropertyModel::parent ( const QModelIndex & index ) const } //! Returns the item flags for the given index -Qt::ItemFlags VPropertyModel::flags (const QModelIndex& index) const +Qt::ItemFlags VPE::VPropertyModel::flags (const QModelIndex& index) const { VProperty* tmpProperty = getProperty(index); if (!tmpProperty) @@ -167,7 +165,7 @@ Qt::ItemFlags VPropertyModel::flags (const QModelIndex& index) const } //! Sets the role data for the item at index to value -bool VPropertyModel::setData (const QModelIndex& index, const QVariant& value, int role) +bool VPE::VPropertyModel::setData (const QModelIndex& index, const QVariant& value, int role) { VProperty* tmpProperty = getProperty(index); if (index.column() == 1 && tmpProperty) @@ -191,7 +189,7 @@ bool VPropertyModel::setData (const QModelIndex& index, const QVariant& value, i //! Returns the data of an model index -QVariant VPropertyModel::data ( const QModelIndex & index, int role ) const +QVariant VPE::VPropertyModel::data ( const QModelIndex & index, int role ) const { VProperty* tmpProperty = getProperty(index); if (!tmpProperty) @@ -203,7 +201,7 @@ QVariant VPropertyModel::data ( const QModelIndex & index, int role ) const } -QVariant VPropertyModel::headerData (int section, Qt::Orientation orientation, int role) const +QVariant VPE::VPropertyModel::headerData (int section, Qt::Orientation orientation, int role) const { if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { @@ -227,7 +225,7 @@ QVariant VPropertyModel::headerData (int section, Qt::Orientation orientation, i //! Returns the number of rows -int VPropertyModel::rowCount ( const QModelIndex & parent ) const +int VPE::VPropertyModel::rowCount ( const QModelIndex & parent ) const { if (parent.isValid()) { @@ -249,7 +247,7 @@ int VPropertyModel::rowCount ( const QModelIndex & parent ) const //! Returns the number of columns -int VPropertyModel::columnCount ( const QModelIndex & parent) const +int VPE::VPropertyModel::columnCount ( const QModelIndex & parent) const { Q_UNUSED(parent) return 2; @@ -257,7 +255,7 @@ int VPropertyModel::columnCount ( const QModelIndex & parent) const //! Gets a property by its ModelIndex -VProperty* VPropertyModel::getProperty(const QModelIndex &index) const +VPE::VProperty* VPE::VPropertyModel::getProperty(const QModelIndex &index) const { if (index.isValid()) { @@ -271,12 +269,12 @@ VProperty* VPropertyModel::getProperty(const QModelIndex &index) const return nullptr; } -QString VPropertyModel::getPropertyID(const VProperty *prop) const +QString VPE::VPropertyModel::getPropertyID(const VProperty *prop) const { return d_ptr->Properties != nullptr ? d_ptr->Properties->getPropertyID(prop) : QString(); } -QModelIndex VPropertyModel::getIndexFromProperty(VProperty* property, int column) const +QModelIndex VPE::VPropertyModel::getIndexFromProperty(VProperty* property, int column) const { if (!property || column > columnCount() || column < 0) { @@ -295,7 +293,7 @@ QModelIndex VPropertyModel::getIndexFromProperty(VProperty* property, int column } -void VPropertyModel::onDataChangedByModel(VProperty* property) +void VPE::VPropertyModel::onDataChangedByModel(VProperty* property) { QModelIndex tmpIndex = getIndexFromProperty(property, 1); if (tmpIndex.isValid()) @@ -305,17 +303,17 @@ void VPropertyModel::onDataChangedByModel(VProperty* property) } } -const VPropertySet *VPropertyModel::getPropertySet() const +const VPE::VPropertySet *VPE::VPropertyModel::getPropertySet() const { return d_ptr->Properties; } -void VPropertyModel::clear(bool emit_signals) +void VPE::VPropertyModel::clear(bool emit_signals) { setPropertySet(nullptr, emit_signals); } -VPropertySet *VPropertyModel::takePropertySet(VPropertySet *new_property_set, bool emit_signals) +VPE::VPropertySet *VPE::VPropertyModel::takePropertySet(VPropertySet *new_property_set, bool emit_signals) { VPropertySet* tmpOldPropertySet = d_ptr->Properties; @@ -332,13 +330,13 @@ VPropertySet *VPropertyModel::takePropertySet(VPropertySet *new_property_set, bo return tmpOldPropertySet; } -void VPropertyModel::setPropertySet(VPropertySet *property_set, bool emit_signals) +void VPE::VPropertyModel::setPropertySet(VPropertySet *property_set, bool emit_signals) { VPropertySet* tmpOldPropertySet = takePropertySet(property_set, emit_signals); delete tmpOldPropertySet; } -VProperty *VPropertyModel::takeProperty(const QString &id) +VPE::VProperty *VPE::VPropertyModel::takeProperty(const QString &id) { QModelIndex tmpIndex = getIndexFromProperty(getProperty(id)); if (d_ptr->Properties && tmpIndex.isValid()) @@ -352,7 +350,7 @@ VProperty *VPropertyModel::takeProperty(const QString &id) return nullptr; } -void VPropertyModel::removeProperty(const QString &id) +void VPE::VPropertyModel::removeProperty(const QString &id) { QModelIndex tmpIndex = getIndexFromProperty(getProperty(id)); if (d_ptr->Properties && tmpIndex.isValid()) diff --git a/src/libs/vpropertyexplorer/vpropertyset.cpp b/src/libs/vpropertyexplorer/vpropertyset.cpp index dd9503792..77775b855 100644 --- a/src/libs/vpropertyexplorer/vpropertyset.cpp +++ b/src/libs/vpropertyexplorer/vpropertyset.cpp @@ -25,19 +25,17 @@ #include #include -using namespace VPE; - #include "vproperty.h" #include "vpropertyset_p.h" -VPropertySet::VPropertySet() +VPE::VPropertySet::VPropertySet() : d_ptr(new VPropertySetPrivate()) { } -VPropertySet::~VPropertySet() +VPE::VPropertySet::~VPropertySet() { // Delete all the properties clear(true); @@ -45,7 +43,7 @@ VPropertySet::~VPropertySet() delete d_ptr; } -bool VPropertySet::addProperty(VProperty *property, const QString &id, const QString &parentid) +bool VPE::VPropertySet::addProperty(VProperty *property, const QString &id, const QString &parentid) { // Check if the property to add is not a null pointer if (!property) @@ -57,7 +55,7 @@ bool VPropertySet::addProperty(VProperty *property, const QString &id, const QSt return addProperty(property, id, tmpParent); } -bool VPropertySet::addProperty(VProperty *property, const QString &id, VProperty *parent_property) +bool VPE::VPropertySet::addProperty(VProperty *property, const QString &id, VProperty *parent_property) { // Check if the property to add is not a null pointer if (!property) @@ -92,7 +90,7 @@ bool VPropertySet::addProperty(VProperty *property, const QString &id, VProperty return true; } -bool VPropertySet::hasProperty(VProperty *property) const +bool VPE::VPropertySet::hasProperty(VProperty *property) const { if (!property) { @@ -102,12 +100,12 @@ bool VPropertySet::hasProperty(VProperty *property) const return hasProperty(property, NULL); } -VProperty *VPropertySet::getProperty(const QString &id) const +VPE::VProperty *VPE::VPropertySet::getProperty(const QString &id) const { return d_ptr->Properties.value(id, NULL); } -VProperty *VPropertySet::takeProperty(const QString &id) +VPE::VProperty *VPE::VPropertySet::takeProperty(const QString &id) { VProperty* tmpProp = getProperty(id); removeProperty(tmpProp, false); @@ -116,13 +114,13 @@ VProperty *VPropertySet::takeProperty(const QString &id) return tmpProp; } -void VPropertySet::removeProperty(const QString &id) +void VPE::VPropertySet::removeProperty(const QString &id) { VProperty* tmpProp = takeProperty(id); delete tmpProp; } -void VPropertySet::removeProperty(VProperty* prop, bool delete_property) +void VPE::VPropertySet::removeProperty(VProperty* prop, bool delete_property) { // Remove all the children removePropertyFromSet(prop); @@ -139,12 +137,12 @@ void VPropertySet::removeProperty(VProperty* prop, bool delete_property) } } -int VPropertySet::count() const +int VPE::VPropertySet::count() const { return d_ptr->Properties.count(); } -void VPropertySet::clear(bool delete_properties) +void VPE::VPropertySet::clear(bool delete_properties) { d_ptr->Properties.clear(); while (!d_ptr->RootProperties.isEmpty()) @@ -157,7 +155,7 @@ void VPropertySet::clear(bool delete_properties) } } -QString VPropertySet::getPropertyID(const VProperty *prop, bool look_for_parent_id) const +QString VPE::VPropertySet::getPropertyID(const VProperty *prop, bool look_for_parent_id) const { QString tmpResult; const VProperty* tmpCurrentProp = prop; @@ -185,27 +183,27 @@ QString VPropertySet::getPropertyID(const VProperty *prop, bool look_for_parent_ } // cppcheck-suppress unusedFunction -const QMap &VPropertySet::getPropertiesMap() const +const QMap &VPE::VPropertySet::getPropertiesMap() const { return d_ptr->Properties; } -const QList &VPropertySet::getRootProperties() const +const QList &VPE::VPropertySet::getRootProperties() const { return d_ptr->RootProperties; } -VProperty *VPropertySet::getRootProperty(int row) const +VPE::VProperty *VPE::VPropertySet::getRootProperty(int row) const { return d_ptr->RootProperties.value(row, NULL); } -int VPropertySet::getRootPropertyCount() const +int VPE::VPropertySet::getRootPropertyCount() const { return d_ptr->RootProperties.count(); } -VPropertySet* VPropertySet::clone() const +VPE::VPropertySet* VPE::VPropertySet::clone() const { VPropertySet* tmpResult = new VPropertySet(); @@ -216,7 +214,7 @@ VPropertySet* VPropertySet::clone() const return tmpResult; } -bool VPropertySet::hasProperty(VProperty *property, VProperty *parent) const +bool VPE::VPropertySet::hasProperty(VProperty *property, VProperty *parent) const { if (!property) { @@ -239,8 +237,8 @@ bool VPropertySet::hasProperty(VProperty *property, VProperty *parent) const return false; } -void VPropertySet::cloneProperty(VProperty* property_to_clone, VProperty *parent_property, - VPropertySet *output_set) const +void VPE::VPropertySet::cloneProperty(VProperty* property_to_clone, VProperty *parent_property, + VPropertySet *output_set) const { if (!output_set || !property_to_clone || !hasProperty(property_to_clone)) { @@ -259,7 +257,7 @@ void VPropertySet::cloneProperty(VProperty* property_to_clone, VProperty *parent } } -void VPropertySet::removePropertyFromSet(VProperty *prop) +void VPE::VPropertySet::removePropertyFromSet(VProperty *prop) { // Remove all the children foreach(VProperty* tmpChild, prop->getChildren()) diff --git a/src/libs/vpropertyexplorer/vpropertytreeview.cpp b/src/libs/vpropertyexplorer/vpropertytreeview.cpp index 761dfdbd8..fbf38a1ea 100644 --- a/src/libs/vpropertyexplorer/vpropertytreeview.cpp +++ b/src/libs/vpropertyexplorer/vpropertytreeview.cpp @@ -29,15 +29,13 @@ class QWidget; -using namespace VPE; - -VPropertyTreeView::VPropertyTreeView(QWidget *parent) +VPE::VPropertyTreeView::VPropertyTreeView(QWidget *parent) : QTreeView(parent), d_ptr(new VPropertyTreeViewPrivate()) { init(); } -VPropertyTreeView::VPropertyTreeView(VPropertyModel *model, QWidget *parent) +VPE::VPropertyTreeView::VPropertyTreeView(VPropertyModel *model, QWidget *parent) : QTreeView(parent), d_ptr(new VPropertyTreeViewPrivate()) { init(); @@ -48,7 +46,7 @@ VPropertyTreeView::VPropertyTreeView(VPropertyModel *model, QWidget *parent) } } -VPropertyTreeView::VPropertyTreeView(VPropertyTreeViewPrivate *d, bool init_, QWidget *parent) +VPE::VPropertyTreeView::VPropertyTreeView(VPropertyTreeViewPrivate *d, bool init_, QWidget *parent) : QTreeView(parent), d_ptr(d) { if (init_) @@ -57,18 +55,18 @@ VPropertyTreeView::VPropertyTreeView(VPropertyTreeViewPrivate *d, bool init_, QW } } -VPropertyTreeView::~VPropertyTreeView() +VPE::VPropertyTreeView::~VPropertyTreeView() { delete d_ptr; } -void VPropertyTreeView::setRowHeight(int height, bool add_to_standard) +void VPE::VPropertyTreeView::setRowHeight(int height, bool add_to_standard) { d_ptr->PropertyDelegate->setRowHeight(height, add_to_standard); } -void VPropertyTreeView::init() +void VPE::VPropertyTreeView::init() { setAlternatingRowColors(true); setUniformRowHeights(true); diff --git a/src/libs/vpropertyexplorer/vserializedproperty.cpp b/src/libs/vpropertyexplorer/vserializedproperty.cpp index 2afd6e729..d94e8eea0 100644 --- a/src/libs/vpropertyexplorer/vserializedproperty.cpp +++ b/src/libs/vpropertyexplorer/vserializedproperty.cpp @@ -26,16 +26,14 @@ #include "vproperty.h" #include "vpropertyset.h" -using namespace VPE; - -VSerializedProperty::VSerializedProperty() +VPE::VSerializedProperty::VSerializedProperty() : ID(), Type(), Value(), Children() {} /*! Creates a new VSerializedProperty from an existing property */ -VSerializedProperty::VSerializedProperty(const VProperty* property, const VPropertySet* set) +VPE::VSerializedProperty::VSerializedProperty(const VProperty* property, const VPropertySet* set) : ID(), Type(property ? property->type() : QString()), Value(property ? property->getValue() : QVariant()), Children() { @@ -47,19 +45,19 @@ VSerializedProperty::VSerializedProperty(const VProperty* property, const VPrope } } -VSerializedProperty::VSerializedProperty(const VProperty *property, const QString &id, const VPropertySet *set) +VPE::VSerializedProperty::VSerializedProperty(const VProperty *property, const QString &id, const VPropertySet *set) : ID(id), Type(property ? property->type() : QString()), Value(property ? property->getValue() : QVariant()), Children() { initChildren(property, set); } -VSerializedProperty::VSerializedProperty(const QString &id, const QString &type, const QVariant &value) +VPE::VSerializedProperty::VSerializedProperty(const QString &id, const QString &type, const QVariant &value) : ID(id), Type(type), Value(value), Children() { } -void VSerializedProperty::initChildren(const VProperty *property, const VPropertySet *set) +void VPE::VSerializedProperty::initChildren(const VProperty *property, const VPropertySet *set) { if (property && set) { diff --git a/src/libs/vpropertyexplorer/vstandardpropertyfactory.cpp b/src/libs/vpropertyexplorer/vstandardpropertyfactory.cpp index cdb143368..fa6d4dc42 100644 --- a/src/libs/vpropertyexplorer/vstandardpropertyfactory.cpp +++ b/src/libs/vpropertyexplorer/vstandardpropertyfactory.cpp @@ -31,15 +31,12 @@ #include "plugins/vshortcutproperty.h" #include "vpropertyfactorymanager.h" - -using namespace VPE; - -VStandardPropertyFactory::VStandardPropertyFactory() +VPE::VStandardPropertyFactory::VStandardPropertyFactory() : VAbstractPropertyFactory() { } -VStandardPropertyFactory::VStandardPropertyFactory(VPropertyFactoryManager *manager) +VPE::VStandardPropertyFactory::VStandardPropertyFactory(VPropertyFactoryManager *manager) : VAbstractPropertyFactory() { if (manager) @@ -57,7 +54,7 @@ VStandardPropertyFactory::VStandardPropertyFactory(VPropertyFactoryManager *mana } } -VProperty *VStandardPropertyFactory::createProperty(const QString &type, const QString &name) +VPE::VProperty *VPE::VStandardPropertyFactory::createProperty(const QString &type, const QString &name) { if (type == QString("string")) { diff --git a/src/test/ParserTest/main.cpp b/src/test/ParserTest/main.cpp index 05e562d5c..a3c1b76a7 100644 --- a/src/test/ParserTest/main.cpp +++ b/src/test/ParserTest/main.cpp @@ -31,9 +31,6 @@ #include #include "../qmuparser/qmuparsertest.h" -using namespace qmu; -using namespace Test; - //--------------------------------------------------------------------------------------------------------------------- void testMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) { @@ -64,7 +61,7 @@ int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); qInstallMessageHandler(testMessageOutput); - QmuParserTester pt; + qmu::Test::QmuParserTester pt; QTimer::singleShot(0, &pt, SLOT(Run())); return a.exec(); } From a2cfecd2f12337c7bce35939bdaaba30e74570fd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 14:20:42 +0200 Subject: [PATCH 07/26] Cppcheck warning. --HG-- branch : develop --- src/libs/vpropertyexplorer/vpropertyset.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/libs/vpropertyexplorer/vpropertyset.cpp b/src/libs/vpropertyexplorer/vpropertyset.cpp index 77775b855..1f077dfba 100644 --- a/src/libs/vpropertyexplorer/vpropertyset.cpp +++ b/src/libs/vpropertyexplorer/vpropertyset.cpp @@ -126,14 +126,11 @@ void VPE::VPropertySet::removeProperty(VProperty* prop, bool delete_property) removePropertyFromSet(prop); // Remove from parent and optionally delete - if (prop) - { - prop->setParent(NULL); + prop->setParent(NULL); - if (delete_property) - { - delete prop; - } + if (delete_property) + { + delete prop; } } From ffc1bae39c02c06460ae1a180300cb8e1c4b6125 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 15:22:44 +0200 Subject: [PATCH 08/26] Remove redundant declaration. --HG-- branch : develop --- src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.h b/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.h index 55fe206b5..eed1af012 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.h +++ b/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.h @@ -40,8 +40,6 @@ #include "../vmisc/def.h" #include "vabstractnode.h" -class VContainer; - class VNodeEllipticalArc :public VAbstractNode { Q_OBJECT From 4cf9c59056358d534561e2b22e872e5148eea464 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 17:19:12 +0200 Subject: [PATCH 09/26] Remove redundant check. --HG-- branch : develop --- src/app/valentina/core/vapplication.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index 31e54bbf2..99bd9d202 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -637,18 +637,15 @@ bool VApplication::event(QEvent *e) case QEvent::FileOpen: { QFileOpenEvent *fileOpenEvent = static_cast(e); - if(fileOpenEvent) + const QString macFileOpen = fileOpenEvent->file(); + if(not macFileOpen.isEmpty()) { - const QString macFileOpen = fileOpenEvent->file(); - if(not macFileOpen.isEmpty()) + MainWindow *window = qobject_cast(mainWindow); + if (window) { - MainWindow *window = qobject_cast(mainWindow); - if (window) - { - window->LoadPattern(macFileOpen); // open file in existing window - } - return true; + window->LoadPattern(macFileOpen); // open file in existing window } + return true; } break; } From 36c8e96babf7746606f80c1c58513a98b67bb0eb Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 17:30:40 +0200 Subject: [PATCH 10/26] Disable MSVC security warnings for library vdxf. --HG-- branch : develop --- src/libs/vdxf/stable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/vdxf/stable.h b/src/libs/vdxf/stable.h index 87d25b41e..f5ea1e47b 100644 --- a/src/libs/vdxf/stable.h +++ b/src/libs/vdxf/stable.h @@ -32,6 +32,8 @@ /* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ #pragma message("Compiling precompiled headers for VDxf library.\n") +#define _CRT_SECURE_NO_WARNINGS + /* Add C includes here */ #if defined __cplusplus From 5c40a913358946040cd72e2b64c5da01c77cec0d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 17:36:38 +0200 Subject: [PATCH 11/26] Remove empty statement. --HG-- branch : develop --- src/libs/vmisc/vabstractapplication.cpp | 2 +- src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp | 2 +- .../toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp | 2 +- src/libs/vtools/tools/vdatatool.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index b2a43ad27..076c96b3f 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -290,7 +290,7 @@ VCommonSettings *VAbstractApplication::Settings() //--------------------------------------------------------------------------------------------------------------------- QGraphicsScene *VAbstractApplication::getCurrentScene() const { - SCASSERT(currentScene != nullptr); + SCASSERT(currentScene != nullptr) return currentScene; } diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp index 79eb1fb0b..7324ea684 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp @@ -120,7 +120,7 @@ void DialogFlippingByLine::SetSecondLinePointId(quint32 value) { ChangeCurrentData(ui->comboBoxSecondLinePoint, value); VisToolFlippingByLine *operation = qobject_cast(vis); - SCASSERT(operation != nullptr); + SCASSERT(operation != nullptr) operation->SetSecondLinePointId(value); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp index 6fb21587a..958a80fa1 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp @@ -206,7 +206,7 @@ void VToolAlongLine::ShowVisualization(bool show) */ void VToolAlongLine::setDialog() { - SCASSERT(dialog != nullptr); + SCASSERT(dialog != nullptr) DialogAlongLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); diff --git a/src/libs/vtools/tools/vdatatool.cpp b/src/libs/vtools/tools/vdatatool.cpp index 3d67c61ef..3c3227ea5 100644 --- a/src/libs/vtools/tools/vdatatool.cpp +++ b/src/libs/vtools/tools/vdatatool.cpp @@ -41,7 +41,7 @@ Q_LOGGING_CATEGORY(vTool, "v.tool") VDataTool::VDataTool(VContainer *data, QObject *parent) : QObject(parent), data(*data), _referens(1) { - SCASSERT(data != nullptr); + SCASSERT(data != nullptr) } //--------------------------------------------------------------------------------------------------------------------- From 7551cfda8747b7390819276356d02b4aad9fefd4 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 17:38:27 +0200 Subject: [PATCH 12/26] Remove the code after "return". --HG-- branch : develop --- src/app/valentina/dialogs/dialogpatternxmledit.cpp | 2 +- src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/valentina/dialogs/dialogpatternxmledit.cpp b/src/app/valentina/dialogs/dialogpatternxmledit.cpp index 5defcf7ec..f028fd1f8 100644 --- a/src/app/valentina/dialogs/dialogpatternxmledit.cpp +++ b/src/app/valentina/dialogs/dialogpatternxmledit.cpp @@ -1006,7 +1006,7 @@ void DialogPatternXmlEdit::ElementClicked ( const QModelIndex & index ) } if (item2->GetelementType() == VXMLTreeElement::TypeRoot) { - ui->label_type_value->setText(tr("Root node"));; + ui->label_type_value->setText(tr("Root node")); ui->pushButton_Add_son->setEnabled(true); } else if (item2->GetelementType() == VXMLTreeElement::TypeNode) diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp index 9d684c2be..e6112dd0b 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp @@ -347,7 +347,7 @@ quint32 DialogPointOfContact::getCenter() const */ quint32 DialogPointOfContact::GetFirstPoint() const { - return getCurrentObjectId(ui->comboBoxFirstPoint);; + return getCurrentObjectId(ui->comboBoxFirstPoint); } //--------------------------------------------------------------------------------------------------------------------- From f3b900902bac92c2ab6d6b03181dfa18ee31f343 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 17:47:07 +0200 Subject: [PATCH 13/26] Fix memory leak. --HG-- branch : develop --- src/app/valentina/dialogs/vwidgetgroups.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/valentina/dialogs/vwidgetgroups.cpp b/src/app/valentina/dialogs/vwidgetgroups.cpp index d43386411..9b8d77a1c 100644 --- a/src/app/valentina/dialogs/vwidgetgroups.cpp +++ b/src/app/valentina/dialogs/vwidgetgroups.cpp @@ -103,7 +103,7 @@ void VWidgetGroups::CtxMenu(const QPoint &pos) item = ui->tableWidget->item(row, 0); const quint32 id = item->data(Qt::UserRole).toUInt(); - QMenu *menu = new QMenu; + QMenu *menu = new QMenu(this); QAction *actionRename = menu->addAction(tr("Rename")); QAction *actionDelete = menu->addAction(tr("Delete")); QAction *selectedAction = menu->exec(ui->tableWidget->viewport()->mapToGlobal(pos)); From 074620fe77ff7161a0098fe96afa2c2f63eec58c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 17:56:52 +0200 Subject: [PATCH 14/26] Refactor to avoid "break" after "return". --HG-- branch : develop --- src/libs/fervor/fvupdater.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libs/fervor/fvupdater.cpp b/src/libs/fervor/fvupdater.cpp index cc9211c55..33ad88f84 100644 --- a/src/libs/fervor/fvupdater.cpp +++ b/src/libs/fervor/fvupdater.cpp @@ -555,18 +555,21 @@ bool FvUpdater::CurrentlyRunningOnPlatform(const QString &platform) case 0: // Q_OS_LINUX #ifdef Q_OS_LINUX // Defined on Linux. return true; +#else + return false; #endif - break; case 1: // Q_OS_MAC #ifdef Q_OS_MAC // Defined on MAC OS (synonym for Darwin). return true; +#else + return false; #endif - break; case 2: // Q_OS_WIN32 #ifdef Q_OS_WIN32 // Defined on all supported versions of Windows. return true; +#else + return false; #endif - break; default: break; } From d10026bd9da1a00d3244e061e691adbba55abeed Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 17:58:18 +0200 Subject: [PATCH 15/26] Remove empty statement. --HG-- branch : develop --- src/app/tape/main.cpp | 2 +- src/app/valentina/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tape/main.cpp b/src/app/tape/main.cpp index 81574be0a..b5ed4d63d 100644 --- a/src/app/tape/main.cpp +++ b/src/app/tape/main.cpp @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(schema); Q_INIT_RESOURCE(flags); - QT_REQUIRE_VERSION(argc, argv, "5.0.0"); + QT_REQUIRE_VERSION(argc, argv, "5.0.0") qt_qhash_seed.store(0); // Lock producing random attribute order in XML diff --git a/src/app/valentina/main.cpp b/src/app/valentina/main.cpp index 60348d25f..275dae711 100644 --- a/src/app/valentina/main.cpp +++ b/src/app/valentina/main.cpp @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(icons); Q_INIT_RESOURCE(toolicon); - QT_REQUIRE_VERSION(argc, argv, "5.0.0"); + QT_REQUIRE_VERSION(argc, argv, "5.0.0") qt_qhash_seed.store(0); // Lock producing random attribute order in XML From 7b76dbe99d9681287e59a75071f759f771f3f6bb Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 18:00:56 +0200 Subject: [PATCH 16/26] Remove redundant check. --HG-- branch : develop --- src/app/tape/mapplication.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index 78ec2335b..90a9f1ec0 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -436,18 +436,15 @@ bool MApplication::event(QEvent *e) case QEvent::FileOpen: { QFileOpenEvent *fileOpenEvent = static_cast(e); - if(fileOpenEvent) + const QString macFileOpen = fileOpenEvent->file(); + if(not macFileOpen.isEmpty()) { - const QString macFileOpen = fileOpenEvent->file(); - if(not macFileOpen.isEmpty()) + TMainWindow *mw = MainWindow(); + if (mw) { - TMainWindow *mw = MainWindow(); - if (mw) - { - mw->LoadFile(macFileOpen); // open file in existing window - } - return true; + mw->LoadFile(macFileOpen); // open file in existing window } + return true; } break; } From 6fe96ca4d06e747374545ef2a57c697e106c9414 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 18:12:49 +0200 Subject: [PATCH 17/26] Remove empty statement. --HG-- branch : develop --- src/libs/vmisc/qxtcsvmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/vmisc/qxtcsvmodel.cpp b/src/libs/vmisc/qxtcsvmodel.cpp index ac7b12061..1135e7b1e 100644 --- a/src/libs/vmisc/qxtcsvmodel.cpp +++ b/src/libs/vmisc/qxtcsvmodel.cpp @@ -72,7 +72,7 @@ QT_WARNING_DISABLE_GCC("-Weffc++") */ QxtCsvModel::QxtCsvModel(QObject *parent) : QAbstractTableModel(parent) { - QXT_INIT_PRIVATE(QxtCsvModel); + QXT_INIT_PRIVATE(QxtCsvModel) } /*! @@ -86,7 +86,7 @@ QxtCsvModel::QxtCsvModel(QObject *parent) : QAbstractTableModel(parent) QxtCsvModel::QxtCsvModel(QIODevice *file, QObject *parent, bool withHeader, QChar separator) : QAbstractTableModel(parent) { - QXT_INIT_PRIVATE(QxtCsvModel); + QXT_INIT_PRIVATE(QxtCsvModel) setSource(file, withHeader, separator); } @@ -103,7 +103,7 @@ QxtCsvModel::QxtCsvModel(QIODevice *file, QObject *parent, bool withHeader, QCha QxtCsvModel::QxtCsvModel(const QString &filename, QObject *parent, bool withHeader, QChar separator) : QAbstractTableModel(parent) { - QXT_INIT_PRIVATE(QxtCsvModel); + QXT_INIT_PRIVATE(QxtCsvModel) QFile src(filename); setSource(&src, withHeader, separator); } From d247823d2223fe8870d01f1bc542aac74eda3f3a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 19:07:57 +0200 Subject: [PATCH 18/26] Refactoring. Merge similar switch cases together. --HG-- branch : develop --- .../core/vtooloptionspropertybrowser.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp index 2703d6644..b4426a712 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp +++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp @@ -153,10 +153,9 @@ void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item) ShowOptionsToolTriangle(item); break; case VGraphicsSimpleTextItem::Type: - currentItem = item->parentItem(); - ShowItemOptions(currentItem); - break; case VControlPointSpline::Type: + case VSimplePoint::Type: + case VSimpleCurve::Type: currentItem = item->parentItem(); ShowItemOptions(currentItem); break; @@ -172,14 +171,6 @@ void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item) case VToolPointFromArcAndTangent::Type: ShowOptionsToolPointFromArcAndTangent(item); break; - case VSimplePoint::Type: - currentItem = item->parentItem(); - ShowItemOptions(currentItem); - break; - case VSimpleCurve::Type: - currentItem = item->parentItem(); - ShowItemOptions(currentItem); - break; case VToolTrueDarts::Type: ShowOptionsToolTrueDarts(item); break; @@ -289,8 +280,6 @@ void VToolOptionsPropertyBrowser::UpdateOptions() UpdateOptionsToolTriangle(); break; case VGraphicsSimpleTextItem::Type: - ShowItemOptions(currentItem->parentItem()); - break; case VControlPointSpline::Type: ShowItemOptions(currentItem->parentItem()); break; From e4c90a0809ee4b751e0de72474f8a9a80d043bfa Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 20:08:02 +0200 Subject: [PATCH 19/26] Fix warning "Explicitly capture the required scope variables". --HG-- branch : develop --- src/app/tape/tmainwindow.cpp | 6 +++--- src/app/valentina/dialogs/dialogincrements.cpp | 6 +++--- src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp | 2 +- src/libs/vtools/tools/vabstracttool.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 532cb0834..31a4693ad 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1969,9 +1969,9 @@ void TMainWindow::InitWindow() connect(ui->comboBoxPMSystem, static_cast(&QComboBox::currentIndexChanged), this, &TMainWindow::SavePMSystem); - connect(ui->lineEditFind, &QLineEdit::textChanged, [=] (const QString &term){search->Find(term);}); - connect(ui->toolButtonFindPrevious, &QToolButton::clicked, [=] (){search->FindPrevious();}); - connect(ui->toolButtonFindNext, &QToolButton::clicked, [=] (){search->FindNext();}); + connect(ui->lineEditFind, &QLineEdit::textChanged, [this] (const QString &term){search->Find(term);}); + connect(ui->toolButtonFindPrevious, &QToolButton::clicked, [this] (){search->FindPrevious();}); + connect(ui->toolButtonFindNext, &QToolButton::clicked, [this] (){search->FindNext();}); connect(search.data(), &VTableSearch::HasResult, [this] (bool state) { diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index 2894f4d65..978d06108 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -110,9 +110,9 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par connect(ui->lineEditName, &QLineEdit::editingFinished, this, &DialogIncrements::SaveIncrName); connect(ui->plainTextEditDescription, &QPlainTextEdit::textChanged, this, &DialogIncrements::SaveIncrDescription); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogIncrements::SaveIncrFormula); - connect(ui->lineEditFind, &QLineEdit::textEdited, [=](const QString &term){search->Find(term);}); - connect(ui->toolButtonFindPrevious, &QToolButton::clicked, [=](){search->FindPrevious();}); - connect(ui->toolButtonFindNext, &QToolButton::clicked, [=](){search->FindNext();}); + connect(ui->lineEditFind, &QLineEdit::textEdited, [this](const QString &term){search->Find(term);}); + connect(ui->toolButtonFindPrevious, &QToolButton::clicked, [this](){search->FindPrevious();}); + connect(ui->toolButtonFindNext, &QToolButton::clicked, [this](){search->FindNext();}); connect(search.data(), &VTableSearch::HasResult, [this] (bool state) { diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index f00a16936..681edd61e 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -404,7 +404,7 @@ void DialogEditWrongFormula::InitVariables() Measurements(); // clear text filter every time when new radio button selected - auto ClearFilterFormulaInputs = [=] () { ui->filterFormulaInputs->clear(); }; + auto ClearFilterFormulaInputs = [this] () { ui->filterFormulaInputs->clear(); }; connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogEditWrongFormula::Measurements); connect(ui->radioButtonStandardTable, &QRadioButton::clicked, ClearFilterFormulaInputs); diff --git a/src/libs/vtools/tools/vabstracttool.h b/src/libs/vtools/tools/vabstracttool.h index b445c9ff9..5c8b22102 100644 --- a/src/libs/vtools/tools/vabstracttool.h +++ b/src/libs/vtools/tools/vabstracttool.h @@ -182,7 +182,7 @@ inline void VAbstractTool::AddVisualization() connect(scene, &VMainGraphicsScene::NewFactor, visual, &Visualization::SetFactor); scene->addItem(visual); - connect(visual, &Visualization::ToolTip, [=] (const QString &toolTip) {emit ToolTip(toolTip);}); + connect(visual, &Visualization::ToolTip, [this] (const QString &toolTip) {emit ToolTip(toolTip);}); vis = visual; } From 731eb9ec89436c06a7ef7c2c462ad73e8961a0bb Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 20:45:14 +0200 Subject: [PATCH 20/26] Refactoring. There is no automatic disconnection when the 'receiver' is destroyed because it's a functor with no QObject. However, since 5.2 there is an overload which adds a "context object". When that object is destroyed, the connection is broken (the context is also used for the thread affinity: the lambda will be called in the thread of the event loop of the object used as context). --HG-- branch : develop --- .../configpages/tapeconfigurationpage.cpp | 8 +-- src/app/tape/dialogs/dialogabouttape.cpp | 5 +- src/app/tape/dialogs/dialogexporttocsv.cpp | 2 +- src/app/tape/dialogs/tapeconfigdialog.cpp | 2 +- src/app/tape/tmainwindow.cpp | 16 ++++-- src/app/valentina/dialogs/configdialog.cpp | 2 +- .../dialogs/configpages/pathpage.cpp | 2 +- src/app/valentina/dialogs/dialogaboutapp.cpp | 2 +- src/app/valentina/dialogs/dialoghistory.cpp | 5 +- .../valentina/dialogs/dialogincrements.cpp | 10 ++-- .../dialogs/dialoglayoutprogress.cpp | 5 +- .../dialogs/dialogpatternproperties.cpp | 22 ++++---- .../valentina/dialogs/dialogsavelayout.cpp | 7 +-- src/app/valentina/mainwindow.cpp | 50 +++++++++---------- src/libs/fervor/fvupdater.cpp | 4 +- src/libs/vmisc/def.h | 11 ++++ src/libs/vmisc/vabstractapplication.cpp | 2 +- .../support/dialogeditwrongformula.cpp | 18 +++---- .../vtools/dialogs/support/dialogundo.cpp | 4 +- .../operation/vabstractoperation.cpp | 15 +++--- .../vtools/tools/nodeDetails/vnodepoint.cpp | 4 +- 21 files changed, 112 insertions(+), 84 deletions(-) diff --git a/src/app/tape/dialogs/configpages/tapeconfigurationpage.cpp b/src/app/tape/dialogs/configpages/tapeconfigurationpage.cpp index 4a2217602..922a5dfea 100644 --- a/src/app/tape/dialogs/configpages/tapeconfigurationpage.cpp +++ b/src/app/tape/dialogs/configpages/tapeconfigurationpage.cpp @@ -181,7 +181,7 @@ QGroupBox *TapeConfigurationPage::LangGroup() { langCombo->setCurrentIndex(index); } - connect(langCombo, static_cast(&QComboBox::currentIndexChanged), [this]() + connect(langCombo, static_cast(&QComboBox::currentIndexChanged), RECEIVER(this)[this]() { langChanged = true; }); @@ -231,7 +231,7 @@ QGroupBox *TapeConfigurationPage::PMSystemGroup() pmSystemLayout->addRow(systemBookLabel, systemBookValueLabel); - connect(systemCombo, static_cast(&QComboBox::currentIndexChanged), [this]() + connect(systemCombo, static_cast(&QComboBox::currentIndexChanged), RECEIVER(this)[this]() { systemChanged = true; #if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) @@ -285,7 +285,7 @@ QGroupBox *TapeConfigurationPage::GradationGroup() defGradationChanged = true; }; - connect(defHeightCombo, static_cast(&QComboBox::currentIndexChanged), + connect(defHeightCombo, static_cast(&QComboBox::currentIndexChanged), RECEIVER(this) DefGradationChanged); gradationLayout->addRow(defHeightLabel, defHeightCombo); @@ -298,7 +298,7 @@ QGroupBox *TapeConfigurationPage::GradationGroup() { defSizeCombo->setCurrentIndex(index); } - connect(defHeightCombo, static_cast(&QComboBox::currentIndexChanged), + connect(defHeightCombo, static_cast(&QComboBox::currentIndexChanged), RECEIVER(this) DefGradationChanged); gradationLayout->addRow(defSizeLabel, defSizeCombo); diff --git a/src/app/tape/dialogs/dialogabouttape.cpp b/src/app/tape/dialogs/dialogabouttape.cpp index 6bcc8e0b9..e2d5c6ef6 100644 --- a/src/app/tape/dialogs/dialogabouttape.cpp +++ b/src/app/tape/dialogs/dialogabouttape.cpp @@ -50,7 +50,7 @@ DialogAboutTape::DialogAboutTape(QWidget *parent) //mApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c()); RetranslateUi(); - connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]() + connect(ui->pushButton_Web_Site, &QPushButton::clicked, RECEIVER(this)[this]() { if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false) { @@ -58,7 +58,8 @@ DialogAboutTape::DialogAboutTape(QWidget *parent) } }); connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &DialogAboutTape::close); - connect(ui->pushButtonCheckUpdate, &QPushButton::clicked, [](){ + connect(ui->pushButtonCheckUpdate, &QPushButton::clicked, []() + { FvUpdater::sharedUpdater()->CheckForUpdatesNotSilent(); }); diff --git a/src/app/tape/dialogs/dialogexporttocsv.cpp b/src/app/tape/dialogs/dialogexporttocsv.cpp index e0e2024b0..8164a437b 100644 --- a/src/app/tape/dialogs/dialogexporttocsv.cpp +++ b/src/app/tape/dialogs/dialogexporttocsv.cpp @@ -57,7 +57,7 @@ DialogExportToCSV::DialogExportToCSV(QWidget *parent) QPushButton *bDefaults = ui->buttonBox->button(QDialogButtonBox::RestoreDefaults); SCASSERT(bDefaults != nullptr) - connect(bDefaults, &QPushButton::clicked, [this]() + connect(bDefaults, &QPushButton::clicked, RECEIVER(this)[this]() { ui->checkBoxWithHeader->setChecked(qApp->TapeSettings()->GetDefCSVWithHeader()); ui->comboBoxCodec->setCurrentIndex(ui->comboBoxCodec->findData(qApp->TapeSettings()->GetDefCSVCodec())); diff --git a/src/app/tape/dialogs/tapeconfigdialog.cpp b/src/app/tape/dialogs/tapeconfigdialog.cpp index fc8eb4fe1..8c2b4a00c 100644 --- a/src/app/tape/dialogs/tapeconfigdialog.cpp +++ b/src/app/tape/dialogs/tapeconfigdialog.cpp @@ -71,7 +71,7 @@ TapeConfigDialog::TapeConfigDialog(QWidget *parent) createIcons(); connect(contentsWidget, &QListWidget::currentItemChanged, - [this](QListWidgetItem *current, QListWidgetItem *previous) + RECEIVER(this)[this](QListWidgetItem *current, QListWidgetItem *previous) { if (current == nullptr) { diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 31a4693ad..ce6537d23 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1787,7 +1787,7 @@ void TMainWindow::SetupMenu() { QAction *action = new QAction(this); recentFileActs[i] = action; - connect(action, &QAction::triggered, [action, this]() + connect(action, &QAction::triggered, RECEIVER(this)[action, this]() { if (action != nullptr) { @@ -1828,8 +1828,11 @@ void TMainWindow::SetupMenu() AboutToShowWindowMenu(); // Help - connect(ui->actionAboutQt, &QAction::triggered, [this](){QMessageBox::aboutQt(this, tr("About Qt"));}); - connect(ui->actionAboutTape, &QAction::triggered, [this]() + connect(ui->actionAboutQt, &QAction::triggered, RECEIVER(this)[this]() + { + QMessageBox::aboutQt(this, tr("About Qt")); + }); + connect(ui->actionAboutTape, &QAction::triggered, RECEIVER(this)[this]() { DialogAboutTape *aboutDialog = new DialogAboutTape(this); aboutDialog->setAttribute(Qt::WA_DeleteOnClose, true); @@ -2007,7 +2010,10 @@ void TMainWindow::InitWindow() connect(ui->plainTextEditDescription, &QPlainTextEdit::textChanged, this, &TMainWindow::SaveMDescription); connect(ui->lineEditFullName, &QLineEdit::textEdited, this, &TMainWindow::SaveMFullName); - connect(ui->pushButtonShowInExplorer, &QPushButton::clicked, [this](){ShowInGraphicalShell(curFile);}); + connect(ui->pushButtonShowInExplorer, &QPushButton::clicked, RECEIVER(this)[this]() + { + ShowInGraphicalShell(curFile); + }); InitUnits(); @@ -2822,7 +2828,7 @@ void TMainWindow::CreateWindowMenu(QMenu *menu) SCASSERT(menu != nullptr) QAction *action = menu->addAction(tr("&New Window")); - connect(action, &QAction::triggered, [this]() + connect(action, &QAction::triggered, RECEIVER(this)[this]() { qApp->NewMainWindow(); qApp->MainWindow()->activateWindow(); diff --git a/src/app/valentina/dialogs/configdialog.cpp b/src/app/valentina/dialogs/configdialog.cpp index fea931e05..35320e738 100644 --- a/src/app/valentina/dialogs/configdialog.cpp +++ b/src/app/valentina/dialogs/configdialog.cpp @@ -168,7 +168,7 @@ void ConfigDialog::createIcons() createIcon("://icon/path_config.png", tr("Paths")); connect(contentsWidget, &QListWidget::currentItemChanged, - [this](QListWidgetItem *current, QListWidgetItem *previous) + RECEIVER(this)[this](QListWidgetItem *current, QListWidgetItem *previous) { if (current == nullptr) { diff --git a/src/app/valentina/dialogs/configpages/pathpage.cpp b/src/app/valentina/dialogs/configpages/pathpage.cpp index 9c9dd34e1..21d74962a 100644 --- a/src/app/valentina/dialogs/configpages/pathpage.cpp +++ b/src/app/valentina/dialogs/configpages/pathpage.cpp @@ -233,7 +233,7 @@ void PathPage::InitTable() pathTable->resizeRowsToContents(); pathTable->horizontalHeader()->setStretchLastSection(true); - connect(pathTable, &QTableWidget::itemSelectionChanged, [this]() + connect(pathTable, &QTableWidget::itemSelectionChanged, RECEIVER(this)[this]() { defaultButton->setEnabled(true); defaultButton->setDefault(false); diff --git a/src/app/valentina/dialogs/dialogaboutapp.cpp b/src/app/valentina/dialogs/dialogaboutapp.cpp index 987065a9b..d779f4a01 100644 --- a/src/app/valentina/dialogs/dialogaboutapp.cpp +++ b/src/app/valentina/dialogs/dialogaboutapp.cpp @@ -61,7 +61,7 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) : ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR)); - connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]() + connect(ui->pushButton_Web_Site, &QPushButton::clicked, RECEIVER(this)[this]() { if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false) { diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index f2ff02db3..2db9a48c4 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -62,7 +62,10 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent) FillTable(); InitialTable(); connect(ui->tableWidget, &QTableWidget::cellClicked, this, &DialogHistory::cellClicked); - connect(this, &DialogHistory::ShowHistoryTool, [doc](quint32 id, bool enable){emit doc->ShowTool(id, enable);}); + connect(this, &DialogHistory::ShowHistoryTool, RECEIVER(doc)[doc](quint32 id, bool enable) + { + emit doc->ShowTool(id, enable); + }); connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor); connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory); ShowPoint(); diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index 978d06108..3c440c09b 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -110,15 +110,15 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par connect(ui->lineEditName, &QLineEdit::editingFinished, this, &DialogIncrements::SaveIncrName); connect(ui->plainTextEditDescription, &QPlainTextEdit::textChanged, this, &DialogIncrements::SaveIncrDescription); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogIncrements::SaveIncrFormula); - connect(ui->lineEditFind, &QLineEdit::textEdited, [this](const QString &term){search->Find(term);}); - connect(ui->toolButtonFindPrevious, &QToolButton::clicked, [this](){search->FindPrevious();}); - connect(ui->toolButtonFindNext, &QToolButton::clicked, [this](){search->FindNext();}); + connect(ui->lineEditFind, &QLineEdit::textEdited, RECEIVER(this)[this](const QString &term){search->Find(term);}); + connect(ui->toolButtonFindPrevious, &QToolButton::clicked, RECEIVER(this)[this](){search->FindPrevious();}); + connect(ui->toolButtonFindNext, &QToolButton::clicked, RECEIVER(this)[this](){search->FindNext();}); - connect(search.data(), &VTableSearch::HasResult, [this] (bool state) + connect(search.data(), &VTableSearch::HasResult, RECEIVER(this)[this] (bool state) { ui->toolButtonFindPrevious->setEnabled(state); }); - connect(search.data(), &VTableSearch::HasResult, [this] (bool state) + connect(search.data(), &VTableSearch::HasResult, RECEIVER(this)[this] (bool state) { ui->toolButtonFindNext->setEnabled(state); }); diff --git a/src/app/valentina/dialogs/dialoglayoutprogress.cpp b/src/app/valentina/dialogs/dialoglayoutprogress.cpp index b22d0b0de..fa98be00d 100644 --- a/src/app/valentina/dialogs/dialoglayoutprogress.cpp +++ b/src/app/valentina/dialogs/dialoglayoutprogress.cpp @@ -55,7 +55,7 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel); SCASSERT(bCancel != nullptr) - connect(bCancel, &QPushButton::clicked, [this](){emit Abort();}); + connect(bCancel, &QPushButton::clicked, RECEIVER(this)[this](){emit Abort();}); setModal(true); this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint); @@ -91,11 +91,10 @@ void DialogLayoutProgress::Error(const LayoutErrors &state) case LayoutErrors::PrepareLayoutError: qCritical() << tr("Couldn't prepare data for creation layout"); break; - case LayoutErrors::ProcessStoped: - break; case LayoutErrors::EmptyPaperError: qCritical() << tr("Several workpieces left not arranged, but none of them match for paper"); break; + case LayoutErrors::ProcessStoped: default: break; } diff --git a/src/app/valentina/dialogs/dialogpatternproperties.cpp b/src/app/valentina/dialogs/dialogpatternproperties.cpp index 995e039da..1f9b0b231 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.cpp +++ b/src/app/valentina/dialogs/dialogpatternproperties.cpp @@ -87,7 +87,10 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte } ui->lineEditPathToFile->setCursorPosition(0); - connect(ui->pushButtonShowInExplorer, &QPushButton::clicked, [this](){ShowInGraphicalShell(m_filePath);}); + connect(ui->pushButtonShowInExplorer, &QPushButton::clicked, RECEIVER(this)[this]() + { + ShowInGraphicalShell(m_filePath); + }); #if defined(Q_OS_MAC) ui->pushButtonShowInExplorer->setText(tr("Show in Finder")); #endif //defined(Q_OS_MAC) @@ -135,7 +138,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte const QString size = QString().setNum(doc->GetDefCustomSize()); SetDefaultSize(size); - connect(ui->radioButtonDefFromP, &QRadioButton::toggled, [this]() + connect(ui->radioButtonDefFromP, &QRadioButton::toggled, RECEIVER(this)[this]() { ui->comboBoxHeight->setEnabled(ui->radioButtonDefFromP->isChecked()); ui->comboBoxSize->setEnabled(ui->radioButtonDefFromP->isChecked()); @@ -143,19 +146,20 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte auto DefValueChanged = [this](){defaultChanged = true;}; - connect(ui->radioButtonDefFromP, &QRadioButton::toggled, DefValueChanged); + connect(ui->radioButtonDefFromP, &QRadioButton::toggled, RECEIVER(this)DefValueChanged); ui->radioButtonDefFromP->setChecked(doc->IsDefCustom()); connect(ui->comboBoxHeight, static_cast(&QComboBox::currentIndexChanged), - DefValueChanged); - connect(ui->comboBoxSize, static_cast(&QComboBox::currentIndexChanged), DefValueChanged); + RECEIVER(this)DefValueChanged); + connect(ui->comboBoxSize, static_cast(&QComboBox::currentIndexChanged), + RECEIVER(this)DefValueChanged); const bool readOnly = doc->IsReadOnly(); ui->checkBoxPatternReadOnly->setChecked(readOnly); if (not readOnly) { - connect(ui->checkBoxPatternReadOnly, &QRadioButton::toggled, [this](){securityChanged = true;}); + connect(ui->checkBoxPatternReadOnly, &QRadioButton::toggled, RECEIVER(this)[this](){securityChanged = true;}); } else { @@ -725,7 +729,7 @@ void DialogPatternProperties::InitImage() { ui->imageLabel->setContextMenuPolicy(Qt::CustomContextMenu); ui->imageLabel->setScaledContents(true); - connect(ui->imageLabel, &QWidget::customContextMenuRequested, [this]() + connect(ui->imageLabel, &QWidget::customContextMenuRequested, RECEIVER(this)[this]() { QMenu menu(this); menu.addAction(deleteAction); @@ -741,7 +745,7 @@ void DialogPatternProperties::InitImage() saveImageAction = new QAction(tr("Save image to file"), this); showImageAction = new QAction(tr("Show image"), this); - connect(deleteAction, &QAction::triggered, [this]() + connect(deleteAction, &QAction::triggered, RECEIVER(this)[this]() { doc->DeleteImage(); ui->imageLabel->setText(tr("Change image")); @@ -752,7 +756,7 @@ void DialogPatternProperties::InitImage() connect(changeImageAction, &QAction::triggered, this, &DialogPatternProperties::ChangeImage); connect(saveImageAction, &QAction::triggered, this, &DialogPatternProperties::SaveImage); - connect(showImageAction, &QAction::triggered, [this]() + connect(showImageAction, &QAction::triggered, RECEIVER(this)[this]() { QLabel *label = new QLabel(this, Qt::Window); const QImage image = GetImage(); diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index ab9a2505d..04af0ee44 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -97,9 +97,10 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget * ui->labelExample->setText(tr("Example:") + FileName() + QLatin1String("1") + Format()); }; - connect(ui->lineEditFileName, &QLineEdit::textChanged, ShowExample); - connect(ui->comboBoxFormat, static_cast(&QComboBox::currentIndexChanged), ShowExample); - connect(ui->pushButtonBrowse, &QPushButton::clicked, [this]() + connect(ui->lineEditFileName, &QLineEdit::textChanged, RECEIVER(this)ShowExample); + connect(ui->comboBoxFormat, static_cast(&QComboBox::currentIndexChanged), + RECEIVER(this)ShowExample); + connect(ui->pushButtonBrowse, &QPushButton::clicked, RECEIVER(this)[this]() { const QString dir = QFileDialog::getExistingDirectory(this, tr("Select folder"), qApp->ValentinaSettings()->GetPathLayout(), diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index baae011ef..0f9e09f37 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -132,7 +132,7 @@ MainWindow::MainWindow(QWidget *parent) connect(doc, &VPattern::patternChanged, this, &MainWindow::PatternChangesWereSaved); connect(doc, &VPattern::UndoCommand, this, &MainWindow::FullParseFile); connect(doc, &VPattern::SetEnabledGUI, this, &MainWindow::SetEnabledGUI); - connect(doc, &VPattern::CheckLayout, [this]() + connect(doc, &VPattern::CheckLayout, RECEIVER(this)[this]() { if (pattern->DataDetails()->count() == 0) { @@ -171,7 +171,7 @@ MainWindow::MainWindow(QWidget *parent) ui->dockWidgetLayoutPages->setVisible(false); connect(watcher, &QFileSystemWatcher::fileChanged, this, &MainWindow::MeasurementsChanged); - connect(qApp, &QApplication::focusChanged, [this](QWidget *old, QWidget *now) + connect(qApp, &QApplication::focusChanged, RECEIVER(this)[this](QWidget *old, QWidget *now) { if (old == nullptr && isAncestorOf(now) == true) {// focus IN @@ -616,7 +616,7 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur connect(dialogTool.data(), &DialogTool::DialogClosed, this, closeDialogSlot); connect(dialogTool.data(), &DialogTool::DialogApplied, this, applyDialogSlot); connect(dialogTool.data(), &DialogTool::ToolTip, this, &MainWindow::ShowToolTip); - connect(ui->view, &VMainGraphicsView::MouseRelease, [this](){EndVisualization(true);}); + connect(ui->view, &VMainGraphicsView::MouseRelease, RECEIVER(this)[this](){EndVisualization(true);}); ui->view->itemClicked(nullptr); } else @@ -1659,9 +1659,9 @@ void MainWindow::ToolBarDraws() comboBoxDraws->setSizeAdjustPolicy(QComboBox::AdjustToContents); comboBoxDraws->setEnabled(false); connect(comboBoxDraws, static_cast(&QComboBox::currentIndexChanged), - [this](int index){ChangePP(index);}); + RECEIVER(this)[this](int index){ChangePP(index);}); - connect(ui->actionOptionDraw, &QAction::triggered, [this]() + connect(ui->actionOptionDraw, &QAction::triggered, RECEIVER(this)[this]() { const QString activDraw = doc->GetNameActivPP(); const QString nameDraw = PatternPieceName(activDraw); @@ -2019,8 +2019,6 @@ void MainWindow::keyPressEvent ( QKeyEvent * event ) ArrowTool(); break; case Qt::Key_Return: - EndVisualization(); - break; case Qt::Key_Enter: EndVisualization(); break; @@ -3511,13 +3509,15 @@ void MainWindow::AddDocks() //Add dock actionDockWidgetToolOptions = ui->dockWidgetToolOptions->toggleViewAction(); ui->menuPatternPiece->insertAction(ui->actionPattern_properties, actionDockWidgetToolOptions); - connect(ui->dockWidgetToolOptions, &QDockWidget::visibilityChanged, [this](bool visible){ + connect(ui->dockWidgetToolOptions, &QDockWidget::visibilityChanged, RECEIVER(this)[this](bool visible) + { isDockToolOptionsVisible = visible; }); actionDockWidgetGroups = ui->dockWidgetGroups->toggleViewAction(); ui->menuPatternPiece->insertAction(ui->actionPattern_properties, actionDockWidgetGroups); - connect(ui->dockWidgetGroups, &QDockWidget::visibilityChanged, [this](bool visible){ + connect(ui->dockWidgetGroups, &QDockWidget::visibilityChanged, RECEIVER(this)[this](bool visible) + { isDockGroupsVisible = visible; }); @@ -3568,14 +3568,14 @@ void MainWindow::CreateActions() connect(ui->actionDetails, &QAction::triggered, this, &MainWindow::ActionDetails); connect(ui->actionLayout, &QAction::triggered, this, &MainWindow::ActionLayout); - connect(ui->actionHistory, &QAction::triggered, [this](bool checked) + connect(ui->actionHistory, &QAction::triggered, RECEIVER(this)[this](bool checked) { if (checked) { dialogHistory = new DialogHistory(pattern, doc, this); dialogHistory->setWindowFlags(Qt::Window); connect(this, &MainWindow::RefreshHistory, dialogHistory.data(), &DialogHistory::UpdateHistory); - connect(dialogHistory.data(), &DialogHistory::DialogClosed, [this]() + connect(dialogHistory.data(), &DialogHistory::DialogClosed, RECEIVER(this)[this]() { ui->actionHistory->setChecked(false); delete dialogHistory; @@ -3591,7 +3591,7 @@ void MainWindow::CreateActions() } }); - connect(ui->actionNewDraw, &QAction::triggered, [this]() + connect(ui->actionNewDraw, &QAction::triggered, RECEIVER(this)[this]() { qCDebug(vMainWindow, "New PP."); QString patternPieceName = tr("Pattern piece %1").arg(comboBoxDraws->count()+1); @@ -3614,12 +3614,12 @@ void MainWindow::CreateActions() connect(ui->actionOpen, &QAction::triggered, this, &MainWindow::Open); connect(ui->actionNew, &QAction::triggered, this, &MainWindow::New); - connect(ui->actionTable, &QAction::triggered, [this](bool checked) + connect(ui->actionTable, &QAction::triggered, RECEIVER(this)[this](bool checked) { if (checked) { dialogTable = new DialogIncrements(pattern, doc, this); - connect(dialogTable.data(), &DialogIncrements::DialogClosed, [this]() + connect(dialogTable.data(), &DialogIncrements::DialogClosed, RECEIVER(this)[this]() { ui->actionTable->setChecked(false); delete dialogTable; @@ -3633,12 +3633,12 @@ void MainWindow::CreateActions() } }); - connect(ui->actionAbout_Qt, &QAction::triggered, [this]() + connect(ui->actionAbout_Qt, &QAction::triggered, RECEIVER(this)[this]() { QMessageBox::aboutQt(this, tr("About Qt")); }); - connect(ui->actionAbout_Valentina, &QAction::triggered, [this]() + connect(ui->actionAbout_Valentina, &QAction::triggered, RECEIVER(this)[this]() { DialogAboutApp *aboutDialog = new DialogAboutApp(this); aboutDialog->setAttribute(Qt::WA_DeleteOnClose, true); @@ -3648,13 +3648,13 @@ void MainWindow::CreateActions() connect(ui->actionExit, &QAction::triggered, this, &MainWindow::close); connect(ui->actionPreferences, &QAction::triggered, this, &MainWindow::Preferences); - connect(ui->actionReportBug, &QAction::triggered, [this]() + connect(ui->actionReportBug, &QAction::triggered, RECEIVER(this)[this]() { qCDebug(vMainWindow, "Reporting bug"); QDesktopServices::openUrl(QUrl(QStringLiteral("https://bitbucket.org/dismine/valentina/issues/new"))); }); - connect(ui->actionOnlineHelp, &QAction::triggered, [this]() + connect(ui->actionOnlineHelp, &QAction::triggered, RECEIVER(this)[this]() { qCDebug(vMainWindow, "Showing online help"); QDesktopServices::openUrl(QUrl(QStringLiteral("https://bitbucket.org/dismine/valentina/wiki/manual/Content"))); @@ -3662,10 +3662,10 @@ void MainWindow::CreateActions() connect(ui->actionLast_tool, &QAction::triggered, this, &MainWindow::LastUsedTool); - connect(ui->actionPattern_properties, &QAction::triggered, [this]() + connect(ui->actionPattern_properties, &QAction::triggered, RECEIVER(this)[this]() { DialogPatternProperties proper(curFile, doc, pattern, this); - connect(&proper, &DialogPatternProperties::UpdateGradation, [this]() + connect(&proper, &DialogPatternProperties::UpdateGradation, RECEIVER(this)[this]() { UpdateHeightsList(VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit())); UpdateSizesList(VMeasurement::ListSizes(doc->GetGradationSizes(), qApp->patternUnit())); @@ -3674,14 +3674,14 @@ void MainWindow::CreateActions() }); ui->actionPattern_properties->setEnabled(false); - connect(ui->actionEdit_pattern_code, &QAction::triggered, [this]() + connect(ui->actionEdit_pattern_code, &QAction::triggered, RECEIVER(this)[this]() { DialogPatternXmlEdit *pattern = new DialogPatternXmlEdit (this, doc); pattern->setAttribute(Qt::WA_DeleteOnClose, true); pattern->show(); }); - connect(ui->actionClosePattern, &QAction::triggered, [this]() + connect(ui->actionClosePattern, &QAction::triggered, RECEIVER(this)[this]() { if (MaybeSave()) { @@ -3690,7 +3690,7 @@ void MainWindow::CreateActions() } }); - connect(ui->actionShowCurveDetails, &QAction::triggered, [this](bool checked) + connect(ui->actionShowCurveDetails, &QAction::triggered, RECEIVER(this)[this](bool checked) { ui->view->itemClicked(nullptr); sceneDraw->EnableDetailsMode(checked); @@ -3699,7 +3699,7 @@ void MainWindow::CreateActions() connect(ui->actionLoadIndividual, &QAction::triggered, this, &MainWindow::LoadIndividual); connect(ui->actionLoadStandard, &QAction::triggered, this, &MainWindow::LoadStandard); - connect(ui->actionCreateNew, &QAction::triggered, [this]() + connect(ui->actionCreateNew, &QAction::triggered, RECEIVER(this)[this]() { const QString tape = qApp->TapeFilePath(); const QString workingDirectory = QFileInfo(tape).absoluteDir().absolutePath(); @@ -3721,7 +3721,7 @@ void MainWindow::CreateActions() QAction *action = new QAction(this); action->setVisible(false); recentFileActs[i] = action; - connect(recentFileActs[i], &QAction::triggered, [action, this]() + connect(recentFileActs[i], &QAction::triggered, RECEIVER(this)[action, this]() { // cppcheck-suppress nullPointerRedundantCheck if (action != nullptr) diff --git a/src/libs/fervor/fvupdater.cpp b/src/libs/fervor/fvupdater.cpp index 33ad88f84..e245bbbc6 100644 --- a/src/libs/fervor/fvupdater.cpp +++ b/src/libs/fervor/fvupdater.cpp @@ -281,7 +281,7 @@ void FvUpdater::startDownloadFeed(const QUrl &url) m_reply = m_qnam.get(request); - connect(m_reply, &QNetworkReply::readyRead, [this]() + connect(m_reply, &QNetworkReply::readyRead, RECEIVER(this)[this]() { // this slot gets called every time the QNetworkReply has new data. // We read all of its new data and write it into the file. @@ -289,7 +289,7 @@ void FvUpdater::startDownloadFeed(const QUrl &url) // signal of the QNetworkReply m_xml.addData(m_reply->readAll()); }); - connect(m_reply, &QNetworkReply::downloadProgress, [this](qint64 bytesRead, qint64 totalBytes) + connect(m_reply, &QNetworkReply::downloadProgress, RECEIVER(this)[this](qint64 bytesRead, qint64 totalBytes) { Q_UNUSED(bytesRead) Q_UNUSED(totalBytes) diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 9c62e8919..c23c9785a 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -49,6 +49,17 @@ template class QSharedPointer; #include #endif /* Q_CC_MSVC */ +//There is no automatic disconnection when the 'receiver' is destroyed because it's a functor with no QObject. However, +//since 5.2 there is an overload which adds a "context object". When that object is destroyed, the connection is broken +//(the context is also used for the thread affinity: the lambda will be called in the thread of the event loop of the +// object used as context). +#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) +#define RECEIVER(obj) (obj), +#else +#define RECEIVER(obj) +#endif + + class QComboBox; class QMarginsF; class VTranslateMeasurements; diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 076c96b3f..2a2774b72 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -118,7 +118,7 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv) setAttribute(Qt::AA_UseHighDpiPixmaps); #endif - connect(this, &QApplication::aboutToQuit, [this]() + connect(this, &QApplication::aboutToQuit, RECEIVER(this)[this]() { // If try to use the method QApplication::exit program can't sync settings and show warning about QApplication // instance. Solution is to call sync() before quit. diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index 681edd61e..731b3d2ab 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -407,31 +407,31 @@ void DialogEditWrongFormula::InitVariables() auto ClearFilterFormulaInputs = [this] () { ui->filterFormulaInputs->clear(); }; connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogEditWrongFormula::Measurements); - connect(ui->radioButtonStandardTable, &QRadioButton::clicked, ClearFilterFormulaInputs); + connect(ui->radioButtonStandardTable, &QRadioButton::clicked, RECEIVER(this)ClearFilterFormulaInputs); connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogEditWrongFormula::Increments); - connect(ui->radioButtonIncrements, &QRadioButton::clicked, ClearFilterFormulaInputs); + connect(ui->radioButtonIncrements, &QRadioButton::clicked, RECEIVER(this)ClearFilterFormulaInputs); connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthLines); - connect(ui->radioButtonLengthLine, &QRadioButton::clicked, ClearFilterFormulaInputs); + connect(ui->radioButtonLengthLine, &QRadioButton::clicked, RECEIVER(this)ClearFilterFormulaInputs); connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthCurves); - connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, ClearFilterFormulaInputs); + connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, RECEIVER(this)ClearFilterFormulaInputs); connect(ui->radioButtonAngleLine, &QRadioButton::clicked, this, &DialogEditWrongFormula::AngleLines); - connect(ui->radioButtonAngleLine, &QRadioButton::clicked, ClearFilterFormulaInputs); + connect(ui->radioButtonAngleLine, &QRadioButton::clicked, RECEIVER(this)ClearFilterFormulaInputs); connect(ui->radioButtonRadiusesArcs, &QRadioButton::clicked, this, &DialogEditWrongFormula::RadiusArcs); - connect(ui->radioButtonRadiusesArcs, &QRadioButton::clicked, ClearFilterFormulaInputs); + connect(ui->radioButtonRadiusesArcs, &QRadioButton::clicked, RECEIVER(this)ClearFilterFormulaInputs); connect(ui->radioButtonAnglesCurves, &QRadioButton::clicked, this, &DialogEditWrongFormula::AnglesCurves); - connect(ui->radioButtonAnglesCurves, &QRadioButton::clicked, ClearFilterFormulaInputs); + connect(ui->radioButtonAnglesCurves, &QRadioButton::clicked, RECEIVER(this)ClearFilterFormulaInputs); connect(ui->radioButtonCLength, &QRadioButton::clicked, this, &DialogEditWrongFormula::CurvesCLength); - connect(ui->radioButtonCLength, &QRadioButton::clicked, ClearFilterFormulaInputs); + connect(ui->radioButtonCLength, &QRadioButton::clicked, RECEIVER(this)ClearFilterFormulaInputs); connect(ui->radioButtonFunctions, &QRadioButton::clicked, this, &DialogEditWrongFormula::Functions); - connect(ui->radioButtonFunctions, &QRadioButton::clicked, ClearFilterFormulaInputs); + connect(ui->radioButtonFunctions, &QRadioButton::clicked, RECEIVER(this)ClearFilterFormulaInputs); connect(ui->checkBoxHideEmpty, &QCheckBox::stateChanged, this, &DialogEditWrongFormula::Measurements); } diff --git a/src/libs/vtools/dialogs/support/dialogundo.cpp b/src/libs/vtools/dialogs/support/dialogundo.cpp index b1c9ae6c7..b8609dbc4 100644 --- a/src/libs/vtools/dialogs/support/dialogundo.cpp +++ b/src/libs/vtools/dialogs/support/dialogundo.cpp @@ -55,13 +55,13 @@ DialogUndo::DialogUndo(QWidget *parent) } else { - connect(ui->pushButtonUndo, &QPushButton::clicked, [this]() + connect(ui->pushButtonUndo, &QPushButton::clicked, RECEIVER(this)[this]() { result = UndoButton::Undo; accept(); }); } - connect(ui->pushButtonFix, &QPushButton::clicked, [this]() + connect(ui->pushButtonFix, &QPushButton::clicked, RECEIVER(this)[this]() { result = UndoButton::Fix; accept(); diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index 3d10e3fcc..4b9e80d3d 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -475,7 +475,7 @@ VSimpleCurve *VAbstractOperation::InitCurve(quint32 id, VContainer *data, GOType curve->setParentItem(this); curve->SetType(curveType); connect(curve, &VSimpleCurve::Selected, this, &VAbstractOperation::ObjectSelected); - connect(curve, &VSimpleCurve::ShowContextMenu, [this](QGraphicsSceneContextMenuEvent * event) + connect(curve, &VSimpleCurve::ShowContextMenu, RECEIVER(this)[this](QGraphicsSceneContextMenuEvent * event) { contextMenuEvent(event); }); @@ -569,12 +569,13 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default") *VAbstractTool::data.GetPatternUnit(), &factor); point->setParentItem(this); point->SetType(GOType::Point); - connect(point, &VSimplePoint::Choosed, [this](quint32 id) + connect(point, &VSimplePoint::Choosed, RECEIVER(this)[this](quint32 id) { emit ChoosedTool(id, SceneObject::Point); }); connect(point, &VSimplePoint::Selected, this, &VAbstractOperation::ObjectSelected); - connect(point, &VSimplePoint::ShowContextMenu, [this](QGraphicsSceneContextMenuEvent * event) + connect(point, &VSimplePoint::ShowContextMenu, + RECEIVER(this)[this](QGraphicsSceneContextMenuEvent * event) { contextMenuEvent(event); }); @@ -587,7 +588,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default") case GOType::Arc: { VSimpleCurve *curve = InitCurve(object.id, &(VAbstractTool::data), obj->getType()); - connect(curve, &VSimpleCurve::Choosed, [this](quint32 id) + connect(curve, &VSimpleCurve::Choosed, RECEIVER(this)[this](quint32 id) { emit ChoosedTool(id, SceneObject::Arc); }); @@ -596,7 +597,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default") case GOType::EllipticalArc: { VSimpleCurve *curve = InitCurve(object.id, &(VAbstractTool::data), obj->getType()); - connect(curve, &VSimpleCurve::Choosed, [this](quint32 id) + connect(curve, &VSimpleCurve::Choosed, RECEIVER(this)[this](quint32 id) { emit ChoosedTool(id, SceneObject::ElArc); }); @@ -606,7 +607,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default") case GOType::CubicBezier: { VSimpleCurve *curve = InitCurve(object.id, &(VAbstractTool::data), obj->getType()); - connect(curve, &VSimpleCurve::Choosed, [this](quint32 id) + connect(curve, &VSimpleCurve::Choosed, RECEIVER(this)[this](quint32 id) { emit ChoosedTool(id, SceneObject::Spline); }); @@ -616,7 +617,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default") case GOType::CubicBezierPath: { VSimpleCurve *curve = InitCurve(object.id, &(VAbstractTool::data), obj->getType()); - connect(curve, &VSimpleCurve::Choosed, [this](quint32 id) + connect(curve, &VSimpleCurve::Choosed, RECEIVER(this)[this](quint32 id) { emit ChoosedTool(id, SceneObject::SplinePath); }); diff --git a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index e693d1b27..e4a272f12 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -84,7 +84,9 @@ VNodePoint::VNodePoint(VAbstractPattern *doc, VContainer *data, quint32 id, quin lineName = new QGraphicsLineItem(this); connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VNodePoint::NameChangePosition); - connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, [this](QGraphicsSceneContextMenuEvent *event) { + connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, + RECEIVER(this)[this](QGraphicsSceneContextMenuEvent *event) + { emit ShowContextMenu(event); }); this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit())))); From a6a8ef29b0865084cfd8230bd9d1c8765e6d2dda Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 21:35:07 +0200 Subject: [PATCH 21/26] Refactoring. Merge similar switch cases together. --HG-- branch : develop --- .../valentina/dialogs/dialoglayoutsettings.cpp | 2 -- src/app/valentina/mainwindowsnogui.cpp | 3 +-- src/app/valentina/xml/vpattern.cpp | 6 +----- src/libs/vdxf/dxflib/dl_dxf.cpp | 17 ++--------------- src/libs/vdxf/vdxfengine.cpp | 9 +-------- src/libs/vdxf/vdxfpaintdevice.cpp | 7 ++----- src/libs/vobj/vobjpaintdevice.cpp | 7 ++----- .../vpropertyexplorer/vpropertyformwidget.cpp | 7 +------ src/libs/vtools/tools/vabstracttool.cpp | 14 ++------------ src/libs/vtools/visualization/line/visline.cpp | 3 +-- 10 files changed, 13 insertions(+), 62 deletions(-) diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp index eae894f50..39aa59c71 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp +++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp @@ -224,8 +224,6 @@ void DialogLayoutSettings::SetGroup(const Cases &value) ui->radioButtonTwoGroups->setChecked(true); break; case Cases::CaseDesc: - ui->radioButtonDescendingArea->setChecked(true); - break; default: ui->radioButtonDescendingArea->setChecked(true); break; diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index cd6d7c46d..b2c369fd4 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -174,11 +174,10 @@ void MainWindowsNoGUI::ErrorConsoleMode(const LayoutErrors &state) case LayoutErrors::PrepareLayoutError: qCritical() << tr("Couldn't prepare data for creation layout"); break; - case LayoutErrors::ProcessStoped: - break; case LayoutErrors::EmptyPaperError: qCritical() << tr("Several workpieces left not arranged, but none of them match for paper"); break; + case LayoutErrors::ProcessStoped: default: break; } diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 7f4e79e9d..ad5eb8c61 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -990,11 +990,6 @@ QString VPattern::GetLabelBase(quint32 index) const alphabet = al.split(","); break; } - case 1: // en - { - alphabet = def.split(","); - break; - } case 2: // fr { const QString al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"); @@ -1031,6 +1026,7 @@ QString VPattern::GetLabelBase(quint32 index) const alphabet = al.split(","); break; } + case 1: // en default: // en { alphabet = def.split(","); diff --git a/src/libs/vdxf/dxflib/dl_dxf.cpp b/src/libs/vdxf/dxflib/dl_dxf.cpp index 01ed1b1f4..80ff93356 100644 --- a/src/libs/vdxf/dxflib/dl_dxf.cpp +++ b/src/libs/vdxf/dxflib/dl_dxf.cpp @@ -1578,12 +1578,7 @@ bool DL_Dxf::handleXData(DL_CreationInterface* creationInterface) creationInterface->addXDataReal(static_cast(groupCode), toReal(groupValue)); return true; } - else if (groupCode>=1060 && groupCode<=1070) - { - creationInterface->addXDataInt(static_cast(groupCode), toInt(groupValue)); - return true; - } - else if (groupCode==1071) + else if (groupCode>=1060 && groupCode<=1071) { creationInterface->addXDataInt(static_cast(groupCode), toInt(groupValue)); return true; @@ -2600,7 +2595,6 @@ void DL_Dxf::writeHeader(DL_WriterA& dw) const break; case DL_Codes::AC1009_MIN: // minimalistic DXF version is unidentified in file: - break; default: break; } @@ -4231,14 +4225,7 @@ void DL_Dxf::writeLinetype(DL_WriterA& dw, dw.dxfString(2, data.name); dw.dxfInt(70, data.flags); - if (nameUpper=="BYBLOCK") - { - dw.dxfString(3, ""); - dw.dxfInt(72, 65); - dw.dxfInt(73, 0); - dw.dxfReal(40, 0.0); - } - else if (nameUpper=="BYLAYER") + if (nameUpper=="BYBLOCK" || nameUpper=="BYLAYER") { dw.dxfString(3, ""); dw.dxfInt(72, 65); diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp index c16932982..2ba90f46e 100644 --- a/src/libs/vdxf/vdxfengine.cpp +++ b/src/libs/vdxf/vdxfengine.cpp @@ -479,24 +479,17 @@ std::string VDxfEngine::getPenStyle() { switch (state->pen().style()) { - case Qt::SolidLine: - return "BYLAYER"; - break; case Qt::DashLine: return "DASHED"; - break; case Qt::DotLine: return "DOT"; - break; case Qt::DashDotLine: return "DASHDOT"; - break; case Qt::DashDotDotLine: return "DIVIDE"; - break; + case Qt::SolidLine: default: return "BYLAYER"; - break; } } diff --git a/src/libs/vdxf/vdxfpaintdevice.cpp b/src/libs/vdxf/vdxfpaintdevice.cpp index 80fcacc49..35b7bd714 100644 --- a/src/libs/vdxf/vdxfpaintdevice.cpp +++ b/src/libs/vdxf/vdxfpaintdevice.cpp @@ -126,10 +126,6 @@ int VDxfPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const return engine->getSize().width(); case QPaintDevice::PdmHeight: return engine->getSize().height(); - case QPaintDevice::PdmDpiX: - return static_cast(engine->getResolution()); - case QPaintDevice::PdmDpiY: - return static_cast(engine->getResolution()); case QPaintDevice::PdmHeightMM: return qRound(engine->getSize().height() * 25.4 / engine->getResolution()); case QPaintDevice::PdmWidthMM: @@ -137,8 +133,9 @@ int VDxfPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const case QPaintDevice::PdmNumColors: return static_cast(0xffffffff); case QPaintDevice::PdmPhysicalDpiX: - return static_cast(engine->getResolution()); case QPaintDevice::PdmPhysicalDpiY: + case QPaintDevice::PdmDpiX: + case QPaintDevice::PdmDpiY: return static_cast(engine->getResolution()); #if QT_VERSION > QT_VERSION_CHECK(5, 0, 2) case QPaintDevice::PdmDevicePixelRatio: diff --git a/src/libs/vobj/vobjpaintdevice.cpp b/src/libs/vobj/vobjpaintdevice.cpp index e1f42a50e..418a01619 100644 --- a/src/libs/vobj/vobjpaintdevice.cpp +++ b/src/libs/vobj/vobjpaintdevice.cpp @@ -147,18 +147,15 @@ int VObjPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const return engine->getSize().width(); case QPaintDevice::PdmHeight: return engine->getSize().height(); - case QPaintDevice::PdmDpiX: - return engine->getResolution(); - case QPaintDevice::PdmDpiY: - return engine->getResolution(); case QPaintDevice::PdmHeightMM: return qRound(engine->getSize().height() * 25.4 / engine->getResolution()); case QPaintDevice::PdmWidthMM: return qRound(engine->getSize().width() * 25.4 / engine->getResolution()); case QPaintDevice::PdmNumColors: return static_cast(0xffffffff); + case QPaintDevice::PdmDpiX: + case QPaintDevice::PdmDpiY: case QPaintDevice::PdmPhysicalDpiX: - return engine->getResolution(); case QPaintDevice::PdmPhysicalDpiY: return engine->getResolution(); #if QT_VERSION > QT_VERSION_CHECK(5, 0, 2) diff --git a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp index f694737e8..b674fe167 100644 --- a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp +++ b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp @@ -228,7 +228,7 @@ void VPE::VPropertyFormWidget::commitData(int row) if (oldValue != newValue) { VProperty *parent = tmpProperty->getParent(); - if (parent == nullptr) + if (parent == nullptr || parent->propertyType() != Property::Complex) { tmpProperty->setValue(newValue); emit propertyDataSubmitted(tmpProperty); @@ -238,11 +238,6 @@ void VPE::VPropertyFormWidget::commitData(int row) tmpProperty->UpdateParent(newValue); emit propertyDataSubmitted(parent); } - else - { - tmpProperty->setValue(newValue); - emit propertyDataSubmitted(tmpProperty); - } } } } diff --git a/src/libs/vtools/tools/vabstracttool.cpp b/src/libs/vtools/tools/vabstracttool.cpp index e77c516e5..f15c3232b 100644 --- a/src/libs/vtools/tools/vabstracttool.cpp +++ b/src/libs/vtools/tools/vabstracttool.cpp @@ -174,25 +174,17 @@ Qt::PenStyle VAbstractTool::LineStyleToPenStyle(const QString &typeLine) { case 0: // TypeLineNone return Qt::NoPen; - break; - case 1: // TypeLineLine - return Qt::SolidLine; - break; case 2: // TypeLineDashLine return Qt::DashLine; - break; case 3: // TypeLineDotLine return Qt::DotLine; - break; case 4: // TypeLineDashDotLine return Qt::DashDotLine; - break; case 5: // TypeLineDashDotDotLine return Qt::DashDotDotLine; - break; + case 1: // TypeLineLine default: return Qt::SolidLine; - break; } } @@ -243,9 +235,6 @@ QMap VAbstractTool::ColorsList() QString name; switch (i) { - case 0: // ColorBlack - name = tr("black"); - break; case 1: // ColorGreen name = tr("green"); break; @@ -294,6 +283,7 @@ QMap VAbstractTool::ColorsList() case 16: // ColorCornFlowerBlue name = tr("corn flower blue"); break; + case 0: // ColorBlack default: name = tr("black"); break; diff --git a/src/libs/vtools/visualization/line/visline.cpp b/src/libs/vtools/visualization/line/visline.cpp index 1bb8e1b68..d66e1d9d9 100644 --- a/src/libs/vtools/visualization/line/visline.cpp +++ b/src/libs/vtools/visualization/line/visline.cpp @@ -64,8 +64,6 @@ qreal VisLine::CorrectAngle(const qreal &angle) switch (qFloor((qAbs(ang)+22.5)/45)) { - case 0: // <22.5 - return 0; case 1: // <67.5 return 45; case 2: // <112.5 @@ -80,6 +78,7 @@ qreal VisLine::CorrectAngle(const qreal &angle) return 270; case 7: // <337.5 return 315; + case 0: // <22.5 default: // <360 return 0; } From 3a8fd53dc88b13ebbbaa2360b66cf56ee079a2d1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 21:39:44 +0200 Subject: [PATCH 22/26] Fix memory leak. --HG-- branch : develop --- src/libs/vtools/tools/vtooldetail.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index 1814548fa..fc2f971bd 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -1229,7 +1229,7 @@ void VToolDetail::RefreshGeometry() //--------------------------------------------------------------------------------------------------------------------- void VToolDetail::DeleteTool(bool ask) { - DeleteDetail *delDet = new DeleteDetail(doc, id, VAbstractTool::data.GetDetail(id)); + QScopedPointer delDet(new DeleteDetail(doc, id, VAbstractTool::data.GetDetail(id))); if (ask) { if (ConfirmDeletion() == QMessageBox::No) @@ -1237,9 +1237,9 @@ void VToolDetail::DeleteTool(bool ask) return; } /* If UnionDetails tool delete detail no need emit FullParsing.*/ - connect(delDet, &DeleteDetail::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); + connect(delDet.data(), &DeleteDetail::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); } - qApp->getUndoStack()->push(delDet); + qApp->getUndoStack()->push(delDet.take()); // Throw exception, this will help prevent case when we forget to immediately quit function. VExceptionToolWasDeleted e("Tool was used after deleting."); From 82c48ef4c3ed3f0e3e89557e306cc7bf5cc9bb39 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 21 Dec 2016 22:40:01 +0200 Subject: [PATCH 23/26] Fix potential memory leak. --HG-- branch : develop --- .../vpropertyfactorymanager.cpp | 18 +++++++++--------- .../vpropertyfactorymanager.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libs/vpropertyexplorer/vpropertyfactorymanager.cpp b/src/libs/vpropertyexplorer/vpropertyfactorymanager.cpp index 0fdc1ad09..55877c8e1 100644 --- a/src/libs/vpropertyexplorer/vpropertyfactorymanager.cpp +++ b/src/libs/vpropertyexplorer/vpropertyfactorymanager.cpp @@ -141,16 +141,16 @@ VPE::VProperty* VPE::VPropertyFactoryManager::createProperty(const QString& type } // cppcheck-suppress unusedFunction -VPE::VPropertyFactoryManager *VPE::VPropertyFactoryManager::getDefaultManager() -{ - if (!DefaultManager) - { - DefaultManager = new VPropertyFactoryManager(); - /*VStandardPropertyFactory* tmpStandardProp = */new VStandardPropertyFactory(DefaultManager); - } +//VPE::VPropertyFactoryManager *VPE::VPropertyFactoryManager::getDefaultManager() +//{ +// if (!DefaultManager) +// { +// DefaultManager = new VPropertyFactoryManager(); +// /*VStandardPropertyFactory* tmpStandardProp = */new VStandardPropertyFactory(DefaultManager); +// } - return DefaultManager; -} +// return DefaultManager; +//} // cppcheck-suppress unusedFunction QStringList VPE::VPropertyFactoryManager::getSupportedTypes() diff --git a/src/libs/vpropertyexplorer/vpropertyfactorymanager.h b/src/libs/vpropertyexplorer/vpropertyfactorymanager.h index a17792e21..136b2b2ea 100644 --- a/src/libs/vpropertyexplorer/vpropertyfactorymanager.h +++ b/src/libs/vpropertyexplorer/vpropertyfactorymanager.h @@ -80,7 +80,7 @@ public: const QString& default_value = QString()); //! Returns the default manager. - static VPropertyFactoryManager* getDefaultManager(); + //static VPropertyFactoryManager* getDefaultManager(); //! Returns a list of all supported property types QStringList getSupportedTypes(); From e777c788b4b914a5576ba4ec212a1ddaceb0f864 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 23 Dec 2016 10:51:05 +0200 Subject: [PATCH 24/26] Cppcheck warning. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 0f9e09f37..10eeb7f93 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -3723,7 +3723,6 @@ void MainWindow::CreateActions() recentFileActs[i] = action; connect(recentFileActs[i], &QAction::triggered, RECEIVER(this)[action, this]() { - // cppcheck-suppress nullPointerRedundantCheck if (action != nullptr) { const QString filePath = action->data().toString(); From c9e9fb57d5a276351771426e9fb956ae5200a032 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 23 Dec 2016 10:25:45 +0200 Subject: [PATCH 25/26] Fixed issue #603. Wrong layout caused by wrong seam allowance. --HG-- branch : develop --- ChangeLog.txt | 1 + src/app/share/collection/bugs/Issue_#603.val | 280 ++++++++++++++++++ src/app/share/collection/bugs/Issue_#603.vit | 36 +++ src/libs/vlayout/vabstractdetail.cpp | 31 +- .../ValentinaTest/tst_vabstractdetail.cpp | 84 ++++++ 5 files changed, 426 insertions(+), 6 deletions(-) create mode 100644 src/app/share/collection/bugs/Issue_#603.val create mode 100644 src/app/share/collection/bugs/Issue_#603.vit diff --git a/ChangeLog.txt b/ChangeLog.txt index 737dba10c..e72c5e1b5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -52,6 +52,7 @@ # Version 0.4.6 - [#594] Broken export on Mac. - Math parser allows apostrophe in variable name. +- [#603] Wrong layout caused by wrong seam allowance. # Version 0.4.5 October 15, 2016 - [#435] Valentina doesn't change the cursor. diff --git a/src/app/share/collection/bugs/Issue_#603.val b/src/app/share/collection/bugs/Issue_#603.val new file mode 100644 index 000000000..b5ec518df --- /dev/null +++ b/src/app/share/collection/bugs/Issue_#603.val @@ -0,0 +1,280 @@ + + + + 0.2.4 + cm + + + + Issue_#603.vit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/src/app/share/collection/bugs/Issue_#603.vit b/src/app/share/collection/bugs/Issue_#603.vit new file mode 100644 index 000000000..a96e2962c --- /dev/null +++ b/src/app/share/collection/bugs/Issue_#603.vit @@ -0,0 +1,36 @@ + + + + 0.3.3 + false + + cm + 998 + + + + 1800-01-01 + unknown + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/vlayout/vabstractdetail.cpp b/src/libs/vlayout/vabstractdetail.cpp index 966e01dd6..c28f2f10e 100644 --- a/src/libs/vlayout/vabstractdetail.cpp +++ b/src/libs/vlayout/vabstractdetail.cpp @@ -359,7 +359,7 @@ QVector VAbstractDetail::CorrectEquidistantPoints(const QVector VAbstractDetail::CheckLoops(const QVector &points) { - const int count = points.size(); + int count = points.size(); /*If we got less than 4 points no need seek loops.*/ if (count < 4) { @@ -458,13 +458,32 @@ QVector VAbstractDetail::CheckLoops(const QVector &points) switch (status) { case ParallelIntersection: + { /*We have found a loop.*/ - // Theoretically there is no big difference which point j or jNext to select. - // In the end we will draw a line in any case. - ekvPoints.append(points.at(i)); - ekvPoints.append(points.at(jNext)); - i = j; + // Very tricky case + // See the file "collection/bugs/Issue_#603.val" + const QLineF line1(points.at(i+1), points.at(j)); + const QLineF line2(points.at(i), points.at(jNext)); + + if (line1.length() <= line2.length()) + { + // In this case we did not check a loop edges and can just skip them + ekvPoints.append(points.at(i)); + ekvPoints.append(points.at(jNext)); + + i = j; // Skip a loo + } + else + { + // In this case a loop edges probably was also chacked and added to the list + ekvPoints.clear();// Previous data is wrong and belong to loop. + ekvPoints.append(points.at(j)); + ekvPoints.append(points.at(i+1)); + + count = j+1;// All beyond this belong to loop. + } break; + } case BoundedIntersection: /*We have found a loop.*/ ekvPoints.append(points.at(i)); diff --git a/src/test/ValentinaTest/tst_vabstractdetail.cpp b/src/test/ValentinaTest/tst_vabstractdetail.cpp index 1ac3995d2..2566d0d19 100644 --- a/src/test/ValentinaTest/tst_vabstractdetail.cpp +++ b/src/test/ValentinaTest/tst_vabstractdetail.cpp @@ -473,6 +473,90 @@ void TST_VAbstractDetail::PathRemoveLoop_data() const // Check a seam allowance path. // The curve that causes the issue is the last in the list. QTest::newRow("Test case issue #515. Small loop in seam allowance path.") << path << res; + + path.clear(); + path << QPointF(1229.6503937007876, 937.6667716535435); + path << QPointF(203.08931117793543, 937.6667716535435); + path << QPointF(459.7677349767701, -2166.704563141019); + path << QPointF(1229.6503937007876, -1990.077167189857); + path << QPointF(1229.6503937007876, -555.2466141732282); + path << QPointF(920.1053824527112, -555.2466141732282); + path << QPointF(887.034516310979, -63.90803149606281); + path << QPointF(816.3607592795726, -63.908031496062826); + path << QPointF(780.7580397937137, -592.8627210002539); + path << QPointF(816.0241340748559, -1202.917917917055); + path << QPointF(887.3711415156957, -1202.917917917055); + path << QPointF(920.4420076574283, -630.8371653543306); + path << QPointF(1229.6503937007876, -630.8371653543306); + path << QPointF(1229.6503937007876, 937.6667716535435); + + res.clear(); + res << QPointF(1229.6503937007876, 937.6667716535435); + res << QPointF(203.08931117793543, 937.6667716535435); + res << QPointF(459.7677349767702, -2166.704563141019); + res << QPointF(1229.6503937007876, -1990.077167189857); + res << QPointF(1229.6503937007876, 937.6667716535435); + res << QPointF(1229.6503937007876, 937.6667716535435); + + // See the file "collection/bugs/Issue_#603.val" + // Point H1 is first in the list + QTest::newRow("Test issue 603. Case 1.") << path << res; + + path.clear(); + path << QPointF(1229.6503937007876, -630.8371653543306); + path << QPointF(1229.6503937007876, 937.6667716535435); + path << QPointF(203.08931117793543, 937.6667716535435); + path << QPointF(459.7677349767702, -2166.704563141019); + path << QPointF(1229.6503937007876, -1990.077167189857); + path << QPointF(1229.6503937007876, -555.2466141732282); + path << QPointF(920.1053824527112, -555.2466141732282); + path << QPointF(887.034516310979, -63.90803149606281); + path << QPointF(816.3607592795726, -63.908031496062826); + path << QPointF(780.7580397937137, -592.8627210002539); + path << QPointF(816.0241340748559, -1202.917917917055); + path << QPointF(887.3711415156957, -1202.917917917055); + path << QPointF(920.4420076574283, -630.8371653543306); + path << QPointF(1229.6503937007876, -630.8371653543306); + + res.clear(); + res << QPointF(1229.6503937007876, -1990.077167189857); + res << QPointF(1229.6503937007876, 937.6667716535435); + res << QPointF(1229.6503937007876, 937.6667716535435); + res << QPointF(203.08931117793543, 937.6667716535435); + res << QPointF(459.7677349767702, -2166.704563141019); + res << QPointF(1229.6503937007876, -1990.077167189857); + + // See the file "collection/bugs/Issue_#603.val" + // Point T1 is first in the list + QTest::newRow("Test issue 603. Case 2.") << path << res; + + path.clear(); + path << QPointF(920.4420076574283, -630.8371653543306); + path << QPointF(1229.6503937007876, -630.8371653543306); + path << QPointF(1229.6503937007876, 937.6667716535435); + path << QPointF(203.08931117793543, 937.6667716535435); + path << QPointF(459.7677349767702, -2166.704563141019); + path << QPointF(1229.6503937007876, -1990.077167189857); + path << QPointF(1229.6503937007876, -555.2466141732282); + path << QPointF(920.1053824527112, -555.2466141732282); + path << QPointF(887.034516310979, -63.90803149606281); + path << QPointF(816.3607592795726, -63.908031496062826); + path << QPointF(780.7580397937137, -592.8627210002539); + path << QPointF(816.0241340748559, -1202.917917917055); + path << QPointF(887.3711415156957, -1202.917917917055); + path << QPointF(920.4420076574283, -630.8371653543306); + + res.clear(); + res << QPointF(1229.6503937007876, -1990.077167189857); + res << QPointF(1229.6503937007876, 937.6667716535435); + res << QPointF(1229.6503937007876, 937.6667716535435); + res << QPointF(203.08931117793543, 937.6667716535435); + res << QPointF(459.7677349767702, -2166.704563141019); + res << QPointF(1229.6503937007876, -1990.077167189857); + + // See the file "collection/bugs/Issue_#603.val" + // Point T62 is first in the list + QTest::newRow("Test issue 603. Case 3.") << path << res; } //--------------------------------------------------------------------------------------------------------------------- From 4d277f392ed7c443caff825e4502b64e5fe52dde Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 23 Dec 2016 11:11:00 +0200 Subject: [PATCH 26/26] Fix switching to Layout page when enable Layout mode. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 2 +- src/app/valentina/mainwindow.ui | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 10eeb7f93..1c8e03d7b 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -2276,7 +2276,7 @@ void MainWindow::ActionLayout(bool checked) mode = Draw::Layout; SetEnableTool(true); SetEnableWidgets(true); - ui->toolBox->setCurrentIndex(6); + ui->toolBox->setCurrentIndex(ui->toolBox->indexOf(ui->layoutPage)); mouseCoordinate->setText(""); diff --git a/src/app/valentina/mainwindow.ui b/src/app/valentina/mainwindow.ui index 473be076f..cbfe05e4f 100644 --- a/src/app/valentina/mainwindow.ui +++ b/src/app/valentina/mainwindow.ui @@ -48,7 +48,7 @@ Tools - 4 + 7 @@ -1425,7 +1425,7 @@ - + 0 @@ -2560,8 +2560,8 @@ - +