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. Why no reaction after hiding QMainWindow and then click it on Mac?
Forum Updated to NodeBB v4.3 + New Features

Why no reaction after hiding QMainWindow and then click it on Mac?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 318 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.
  • LimerL Offline
    LimerL Offline
    Limer
    wrote on last edited by Limer
    #1

    I just wrote a very simple program on Mac, like that,

    
    #include "main_window.h"
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
    {
        setCentralWidget(new QWidget);
    
        setFixedSize(100, 100);
    
    }
    
    MainWindow::~MainWindow()
    {
    }
    
    
    void MainWindow::closeEvent(QCloseEvent* event)
    {
        hide();
        event->ignore();
    }
    
    

    After clicked the ❎of MainWindow, and then click the icon at the bottom program-dock, but there is no response, it can't show again, why?

    sierdzioS 1 Reply Last reply
    0
    • LimerL Limer

      I just wrote a very simple program on Mac, like that,

      
      #include "main_window.h"
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
      {
          setCentralWidget(new QWidget);
      
          setFixedSize(100, 100);
      
      }
      
      MainWindow::~MainWindow()
      {
      }
      
      
      void MainWindow::closeEvent(QCloseEvent* event)
      {
          hide();
          event->ignore();
      }
      
      

      After clicked the ❎of MainWindow, and then click the icon at the bottom program-dock, but there is no response, it can't show again, why?

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @Limer said in Why no reaction after hiding QMainWindow and then click it on Mac?:

      After clicked the ❎of MainWindow, and then click the icon at the bottom program-dock, but there is no response, it can't show again, why?

      Because it is hidden (visible property is false).

      Perhaps you should have called minimize() instead of hide()?

      (Z(:^

      LimerL 1 Reply Last reply
      3
      • sierdzioS sierdzio

        @Limer said in Why no reaction after hiding QMainWindow and then click it on Mac?:

        After clicked the ❎of MainWindow, and then click the icon at the bottom program-dock, but there is no response, it can't show again, why?

        Because it is hidden (visible property is false).

        Perhaps you should have called minimize() instead of hide()?

        LimerL Offline
        LimerL Offline
        Limer
        wrote on last edited by
        #3

        @sierdzio You are right, thanks a lot.

        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