Scenario A:
You close above application and change the value (as an example the names of the virtual desktops)
somehow externally via windowManager/Unity/KDE/etc
from [ "old_desktopname1", "old_desktopname2" ] to [ "new_desktopname1", "new_desktopname2" ]
and restart the application.
//This works
Scenario B:
You close above application and change the value (as an example the names of the virtual desktops)
somehow externally via windowManager/Unity/KDE/etc
from [ "old_desktopname1", "old_desktopname2" ] to [ "new_desktopname1", "new_desktopname2", "new_desktopname3" ]
and restart the application.
//The length changed as we added an additional virtual desktop. Now the application just crashes:
//ASSERT failure in QList<T>::operator[]: "index out of range", file ../../Qt5.3.0/5.3/gcc_64/include/QtCore/qlist.h, line 487
//The program has unexpectedly finished.
Workaround:
//change example code to:
property bool startSync
Timer {running:true;interval:1000; onTriggered:startSync=true}
Binding {target: virtualDesktopSettings; property:"names"; value:windowSystem.desktopNames}
Binding {target: windowSystem; property: "desktopNames"; value:virtualDesktopSettings.names;when:(startSync)}
//windowSystem is another cpp plugin exposing also virtual desktop names
PS:
Just wondering right now on such a bidirectional binding, if changed while application was not running which one should have precedence (when I set when: it's obvious)? Should GSettings enforce it's settings, or the other side enforce onto GSettings?
But this should be more of a Qt request for a true QML BiDirectionalBinding {}
GSettings-qt crashes when qlist (any list value in gsettings), below
Example code: ettings; property:"names"; value:windowSys tem.desktopName s} sktopSettings. names}
Binding {target: virtualDesktopS
Binding {target: windowSystem; property: "desktopNames"; value:virtualDe
//windowSystem is another cpp plugin exposing also virtual desktop names
GSettings {id:virtualDesk topSettings;
schema. id:"org. qmldesktop. virtualdesktops ";
schema. path:"/ org/qmldesktop/ virtualdesktops /";
}
Scenario A: Unity/KDE/ etc
You close above application and change the value (as an example the names of the virtual desktops)
somehow externally via windowManager/
from [ "old_desktopname1", "old_desktopname2" ] to [ "new_desktopname1", "new_desktopname2" ]
and restart the application.
//This works
Scenario B: Unity/KDE/ etc ::operator[ ]: "index out of range", file ../../Qt5. 3.0/5.3/ gcc_64/ include/ QtCore/ qlist.h, line 487
You close above application and change the value (as an example the names of the virtual desktops)
somehow externally via windowManager/
from [ "old_desktopname1", "old_desktopname2" ] to [ "new_desktopname1", "new_desktopname2", "new_desktopname3" ]
and restart the application.
//The length changed as we added an additional virtual desktop. Now the application just crashes:
//ASSERT failure in QList<T>
//The program has unexpectedly finished.
Workaround: true;interval: 1000; onTriggered: startSync= true} ettings; property:"names"; value:windowSys tem.desktopName s} sktopSettings. names;when: (startSync) }
//change example code to:
property bool startSync
Timer {running:
Binding {target: virtualDesktopS
Binding {target: windowSystem; property: "desktopNames"; value:virtualDe
//windowSystem is another cpp plugin exposing also virtual desktop names
GSettings {id:virtualDesk topSettings;
schema. id:"org. qmldesktop. virtualdesktops ";
schema. path:"/ org/qmldesktop/ virtualdesktops /";
}
PS: nding {}
Just wondering right now on such a bidirectional binding, if changed while application was not running which one should have precedence (when I set when: it's obvious)? Should GSettings enforce it's settings, or the other side enforce onto GSettings?
But this should be more of a Qt request for a true QML BiDirectionalBi