[solved] qobjectlist-based model: QString for QColor
-
see here: http://doc.qt.nokia.com/4.8/qdeclarativemodels.html#qobjectlist-based-model
here the developer uses color: model.modelData.color, where color returns a qstring.
why in my app i can not do the same thing?
@
ListView { id: list_parolaSalvate; x: 9; y: 130; width: 300; height: 489; clip: true; smooth: true; spacing: 3; model: parolemodello
delegate: Rectangle {
id: delegate_grafica; width: 300; height: 37; radius: 9; color: model.modelData.tipo
Column
{
spacing: 4;
Text { id: worttext; x: 18; y: 0; color: "black"; text: wort; font.bold: true; anchors.verticalCenterOffset: -10;
anchors.horizontalCenterOffset: -127; font.pixelSize: 15; anchors.centerIn: parent }
Text { id: deutschbeispiel; x: 18; y: 20; height: 28; color: "black"; text: beispiel; font.pixelSize: 12 }
}
MouseArea { anchors.fill: delegate_grafica; onClicked: gestore.visualizzaParola(index); }
} }
@@
QString gettipo() const { return this->tipo; }
void settipo(QString newtipo) { this->tipo = newtipo; }private:
QString tipo;signals:
void tipo_changed();
@