Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36070

XCB: regression: delay after second show()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 5.2.0
    • None
    • Linux i5 3.12.6-1-ARCH #1 SMP PREEMPT Fri Dec 20 19:39:00 CET 2013 x86_64 GNU/Linux

      After a widget is hidden, there is a long delay if show() is called, before it is shown.

      #include <QDebug>
      
      #include <QTime>
      
      #include "widget.hpp"
      
      Widget::Widget(QWidget* const parent) : QWidget(parent)
      {
      }
      
      void Widget::hideEvent(QHideEvent* const event)
      {
        QWidget::hideEvent(event);
        qDebug() << QTime::currentTime() << "widget hidden";
      }
      
      void Widget::showEvent(QShowEvent* const event)
      {
        QWidget::showEvent(event);
        qDebug() << QTime::currentTime() << "widget shown";
      
        startTimer(1000);
      }
      
      void Widget::timerEvent(QTimerEvent* const event)
      {
        static int counter;
        qDebug() << QTime::currentTime() << "timer event";
      
        switch (counter)
        {
          case 0:
            ++counter;
            hide();
            break;
      
          case 1:
            ++counter;
            QObject::killTimer(event->timerId());
            show();
            break;
       
          default:
            QObject::killTimer(event->timerId());
        }
      }
      

      Widget is shown in main() and a timer is triggered, which hides the widget. The timer event is triggered again and the widget is shown, but only after a long delay. This bug manifests itself under linux (KDE), but not under Windows. This is a critical bug, as it delays the reshowing of widgets that were displayed previously, but then hidden.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            paeglis Gatis Paeglis
            janezzabc Janez Žemva
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes