How to remove Qt icon from QMdiSubWindow
Trying to remove Qt icon from QMdiSubWindow with little success. Below is an icon depicting the icon in the upper left corner.
Here is some code that looks like it should set Icon to empty, but not.
QMdiSubWindow* sub = new QMdiSubWindow;
sub->setAttribute( Qt::WA_DeleteOnClose );
sub->setWidget( myWidget );
sub->setWindowIcon( QIcon() );
//tried this too
//sub->setWindowIcon( QIcon("") );
mdiArea->addSubWindow( traceSub );
Thank!
source to share
Removing / replacing Qt default window icon
First go to your user interface (user interface) form and enter the properties panel (it should be on the right side by default). Then scroll down the page until you see "windowIcon" and click in the window and select the down arrow.
Then continue selecting the item as shown on the left side of my image box 1 . To add here, add items to resources from Qt. Here is some documentation on this - http://doc.qt.io/qt-5/resources.html
The other answers were acceptable, but did not go into details about accessing the UI, this is not a bad way to do it, but if you want to keep everything in code, you can easily do it.
// Replace relevant code, use ico files in UI (method shown above).
form->setWindowIcon(QIcon(QPixmap(1,1)));
Using .ico files is the best and more industry standard way as this scaling is related to the display due to the storage of different image sizes. Setting up a transparent icon is not the best thing, as when the user launches the application, they won't see it and it will look glitchy, but for testing it's okay.
source to share