showPopup() -> popupPosition()
makes possible to move the popup
This commit is contained in:
parent
b958bf1480
commit
19ad72af78
@ -164,18 +164,14 @@ void DialogProxy::setVisible(const bool visible)
|
||||
}
|
||||
}
|
||||
|
||||
void DialogProxy::showPopup(QGraphicsObject *item)
|
||||
QPoint DialogProxy::popupPosition(QGraphicsObject *item) const
|
||||
{
|
||||
if (m_dialog->isVisible()) {
|
||||
m_dialog->hide();
|
||||
Plasma::Corona *corona = qobject_cast<Plasma::Corona *>(item->scene());
|
||||
if (corona) {
|
||||
return corona->popupPosition(item, m_dialog->size());
|
||||
} else {
|
||||
Plasma::Corona *corona = qobject_cast<Plasma::Corona *>(item->scene());
|
||||
if (corona) {
|
||||
m_dialog->move(corona->popupPosition(item, m_dialog->size()));
|
||||
}
|
||||
m_dialog->show();
|
||||
return QPoint();
|
||||
}
|
||||
emit visibleChanged();
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QWeakPointer>
|
||||
#include <QPoint>
|
||||
|
||||
class QGraphicsObject;
|
||||
|
||||
@ -60,7 +61,7 @@ public:
|
||||
int y() const;
|
||||
void setY(int y);
|
||||
|
||||
Q_INVOKABLE void showPopup(QGraphicsObject *item);
|
||||
Q_INVOKABLE QPoint popupPosition(QGraphicsObject *item) const;
|
||||
//FIXME:: Qt::WidgetAttribute should be already
|
||||
Q_INVOKABLE void setAttribute(int attribute, bool on);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user