⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Can't resize QSplitter's children after customization

  • The handle doesn't show up when the mouse cursor hovers over the splitter after I apply the following stylesheet

    @QSplitter::handle {
    color: rgb(145, 145, 145);
    width: 1px;

  • Hi Byron,

    it is only 1 pixel width, that is not much.

    I assume you just don't see it, as it is too small.

  • Thanks Gerolf
    There is a mistake in my original stylesheet
    Now I can resize the splitter's children
    It should be
    @QSplitter::handle:vertical {
    color: rgb(145, 145, 145);
    height: 1px;
    But setting color to rgb(145, 145, 145) doesn't change the splitter's appearance
    Is subclassing QSplitter and QSplitterHandlethe the only way to change the splitter's appearance to a plain straight line?

  • you could try background instead of color. color is typically used for foreground. But I never tried this.

  • Hi...
    I am also facing similar problem...like this..
    I have set the stylesheet of my QSplitter as

    parentsplitter->setStyleSheet("QSplitter { border-color: rgb(255, 0, 0); color: rgb(145, 145, 145); height: 5px;background-color: rgb(225,230,234); }");


    But i can see only the background color of my QSplitter is getting changed, but i want to change my border color of QSplitter from my main window..

    Please help me on this..

Log in to reply