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 );
|
QskPushButton* button = createButton( action );
|
||||||
if ( button )
|
if ( button )
|
||||||
|
@ -339,7 +339,7 @@ void QskDialogButtonBox::setActions( QskDialog::Actions actions )
|
||||||
{
|
{
|
||||||
const auto action = static_cast< QskDialog::Action >( i );
|
const auto action = static_cast< QskDialog::Action >( i );
|
||||||
if ( action & actions )
|
if ( action & actions )
|
||||||
addButton( action );
|
addAction( action );
|
||||||
}
|
}
|
||||||
|
|
||||||
invalidateLayout();
|
invalidateLayout();
|
||||||
|
|
|
@ -39,7 +39,6 @@ class QSK_EXPORT QskDialogButtonBox : public QskBox
|
||||||
bool centeredButtons() const;
|
bool centeredButtons() const;
|
||||||
|
|
||||||
void addButton( QskPushButton*, QskDialog::ActionRole );
|
void addButton( QskPushButton*, QskDialog::ActionRole );
|
||||||
void addButton( QskDialog::Action );
|
|
||||||
void removeButton( QskPushButton* );
|
void removeButton( QskPushButton* );
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
@ -48,8 +47,11 @@ class QSK_EXPORT QskDialogButtonBox : public QskBox
|
||||||
|
|
||||||
QskDialog::ActionRole actionRole( const QskPushButton* ) const;
|
QskDialog::ActionRole actionRole( const QskPushButton* ) const;
|
||||||
|
|
||||||
|
void addAction( QskDialog::Action );
|
||||||
|
|
||||||
void setActions( QskDialog::Actions );
|
void setActions( QskDialog::Actions );
|
||||||
QskDialog::Actions actions() const;
|
QskDialog::Actions actions() const;
|
||||||
|
|
||||||
QskDialog::Action action( const QskPushButton* ) const;
|
QskDialog::Action action( const QskPushButton* ) const;
|
||||||
|
|
||||||
QskPushButton* button( QskDialog::Action ) 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 )
|
void QskDialogSubWindow::setDialogActions( QskDialog::Actions actions )
|
||||||
{
|
{
|
||||||
if ( m_data->actions == actions )
|
if ( m_data->actions == actions )
|
||||||
|
|
|
@ -28,6 +28,9 @@ class QSK_EXPORT QskDialogSubWindow : public QskSubWindow
|
||||||
QskDialog::Actions dialogActions() const;
|
QskDialog::Actions dialogActions() const;
|
||||||
void setDialogActions( QskDialog::Actions );
|
void setDialogActions( QskDialog::Actions );
|
||||||
|
|
||||||
|
void addDialogAction( QskDialog::Action );
|
||||||
|
void addDialogButton( QskPushButton*, QskDialog::ActionRole );
|
||||||
|
|
||||||
Q_INVOKABLE QskDialog::Action clickedAction() const;
|
Q_INVOKABLE QskDialog::Action clickedAction() const;
|
||||||
|
|
||||||
Q_INVOKABLE QskDialog::DialogCode result() const;
|
Q_INVOKABLE QskDialog::DialogCode result() const;
|
||||||
|
|
Loading…
Reference in New Issue