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. Qt5: hideEvent not fired after showMinimized

Qt5: hideEvent not fired after showMinimized

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

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • _rth__ Offline
        _rth__ Offline
        _rth_
        wrote on last edited by
        #3

        Exact Qt version is 5.3.1. OS: Windows 7.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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
          0

          • Login

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