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. remove qapplication window icon
Forum Updated to NodeBB v4.3 + New Features

remove qapplication window icon

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 7.1k Views 3 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.
  • U Offline
    U Offline
    user4592357
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    1
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      You can try setting the windowsFlags like the following.

      w->setFlags( Qt::CustomizeWindowHint | Qt::WindowTitleHint );

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      1
      • U Offline
        U Offline
        user4592357
        wrote on last edited by
        #3

        how? the window is a subclass of QMainWindow, not QWindow

        A 1 Reply Last reply
        0
        • U user4592357

          how? the window is a subclass of QMainWindow, not QWindow

          A Offline
          A Offline
          ambershark
          wrote on last edited by
          #4

          @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.

          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

          1 Reply Last reply
          1
          • U Offline
            U Offline
            user4592357
            wrote on last edited by
            #5

            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

            mrjjM 1 Reply Last reply
            0
            • U user4592357

              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

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @user4592357
              Well if you dont find a more correct way, simply hax it ;)
              QPixmap pixmap( 32, 32 );
              pixmap.fill( Qt::transparent );
              setWindowIcon(QIcon(pixmap));

              1 Reply Last reply
              4

              • Login

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