Set QSplitter as a line with width = 1px ?

  • 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);
    QFrame * vLine = new QFrame(vHandle);

    The screenshot is here:

  • Lifetime Qt Champion

    Hi and welcome to devnet,

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

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.