mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-14 08:50:08 -05:00
Don't use deprecated Qt methods.
This commit is contained in:
parent
ddd5e8a209
commit
5d46ecdbe6
@ -418,27 +418,27 @@ void ModelTest::data()
|
|||||||
// General Purpose roles that should return a QString
|
// General Purpose roles that should return a QString
|
||||||
QVariant variant = model->data ( model->index ( 0, 0 ), Qt::ToolTipRole );
|
QVariant variant = model->data ( model->index ( 0, 0 ), Qt::ToolTipRole );
|
||||||
if ( variant.isValid() ) {
|
if ( variant.isValid() ) {
|
||||||
QVERIFY( qVariantCanConvert<QString> ( variant ) );
|
QVERIFY( variant.canConvert<QString>() );
|
||||||
}
|
}
|
||||||
variant = model->data ( model->index ( 0, 0 ), Qt::StatusTipRole );
|
variant = model->data ( model->index ( 0, 0 ), Qt::StatusTipRole );
|
||||||
if ( variant.isValid() ) {
|
if ( variant.isValid() ) {
|
||||||
QVERIFY( qVariantCanConvert<QString> ( variant ) );
|
QVERIFY( variant.canConvert<QString>() );
|
||||||
}
|
}
|
||||||
variant = model->data ( model->index ( 0, 0 ), Qt::WhatsThisRole );
|
variant = model->data ( model->index ( 0, 0 ), Qt::WhatsThisRole );
|
||||||
if ( variant.isValid() ) {
|
if ( variant.isValid() ) {
|
||||||
QVERIFY( qVariantCanConvert<QString> ( variant ) );
|
QVERIFY( variant.canConvert<QString>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// General Purpose roles that should return a QSize
|
// General Purpose roles that should return a QSize
|
||||||
variant = model->data ( model->index ( 0, 0 ), Qt::SizeHintRole );
|
variant = model->data ( model->index ( 0, 0 ), Qt::SizeHintRole );
|
||||||
if ( variant.isValid() ) {
|
if ( variant.isValid() ) {
|
||||||
QVERIFY( qVariantCanConvert<QSize> ( variant ) );
|
QVERIFY( variant.canConvert<QSize>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// General Purpose roles that should return a QFont
|
// General Purpose roles that should return a QFont
|
||||||
QVariant fontVariant = model->data ( model->index ( 0, 0 ), Qt::FontRole );
|
QVariant fontVariant = model->data ( model->index ( 0, 0 ), Qt::FontRole );
|
||||||
if ( fontVariant.isValid() ) {
|
if ( fontVariant.isValid() ) {
|
||||||
QVERIFY( qVariantCanConvert<QFont> ( fontVariant ) );
|
QVERIFY( fontVariant.canConvert<QFont>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the alignment is one we know about
|
// Check that the alignment is one we know about
|
||||||
@ -451,12 +451,12 @@ void ModelTest::data()
|
|||||||
// General Purpose roles that should return a QColor
|
// General Purpose roles that should return a QColor
|
||||||
QVariant colorVariant = model->data ( model->index ( 0, 0 ), Qt::BackgroundColorRole );
|
QVariant colorVariant = model->data ( model->index ( 0, 0 ), Qt::BackgroundColorRole );
|
||||||
if ( colorVariant.isValid() ) {
|
if ( colorVariant.isValid() ) {
|
||||||
QVERIFY( qVariantCanConvert<QColor> ( colorVariant ) );
|
QVERIFY( colorVariant.canConvert<QColor>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
colorVariant = model->data ( model->index ( 0, 0 ), Qt::TextColorRole );
|
colorVariant = model->data ( model->index ( 0, 0 ), Qt::TextColorRole );
|
||||||
if ( colorVariant.isValid() ) {
|
if ( colorVariant.isValid() ) {
|
||||||
QVERIFY( qVariantCanConvert<QColor> ( colorVariant ) );
|
QVERIFY( colorVariant.canConvert<QColor>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the "check state" is one we know about.
|
// Check that the "check state" is one we know about.
|
||||||
|
Loading…
Reference in New Issue
Block a user