Search code examples
qtqt4

Change handle color of QSplitter


I am using a QSplitter, but the handle color is not changing, it has always the default color:

m_pSplitMainWin = new QSplitter;
m_pSplitMainWin->setOrientation(Qt::Horizontal);

m_pSplitMainWin->setHandleWidth(10);
m_pSplitMainWin->setStyleSheet("QSplitter::handle:background-color: rgb(55, 100, 110);");

I got some idea from previous post but I am not able to do it with m_pSplitMainWin object


Solution

  • Your CSS syntax is wrong. It should read

    QSplitter::handle { background-color: rgb(55, 100, 110); }