×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    3

    QListWidget requires two initial clicks to activate

    Hey everyone,

    for making a user interface menu in an application in Qt, I am using a QListWidget to display several options in a menu. The user is then able to go to different locations in the program, by clicking on different QListWidgetItems in the QListWidget. I use the Signal 'itemActivated(QListWidgetItem*)' to detect when a press was done (itemClicked doesn't seem to work).

    However on my E72 I have the problem that when the application starts up, I need to press the QListWidget twice before it emits the first signal. After that only one click is required. While this is not really a big bug, it is kinda annoying if you have to go through a lot of QListWidgets after each other.

    Is there a way to solve this problem?
    I more information is needed, please ask

    Thanks
    Thijs

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: QListWidget requires two initial clicks to activate

    Welcome to the Qt DIBO.

    At the first time item is selected from the list and after that when you press it.
    http://wiki.forum.nokia.com/index.ph...ListWidgetItem

    Action has been taken if you have set the signal and slot mechanism.
    http://doc.qt.nokia.com/4.5/qlistwidget.html

    Best regards,

  3. #3
    Registered User
    Join Date
    Jun 2010
    Posts
    3

    Re: QListWidget requires two initial clicks to activate

    So when I press the first time, the item is selected, and the second time I press the item is activated, and the itemActivated slot is emitted.

    But after that, I only need to press one time on other items to get the sigal emited.

    Is there a way to make this first press unneccessary? Tried a lot but nothing work.

    I already found the two links you gave before, but that couldn't solve my problem.

    Thijs

  4. #4
    Registered User
    Join Date
    Mar 2010
    Posts
    61

    Re: QListWidget requires two initial clicks to activate

    On E72 you don't have "clicks", clicks are either mouse button presses or touch screen events, that's why itemClicked doesn't work.

    The first D-pad press is needed to activate the list. You'll notice that you can't move to other widgets in the window when the list is activated. The second press will trigger itemActivated. Using setEditFocus will activate the list without the need for the first D-pad press; this works best when the list is the only widget in the window.

  5. #5
    Registered User
    Join Date
    Jun 2010
    Posts
    3

    Re: QListWidget requires two initial clicks to activate

    Hey. Thanks for the explination!

    Using listWidget->setEditFocues(true) it works fine now!

    Thanks
    Thijs

Similar Threads

  1. Replies: 8
    Last Post: 2010-06-10, 18:03
  2. QListWidget with checkbox
    By damodharan in forum Qt
    Replies: 13
    Last Post: 2010-05-31, 14:54
  3. Key Clicks
    By smb101 in forum Mobile Java General
    Replies: 1
    Last Post: 2006-04-23, 23:14
  4. Key clicks in Series 60 emaulator
    By rbalch in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2004-06-14, 20:42
  5. Avoid clicks during connection phase
    By Cyrilou in forum Mobile Java General
    Replies: 2
    Last Post: 2004-03-08, 19:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •