2019-12-05 15:24:12 +01:00
<!DOCTYPE html>
< html lang = "en" >
< head >
2020-03-31 15:35:51 +02:00
< meta charset = "utf-8" >
2019-12-05 15:24:12 +01:00
<!-- monitorlistmodel.cpp -->
2020-01-30 15:47:04 +01:00
< title > MonitorListModel Class | ScreenPlay< / title >
2019-12-05 15:24:12 +01:00
< link rel = "stylesheet" type = "text/css" href = "../css/style.css" / > < link rel = "stylesheet" type = "text/css" href = "../css/bootstrap.min.css" / >
< / head >
< body >
2020-11-22 12:24:43 +01:00
< div class = "container-fullwidth nav sticky-top" > < div class = "container navWrapper" > < a href = "../index.html" > < span class = "logo" > ScreenPlay Generated Docs < / span > < / a > < span class = "navHome" > < a href = "../index.html" > Home< / a > < / span > < / div > < / div > < div id = mainWrapper class = "wrapper container " >
2019-12-05 15:24:12 +01:00
< li > MonitorListModel< / li >
< div class = "sidebar" >
< div class = "toc" >
< h3 > < a name = "toc" > Contents< / a > < / h3 >
< ul >
2020-01-30 15:47:04 +01:00
< li class = "level1" > < a href = "#public-functions" > Public Functions< / a > < / li >
2020-03-31 15:35:51 +02:00
< li class = "level1" > < a href = "#reimplemented-public-functions" > Reimplemented Public Functions< / a > < / li >
< li class = "level1" > < a href = "#public-slots" > Public Slots< / a > < / li >
2019-12-05 15:24:12 +01:00
< li class = "level1" > < a href = "#details" > Detailed Description< / a > < / li >
< / ul >
< / div >
< div class = "sidebar-content" id = "sidebar-content" > < / div > < / div >
< h1 class = "title" > MonitorListModel Class< / h1 >
2021-05-13 13:05:05 +02:00
< span class = "small-subtitle" > class < a href = "screenplay-module.html" > ScreenPlay< / a > ::MonitorListModel< / span >
2019-12-05 15:24:12 +01:00
<!-- $$$MonitorListModel - brief -->
< p > MonitorListModel. < a href = "#details" > More...< / a > < / p >
<!-- @@@MonitorListModel -->
< div class = "table" > < table class = "alignedsummary" >
< tr > < td class = "memItemLeft rightAlign topAlign" > Header:< / td > < td class = "memItemRight bottomAlign" > < span class = "preprocessor" > #include < MonitorListModel> < / span >
< / td > < / tr > < / table > < / div > < ul >
2020-01-30 15:47:04 +01:00
< li > < a href = "screenplay-monitorlistmodel-members.html" > List of all members, including inherited members< / a > < / li >
2019-12-05 15:24:12 +01:00
< / ul >
2020-01-30 15:47:04 +01:00
< a name = "public-functions" > < / a >
< h2 id = "public-functions" > Public Functions< / h2 >
< div class = "table" > < table class = "alignedsummary" >
< tr > < td class = "memItemLeft rightAlign topAlign" > < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#MonitorListModel" > MonitorListModel< / a > < / b > (QObject *< i > parent< / i > = nullptr)< / td > < / tr >
2020-11-14 19:08:09 +01:00
< tr > < td class = "memItemLeft rightAlign topAlign" > std::optional< QString> < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#getAppIDByMonitorIndex" > getAppIDByMonitorIndex< / a > < / b > (const int < i > index< / i > ) const< / td > < / tr >
2021-05-13 13:05:05 +02:00
< tr > < td class = "memItemLeft rightAlign topAlign" > void < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#setWallpaperMonitor" > setWallpaperMonitor< / a > < / b > (const std::shared_ptr< ScreenPlayWallpaper> & < i > wallpaper< / i > , const QVector< int> < i > monitors< / i > )< / td > < / tr >
2020-03-31 15:35:51 +02:00
< / table > < / div >
< a name = "reimplemented-public-functions" > < / a >
< h2 id = "reimplemented-public-functions" > Reimplemented Public Functions< / h2 >
< div class = "table" > < table class = "alignedsummary" >
< tr > < td class = "memItemLeft rightAlign topAlign" > virtual QVariant < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#data" > data< / a > < / b > (const QModelIndex & < i > index< / i > , int < i > role< / i > = Qt::DisplayRole) const override< / td > < / tr >
< tr > < td class = "memItemLeft rightAlign topAlign" > virtual QHash< int, QByteArray> < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#roleNames" > roleNames< / a > < / b > () const override< / td > < / tr >
< tr > < td class = "memItemLeft rightAlign topAlign" > virtual int < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#rowCount" > rowCount< / a > < / b > (const QModelIndex & < i > parent< / i > = QModelIndex()) const override< / td > < / tr >
< / table > < / div >
< a name = "public-slots" > < / a >
< h2 id = "public-slots" > Public Slots< / h2 >
< div class = "table" > < table class = "alignedsummary" >
< tr > < td class = "memItemLeft rightAlign topAlign" > void < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#clearActiveWallpaper" > clearActiveWallpaper< / a > < / b > ()< / td > < / tr >
< tr > < td class = "memItemLeft rightAlign topAlign" > void < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#closeWallpaper" > closeWallpaper< / a > < / b > (const QString & < i > appID< / i > )< / td > < / tr >
2020-08-11 16:20:07 +02:00
< tr > < td class = "memItemLeft rightAlign topAlign" > QRect < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#getAbsoluteDesktopSize" > getAbsoluteDesktopSize< / a > < / b > () const< / td > < / tr >
2020-03-31 15:35:51 +02:00
< tr > < td class = "memItemLeft rightAlign topAlign" > void < / td > < td class = "memItemRight bottomAlign" > < b > < a href = "screenplay-monitorlistmodel.html#reset" > reset< / a > < / b > ()< / td > < / tr >
2020-01-30 15:47:04 +01:00
< / table > < / div >
2019-12-05 15:24:12 +01:00
< a name = "details" > < / a >
<!-- $$$MonitorListModel - description -->
< div class = "descr" >
< h2 id = "details" > Detailed Description< / h2 >
2019-12-08 11:38:48 +01:00
< p > Loads all available monitors and saves them in a QAbstractListModel inherited list model. This list model gets updated if:< / p >
< ul >
< li > A user adds or removes a monitor< / li >
< li > A user adds or removes a wallpaper< / li >
< li > On startup based on profiles.json< / li >
< / ul >
< p > This listmodel is also needed for calculating the monitor preview in the UI.< / p >
2019-12-05 15:24:12 +01:00
< / div >
<!-- @@@MonitorListModel -->
2020-01-30 15:47:04 +01:00
< div class = "func" >
< h2 > Member Function Documentation< / h2 >
<!-- $$$MonitorListModel[overload1]$$$MonitorListModelQObject* -->
< h3 class = "fn" id = "MonitorListModel" > < a name = "MonitorListModel" > < / a > MonitorListModel::< span class = "name" > MonitorListModel< / span > (< span class = "type" > QObject< / span > *< i > parent< / i > = nullptr)< / h3 >
2020-03-31 15:35:51 +02:00
< p > Constructor.< / p >
2020-01-30 15:47:04 +01:00
<!-- @@@MonitorListModel -->
2020-03-31 15:35:51 +02:00
<!-- $$$clearActiveWallpaper[overload1]$$$clearActiveWallpaper -->
< h3 class = "fn" id = "clearActiveWallpaper" > < a name = "clearActiveWallpaper" > < / a > < code > [slot] < / code > < span class = "type" > void< / span > MonitorListModel::< span class = "name" > clearActiveWallpaper< / span > ()< / h3 >
< p > Clears the listmodel.< / p >
<!-- @@@clearActiveWallpaper -->
<!-- $$$closeWallpaper[overload1]$$$closeWallpaperconstQString& -->
< h3 class = "fn" id = "closeWallpaper" > < a name = "closeWallpaper" > < / a > < code > [slot] < / code > < span class = "type" > void< / span > MonitorListModel::< span class = "name" > closeWallpaper< / span > (const < span class = "type" > QString< / span > & < i > appID< / i > )< / h3 >
< p > Removes the preview image and appID inside an monitor item.< / p >
<!-- @@@closeWallpaper -->
2020-08-11 16:20:07 +02:00
<!-- $$$getAbsoluteDesktopSize[overload1]$$$getAbsoluteDesktopSize -->
< h3 class = "fn" id = "getAbsoluteDesktopSize" > < a name = "getAbsoluteDesktopSize" > < / a > < code > [slot] < / code > < span class = "type" > QRect< / span > MonitorListModel::< span class = "name" > getAbsoluteDesktopSize< / span > () const< / h3 >
< p > MonitorListModel::getAbsoluteDesktopSize < b class = "redFont" > < code > \return< / code > < / b > < / p >
<!-- @@@getAbsoluteDesktopSize -->
2020-03-31 15:35:51 +02:00
<!-- $$$reset[overload1]$$$reset -->
< h3 class = "fn" id = "reset" > < a name = "reset" > < / a > < code > [slot] < / code > < span class = "type" > void< / span > MonitorListModel::< span class = "name" > reset< / span > ()< / h3 >
< p > Removes all items and loads them vida loadMonitors() again.< / p >
<!-- @@@reset -->
<!-- $$$data[overload1]$$$dataconstQModelIndex&int -->
< h3 class = "fn" id = "data" > < a name = "data" > < / a > < code > [override virtual] < / code > < span class = "type" > QVariant< / span > MonitorListModel::< span class = "name" > data< / span > (const < span class = "type" > QModelIndex< / span > & < i > index< / i > , < span class = "type" > int< / span > < i > role< / i > = Qt::DisplayRole) const< / h3 >
< p > Retruns the data member of the Monitor.< / p >
<!-- @@@data -->
<!-- $$$getAppIDByMonitorIndex[overload1]$$$getAppIDByMonitorIndexconstint -->
2020-11-14 19:08:09 +01:00
< h3 class = "fn" id = "getAppIDByMonitorIndex" > < a name = "getAppIDByMonitorIndex" > < / a > < span class = "type" > std::optional< / span > < < span class = "type" > QString< / span > > MonitorListModel::< span class = "name" > getAppIDByMonitorIndex< / span > (const < span class = "type" > int< / span > < i > index< / i > ) const< / h3 >
2020-03-31 15:35:51 +02:00
< p > If successful this function returns an AppID. Otherwhise std::nullopt.< / p >
<!-- @@@getAppIDByMonitorIndex -->
<!-- $$$roleNames[overload1]$$$roleNames -->
< h3 class = "fn" id = "roleNames" > < a name = "roleNames" > < / a > < code > [override virtual] < / code > < span class = "type" > QHash< / span > < < span class = "type" > int< / span > , < span class = "type" > QByteArray< / span > > MonitorListModel::< span class = "name" > roleNames< / span > () const< / h3 >
< p > Returns the variable names for QML.< / p >
<!-- @@@roleNames -->
<!-- $$$rowCount[overload1]$$$rowCountconstQModelIndex& -->
< h3 class = "fn" id = "rowCount" > < a name = "rowCount" > < / a > < code > [override virtual] < / code > < span class = "type" > int< / span > MonitorListModel::< span class = "name" > rowCount< / span > (const < span class = "type" > QModelIndex< / span > & < i > parent< / i > = QModelIndex()) const< / h3 >
< p > Returns the amount of active monitors.< / p >
<!-- @@@rowCount -->
2021-05-13 13:05:05 +02:00
<!-- $$$setWallpaperMonitor[overload1]$$$setWallpaperMonitorconststd::shared_ptr<ScreenPlayWallpaper>&constQVector<int> -->
< h3 class = "fn" id = "setWallpaperMonitor" > < a name = "setWallpaperMonitor" > < / a > < span class = "type" > void< / span > MonitorListModel::< span class = "name" > setWallpaperMonitor< / span > (const < span class = "type" > std::shared_ptr< / span > < < span class = "type" > < a href = "screenplay-screenplaywallpaper.html" > ScreenPlayWallpaper< / a > < / span > > & < i > wallpaper< / i > , const < span class = "type" > QVector< / span > < < span class = "type" > int< / span > > < i > monitors< / i > )< / h3 >
< p > Sets a shared_ptr to the monitor list. This should be used to set and remove the shared_ptr.< / p >
<!-- @@@setWallpaperMonitor -->
2020-01-30 15:47:04 +01:00
< / div >
2020-11-22 12:24:43 +01:00
< div id = license class = "footer center" > < p > This documentation is licensed under a < a rel = "license" href = "http://creativecommons.org/licenses/by/4.0/" > Creative Commons Attribution 4.0 International License< / a > .< / p > < / div > < script src = "../js/bootstrap.bundle.min.js" > < / script > < script src = "../js/mermaid.min.js" > < / script > < script > var config = { startOnLoad : true , flowchart : { useMaxWidth : true , htmlLabels : true } } ; mermaid . initialize ( config ) ; < / script > < / body >
2019-12-05 15:24:12 +01:00
< / html >