QskDialogSubWindow API improved
This commit is contained in:
parent
958e087943
commit
8a97403343
@ -272,7 +272,7 @@ void QskDialogButtonBox::addButton(
|
||||
}
|
||||
}
|
||||
|
||||
void QskDialogButtonBox::addButton( QskDialog::Action action )
|
||||
void QskDialogButtonBox::addAction( QskDialog::Action action )
|
||||
{
|
||||
QskPushButton* button = createButton( action );
|
||||
if ( button )
|
||||
@ -339,7 +339,7 @@ void QskDialogButtonBox::setActions( QskDialog::Actions actions )
|
||||
{
|
||||
const auto action = static_cast< QskDialog::Action >( i );
|
||||
if ( action & actions )
|
||||
addButton( action );
|
||||
addAction( action );
|
||||
}
|
||||
|
||||
invalidateLayout();
|
||||
|
@ -39,7 +39,6 @@ class QSK_EXPORT QskDialogButtonBox : public QskBox
|
||||
bool centeredButtons() const;
|
||||
|
||||
void addButton( QskPushButton*, QskDialog::ActionRole );
|
||||
void addButton( QskDialog::Action );
|
||||
void removeButton( QskPushButton* );
|
||||
void clear();
|
||||
|
||||
@ -48,8 +47,11 @@ class QSK_EXPORT QskDialogButtonBox : public QskBox
|
||||
|
||||
QskDialog::ActionRole actionRole( const QskPushButton* ) const;
|
||||
|
||||
void addAction( QskDialog::Action );
|
||||
|
||||
void setActions( QskDialog::Actions );
|
||||
QskDialog::Actions actions() const;
|
||||
|
||||
QskDialog::Action action( const QskPushButton* ) const;
|
||||
|
||||
QskPushButton* button( QskDialog::Action ) const;
|
||||
|
@ -51,6 +51,31 @@ QskDialogSubWindow::~QskDialogSubWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void QskDialogSubWindow::addDialogAction( QskDialog::Action action )
|
||||
{
|
||||
if ( action != QskDialog::NoAction )
|
||||
{
|
||||
if ( m_data->buttonBox == nullptr )
|
||||
m_data->buttonBox = createButtonBox();
|
||||
|
||||
if ( m_data->buttonBox )
|
||||
m_data->buttonBox->addAction( action );
|
||||
}
|
||||
}
|
||||
|
||||
void QskDialogSubWindow::addDialogButton(
|
||||
QskPushButton* button, QskDialog::ActionRole actionRole )
|
||||
{
|
||||
if ( button )
|
||||
{
|
||||
if ( m_data->buttonBox == nullptr )
|
||||
m_data->buttonBox = createButtonBox();
|
||||
|
||||
if ( m_data->buttonBox )
|
||||
m_data->buttonBox->addButton( button, actionRole );
|
||||
}
|
||||
}
|
||||
|
||||
void QskDialogSubWindow::setDialogActions( QskDialog::Actions actions )
|
||||
{
|
||||
if ( m_data->actions == actions )
|
||||
|
@ -27,6 +27,9 @@ class QSK_EXPORT QskDialogSubWindow : public QskSubWindow
|
||||
|
||||
QskDialog::Actions dialogActions() const;
|
||||
void setDialogActions( QskDialog::Actions );
|
||||
|
||||
void addDialogAction( QskDialog::Action );
|
||||
void addDialogButton( QskPushButton*, QskDialog::ActionRole );
|
||||
|
||||
Q_INVOKABLE QskDialog::Action clickedAction() const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user