Fixate size of the 'Config dialog' only after first show.
--HG-- branch : develop
This commit is contained in:
parent
ab526a54b4
commit
974a074ffd
|
@ -38,7 +38,7 @@
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
ConfigDialog::ConfigDialog(QWidget *parent) :
|
ConfigDialog::ConfigDialog(QWidget *parent) :
|
||||||
QDialog(parent), contentsWidget(nullptr), pagesWidget(nullptr), configurationPage(nullptr), patternPage(nullptr),
|
QDialog(parent), contentsWidget(nullptr), pagesWidget(nullptr), configurationPage(nullptr), patternPage(nullptr),
|
||||||
communityPage(nullptr), pathPage(nullptr)
|
communityPage(nullptr), pathPage(nullptr), isInitialized(false)
|
||||||
{
|
{
|
||||||
contentsWidget = new QListWidget;
|
contentsWidget = new QListWidget;
|
||||||
contentsWidget->setViewMode(QListView::IconMode);
|
contentsWidget->setViewMode(QListView::IconMode);
|
||||||
|
@ -92,7 +92,6 @@ ConfigDialog::ConfigDialog(QWidget *parent) :
|
||||||
|
|
||||||
setWindowTitle(tr("Config Dialog"));
|
setWindowTitle(tr("Config Dialog"));
|
||||||
|
|
||||||
this->setFixedSize(QSize(750, 565));
|
|
||||||
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,6 +115,27 @@ void ConfigDialog::closeEvent(QCloseEvent *event)
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void ConfigDialog::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 ConfigDialog::createIcons()
|
void ConfigDialog::createIcons()
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,7 @@ signals:
|
||||||
void UpdateProperties();
|
void UpdateProperties();
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
||||||
|
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(ConfigDialog)
|
Q_DISABLE_COPY(ConfigDialog)
|
||||||
QListWidget *contentsWidget;
|
QListWidget *contentsWidget;
|
||||||
|
@ -55,6 +56,7 @@ private:
|
||||||
PatternPage *patternPage;
|
PatternPage *patternPage;
|
||||||
CommunityPage *communityPage;
|
CommunityPage *communityPage;
|
||||||
PathPage *pathPage;
|
PathPage *pathPage;
|
||||||
|
bool isInitialized;
|
||||||
void createIcons();
|
void createIcons();
|
||||||
void createIcon(const QString &icon, const QString &text);
|
void createIcon(const QString &icon, const QString &text);
|
||||||
void Apply();
|
void Apply();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user