Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, January 2007
Implementing a slide-out panel from a dockwidget


Message 1 in thread

Hi,

I need to implement something akin to having a slide-out panel appear from one
edge of a dock widget.  For instance, I want a main window with a regular dock
widget on the left, and some kind of 'Expand' or '>>' button on the dock, when
clicked, shows more option, or a fuller version of the dockable widget.
Rather than having a regular popup dialog, I'm looking into having a frameless
widget appear at the rightmost edge (in the case of a left-docked widget) of
the docked widget, grey out the dock widget, and have the new widget behave a
little like a modal docked widget - for instance, if I move the main window,
the new widget has to remain in the same position relative to the dock.  The
slide-out widget will obscure the contents below, rather than squash them like
a dock widget.  It's only intended to be visible temporarily.

Some poor-quality ascii pics:

+------------------------------------------+
|       |                                  |
|  [>>] |                                  |
|       |                                  |
|       |     Main Window                  |
|       |                                  |
| Dock  |                                  |
|Widget |                                  |
|       |                                  |
|       |                                  |
+------------------------------------------+

User clicks on the [>>] button, and gets something like this:


+------------------------------------------+
|       |---------------+                  |
|  [>>] |           [<<]|                  |
|       |   Slide-out   |                  |
|Greyed |    Popup      |    Main          |
| Out   |    Window     |   Window         |
| Dock  |               |                  |
|Widget |               |                  |
|       |               |                  |
|       |---------------+                  |
+------------------------------------------+

Is there some kind of standard (or easy) way of creating this slide-out window
and having it automatically stay docked to the dock window?  Or am I going to
have to create a basic windowless dock/widget, and manually manage the size
position by, for instance, installing an event handler on the left dock and
main window and watching for resize/move events?

Thanks,
Graeme.

--
 [ signature omitted ] 

Message 2 in thread

Hi Graeme,

Mmhhhhhh... Are you looking for something like the "tabbed tool spaces" in
Adobe Indesign, as I was speaking about in
http://lists.trolltech.com/qt-interest/2006-08/thread00523-0.html ?


If yes : according to the trolls, seems that you'll have to do it by
yourself.


Enclosed, a sample code I had set up months ago, while looking for this
behavior. 

Not finished, quite dirty, but probably going toward a satisfying solution..

Please, let me know if you improve it !

Best,
Nicolas



Graeme Bunyan wrote:

> Hi,
> 
> I need to implement something akin to having a slide-out panel appear from
> one
> edge of a dock widget.  For instance, I want a main window with a regular
> dock widget on the left, and some kind of 'Expand' or '>>' button on the
> dock, when clicked, shows more option, or a fuller version of the dockable
> widget. Rather than having a regular popup dialog, I'm looking into having
> a frameless widget appear at the rightmost edge (in the case of a
> left-docked widget) of the docked widget, grey out the dock widget, and
> have the new widget behave a little like a modal docked widget - for
> instance, if I move the main window,
> the new widget has to remain in the same position relative to the dock. 
> The slide-out widget will obscure the contents below, rather than squash
> them like
> a dock widget.  It's only intended to be visible temporarily.
> 
> Some poor-quality ascii pics:
> 
> +------------------------------------------+
> |       |                                  |
> |  [>>] |                                  |
> |       |                                  |
> |       |     Main Window                  |
> |       |                                  |
> | Dock  |                                  |
> |Widget |                                  |
> |       |                                  |
> |       |                                  |
> +------------------------------------------+
> 
> User clicks on the [>>] button, and gets something like this:
> 
> 
> +------------------------------------------+
> |       |---------------+                  |
> |  [>>] |           [<<]|                  |
> |       |   Slide-out   |                  |
> |Greyed |    Popup      |    Main          |
> | Out   |    Window     |   Window         |
> | Dock  |               |                  |
> |Widget |               |                  |
> |       |               |                  |
> |       |---------------+                  |
> +------------------------------------------+
> 
> Is there some kind of standard (or easy) way of creating this slide-out
> window
> and having it automatically stay docked to the dock window?  Or am I going
> to have to create a basic windowless dock/widget, and manually manage the
> size position by, for instance, installing an event handler on the left
> dock and main window and watching for resize/move events?
> 
> Thanks,
> Graeme.

Attachment:

Attachment: borderTabWindow.tar
Description: Unix tar archive


Message 3 in thread

On 01/04/07 15:54, Graeme Bunyan wrote:
> Hi,
> 
> I need to implement something akin to having a slide-out panel appear from one
> edge of a dock widget.  For instance, I want a main window with a regular dock
> widget on the left, and some kind of 'Expand' or '>>' button on the dock, when
> clicked, shows more option, or a fuller version of the dockable widget.
> Rather than having a regular popup dialog, I'm looking into having a frameless
> widget appear at the rightmost edge (in the case of a left-docked widget) of
> the docked widget, grey out the dock widget, and have the new widget behave a
> little like a modal docked widget - for instance, if I move the main window,
> the new widget has to remain in the same position relative to the dock.  The
> slide-out widget will obscure the contents below, rather than squash them like
> a dock widget.  It's only intended to be visible temporarily.
> 
> Some poor-quality ascii pics:
> 
> +------------------------------------------+
> |       |                                  |
> |  [>>] |                                  |
> |       |                                  |
> |       |     Main Window                  |
> |       |                                  |
> | Dock  |                                  |
> |Widget |                                  |
> |       |                                  |
> |       |                                  |
> +------------------------------------------+
> 
> User clicks on the [>>] button, and gets something like this:
> 
> 
> +------------------------------------------+
> |       |---------------+                  |
> |  [>>] |           [<<]|                  |
> |       |   Slide-out   |                  |
> |Greyed |    Popup      |    Main          |
> | Out   |    Window     |   Window         |
> | Dock  |               |                  |
> |Widget |               |                  |
> |       |               |                  |
> |       |---------------+                  |
> +------------------------------------------+
> 
> Is there some kind of standard (or easy) way of creating this slide-out window
> and having it automatically stay docked to the dock window?  Or am I going to
> have to create a basic windowless dock/widget, and manually manage the size
> position by, for instance, installing an event handler on the left dock and
> main window and watching for resize/move events?
> 
> Thanks,
> Graeme.

Thanks to those who replied - as I was typing out the question, I began to
wonder 'what the heck am I talking about?'.  Really, the use model is that of
a modal dialog, but somebody wanted to be 'flashy' like Google Desktop and
have a slide-out window coming out of the docked window.  Most of the
suggestions seemed to point me towards hideable docked windows - what I needed
was something that sprung out FROM an existing docked window.  I tried a few
things with a second docked widget and just splitting the dock area, which
kinda worked, but my thinking was still that what was being requested was
basically calling for a simple modal dialog, and that trying to have other
types of widgets appearing just made things more confusing for the user (in
this particular case).

Thanks,
Graeme.

--
 [ signature omitted ]