PDA

View Full Version : Q3ListView



kemp
5th October 2006, 08:11
Hi!

does anyone know how can i set selection, so that i could select item by clicking on text and
not just by clicking on icon that the item has?

Thank you.

jpn
7th October 2006, 20:20
What do you mean? Selecting a Q3ListViewItem over both, the icon and the text, works just fine, at least for me. :)

kemp
9th October 2006, 07:02
yes i mean Q3ListViewItem, i can select the item only by clicking on the icon and the first
2 characters. If i click on the third character of more to the right the item will not select.

jpn
9th October 2006, 07:07
Do you have a recent version of Qt?

kemp
9th October 2006, 08:04
I use Qt 4.1.4 and VS_Integration 1.1.3.

jpn
9th October 2006, 08:26
I somewhy cannot reproduce this. Could you provide a minimal compilable example which reproduces the problem? Maybe it's some specific combination of selection mode, amount of columns and so on.

kemp
9th October 2006, 08:58
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:




protected slots:

void itemPressed( int nBtn, Q3ListViewItem *pItem, const QPoint &Pos, int nCol );

////////////////////////////////////////////////////////

void CGroupView::itemPressed( int nBtn, Q3ListViewItem *pItem, const QPoint &Pos, int nCol )
{
if ( !pItem ) // here it says that i don't click on the item and doesn't select it
return; //it has something to do with const QPoint &Pos

if ( nBtn != Qt::LeftButton )
return;

Q_UNUSED( Pos );
Q_UNUSED( nCol );

// Remember last pressed item.
m_sLastClickedItem = pItem->text( 0 );
}

/////////////////////////////////////////////////////////////////////////

connect( this, SIGNAL( mouseButtonPressed( int, Q3ListViewItem *, const QPoint &, int ) ),
this, SLOT( itemPressed( int, Q3ListViewItem *, const QPoint &, int ) ) );