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
qtextracomponentsplugin.cpp
qpixmapitem.cpp
# qimageitem.cpp
qimageitem.cpp
qiconitem.cpp
mouseeventlistener.cpp
columnproxymodel.cpp

View File

@ -22,12 +22,12 @@
#include <QPainter>
QImageItem::QImageItem(QDeclarativeItem *parent)
: QDeclarativeItem(parent),
QImageItem::QImageItem(QQuickItem *parent)
: QQuickPaintedItem(parent),
m_smooth(false),
m_fillMode(QImageItem::Stretch)
{
setFlag(QGraphicsItem::ItemHasNoContents, false);
setFlag(ItemHasContents, true);
}
@ -93,11 +93,8 @@ void QImageItem::setFillMode(QImageItem::FillMode mode)
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()) {
return;
}

View File

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