Port QtExtras.QImageItem to Qt5, enable build

This commit is contained in:
Sebastian Kügler 2013-02-15 00:20:01 +01:00
parent 49dee59515
commit a283134b3e
3 changed files with 8 additions and 11 deletions

View File

@ -7,7 +7,7 @@ add_subdirectory(tests)
set(qtextracomponents_SRCS set(qtextracomponents_SRCS
qtextracomponentsplugin.cpp qtextracomponentsplugin.cpp
qpixmapitem.cpp qpixmapitem.cpp
# qimageitem.cpp qimageitem.cpp
qiconitem.cpp qiconitem.cpp
mouseeventlistener.cpp mouseeventlistener.cpp
columnproxymodel.cpp columnproxymodel.cpp

View File

@ -22,12 +22,12 @@
#include <QPainter> #include <QPainter>
QImageItem::QImageItem(QDeclarativeItem *parent) QImageItem::QImageItem(QQuickItem *parent)
: QDeclarativeItem(parent), : QQuickPaintedItem(parent),
m_smooth(false), m_smooth(false),
m_fillMode(QImageItem::Stretch) m_fillMode(QImageItem::Stretch)
{ {
setFlag(QGraphicsItem::ItemHasNoContents, false); setFlag(ItemHasContents, true);
} }
@ -93,11 +93,8 @@ void QImageItem::setFillMode(QImageItem::FillMode mode)
emit fillModeChanged(); emit fillModeChanged();
} }
void QImageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) void QImageItem::paint(QPainter *painter)
{ {
Q_UNUSED(option);
Q_UNUSED(widget);
if (m_image.isNull()) { if (m_image.isNull()) {
return; return;
} }

View File

@ -19,10 +19,10 @@
#ifndef QIMAGEITEM_H #ifndef QIMAGEITEM_H
#define QIMAGEITEM_H #define QIMAGEITEM_H
#include <QQuickItem> #include <QQuickPaintedItem>
#include <QImage> #include <QImage>
class QImageItem : public QQuickItem class QImageItem : public QQuickPaintedItem
{ {
Q_OBJECT Q_OBJECT
@ -59,7 +59,7 @@ public:
FillMode fillMode() const; FillMode fillMode() const;
void setFillMode(FillMode mode); void setFillMode(FillMode mode);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); void paint(QPainter *painter);
bool isNull() const; bool isNull() const;