missing initialization of the buttonBox fixed
This commit is contained in:
parent
8a97403343
commit
c2ca7fd200
@ -56,7 +56,7 @@ void QskDialogSubWindow::addDialogAction( QskDialog::Action action )
|
||||
if ( action != QskDialog::NoAction )
|
||||
{
|
||||
if ( m_data->buttonBox == nullptr )
|
||||
m_data->buttonBox = createButtonBox();
|
||||
initButtonBox();
|
||||
|
||||
if ( m_data->buttonBox )
|
||||
m_data->buttonBox->addAction( action );
|
||||
@ -69,7 +69,7 @@ void QskDialogSubWindow::addDialogButton(
|
||||
if ( button )
|
||||
{
|
||||
if ( m_data->buttonBox == nullptr )
|
||||
m_data->buttonBox = createButtonBox();
|
||||
initButtonBox();
|
||||
|
||||
if ( m_data->buttonBox )
|
||||
m_data->buttonBox->addButton( button, actionRole );
|
||||
@ -107,20 +107,7 @@ void QskDialogSubWindow::setDialogActions( QskDialog::Actions actions )
|
||||
{
|
||||
if ( m_data->buttonBox == nullptr )
|
||||
{
|
||||
m_data->buttonBox = createButtonBox();
|
||||
|
||||
if ( m_data->buttonBox )
|
||||
{
|
||||
m_data->buttonBox->setParentItem( this );
|
||||
if ( m_data->buttonBox->parent() == nullptr )
|
||||
m_data->buttonBox->setParent( this );
|
||||
|
||||
connect( m_data->buttonBox, &QskDialogButtonBox::accepted,
|
||||
this, &QskDialogSubWindow::accept, Qt::UniqueConnection );
|
||||
|
||||
connect( m_data->buttonBox, &QskDialogButtonBox::rejected,
|
||||
this, &QskDialogSubWindow::reject, Qt::UniqueConnection );
|
||||
}
|
||||
initButtonBox();
|
||||
}
|
||||
|
||||
if ( m_data->buttonBox )
|
||||
@ -328,6 +315,25 @@ QskDialogButtonBox* QskDialogSubWindow::createButtonBox()
|
||||
return new QskDialogButtonBox();
|
||||
}
|
||||
|
||||
void QskDialogSubWindow::initButtonBox()
|
||||
{
|
||||
m_data->buttonBox = createButtonBox();
|
||||
|
||||
if ( m_data->buttonBox )
|
||||
{
|
||||
m_data->buttonBox->setParentItem( this );
|
||||
|
||||
if ( m_data->buttonBox->parent() == nullptr )
|
||||
m_data->buttonBox->setParent( this );
|
||||
|
||||
connect( m_data->buttonBox, &QskDialogButtonBox::accepted,
|
||||
this, &QskDialogSubWindow::accept, Qt::UniqueConnection );
|
||||
|
||||
connect( m_data->buttonBox, &QskDialogButtonBox::rejected,
|
||||
this, &QskDialogSubWindow::reject, Qt::UniqueConnection );
|
||||
}
|
||||
}
|
||||
|
||||
void QskDialogSubWindow::aboutToShow()
|
||||
{
|
||||
if ( size().isEmpty() )
|
||||
|
@ -48,7 +48,7 @@ class QSK_EXPORT QskDialogSubWindow : public QskSubWindow
|
||||
QQuickItem* contentItem() const;
|
||||
|
||||
// padding around the contentItem
|
||||
void setContentPadding( const QMarginsF & );
|
||||
void setContentPadding( const QMarginsF& );
|
||||
QMarginsF contentPadding() const;
|
||||
|
||||
qreal heightForWidth( qreal width ) const override;
|
||||
@ -76,6 +76,8 @@ class QSK_EXPORT QskDialogSubWindow : public QskSubWindow
|
||||
virtual QskDialogButtonBox* createButtonBox();
|
||||
|
||||
private:
|
||||
void initButtonBox();
|
||||
|
||||
class PrivateData;
|
||||
std::unique_ptr< PrivateData > m_data;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user