QTreeWidgetItem Icon
Posted: Fri Sep 03, 2010 4:55 am
Hi
I invite your kind attention to Line no. 655 of QTreeWidgetItem.cpp file.
It deals with setting an icon for tree items. As of now, the third parameter for this function should be a string (may be icon filename from disk or resource). In the case of tree item, we can have item states (normal and selected) (for example a closed book icon for normal state and an open book icon for selected state).
For this I have created a Quick Icon with two Pixmaps using addPixmap method.
Since the third parameter here is not QIcon but a string, I could not set the icon for treewidgetitem. I understand this is used for simplicity.
Now, can we have another function/method to pass the third parameter as QIcon itself?
I invite your kind attention to Line no. 655 of QTreeWidgetItem.cpp file.
Code: Select all
655 HB_FUNC( QT_QTREEWIDGETITEM_SETICON )
656 {
657 QTreeWidgetItem * p = hbqt_par_QTreeWidgetItem( 1 );
658 if( p )
659 ( p )->setIcon( hb_parni( 2 ), QIcon( hbqt_par_QString( 3 ) ) );
660 else
661 {
662 HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QTREEWIDGETITEM_SETICON FP=( p )->setIcon( hb_parni( 2 ), QIcon( hbqt_par_QString( 3 ) ) ); p is NULL" ) );
663 }
664 }
For this I have created a Quick Icon with two Pixmaps using addPixmap method.
Since the third parameter here is not QIcon but a string, I could not set the icon for treewidgetitem. I understand this is used for simplicity.
Now, can we have another function/method to pass the third parameter as QIcon itself?