API cleanup
This commit is contained in:
parent
b398d11310
commit
2874d68d23
|
@ -109,6 +109,11 @@ QskTextOptions QskSubWindow::windowTitleTextOptions() const
|
||||||
return m_data->windowTitleTextOptions;
|
return m_data->windowTitleTextOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QskSubWindow::setWindowIconSource( const QString& url )
|
||||||
|
{
|
||||||
|
setWindowIconSource( QUrl( url ) );
|
||||||
|
}
|
||||||
|
|
||||||
void QskSubWindow::setWindowIconSource( const QUrl& url )
|
void QskSubWindow::setWindowIconSource( const QUrl& url )
|
||||||
{
|
{
|
||||||
if ( m_data->windowIconSource == url )
|
if ( m_data->windowIconSource == url )
|
||||||
|
|
|
@ -61,6 +61,7 @@ class QSK_EXPORT QskSubWindow : public QskPopup
|
||||||
void setWindowTitle( const QString& );
|
void setWindowTitle( const QString& );
|
||||||
QString windowTitle() const;
|
QString windowTitle() const;
|
||||||
|
|
||||||
|
void setWindowIconSource( const QString& );
|
||||||
void setWindowIconSource( const QUrl& );
|
void setWindowIconSource( const QUrl& );
|
||||||
QUrl windowIconSource() const;
|
QUrl windowIconSource() const;
|
||||||
|
|
||||||
|
|
|
@ -54,12 +54,12 @@ static void qskSetupSubWindow(
|
||||||
{
|
{
|
||||||
subWindow->setModal( true );
|
subWindow->setModal( true );
|
||||||
subWindow->setWindowTitle( title );
|
subWindow->setWindowTitle( title );
|
||||||
subWindow->setActions( actions );
|
subWindow->setDialogActions( actions );
|
||||||
|
|
||||||
if ( defaultAction == QskDialog::NoAction )
|
if ( defaultAction == QskDialog::NoAction )
|
||||||
defaultAction = subWindow->buttonBox()->defaultActionCandidate();
|
defaultAction = subWindow->buttonBox()->defaultActionCandidate();
|
||||||
|
|
||||||
subWindow->setDefaultAction( defaultAction );
|
subWindow->setDefaultDialogAction( defaultAction );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qskSetupWindow(
|
static void qskSetupWindow(
|
||||||
|
@ -70,12 +70,12 @@ static void qskSetupWindow(
|
||||||
window->setTransientParent( transientParent );
|
window->setTransientParent( transientParent );
|
||||||
|
|
||||||
window->setTitle( title );
|
window->setTitle( title );
|
||||||
window->setActions( actions );
|
window->setDialogActions( actions );
|
||||||
|
|
||||||
if ( defaultAction == QskDialog::NoAction )
|
if ( defaultAction == QskDialog::NoAction )
|
||||||
defaultAction = window->buttonBox()->defaultActionCandidate();
|
defaultAction = window->buttonBox()->defaultActionCandidate();
|
||||||
|
|
||||||
window->setDefaultAction( defaultAction );
|
window->setDefaultDialogAction( defaultAction );
|
||||||
|
|
||||||
window->setModality( transientParent ? Qt::WindowModal : Qt::ApplicationModal );
|
window->setModality( transientParent ? Qt::WindowModal : Qt::ApplicationModal );
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ QskInputSubWindow::~QskInputSubWindow()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskInputSubWindow::setActions( QskDialog::Actions actions )
|
void QskInputSubWindow::setDialogActions( QskDialog::Actions actions )
|
||||||
{
|
{
|
||||||
if ( m_data->actions == actions )
|
if ( m_data->actions == actions )
|
||||||
return;
|
return;
|
||||||
|
@ -139,17 +139,17 @@ void QskInputSubWindow::setActions( QskDialog::Actions actions )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QskDialog::Actions QskInputSubWindow::actions() const
|
QskDialog::Actions QskInputSubWindow::dialogActions() const
|
||||||
{
|
{
|
||||||
return m_data->buttonBox->actions();
|
return m_data->buttonBox->actions();
|
||||||
}
|
}
|
||||||
|
|
||||||
QskDialog::Action QskInputSubWindow::defaultAction() const
|
QskDialog::Action QskInputSubWindow::defaultDialogAction() const
|
||||||
{
|
{
|
||||||
return m_data->defaultAction;
|
return m_data->defaultAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskInputSubWindow::setDefaultAction( QskDialog::Action action )
|
void QskInputSubWindow::setDefaultDialogAction( QskDialog::Action action )
|
||||||
{
|
{
|
||||||
m_data->defaultAction = action;
|
m_data->defaultAction = action;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ void QskInputSubWindow::keyPressEvent( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
if ( QskDialogButtonBox::isDefaultButtonKeyEvent( event ) )
|
if ( QskDialogButtonBox::isDefaultButtonKeyEvent( event ) )
|
||||||
{
|
{
|
||||||
QskPushButton* button = m_data->buttonBox->button( defaultAction() );
|
auto button = m_data->buttonBox->button( defaultDialogAction() );
|
||||||
if ( button && button->isEnabled() )
|
if ( button && button->isEnabled() )
|
||||||
button->click();
|
button->click();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,17 +25,23 @@ class QSK_EXPORT QskInputSubWindow : public QskDialogSubWindow
|
||||||
Q_PROPERTY( QUrl symbolSource READ symbolSource
|
Q_PROPERTY( QUrl symbolSource READ symbolSource
|
||||||
WRITE setSymbolSource NOTIFY symbolSourceChanged FINAL )
|
WRITE setSymbolSource NOTIFY symbolSourceChanged FINAL )
|
||||||
|
|
||||||
|
Q_PROPERTY( QskDialog::Actions dialogActions
|
||||||
|
READ dialogActions WRITE setDialogActions )
|
||||||
|
|
||||||
|
Q_PROPERTY( QskDialog::Action defaultDialogAction
|
||||||
|
READ defaultDialogAction WRITE setDefaultDialogAction )
|
||||||
|
|
||||||
using Inherited = QskDialogSubWindow;
|
using Inherited = QskDialogSubWindow;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QskInputSubWindow( QQuickItem* parent = nullptr );
|
QskInputSubWindow( QQuickItem* parent = nullptr );
|
||||||
~QskInputSubWindow() override;
|
~QskInputSubWindow() override;
|
||||||
|
|
||||||
QskDialog::Actions actions() const;
|
QskDialog::Actions dialogActions() const;
|
||||||
void setActions( QskDialog::Actions );
|
void setDialogActions( QskDialog::Actions );
|
||||||
|
|
||||||
QskDialog::Action defaultAction() const;
|
QskDialog::Action defaultDialogAction() const;
|
||||||
void setDefaultAction( QskDialog::Action );
|
void setDefaultDialogAction( QskDialog::Action );
|
||||||
|
|
||||||
void setInfoTextOptions( const QskTextOptions& );
|
void setInfoTextOptions( const QskTextOptions& );
|
||||||
QskTextOptions infoTextOptions() const;
|
QskTextOptions infoTextOptions() const;
|
||||||
|
|
|
@ -55,26 +55,26 @@ QskInputSubWindow* QskInputWindow::subWindow() const
|
||||||
return m_subWindow;
|
return m_subWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
QskDialog::Actions QskInputWindow::actions() const
|
QskDialog::Actions QskInputWindow::dialogActions() const
|
||||||
{
|
{
|
||||||
return m_subWindow ? m_subWindow->actions() : QskDialog::NoAction;
|
return m_subWindow ? m_subWindow->dialogActions() : QskDialog::NoAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskInputWindow::setActions( QskDialog::Actions actions )
|
void QskInputWindow::setDialogActions( QskDialog::Actions actions )
|
||||||
{
|
{
|
||||||
if ( m_subWindow )
|
if ( m_subWindow )
|
||||||
m_subWindow->setActions( actions );
|
m_subWindow->setDialogActions( actions );
|
||||||
}
|
}
|
||||||
|
|
||||||
QskDialog::Action QskInputWindow::defaultAction() const
|
QskDialog::Action QskInputWindow::defaultDialogAction() const
|
||||||
{
|
{
|
||||||
return m_subWindow ? m_subWindow->defaultAction() : QskDialog::NoAction;
|
return m_subWindow ? m_subWindow->defaultDialogAction() : QskDialog::NoAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskInputWindow::setDefaultAction( QskDialog::Action action )
|
void QskInputWindow::setDefaultDialogAction( QskDialog::Action action )
|
||||||
{
|
{
|
||||||
if ( m_subWindow )
|
if ( m_subWindow )
|
||||||
m_subWindow->setDefaultAction( action );
|
m_subWindow->setDefaultDialogAction( action );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskInputWindow::setInfoText( const QString& text )
|
void QskInputWindow::setInfoText( const QString& text )
|
||||||
|
|
|
@ -27,17 +27,23 @@ class QSK_EXPORT QskInputWindow : public QskDialogWindow
|
||||||
Q_PROPERTY( QUrl symbolSource READ symbolSource
|
Q_PROPERTY( QUrl symbolSource READ symbolSource
|
||||||
WRITE setSymbolSource NOTIFY symbolSourceChanged FINAL )
|
WRITE setSymbolSource NOTIFY symbolSourceChanged FINAL )
|
||||||
|
|
||||||
|
Q_PROPERTY( QskDialog::Actions dialogActions
|
||||||
|
READ dialogActions WRITE setDialogActions )
|
||||||
|
|
||||||
|
Q_PROPERTY( QskDialog::Action defaultDialogAction
|
||||||
|
READ defaultDialogAction WRITE setDefaultDialogAction )
|
||||||
|
|
||||||
using Inherited = QskDialogWindow;
|
using Inherited = QskDialogWindow;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QskInputWindow( QWindow* parent = nullptr );
|
QskInputWindow( QWindow* parent = nullptr );
|
||||||
~QskInputWindow() override;
|
~QskInputWindow() override;
|
||||||
|
|
||||||
QskDialog::Actions actions() const;
|
QskDialog::Actions dialogActions() const;
|
||||||
void setActions( QskDialog::Actions );
|
void setDialogActions( QskDialog::Actions );
|
||||||
|
|
||||||
QskDialog::Action defaultAction() const;
|
QskDialog::Action defaultDialogAction() const;
|
||||||
void setDefaultAction( QskDialog::Action );
|
void setDefaultDialogAction( QskDialog::Action );
|
||||||
|
|
||||||
void setInfoTextOptions( const QskTextOptions& );
|
void setInfoTextOptions( const QskTextOptions& );
|
||||||
QskTextOptions infoTextOptions() const;
|
QskTextOptions infoTextOptions() const;
|
||||||
|
|
|
@ -39,7 +39,7 @@ QskSelectionSubWindow::QskSelectionSubWindow( QQuickItem* parent )
|
||||||
: Inherited( parent )
|
: Inherited( parent )
|
||||||
{
|
{
|
||||||
setInputControl( new ListBox( this ) );
|
setInputControl( new ListBox( this ) );
|
||||||
setActions( QskDialog::Ok | QskDialog::Cancel );
|
setDialogActions( QskDialog::Ok | QskDialog::Cancel );
|
||||||
}
|
}
|
||||||
|
|
||||||
QskSelectionSubWindow::~QskSelectionSubWindow()
|
QskSelectionSubWindow::~QskSelectionSubWindow()
|
||||||
|
|
Loading…
Reference in New Issue