修改QtCreator/QDesigner的对象指示器高亮颜色

一、前言

QtCreator的设计中,高亮颜色太接近了,在左边点一个对象后,很难在右边对上,体验极差。
修改QtCreator/QDesigner的对象指示器高亮颜色_第1张图片

二、解决方案

  1. 创建一份style.qss,写入以下的样式:
/* for QtCreator */
/*QDockWidget#ObjectInspectorDockWidget 也可*/
QDockWidget #ObjectInspector QTreeView::item::selected
{
    background-color: #40735d;
    color: white;
}

/* for QDesigner */
QDockWidget#qt_designer_objectinspector_dock QTreeView::item::selected
{
    background-color: #40735d;
    color: white;
}

类名都是从QtCreator和QDesigner的源代代码里找到的。

  1. 然后命令行运行:
designer.exe -stylesheet style.qss

三、效果

最终效果如下,选中的组件一目了然。
修改QtCreator/QDesigner的对象指示器高亮颜色_第2张图片

四、原理

参见 stackoverflow how to change the color configuration of QtCreator/QtDesigner

你可能感兴趣的:(软件使用,qt,c++,qt)