From 814a346c0ef4b2625779c5ef96be5ff87980acbb Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 14 Apr 2020 18:11:20 +0300 Subject: [PATCH] Improve calculation of size of preferences panel. --- src/ModuleBase/ModuleBase_Preferences.cpp | 7 ++++++- src/ModuleBase/ModuleBase_Preferences.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ModuleBase/ModuleBase_Preferences.cpp b/src/ModuleBase/ModuleBase_Preferences.cpp index 4d5f2a1c5..ac5aae4c6 100644 --- a/src/ModuleBase/ModuleBase_Preferences.cpp +++ b/src/ModuleBase/ModuleBase_Preferences.cpp @@ -295,7 +295,6 @@ ModuleBase_PreferencesDlg::ModuleBase_PreferencesDlg(SUIT_ResourceMgr* theResurc createEditors(); myPreferences->retrieve(); - setMinimumSize(820, 300); } ModuleBase_PreferencesDlg::~ModuleBase_PreferencesDlg() @@ -458,6 +457,12 @@ void ModuleBase_PreferencesDlg::onDefault() ModuleBase_Preferences::resetConfigPropPreferences(myPreferences); } +void ModuleBase_PreferencesDlg::showEvent(QShowEvent* theEvent) +{ + QDialog::showEvent(theEvent); + adjustSize(); +} + //********************************************************** //********************************************************** //********************************************************** diff --git a/src/ModuleBase/ModuleBase_Preferences.h b/src/ModuleBase/ModuleBase_Preferences.h index 59badbfac..669599970 100644 --- a/src/ModuleBase/ModuleBase_Preferences.h +++ b/src/ModuleBase/ModuleBase_Preferences.h @@ -149,6 +149,9 @@ Q_OBJECT /// A slot called on Ok button press virtual void accept(); +protected: + virtual void showEvent(QShowEvent* theEvent); + protected slots: /// A slot called on Default button press void onDefault(); -- 2.39.2