remove qapplication window icon
-
i'd like to have no window icon on app's window's top-left corner, but setting it to QIcon() just adds the default window icon.
-
You can try setting the windowsFlags like the following.
w->setFlags( Qt::CustomizeWindowHint | Qt::WindowTitleHint );
-
how? the window is a subclass of QMainWindow, not QWindow
-
@user4592357 said in remove qapplication window icon:
how? the window is a subclass of QMainWindow, not QWindow
QMainWindow::QMainWindow(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags())
You can pass the flags in on the constructor to your MainWindow.
My next question though is why you want to do this? It's non standard application design. Your alt+tab won't have an icon and will look funny too.
-
okay, so i called
setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);
in my window's constructor but the only change i see is that my window doesn't have those close and minimize buttons on top-right corner :(
the default icon still appears as before
-
@user4592357
Well if you dont find a more correct way, simply hax it ;)
QPixmap pixmap( 32, 32 );
pixmap.fill( Qt::transparent );
setWindowIcon(QIcon(pixmap));