Results 1 to 2 of 2

Thread: Weird QDockWidget behavior (trigger/toggle/minimize) [solved]

  1. #1
    Join Date
    Dec 2007
    Location
    Austin, TX
    Posts
    43
    Thanks
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question Weird QDockWidget behavior (trigger/toggle/minimize) [solved]

    I have a QMainWidget with a dock on the right side. I add 3 QDockWidgets (actually a derived class from the Qt class). The close button on the Dock Widget, the context menu for the dock widgets, and the View menu item (using the QDockWidget::toggleViewAction() QAction) should all query the user before "closing" the dock (actually hiding it). This is done by connecting the QAction's toggled signal with our slot. Now, using toggled gives us the query as designed... but closing the app also queried the user (I was able to add an 'isClosing' type of check to prevent this)....and minimizing the app also closes/queries. If I switch the connect to triggered, the menus won't query, but the minimize also does not have the problem.

    Do I need to keep track of if the app is minimizing? (isVisible() and isMinimized() functions on the main widget doesn't work (I suspect that the app hasn't minimized at the time the toggle is done)) Has anyone else found this issue?

    (Using version 4.3.2 .... I can try to push the company to get a newer version, if this is known to be a bug in the version.)

    Thanks,
    Vycke
    Last edited by vycke; 4th May 2010 at 18:15. Reason: solved

  2. #2
    Join Date
    Dec 2007
    Location
    Austin, TX
    Posts
    43
    Thanks
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird QDockWidget behavior (trigger/toggle/minimize) [solved]

    Solved with a bool set on hideEvent()/showEvent() on the Main Window (since minimizing does a hide. but doesn't set the isVisible flag to false according to the docs). It's sort of a work-around, but it works.

    Vycke

Similar Threads

  1. QDockWidget on 4.6.X , weird behaviour
    By benacler in forum Qt Programming
    Replies: 0
    Last Post: 8th April 2010, 14:44
  2. Weird removeRow behavior
    By metalinspired in forum Qt Programming
    Replies: 0
    Last Post: 30th August 2009, 12:42
  3. Weird QMenu behavior on Mac
    By munna in forum Qt Programming
    Replies: 1
    Last Post: 14th January 2009, 15:18
  4. Replies: 5
    Last Post: 12th September 2008, 23:13
  5. Weird behavior when readding a window to a QMdiArea
    By seand in forum Qt Programming
    Replies: 0
    Last Post: 27th August 2008, 02:14

Tags for this Thread

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.