diff --git a/src/app/tape/dialogs/dialogabouttape.cpp b/src/app/tape/dialogs/dialogabouttape.cpp index afeeab282..5e6ea7884 100644 --- a/src/app/tape/dialogs/dialogabouttape.cpp +++ b/src/app/tape/dialogs/dialogabouttape.cpp @@ -34,13 +34,15 @@ #include #include #include +#include #include #include //--------------------------------------------------------------------------------------------------------------------- DialogAboutTape::DialogAboutTape(QWidget *parent) :QDialog(parent), - ui(new Ui::DialogAboutTape) + ui(new Ui::DialogAboutTape), + isInitialized(false) { ui->setupUi(this); @@ -54,10 +56,6 @@ DialogAboutTape::DialogAboutTape(QWidget *parent) FontPointSize(ui->label_Legal_Stuff, 11); FontPointSize(ui->label_Tape_Built, 11); FontPointSize(ui->label_QT_Version, 11); - - adjustSize(); - setMaximumSize(size()); - setMinimumSize(size()); } //--------------------------------------------------------------------------------------------------------------------- @@ -80,6 +78,27 @@ void DialogAboutTape::changeEvent(QEvent *event) QDialog::changeEvent(event); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogAboutTape::showEvent(QShowEvent *event) +{ + QDialog::showEvent( event ); + if ( event->spontaneous() ) + { + return; + } + + if (isInitialized) + { + return; + } + // do your init stuff here + + setMaximumSize(size()); + setMinimumSize(size()); + + isInitialized = true;//first show windows are held +} + //--------------------------------------------------------------------------------------------------------------------- void DialogAboutTape::WebButtonClicked() { diff --git a/src/app/tape/dialogs/dialogabouttape.h b/src/app/tape/dialogs/dialogabouttape.h index 7722bb496..d3927dfd6 100644 --- a/src/app/tape/dialogs/dialogabouttape.h +++ b/src/app/tape/dialogs/dialogabouttape.h @@ -45,6 +45,7 @@ public: protected: virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE; + virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; private slots: void WebButtonClicked(); @@ -52,6 +53,7 @@ private slots: private: Q_DISABLE_COPY(DialogAboutTape) Ui::DialogAboutTape *ui; + bool isInitialized; void FontPointSize(QWidget *w, int pointSize); diff --git a/src/app/tape/dialogs/dialognewmeasurements.cpp b/src/app/tape/dialogs/dialognewmeasurements.cpp index 36387f82e..72d7dc098 100644 --- a/src/app/tape/dialogs/dialognewmeasurements.cpp +++ b/src/app/tape/dialogs/dialognewmeasurements.cpp @@ -31,10 +31,13 @@ #include "../vpatterndb/variables/vmeasurement.h" +#include + //--------------------------------------------------------------------------------------------------------------------- DialogNewMeasurements::DialogNewMeasurements(QWidget *parent) :QDialog(parent), - ui(new Ui::DialogNewMeasurements) + ui(new Ui::DialogNewMeasurements), + isInitialized(false) { ui->setupUi(this); @@ -48,10 +51,6 @@ DialogNewMeasurements::DialogNewMeasurements(QWidget *parent) connect(ui->comboBoxUnit, static_cast(&QComboBox::currentIndexChanged), this, &DialogNewMeasurements::CurrentUnitChanged); - - adjustSize(); - setMaximumSize(size()); - setMinimumSize(size()); } //--------------------------------------------------------------------------------------------------------------------- @@ -100,6 +99,27 @@ void DialogNewMeasurements::changeEvent(QEvent *event) QDialog::changeEvent(event); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogNewMeasurements::showEvent(QShowEvent *event) +{ + QDialog::showEvent( event ); + if ( event->spontaneous() ) + { + return; + } + + if (isInitialized) + { + return; + } + // do your init stuff here + + setMaximumSize(size()); + setMinimumSize(size()); + + isInitialized = true;//first show windows are held +} + //--------------------------------------------------------------------------------------------------------------------- void DialogNewMeasurements::CurrentTypeChanged(int index) { diff --git a/src/app/tape/dialogs/dialognewmeasurements.h b/src/app/tape/dialogs/dialognewmeasurements.h index 41562a954..ffc7d4449 100644 --- a/src/app/tape/dialogs/dialognewmeasurements.h +++ b/src/app/tape/dialogs/dialognewmeasurements.h @@ -53,6 +53,7 @@ public: protected: virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE; + virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; private slots: void CurrentTypeChanged(int index); @@ -61,6 +62,7 @@ private slots: private: Q_DISABLE_COPY(DialogNewMeasurements) Ui::DialogNewMeasurements *ui; + bool isInitialized; void InitMTypes(); void InitHeightsList(); diff --git a/src/app/valentina/dialogs/dialogaboutapp.cpp b/src/app/valentina/dialogs/dialogaboutapp.cpp index f8cad0ddb..37be0ab3d 100644 --- a/src/app/valentina/dialogs/dialogaboutapp.cpp +++ b/src/app/valentina/dialogs/dialogaboutapp.cpp @@ -39,7 +39,8 @@ //--------------------------------------------------------------------------------------------------------------------- DialogAboutApp::DialogAboutApp(QWidget *parent) : QDialog(parent), - ui(new Ui::DialogAboutApp) + ui(new Ui::DialogAboutApp), + isInitialized(false) { ui->setupUi(this); @@ -66,9 +67,6 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) : FontPointSize(ui->label_contrib_label, 11); FontPointSize(ui->label_Valentina_Built, 11); FontPointSize(ui->label_QT_Version, 11); - - setMaximumSize(size()); - setMinimumSize(size()); } //--------------------------------------------------------------------------------------------------------------------- @@ -77,6 +75,27 @@ DialogAboutApp::~DialogAboutApp() delete ui; } +//--------------------------------------------------------------------------------------------------------------------- +void DialogAboutApp::showEvent(QShowEvent *event) +{ + QDialog::showEvent( event ); + if ( event->spontaneous() ) + { + return; + } + + if (isInitialized) + { + return; + } + // do your init stuff here + + setMaximumSize(size()); + setMinimumSize(size()); + + isInitialized = true;//first show windows are held +} + //--------------------------------------------------------------------------------------------------------------------- void DialogAboutApp::FontPointSize(QWidget *w, int pointSize) { diff --git a/src/app/valentina/dialogs/dialogaboutapp.h b/src/app/valentina/dialogs/dialogaboutapp.h index 684176d2d..5e8ce6b17 100644 --- a/src/app/valentina/dialogs/dialogaboutapp.h +++ b/src/app/valentina/dialogs/dialogaboutapp.h @@ -44,8 +44,12 @@ public: explicit DialogAboutApp(QWidget *parent = 0); ~DialogAboutApp(); +protected: + virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; + private: Ui::DialogAboutApp *ui; + bool isInitialized; Q_DISABLE_COPY(DialogAboutApp) void FontPointSize(QWidget *w, int pointSize); diff --git a/src/app/valentina/dialogs/dialoglayoutprogress.cpp b/src/app/valentina/dialogs/dialoglayoutprogress.cpp index ae89fa76c..0f236b912 100644 --- a/src/app/valentina/dialogs/dialoglayoutprogress.cpp +++ b/src/app/valentina/dialogs/dialoglayoutprogress.cpp @@ -38,7 +38,7 @@ //--------------------------------------------------------------------------------------------------------------------- DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) - :QDialog(parent), ui(new Ui::DialogLayoutProgress), maxCount(count), movie(nullptr) + :QDialog(parent), ui(new Ui::DialogLayoutProgress), maxCount(count), movie(nullptr), isInitialized(false) { ui->setupUi(this); @@ -59,9 +59,6 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) setModal(true); this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint); - - setMaximumSize(size()); - setMinimumSize(size()); } //--------------------------------------------------------------------------------------------------------------------- @@ -117,3 +114,24 @@ void DialogLayoutProgress::StopWorking() { emit Abort(); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::showEvent(QShowEvent *event) +{ + QDialog::showEvent( event ); + if ( event->spontaneous() ) + { + return; + } + + if (isInitialized) + { + return; + } + // do your init stuff here + + setMaximumSize(size()); + setMinimumSize(size()); + + isInitialized = true;//first show windows are held +} diff --git a/src/app/valentina/dialogs/dialoglayoutprogress.h b/src/app/valentina/dialogs/dialoglayoutprogress.h index 4ece9abe7..38eb0b96e 100644 --- a/src/app/valentina/dialogs/dialoglayoutprogress.h +++ b/src/app/valentina/dialogs/dialoglayoutprogress.h @@ -56,11 +56,15 @@ public slots: void Finished(); void StopWorking(); +protected: + virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; + private: Q_DISABLE_COPY(DialogLayoutProgress) Ui::DialogLayoutProgress *ui; const int maxCount; QMovie *movie; + bool isInitialized; }; #endif // DIALOGLAYOUTPROGRESS_H diff --git a/src/app/valentina/dialogs/dialognewpattern.cpp b/src/app/valentina/dialogs/dialognewpattern.cpp index b68b461e5..f37dd127a 100644 --- a/src/app/valentina/dialogs/dialognewpattern.cpp +++ b/src/app/valentina/dialogs/dialognewpattern.cpp @@ -41,7 +41,7 @@ //--------------------------------------------------------------------------------------------------------------------- DialogNewPattern::DialogNewPattern(VContainer *data, const QString &patternPieceName, QWidget *parent) - :QDialog(parent), ui(new Ui::DialogNewPattern), data(data) + :QDialog(parent), ui(new Ui::DialogNewPattern), data(data), isInitialized(false) { ui->setupUi(this); @@ -56,9 +56,6 @@ DialogNewPattern::DialogNewPattern(VContainer *data, const QString &patternPiece InitUnits(); CheckState(); connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogNewPattern::CheckState); - - setMaximumSize(size()); - setMinimumSize(size()); } //--------------------------------------------------------------------------------------------------------------------- @@ -88,6 +85,27 @@ void DialogNewPattern::CheckState() bOk->setEnabled(flagName); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogNewPattern::showEvent(QShowEvent *event) +{ + QDialog::showEvent( event ); + if ( event->spontaneous() ) + { + return; + } + + if (isInitialized) + { + return; + } + // do your init stuff here + + setMaximumSize(size()); + setMinimumSize(size()); + + isInitialized = true;//first show windows are held +} + //--------------------------------------------------------------------------------------------------------------------- void DialogNewPattern::InitUnits() { diff --git a/src/app/valentina/dialogs/dialognewpattern.h b/src/app/valentina/dialogs/dialognewpattern.h index 966e9d9e7..aeb171b74 100644 --- a/src/app/valentina/dialogs/dialognewpattern.h +++ b/src/app/valentina/dialogs/dialognewpattern.h @@ -50,10 +50,13 @@ public: Unit PatternUnit() const; public slots: void CheckState(); +protected: + virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(DialogNewPattern) Ui::DialogNewPattern *ui; VContainer *data; + bool isInitialized; void InitUnits(); }; diff --git a/src/app/valentina/dialogs/dialogpatternproperties.cpp b/src/app/valentina/dialogs/dialogpatternproperties.cpp index e33b30d5a..49e612efd 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.cpp +++ b/src/app/valentina/dialogs/dialogpatternproperties.cpp @@ -39,7 +39,7 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) : QDialog(parent), ui(new Ui::DialogPatternProperties), doc(doc), heightsChecked(MAX_HEIGHTS), sizesChecked(MAX_SIZES), heights (QMap()), sizes(QMap()), - data(QMap()), descriptionChanged(false), gradationChanged(false) + data(QMap()), descriptionChanged(false), gradationChanged(false), isInitialized(false) { ui->setupUi(this); @@ -80,9 +80,6 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) SetOptions(sizes); gradationChanged = false;//Set to default value after initialization - - setMaximumSize(size()); - setMinimumSize(size()); } //--------------------------------------------------------------------------------------------------------------------- @@ -254,6 +251,27 @@ void DialogPatternProperties::DescEdited() descriptionChanged = true; } +//--------------------------------------------------------------------------------------------------------------------- +void DialogPatternProperties::showEvent(QShowEvent *event) +{ + QDialog::showEvent( event ); + if ( event->spontaneous() ) + { + return; + } + + if (isInitialized) + { + return; + } + // do your init stuff here + + setMaximumSize(size()); + setMinimumSize(size()); + + isInitialized = true;//first show windows are held +} + //--------------------------------------------------------------------------------------------------------------------- void DialogPatternProperties::SetHeightsChecked(bool enabled) { diff --git a/src/app/valentina/dialogs/dialogpatternproperties.h b/src/app/valentina/dialogs/dialogpatternproperties.h index fe25722ec..9baa9b782 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.h +++ b/src/app/valentina/dialogs/dialogpatternproperties.h @@ -56,6 +56,8 @@ public slots: void CheckStateHeight(int state); void CheckStateSize(int state); void DescEdited(); +protected: + virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(DialogPatternProperties) Ui::DialogPatternProperties *ui; @@ -67,6 +69,7 @@ private: QMap data; bool descriptionChanged; bool gradationChanged; + bool isInitialized; void SetHeightsChecked(bool enabled); void SetSizesChecked(bool enabled); diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index 48f5e0b6c..7e407755f 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -46,7 +46,7 @@ bool DialogSaveLayout::tested = false; //--------------------------------------------------------------------------------------------------------------------- DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget *parent) - :QDialog(parent), ui(new Ui::DialogSaveLAyout), count(count), availFormats(InitAvailFormats()) + :QDialog(parent), ui(new Ui::DialogSaveLAyout), count(count), isInitialized(false), availFormats(InitAvailFormats()) { ui->setupUi(this); @@ -93,9 +93,6 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget * ui->lineEditPath->setText(qApp->ValentinaSettings()->GetPathLayout()); ShowExample();//Show example for current format. - - setMaximumSize(size()); - setMinimumSize(size()); } //--------------------------------------------------------------------------------------------------------------------- @@ -246,6 +243,27 @@ void DialogSaveLayout::PathChanged(const QString &text) ui->lineEditPath->setPalette(palette); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::showEvent(QShowEvent *event) +{ + QDialog::showEvent( event ); + if ( event->spontaneous() ) + { + return; + } + + if (isInitialized) + { + return; + } + // do your init stuff here + + setMaximumSize(size()); + setMinimumSize(size()); + + isInitialized = true;//first show windows are held +} + //--------------------------------------------------------------------------------------------------------------------- bool DialogSaveLayout::SupportPSTest() { diff --git a/src/app/valentina/dialogs/dialogsavelayout.h b/src/app/valentina/dialogs/dialogsavelayout.h index c06d9265a..2d384e4b9 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.h +++ b/src/app/valentina/dialogs/dialogsavelayout.h @@ -62,11 +62,13 @@ public slots: void ShowExample(); void Browse(); void PathChanged(const QString &text); - +protected: + virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(DialogSaveLayout) Ui::DialogSaveLAyout *ui; int count; + bool isInitialized; // Note. We can't make availFormats static because MSVC doesn't support C++11 list initialization QVector> availFormats; static bool havePdf; diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.cpp b/src/libs/vtools/dialogs/tools/dialogalongline.cpp index 817274dce..d64143f6f 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogalongline.cpp @@ -76,8 +76,6 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, // Call after initialization vis!!!! SetTypeLine(TypeLineNone);//By default don't show line - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogarc.cpp b/src/libs/vtools/dialogs/tools/dialogarc.cpp index 6e30dc10c..c3b38859f 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarc.cpp @@ -90,8 +90,6 @@ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *par connect(ui->pushButtonGrowLengthF2, &QPushButton::clicked, this, &DialogArc::DeployF2TextEdit); vis = new VisToolArc(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp index 453bf26b2..e79923182 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp @@ -85,8 +85,6 @@ DialogArcWithLength::DialogArcWithLength(const VContainer *data, const quint32 & connect(ui->pushButtonGrowLengthArcLength, &QPushButton::clicked, this, &DialogArcWithLength::DeployLengthTextEdit); vis = new VisToolArcWithLength(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogbisector.cpp b/src/libs/vtools/dialogs/tools/dialogbisector.cpp index 3cd217775..18f051123 100644 --- a/src/libs/vtools/dialogs/tools/dialogbisector.cpp +++ b/src/libs/vtools/dialogs/tools/dialogbisector.cpp @@ -75,8 +75,6 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QW this, &DialogBisector::PointNameChanged); vis = new VisToolBisector(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp index fa515be5e..8385a9fbe 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp @@ -68,8 +68,6 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const connect(timerFormula, &QTimer::timeout, this, &DialogCurveIntersectAxis::EvalAngle); vis = new VisToolCurveIntersectAxis(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp index 65ea96357..4a897e86e 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp @@ -66,8 +66,6 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit); vis = new VisToolCutArc(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp index 2485849a4..fbb028b63 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp @@ -65,8 +65,6 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId, connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSpline::DeployFormulaTextEdit); vis = new VisToolCutSpline(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp index d5f566890..586572036 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp @@ -65,8 +65,6 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 & connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSplinePath::DeployFormulaTextEdit); vis = new VisToolCutSplinePath(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index 3de799e58..a14c08ccb 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -78,8 +78,6 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge connect(ui.lineEditNameDetail, &QLineEdit::textChanged, this, &DialogDetail::NamePointChanged); connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- @@ -256,7 +254,7 @@ void DialogDetail::setDetail(const VDetail &value) ui.listWidget->clear(); for (int i = 0; i < detail.CountNode(); ++i) { - const VNodeDetail &node = detail.at(i); + const VNodeDetail &node = detail.at(i); NewItem(node.getId(), node.getTypeTool(), node.getTypeNode(), node.getMx(), node.getMy(), node.getReverse()); } diff --git a/src/libs/vtools/dialogs/tools/dialogendline.cpp b/src/libs/vtools/dialogs/tools/dialogendline.cpp index 3473eab7f..d727b4cd9 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogendline.cpp @@ -80,8 +80,6 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid connect(timerFormula, &QTimer::timeout, this, &DialogEndLine::EvalAngle); vis = new VisToolEndLine(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogheight.cpp b/src/libs/vtools/dialogs/tools/dialogheight.cpp index 1f96321c7..28efdc481 100644 --- a/src/libs/vtools/dialogs/tools/dialogheight.cpp +++ b/src/libs/vtools/dialogs/tools/dialogheight.cpp @@ -65,8 +65,6 @@ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidge this, &DialogHeight::PointNameChanged); vis = new VisToolHeight(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogline.cpp b/src/libs/vtools/dialogs/tools/dialogline.cpp index 1873c57db..04545ebf2 100644 --- a/src/libs/vtools/dialogs/tools/dialogline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogline.cpp @@ -63,8 +63,6 @@ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *p this, &DialogLine::PointNameChanged); vis = new VisToolLine(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp index 2797b6316..023f5fac9 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp @@ -65,8 +65,6 @@ DialogLineIntersect::DialogLineIntersect(const VContainer *data, const quint32 & this, &DialogLineIntersect::PointNameChanged); vis = new VisToolLineIntersect(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp index f0b716f9f..ccd2fe9b7 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp @@ -76,8 +76,6 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q this, &DialogLineIntersectAxis::PointNameChanged); vis = new VisToolLineIntersectAxis(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialognormal.cpp b/src/libs/vtools/dialogs/tools/dialognormal.cpp index f9b665f8d..c7d8681da 100644 --- a/src/libs/vtools/dialogs/tools/dialognormal.cpp +++ b/src/libs/vtools/dialogs/tools/dialognormal.cpp @@ -71,8 +71,6 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge this, &DialogNormal::PointNameChanged); vis = new VisToolNormal(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp index 5cfbc2340..3743ed5fd 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp @@ -54,8 +54,6 @@ DialogPointFromArcAndTangent::DialogPointFromArcAndTangent(const VContainer *dat connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointFromArcAndTangent::NamePointChanged); vis = new VisToolPointFromArcAndTangent(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp index 563310ed8..14ae2bab2 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -79,8 +79,6 @@ DialogPointFromCircleAndTangent::DialogPointFromCircleAndTangent(const VContaine &DialogPointFromCircleAndTangent::DeployCircleRadiusTextEdit); vis = new VisToolPointFromCircleAndTangent(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp index 951000019..eaa3302dd 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp @@ -71,8 +71,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 this, &DialogPointOfContact::PointNameChanged); vis = new VisToolPointOfContact(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp index b26901904..a65fd2b4d 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersection.cpp @@ -61,8 +61,6 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, con vis = new VisToolPointOfIntersection(data); vis->VisualMode(NULL_ID);//Show vertical axis - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp index 77683239e..da5c27180 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp @@ -57,8 +57,6 @@ DialogPointOfIntersectionArcs::DialogPointOfIntersectionArcs(const VContainer *d this, &DialogPointOfIntersectionArcs::ArcChanged); vis = new VisToolPointOfIntersectionArcs(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp index 9a54b956b..5afb71289 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -95,8 +95,6 @@ DialogPointOfIntersectionCircles::DialogPointOfIntersectionCircles(const VContai &DialogPointOfIntersectionCircles::DeployCircle2RadiusTextEdit); vis = new VisToolPointOfIntersectionCircles(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp index 0d79a00a9..3f603b4e1 100644 --- a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp @@ -76,8 +76,6 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 & this, &DialogShoulderPoint::PointNameChanged); vis = new VisToolShoulderPoint(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp b/src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp index 9c8963033..d883bbb0d 100644 --- a/src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp +++ b/src/libs/vtools/dialogs/tools/dialogsinglepoint.cpp @@ -48,8 +48,6 @@ DialogSinglePoint::DialogSinglePoint(const VContainer *data, const quint32 &tool CheckState(); connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogTool::NamePointChanged); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogspline.cpp b/src/libs/vtools/dialogs/tools/dialogspline.cpp index 99aefe467..9a12ee58c 100644 --- a/src/libs/vtools/dialogs/tools/dialogspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogspline.cpp @@ -57,8 +57,6 @@ DialogSpline::DialogSpline(const VContainer *data, const quint32 &toolId, QWidge this, &DialogSpline::PointNameChanged); vis = new VisToolSpline(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp index f8f360ef9..57b9a0bfd 100644 --- a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp @@ -61,8 +61,6 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, const quint32 &toolId this, &DialogSplinePath::KAsm2Changed); vis = new VisToolSplinePath(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- @@ -84,7 +82,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value) ui->listWidget->clear(); for (qint32 i = 0; i < path.CountPoint(); ++i) { - const VSplinePoint &point = path.at(i); + const VSplinePoint &point = path.at(i); NewItem(point.P().id(), point.KAsm1(), point.Angle1(), point.KAsm2(), point.Angle2()); } ui->listWidget->setFocus(Qt::OtherFocusReason); diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index 6074269ef..ab0bcf375 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -106,6 +106,11 @@ void DialogTool::showEvent(QShowEvent *event) { return; } + // do your init stuff here + + setMaximumSize(size()); + setMinimumSize(size()); + isInitialized = true;//first show windows are held ShowVisualization(); } @@ -281,13 +286,6 @@ bool DialogTool::eventFilter(QObject *object, QEvent *event) return false; } -//--------------------------------------------------------------------------------------------------------------------- -void DialogTool::FixateSize() -{ - setMaximumSize(size()); - setMinimumSize(size()); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief ValFormulaChanged handle change formula diff --git a/src/libs/vtools/dialogs/tools/dialogtool.h b/src/libs/vtools/dialogs/tools/dialogtool.h index 586e0cb0f..a12c8ad6f 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.h +++ b/src/libs/vtools/dialogs/tools/dialogtool.h @@ -251,7 +251,6 @@ protected: virtual void SaveData() {} void MoveCursorToEnd(QPlainTextEdit *plainTextEdit); bool eventFilter(QObject *object, QEvent *event); - void FixateSize(); private: void FillList(QComboBox *box, const QMap &list)const; diff --git a/src/libs/vtools/dialogs/tools/dialogtriangle.cpp b/src/libs/vtools/dialogs/tools/dialogtriangle.cpp index 26dad5c42..d80c9c948 100644 --- a/src/libs/vtools/dialogs/tools/dialogtriangle.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtriangle.cpp @@ -65,8 +65,6 @@ DialogTriangle::DialogTriangle(const VContainer *data, const quint32 &toolId, QW this, &DialogTriangle::PointNameChanged); vis = new VisToolTriangle(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp b/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp index 01aa42b7c..9a984e068 100644 --- a/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtruedarts.cpp @@ -69,8 +69,6 @@ DialogTrueDarts::DialogTrueDarts(const VContainer *data, const quint32 &toolId, this, &DialogTrueDarts::PointNameChanged); vis = new VisToolTrueDarts(data); - - FixateSize(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialoguniondetails.cpp b/src/libs/vtools/dialogs/tools/dialoguniondetails.cpp index d139a4f66..45174be35 100644 --- a/src/libs/vtools/dialogs/tools/dialoguniondetails.cpp +++ b/src/libs/vtools/dialogs/tools/dialoguniondetails.cpp @@ -43,8 +43,6 @@ DialogUnionDetails::DialogUnionDetails(const VContainer *data, const quint32 &to { ui->setupUi(this); InitOkCancel(ui); - - FixateSize(); } //---------------------------------------------------------------------------------------------------------------------