zoukankan      html  css  js  c++  java
  • 还是Qt 通过stylesheet或者palette设置背景色的问题

    关于Qt,设置一个widget的背景色后,希望子对象不受影响。 很久以前在QtForum上问过一个问题:http://www.qtforum.org/post/94103/setting-background-color-on-widgets-makes-child-widget-wrong-style.html?highlight=#post94103

    在stackoverflow上也有类似的问题:http://stackoverflow.com/questions/177778/in-qt-how-do-i-set-the-background-color-of-a-widget-like-combobox-or-double-spin

    现在的方法是:

    1. 要是设置整个对话框的,就用palette

    2. 要是设置某个对象的,就用selector

    Class Selector .QPushButton Matches instances of  QPushButton , but not of its subclasses.

    This is equivalent to  *[class~="QPushButton"] .

    或者

    ID  Selector QPushButton#okButton Matches all  QPushButton   instances whose  object name   is  okButton .

    http://blog.csdn.net/aladdina/article/details/4800079

  • 相关阅读:
    QML的默认属性default property
    QtCreator下QML翻译
    QML开发常见错误(原)
    qt下的跨目录多工程编译(转)
    git使用笔记
    osgQt支持触摸屏
    Qt资源整理ING
    Visual assint x(转)
    C#开发重用方法
    UDP问题
  • 原文地址:https://www.cnblogs.com/findumars/p/8298915.html
Copyright © 2011-2022 走看看