Hi,
I'm struggling to set my window icon on a derived QWidget object.
This is the code I have to set the icon :
But alas, I still have the default QT icon?
Any help is appreciated,
Steve
Printable View
setWindowIcon(QIcon(":/images/VDB_Logo.png")); this code working for me.
you try this
setWindowIcon(QIcon(":/QTCanMonitor/Resources/car.png"));
make sure your icon is there.
Still the same, the icon is there, but I still just get the default qt one.
Wondering if it could be something to with that the window is a sub-window? Code I use to add this to my mdi workspace :
Code:
m_pworkspace->addSubWindow( m_pPlotterView );
Where m_pPlotterView is my class derived from QWidget.
The only window I've successfully been able to change icon on is if it is derived from QDialog?
Regards,
Steve
- Check out the case. AFAIK Qt resources paths are case-sensitive just like Unix (and unlike Window$ hence the troubles most users of that OS are facing with filenames... :rolleyes:).
- Is your widget a window (i.e a top level one, either main window, a dialog or a mdi sub window...)
Thanks all,
JPN's solution worked a treat ;)