Results 1 to 3 of 3

Thread: what is currentItem?

  1. #1
    Join Date
    Jan 2006
    Posts
    6
    Thanks
    1

    Red face what is currentItem?

    hi
    In treeWidget ,what is the currenItem ? is it a clicked treewidgetitem? [

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: what is currentItem?

    I think its item that have input focus(so last selected item)
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: what is currentItem?

    Quote Originally Posted by Alina
    hi
    In treeWidget ,what is the currenItem ? is it a clicked treewidgetitem? [
    The current item is the one that has keyboard focus. When your Tree widget, list widget, etc has a 'single' selection model, the current item is always the selected item. Here's the catch however - the current item is only valid for as long as the widget has focus. If you tab, click or otherwise move focus to another widget, the current item is now invalid and should not be used. The selection however, remains valid.

    I tend to avoid using the current item in 90% of cases and stick with the 'selected' item(s).
    Save yourself some pain. Learn C++ before learning Qt.

Similar Threads

  1. QComboBox currentItem
    By Project25 in forum Qt Programming
    Replies: 2
    Last Post: 29th April 2008, 08:27
  2. QItemDelegates and currentItem
    By mchara in forum Qt Programming
    Replies: 3
    Last Post: 23rd January 2008, 06:52

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.