[gelöst] QTreeWidget (findItems)
Verfasst: 15. Juli 2008 16:37
Servus zusammen,
ist es möglich in einem QTreeWidget nach einträgen zu suchen?
Ich habe es damit versucht, aber es funktioniert nicht? Fehler von Eclipse:
(The method findItems(String, Qt.MatchFlags) in the type QTreeWidget is not applicable for the arguments (String, Qt.MatchFlag)
(The method findItems(String, Qt.MatchFlags, int) in the type QTreeWidget is not applicable for the arguments (String, Qt.MatchFlag, int)
Ist dies ein Bug in QtJambi? Wenn ja, muss ich mich halt damit begnügen.
ist es möglich in einem QTreeWidget nach einträgen zu suchen?
Ich habe es damit versucht, aber es funktioniert nicht? Fehler von Eclipse:
(The method findItems(String, Qt.MatchFlags) in the type QTreeWidget is not applicable for the arguments (String, Qt.MatchFlag)
(The method findItems(String, Qt.MatchFlags, int) in the type QTreeWidget is not applicable for the arguments (String, Qt.MatchFlag, int)
Code: Alles auswählen
List< QTreeWidgetItem > itemList = ui.treeWidget.findItems( "Hallo", Qt.MatchFlag.MatchExactly );
List< QTreeWidgetItem > itemList1 = ui.treeWidget.findItems( "Welt", Qt.MatchFlag.MatchExactly, 0 );
Code: Alles auswählen
boolean foundItem = false;
for( int a = 0; a < ui.treeWidget.topLevelItemCount(); a++ )
{
QApplication.processEvents();
QTreeWidgetItem findItem = ui.treeWidget.topLevelItem( a );
if( findItem.text( 0 ).equalsIgnoreCase( ui.lineEdit.text() ) )
{
foundItem = true;
}
}