From d696af9a3381a9b773c43d460283cf3805f08f23 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 23 Mar 2017 10:25:46 +0200 Subject: [PATCH] "static" members should be accessed statically. --HG-- branch : develop --- src/app/tape/mapplication.cpp | 8 ++-- src/app/tape/tmainwindow.cpp | 30 ++++++------- src/app/valentina/core/vapplication.cpp | 17 ++++---- .../dialogs/dialogpatternproperties.cpp | 4 +- src/app/valentina/mainwindow.cpp | 42 +++++++++---------- src/app/valentina/mainwindowsnogui.cpp | 7 ++-- src/app/valentina/xml/vpattern.cpp | 4 +- src/libs/fervor/fvupdatewindow.cpp | 6 ++- src/libs/qmuparser/qmuparsertokenreader.cpp | 4 +- src/libs/vformat/vmeasurements.cpp | 4 +- src/libs/vlayout/vlayoutpiece.cpp | 4 +- .../dialogs/tools/dialogflippingbyaxis.cpp | 2 +- .../dialogs/tools/dialogflippingbyline.cpp | 2 +- src/libs/vtools/dialogs/tools/dialogmove.cpp | 2 +- .../vtools/dialogs/tools/dialogrotation.cpp | 2 +- .../operation/flipping/vabstractflipping.cpp | 2 +- .../flipping/vtoolflippingbyaxis.cpp | 4 +- .../flipping/vtoolflippingbyline.cpp | 2 +- .../operation/vabstractoperation.cpp | 6 +-- .../tools/drawTools/operation/vtoolmove.cpp | 8 ++-- .../drawTools/operation/vtoolrotation.cpp | 6 +-- .../tools/drawTools/toolcurve/vtoolarc.cpp | 2 +- .../toolcurve/vtoolarcwithlength.cpp | 2 +- .../drawTools/toolcurve/vtoolcubicbezier.cpp | 2 +- .../toolcurve/vtoolcubicbezierpath.cpp | 2 +- .../toolcurve/vtoolellipticalarc.cpp | 2 +- .../tools/drawTools/toolcurve/vtoolspline.cpp | 2 +- .../drawTools/toolcurve/vtoolsplinepath.cpp | 2 +- .../tooldoublepoint/vtooldoublepoint.cpp | 4 +- .../tooldoublepoint/vtooltruedarts.cpp | 14 +++---- .../toolsinglepoint/toolcut/vtoolcut.h | 2 +- .../toolsinglepoint/toolcut/vtoolcutarc.cpp | 6 +-- .../toolcut/vtoolcutspline.cpp | 2 +- .../toolcut/vtoolcutsplinepath.cpp | 2 +- .../toollinepoint/vtoolalongline.cpp | 2 +- .../toollinepoint/vtoolbisector.cpp | 2 +- .../toollinepoint/vtoolcurveintersectaxis.cpp | 6 +-- .../toollinepoint/vtoolendline.cpp | 2 +- .../toollinepoint/vtoolheight.cpp | 2 +- .../toollinepoint/vtoollineintersectaxis.cpp | 2 +- .../toollinepoint/vtoolnormal.cpp | 2 +- .../toollinepoint/vtoolshoulderpoint.cpp | 2 +- .../toolsinglepoint/vtoolbasepoint.cpp | 2 +- .../toolsinglepoint/vtoollineintersect.cpp | 2 +- .../vtoolpointfromarcandtangent.cpp | 2 +- .../vtoolpointfromcircleandtangent.cpp | 2 +- .../toolsinglepoint/vtoolpointofcontact.cpp | 2 +- .../vtoolpointofintersection.cpp | 2 +- .../vtoolpointofintersectionarcs.cpp | 2 +- .../vtoolpointofintersectioncircles.cpp | 2 +- .../vtoolpointofintersectioncurves.cpp | 2 +- .../toolsinglepoint/vtooltriangle.cpp | 2 +- src/libs/vtools/tools/drawTools/vdrawtool.cpp | 2 +- src/libs/vtools/tools/drawTools/vtoolline.cpp | 4 +- .../vtools/tools/nodeDetails/vnodearc.cpp | 4 +- .../tools/nodeDetails/vnodeellipticalarc.cpp | 4 +- .../vtools/tools/nodeDetails/vnodepoint.cpp | 4 +- .../vtools/tools/nodeDetails/vnodespline.cpp | 4 +- .../tools/nodeDetails/vnodesplinepath.cpp | 4 +- .../tools/nodeDetails/vtoolpiecepath.cpp | 6 +-- .../vtools/tools/nodeDetails/vtoolpin.cpp | 4 +- src/libs/vtools/tools/vabstracttool.cpp | 2 +- src/libs/vtools/tools/vtoolseamallowance.cpp | 16 +++---- src/libs/vtools/tools/vtooluniondetails.cpp | 6 +-- src/libs/vtools/undocommands/deletepiece.cpp | 2 +- src/test/ValentinaTest/tst_vmeasurements.cpp | 8 ++-- 66 files changed, 162 insertions(+), 158 deletions(-) diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index 4093d4a14..9750a5b6a 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -167,8 +167,8 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con { //fixme: trying to make sure there are no save/load dialogs are opened, because error message during them will //lead to crash - const bool topWinAllowsPop = (qApp->activeModalWidget() == nullptr) || - !qApp->activeModalWidget()->inherits("QFileDialog"); + const bool topWinAllowsPop = (QApplication::activeModalWidget() == nullptr) || + !QApplication::activeModalWidget()->inherits("QFileDialog"); QMessageBox messageBox; switch (type) { @@ -390,8 +390,8 @@ void MApplication::InitOptions() qCDebug(mApp, "Build revision: %s", BUILD_REVISION); qCDebug(mApp, "%s", qUtf8Printable(buildCompatibilityString())); qCDebug(mApp, "Built on %s at %s", __DATE__, __TIME__); - qCDebug(mApp, "Command-line arguments: %s", qUtf8Printable(this->arguments().join(", "))); - qCDebug(mApp, "Process ID: %s", qUtf8Printable(QString().setNum(this->applicationPid()))); + qCDebug(mApp, "Command-line arguments: %s", qUtf8Printable(arguments().join(", "))); + qCDebug(mApp, "Process ID: %s", qUtf8Printable(QString().setNum(applicationPid()))); LoadTranslation(QLocale().name());// By default the console version uses system locale diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index bf7fbc8aa..0bc85e214 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -186,7 +186,7 @@ void TMainWindow::SetBaseMHeight(int height) if (mType == MeasurementsType::Standard) { const int row = ui->tableWidget->currentRow(); - data->SetHeight(UnitConvertor(height, Unit::Cm, mUnit)); + VContainer::SetHeight(UnitConvertor(height, Unit::Cm, mUnit)); RefreshData(); ui->tableWidget->selectRow(row); } @@ -201,7 +201,7 @@ void TMainWindow::SetBaseMSize(int size) if (mType == MeasurementsType::Standard) { const int row = ui->tableWidget->currentRow(); - data->SetSize(UnitConvertor(size, Unit::Cm, mUnit)); + VContainer::SetSize(UnitConvertor(size, Unit::Cm, mUnit)); RefreshData(); ui->tableWidget->selectRow(row); } @@ -287,8 +287,8 @@ bool TMainWindow::LoadFile(const QString &path) mUnit = m->MUnit(); pUnit = mUnit; - data->SetHeight(m->BaseHeight()); - data->SetSize(m->BaseSize()); + VContainer::SetHeight(m->BaseHeight()); + VContainer::SetSize(m->BaseSize()); ui->labelToolTip->setVisible(false); ui->tabWidget->setVisible(true); @@ -353,8 +353,8 @@ void TMainWindow::FileNew() mType = measurements.Type(); data = new VContainer(qApp->TrVars(), &mUnit); - data->SetHeight(measurements.BaseHeight()); - data->SetSize(measurements.BaseSize()); + VContainer::SetHeight(measurements.BaseHeight()); + VContainer::SetSize(measurements.BaseSize()); if (mType == MeasurementsType::Standard) { @@ -1401,7 +1401,7 @@ void TMainWindow::ImportFromPattern() void TMainWindow::ChangedSize(const QString &text) { const int row = ui->tableWidget->currentRow(); - data->SetSize(text.toInt()); + VContainer::SetSize(text.toInt()); RefreshData(); search->RefreshList(ui->lineEditFind->text()); ui->tableWidget->selectRow(row); @@ -1411,7 +1411,7 @@ void TMainWindow::ChangedSize(const QString &text) void TMainWindow::ChangedHeight(const QString &text) { const int row = ui->tableWidget->currentRow(); - data->SetHeight(text.toInt()); + VContainer::SetHeight(text.toInt()); RefreshData(); search->RefreshList(ui->lineEditFind->text()); ui->tableWidget->selectRow(row); @@ -1997,13 +1997,13 @@ void TMainWindow::InitWindow() labelGradationHeights = new QLabel(tr("Height:")); gradationHeights = SetGradationList(labelGradationHeights, listHeights); - SetDefaultHeight(static_cast(data->height())); + SetDefaultHeight(static_cast(VContainer::height())); connect(gradationHeights, static_cast(&QComboBox::currentIndexChanged), this, &TMainWindow::ChangedHeight); labelGradationSizes = new QLabel(tr("Size:")); gradationSizes = SetGradationList(labelGradationSizes, listSizes); - SetDefaultSize(static_cast(data->size())); + SetDefaultSize(static_cast(VContainer::size())); connect(gradationSizes, static_cast(&QComboBox::currentIndexChanged), this, &TMainWindow::ChangedSize); @@ -2319,7 +2319,7 @@ void TMainWindow::SetDefaultHeight(int value) } else { - data->SetHeight(gradationHeights->currentText().toInt()); + VContainer::SetHeight(gradationHeights->currentText().toInt()); } } @@ -2333,14 +2333,14 @@ void TMainWindow::SetDefaultSize(int value) } else { - data->SetSize(gradationSizes->currentText().toInt()); + VContainer::SetSize(gradationSizes->currentText().toInt()); } } //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::RefreshData() { - data->ClearUniqueNames(); + VContainer::ClearUniqueNames(); data->ClearVariables(VarType::Measurement); m->ReadMeasurements(); @@ -2812,8 +2812,8 @@ bool TMainWindow::LoadFromExistingFile(const QString &path) mUnit = m->MUnit(); pUnit = mUnit; - data->SetHeight(m->BaseHeight()); - data->SetSize(m->BaseSize()); + VContainer::SetHeight(m->BaseHeight()); + VContainer::SetSize(m->BaseSize()); ui->labelToolTip->setVisible(false); ui->tabWidget->setVisible(true); diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index f1dc4a997..08e3179e3 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -178,8 +178,8 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con { //fixme: trying to make sure there are no save/load dialogs are opened, because error message during them will //lead to crash - const bool topWinAllowsPop = (qApp->activeModalWidget() == nullptr) || - !qApp->activeModalWidget()->inherits("QFileDialog"); + const bool topWinAllowsPop = (QApplication::activeModalWidget() == nullptr) || + !QApplication::activeModalWidget()->inherits("QFileDialog"); QMessageBox messageBox; switch (type) @@ -298,9 +298,10 @@ void VApplication::NewValentina(const QString &fileName) qCDebug(vApp, "Open new detached process."); if (fileName.isEmpty()) { - qCDebug(vApp, "New process without arguments. program = %s", qUtf8Printable(qApp->applicationFilePath())); + qCDebug(vApp, "New process without arguments. program = %s", + qUtf8Printable(QCoreApplication::applicationFilePath())); // Path can contain spaces. - if (QProcess::startDetached("\""+qApp->applicationFilePath()+"\"")) + if (QProcess::startDetached("\""+QCoreApplication::applicationFilePath()+"\"")) { qCDebug(vApp, "The process was started successfully."); } @@ -311,7 +312,7 @@ void VApplication::NewValentina(const QString &fileName) } else { - const QString run = QString("\"%1\" \"%2\"").arg(qApp->applicationFilePath()).arg(fileName); + const QString run = QString("\"%1\" \"%2\"").arg(QCoreApplication::applicationFilePath()).arg(fileName); qCDebug(vApp, "New process with arguments. program = %s", qUtf8Printable(run)); if (QProcess::startDetached(run)) { @@ -466,7 +467,7 @@ QString VApplication::LogDirPath() const //--------------------------------------------------------------------------------------------------------------------- QString VApplication::LogPath() const { - return QString("%1/valentina-pid%2.log").arg(LogDirPath()).arg(qApp->applicationPid()); + return QString("%1/valentina-pid%2.log").arg(LogDirPath()).arg(applicationPid()); } //--------------------------------------------------------------------------------------------------------------------- @@ -562,8 +563,8 @@ void VApplication::InitOptions() qDebug()<<"Build revision:"<arguments(); - qDebug()<<"Process ID:"<applicationPid(); + qDebug()<<"Command-line arguments:"<(pattern->height()); + const int height = static_cast(VContainer::height()); index = ui->comboBoxHeight->findText(QString().setNum(height)); if (index != -1) { @@ -653,7 +653,7 @@ void DialogPatternProperties::SetDefaultSize(const QString &def) } else { - const int size = static_cast(pattern->size()); + const int size = static_cast(VContainer::size()); index = ui->comboBoxSize->findText(QString().setNum(size)); if (index != -1) { diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 618ee18b3..80b15fc92 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -492,8 +492,8 @@ bool MainWindow::UpdateMeasurements(const QString &path, int size, int height) if (m->Type() == MeasurementsType::Standard) { - pattern->SetSize(size); - pattern->SetHeight(height); + VContainer::SetSize(size); + VContainer::SetHeight(height); } try @@ -1128,7 +1128,7 @@ void MainWindow::ClosedDialogGroup(int result) { DialogGroup *dialog = qobject_cast(dialogTool); SCASSERT(dialog != nullptr) - const QDomElement group = doc->CreateGroup(pattern->getNextId(), dialog->GetName(), dialog->GetGroup()); + const QDomElement group = doc->CreateGroup(VContainer::getNextId(), dialog->GetName(), dialog->GetGroup()); if (not group.isNull()) { AddGroup *addGroup = new AddGroup(group, doc); @@ -1374,7 +1374,7 @@ void MainWindow::closeEvent(QCloseEvent *event) FileClosedCorrect(); event->accept(); - qApp->closeAllWindows(); + QApplication::closeAllWindows(); } else { @@ -1560,9 +1560,9 @@ void MainWindow::ShowMeasurements() << "-u" << VDomDocument::UnitsToStr(qApp->patternUnit()) << "-e" - << QString().setNum(static_cast(UnitConvertor(pattern->height(), doc->MUnit(), Unit::Cm))) + << QString().setNum(static_cast(UnitConvertor(VContainer::height(), doc->MUnit(), Unit::Cm))) << "-s" - << QString().setNum(static_cast(UnitConvertor(pattern->size(), doc->MUnit(), Unit::Cm))); + << QString().setNum(static_cast(UnitConvertor(VContainer::size(), doc->MUnit(), Unit::Cm))); } else { @@ -1623,7 +1623,7 @@ void MainWindow::SyncMeasurements() if (mChanges) { const QString path = AbsoluteMPath(curFile, doc->MPath()); - if(UpdateMeasurements(path, static_cast(pattern->size()), static_cast(pattern->height()))) + if(UpdateMeasurements(path, static_cast(VContainer::size()), static_cast(VContainer::height()))) { if (not watcher->files().contains(path)) { @@ -1717,7 +1717,7 @@ void MainWindow::ToolBarOption() ui->toolBarOption->addSeparator(); } - mouseCoordinate = new QLabel(QString("0, 0 (%1)").arg(doc->UnitsToStr(qApp->patternUnit(), true))); + mouseCoordinate = new QLabel(QString("0, 0 (%1)").arg(VDomDocument::UnitsToStr(qApp->patternUnit(), true))); ui->toolBarOption->addWidget(mouseCoordinate); } @@ -1886,7 +1886,7 @@ void MainWindow::MouseMove(const QPointF &scenePos) //: Coords in status line: "X, Y (units)" mouseCoordinate->setText(QString("%1, %2 (%3)").arg(static_cast(qApp->fromPixel(scenePos.x()))) .arg(static_cast(qApp->fromPixel(scenePos.y()))) - .arg(doc->UnitsToStr(qApp->patternUnit(), true))); + .arg(VDomDocument::UnitsToStr(qApp->patternUnit(), true))); } } @@ -3030,7 +3030,7 @@ void MainWindow::New() AddPP(patternPieceName); - mouseCoordinate = new QLabel(QString("0, 0 (%1)").arg(doc->UnitsToStr(qApp->patternUnit(), true))); + mouseCoordinate = new QLabel(QString("0, 0 (%1)").arg(VDomDocument::UnitsToStr(qApp->patternUnit(), true))); ui->toolBarOption->addWidget(mouseCoordinate); } else @@ -3061,8 +3061,8 @@ void MainWindow::PatternChangesWereSaved(bool saved) */ void MainWindow::ChangedSize(const QString & text) { - const int size = static_cast(pattern->size()); - if (UpdateMeasurements(AbsoluteMPath(curFile, doc->MPath()), text.toInt(), static_cast(pattern->height()))) + const int size = static_cast(VContainer::size()); + if (UpdateMeasurements(AbsoluteMPath(curFile, doc->MPath()), text.toInt(), static_cast(VContainer::height()))) { doc->LiteParseTree(Document::LiteParse); emit sceneDetails->DimensionsChanged(); @@ -3090,8 +3090,8 @@ void MainWindow::ChangedSize(const QString & text) */ void MainWindow::ChangedHeight(const QString &text) { - const int height = static_cast(pattern->height()); - if (UpdateMeasurements(AbsoluteMPath(curFile, doc->MPath()), static_cast(pattern->size()), text.toInt())) + const int height = static_cast(VContainer::height()); + if (UpdateMeasurements(AbsoluteMPath(curFile, doc->MPath()), static_cast(VContainer::size()), text.toInt())) { doc->LiteParseTree(Document::LiteParse); emit sceneDetails->DimensionsChanged(); @@ -3123,13 +3123,13 @@ void MainWindow::SetDefaultHeight() } else { - index = gradationHeights->findText(QString().setNum(pattern->height())); + index = gradationHeights->findText(QString().setNum(VContainer::height())); if (index != -1) { gradationHeights->setCurrentIndex(index); } } - pattern->SetHeight(gradationHeights->currentText().toInt()); + VContainer::SetHeight(gradationHeights->currentText().toInt()); } //--------------------------------------------------------------------------------------------------------------------- @@ -3143,13 +3143,13 @@ void MainWindow::SetDefaultSize() } else { - index = gradationSizes->findText(QString().setNum(pattern->size())); + index = gradationSizes->findText(QString().setNum(VContainer::size())); if (index != -1) { gradationSizes->setCurrentIndex(index); } } - pattern->SetSize(gradationSizes->currentText().toInt()); + VContainer::SetSize(gradationSizes->currentText().toInt()); } //--------------------------------------------------------------------------------------------------------------------- @@ -4384,7 +4384,7 @@ QString MainWindow::CheckPathToMeasurements(const QString &patternPath, const QS QFileInfo table(path); if (table.exists() == false) { - if (!qApp->IsGUIMode()) + if (!VApplication::IsGUIMode()) { return QString();// console mode doesn't support fixing path to a measurement file } @@ -4627,7 +4627,7 @@ void MainWindow::DoExport(const VCommandLinePtr &expParams) //--------------------------------------------------------------------------------------------------------------------- bool MainWindow::SetSize(const QString &text) { - if (not qApp->IsGUIMode()) + if (not VApplication::IsGUIMode()) { if (this->isWindowModified() || not curFile.isEmpty()) { @@ -4670,7 +4670,7 @@ bool MainWindow::SetSize(const QString &text) //--------------------------------------------------------------------------------------------------------------------- bool MainWindow::SetHeight(const QString &text) { - if (not qApp->IsGUIMode()) + if (not VApplication::IsGUIMode()) { if (this->isWindowModified() || not curFile.isEmpty()) { diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index ed2928768..b01b4b1cf 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -487,7 +487,7 @@ void MainWindowsNoGUI::PrepareDetailsForLayout(const QHash *det QHash::const_iterator i = details->constBegin(); while (i != details->constEnd()) { - VAbstractTool *tool = qobject_cast(doc->getTool(i.key())); + VAbstractTool *tool = qobject_cast(VAbstractPattern::getTool(i.key())); SCASSERT(tool != nullptr) listDetails.append(VLayoutPiece::Create(i.value(), tool->getData())); ++i; @@ -643,7 +643,8 @@ void MainWindowsNoGUI::PdfFile(const QString &name, int i) const if (paper) { QPrinter printer; - printer.setCreator(qApp->applicationDisplayName()+QLatin1String(" ")+qApp->applicationVersion()); + printer.setCreator(QGuiApplication::applicationDisplayName()+QLatin1String(" ")+ + QCoreApplication::applicationVersion()); printer.setOutputFormat(QPrinter::PdfFormat); printer.setOutputFileName(name); printer.setDocName(FileName()); @@ -956,7 +957,7 @@ void MainWindowsNoGUI::LayoutPrint() void MainWindowsNoGUI::SetPrinterSettings(QPrinter *printer, const PrintType &printType) { SCASSERT(printer != nullptr) - printer->setCreator(qApp->applicationDisplayName()+" "+qApp->applicationVersion()); + printer->setCreator(QGuiApplication::applicationDisplayName()+" "+QCoreApplication::applicationVersion()); // Set orientation if (paperSize.height() >= paperSize.width()) diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index db96f0fbd..2f3d002e7 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -3458,7 +3458,7 @@ QString VPattern::GenerateLabel(const LabelType &type, const QString &reservedNa QString VPattern::GenerateSuffix() const { const QString suffixBase = GetLabelBase(static_cast(GetIndexActivPP())).toLower(); - const QStringList uniqueNames = data->AllUniqueNames(); + const QStringList uniqueNames = VContainer::AllUniqueNames(); qint32 num = 1; QString suffix; for (;;) @@ -3717,7 +3717,7 @@ void VPattern::PrepareForParse(const Document &parse) } else if (parse == Document::LiteParse) { - data->ClearUniqueNames(); + VContainer::ClearUniqueNames(); data->ClearVariables(VarType::Increment); data->ClearVariables(VarType::LineAngle); data->ClearVariables(VarType::LineLength); diff --git a/src/libs/fervor/fvupdatewindow.cpp b/src/libs/fervor/fvupdatewindow.cpp index 88af5b4a8..241a52226 100644 --- a/src/libs/fervor/fvupdatewindow.cpp +++ b/src/libs/fervor/fvupdatewindow.cpp @@ -42,7 +42,8 @@ FvUpdateWindow::FvUpdateWindow(QWidget *parent) setAttribute(Qt::WA_DeleteOnClose, true); // Set the "new version is available" string - const QString newVersString = m_ui->newVersionIsAvailableLabel->text().arg(qApp->applicationDisplayName()); + const QString newVersString = m_ui->newVersionIsAvailableLabel->text() + .arg(QGuiApplication::applicationDisplayName()); m_ui->newVersionIsAvailableLabel->setText(newVersString); // Connect buttons @@ -67,7 +68,8 @@ bool FvUpdateWindow::UpdateWindowWithCurrentProposedUpdate() } const QString downloadString = m_ui->wouldYouLikeToDownloadLabel->text() - .arg(qApp->applicationDisplayName(), proposedUpdate->GetEnclosureVersion(), qApp->applicationVersion()); + .arg(QGuiApplication::applicationDisplayName(), proposedUpdate->GetEnclosureVersion(), + QCoreApplication::applicationVersion()); m_ui->wouldYouLikeToDownloadLabel->setText(downloadString); return true; diff --git a/src/libs/qmuparser/qmuparsertokenreader.cpp b/src/libs/qmuparser/qmuparsertokenreader.cpp index 45670468d..41741630a 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.cpp +++ b/src/libs/qmuparser/qmuparsertokenreader.cpp @@ -389,7 +389,7 @@ QT_WARNING_POP */ bool QmuParserTokenReader::IsBuiltIn ( token_type &a_Tok ) { - const QStringList pOprtDef = m_pParser->GetOprtDef(); + const QStringList pOprtDef = QmuParserBase::GetOprtDef(); // Compare token with function and operator strings // check string for operator/function @@ -663,7 +663,7 @@ bool QmuParserTokenReader::IsOprt ( token_type &a_Tok ) } // Check if the operator is a built in operator, if so ignore it here - const QStringList &pOprtDef = m_pParser->GetOprtDef(); + const QStringList &pOprtDef = QmuParserBase::GetOprtDef(); QStringList::const_iterator constIterator; for ( constIterator = pOprtDef.constBegin(); m_pParser->HasBuiltInOprt() && constIterator != pOprtDef.constEnd(); ++constIterator ) diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp index 1abd8b8db..a0de35275 100644 --- a/src/libs/vformat/vmeasurements.cpp +++ b/src/libs/vformat/vmeasurements.cpp @@ -675,13 +675,13 @@ bool VMeasurements::IsDefinedKnownNamesValid() const //--------------------------------------------------------------------------------------------------------------------- void VMeasurements::SetDataSize() { - data->SetSize(UnitConvertor(BaseSize(), MUnit(), *data->GetPatternUnit())); + VContainer::SetSize(UnitConvertor(BaseSize(), MUnit(), *data->GetPatternUnit())); } //--------------------------------------------------------------------------------------------------------------------- void VMeasurements::SetDataHeight() { - data->SetHeight(UnitConvertor(BaseHeight(), MUnit(), *data->GetPatternUnit())); + VContainer::SetHeight(UnitConvertor(BaseHeight(), MUnit(), *data->GetPatternUnit())); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 7d9595a60..1ddb6fc8e 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -397,14 +397,14 @@ VLayoutPiece VLayoutPiece::Create(const VPiece &piece, const VContainer *pattern const VPieceLabelData& data = piece.GetPatternPieceData(); if (data.IsVisible() == true) { - det.SetDetail(piece.GetName(), data, qApp->font(), pattern); + det.SetDetail(piece.GetName(), data, QApplication::font(), pattern); } const VPatternLabelData& geom = piece.GetPatternInfo(); if (geom.IsVisible() == true) { VAbstractPattern* pDoc = qApp->getCurrentDocument(); - det.SetPatternInfo(pDoc, geom, qApp->font(), pattern->size(), pattern->height(), pattern); + det.SetPatternInfo(pDoc, geom, QApplication::font(), VContainer::size(), VContainer::height(), pattern); } const VGrainlineData& grainlineGeom = piece.GetGrainlineGeometry(); diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp index 66928d72a..236f2561b 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp @@ -250,7 +250,7 @@ void DialogFlippingByAxis::SuffixChanged() if (m_suffix != suffix) { QRegularExpression rx(NameRegExp()); - const QStringList uniqueNames = data->AllUniqueNames(); + const QStringList uniqueNames = VContainer::AllUniqueNames(); for (int i=0; i < uniqueNames.size(); ++i) { const QString name = uniqueNames.at(i) + suffix; diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp index 7324ea684..07e010fd1 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp @@ -279,7 +279,7 @@ void DialogFlippingByLine::SuffixChanged() if (m_suffix != suffix) { QRegularExpression rx(NameRegExp()); - const QStringList uniqueNames = data->AllUniqueNames(); + const QStringList uniqueNames = VContainer::AllUniqueNames(); for (int i=0; i < uniqueNames.size(); ++i) { const QString name = uniqueNames.at(i) + suffix; diff --git a/src/libs/vtools/dialogs/tools/dialogmove.cpp b/src/libs/vtools/dialogs/tools/dialogmove.cpp index e1251ce6c..7fce06f03 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.cpp +++ b/src/libs/vtools/dialogs/tools/dialogmove.cpp @@ -340,7 +340,7 @@ void DialogMove::SuffixChanged() if (m_suffix != suffix) { QRegularExpression rx(NameRegExp()); - const QStringList uniqueNames = data->AllUniqueNames(); + const QStringList uniqueNames = VContainer::AllUniqueNames(); for (int i=0; i < uniqueNames.size(); ++i) { const QString name = uniqueNames.at(i) + suffix; diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.cpp b/src/libs/vtools/dialogs/tools/dialogrotation.cpp index 98e1a326c..9259be628 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.cpp +++ b/src/libs/vtools/dialogs/tools/dialogrotation.cpp @@ -321,7 +321,7 @@ void DialogRotation::SuffixChanged() if (m_suffix != suffix) { QRegularExpression rx(NameRegExp()); - const QStringList uniqueNames = data->AllUniqueNames(); + const QStringList uniqueNames = VContainer::AllUniqueNames(); for (int i=0; i < uniqueNames.size(); ++i) { const QString name = uniqueNames.at(i) + suffix; diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.cpp index a5eb68c7d..3b1015100 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vabstractflipping.cpp @@ -60,7 +60,7 @@ void VAbstractFlipping::CreateDestination(Source typeCreation, quint32 &id, QVec { dest.clear();// Try to avoid mistake, value must be empty - id = data->getNextId();//Just reserve id for tool + id = VContainer::getNextId();//Just reserve id for tool for (int i = 0; i < source.size(); ++i) { diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index 177c2907b..03a8f4c98 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -134,7 +134,7 @@ VToolFlippingByAxis *VToolFlippingByAxis::Create(const quint32 _id, quint32 orig dest, typeCreation); scene->addItem(tool); InitOperationToolConnections(scene, tool); - doc->AddTool(id, tool); + VAbstractPattern::AddTool(id, tool); doc->IncrementReferens(originPoint.getIdTool()); for (int i = 0; i < source.size(); ++i) { @@ -156,7 +156,7 @@ void VToolFlippingByAxis::SetAxisType(AxisType value) { m_axisType = value; - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index ed10af982..ec768fe27 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -128,7 +128,7 @@ VToolFlippingByLine *VToolFlippingByLine::Create(const quint32 _id, quint32 firs source, dest, typeCreation); scene->addItem(tool); InitOperationToolConnections(scene, tool); - doc->AddTool(id, tool); + VAbstractPattern::AddTool(id, tool); doc->IncrementReferens(firstPoint.getIdTool()); doc->IncrementReferens(secondPoint.getIdTool()); for (int i = 0; i < source.size(); ++i) diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index 493f24ead..10fbbfa33 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -62,7 +62,7 @@ void VAbstractOperation::SetSuffix(const QString &suffix) { // Don't know if need check name here. this->suffix = suffix; - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } @@ -423,7 +423,7 @@ VAbstractOperation::VAbstractOperation(VAbstractPattern *doc, VContainer *data, void VAbstractOperation::AddToFile() { QDomElement domElement = doc->createElement(getTagName()); - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOptions(domElement, obj); AddToCalculation(domElement); } @@ -434,7 +434,7 @@ void VAbstractOperation::RefreshDataInFile() QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOptions(domElement, obj); } else diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp index b1fb346bd..6a53541af 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp @@ -130,7 +130,7 @@ VToolMove *VToolMove::Create(quint32 _id, QString &formulaAngle, QString &formul { dest.clear();// Try to avoid mistake, value must be empty - id = data->getNextId();//Just reserve id for tool + id = VContainer::getNextId();//Just reserve id for tool for (int i = 0; i < source.size(); ++i) { @@ -229,7 +229,7 @@ QT_WARNING_POP typeCreation); scene->addItem(tool); InitOperationToolConnections(scene, tool); - doc->AddTool(id, tool); + VAbstractPattern::AddTool(id, tool); for (int i = 0; i < source.size(); ++i) { doc->IncrementReferens(data->GetGObject(source.at(i))->getIdTool()); @@ -256,7 +256,7 @@ void VToolMove::SetFormulaAngle(const VFormula &value) { formulaAngle = value.GetFormula(FormulaType::FromUser); - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } } @@ -278,7 +278,7 @@ void VToolMove::SetFormulaLength(const VFormula &value) { formulaLength = value.GetFormula(FormulaType::FromUser); - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } } diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index 6dc19e515..79582ead6 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -148,7 +148,7 @@ VToolRotation *VToolRotation::Create(const quint32 _id, const quint32 &origin, Q { dest.clear();// Try to avoid mistake, value must be empty - id = data->getNextId();//Just reserve id for tool + id = VContainer::getNextId();//Just reserve id for tool for (int i = 0; i < source.size(); ++i) { @@ -244,7 +244,7 @@ QT_WARNING_POP VToolRotation *tool = new VToolRotation(doc, data, id, origin, angle, suffix, source, dest, typeCreation); scene->addItem(tool); InitOperationToolConnections(scene, tool); - doc->AddTool(id, tool); + VAbstractPattern::AddTool(id, tool); doc->IncrementReferens(originPoint.getIdTool()); for (int i = 0; i < source.size(); ++i) { @@ -278,7 +278,7 @@ void VToolRotation::SetFormulaAngle(const VFormula &value) { formulaAngle = value.GetFormula(FormulaType::FromUser); - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp index 8b341a426..70bc4db9b 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp @@ -174,7 +174,7 @@ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &ra VToolArc *toolArc = new VToolArc(doc, data, id, typeCreation); scene->addItem(toolArc); InitArcToolConnections(scene, toolArc); - doc->AddTool(id, toolArc); + VAbstractPattern::AddTool(id, toolArc); doc->IncrementReferens(c.getIdTool()); return toolArc; } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp index 7b6b46bf3..be17b4fb2 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp @@ -144,7 +144,7 @@ VToolArcWithLength *VToolArcWithLength::Create(const quint32 _id, const quint32 VToolArcWithLength *toolArc = new VToolArcWithLength(doc, data, id, typeCreation); scene->addItem(toolArc); InitArcToolConnections(scene, toolArc); - doc->AddTool(id, toolArc); + VAbstractPattern::AddTool(id, toolArc); doc->IncrementReferens(c.getIdTool()); return toolArc; } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp index 130aa9766..31ac52704 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp @@ -132,7 +132,7 @@ VToolCubicBezier *VToolCubicBezier::Create(const quint32 _id, VCubicBezier *spli auto _spl = new VToolCubicBezier(doc, data, id, typeCreation); scene->addItem(_spl); InitSplineToolConnections(scene, _spl); - doc->AddTool(id, _spl); + VAbstractPattern::AddTool(id, _spl); doc->IncrementReferens(spline->GetP1().getIdTool()); doc->IncrementReferens(spline->GetP1().getIdTool()); doc->IncrementReferens(spline->GetP1().getIdTool()); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp index e9950f62f..58dd025de 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp @@ -137,7 +137,7 @@ VToolCubicBezierPath *VToolCubicBezierPath::Create(const quint32 _id, VCubicBezi VToolCubicBezierPath *spl = new VToolCubicBezierPath(doc, data, id, typeCreation); scene->addItem(spl); InitSplinePathToolConnections(scene, spl); - doc->AddTool(id, spl); + VAbstractPattern::AddTool(id, spl); return spl; } return nullptr; diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp index cf6b5f8c1..8c969d275 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp @@ -188,7 +188,7 @@ VToolEllipticalArc* VToolEllipticalArc::Create(const quint32 _id, const quint32 VToolEllipticalArc *toolEllipticalArc = new VToolEllipticalArc(doc, data, id, typeCreation); scene->addItem(toolEllipticalArc); InitElArcToolConnections(scene, toolEllipticalArc); - doc->AddTool(id, toolEllipticalArc); + VAbstractPattern::AddTool(id, toolEllipticalArc); doc->IncrementReferens(c.getIdTool()); return toolEllipticalArc; } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index c2aa013a2..6d3b5063c 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -209,7 +209,7 @@ VToolSpline* VToolSpline::Create(const quint32 _id, VSpline *spline, const QStri auto _spl = new VToolSpline(doc, data, id, typeCreation); scene->addItem(_spl); InitSplineToolConnections(scene, _spl); - doc->AddTool(id, _spl); + VAbstractPattern::AddTool(id, _spl); doc->IncrementReferens(spline->GetP1().getIdTool()); doc->IncrementReferens(spline->GetP4().getIdTool()); return _spl; diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index 45863c18a..cc5970b69 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -220,7 +220,7 @@ VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, c VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation); scene->addItem(spl); InitSplinePathToolConnections(scene, spl); - doc->AddTool(id, spl); + VAbstractPattern::AddTool(id, spl); return spl; } return nullptr; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp index afd69b858..6da332a60 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp @@ -386,7 +386,7 @@ void VToolDoublePoint::SaveOptions(QDomElement &tag, QSharedPointer &o void VToolDoublePoint::AddToFile() { QDomElement domElement = doc->createElement(getTagName()); - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOptions(domElement, obj); AddToCalculation(domElement); } @@ -397,7 +397,7 @@ void VToolDoublePoint::RefreshDataInFile() QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOptions(domElement, obj); } else diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp index 2d34feb3a..17af7ee53 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp @@ -173,7 +173,7 @@ VToolTrueDarts *VToolTrueDarts::Create(quint32 _id, quint32 p2id = _p2id; if (typeCreation == Source::FromGui) { - id = data->getNextId();//Just reserve id for tool + id = VContainer::getNextId();//Just reserve id for tool p1id = data->AddGObject(new VPointF(fPoint1, point1Name, mx1, my1, id)); p2id = data->AddGObject(new VPointF(fPoint2, point2Name, mx2, my2, id)); } @@ -194,7 +194,7 @@ VToolTrueDarts *VToolTrueDarts::Create(quint32 _id, dartP1Id, dartP2Id, dartP3Id, typeCreation); scene->addItem(points); InitToolConnections(scene, points); - doc->AddTool(id, points); + VAbstractPattern::AddTool(id, points); doc->IncrementReferens(baseLineP1->getIdTool()); doc->IncrementReferens(baseLineP2->getIdTool()); doc->IncrementReferens(dartP1->getIdTool()); @@ -254,7 +254,7 @@ void VToolTrueDarts::SetBaseLineP1Id(const quint32 &value) { baseLineP1Id = value; - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } } @@ -272,7 +272,7 @@ void VToolTrueDarts::SetBaseLineP2Id(const quint32 &value) { baseLineP2Id = value; - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } } @@ -290,7 +290,7 @@ void VToolTrueDarts::SetDartP1Id(const quint32 &value) { dartP1Id = value; - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } } @@ -308,7 +308,7 @@ void VToolTrueDarts::SetDartP2Id(const quint32 &value) { dartP2Id = value; - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } } @@ -326,7 +326,7 @@ void VToolTrueDarts::SetDartP3Id(const quint32 &value) { dartP3Id = value; - QSharedPointer obj = VAbstractTool::data.GetFakeGObject(id); + QSharedPointer obj = VContainer::GetFakeGObject(id); SaveOption(obj); } } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h index e93383222..258a8e010 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h @@ -108,7 +108,7 @@ inline void VToolCut::ShowToolVisualization(bool show) delete vis; } - VDataTool *parent = doc->getTool(VAbstractTool::data.GetGObject(curveCutId)->getIdTool()); + VDataTool *parent = VAbstractPattern::getTool(VAbstractTool::data.GetGObject(curveCutId)->getIdTool()); if (VAbstractSpline *parentCurve = qobject_cast(parent)) { detailsMode ? parentCurve->ShowHandles(detailsMode) : parentCurve->ShowHandles(show); 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 1c6312a78..6a139e54a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp @@ -148,8 +148,8 @@ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QS if (typeCreation == Source::FromGui) { id = data->AddGObject(p); - a1->setId(data->getNextId()); - a2->setId(data->getNextId()); + a1->setId(VContainer::getNextId()); + a2->setId(VContainer::getNextId()); data->AddArc(a1, a1->id(), id); data->AddArc(a2, a2->id(), id); } @@ -173,7 +173,7 @@ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QS VToolCutArc *point = new VToolCutArc(doc, data, id, formula, arcId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(arc->getIdTool()); return point; } 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 80aa19cdc..6e7701303 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp @@ -174,7 +174,7 @@ VToolCutSpline* VToolCutSpline::Create(const quint32 _id, const QString &pointNa VToolCutSpline *point = new VToolCutSpline(doc, data, id, formula, splineId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(spl->getIdTool()); return point; } 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 601791095..86fec306f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp @@ -185,7 +185,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString VToolCutSplinePath *point = new VToolCutSplinePath(doc, data, id, formula, splinePathId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(splPath->getIdTool()); return point; } 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 2b3f1ce43..75c244911 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp @@ -306,7 +306,7 @@ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointNa typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(firstPoint->getIdTool()); doc->IncrementReferens(secondPoint->getIdTool()); } 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 8c0fe719a..066e04f23 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp @@ -219,7 +219,7 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const secondPointId, thirdPointId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(firstPoint->getIdTool()); doc->IncrementReferens(secondPoint->getIdTool()); doc->IncrementReferens(thirdPoint->getIdTool()); 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 f032c03ee..a8c21594d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -148,8 +148,8 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, cons id = data->AddGObject(p); data->AddLine(basePointId, id); - data->getNextId(); - data->getNextId(); + VContainer::getNextId(); + VContainer::getNextId(); InitSegments(curve->getType(), segLength, p, curveId, data); } else @@ -172,7 +172,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, cons basePointId, curveId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(basePoint->getIdTool()); doc->IncrementReferens(curve->getIdTool()); return point; 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 4e6add8e6..506b5b4d4 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp @@ -186,7 +186,7 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, basePointId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(basePoint->getIdTool()); return point; } 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 87f892aa6..816718408 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp @@ -178,7 +178,7 @@ VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, co typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(basePoint->getIdTool()); doc->IncrementReferens(p1Line->getIdTool()); doc->IncrementReferens(p2Line->getIdTool()); 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 19b955c87..116968089 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp @@ -160,7 +160,7 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(basePoint->getIdTool()); doc->IncrementReferens(firstPoint->getIdTool()); doc->IncrementReferens(secondPoint->getIdTool()); 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 2a4d21c98..d21c5aa20 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp @@ -182,7 +182,7 @@ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quin secondPointId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(firstPoint->getIdTool()); doc->IncrementReferens(secondPoint->getIdTool()); return point; 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 839da734a..8169c7f59 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp @@ -229,7 +229,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(firstPoint->getIdTool()); doc->IncrementReferens(secondPoint->getIdTool()); doc->IncrementReferens(shoulderPoint->getIdTool()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp index 19b49e4a8..e8564722f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp @@ -138,7 +138,7 @@ VToolBasePoint *VToolBasePoint::Create(quint32 _id, const QString &nameActivPP, VToolBasePoint *spoint = new VToolBasePoint(doc, data, id, typeCreation, nameActivPP); scene->addItem(spoint); InitToolConnections(scene, spoint); - doc->AddTool(id, spoint); + VAbstractPattern::AddTool(id, spoint); return spoint; } return nullptr; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp index 03430b391..b4fdcfd2b 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp @@ -188,7 +188,7 @@ VToolLineIntersect* VToolLineIntersect::Create(const quint32 _id, const quint32 p2Line2Id, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(p1Line1->getIdTool()); doc->IncrementReferens(p2Line1->getIdTool()); doc->IncrementReferens(p1Line2->getIdTool()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp index b66652e2b..edf32f773 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp @@ -130,7 +130,7 @@ VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(const quint32 _ crossPoint, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(arc.getIdTool()); doc->IncrementReferens(tPoint.getIdTool()); return point; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp index 876e84a0c..1e451b514 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp @@ -140,7 +140,7 @@ VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(const qui crossPoint, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(cPoint.getIdTool()); doc->IncrementReferens(tPoint.getIdTool()); return point; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp index d291f999d..933add83e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp @@ -241,7 +241,7 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad firstPointId, secondPointId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(centerP->getIdTool()); doc->IncrementReferens(firstP->getIdTool()); doc->IncrementReferens(secondP->getIdTool()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp index 34c31d403..d788645dc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp @@ -163,7 +163,7 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(const quint32 _id, co secondPointId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(firstPoint->getIdTool()); doc->IncrementReferens(secondPoint->getIdTool()); return point; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp index 1a578728e..9a66530d3 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp @@ -131,7 +131,7 @@ VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(const quint32 secondArcId, pType, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(firstArc->getIdTool()); doc->IncrementReferens(secondArc->getIdTool()); return point; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp index 7daad360a..8153b9302 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp @@ -152,7 +152,7 @@ VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(const q typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(c1Point.getIdTool()); doc->IncrementReferens(c2Point.getIdTool()); return point; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index a29dad3f9..10ae2ed96 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -140,7 +140,7 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(const qui hCrossPoint, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(curve1->getIdTool()); doc->IncrementReferens(curve2->getIdTool()); return point; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp index a756755da..e0c71cfab 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp @@ -173,7 +173,7 @@ VToolTriangle* VToolTriangle::Create(const quint32 _id, const QString &pointName secondPointId, typeCreation); scene->addItem(point); InitToolConnections(scene, point); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); doc->IncrementReferens(axisP1->getIdTool()); doc->IncrementReferens(axisP2->getIdTool()); doc->IncrementReferens(firstPoint->getIdTool()); diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.cpp b/src/libs/vtools/tools/drawTools/vdrawtool.cpp index fffead828..259144188 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.cpp +++ b/src/libs/vtools/tools/drawTools/vdrawtool.cpp @@ -268,7 +268,7 @@ void VDrawTool::DialogLinkDestroy() */ void VDrawTool::SetFactor(qreal factor) { - CheckFactor(this->factor, factor); + CheckFactor(VDrawTool::factor, factor); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index b19c0e293..d52fa3c20 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -153,7 +153,7 @@ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, con quint32 id = _id; if (typeCreation == Source::FromGui) { - id = data->getNextId(); + id = VContainer::getNextId(); data->AddLine(firstPoint, secondPoint); } else @@ -174,7 +174,7 @@ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, con InitDrawToolConnections(scene, line); connect(scene, &VMainGraphicsScene::EnableLineItemSelection, line, &VToolLine::AllowSelecting); connect(scene, &VMainGraphicsScene::EnableLineItemHover, line, &VToolLine::AllowHover); - doc->AddTool(id, line); + VAbstractPattern::AddTool(id, line); const QSharedPointer first = data->GeometricObject(firstPoint); const QSharedPointer second = data->GeometricObject(secondPoint); diff --git a/src/libs/vtools/tools/nodeDetails/vnodearc.cpp b/src/libs/vtools/tools/nodeDetails/vnodearc.cpp index c7660a3a5..14b7e670c 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodearc.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodearc.cpp @@ -78,11 +78,11 @@ void VNodeArc::Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint VAbstractTool::AddRecord(id, Tool::NodeArc, doc); VNodeArc *arc = new VNodeArc(doc, data, id, idArc, typeCreation, drawName, idTool, doc); - doc->AddTool(id, arc); + VAbstractPattern::AddTool(id, arc); if (idTool != NULL_ID) { //Some nodes we don't show on scene. Tool that create this nodes must free memory. - VDataTool *tool = doc->getTool(idTool); + VDataTool *tool = VAbstractPattern::getTool(idTool); SCASSERT(tool != nullptr) arc->setParent(tool);// Adopted by a tool } diff --git a/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp b/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp index 2bc64a0b9..13a746854 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp @@ -51,11 +51,11 @@ void VNodeEllipticalArc::Create(VAbstractPattern *doc, VContainer *data, quint32 VAbstractTool::AddRecord(id, Tool::NodeElArc, doc); VNodeEllipticalArc *arc = new VNodeEllipticalArc(doc, data, id, idArc, typeCreation, drawName, idTool, doc); - doc->AddTool(id, arc); + VAbstractPattern::AddTool(id, arc); if (idTool != NULL_ID) { //Some nodes we don't show on scene. Tool that create this nodes must free memory. - VDataTool *tool = doc->getTool(idTool); + VDataTool *tool = VAbstractPattern::getTool(idTool); SCASSERT(tool != nullptr) arc->setParent(tool);// Adopted by a tool } diff --git a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index 2d645a141..714e692fe 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -120,11 +120,11 @@ void VNodePoint::Create(VAbstractPattern *doc, VContainer *data, VMainGraphicsSc connect(scene, &VMainGraphicsScene::EnablePointItemSelection, point, &VNodePoint::AllowSelecting); connect(scene, &VMainGraphicsScene::EnableLabelItemHover, point, &VNodePoint::AllowLabelHover); connect(scene, &VMainGraphicsScene::EnableLabelItemSelection, point, &VNodePoint::AllowLabelSelecting); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); if (idTool != NULL_ID) { //Some nodes we don't show on scene. Tool that create this nodes must free memory. - VDataTool *tool = doc->getTool(idTool); + VDataTool *tool = VAbstractPattern::getTool(idTool); SCASSERT(tool != nullptr) point->setParent(tool);// Adopted by a tool } diff --git a/src/libs/vtools/tools/nodeDetails/vnodespline.cpp b/src/libs/vtools/tools/nodeDetails/vnodespline.cpp index dd3df98dd..dfad04c80 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodespline.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodespline.cpp @@ -81,11 +81,11 @@ VNodeSpline *VNodeSpline::Create(VAbstractPattern *doc, VContainer *data, quint3 VAbstractTool::AddRecord(id, Tool::NodeSpline, doc); spl = new VNodeSpline(doc, data, id, idSpline, typeCreation, drawName, idTool, doc); - doc->AddTool(id, spl); + VAbstractPattern::AddTool(id, spl); if (idTool != NULL_ID) { //Some nodes we don't show on scene. Tool that create this nodes must free memory. - VDataTool *tool = doc->getTool(idTool); + VDataTool *tool = VAbstractPattern::getTool(idTool); SCASSERT(tool != nullptr) spl->setParent(tool);// Adopted by a tool } diff --git a/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp b/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp index 8e8aa4b0d..0bb53f899 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodesplinepath.cpp @@ -80,11 +80,11 @@ void VNodeSplinePath::Create(VAbstractPattern *doc, VContainer *data, quint32 id VAbstractTool::AddRecord(id, Tool::NodeSplinePath, doc); VNodeSplinePath *splPath = new VNodeSplinePath(doc, data, id, idSpline, typeCreation, drawName, idTool, doc); - doc->AddTool(id, splPath); + VAbstractPattern::AddTool(id, splPath); if (idTool != NULL_ID) { //Some nodes we don't show on scene. Tool that create this nodes must free memory. - VDataTool *tool = doc->getTool(idTool); + VDataTool *tool = VAbstractPattern::getTool(idTool); SCASSERT(tool != nullptr) splPath->setParent(tool);// Adopted by a tool } diff --git a/src/libs/vtools/tools/nodeDetails/vtoolpiecepath.cpp b/src/libs/vtools/tools/nodeDetails/vtoolpiecepath.cpp index 2d060ea89..738ec30ce 100644 --- a/src/libs/vtools/tools/nodeDetails/vtoolpiecepath.cpp +++ b/src/libs/vtools/tools/nodeDetails/vtoolpiecepath.cpp @@ -75,11 +75,11 @@ VToolPiecePath *VToolPiecePath::Create(quint32 _id, const VPiecePath &path, quin //Better check garbage before each saving file. Check only modeling tags. VToolPiecePath *pathTool = new VToolPiecePath(doc, data, id, pieceId, typeCreation, drawName, idTool, doc); - doc->AddTool(id, pathTool); + VAbstractPattern::AddTool(id, pathTool); if (idTool != NULL_ID) { //Some nodes we don't show on scene. Tool that create this nodes must free memory. - VDataTool *tool = doc->getTool(idTool); + VDataTool *tool = VAbstractPattern::getTool(idTool); SCASSERT(tool != nullptr); pathTool->setParent(tool);// Adopted by a tool } @@ -88,7 +88,7 @@ VToolPiecePath *VToolPiecePath::Create(quint32 _id, const VPiecePath &path, quin if (typeCreation == Source::FromGui && path.GetType() == PiecePathType::InternalPath) { // Seam allowance tool already initializated and can't init the path SCASSERT(pieceId > NULL_ID); - VToolSeamAllowance *saTool = qobject_cast(doc->getTool(pieceId)); + VToolSeamAllowance *saTool = qobject_cast(VAbstractPattern::getTool(pieceId)); SCASSERT(saTool != nullptr); pathTool->setParentItem(saTool); pathTool->SetParentType(ParentType::Item); diff --git a/src/libs/vtools/tools/nodeDetails/vtoolpin.cpp b/src/libs/vtools/tools/nodeDetails/vtoolpin.cpp index da8000827..0c66bfd08 100644 --- a/src/libs/vtools/tools/nodeDetails/vtoolpin.cpp +++ b/src/libs/vtools/tools/nodeDetails/vtoolpin.cpp @@ -82,11 +82,11 @@ VToolPin *VToolPin::Create(quint32 _id, quint32 pointId, quint32 pieceId, VAbstr { point = new VToolPin(doc, data, id, pointId, pieceId, typeCreation, drawName, idTool, doc); - doc->AddTool(id, point); + VAbstractPattern::AddTool(id, point); if (idTool != NULL_ID) { //Some nodes we don't show on scene. Tool that create this nodes must free memory. - VDataTool *tool = doc->getTool(idTool); + VDataTool *tool = VAbstractPattern::getTool(idTool); SCASSERT(tool != nullptr) point->setParent(tool);// Adopted by a tool } diff --git a/src/libs/vtools/tools/vabstracttool.cpp b/src/libs/vtools/tools/vabstracttool.cpp index eb3036c03..e4397de57 100644 --- a/src/libs/vtools/tools/vabstracttool.cpp +++ b/src/libs/vtools/tools/vabstracttool.cpp @@ -278,7 +278,7 @@ int VAbstractTool::ConfirmDeletion() msgBox.setText(tr("Do you really want to delete?")); msgBox.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); msgBox.setDefaultButton(QDialogButtonBox::No); - msgBox.setIconPixmap(qApp->style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(32, 32) ); + msgBox.setIconPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(32, 32) ); int dialogResult = msgBox.exec(); diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index d02b237ee..3bcbd3976 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -145,7 +145,7 @@ VToolSeamAllowance *VToolSeamAllowance::Create(quint32 id, VPiece newPiece, QStr connect(scene, &VMainGraphicsScene::EnableDetailItemHover, piece, &VToolSeamAllowance::AllowHover); connect(scene, &VMainGraphicsScene::EnableDetailItemSelection, piece, &VToolSeamAllowance::AllowSelecting); connect(scene, &VMainGraphicsScene::HighlightDetail, piece, &VToolSeamAllowance::Highlight); - doc->AddTool(id, piece); + VAbstractPattern::AddTool(id, piece); } //Very important to delete it. Only this tool need this special variable. data->RemoveVariable(currentSeamAllowance); @@ -198,7 +198,7 @@ void VToolSeamAllowance::InsertNode(VPieceNode node, quint32 pieceId, VMainGraph newDet.GetPath().Append(node); // Seam allowance tool already initializated and can't init the node - VToolSeamAllowance *saTool = qobject_cast(doc->getTool(pieceId)); + VToolSeamAllowance *saTool = qobject_cast(VAbstractPattern::getTool(pieceId)); SCASSERT(saTool != nullptr); InitNode(node, scene, data, doc, saTool); @@ -568,7 +568,7 @@ void VToolSeamAllowance::UpdateLabel() } m_dataLabel->SetMoveType(type); - QFont fnt = qApp->font(); + QFont fnt = QApplication::font(); { const int iFS = labelData.GetFontSize(); iFS < MIN_FONT_SIZE ? fnt.setPixelSize(MIN_FONT_SIZE) : fnt.setPixelSize(iFS); @@ -624,7 +624,7 @@ void VToolSeamAllowance::UpdatePatternInfo() } m_patternInfo->SetMoveType(type); - QFont fnt = qApp->font(); + QFont fnt = QApplication::font(); int iFS = geom.GetFontSize(); if (iFS < MIN_FONT_SIZE) { @@ -634,7 +634,7 @@ void VToolSeamAllowance::UpdatePatternInfo() m_patternInfo->SetFont(fnt); m_patternInfo->SetSize(ToPixel(labelWidth, *VDataTool::data.GetPatternUnit()), ToPixel(labelHeight, *VDataTool::data.GetPatternUnit())); - m_patternInfo->UpdateData(doc, getData()->size(), getData()->height()); + m_patternInfo->UpdateData(doc, VContainer::size(), VContainer::height()); QRectF rectBB; rectBB.setTopLeft(pos); @@ -1217,7 +1217,7 @@ void VToolSeamAllowance::UpdateExcludeState() const VPieceNode &node = detail.GetPath().at(i); if (node.GetTypeTool() == Tool::NodePoint) { - VNodePoint *tool = qobject_cast(doc->getTool(node.GetId())); + VNodePoint *tool = qobject_cast(VAbstractPattern::getTool(node.GetId())); SCASSERT(tool != nullptr); tool->SetExluded(node.IsExcluded()); @@ -1474,7 +1474,7 @@ void VToolSeamAllowance::InitNode(const VPieceNode &node, VMainGraphicsScene *sc { case (Tool::NodePoint): { - VNodePoint *tool = qobject_cast(doc->getTool(node.GetId())); + VNodePoint *tool = qobject_cast(VAbstractPattern::getTool(node.GetId())); SCASSERT(tool != nullptr); connect(tool, &VNodePoint::ShowContextMenu, parent, &VToolSeamAllowance::contextMenuEvent); @@ -1512,7 +1512,7 @@ void VToolSeamAllowance::InitInternalPaths(const VPiece &detail) { for (int i = 0; i < detail.GetInternalPaths().size(); ++i) { - VToolPiecePath *tool = qobject_cast(doc->getTool(detail.GetInternalPaths().at(i))); + auto *tool = qobject_cast(VAbstractPattern::getTool(detail.GetInternalPaths().at(i))); SCASSERT(tool != nullptr); tool->setParentItem(this); tool->SetParentType(ParentType::Item); diff --git a/src/libs/vtools/tools/vtooluniondetails.cpp b/src/libs/vtools/tools/vtooluniondetails.cpp index 3e35e9776..ef040ae14 100644 --- a/src/libs/vtools/tools/vtooluniondetails.cpp +++ b/src/libs/vtools/tools/vtooluniondetails.cpp @@ -1299,7 +1299,7 @@ void CreateUnitedDetail(quint32 id, const VToolUnionDetailsInitData &initData, q auto RemoveDetail = [initData](quint32 id) { - VToolSeamAllowance *toolDet = qobject_cast(initData.doc->getTool(id)); + VToolSeamAllowance *toolDet = qobject_cast(VAbstractPattern::getTool(id)); SCASSERT(toolDet != nullptr); bool ask = false; toolDet->Remove(ask); @@ -1472,7 +1472,7 @@ VToolUnionDetails* VToolUnionDetails::Create(const quint32 _id, const VToolUnion quint32 id = _id; if (initData.typeCreation == Source::FromGui) { - id = initData.data->getNextId(); + id = VContainer::getNextId(); } else { @@ -1488,7 +1488,7 @@ VToolUnionDetails* VToolUnionDetails::Create(const quint32 _id, const VToolUnion VAbstractTool::AddRecord(id, Tool::UnionDetails, initData.doc); //Scene doesn't show this tool, so doc will destroy this object. unionDetails = new VToolUnionDetails(id, initData); - initData.doc->AddTool(id, unionDetails); + VAbstractPattern::AddTool(id, unionDetails); // Unfortunatelly doc will destroy all objects only in the end, but we should delete them before each FullParse initData.doc->AddToolOnRemove(unionDetails); } diff --git a/src/libs/vtools/undocommands/deletepiece.cpp b/src/libs/vtools/undocommands/deletepiece.cpp index b1c97a45d..1a58eff5b 100644 --- a/src/libs/vtools/undocommands/deletepiece.cpp +++ b/src/libs/vtools/undocommands/deletepiece.cpp @@ -98,7 +98,7 @@ void DeletePiece::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. - VToolSeamAllowance *toolDet = qobject_cast(doc->getTool(nodeId)); + VToolSeamAllowance *toolDet = qobject_cast(VAbstractPattern::getTool(nodeId)); SCASSERT(toolDet != nullptr); toolDet->hide(); diff --git a/src/test/ValentinaTest/tst_vmeasurements.cpp b/src/test/ValentinaTest/tst_vmeasurements.cpp index 8f1f8309c..05be20ca5 100644 --- a/src/test/ValentinaTest/tst_vmeasurements.cpp +++ b/src/test/ValentinaTest/tst_vmeasurements.cpp @@ -50,8 +50,8 @@ void TST_VMeasurements::CreateEmptyStandardFile() const int size = 50; QSharedPointer data = QSharedPointer(new VContainer(nullptr, &mUnit)); - data->SetHeight(height); - data->SetSize(size); + VContainer::SetHeight(height); + VContainer::SetSize(size); QSharedPointer m = QSharedPointer(new VMeasurements(mUnit, size, height, data.data())); @@ -138,8 +138,8 @@ void TST_VMeasurements::ValidPMCodesStandardFile() const int size = 50; QSharedPointer data = QSharedPointer(new VContainer(nullptr, &mUnit)); - data->SetHeight(height); - data->SetSize(size); + VContainer::SetHeight(height); + VContainer::SetSize(size); QSharedPointer m = QSharedPointer(new VMeasurements(mUnit, size, height, data.data()));