Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt5: hideEvent not fired after showMinimized

    General and Desktop
    2
    4
    1099
    Loading More Posts
    • 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.
    • _rth_
      _rth_ last edited by

      Hello.

      I have application, which displays my QWidget derived widget (no QMainWindow used):

      @class RthTools : public QWidget
      {
      Q_OBJECT

      public:
      explicit RthTools(QWidget *parent = 0);
      ~RthTools();

      protected:
      void showEvent(QShowEvent *);
      void hideEvent(QHideEvent *);

      ...

      }@

      @
      ...

      void RthTools::pickColor()
      {
      //qDebug() << "> RthColorDialog::pickColor()";

      this->takingScreenshot = true;
      this->showMinimized();
      

      }

      void RthTools::showEvent(QShowEvent *e)
      {
      //qDebug() << "> RthColorDialog::showEvent";
      }

      void RthTools::hideEvent(QHideEvent *e)
      {
      //qDebug() << "> RthColorDialog::hideEvent";
      QWidget::hideEvent(e);
      if (this->takingScreenshot)
      QTimer::singleShot(50, this, SLOT(takeScreenshot()));
      }

      ...
      @

      After click on button, pickColor() slot is called and widget is minimized, but the hideEvent is not fired.

      Note: this approach worked fine on previous version 4.7.x, 4.8.x.

      Could someone please help me? Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        You should add which version of Qt you are using as well as OS

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • _rth_
          _rth_ last edited by

          Exact Qt version is 5.3.1. OS: Windows 7.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Then you should re-check if it's still the same with 5.4

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post