Results 1 to 13 of 13

Thread: Mouse over event

Hybrid View

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

    Default Re: Mouse over event

    Nothing Works , Please tell me Is there any other way to do this.
    Always Believe in Urself
    Merry

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

    Default Re: Mouse over event

    Maybe you'd like to tell us some more details about this "nothing"?

  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 over event

    Yaa , Actuallly I implemented that what Marcel had told me

    Qt Code:
    1. class MyButton : public QPushButton
    2. {
    3. Q_OBJECT
    4. public:
    5. MyButton( QWidget* = NULL );
    6. ~MyButton();
    7.  
    8. protected:
    9. virtual void enterEvent( QEvent* );
    10. virtual void leaveEvent( QEvent* );
    11.  
    12. public signals:
    13. void enter( QString );
    14. void leave( QString );
    15.  
    16. }
    17.  
    18. void MyButton::enterEvent( QEvent* e )
    19. {
    20. emit enter( text() );
    21. }
    22.  
    23. void MyButton::leaveEvent( QEvent* e )
    24. {
    25. emit leave( text() );
    26. }
    To copy to clipboard, switch view to plain text mode 


    and also what u told
    , that Main windows have a status bar and you can make it that it
    displays the text you want when a widget is hovered.
    But it wont works ,because what i want is this ,I am having 6 Push buttons on my main window,and each works differently ,When mouse cursor is over any button it displays the detail of that button in the label that i used.
    Last edited by wysota; 16th May 2007 at 10:54. Reason: Incorrect tags
    Always Believe in Urself
    Merry

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Mouse over event

    Have you used MyButton instead of QPushButton?
    Also have you used the two signals properly?

    It is impossible not to
    work, therefore you have done something wrong.

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

    Default Re: Mouse over event

    I got this to work without any subclassing, just using a status tip.
    Attached Files Attached Files

  6. The following user says thank you to wysota for this useful post:

    merry (16th May 2007)

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

    Default Re: Mouse over event

    Thanx Wysota it works and also thanx to Marcel for helping me so much
    Always Believe in Urself
    Merry

Similar Threads

  1. rotation and mouse event identification
    By kiransu123 in forum Qt Programming
    Replies: 2
    Last Post: 14th March 2007, 04:41
  2. 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
  3. Mouse Over event on button
    By vishal.chauhan in forum Qt Programming
    Replies: 9
    Last Post: 10th January 2007, 05:03
  4. mouse click event
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 1st May 2006, 09:24
  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
  •  
Qt is a trademark of The Qt Company.