Port QtExtras.QPixmapItem to Qt5, enable build

This commit is contained in:
Sebastian Kügler 2013-02-15 00:16:21 +01:00
parent 7528bbba38
commit 49dee59515
3 changed files with 7 additions and 10 deletions

View File

@ -6,7 +6,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

View File

@ -23,11 +23,11 @@
QPixmapItem::QPixmapItem(QQuickItem *parent) QPixmapItem::QPixmapItem(QQuickItem *parent)
: QQuickItem(parent), : QQuickPaintedItem(parent),
m_smooth(false), m_smooth(false),
m_fillMode(QPixmapItem::Stretch) m_fillMode(QPixmapItem::Stretch)
{ {
setFlag(QGraphicsItem::ItemHasNoContents, false); setFlag(ItemHasContents, true);
} }
@ -93,11 +93,8 @@ void QPixmapItem::setFillMode(QPixmapItem::FillMode mode)
emit fillModeChanged(); emit fillModeChanged();
} }
void QPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) void QPixmapItem::paint(QPainter *painter)
{ {
Q_UNUSED(option);
Q_UNUSED(widget);
if (m_pixmap.isNull()) { if (m_pixmap.isNull()) {
return; return;
} }

View File

@ -19,10 +19,10 @@
#ifndef QPIXMAPITEM_H #ifndef QPIXMAPITEM_H
#define QPIXMAPITEM_H #define QPIXMAPITEM_H
#include <QQuickItem> #include <QQuickPaintedItem>
#include <QPixmap> #include <QPixmap>
class QPixmapItem : public QQuickItem class QPixmapItem : 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;