Port QtExtras.QPixmapItem to Qt5, enable build
This commit is contained in:
parent
7528bbba38
commit
49dee59515
@ -6,7 +6,7 @@ add_subdirectory(tests)
|
||||
|
||||
set(qtextracomponents_SRCS
|
||||
qtextracomponentsplugin.cpp
|
||||
# qpixmapitem.cpp
|
||||
qpixmapitem.cpp
|
||||
# qimageitem.cpp
|
||||
qiconitem.cpp
|
||||
mouseeventlistener.cpp
|
||||
|
@ -23,11 +23,11 @@
|
||||
|
||||
|
||||
QPixmapItem::QPixmapItem(QQuickItem *parent)
|
||||
: QQuickItem(parent),
|
||||
: QQuickPaintedItem(parent),
|
||||
m_smooth(false),
|
||||
m_fillMode(QPixmapItem::Stretch)
|
||||
{
|
||||
setFlag(QGraphicsItem::ItemHasNoContents, false);
|
||||
setFlag(ItemHasContents, true);
|
||||
}
|
||||
|
||||
|
||||
@ -93,11 +93,8 @@ void QPixmapItem::setFillMode(QPixmapItem::FillMode mode)
|
||||
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()) {
|
||||
return;
|
||||
}
|
||||
|
@ -19,10 +19,10 @@
|
||||
#ifndef QPIXMAPITEM_H
|
||||
#define QPIXMAPITEM_H
|
||||
|
||||
#include <QQuickItem>
|
||||
#include <QQuickPaintedItem>
|
||||
#include <QPixmap>
|
||||
|
||||
class QPixmapItem : public QQuickItem
|
||||
class QPixmapItem : 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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user