Don't use deprecated Qt methods.

This commit is contained in:
Felix Geyer 2012-10-27 00:06:12 +02:00
parent ddd5e8a209
commit 5d46ecdbe6

View File

@ -418,27 +418,27 @@ void ModelTest::data()
// General Purpose roles that should return a QString
QVariant variant = model->data ( model->index ( 0, 0 ), Qt::ToolTipRole );
if ( variant.isValid() ) {
QVERIFY( qVariantCanConvert<QString> ( variant ) );
QVERIFY( variant.canConvert<QString>() );
}
variant = model->data ( model->index ( 0, 0 ), Qt::StatusTipRole );
if ( variant.isValid() ) {
QVERIFY( qVariantCanConvert<QString> ( variant ) );
QVERIFY( variant.canConvert<QString>() );
}
variant = model->data ( model->index ( 0, 0 ), Qt::WhatsThisRole );
if ( variant.isValid() ) {
QVERIFY( qVariantCanConvert<QString> ( variant ) );
QVERIFY( variant.canConvert<QString>() );
}
// General Purpose roles that should return a QSize
variant = model->data ( model->index ( 0, 0 ), Qt::SizeHintRole );
if ( variant.isValid() ) {
QVERIFY( qVariantCanConvert<QSize> ( variant ) );
QVERIFY( variant.canConvert<QSize>() );
}
// General Purpose roles that should return a QFont
QVariant fontVariant = model->data ( model->index ( 0, 0 ), Qt::FontRole );
if ( fontVariant.isValid() ) {
QVERIFY( qVariantCanConvert<QFont> ( fontVariant ) );
QVERIFY( fontVariant.canConvert<QFont>() );
}
// Check that the alignment is one we know about
@ -451,12 +451,12 @@ void ModelTest::data()
// General Purpose roles that should return a QColor
QVariant colorVariant = model->data ( model->index ( 0, 0 ), Qt::BackgroundColorRole );
if ( colorVariant.isValid() ) {
QVERIFY( qVariantCanConvert<QColor> ( colorVariant ) );
QVERIFY( colorVariant.canConvert<QColor>() );
}
colorVariant = model->data ( model->index ( 0, 0 ), Qt::TextColorRole );
if ( colorVariant.isValid() ) {
QVERIFY( qVariantCanConvert<QColor> ( colorVariant ) );
QVERIFY( colorVariant.canConvert<QColor>() );
}
// Check that the "check state" is one we know about.