Results 1 to 7 of 7

Thread: Create new an event, help me?

  1. #1
    Join Date
    Jun 2007
    Posts
    15
    Thanks
    2

    Unhappy Create new an event, help me?

    Hi everyone, I want to create a new events receive mouse release events on the border of the QMainwindow but I don't know the code so that It( the event) can be called automatically. Untill now, the "mouse release event" can only receive the event inside the widget. After releasing that mouse event, I will repaint 60.000 components inside that window. Could you tell me the way to create or add a new event and It will be called automatically like "resizeEvent(...)" or "mouseReleaseEvent(...)"?
    Thanks!

  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: Create new an event, help me?

    The "border" of the window is handled by the window manager and not by your application, so there is nothing really you can do here without at least digging into platform dependent API.

  3. #3
    Join Date
    Jun 2007
    Posts
    15
    Thanks
    2

    Red face Re: Create new an event, help me?

    So, could you tell me other ways to solve my problem? Thanks!

  4. #4
    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: Create new an event, help me?

    But what is the problem?

  5. #5
    Join Date
    Jun 2007
    Posts
    15
    Thanks
    2

    Default Re: Create new an event, help me?

    I want to catch "mouseReleaseEvent" on the border of the main window to redraw the components inside the main window. During resizeEvent, I can't draw the window because it has 60.000 components. I can only draw one time after finishing resizing so that It can be faster. Thanks!

  6. #6
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Create new an event, help me?

    In resizeEvent() check QApplication::mouseButtons() and only do the update if the left mouse isn't pressed.

  7. #7
    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: Create new an event, help me?

    I'm afraid resizeEvent will post a paintEvent by itself, so this is not a solution. I suggest optimizing the painting routine and maybe use the Graphics View framework to speed things up.

Similar Threads

  1. QDockWidget-title
    By moowy in forum Qt Programming
    Replies: 18
    Last Post: 23rd April 2014, 20:13
  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. event problem
    By windkracht8 in forum Qt Programming
    Replies: 5
    Last Post: 17th August 2006, 11:52
  4. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55
  5. What's the relationship between signal/slot and event?
    By twosnowman in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 17:13

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.