• 5581阅读
  • 2回复

QRubberBand如何设置颜色 [复制链接]

上一主题 下一主题
离线xinqingfly
 

只看楼主 倒序阅读 楼主  发表于: 2010-02-23
QRubberBand怎么才能设置它的颜色,在windows下是白色的,到了unix变成黑色的了,谁用过交流交流
菜鸟也是鸟
离线xtfllbl

只看该作者 1楼 发表于: 2010-02-23
void setPalette ( const QPalette & )
上海欢迎您
离线xinqingfly

只看该作者 2楼 发表于: 2010-02-23
m_rubberBand = new QRubberBand(QRubberBand::Rectangle,this);
QPalette palette=m_rubberBand->palette();
palette.setColor(m_rubberBand->backgroundRole(), Qt::red);
palette.setColor(m_rubberBand->foregroundRole(), Qt::red);
m_rubberBand->setPalette(palette);

设置了不起效,windows下还是默认白色的
菜鸟也是鸟
快速回复
限100 字节
 
上一个 下一个