Fixate size of the Tape 'Config dialog' only after first show.
--HG-- branch : develop
This commit is contained in:
parent
0473db2947
commit
9ce9f45cd3
|
@ -44,10 +44,9 @@ TapeConfigDialog::TapeConfigDialog(QWidget *parent)
|
|||
pathPage(nullptr),
|
||||
applyButton(nullptr),
|
||||
canselButton(nullptr),
|
||||
okButton(nullptr)
|
||||
okButton(nullptr),
|
||||
isInitialized(false)
|
||||
{
|
||||
this->setMaximumHeight(300);
|
||||
|
||||
contentsWidget = new QListWidget;
|
||||
contentsWidget->setViewMode(QListView::IconMode);
|
||||
contentsWidget->setIconSize(QSize(96, 84));
|
||||
|
@ -133,6 +132,27 @@ void TapeConfigDialog::changeEvent(QEvent *event)
|
|||
QDialog::changeEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TapeConfigDialog::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 TapeConfigDialog::createIcons()
|
||||
{
|
||||
|
|
|
@ -49,6 +49,7 @@ signals:
|
|||
protected:
|
||||
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
||||
virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE;
|
||||
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
|
||||
private:
|
||||
Q_DISABLE_COPY(TapeConfigDialog)
|
||||
QListWidget *contentsWidget;
|
||||
|
@ -58,6 +59,7 @@ private:
|
|||
QPushButton *applyButton;
|
||||
QPushButton *canselButton;
|
||||
QPushButton *okButton;
|
||||
bool isInitialized;
|
||||
|
||||
void createIcons();
|
||||
void createIcon(const QString &icon, const QString &text);
|
||||
|
|
Loading…
Reference in New Issue
Block a user