mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-05 10:32:28 +01:00
Remove QScreen to get valid data from windows
This commit is contained in:
parent
7263204616
commit
7f341e642e
@ -82,7 +82,7 @@ QVariant MonitorListModel::data(const QModelIndex& index, int role) const
|
||||
case MonitorRole::Index:
|
||||
return m_monitorList.at(row).m_index;
|
||||
case MonitorRole::Geometry:
|
||||
return m_monitorList.at(row).m_screen->geometry();
|
||||
return m_monitorList.at(row).m_geometry;
|
||||
case MonitorRole::InstalledType:
|
||||
if (m_monitorList.at(row).m_activeWallpaper) {
|
||||
return static_cast<int>(m_monitorList.at(row).m_activeWallpaper->type());
|
||||
@ -138,7 +138,7 @@ void MonitorListModel::loadMonitors()
|
||||
width,
|
||||
height);
|
||||
beginInsertRows(index, m_monitorList.size(), m_monitorList.size());
|
||||
m_monitorList.append(Monitor { i, geometry, QApplication::screens().at(i) });
|
||||
m_monitorList.append(Monitor { i, geometry });
|
||||
endInsertRows();
|
||||
}
|
||||
#else
|
||||
|
@ -59,17 +59,14 @@ struct Monitor {
|
||||
|
||||
Monitor(
|
||||
const int index,
|
||||
const QRect& geometry,
|
||||
QScreen* screen)
|
||||
const QRect& geometry)
|
||||
{
|
||||
m_index = index;
|
||||
m_geometry = geometry;
|
||||
m_screen = screen;
|
||||
}
|
||||
|
||||
int m_index { 0 };
|
||||
QRect m_geometry;
|
||||
QScreen* m_screen { nullptr };
|
||||
std::shared_ptr<ScreenPlayWallpaper> m_activeWallpaper { nullptr };
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user