Results 1 to 8 of 8

Thread: QTabWidget->setCornerWidget() unexpected resize.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QTabWidget->setCornerWidget() unexpected resize.

    Hello people,

    I'm experiencing some strange behavior with the following set up:
    - I'm using QT 4.2.x (Replace .x with the standard Edgy packaged version).
    - I create a class which herits from QTabWidget, and dynamicaly creates sub widgets (Tabs).
    - I also have created a little other QWidget derived class (With QTDesigner, named CEditorTabButtons) then a subclass which implements it. It is a simple qwidget with inside several QToolButtons. All the QToolsButtons are layed out with a default horizontal boxing.
    - In the constructor of the "Tab manager" class, i do:
    Qt Code:
    1. pButtonsBar = new CEditorTabButtonsImpl(this);
    2. setCornerWidget(pButtonsBar);
    To copy to clipboard, switch view to plain text mode 

    Then here comes the strange thing:
    If i have only one tab in the tab container, the "corner buttons" are kind of stacked (If i give them a minimal size). They are also resized to very tiny size (If i give them no minimal size). After i add another tab, the buttons have almost their right size, and with more than 2 tabs they have the right size and stop changing size (Until i remove tabs again, they becomes small).

    So i tried to tell my CEditorTabButtonsImpl to have a fixed size, the result is that when i only have 1 tab, the box "slides" to the right, and as a result i'm only able to see the 2 first buttons (The others are out of the window).

    Resizing the main application window does nothing.

    Anyone has a clue on what i'm doing wrong here?

    Thanks a lot,
    Pierre.

    [EDIT:] Just to make thinks a bit more clear: what i'm trying to achieve is a simple tabbed based text editor. So the tools buttons in the tab bar i'm talking about are like such this kind of tool usualy have (With save, open, new close icons). I hope you'll see what i mean
    [EDIT2:] Just added 4 screens of what's appening
    Attached Images Attached Images
    Last edited by hickscorp; 8th December 2006 at 01:46.

Similar Threads

  1. postponing resize event
    By Honestmath in forum Qt Programming
    Replies: 11
    Last Post: 26th February 2006, 00:32

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.