jxgxldl
14 years agoOccasional Contributor
How to get the model of Qt widget
Hi, In the tested Qt-bassed application, I got one widget, it's a QTreeView object. and there are some items ( like folders and files ) in it. Those items we called Model. It works like this in Qt:
QFileSystemModel *model = new QFileSystemModel;
model->init(); // Initilize the model
QTreeView *tree = new QTreeView();
tree->setModel(model); // set the model.
So, In TestComplete, How to get the model ( itmes ) of QWidget ( eg: QTreeView ) ?
I used JScript:
var treeView = widget.QtObject("QTreeView","",1);
var treeItems = ???; // how to get it ?