I found out that if i click in the item are and keep clicking not on the same spot, the item
gets selected.

My selection code:

Qt Code:
  1. protected slots:
  2.  
  3. void itemPressed( int nBtn, Q3ListViewItem *pItem, const QPoint &Pos, int nCol );
  4.  
  5. ////////////////////////////////////////////////////////
  6.  
  7. void CGroupView::itemPressed( int nBtn, Q3ListViewItem *pItem, const QPoint &Pos, int nCol )
  8. {
  9. if ( !pItem ) // here it says that i don't click on the item and doesn't select it
  10. return; //it has something to do with const QPoint &Pos
  11.  
  12. if ( nBtn != Qt::LeftButton )
  13. return;
  14.  
  15. Q_UNUSED( Pos );
  16. Q_UNUSED( nCol );
  17.  
  18. // Remember last pressed item.
  19. m_sLastClickedItem = pItem->text( 0 );
  20. }
  21.  
  22. /////////////////////////////////////////////////////////////////////////
  23.  
  24. connect( this, SIGNAL( mouseButtonPressed( int, Q3ListViewItem *, const QPoint &, int ) ),
  25. this, SLOT( itemPressed( int, Q3ListViewItem *, const QPoint &, int ) ) );
To copy to clipboard, switch view to plain text mode