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
QtWS25 Last Chance

remove qapplication window icon

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 6.9k Views
  • 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 25 Sept 2017, 15:37 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
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 25 Sept 2017, 15:45 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 25 Sept 2017, 16:32 last edited by
        #3

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

        A 1 Reply Last reply 26 Sept 2017, 03:24
        0
        • U user4592357
          25 Sept 2017, 16:32

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

          A Offline
          A Offline
          ambershark
          wrote on 26 Sept 2017, 03:24 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 26 Sept 2017, 18:34 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

            M 1 Reply Last reply 26 Sept 2017, 18:53
            0
            • U user4592357
              26 Sept 2017, 18:34

              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

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 26 Sept 2017, 18:53 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

              1/6

              25 Sept 2017, 15:37

              • Login

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