add int Screens::intersecting(QRect)
REVIEW: 112910
This commit is contained in:
parent
05bc5bfc0b
commit
c6580ce696
2 changed files with 13 additions and 0 deletions
11
screens.cpp
11
screens.cpp
|
@ -117,6 +117,17 @@ int Screens::current() const
|
||||||
return m_current;
|
return m_current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Screens::intersecting(const QRect &r) const
|
||||||
|
{
|
||||||
|
int cnt = 0;
|
||||||
|
for (int i = 0; i < count(); ++i) {
|
||||||
|
if (geometry(i).intersects(r)) {
|
||||||
|
++cnt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cnt;
|
||||||
|
}
|
||||||
|
|
||||||
DesktopWidgetScreens::DesktopWidgetScreens(QObject *parent)
|
DesktopWidgetScreens::DesktopWidgetScreens(QObject *parent)
|
||||||
: Screens(parent)
|
: Screens(parent)
|
||||||
, m_desktop(QApplication::desktop())
|
, m_desktop(QApplication::desktop())
|
||||||
|
|
|
@ -68,6 +68,8 @@ public:
|
||||||
|
|
||||||
inline bool isChanging() { return m_changedTimer->isActive(); }
|
inline bool isChanging() { return m_changedTimer->isActive(); }
|
||||||
|
|
||||||
|
int intersecting(const QRect &r) const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void reconfigure();
|
void reconfigure();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue