Nominate our 2022 Qt Champions!

Central QDockWidget as a replacement for a QTabWidget ?

  • Hi

    I am a bit stuck with my project. I try to write a little editor. I have a program with an editor (central position) , an output console (bottom) and two explorer (left and right side).

    Until today, the console and the two object explorer were dock widget and the editor was a central QPlainTextEdit. But the deign is not that good (Many lines around the widgets etc, different layout under windows and kubuntu etc...)

    Here is a screen of the current GUI:

    Windows (Okay, only a few lines, clear layout, but this ugly double line -> 0 pixel margin):
    Kubuntu (Too many lines...I should simplify the layout):

    I saw kdevelop under Kubuntu and they have this fancy file tab "array". I like this interface:

    Please pay attention to the file tab array and the left dock widget (The distance between each dock widget is much closer than in my application. The height of the file explorer and the tab menu is the same - not in my application). Is there an easy way to simplify my layout (more like kdevelop) ? Can I create a central widget with a "normal" and clean file tab array like in kdevelop or can I disable the frame lines (See kubuntu picture)

    I know, I this is not a regular question, I need some input, a different point of view ;)


  • That is because you moved the dock title to the left side. If you want to keep equal the height of QPlainTextEdit and the height of the widget internal to the dock, you can use stylesheets to change the marging and the padding of the widget, also change the dock frame style to remove the borders.

  • Okay, thank you, that sounds like a good plan. I changed the border size, but there is still a pixel (maybe two) between the border of the QWidget and the QTabWidget

Log in to reply