I have next piece of code in my project and it produces transparent background for png-image I use.
Qt Code:
splash.setMask(pixmap.mask()); splash.show();To copy to clipboard, switch view to plain text mode
I have next piece of code in my project and it produces transparent background for png-image I use.
Qt Code:
splash.setMask(pixmap.mask()); splash.show();To copy to clipboard, switch view to plain text mode
Bong.Da.City (12th September 2010), kremuwa (23rd July 2010), saa7_go (22nd July 2010)
Thank you very much for your responses. Unfortunately, Qt::WA_TranslucentBackground (together with Qt::FramelessWindowHint flag passed to the splash screen constructor) didn't work - it made the splash screen completely transparent - not only its "transparent places" from PNG. Tsp, your solution works well.
hello i tried this but no joy.
only the main window is displayed after timeout. the image splash.png is in my working directory.Qt Code:
#include <QtGui/QApplication> #include<QTimer> #include <QSplashScreen> #include <QMainWindow> int main(int argc, char *argv[]) { //splash.setMask(pixmap.mask()); splash.show(); QMainWindow mainWin; return a.exec(); }To copy to clipboard, switch view to plain text mode
if i uncomment splash.setMask(pixmap.mask()); i get: invalid use of incomplete type 'struct QBitmap' forward declaration of 'struct QBitmap'.
any hints? thanks
You must include QBitmap header.
Maybe the problem is in the way you are are referring to splash screen file i.e.
You are using :/ prefix, so the file should be defined in the resource file, maybe you have not done that?Qt Code:
To copy to clipboard, switch view to plain text mode
Hello,
i have added this, res.qrc
and when i compile i get :: error: [debug/qrc_res.cpp] Error 1Qt Code:
<!DOCTYPE RCC><RCC version="1.0"> <qresource> <file>twirl.png</file> <file>splash.png</file> </qresource> </RCC>To copy to clipboard, switch view to plain text mode
my project file is:
thanksQt Code:
SOURCES += \ main2.cpp RESOURCES += \ res.qrcTo copy to clipboard, switch view to plain text mode
Bookmarks