Remove windowFlags property

This is a needless duplication of the property, and it causes bugs.

Removing it, and porting all users to the flags property from QWindow
magically makes layering and resizability bugs vanish.

One problem is left: the dialog dismisses too easily, it should not
dismiss when being resized, moved or when a child dialog or QMenu opens
from it.
This commit is contained in:
Sebastian Kügler 2013-12-17 02:33:39 +01:00
parent 4c17887657
commit 2edebc57c3
2 changed files with 1 additions and 24 deletions

View File

@ -52,8 +52,6 @@ DialogProxy::DialogProxy(QQuickItem *parent)
setColor(QColor(Qt::transparent));
setFlags(Qt::FramelessWindowHint);
m_flags = flags();
m_syncTimer = new QTimer(this);
m_syncTimer->setSingleShot(true);
m_syncTimer->setInterval(250);
@ -173,7 +171,7 @@ void DialogProxy::onVisibleChanged()
} else {
KWindowSystem::setOnAllDesktops(winId(), false);
}
setFlags(Qt::FramelessWindowHint|m_flags);
setFlags(Qt::FramelessWindowHint|flags());
}
}
@ -302,17 +300,6 @@ void DialogProxy::activateWindow()
setWindowState(Qt::WindowActive);
}
int DialogProxy::windowFlags() const
{
return (int)m_flags;
}
void DialogProxy::setWindowFlags(const int flags)
{
m_flags = (Qt::WindowFlags)flags;
setFlags(Qt::FramelessWindowHint|m_flags);
}
Plasma::Types::Location DialogProxy::location() const
{
return m_location;

View File

@ -56,11 +56,6 @@ class DialogProxy : public QQuickWindow
*/
Q_PROPERTY(QQuickItem *visualParent READ visualParent WRITE setVisualParent NOTIFY visualParentChanged)
/**
* Window flags of the Dialog window
*/
Q_PROPERTY(int windowFlags READ windowFlags WRITE setWindowFlags)
/**
* Margins of the dialog around the mainItem.
* @see DialogMargins
@ -118,10 +113,6 @@ public:
*/
Q_INVOKABLE void activateWindow();
//FIXME: passing an int is ugly
int windowFlags() const;
void setWindowFlags(const int);
Plasma::Types::Location location() const;
void setLocation(Plasma::Types::Location location);
@ -170,7 +161,6 @@ private Q_SLOTS:
void onVisibleChanged();
private:
Qt::WindowFlags m_flags;
bool m_activeWindow;
QRect m_cachedGeometry;
WindowType m_type;