Plasma5Support
datacontainer.cpp
94void DataContainer::connectVisualization(QObject *visualization, uint pollingInterval, Plasma5Support::Types::IntervalAlignment alignment)
118 if (visualization->metaObject()->indexOfSlot("dataUpdated(QString,Plasma5Support::DataEngine::Data)") >= 0) {
125 if (visualization->metaObject()->indexOfSlot("modelChanged(QString,QAbstractItemModel*)") >= 0) {
126 disconnect(this, SIGNAL(modelChanged(QString, QAbstractItemModel *)), visualization, SLOT(modelChanged(QString, QAbstractItemModel *)));
137 if (visualization->metaObject()->indexOfSlot("dataUpdated(QString,Plasma5Support::DataEngine::Data)") >= 0) {
143 if (visualization->metaObject()->indexOfSlot("modelChanged(QString,QAbstractItemModel*)") >= 0) {
144 disconnect(this, SIGNAL(modelChanged(QString, QAbstractItemModel *)), visualization, SLOT(modelChanged(QString, QAbstractItemModel *)));
148 connect(visualization, &QObject::destroyed, this, &DataContainer::disconnectVisualization); //, Qt::QueuedConnection);
154 if (visualization->metaObject()->indexOfSlot("dataUpdated(QString,Plasma5Support::DataEngine::Data)") >= 0) {
160 if (visualization->metaObject()->indexOfSlot("modelChanged(QString,QAbstractItemModel*)") >= 0) {
161 connect(this, SIGNAL(modelChanged(QString, QAbstractItemModel *)), visualization, SLOT(modelChanged(QString, QAbstractItemModel *)));
169 SignalRelay *relay = d->signalRelay(this, visualization, pollingInterval, alignment, immediateUpdate);
170 if (visualization->metaObject()->indexOfSlot("dataUpdated(QString,Plasma5Support::DataEngine::Data)") >= 0) {
177 if (visualization->metaObject()->indexOfSlot("modelChanged(QString,QAbstractItemModel*)") >= 0) {
178 connect(this, SIGNAL(modelChanged(QString, QAbstractItemModel *)), visualization, SLOT(modelChanged(QString, QAbstractItemModel *)));
299 disconnect(visualization, &QObject::destroyed, this, &DataContainer::disconnectVisualization); //, Qt::QueuedConnection);
303 if (visualization->metaObject()->indexOfSlot("dataUpdated(QString,Plasma5Support::DataEngine::Data)") >= 0) {
309 if (visualization->metaObject()->indexOfSlot("modelChanged(QString,QAbstractItemModel*)") >= 0) {
310 disconnect(this, SIGNAL(modelChanged(QString, QAbstractItemModel *)), visualization, SLOT(modelChanged(QString, QAbstractItemModel *)));
319 if (visualization->metaObject()->indexOfSlot("dataUpdated(QString,Plasma5Support::DataEngine::Data)") >= 0) {
326 if (visualization->metaObject()->indexOfSlot("modelChanged(QString,QAbstractItemModel*)") >= 0) {
327 disconnect(this, SIGNAL(modelChanged(QString, QAbstractItemModel *)), visualization, SLOT(modelChanged(QString, QAbstractItemModel *)));
379 return !d->relays.isEmpty() || receivers(SIGNAL(dataUpdated(QString, Plasma5Support::DataEngine::Data))) > 0;
int error() const
void disconnectVisualization(QObject *visualization)
Disconnects an object from this DataContainer.
Definition datacontainer.cpp:296
void setModel(QAbstractItemModel *model)
Associates a model with this DataContainer.
Definition datacontainer.cpp:57
void timerEvent(QTimerEvent *event) override
Definition datacontainer.cpp:389
void setData(const QString &key, const QVariant &value)
Set a value for a key.
Definition datacontainer.cpp:35
DataContainer(QObject *parent=nullptr)
Constructs a default DataContainer that has no name or data associated with it.
Definition datacontainer.cpp:19
void connectVisualization(QObject *visualization, uint pollingInterval, Plasma5Support::Types::IntervalAlignment alignment)
Connects an object to this DataContainer.
Definition datacontainer.cpp:94
uint timeSinceLastUpdate() const
Returns how long ago, in msecs, that the data in this container was last updated.
Definition datacontainer.cpp:367
bool isStorageEnabled() const
Definition datacontainer.cpp:191
bool needsToBeStored() const
Definition datacontainer.cpp:196
bool visualizationIsConnected(QObject *visualization) const
Definition datacontainer.cpp:89
const DataEngine::Data data() const
Returns the data for this DataContainer.
Definition datacontainer.cpp:30
void setStorageEnabled(bool store)
sets this data container to be automatically stored.
Definition datacontainer.cpp:183
void dataUpdated(const QString &source, const Plasma5Support::DataEngine::Data &data)
Emitted when the data has been updated, allowing visualizations to reflect the new data.
void checkForUpdate()
Checks whether any data has changed and, if so, emits dataUpdated().
Definition datacontainer.cpp:339
void setNeedsUpdate(bool update=true)
Indicates that the data should be treated as dirty the next time hasUpdates() is called.
Definition datacontainer.cpp:372
DataEngine * getDataEngine()
Definition datacontainer.cpp:206
void removeAllData()
Removes all data currently associated with this source.
Definition datacontainer.cpp:77
void becameUnused(const QString &source)
Emitted when the last visualization is disconnected.
void modelChanged(const QString &source, QAbstractItemModel *model)
A new model has been associated to this source, visualizations can safely use it as long they are con...
void setNeedsToBeStored(bool store)
sets that the data container needs to be stored or not.
Definition datacontainer.cpp:201
void forceImmediateUpdate()
Forces immediate update signals to all visualizations.
Definition datacontainer.cpp:355
int indexOfSlot(const char *slot) const const
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
bool disconnect(const QMetaObject::Connection &connection)
virtual bool event(QEvent *e)
virtual const QMetaObject * metaObject() const const
objectName
QObject * parent() const const
int receivers(const char *signal) const const
void setParent(QObject *parent)
QRandomGenerator * global()
singleShot
bool isValid() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.