Results 1 to 2 of 2

Thread: QMainWindow not receiving QResizeEvent

  1. #1
    Join Date
    Feb 2006
    Location
    US
    Posts
    173
    Thanks
    16
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default QMainWindow not receiving QResizeEvent

    Hello,

    I have reimplemented the resizeEvent in a subclass (of the QMainWindow) to receive widget resize events which are passed in the event parameter. The method is not getting called. Any ideas why?

    The closeEvent method is also not being called.

    Qt Code:
    1. class cMainWindow : public QMainWindow, public Ui::cMainWindow
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. void setupUi(QMainWindow * mainWindow);
    7.  
    8. ...
    9.  
    10. protected:
    11. void resizeEvent(QResizeEvent * event)
    12. { qDebug("Got called!!!"); }
    13. void closeEvent(QCloseEvent * event)
    14. { qDebug("Got called!!!"); }
    15.  
    16. };
    To copy to clipboard, switch view to plain text mode 

  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: QMainWindow not receiving QResizeEvent

    Can you provide a minimal compilable example which reproduces the problem?

Similar Threads

  1. Disabling the Maximize button in QMainWindow ?
    By sunil.thaha in forum Qt Programming
    Replies: 17
    Last Post: 26th June 2017, 13:31
  2. forcing QResizeEvent to come immediately
    By tpomorsk in forum Qt Programming
    Replies: 5
    Last Post: 14th September 2006, 16:39
  3. Dynamically Loading a QMainWindow?
    By natron in forum Newbie
    Replies: 10
    Last Post: 21st July 2006, 01:15
  4. Insert separate QToolBar into QMainWindow
    By YuriyRusinov in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 10:37
  5. Replies: 18
    Last Post: 22nd February 2006, 20:51

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.