diff options
Diffstat (limited to 'examples/itemviews')
-rw-r--r-- | examples/itemviews/chart/chart.pro | 2 | ||||
-rw-r--r-- | examples/itemviews/coloreditorfactory/colorlisteditor.cpp | 2 | ||||
-rw-r--r-- | examples/itemviews/puzzle/piecesmodel.cpp | 2 | ||||
-rw-r--r-- | examples/itemviews/stardelegate/main.cpp | 2 | ||||
-rw-r--r-- | examples/itemviews/stardelegate/stardelegate.cpp | 18 |
5 files changed, 13 insertions, 13 deletions
diff --git a/examples/itemviews/chart/chart.pro b/examples/itemviews/chart/chart.pro index 53601f4..12f08b9 100644 --- a/examples/itemviews/chart/chart.pro +++ b/examples/itemviews/chart/chart.pro @@ -4,7 +4,7 @@ RESOURCES = chart.qrc SOURCES = main.cpp \ mainwindow.cpp \ pieview.cpp -unix:!mac:!symbian:!vxworks:LIBS+= -lm +unix:!mac:!symbian:!vxworks:!integrity:LIBS+= -lm TARGET.EPOCHEAPSIZE = 0x200000 0x800000 diff --git a/examples/itemviews/coloreditorfactory/colorlisteditor.cpp b/examples/itemviews/coloreditorfactory/colorlisteditor.cpp index 6797316..d8ce45b 100644 --- a/examples/itemviews/coloreditorfactory/colorlisteditor.cpp +++ b/examples/itemviews/coloreditorfactory/colorlisteditor.cpp @@ -50,7 +50,7 @@ ColorListEditor::ColorListEditor(QWidget *widget) : QComboBox(widget) //! [0] QColor ColorListEditor::color() const { - return qVariantValue<QColor>(itemData(currentIndex(), Qt::DecorationRole)); + return qvariant_cast<QColor>(itemData(currentIndex(), Qt::DecorationRole)); } //! [0] diff --git a/examples/itemviews/puzzle/piecesmodel.cpp b/examples/itemviews/puzzle/piecesmodel.cpp index d7a37a9..4235050 100644 --- a/examples/itemviews/puzzle/piecesmodel.cpp +++ b/examples/itemviews/puzzle/piecesmodel.cpp @@ -124,7 +124,7 @@ QMimeData *PiecesModel::mimeData(const QModelIndexList &indexes) const foreach (QModelIndex index, indexes) { if (index.isValid()) { - QPixmap pixmap = qVariantValue<QPixmap>(data(index, Qt::UserRole)); + QPixmap pixmap = qvariant_cast<QPixmap>(data(index, Qt::UserRole)); QPoint location = data(index, Qt::UserRole+1).toPoint(); stream << pixmap << location; } diff --git a/examples/itemviews/stardelegate/main.cpp b/examples/itemviews/stardelegate/main.cpp index 5ff9782..1af54d0 100644 --- a/examples/itemviews/stardelegate/main.cpp +++ b/examples/itemviews/stardelegate/main.cpp @@ -71,7 +71,7 @@ void populateTableWidget(QTableWidget *tableWidget) QTableWidgetItem *item2 = new QTableWidgetItem(staticData[row].artist); QTableWidgetItem *item3 = new QTableWidgetItem; item3->setData(0, - qVariantFromValue(StarRating(staticData[row].rating))); + QVariant::fromValue(StarRating(staticData[row].rating))); tableWidget->setItem(row, 0, item0); tableWidget->setItem(row, 1, item1); diff --git a/examples/itemviews/stardelegate/stardelegate.cpp b/examples/itemviews/stardelegate/stardelegate.cpp index 8a7a26c..c784da2 100644 --- a/examples/itemviews/stardelegate/stardelegate.cpp +++ b/examples/itemviews/stardelegate/stardelegate.cpp @@ -48,8 +48,8 @@ void StarDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { - if (qVariantCanConvert<StarRating>(index.data())) { - StarRating starRating = qVariantValue<StarRating>(index.data()); + if (index.data().canConvert<StarRating>()) { + StarRating starRating = qvariant_cast<StarRating>(index.data()); if (option.state & QStyle::State_Selected) painter->fillRect(option.rect, option.palette.highlight()); @@ -66,8 +66,8 @@ void StarDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, QSize StarDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { - if (qVariantCanConvert<StarRating>(index.data())) { - StarRating starRating = qVariantValue<StarRating>(index.data()); + if (index.data().canConvert<StarRating>()) { + StarRating starRating = qvariant_cast<StarRating>(index.data()); return starRating.sizeHint(); } else { return QStyledItemDelegate::sizeHint(option, index); @@ -81,7 +81,7 @@ QWidget *StarDelegate::createEditor(QWidget *parent, const QModelIndex &index) const { - if (qVariantCanConvert<StarRating>(index.data())) { + if (index.data().canConvert<StarRating>()) { StarEditor *editor = new StarEditor(parent); connect(editor, SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor())); @@ -96,8 +96,8 @@ QWidget *StarDelegate::createEditor(QWidget *parent, void StarDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { - if (qVariantCanConvert<StarRating>(index.data())) { - StarRating starRating = qVariantValue<StarRating>(index.data()); + if (index.data().canConvert<StarRating>()) { + StarRating starRating = qvariant_cast<StarRating>(index.data()); StarEditor *starEditor = qobject_cast<StarEditor *>(editor); starEditor->setStarRating(starRating); } else { @@ -110,9 +110,9 @@ void StarDelegate::setEditorData(QWidget *editor, void StarDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { - if (qVariantCanConvert<StarRating>(index.data())) { + if (index.data().canConvert<StarRating>()) { StarEditor *starEditor = qobject_cast<StarEditor *>(editor); - model->setData(index, qVariantFromValue(starEditor->starRating())); + model->setData(index, QVariant::fromValue(starEditor->starRating())); } else { QStyledItemDelegate::setModelData(editor, model, index); } |