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. Common Icon for all dialogs and message boxes
Forum Updated to NodeBB v4.3 + New Features

Common Icon for all dialogs and message boxes

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 1.5k 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.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by
    #1

    Hi
    My application has a application icon that is displayed correctly, but I want the same icon to appear on all my dialogs and message boxes
    Currently I am doing
    @
    QIcon icon;
    icon.addPixmap(QString(":/Images/emu.png"));
    setWindowIcon(icon);
    @

    in each of my dialog classes.

    My question is, is there a way of getting this icon to be used by all dialogs without having to place the same code in each dialog class?

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      i think you should be able to achieve this by "setting the application icon":http://qt-project.org/doc/qt-4.8/appicon.html but i'm not sure.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GrahamL
        wrote on last edited by
        #3

        I have already set the application icon

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kqt-mr-nv6
          wrote on last edited by
          #4

          pass parent pointer while creating dialogs
          parent icon will be shown on all childs

          1 Reply Last reply
          0
          • IamSumitI Offline
            IamSumitI Offline
            IamSumit
            wrote on last edited by
            #5

            You can use CSS as well . But you have to write atleast one line code/instruction.

            Be Cute

            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