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. [Solved] QMainWindow show/hide
Forum Updated to NodeBB v4.3 + New Features

[Solved] QMainWindow show/hide

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.1k 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.
  • V Offline
    V Offline
    Verminoz
    wrote on last edited by
    #1

    Hi all,

    In an application I am developing I have implemented a tray icon. The close action is overriden to minimize to tray and from the icon tray one can restore the window.
    I use hide() to hide the window when I minimize the window to tray and show() to make it appear again after the tray icon is clicked. It works fine but there seems to be a side-effect I don't like. When the window is shown again the window constructor is called executing a lot of code that should not be executed. Is there a way to avoid this?

    edit: By the way setVisible() has exactly the same effect

    edit 2: My bad, I forgot I had overriden the showEvent. Sorry for spamming with stupid question.

    Ohne Muzik ware das Leben ein Irrtum.

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      zeljko
      wrote on last edited by
      #2

      I'm using same thing here and there's no constructor calling after re-show - everything works as expected.IMO, without provided code nobody can help you in this case.
      btw. I'm talking about linux (x11).

      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