cleaning up dialog classes
This commit is contained in:
parent
b0e8a486a3
commit
2ddde243e1
@ -128,7 +128,7 @@ static QskDialog::Action qskMessageSubWindow(
|
||||
{
|
||||
QskMessageSubWindow subWindow( window->contentItem() );
|
||||
subWindow.setSymbolType( symbolType );
|
||||
subWindow.setInfoText( text );
|
||||
subWindow.setText( text );
|
||||
|
||||
qskSetupSubWindow( title, actions, defaultAction, &subWindow );
|
||||
( void ) subWindow.exec();
|
||||
@ -150,7 +150,7 @@ static QskDialog::Action qskMessageWindow(
|
||||
{
|
||||
QskMessageWindow messageWindow;
|
||||
messageWindow.setSymbolType( symbolType );
|
||||
messageWindow.setInfoText( text );
|
||||
messageWindow.setText( text );
|
||||
|
||||
qskSetupWindow( transientParent, title, actions, defaultAction, &messageWindow );
|
||||
( void ) qskExec( &messageWindow );
|
||||
|
@ -259,7 +259,7 @@ void QskDialogButtonBox::addButton(
|
||||
button->setParent( this );
|
||||
|
||||
/*
|
||||
To have a proper ownership, inserting the buttons
|
||||
To have a proper ownership. Inserting the buttons
|
||||
according to the layout rules will be done later
|
||||
*/
|
||||
button->setParentItem( m_data->layoutBox );
|
||||
|
@ -22,14 +22,14 @@ namespace
|
||||
setObjectName( QStringLiteral( "QskMessageSubWindowTextLabel" ) );
|
||||
initSizePolicy( QskSizePolicy::Preferred, QskSizePolicy::Preferred );
|
||||
|
||||
setAlignment( Qt::AlignHCenter | Qt::AlignTop );
|
||||
setAlignment( Qt::AlignLeft | Qt::AlignTop );
|
||||
setWrapMode( QskTextOptions::WordWrap );
|
||||
|
||||
connect( this, &QskTextLabel::textChanged,
|
||||
box, &QskMessageSubWindow::infoTextChanged );
|
||||
box, &QskMessageSubWindow::textChanged );
|
||||
|
||||
connect( this, &QskTextLabel::textOptionsChanged,
|
||||
box, &QskMessageSubWindow::infoTextOptionsChanged );
|
||||
box, &QskMessageSubWindow::textOptionsChanged );
|
||||
}
|
||||
};
|
||||
|
||||
@ -73,14 +73,14 @@ class QskMessageSubWindow::PrivateData
|
||||
{
|
||||
public:
|
||||
QskGraphicLabel* symbolLabel;
|
||||
QskTextLabel* infoTextLabel;
|
||||
QskTextLabel* textLabel;
|
||||
};
|
||||
|
||||
QskMessageSubWindow::QskMessageSubWindow( QQuickItem* parent )
|
||||
: Inherited( parent )
|
||||
, m_data( new PrivateData() )
|
||||
{
|
||||
m_data->infoTextLabel = new TextLabel( this );
|
||||
m_data->textLabel = new TextLabel( this );
|
||||
|
||||
m_data->symbolLabel = new SymbolLabel( this );
|
||||
m_data->symbolLabel->hide();
|
||||
@ -90,8 +90,8 @@ QskMessageSubWindow::QskMessageSubWindow( QQuickItem* parent )
|
||||
auto box = new QskLinearBox( Qt::Horizontal );
|
||||
box->setSpacing( 0 );
|
||||
box->addItem( m_data->symbolLabel, alignment );
|
||||
box->addItem( m_data->infoTextLabel, alignment );
|
||||
box->setStretchFactor( m_data->infoTextLabel, 10 );
|
||||
box->addItem( m_data->textLabel, alignment );
|
||||
box->setStretchFactor( m_data->textLabel, 10 );
|
||||
|
||||
setContentItem( box );
|
||||
}
|
||||
@ -100,24 +100,24 @@ QskMessageSubWindow::~QskMessageSubWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void QskMessageSubWindow::setInfoText( const QString& text )
|
||||
void QskMessageSubWindow::setText( const QString& text )
|
||||
{
|
||||
m_data->infoTextLabel->setText( text );
|
||||
m_data->textLabel->setText( text );
|
||||
}
|
||||
|
||||
QString QskMessageSubWindow::infoText() const
|
||||
QString QskMessageSubWindow::text() const
|
||||
{
|
||||
return m_data->infoTextLabel->text();
|
||||
return m_data->textLabel->text();
|
||||
}
|
||||
|
||||
void QskMessageSubWindow::setInfoTextOptions( const QskTextOptions& options )
|
||||
void QskMessageSubWindow::setTextOptions( const QskTextOptions& options )
|
||||
{
|
||||
m_data->infoTextLabel->setTextOptions( options );
|
||||
m_data->textLabel->setTextOptions( options );
|
||||
}
|
||||
|
||||
QskTextOptions QskMessageSubWindow::infoTextOptions() const
|
||||
QskTextOptions QskMessageSubWindow::textOptions() const
|
||||
{
|
||||
return m_data->infoTextLabel->textOptions();
|
||||
return m_data->textLabel->textOptions();
|
||||
}
|
||||
|
||||
void QskMessageSubWindow::setSymbolSource( const QUrl& url )
|
||||
|
@ -15,11 +15,11 @@ class QSK_EXPORT QskMessageSubWindow : public QskDialogSubWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY( QString infoText READ infoText
|
||||
WRITE setInfoText NOTIFY infoTextChanged )
|
||||
|
||||
Q_PROPERTY( QskTextOptions infoTextOptions READ infoTextOptions
|
||||
WRITE setInfoTextOptions NOTIFY infoTextOptionsChanged )
|
||||
Q_PROPERTY( QString text READ text
|
||||
WRITE setText NOTIFY textChanged )
|
||||
|
||||
Q_PROPERTY( QskTextOptions textOptions READ textOptions
|
||||
WRITE setTextOptions NOTIFY textOptionsChanged )
|
||||
|
||||
Q_PROPERTY( QUrl symbolSource READ symbolSource WRITE setSymbolSource )
|
||||
|
||||
@ -29,10 +29,10 @@ class QSK_EXPORT QskMessageSubWindow : public QskDialogSubWindow
|
||||
QskMessageSubWindow( QQuickItem* parent = nullptr );
|
||||
~QskMessageSubWindow() override;
|
||||
|
||||
void setInfoTextOptions( const QskTextOptions& );
|
||||
QskTextOptions infoTextOptions() const;
|
||||
void setTextOptions( const QskTextOptions& );
|
||||
QskTextOptions textOptions() const;
|
||||
|
||||
QString infoText() const;
|
||||
QString text() const;
|
||||
|
||||
void setSymbolSource( const QUrl& url );
|
||||
QUrl symbolSource() const;
|
||||
@ -43,11 +43,11 @@ class QSK_EXPORT QskMessageSubWindow : public QskDialogSubWindow
|
||||
QskGraphic symbol() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setInfoText( const QString& );
|
||||
void setText( const QString& );
|
||||
|
||||
Q_SIGNALS:
|
||||
void infoTextChanged( const QString& );
|
||||
void infoTextOptionsChanged( const QskTextOptions& );
|
||||
void textChanged( const QString& );
|
||||
void textOptionsChanged( const QskTextOptions& );
|
||||
|
||||
private:
|
||||
class PrivateData;
|
||||
|
@ -23,14 +23,14 @@ namespace
|
||||
setObjectName( QStringLiteral( "QskMessageWindowTextLabel" ) );
|
||||
initSizePolicy( QskSizePolicy::Preferred, QskSizePolicy::Preferred );
|
||||
|
||||
setAlignment( Qt::AlignHCenter | Qt::AlignTop );
|
||||
setAlignment( Qt::AlignLeft | Qt::AlignTop );
|
||||
setWrapMode( QskTextOptions::WordWrap );
|
||||
|
||||
connect( this, &QskTextLabel::textChanged,
|
||||
box, &QskMessageWindow::infoTextChanged );
|
||||
box, &QskMessageWindow::textChanged );
|
||||
|
||||
connect( this, &QskTextLabel::textOptionsChanged,
|
||||
box, &QskMessageWindow::infoTextOptionsChanged );
|
||||
box, &QskMessageWindow::textOptionsChanged );
|
||||
}
|
||||
};
|
||||
|
||||
@ -104,22 +104,22 @@ QskMessageWindow::~QskMessageWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void QskMessageWindow::setInfoText( const QString& text )
|
||||
void QskMessageWindow::setText( const QString& text )
|
||||
{
|
||||
m_data->textLabel->setText( text );
|
||||
}
|
||||
|
||||
QString QskMessageWindow::infoText() const
|
||||
QString QskMessageWindow::text() const
|
||||
{
|
||||
return m_data->textLabel->text();
|
||||
}
|
||||
|
||||
void QskMessageWindow::setInfoTextOptions( const QskTextOptions& options )
|
||||
void QskMessageWindow::setTextOptions( const QskTextOptions& options )
|
||||
{
|
||||
m_data->textLabel->setTextOptions( options );
|
||||
}
|
||||
|
||||
QskTextOptions QskMessageWindow::infoTextOptions() const
|
||||
QskTextOptions QskMessageWindow::textOptions() const
|
||||
{
|
||||
return m_data->textLabel->textOptions();
|
||||
}
|
||||
|
@ -15,11 +15,11 @@ class QSK_EXPORT QskMessageWindow : public QskDialogWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY( QString infoText READ infoText
|
||||
WRITE setInfoText NOTIFY infoTextChanged )
|
||||
Q_PROPERTY( QString text READ text
|
||||
WRITE setText NOTIFY textChanged )
|
||||
|
||||
Q_PROPERTY( QskTextOptions infoTextOptions READ infoTextOptions
|
||||
WRITE setInfoTextOptions NOTIFY infoTextOptionsChanged )
|
||||
Q_PROPERTY( QskTextOptions textOptions READ textOptions
|
||||
WRITE setTextOptions NOTIFY textOptionsChanged )
|
||||
|
||||
Q_PROPERTY( QUrl symbolSource READ symbolSource WRITE setSymbolSource )
|
||||
|
||||
@ -29,10 +29,10 @@ class QSK_EXPORT QskMessageWindow : public QskDialogWindow
|
||||
QskMessageWindow( QWindow* parent = nullptr );
|
||||
~QskMessageWindow() override;
|
||||
|
||||
void setInfoTextOptions( const QskTextOptions& );
|
||||
QskTextOptions infoTextOptions() const;
|
||||
void setTextOptions( const QskTextOptions& );
|
||||
QskTextOptions textOptions() const;
|
||||
|
||||
QString infoText() const;
|
||||
QString text() const;
|
||||
|
||||
void setSymbolSource( const QUrl& url );
|
||||
QUrl symbolSource() const;
|
||||
@ -43,16 +43,15 @@ class QSK_EXPORT QskMessageWindow : public QskDialogWindow
|
||||
QskGraphic symbol() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setInfoText( const QString& );
|
||||
void setText( const QString& );
|
||||
|
||||
Q_SIGNALS:
|
||||
void infoTextChanged( const QString& );
|
||||
void infoTextOptionsChanged( const QskTextOptions& );
|
||||
void textChanged( const QString& );
|
||||
void textOptionsChanged( const QskTextOptions& );
|
||||
|
||||
private:
|
||||
class PrivateData;
|
||||
std::unique_ptr< PrivateData > m_data;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user