Results 1 to 9 of 9

Thread: Collapzable widget

  1. #1
    Join Date
    Apr 2011
    Posts
    58
    Thanks
    1

    Default Collapzable widget

    Hi,

    How do I create a widget that has a tiny little arrow that, when user clicks on it, it will collapse the widget into just a title bar. I see this sort of collapzable interface in other applications before. I could not find any examples or demo that show this in QT.
    Any pointer please.

    Thank you.
    marc

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Collapzable widget

    Connect a checkable button that will serve as your "arrow" and connect its toggled(bool) signal to a setVisible(bool) (or setHidden(bool)) slot of the widget serving as a "body" of the widget you want. Or use QwwTaskPanel from wwWidgets if it suits your needs.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    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: Collapzable widget

    i think if u just resize your widget to a minimum height (0 maybe) then u can get the desired effect.

    EDIT: too late

    EDIT2: if he hides the toplevel widget then the whole window with title bar will hide.

  4. #4
    Join Date
    Apr 2011
    Posts
    58
    Thanks
    1

    Default Re: Collapzable widget

    So we're saying there is no built in function. But rather has to be achieved through some kind of tricks?

  5. #5
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Collapzable widget

    No; they're saying that the functionality to do this is present, and that you simply have to write code to make use of it.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Collapzable widget

    Quote Originally Posted by nish View Post
    if he hides the toplevel widget then the whole window with title bar will hide.
    Nobody said he should use top-level windows. That's a different mechanism.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    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: Collapzable widget

    Quote Originally Posted by wysota View Post
    Nobody said he should use top-level windows. That's a different mechanism.
    I thought he was talking about toplevel when i saw the "Title bar" and the collapse behavior which is present in many gnome themes.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Collapzable widget

    Collapsing (or actually "shading") a window is a feature of the windowing system and not the application. You can only hint the OS to shade the window by setting Qt::WindowShadeButtonHint.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    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: Collapzable widget

    Quote Originally Posted by wysota View Post
    Collapsing (or actually "shading") a window is a feature of the windowing system and not the application. You can only hint the OS to shade the window by setting Qt::WindowShadeButtonHint.
    yes.. and i was under impression that he want to mimic that behavior where it is not available (Windows).

Similar Threads

  1. Replies: 1
    Last Post: 11th March 2011, 19:34
  2. Replies: 10
    Last Post: 29th May 2010, 18:42
  3. Replies: 7
    Last Post: 14th January 2010, 08:47
  4. Replies: 4
    Last Post: 3rd March 2008, 22:15
  5. Replies: 1
    Last Post: 5th November 2006, 23:50

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.