Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Qt5.2: How to change popwindow icon to be different from MainWindow?

[SOLVED] Qt5.2: How to change popwindow icon to be different from MainWindow?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sharon_obl82
    wrote on last edited by
    #1

    Hi all,
    I'm not sure if anyone has done this before but I have a MainWindow with some buttons of which when clicked will display another form. I am able to change the MainWindow icon using

    RC_ICONS = img.ico in my .pro file and by adding it to .qrc file

    but I would like to change the popup window's icon so it changes with different windows. Right now, the popup window is displaying the same icon as the MainWindow but I'd like to change it. I used this line but it doesn't seem to work.

    radiouser->setWindowIcon(QIcon("/other_img.ico"));

    Please advise.

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      zeljko
      wrote on last edited by
      #2

      So other_img.ico is in root of disc (I assume that you're on some kinda of unix) ? Are you sure that other_img.ico path is valid ?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sharon_obl82
        wrote on last edited by
        #3

        Yes both the icons reside in the same location

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          zeljko
          wrote on last edited by
          #4

          I mean is QIcon(”/other_img.ico”) valid ? And that "popup window" .. is it QWidget, QMainWindow or QDialog ? (asking because it works here with Qt-4.8.6)

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved