Results 1 to 9 of 9

Thread: Help with mousePressEvent implementation

Hybrid View

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

    Default Re: Help with mousePressEvent implementation

    You must reimplement the QLabel's mouse press event, not the one for the window.
    Most likely that is why you're getting thius behavior.

    To access scribblePad from the labels's mouse event you have to make your main window a singleton. Then you can do something like MainWindow::instance()->getScribblePad()->navigateNext().

    Regards

  2. The following user says thank you to marcel for this useful post:

    QuTe (29th October 2007)

  3. #2
    Join Date
    Oct 2007
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Help with mousePressEvent implementation

    Hi,

    as per your suggestion I've reimplemented the mousePressEvent() for QLabel only, and not for the main window; but unfortunately the problem still persists and it requires double clicks to actually trigger the respective actions!

    is there something else I need to do to solve this problem?

    Regards

  4. #3
    Join Date
    Oct 2007
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Help with mousePressEvent implementation

    is it too enigmatic to get a solution for?

    I still have not been able to get it with a single click somehow
    can someone help?

    Thanks

  5. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Help with mousePressEvent implementation

    Is this still unsolved? How does the mousePressEvent() implementation look like now?
    J-P Nurmi

  6. #5
    Join Date
    Oct 2007
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Help with mousePressEvent implementation

    No, it has solved my problem.
    sry I couldn't msg over here back then b'coz it worked out after couple of days of my last post.
    the mousePressEvent() works fine now


    Thanks marcel

  7. #6
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    18
    Thanked 5 Times in 5 Posts

    Default Re: Help with mousePressEvent implementation

    Please post your code. I'm having a problem with activating a particular QWidgetAction given a mouse event from a QPushButton in that QWidgetAction. You code could be very useful to me.

    Thanks

Similar Threads

  1. UI implementation style
    By goes2bob in forum Qt Tools
    Replies: 2
    Last Post: 15th August 2007, 23:37
  2. RubberBand zoom implementation for images
    By cdemirkir in forum Qt Programming
    Replies: 4
    Last Post: 16th July 2007, 22:55
  3. Replies: 6
    Last Post: 30th April 2007, 23:59
  4. Implementation of right indentation in a text editor
    By sukanyarn in forum Qt Programming
    Replies: 11
    Last Post: 26th September 2006, 13:06
  5. source and implementation
    By shrikarcse in forum Newbie
    Replies: 6
    Last Post: 29th March 2006, 05:02

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.