Disable changing window size only after first show.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-11-05 15:01:33 +02:00
parent 7f065cac89
commit 912d1f91f6
44 changed files with 188 additions and 97 deletions

View File

@ -34,13 +34,15 @@
#include <QDate> #include <QDate>
#include <QDesktopServices> #include <QDesktopServices>
#include <QMessageBox> #include <QMessageBox>
#include <QShowEvent>
#include <QUrl> #include <QUrl>
#include <QtDebug> #include <QtDebug>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogAboutTape::DialogAboutTape(QWidget *parent) DialogAboutTape::DialogAboutTape(QWidget *parent)
:QDialog(parent), :QDialog(parent),
ui(new Ui::DialogAboutTape) ui(new Ui::DialogAboutTape),
isInitialized(false)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -54,10 +56,6 @@ DialogAboutTape::DialogAboutTape(QWidget *parent)
FontPointSize(ui->label_Legal_Stuff, 11); FontPointSize(ui->label_Legal_Stuff, 11);
FontPointSize(ui->label_Tape_Built, 11); FontPointSize(ui->label_Tape_Built, 11);
FontPointSize(ui->label_QT_Version, 11); FontPointSize(ui->label_QT_Version, 11);
adjustSize();
setMaximumSize(size());
setMinimumSize(size());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -80,6 +78,27 @@ void DialogAboutTape::changeEvent(QEvent *event)
QDialog::changeEvent(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() void DialogAboutTape::WebButtonClicked()
{ {

View File

@ -45,6 +45,7 @@ public:
protected: protected:
virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE; virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE;
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
private slots: private slots:
void WebButtonClicked(); void WebButtonClicked();
@ -52,6 +53,7 @@ private slots:
private: private:
Q_DISABLE_COPY(DialogAboutTape) Q_DISABLE_COPY(DialogAboutTape)
Ui::DialogAboutTape *ui; Ui::DialogAboutTape *ui;
bool isInitialized;
void FontPointSize(QWidget *w, int pointSize); void FontPointSize(QWidget *w, int pointSize);

View File

@ -31,10 +31,13 @@
#include "../vpatterndb/variables/vmeasurement.h" #include "../vpatterndb/variables/vmeasurement.h"
#include <QShowEvent>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogNewMeasurements::DialogNewMeasurements(QWidget *parent) DialogNewMeasurements::DialogNewMeasurements(QWidget *parent)
:QDialog(parent), :QDialog(parent),
ui(new Ui::DialogNewMeasurements) ui(new Ui::DialogNewMeasurements),
isInitialized(false)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -48,10 +51,6 @@ DialogNewMeasurements::DialogNewMeasurements(QWidget *parent)
connect(ui->comboBoxUnit, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(ui->comboBoxUnit, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&DialogNewMeasurements::CurrentUnitChanged); &DialogNewMeasurements::CurrentUnitChanged);
adjustSize();
setMaximumSize(size());
setMinimumSize(size());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -100,6 +99,27 @@ void DialogNewMeasurements::changeEvent(QEvent *event)
QDialog::changeEvent(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) void DialogNewMeasurements::CurrentTypeChanged(int index)
{ {

View File

@ -53,6 +53,7 @@ public:
protected: protected:
virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE; virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE;
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
private slots: private slots:
void CurrentTypeChanged(int index); void CurrentTypeChanged(int index);
@ -61,6 +62,7 @@ private slots:
private: private:
Q_DISABLE_COPY(DialogNewMeasurements) Q_DISABLE_COPY(DialogNewMeasurements)
Ui::DialogNewMeasurements *ui; Ui::DialogNewMeasurements *ui;
bool isInitialized;
void InitMTypes(); void InitMTypes();
void InitHeightsList(); void InitHeightsList();

View File

@ -39,7 +39,8 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogAboutApp::DialogAboutApp(QWidget *parent) : DialogAboutApp::DialogAboutApp(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::DialogAboutApp) ui(new Ui::DialogAboutApp),
isInitialized(false)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -66,9 +67,6 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) :
FontPointSize(ui->label_contrib_label, 11); FontPointSize(ui->label_contrib_label, 11);
FontPointSize(ui->label_Valentina_Built, 11); FontPointSize(ui->label_Valentina_Built, 11);
FontPointSize(ui->label_QT_Version, 11); FontPointSize(ui->label_QT_Version, 11);
setMaximumSize(size());
setMinimumSize(size());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -77,6 +75,27 @@ DialogAboutApp::~DialogAboutApp()
delete ui; 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) void DialogAboutApp::FontPointSize(QWidget *w, int pointSize)
{ {

View File

@ -44,8 +44,12 @@ public:
explicit DialogAboutApp(QWidget *parent = 0); explicit DialogAboutApp(QWidget *parent = 0);
~DialogAboutApp(); ~DialogAboutApp();
protected:
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
private: private:
Ui::DialogAboutApp *ui; Ui::DialogAboutApp *ui;
bool isInitialized;
Q_DISABLE_COPY(DialogAboutApp) Q_DISABLE_COPY(DialogAboutApp)
void FontPointSize(QWidget *w, int pointSize); void FontPointSize(QWidget *w, int pointSize);

View File

@ -38,7 +38,7 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) 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); ui->setupUi(this);
@ -59,9 +59,6 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent)
setModal(true); setModal(true);
this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint); this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
setMaximumSize(size());
setMinimumSize(size());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -117,3 +114,24 @@ void DialogLayoutProgress::StopWorking()
{ {
emit Abort(); 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
}

View File

@ -56,11 +56,15 @@ public slots:
void Finished(); void Finished();
void StopWorking(); void StopWorking();
protected:
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
private: private:
Q_DISABLE_COPY(DialogLayoutProgress) Q_DISABLE_COPY(DialogLayoutProgress)
Ui::DialogLayoutProgress *ui; Ui::DialogLayoutProgress *ui;
const int maxCount; const int maxCount;
QMovie *movie; QMovie *movie;
bool isInitialized;
}; };
#endif // DIALOGLAYOUTPROGRESS_H #endif // DIALOGLAYOUTPROGRESS_H

View File

@ -41,7 +41,7 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogNewPattern::DialogNewPattern(VContainer *data, const QString &patternPieceName, QWidget *parent) 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); ui->setupUi(this);
@ -56,9 +56,6 @@ DialogNewPattern::DialogNewPattern(VContainer *data, const QString &patternPiece
InitUnits(); InitUnits();
CheckState(); CheckState();
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogNewPattern::CheckState); connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogNewPattern::CheckState);
setMaximumSize(size());
setMinimumSize(size());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -88,6 +85,27 @@ void DialogNewPattern::CheckState()
bOk->setEnabled(flagName); 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() void DialogNewPattern::InitUnits()
{ {

View File

@ -50,10 +50,13 @@ public:
Unit PatternUnit() const; Unit PatternUnit() const;
public slots: public slots:
void CheckState(); void CheckState();
protected:
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
private: private:
Q_DISABLE_COPY(DialogNewPattern) Q_DISABLE_COPY(DialogNewPattern)
Ui::DialogNewPattern *ui; Ui::DialogNewPattern *ui;
VContainer *data; VContainer *data;
bool isInitialized;
void InitUnits(); void InitUnits();
}; };

View File

@ -39,7 +39,7 @@
DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) : DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) :
QDialog(parent), ui(new Ui::DialogPatternProperties), doc(doc), heightsChecked(MAX_HEIGHTS), QDialog(parent), ui(new Ui::DialogPatternProperties), doc(doc), heightsChecked(MAX_HEIGHTS),
sizesChecked(MAX_SIZES), heights (QMap<GHeights, bool>()), sizes(QMap<GSizes, bool>()), sizesChecked(MAX_SIZES), heights (QMap<GHeights, bool>()), sizes(QMap<GSizes, bool>()),
data(QMap<QCheckBox *, int>()), descriptionChanged(false), gradationChanged(false) data(QMap<QCheckBox *, int>()), descriptionChanged(false), gradationChanged(false), isInitialized(false)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -80,9 +80,6 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent)
SetOptions(sizes); SetOptions(sizes);
gradationChanged = false;//Set to default value after initialization gradationChanged = false;//Set to default value after initialization
setMaximumSize(size());
setMinimumSize(size());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -254,6 +251,27 @@ void DialogPatternProperties::DescEdited()
descriptionChanged = true; 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) void DialogPatternProperties::SetHeightsChecked(bool enabled)
{ {

View File

@ -56,6 +56,8 @@ public slots:
void CheckStateHeight(int state); void CheckStateHeight(int state);
void CheckStateSize(int state); void CheckStateSize(int state);
void DescEdited(); void DescEdited();
protected:
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
private: private:
Q_DISABLE_COPY(DialogPatternProperties) Q_DISABLE_COPY(DialogPatternProperties)
Ui::DialogPatternProperties *ui; Ui::DialogPatternProperties *ui;
@ -67,6 +69,7 @@ private:
QMap<QCheckBox *, int> data; QMap<QCheckBox *, int> data;
bool descriptionChanged; bool descriptionChanged;
bool gradationChanged; bool gradationChanged;
bool isInitialized;
void SetHeightsChecked(bool enabled); void SetHeightsChecked(bool enabled);
void SetSizesChecked(bool enabled); void SetSizesChecked(bool enabled);

View File

@ -46,7 +46,7 @@ bool DialogSaveLayout::tested = false;
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget *parent) 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); ui->setupUi(this);
@ -93,9 +93,6 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget *
ui->lineEditPath->setText(qApp->ValentinaSettings()->GetPathLayout()); ui->lineEditPath->setText(qApp->ValentinaSettings()->GetPathLayout());
ShowExample();//Show example for current format. ShowExample();//Show example for current format.
setMaximumSize(size());
setMinimumSize(size());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -246,6 +243,27 @@ void DialogSaveLayout::PathChanged(const QString &text)
ui->lineEditPath->setPalette(palette); 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() bool DialogSaveLayout::SupportPSTest()
{ {

View File

@ -62,11 +62,13 @@ public slots:
void ShowExample(); void ShowExample();
void Browse(); void Browse();
void PathChanged(const QString &text); void PathChanged(const QString &text);
protected:
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
private: private:
Q_DISABLE_COPY(DialogSaveLayout) Q_DISABLE_COPY(DialogSaveLayout)
Ui::DialogSaveLAyout *ui; Ui::DialogSaveLAyout *ui;
int count; int count;
bool isInitialized;
// Note. We can't make availFormats static because MSVC doesn't support C++11 list initialization // Note. We can't make availFormats static because MSVC doesn't support C++11 list initialization
QVector<std::pair<QString, QString>> availFormats; QVector<std::pair<QString, QString>> availFormats;
static bool havePdf; static bool havePdf;

View File

@ -76,8 +76,6 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId,
// Call after initialization vis!!!! // Call after initialization vis!!!!
SetTypeLine(TypeLineNone);//By default don't show line SetTypeLine(TypeLineNone);//By default don't show line
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -90,8 +90,6 @@ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *par
connect(ui->pushButtonGrowLengthF2, &QPushButton::clicked, this, &DialogArc::DeployF2TextEdit); connect(ui->pushButtonGrowLengthF2, &QPushButton::clicked, this, &DialogArc::DeployF2TextEdit);
vis = new VisToolArc(data); vis = new VisToolArc(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -85,8 +85,6 @@ DialogArcWithLength::DialogArcWithLength(const VContainer *data, const quint32 &
connect(ui->pushButtonGrowLengthArcLength, &QPushButton::clicked, this, &DialogArcWithLength::DeployLengthTextEdit); connect(ui->pushButtonGrowLengthArcLength, &QPushButton::clicked, this, &DialogArcWithLength::DeployLengthTextEdit);
vis = new VisToolArcWithLength(data); vis = new VisToolArcWithLength(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -75,8 +75,6 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QW
this, &DialogBisector::PointNameChanged); this, &DialogBisector::PointNameChanged);
vis = new VisToolBisector(data); vis = new VisToolBisector(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -68,8 +68,6 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const
connect(timerFormula, &QTimer::timeout, this, &DialogCurveIntersectAxis::EvalAngle); connect(timerFormula, &QTimer::timeout, this, &DialogCurveIntersectAxis::EvalAngle);
vis = new VisToolCurveIntersectAxis(data); vis = new VisToolCurveIntersectAxis(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -66,8 +66,6 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit);
vis = new VisToolCutArc(data); vis = new VisToolCutArc(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -65,8 +65,6 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId,
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSpline::DeployFormulaTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSpline::DeployFormulaTextEdit);
vis = new VisToolCutSpline(data); vis = new VisToolCutSpline(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -65,8 +65,6 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 &
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSplinePath::DeployFormulaTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSplinePath::DeployFormulaTextEdit);
vis = new VisToolCutSplinePath(data); vis = new VisToolCutSplinePath(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -78,8 +78,6 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge
connect(ui.lineEditNameDetail, &QLineEdit::textChanged, this, &DialogDetail::NamePointChanged); connect(ui.lineEditNameDetail, &QLineEdit::textChanged, this, &DialogDetail::NamePointChanged);
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem); connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -80,8 +80,6 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid
connect(timerFormula, &QTimer::timeout, this, &DialogEndLine::EvalAngle); connect(timerFormula, &QTimer::timeout, this, &DialogEndLine::EvalAngle);
vis = new VisToolEndLine(data); vis = new VisToolEndLine(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -65,8 +65,6 @@ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidge
this, &DialogHeight::PointNameChanged); this, &DialogHeight::PointNameChanged);
vis = new VisToolHeight(data); vis = new VisToolHeight(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -63,8 +63,6 @@ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *p
this, &DialogLine::PointNameChanged); this, &DialogLine::PointNameChanged);
vis = new VisToolLine(data); vis = new VisToolLine(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -65,8 +65,6 @@ DialogLineIntersect::DialogLineIntersect(const VContainer *data, const quint32 &
this, &DialogLineIntersect::PointNameChanged); this, &DialogLineIntersect::PointNameChanged);
vis = new VisToolLineIntersect(data); vis = new VisToolLineIntersect(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -76,8 +76,6 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q
this, &DialogLineIntersectAxis::PointNameChanged); this, &DialogLineIntersectAxis::PointNameChanged);
vis = new VisToolLineIntersectAxis(data); vis = new VisToolLineIntersectAxis(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -71,8 +71,6 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge
this, &DialogNormal::PointNameChanged); this, &DialogNormal::PointNameChanged);
vis = new VisToolNormal(data); vis = new VisToolNormal(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -54,8 +54,6 @@ DialogPointFromArcAndTangent::DialogPointFromArcAndTangent(const VContainer *dat
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointFromArcAndTangent::NamePointChanged); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointFromArcAndTangent::NamePointChanged);
vis = new VisToolPointFromArcAndTangent(data); vis = new VisToolPointFromArcAndTangent(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -79,8 +79,6 @@ DialogPointFromCircleAndTangent::DialogPointFromCircleAndTangent(const VContaine
&DialogPointFromCircleAndTangent::DeployCircleRadiusTextEdit); &DialogPointFromCircleAndTangent::DeployCircleRadiusTextEdit);
vis = new VisToolPointFromCircleAndTangent(data); vis = new VisToolPointFromCircleAndTangent(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -71,8 +71,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32
this, &DialogPointOfContact::PointNameChanged); this, &DialogPointOfContact::PointNameChanged);
vis = new VisToolPointOfContact(data); vis = new VisToolPointOfContact(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -61,8 +61,6 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, con
vis = new VisToolPointOfIntersection(data); vis = new VisToolPointOfIntersection(data);
vis->VisualMode(NULL_ID);//Show vertical axis vis->VisualMode(NULL_ID);//Show vertical axis
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -57,8 +57,6 @@ DialogPointOfIntersectionArcs::DialogPointOfIntersectionArcs(const VContainer *d
this, &DialogPointOfIntersectionArcs::ArcChanged); this, &DialogPointOfIntersectionArcs::ArcChanged);
vis = new VisToolPointOfIntersectionArcs(data); vis = new VisToolPointOfIntersectionArcs(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -95,8 +95,6 @@ DialogPointOfIntersectionCircles::DialogPointOfIntersectionCircles(const VContai
&DialogPointOfIntersectionCircles::DeployCircle2RadiusTextEdit); &DialogPointOfIntersectionCircles::DeployCircle2RadiusTextEdit);
vis = new VisToolPointOfIntersectionCircles(data); vis = new VisToolPointOfIntersectionCircles(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -76,8 +76,6 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 &
this, &DialogShoulderPoint::PointNameChanged); this, &DialogShoulderPoint::PointNameChanged);
vis = new VisToolShoulderPoint(data); vis = new VisToolShoulderPoint(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -48,8 +48,6 @@ DialogSinglePoint::DialogSinglePoint(const VContainer *data, const quint32 &tool
CheckState(); CheckState();
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogTool::NamePointChanged); connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogTool::NamePointChanged);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -57,8 +57,6 @@ DialogSpline::DialogSpline(const VContainer *data, const quint32 &toolId, QWidge
this, &DialogSpline::PointNameChanged); this, &DialogSpline::PointNameChanged);
vis = new VisToolSpline(data); vis = new VisToolSpline(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -61,8 +61,6 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, const quint32 &toolId
this, &DialogSplinePath::KAsm2Changed); this, &DialogSplinePath::KAsm2Changed);
vis = new VisToolSplinePath(data); vis = new VisToolSplinePath(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -106,6 +106,11 @@ void DialogTool::showEvent(QShowEvent *event)
{ {
return; return;
} }
// do your init stuff here
setMaximumSize(size());
setMinimumSize(size());
isInitialized = true;//first show windows are held isInitialized = true;//first show windows are held
ShowVisualization(); ShowVisualization();
} }
@ -281,13 +286,6 @@ bool DialogTool::eventFilter(QObject *object, QEvent *event)
return false; return false;
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::FixateSize()
{
setMaximumSize(size());
setMinimumSize(size());
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief ValFormulaChanged handle change formula * @brief ValFormulaChanged handle change formula

View File

@ -251,7 +251,6 @@ protected:
virtual void SaveData() {} virtual void SaveData() {}
void MoveCursorToEnd(QPlainTextEdit *plainTextEdit); void MoveCursorToEnd(QPlainTextEdit *plainTextEdit);
bool eventFilter(QObject *object, QEvent *event); bool eventFilter(QObject *object, QEvent *event);
void FixateSize();
private: private:
void FillList(QComboBox *box, const QMap<QString, quint32> &list)const; void FillList(QComboBox *box, const QMap<QString, quint32> &list)const;

View File

@ -65,8 +65,6 @@ DialogTriangle::DialogTriangle(const VContainer *data, const quint32 &toolId, QW
this, &DialogTriangle::PointNameChanged); this, &DialogTriangle::PointNameChanged);
vis = new VisToolTriangle(data); vis = new VisToolTriangle(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -69,8 +69,6 @@ DialogTrueDarts::DialogTrueDarts(const VContainer *data, const quint32 &toolId,
this, &DialogTrueDarts::PointNameChanged); this, &DialogTrueDarts::PointNameChanged);
vis = new VisToolTrueDarts(data); vis = new VisToolTrueDarts(data);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -43,8 +43,6 @@ DialogUnionDetails::DialogUnionDetails(const VContainer *data, const quint32 &to
{ {
ui->setupUi(this); ui->setupUi(this);
InitOkCancel(ui); InitOkCancel(ui);
FixateSize();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------