Results 1 to 3 of 3

Thread: Handling mouse over event for QListWidget

  1. #1
    Join Date
    Jun 2008
    Posts
    22

    Default Handling mouse over event for QListWidget

    Hi,
    I am using QT 4.4 on windows XP. I want to handle the mouse over evnt on a QListWidget. I have QStringList added to my widget. This QStringList comprises of strings (each has 3-4 lines). I want to change the background of the text (as if to highlight or focus the same), one line at a time, as and when my mouse moves over the same.

    Please help me with any snippet that may solve the purpose.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Handling mouse over event for QListWidget

    you need to reimplement mouseMoveEvent().
    There you can access the list item (QListWidgetItem) and manipulate its background.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Handling mouse over event for QListWidget

    Or you can use stylesheet instead

Similar Threads

  1. how to send a emulated mouse event to QListWidget
    By yxmaomao in forum Qt Programming
    Replies: 4
    Last Post: 22nd July 2008, 02:49
  2. pass mouse event information to another widget
    By Rooster in forum Qt Programming
    Replies: 5
    Last Post: 12th July 2008, 04:23
  3. Enter event mouse position
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 7th May 2008, 18:53
  4. Handling Mouse Events of a parent widget
    By dvmorris in forum Qt Programming
    Replies: 2
    Last Post: 28th March 2007, 18:44
  5. The event fired by the mouse click on the frame
    By Placido Currò in forum Qt Programming
    Replies: 8
    Last Post: 3rd March 2007, 09:05

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.