PDA

View Full Version : Set QDeclarativeView in QListTable by setIndexWidget()



migel
3rd September 2011, 18:04
Below code does not work. It prints the rectange out side of na list item


QDeclarativeView *qmlListViewName = new QDeclarativeView(this);
qmlListViewName->rootContext()->setContextProperty("name", name);
qmlListViewName->setSource(QUrl("qrc:/qml/ListViewName.qml"));


setIndexWidget(nameItem->index(),qmlListViewName);



import QtQuick 1.0

Rectangle {
width: 100
height: 62
color: "yellow"

Text {
id: fileName
anchors.centerIn: parent
text: name
}
}



When I remove [this] from new QDeclarativeView(this); -> new QDeclarativeView;
It does not do anything.

Any ideas why ?