Results 1 to 7 of 7

Thread: How to put a DockWidget or Widget over others??

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

    Question How to put a DockWidget or Widget over others??

    Hi all,

    In Qt 4.3, I want to create a small application similar to Slick Edit and have some troubles:

    1. Auto Hide feature: how to add a Widget is same as "project" tab or "classes" tab in the left of the Visual Slick application, It means that, when users move over the "Project", "Classes", "FTP" tabs, these widgets will expand slowly and increase its size. The trouble is that when these tabs are increasing its size, these must above the central widget, don't push the central widget to the right. I imitate the way of QRubberband class by using: setAttribute(Qt::WA_NoSystemBackground) method so that the left widget can put over others but it does not affect. How can I do?

    2. What should I do to replace the normal symbol on the top-right corner by the auto-hide symbol?

    Thanks!
    Last edited by dungsivn; 23rd October 2007 at 13:19.

  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: How to put a DockWidget or Widget over others??

    I think dock widgets are not the way to go here. If you want to obscure the central widget, you'll need to use a widget that is not in the main window layout and use QWidget::setGeometry() or similar to control the position and size of the widget yourself using a timer to create animating effect.

  3. The following user says thank you to wysota for this useful post:

    dungsivn (24th October 2007)

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

    Default Re: How to put a DockWidget or Widget over others??

    Thanks, and what does function allow that widget over others?

  5. #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: How to put a DockWidget or Widget over others??

    QWidget::raise() should do the trick.

  6. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to put a DockWidget or Widget over others??

    This might be of interest to you.
    http://wiki.qtcentre.org/index.php?t...scroll_effects
    These are the classes Qt uses internally for some simple animations. Even though easy to use they have a few drawbacks. They are appropriate for fast animations and optimized accordingly. Moving widgets using a QTimer/QTimeLine as Wysota suggested, ideally with a higher timer resolution (~20msec) will probably better suit your needs.

  7. The following user says thank you to momesana for this useful post:

    dungsivn (25th October 2007)

  8. #6
    Join Date
    Jun 2007
    Posts
    15
    Thanks
    2

    Default Re: How to put a DockWidget or Widget over others??

    thanks all, and the last question: how to remove a widget out of a dock widget? I search in Qt assistant but can't found the way to do that. I only deleted the widget which was set into the dock widget, It right?

  9. #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: How to put a DockWidget or Widget over others??

    You can reparent (QObject::setParent()) the widget out of the dock widget and delete the dock widget.

Similar Threads

  1. Drawing a widget in QItemDelegate's paint method
    By darkadept in forum Qt Programming
    Replies: 17
    Last Post: 11th August 2009, 05:15
  2. Replies: 3
    Last Post: 17th October 2007, 12:52
  3. transparent background of the main widget
    By nagpalma in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2007, 17:52
  4. Controlling which widget on top layer?
    By JonathanForQT4 in forum Qt Programming
    Replies: 6
    Last Post: 22nd March 2007, 14:27
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16

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.