首页| 论坛| 消息

回复: 求教怎么改变 QLineEdit 、QSpinBox控件的背景色
#6 回 5楼(dbzhang800) 的帖子 [fourdegree 04-21 14:34]
我用的是windows 7,但是为什么我使用setStyleSheet来设置就可以呢?
#7 Re:回 5楼(dbzhang800) 的帖子 [dbzhang800 04-21 14:51]
引用第6楼fourdegree于2011-04-21 14:34发表的 回 5楼(dbzhang800) 的帖子 :
我用的是windows 7,但是为什么我使用setStyleSheet来设置就可以呢?
汗,因为当时使用setStyleSheet以后,会生成一个 QStyleSheetStyle !!
你为什么不想用stylesheet呢?我想就是因为和默认style不太一样
#8 回 7楼(dbzhang800) 的帖子 [fourdegree 04-21 15:12]
开始我没有使用stylesheet的。我不想用stylesheet是因为颜色随时会改变,所以我想用setPalette,以为这样程序运行效率会快一点。我是接触QT,还不了解stylesheet、QStyle和QPalette对外观有什么改变有什么区别。。请多多指教!!!谢谢
#9 回 fourdegree 的帖子 [lanmanck 02-02 09:14]
fourdegree:开始我没有使用stylesheet的。我不想用stylesheet是因为颜色随时会改变,所以我想用setPalette,以为这样程序运行效率会快一点。我是接触QT,还不了解stylesheet、QStyle和QPalette对外观有什么改变有什么区别。。请多多指教!!!谢谢 (2011-04-21 15:12) 
QPalette pa = ui->lineEdit->palette();
qDebug() setPalette(pa);

<< 1 2 >> (2/2)

回复 发表
主题 版块