Merge branch 'master' into plasma/mart/PageRow
This commit is contained in:
commit
8276343bcf
@ -158,7 +158,7 @@ void QMenuProxy::itemTriggered(QAction *action)
|
||||
}
|
||||
}
|
||||
|
||||
void QMenuProxy::showMenu(int x, int y)
|
||||
void QMenuProxy::open(int x, int y)
|
||||
{
|
||||
m_menu->clear();
|
||||
foreach(QMenuItem* item, m_items) {
|
||||
@ -188,14 +188,14 @@ void QMenuProxy::open()
|
||||
}
|
||||
|
||||
if (!parentItem || !parentItem->scene()) {
|
||||
showMenu(0, 0);
|
||||
open(0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
QList<QGraphicsView*> views = parentItem->scene()->views();
|
||||
|
||||
if (views.size() < 1) {
|
||||
showMenu(0, 0);
|
||||
open(0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ void QMenuProxy::open()
|
||||
}
|
||||
|
||||
if (!view) {
|
||||
showMenu(0, 0);
|
||||
open(0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
QObject *visualParent() const;
|
||||
void setVisualParent(QObject *parent);
|
||||
|
||||
void showMenu(int x, int y);
|
||||
Q_INVOKABLE void open(int x, int y);
|
||||
Q_INVOKABLE void open();
|
||||
Q_INVOKABLE void close();
|
||||
Q_INVOKABLE void clearMenuItems();
|
||||
|
@ -151,6 +151,7 @@ Item {
|
||||
|
||||
visible: indeterminate || value > 0
|
||||
onWidthChanged: resizeTimer.restart()
|
||||
onHeightChanged: resizeTimer.restart()
|
||||
|
||||
SequentialAnimation {
|
||||
id: indeterminateAnimation
|
||||
|
@ -91,8 +91,8 @@ Item {
|
||||
|
||||
signal clicked
|
||||
|
||||
implicitWidth: label.paintedWidth + (internal.portrait ? 0 : (iconSource != null ? 16 : 0))
|
||||
implicitHeight: label.paintedHeight + (internal.portrait ? (iconSource != null ? 16 : 0) : 0)
|
||||
implicitWidth: label.implicitWidth + (internal.portrait ? 0 : (iconSource != null ? 16 : 0))
|
||||
implicitHeight: label.implicitHeight + (internal.portrait ? (iconSource != null ? 16 : 0) : 0)
|
||||
|
||||
opacity: enabled ? 1 : 0.6
|
||||
//long notation to not make it overwritten by implementations
|
||||
|
@ -52,7 +52,7 @@ Properties:
|
||||
Sets the font for the button.
|
||||
|
||||
bool enabled:
|
||||
Returns wether the button is currently enabled and receives user input.
|
||||
Returns whether the button is currently enabled and receives user input.
|
||||
|
||||
Signals:
|
||||
onClicked:
|
||||
|
@ -37,10 +37,15 @@ QImageItem::~QImageItem()
|
||||
|
||||
void QImageItem::setImage(const QImage &image)
|
||||
{
|
||||
bool oldImageNull = m_image.isNull();
|
||||
m_image = image;
|
||||
update();
|
||||
emit nativeWidthChanged();
|
||||
emit nativeHeightChanged();
|
||||
emit imageChanged();
|
||||
if (oldImageNull != m_image.isNull()) {
|
||||
emit nullChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QImage QImageItem::image() const
|
||||
@ -143,5 +148,9 @@ void QImageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
bool QImageItem::isNull() const
|
||||
{
|
||||
return m_image.isNull();
|
||||
}
|
||||
|
||||
#include "qimageitem.moc"
|
||||
|
@ -26,11 +26,12 @@ class QImageItem : public QDeclarativeItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QImage image READ image WRITE setImage)
|
||||
Q_PROPERTY(QImage image READ image WRITE setImage NOTIFY imageChanged)
|
||||
Q_PROPERTY(bool smooth READ smooth WRITE setSmooth)
|
||||
Q_PROPERTY(int nativeWidth READ nativeWidth NOTIFY nativeWidthChanged)
|
||||
Q_PROPERTY(int nativeHeight READ nativeHeight NOTIFY nativeHeightChanged)
|
||||
Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged)
|
||||
Q_PROPERTY(bool null READ isNull NOTIFY nullChanged)
|
||||
Q_ENUMS(FillMode)
|
||||
|
||||
public:
|
||||
@ -60,10 +61,14 @@ public:
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
bool isNull() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void nativeWidthChanged();
|
||||
void nativeHeightChanged();
|
||||
void fillModeChanged();
|
||||
void imageChanged();
|
||||
void nullChanged();
|
||||
|
||||
private:
|
||||
QImage m_image;
|
||||
|
@ -37,10 +37,15 @@ QPixmapItem::~QPixmapItem()
|
||||
|
||||
void QPixmapItem::setPixmap(const QPixmap &pixmap)
|
||||
{
|
||||
bool oldPixmapNull = m_pixmap.isNull();
|
||||
m_pixmap = pixmap;
|
||||
update();
|
||||
emit nativeWidthChanged();
|
||||
emit nativeHeightChanged();
|
||||
emit pixmapChanged();
|
||||
if (oldPixmapNull != m_pixmap.isNull()) {
|
||||
emit nullChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QPixmap QPixmapItem::pixmap() const
|
||||
@ -143,5 +148,9 @@ void QPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
bool QPixmapItem::isNull() const
|
||||
{
|
||||
return m_pixmap.isNull();
|
||||
}
|
||||
|
||||
#include "qpixmapitem.moc"
|
||||
|
@ -26,11 +26,12 @@ class QPixmapItem : public QDeclarativeItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
|
||||
Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap NOTIFY pixmapChanged)
|
||||
Q_PROPERTY(bool smooth READ smooth WRITE setSmooth)
|
||||
Q_PROPERTY(int nativeWidth READ nativeWidth NOTIFY nativeWidthChanged)
|
||||
Q_PROPERTY(int nativeHeight READ nativeHeight NOTIFY nativeHeightChanged)
|
||||
Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged)
|
||||
Q_PROPERTY(bool null READ isNull NOTIFY nullChanged)
|
||||
Q_ENUMS(FillMode)
|
||||
|
||||
public:
|
||||
@ -60,10 +61,14 @@ public:
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
bool isNull() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void nativeWidthChanged();
|
||||
void nativeHeightChanged();
|
||||
void fillModeChanged();
|
||||
void pixmapChanged();
|
||||
void nullChanged();
|
||||
|
||||
private:
|
||||
QPixmap m_pixmap;
|
||||
|
Loading…
Reference in New Issue
Block a user