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