Qt5: hideEvent not fired after showMinimized



  • 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.


  • Lifetime Qt Champion

    Hi,

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



  • Exact Qt version is 5.3.1. OS: Windows 7.


  • Lifetime Qt Champion

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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.