[Qt-interest] about 64bit qt's stylesheet & Q_PROPERTY

iptton iptton at gmail.com
Mon Apr 20 15:31:29 CEST 2009


hi all.

  When I use QT's stylesheet:   qproperty-<object name> to set the widget's
background:

It works on 32bit system drawing

But in 64bit qt4.3.4,it seems that backgroundPixmap never been initialed.

code like below:

CSS file:

#mainWindow{

qproperty-backgroundImage:url("./skin1/mainpanel.bmp");

}

C++:

void FxWidget::resizeEvent(QResizeEvent *event){
 QWidget::resizeEvent(event);
 if( !backgroundPixmap.isNull() )
  setBackground(backgroundPixmap);
}
void FxWidget::setBackground(QPixmap pix){
 QPalette palette;
  backgroundPixmap = pix;
  QImage image = pix.toImage();//("./skin1/mainpanel_window_windowbkg.bmp");
  int left=65,right=130,bottom=58,top=135;
  QPixmap bgTop(width(),height());
  QPainter painter(&bgTop);

// balabala

   // scale the image to 9 pixel

  palette.setBrush(this->backgroundRole(),QBrush(bgTop));
  this->setPalette(palette);

}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090420/09295229/attachment.html 


More information about the Qt-interest-old mailing list