title: Qt missing application's icon in Windows' bottom bar
body: <p>Welcome, I have a question about Qt's windows operations. I have a simple app which contains 2 windows:</p>
  
  <ol>
  <li>MainWindow - includes push button, can't be resizeable, </li>
  <li>AdminWindow - includes label, can be resizeable.</li>
  </ol>
  
  <p>When I click push button, it should open AdminWindow and hide MainWindow. I made the app and it seems to work but when I open the AdminWindow, the application icon which is located in windows's bottom bar is missing. How can I fix it?</p>
  
  <p>Icon is showed when MainWindow is opened:
  <a href="https://i.stack.imgur.com/JUul4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JUul4.png" alt="enter image description here"></a></p>
  
  <p>mainwindow.h</p>
  
  <pre><code>#ifndef MAINWINDOW_H
  #define MAINWINDOW_H
  
  #include &lt;QMainWindow&gt;
  #include "adminwindow.h"
  
  namespace Ui {
  class MainWindow;
  }
  
  class MainWindow : public QMainWindow
  {
      Q_OBJECT
  
  public:
      explicit MainWindow(QWidget *parent = 0);
      ~MainWindow();
  
  private slots:
      void on_pushButtonOpenAdmin_clicked();
  
  private:
      Ui::MainWindow *ui;
      AdminWindow *adminWindow;
  };
  
  #endif // MAINWINDOW_H
  </code></pre>
  
  <p>mainwindow.cpp</p>
  
  <pre><code>#include "mainwindow.h"
  #include "ui_mainwindow.h"
  
  MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi(this);
  }
  
  MainWindow::~MainWindow()
  {
      delete ui;
  }
  
  // hides MainWindow and show AdminWindow
  void MainWindow::on_pushButtonOpenAdmin_clicked()
  {
      hide();
      adminWindow = new AdminWindow(this);
      adminWindow-&gt;show();
  }
  </code></pre>
  
  <p>adminwindow.h</p>
  
  <pre><code>#ifndef ADMINWINDOW_H
  #define ADMINWINDOW_H
  
  #include &lt;QMainWindow&gt;
  
  namespace Ui {
  class AdminWindow;
  }
  
  class AdminWindow : public QMainWindow
  {
      Q_OBJECT
  
  public:
      explicit AdminWindow(QWidget *parent = 0);
      ~AdminWindow();
  
  private:
      Ui::AdminWindow *ui;
  };
  
  #endif // ADMINWINDOW_H
  </code></pre>
  
  <p>adminwindow.cpp</p>
  
  <pre><code>#include "adminwindow.h"
  #include "ui_adminwindow.h"
  
  AdminWindow::AdminWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::AdminWindow)
  {
      ui-&gt;setupUi(this);
  }
  
  AdminWindow::~AdminWindow()
  {
      delete ui;
  }
  </code></pre>