Results 1 to 9 of 9

Thread: QToolBox Formatting

  1. #1
    Join Date
    Jan 2006
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QToolBox Formatting

    Hi folks,

    Here's a basic QToolBox:



    How do I bring down the spacing between the tabs to zero? For example the gap between ToolBox Item 1 and ToolBox Item 2

    I know this is basic, but I can't find it!

    Ta,
    C.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: QToolBox Formatting

    I think this depends on the style. You'll have to alter the style. Did you tried other styles?
    It's nice to be important but it's more important to be nice.

  3. #3
    Join Date
    Jan 2006
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBox Formatting

    Thanks Axel,

    When I use the '-style plastique' flag it does produce that nicer "tab" style tab:



    But what I had in mind was something more like:



    Not so much the colours and shading style, but the inter-tab spacing. Any ideas?

    Thanks
    Chris
    Attached Images Attached Images

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: QToolBox Formatting

    Use a proxystyle to replace the code for handling the toolbox with your own code. Proxystyle is explained here:

    http://doc.trolltech.com/qq/qq09-q-and-a.html#style
    It's nice to be important but it's more important to be nice.

  5. #5
    Join Date
    Jan 2006
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBox Formatting

    Thanks Axel, so it's not quite as trivial as I'd hoped...

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

    Default Re: QToolBox Formatting

    Oh, the (in)famous "outlook nav bar issue" again

    We found it easier to implement such a widget using a set of buttons (or frames), splitter and a stacked widget instead of a QToolBox. The buttons just cause the stacked widget page to change.

  7. #7
    Join Date
    Jan 2006
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBox Formatting

    Hi again

    Boredom and foolishness led me to try re-implementing QToolBox, to see if I could make something with easier access to it's layout. By some miraculous good fortune it worked, check out the pic:

    toolbox_reimp.png

    If anyone wants the source I'll put it up here later.

    Thanks!
    Chris

  8. #8
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: QToolBox Formatting

    Of course we are interested in the source.
    It's nice to be important but it's more important to be nice.

  9. #9
    Join Date
    Jan 2006
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBox Formatting

    Here it is,

    In summary:
    I've put the QToolBoxButton into a seperate ToolBoxButton class, and moved all the internal QToolBoxPrivate stuff into the ToolBox class where I could get at it's bits. Then it was just a case of putting a
    Qt Code:
    1. layout->setSpacing(0);
    To copy to clipboard, switch view to plain text mode 
    in the constructor.

    Cheers!
    Chris
    toolbox.zip

  10. The following user says thank you to cwalsh for this useful post:

    miro (14th April 2006)

Similar Threads

  1. QToolBox Resizing to contents??
    By kerwim in forum Qt Programming
    Replies: 1
    Last Post: 30th June 2008, 08:28
  2. xhtml/css text formatting
    By kernel_panic in forum Qt Programming
    Replies: 10
    Last Post: 30th October 2007, 14:21
  3. QToolBox + resize + hide
    By eleanor in forum Newbie
    Replies: 14
    Last Post: 24th October 2007, 19:41
  4. QMainWindow && QToolBox
    By eleanor in forum Qt Programming
    Replies: 1
    Last Post: 21st October 2007, 20:11
  5. QToolBox qss style sheet problem
    By eskil in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2007, 17:45

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.