Results 1 to 7 of 7

Thread: resize event

  1. #1
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Post resize event

    How use resize event for QDialog ? I try like this, but not work.

    Qt Code:
    1. ...............
    2. ...............
    3. connect(this, SIGNAL(resizeEvent ( QResizeEvent * event )), this, SLOT(coba( QResizeEvent * event )));
    4. ...............
    5. ...............
    6.  
    7. void myDialog::coba( QResizeEvent * event )
    8. {
    9. qDebug() << size();
    10. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: resize event

    resizeEvent is not a signal... its a virtual function... use it directly..(first declare it in your class)

    void myDialog::resizeEvent(QResizeEvent*)

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: resize event

    Qt Code:
    1. class myDialog
    2. {
    3. protected:
    4. void resizeEvent(QResizeEvent *event);
    5. };
    6.  
    7. void myDialog::resizeEvent(QResizeEvent *event)
    8. {
    9. qDebug() << event->size() << event->oldSize();
    10. }
    To copy to clipboard, switch view to plain text mode 

    EDIT: too late...

  4. #4
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: resize event

    i) resizeEvent is a regular virtual protected function, just overload it in your class and handle the event
    ii) if it was a signal (it is not), your syntax would be wrong:
    connect(this, SIGNAL(resizeEvent ( QResizeEvent * event )), this, SLOT(coba( QResizeEvent * event )));
    you must not have argument names in there, it would be
    connect(this, SIGNAL(resizeEvent(QResizeEvent*)), this, SLOT(coba(QResizeEvent*)));(Of course, this will not work, as resizeEvent is NOT a signal.)

    HTH

  5. #5
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: resize event

    Quote Originally Posted by Lykurg View Post
    EDIT: too late...
    better luck next time brother

  6. #6
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: resize event

    boy!! this guy is really lucky..!! he got three replies.!!

  7. #7
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Thumbs up Re: resize event

    Wow, this is amazing...
    So many reply...

    Well, work now. Thank's for your help

Similar Threads

  1. How to get screen resize event?
    By kamlesh.sangani in forum Qt Programming
    Replies: 8
    Last Post: 10th March 2010, 08:46
  2. Replies: 4
    Last Post: 19th February 2009, 11:10
  3. Resize event on stretch?
    By kodiak in forum Qt Programming
    Replies: 2
    Last Post: 3rd November 2008, 22:51
  4. Resize event
    By boss_bhat in forum Qt Programming
    Replies: 5
    Last Post: 19th July 2006, 15:43
  5. postponing resize event
    By Honestmath in forum Qt Programming
    Replies: 11
    Last Post: 26th February 2006, 00:32

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.