Results 1 to 4 of 4

Thread: reacting on moving or resizeing

  1. #1
    Join Date
    Feb 2011
    Posts
    26
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default reacting on moving or resizeing

    Hi,
    I've placed a QDockWidget to my MainWindow.
    Now I want to connect a slot to this DockWidget.
    I want to call a sub when the user resizes, moves, docks or undocks the Widget.

    Looking forward for your help.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: reacting on moving or resizeing

    The QDockWidget emits QDockWidget::topLevelChanged() when docked or undocked.
    The dock widget's QWidget::resizeEvent() should be called when the widget is resized.

  3. #3
    Join Date
    Feb 2011
    Posts
    26
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: reacting on moving or resizeing

    Okay, but how can I use the resizeEvent() as a SIGNAL of the QDockWidget?
    When I type the connect command, resizeEvent is not existing in the list of available signals.

    Qt Code:
    1. connect(ui->dockWidget_Contractor,SIGNAL(topLevelChanged(bool)), this,SLOT(testsub()));
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Feb 2011
    Posts
    26
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: reacting on moving or resizeing

    I think I solved the problem with the missing resizeEvent().
    I found another thread with the answer.
    Here is the link for everyone who has the same problem.

    http://lists.trolltech.com/qt-intere...ad00274-0.html

Similar Threads

  1. Replies: 0
    Last Post: 24th May 2010, 12:19
  2. Problem in resizeing dialog
    By moh.gup@gmail.com in forum Qt Programming
    Replies: 0
    Last Post: 27th April 2010, 14:09
  3. Replies: 9
    Last Post: 26th October 2009, 00:13
  4. why pushbutton moving??
    By Shuchi Agrawal in forum Qt Tools
    Replies: 7
    Last Post: 19th January 2007, 17:17
  5. Replies: 1
    Last Post: 13th July 2006, 21:10

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.