support for centering

This commit is contained in:
Marco Martin 2011-06-08 13:02:22 +02:00
parent e8b1374ff0
commit 9cd8721f61
2 changed files with 4 additions and 3 deletions

View File

@ -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<Plasma::Corona *>(item->scene());
if (corona) {
return corona->popupPosition(item, m_dialog->size());
return corona->popupPosition(item, m_dialog->size(), (Qt::AlignmentFlag)alignment);
} else {
return QPoint();
}

View File

@ -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);