nicolasfella added a comment.

  In D13931#290535 <https://phabricator.kde.org/D13931#290535>, @drosca wrote:
  
  > And the whole ComboBox/SinkModel code needs to be changed. You should be 
able to get the PulseObject from the model just with QML code (see invokables 
in 
https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/itemmodels/qabstractitemmodel.h).
  >  Also I don't see purpose of that "changed" property.
  
  
  I can get the PulseObject, that is not the problem, the problem is that I 
can't access the model outside of a delegate. model[index] does not work 
because QAbstractItemModel does not implement the {} operator. It only works 
with QList-based models. Therefore I introduced the get function to the model. 
This has the limitation that I don't have an notify signal for it. Therefore I 
use the notify signal of the changed property to force a reevaluate of the 
properties that depend on "get". It's a hacky solution, but I didn't find a 
better one.

REPOSITORY
  R115 Plasma Audio Volume Applet

REVISION DETAIL
  https://phabricator.kde.org/D13931

To: nicolasfella, drosca
Cc: ngraham, #vdg, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart

Reply via email to