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. Set QSplitter as a line with width = 1px ?
QtWS25 Last Chance

Set QSplitter as a line with width = 1px ?

Scheduled Pinned Locked Moved General and Desktop
qsplitter
2 Posts 2 Posters 2.1k 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.
  • Y Offline
    Y Offline
    yangzk
    wrote on 9 Nov 2015, 14:12 last edited by yangzk 11 Sept 2015, 14:35
    #1

    My window is compsoed of two QSplitter widgets, a horizontal one and a vertical one. Currently I put a grey line on the handle. I found there are still a grey border around the splitter, instead of the single line in the middle. How can I set the splitter with width=1 px?

    part of my code is:

    QSplitterHandle * vHandle = mHSplitter->handle(1);
    QHBoxLayout * vLayout = new QHBoxLayout(vHandle);
    vLayout->setSpacing(0);
    vLayout->setMargin(0);
    QFrame * vLine = new QFrame(vHandle);
    vLine->setFrameShape(QFrame::VLine);
    vLine->setStyleSheet("color:rgb(157,157,157)");
    vLayout->addWidget(vLine);
    

    The screenshot is here:
    Screenshot

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Nov 2015, 22:58 last edited by
      #2

      Hi and welcome to devnet,

      Why not create your own subclass of QSplitterHandle that renders the way you want it ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      1/2

      9 Nov 2015, 14:12

      • Login

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