Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDockWIdget title & body overlapping
Forum Update on Monday, May 27th 2025

QDockWIdget title & body overlapping

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ixSci
    wrote on last edited by
    #1

    Hi there, I'd like to have title overlapping with body by few pixels. Is there a way to do that?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Could you post a sketch or mockup of what you are after? It's not clear to me.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        ixSci
        wrote on last edited by
        #3

        !http://content.screencast.com/users/ixSci/folders/Jing/media/e0c209b6-c34b-4dfb-89a4-1960f091c302/2012-04-19_1106.png(sketch)!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sam
          wrote on last edited by
          #4

          Hi ,

          You can use styleSheets for the above requirement "QDockWidget Stylesheet":http://doc.qt.nokia.com/4.7-snapshot/stylesheet-examples.html#customizing-qdockwidget

          i tried the following code to get the above look and feel.

          @QString docStylesheet;
          QString txtEditStyleSheet;

          docStylesheet += "QDockWidget::title { border: 4px solid #00A2E8;}";
          txtEditStyleSheet += "QTextEdit { border-top: 0px solid gray; border-left: 4px solid gray; border-bottom: 4px solid gray;border-right: 4px solid gray;}";

          ui->dockWidget->setStyleSheet(docStylesheet);
          ui->textEdit->setStyleSheet(txtEditStyleSheet);@

          I have placed a textEdit inside the dockWidget.

          1 Reply Last reply
          0
          • I Offline
            I Offline
            ixSci
            wrote on last edited by
            #5

            even if your solution works it just means that you solved my mockup exactly :) But the real thing I need is the title overlaps with body. So it should work in general not just for the border

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved