Hi,
for some reason stylesheet doesn't want to display files from NumbatEngine. Copying file back from NumbatEngine to hard disk as following writes the file just fine, i.e. it's not damaged or something:
QPixmap pixFromNumbat
("???Hello.jpg");
pixFromNumbat.save("pixFromNumbat.jpg");
QPixmap pixFromNumbat("???Hello.jpg");
pixFromNumbat.save("pixFromNumbat.jpg");
To copy to clipboard, switch view to plain text mode
Also, stylesheet does display the image if it's read from hard disk (by disabling NumbatEngine from main()).
I'm using Qt 4.7.2. Please, can anyone confirm that NumbatEngine works for you? I'm desperate
EDIT
This works too (taken from):
/* Demonstration. */
MainWindow
::MainWindow(QWidget *parent
){
pix.save("???Hello.jpg");
//lbl->setStyleSheet("QLabel {background-image:url(\"???Hello.jpg\");}");
lbl->setText("<b> this is a test</b><img src=\"???Hello.jpg\" />");
setCentralWidget(lbl);
}
/* Demonstration. */
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
QPixmap pix("image.jpeg");
pix.save("???Hello.jpg");
QLabel * lbl = new QLabel;
//lbl->setStyleSheet("QLabel {background-image:url(\"???Hello.jpg\");}");
lbl->setText("<b> this is a test</b><img src=\"???Hello.jpg\" />");
setCentralWidget(lbl);
}
To copy to clipboard, switch view to plain text mode
but it doesn't work for styleSheet. Bug in Qt?
Bookmarks