From 9cd8721f61c68354e74acf799ba1240a4678cb4b Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 Jun 2011 13:02:22 +0200 Subject: [PATCH] support for centering --- declarativeimports/core/dialog.cpp | 4 ++-- declarativeimports/core/dialog.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/declarativeimports/core/dialog.cpp b/declarativeimports/core/dialog.cpp index 2b9420a3e..e6fbd15f9 100644 --- a/declarativeimports/core/dialog.cpp +++ b/declarativeimports/core/dialog.cpp @@ -125,11 +125,11 @@ void DialogProxy::setVisible(const bool visible) } } -QPoint DialogProxy::popupPosition(QGraphicsObject *item) const +QPoint DialogProxy::popupPosition(QGraphicsObject *item, int alignment) const { Plasma::Corona *corona = qobject_cast(item->scene()); if (corona) { - return corona->popupPosition(item, m_dialog->size()); + return corona->popupPosition(item, m_dialog->size(), (Qt::AlignmentFlag)alignment); } else { return QPoint(); } diff --git a/declarativeimports/core/dialog.h b/declarativeimports/core/dialog.h index e86fffc76..8cfdc1664 100644 --- a/declarativeimports/core/dialog.h +++ b/declarativeimports/core/dialog.h @@ -72,7 +72,8 @@ public: int windowFlags() const; void setWindowFlags(const int); - Q_INVOKABLE QPoint popupPosition(QGraphicsObject *item) const; + //FIXME: alignment should be Qt::AlignmentFlag + Q_INVOKABLE QPoint popupPosition(QGraphicsObject *item, int alignment=Qt::AlignLeft) const; //FIXME:: Qt::WidgetAttribute should be already Q_INVOKABLE void setAttribute(int attribute, bool on);