Results 1 to 4 of 4

Thread: setWindowIcon

  1. #1
    Join Date
    Jan 2006
    Posts
    115
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default setWindowIcon

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: setWindowIcon

    Are you sure if the path to the image is correct? Could you verify that for example by showing the image in a window?

  3. #3
    Join Date
    Jan 2006
    Posts
    115
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: setWindowIcon

    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:

    [HTML]void MainWindow::info()
    {

    QMessageBox *mb = new QMessageBox(this);
    mb->setWindowIcon(QIcon(":/images/triple20.png"));
    mb->setWindowTitle( "Triple/S");
    QPixmap pm (":/images/triple50.png");
    mb->setIconPixmap( pm );
    etc.....
    mb->exec();
    }[/HTML]

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

  4. #4
    Join Date
    Oct 2012
    Posts
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: setWindowIcon

    How resize windowiconsize of mainwindow

Similar Threads

  1. Qt3 to Qt4 transition, setWindowIcon() problems
    By watashi16 in forum Qt Programming
    Replies: 5
    Last Post: 13th December 2007, 20:18
  2. Can setWindowIcon() work in QDockWidget?
    By alfa_wu in forum Qt Programming
    Replies: 2
    Last Post: 13th December 2007, 08:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.