Results 1 to 6 of 6

Thread: Mouse Move Event

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Mouse Move Event

    Hi all

    I m working on Qt4.2,

    Problem:

    having a main window with some QPushButtons , The problem is this , When mouse move over the button ,then all the details of that button should be shown in the "Text Label" . and when mouse leaves that button then all the details of that button that are shown in the TextLabel should be hide.

    for this I had also set status tip of the buttons , but it displays all the details of the button on the window itself not on the "Text Label" and I want that all the details should be displayed on the TextLabel

    Thanx
    Always Believe in Urself
    Merry

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Mouse Move Event

    But what is the problem? Do you have any code that doesn't work or...?

  3. #3
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Mouse Move Event

    No I dont have any code for this , Could you tell me how can I do this and Which events should I use .
    Always Believe in Urself
    Merry

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

    Default Re: Mouse Move Event

    ==========================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.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Mouse Move Event

    And enable mouse tracking. You can also try enterEvent and leaveEvent. Or you can use the statusTip property and attach to the status bar if you use a main window.

  6. #6
    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: Mouse Move Event

    Displaying the button information as a tooltip or some widget would be better.
    What I understood from ur post is u wan tto change the text of the button to button informatin when the mouse is over it. You can use setText() function for the same. But displaying long information on a small button wont be advisable. Use tooltip or some widget to display the information.
    Rest follow the above answers by wysota and others.

Similar Threads

  1. Mouse over event
    By merry in forum Qt Programming
    Replies: 12
    Last Post: 16th May 2007, 11:13
  2. Move Rectangle on mouse Move
    By vermarajeev in forum Qt Programming
    Replies: 24
    Last Post: 14th May 2007, 05:34
  3. 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
  4. Mouse Over event on button
    By vishal.chauhan in forum Qt Programming
    Replies: 9
    Last Post: 10th January 2007, 05:03
  5. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25

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.