Results 1 to 7 of 7

Thread: Q3ListView

  1. #1
    Join Date
    Aug 2006
    Posts
    77
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Q3ListView

    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.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Q3ListView

    What do you mean? Selecting a Q3ListViewItem over both, the icon and the text, works just fine, at least for me.
    J-P Nurmi

  3. #3
    Join Date
    Aug 2006
    Posts
    77
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Q3ListView

    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.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Q3ListView

    Do you have a recent version of Qt?
    J-P Nurmi

  5. #5
    Join Date
    Aug 2006
    Posts
    77
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Q3ListView

    I use Qt 4.1.4 and VS_Integration 1.1.3.

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Q3ListView

    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.
    J-P Nurmi

  7. #7
    Join Date
    Aug 2006
    Posts
    77
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Q3ListView

    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 

Similar Threads

  1. Q3ListView highlight part of a column
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 5th May 2006, 09:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.