Hi,
I'm struggling to set my window icon on a derived QWidget object.
This is the code I have to set the icon :
Qt Code:
To copy to clipboard, switch view to plain text mode
But alas, I still have the default QT icon?
Any help is appreciated,
Steve
Hi,
I'm struggling to set my window icon on a derived QWidget object.
This is the code I have to set the icon :
Qt Code:
To copy to clipboard, switch view to plain text mode
But alas, I still have the default QT icon?
Any help is appreciated,
Steve
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.
Rajesh Kumar Singh
Bangalore, India.
Qt Search
Must Watch:
See how we can connect digital world objects to our day to day life….
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 :
Qt Code:
m_pworkspace->addSubWindow( m_pPlotterView );To copy to clipboard, switch view to plain text mode
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
Qt Code:
QMdiSubWindow* subWindow = m_pworkspace->addSubWindow( m_pPlotterView );To copy to clipboard, switch view to plain text mode
J-P Nurmi
steg90 (16th July 2007)
- 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...
).
- Is your widget a window (i.e a top level one, either main window, a dialog or a mdi sub window...)
Current Qt projects : QCodeEdit, RotiDeCode
Thanks all,
JPN's solution worked a treat![]()
Bookmarks