View Full Version : setWindowIcon

22nd May 2006, 17:23
Hello anybody,

I'am using Fedora Core 5 with KDE-4
I'am also using QT-4.1.3

I want to put my own icon on the taskbar next to the windowtitle.
If i do in designer nothing happens.
if i put in mainwindow.cpp: setWindowIcon(QIcon(":/images/triple20.png"));
also nothing happens.
I also tried it in main.cpp: app.setWindowIcon(QIcon(":/images/triple20.png"));
also nothing happens.

I also search the net but i can't find anything about this item.
I also read the documentation from Trolltech about this.

Is it posibble to put a icon on the taskbar.

22nd May 2006, 18:04
Are you sure if the path to the image is correct? Could you verify that for example by showing the image in a window?

22nd May 2006, 20:19
I have got a file called images.
In this file i have got triple20.png and triple50.png

Here is some code of a MessageBox i use:

void MainWindow::info()

QMessageBox *mb = new QMessageBox(this);
mb->setWindowTitle( "Triple/S");
QPixmap pm (":/images/triple50.png");
mb->setIconPixmap( pm );

In this MessageBox the setWindowIcon is nothing showing in the taskbar.
The setIconPixmap is showing nicely the triple50.png in the MessageBox window.

3rd December 2012, 06:41
How resize windowiconsize of mainwindow