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 ( action != QskDialog::NoAction )
|
||||||
{
|
{
|
||||||
if ( m_data->buttonBox == nullptr )
|
if ( m_data->buttonBox == nullptr )
|
||||||
m_data->buttonBox = createButtonBox();
|
initButtonBox();
|
||||||
|
|
||||||
if ( m_data->buttonBox )
|
if ( m_data->buttonBox )
|
||||||
m_data->buttonBox->addAction( action );
|
m_data->buttonBox->addAction( action );
|
||||||
|
@ -69,7 +69,7 @@ void QskDialogSubWindow::addDialogButton(
|
||||||
if ( button )
|
if ( button )
|
||||||
{
|
{
|
||||||
if ( m_data->buttonBox == nullptr )
|
if ( m_data->buttonBox == nullptr )
|
||||||
m_data->buttonBox = createButtonBox();
|
initButtonBox();
|
||||||
|
|
||||||
if ( m_data->buttonBox )
|
if ( m_data->buttonBox )
|
||||||
m_data->buttonBox->addButton( button, actionRole );
|
m_data->buttonBox->addButton( button, actionRole );
|
||||||
|
@ -107,20 +107,7 @@ void QskDialogSubWindow::setDialogActions( QskDialog::Actions actions )
|
||||||
{
|
{
|
||||||
if ( m_data->buttonBox == nullptr )
|
if ( m_data->buttonBox == nullptr )
|
||||||
{
|
{
|
||||||
m_data->buttonBox = createButtonBox();
|
initButtonBox();
|
||||||
|
|
||||||
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 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_data->buttonBox )
|
if ( m_data->buttonBox )
|
||||||
|
@ -328,6 +315,25 @@ QskDialogButtonBox* QskDialogSubWindow::createButtonBox()
|
||||||
return new QskDialogButtonBox();
|
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()
|
void QskDialogSubWindow::aboutToShow()
|
||||||
{
|
{
|
||||||
if ( size().isEmpty() )
|
if ( size().isEmpty() )
|
||||||
|
|
|
@ -48,7 +48,7 @@ class QSK_EXPORT QskDialogSubWindow : public QskSubWindow
|
||||||
QQuickItem* contentItem() const;
|
QQuickItem* contentItem() const;
|
||||||
|
|
||||||
// padding around the contentItem
|
// padding around the contentItem
|
||||||
void setContentPadding( const QMarginsF & );
|
void setContentPadding( const QMarginsF& );
|
||||||
QMarginsF contentPadding() const;
|
QMarginsF contentPadding() const;
|
||||||
|
|
||||||
qreal heightForWidth( qreal width ) const override;
|
qreal heightForWidth( qreal width ) const override;
|
||||||
|
@ -76,6 +76,8 @@ class QSK_EXPORT QskDialogSubWindow : public QskSubWindow
|
||||||
virtual QskDialogButtonBox* createButtonBox();
|
virtual QskDialogButtonBox* createButtonBox();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void initButtonBox();
|
||||||
|
|
||||||
class PrivateData;
|
class PrivateData;
|
||||||
std::unique_ptr< PrivateData > m_data;
|
std::unique_ptr< PrivateData > m_data;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue