QSplitter becoming undistinguishable between QWidget and QTabWidget

前端 未结 7 1110
庸人自扰
庸人自扰 2021-02-04 06:30

I am puting a QWidget and a QTabWidget next to each other in one horisontal splitter. And the splitter loses it\'s shape, you can know that there is a splitter only by hovering

7条回答
  •  被撕碎了的回忆
    2021-02-04 07:24

    This is true for every splitter at least with WinXP and the default Luna thema (changing to classic solves the problem). If you want to stay with Luna you may change the way the splitters are rendered, e.g. by changing the background color of the handle.

    int main(int argc, char *argv[])    {
    
        QApplication a(argc, argv);
        a.setStyleSheet("QSplitter::handle { background-color: gray }");
        MainWindow w;
        w.show();
        return a.exec();
    }
    

    You may find more on Qt style sheets at https://doc.qt.io/qt-5/stylesheet-reference.html

提交回复
热议问题