Return resizing Increments Dialog.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-07-26 09:13:29 +03:00
parent 4d7d2ac607
commit 1fff49936b
5 changed files with 60 additions and 4 deletions

View File

@ -864,6 +864,44 @@ bool DialogIncrements::eventFilter(QObject *object, QEvent *event)
return false;// pass the event to the widget return false;// pass the event to the widget
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::showEvent(QShowEvent *event)
{
// Skip DialogTool implementation
QDialog::showEvent(event);
if ( event->spontaneous() )
{
return;
}
if (isInitialized)
{
return;
}
// do your init stuff here
const QSize sz = qApp->Settings()->GetIncrementsDialogSize();
if (not sz.isEmpty())
{
resize(sz);
}
isInitialized = true;//first show windows are held
}
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::resizeEvent(QResizeEvent *event)
{
// remember the size for the next time this dialog is opened, but only
// if widget was already initialized, which rules out the resize at
// dialog creating, which would
if (isInitialized)
{
qApp->Settings()->SetIncrementsDialogSize(size());
}
DialogTool::resizeEvent(event);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::ShowIncrementDetails() void DialogIncrements::ShowIncrementDetails()
{ {

View File

@ -54,6 +54,8 @@ protected:
virtual void closeEvent ( QCloseEvent * event ) Q_DECL_OVERRIDE; virtual void closeEvent ( QCloseEvent * event ) Q_DECL_OVERRIDE;
virtual void changeEvent ( QEvent * event) Q_DECL_OVERRIDE; virtual void changeEvent ( QEvent * event) Q_DECL_OVERRIDE;
virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE; virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
virtual void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE;
virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
private slots: private slots:
void ShowIncrementDetails(); void ShowIncrementDetails();
void AddIncrement(); void AddIncrement();

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>979</width> <width>800</width>
<height>729</height> <height>497</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">

View File

@ -75,6 +75,7 @@ const QString settingGeneralWindowState = QStringLiteral("windowState")
const QString settingGeneralToolbarsState = QStringLiteral("toolbarsState"); const QString settingGeneralToolbarsState = QStringLiteral("toolbarsState");
const QString settingPreferenceDialogSize = QStringLiteral("preferenceDialogSize"); const QString settingPreferenceDialogSize = QStringLiteral("preferenceDialogSize");
const QString settingToolSeamAllowanceDialogSize = QStringLiteral("toolSeamAllowanceDialogSize"); const QString settingToolSeamAllowanceDialogSize = QStringLiteral("toolSeamAllowanceDialogSize");
const QString settingIncrementsDialogSize = QStringLiteral("toolIncrementsDialogSize");
const QString settingFormulaWizardDialogSize = QStringLiteral("formulaWizardDialogSize"); const QString settingFormulaWizardDialogSize = QStringLiteral("formulaWizardDialogSize");
const QString settingLatestSkippedVersion = QStringLiteral("lastestSkippedVersion"); const QString settingLatestSkippedVersion = QStringLiteral("lastestSkippedVersion");
const QString settingDateOfLastRemind = QStringLiteral("dateOfLastRemind"); const QString settingDateOfLastRemind = QStringLiteral("dateOfLastRemind");
@ -587,6 +588,18 @@ void VCommonSettings::SetFormulaWizardDialogSize(const QSize &sz)
setValue(settingFormulaWizardDialogSize, sz); setValue(settingFormulaWizardDialogSize, sz);
} }
//---------------------------------------------------------------------------------------------------------------------
QSize VCommonSettings::GetIncrementsDialogSize() const
{
return value(settingIncrementsDialogSize, QSize(0, 0)).toSize();
}
//---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetIncrementsDialogSize(const QSize &sz)
{
setValue(settingIncrementsDialogSize, sz);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
int VCommonSettings::GetLatestSkippedVersion() const int VCommonSettings::GetLatestSkippedVersion() const
{ {

View File

@ -126,6 +126,9 @@ public:
QSize GetFormulaWizardDialogSize() const; QSize GetFormulaWizardDialogSize() const;
void SetFormulaWizardDialogSize(const QSize& sz); void SetFormulaWizardDialogSize(const QSize& sz);
QSize GetIncrementsDialogSize() const;
void SetIncrementsDialogSize(const QSize& sz);
int GetLatestSkippedVersion() const; int GetLatestSkippedVersion() const;
void SetLatestSkippedVersion(int value); void SetLatestSkippedVersion(int value);