Additionally if you just want to loop through the tree widgets selected items, then something like:
i used your code but cannt get any text..
help me how can change this :
to QString ..
and how can i use your code with qt designer
Qt Designer is mainly to assist in building GUI interfaces, it's not a all inclusive builder for you applications. You will need to create you own header and source files to work with the ui files that the designer creates. Many of the examples I post do this.
The QTreeWidgetItem text( int ) returns a QString.
(e.g. QString itemStr = item->text( col ); )
To use qDebug, include the header in you source file:
#include
---------------------------
Bottom line is you can't do everything with just the Qt Designer.
thanks alot ...
im can not use your way...my Knowledge in qt is very low
However how can i use this way :
Not sure what answer your waiting for, but If designer has this function, then something like:
link: http://www.qtcentre.org/threads/13216-QTreeWidget-selection
--------------
dy'
Source code | |
1 | foreach( QTreeWidgetItem *item, treeWidget->selectedItems() ) { |
i used your code but cannt get any text..
help me how can change this :
Source code | |
1 | qDebug() << "Item Text: " <<>text( col ); |
to QString ..
and how can i use your code with qt designer
Source code | |
1 | void books::on_treeWidget_itemClicked(QTreeWidgetItem* item, int column) |
The QTreeWidgetItem text( int ) returns a QString.
(e.g. QString itemStr = item->text( col ); )
To use qDebug, include the header in you source file:
#include
---------------------------
Bottom line is you can't do everything with just the Qt Designer.
thanks alot ...
im can not use your way...my Knowledge in qt is very low
However how can i use this way :
ui->lineEdit->setText(ui->treeWidget->currentItem()->text());
Not sure what answer your waiting for, but If designer has this function, then something like:
Source code | |
1 | void books::on_treeWidget_itemClicked(QTreeWidgetItem* item, int column) |
--------------
dy'
Comments