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

QDialog subclass does not paint on second show. Moving scrollbar in the QDialog subclass then causes ASSERT failure in QWidget::mapTo(const QWidget *parent, const QPoint &pos): "parent must be in parent hierarchy", file kernel/qwidget.cpp, line 4253

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P1: Critical
    • None
    • 5.11.1, 5.12.4
    • None
    • Centos7 64 bit
    • Linux/X11

    Description

      In the simple working example attached, for the second time the TestDialog subclass of QDialog is shown it does not receive a paint event.  If I then resize the TestDialog it is painted but then moving either of its scrollbars (its layout contains a QScrollArea widget) will then cause the following assertion in QWidget to fail:

      ASSERT failure in QWidget::mapTo(const QWidget *parent, const QPoint &pos): "parent must be in parent hierarchy", file kernel/qwidget.cpp, line 4253
      ./Main.sh: line 18: 21498 Aborted (core dumped) $val ./Main

       

      I get this bug with a selection of Qt5 versions >=5.11.1. The version I am currently working with is 5.12.4.

      This bug does not occur with Qt5 versions <=5.11.0 and also 4.8.7.

       

      Here is the backtrace:

      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib64/libthread_db.so.1".
      Core was generated by `./Main'.
      Program terminated with signal SIGABRT, Aborted.
      #0 0x00007f666f400207 in raise () from /lib64/libc.so.6
      [Current thread is 1 (Thread 0x7f6671557780 (LWP 21498))]
      Missing separate debuginfos, use: debuginfo-install bzip2-libs-1.0.6-13.el7.x86_64 dbus-libs-1.10.24-13.el7_6.x86_64 devtoolset-4-elfutils-libelf-0.166-1.el7.x86_64 devtoolset-4-elfutils-libs-0.166-1.el7.x86_64 expat-2.1.0-10.el7_3.x86_64 fontconfig-2.13.0-4.3.el7.x86_64 freetype-2.8-12.el7_6.1.x86_64 glib2-2.56.1-4.el7_6.x86_64 glibc-2.17-260.el7_6.5.x86_64 libICE-1.0.9-9.el7.x86_64 libSM-1.2.2-2.el7.x86_64 libX11-1.6.5-2.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXcursor-1.1.14-8.el7.x86_64 libXext-1.3.3-3.el7.x86_64 libXfixes-5.0.3-1.el7.x86_64 libXrender-0.9.10-1.el7.x86_64 libattr-2.4.46-12.el7.x86_64 libcap-2.22-9.el7.x86_64 libgcc-4.8.5-28.el7_5.1.x86_64 libgcrypt-1.5.3-14.el7.x86_64 libgpg-error-1.12-3.el7.x86_64 libicu-50.1.2-17.el7.x86_64 libpng-1.5.13-7.el7_2.x86_64 libselinux-2.5-11.el7.x86_64 libstdc++-4.8.5-28.el7_5.1.x86_64 libuuid-2.23.2-43.el7_4.2.x86_64 libxcb-1.13-1.el7.x86_64 libxkbcommon-0.7.1-1.el7.x86_64 libxkbcommon-x11-0.7.1-1.el7.x86_64 lz4-1.7.5-2.el7.x86_64 pcre-8.32-17.el7.x86_64 systemd-libs-219-62.el7_6.6.x86_64 xz-libs-5.2.2-1.el7.x86_64 zlib-1.2.7-18.el7.x86_64
      (gdb) bt
      #0 0x00007f666f400207 in raise () from /lib64/libc.so.6
      #1 0x00007f666f4018f8 in abort () from /lib64/libc.so.6
      #2 0x00007f667026d723 in qt_message_fatal (context=..., message=...) at global/qlogging.cpp:1904
      #3 0x00007f667026e210 in QMessageLogger::fatal (this=this@entry=0x7ffd84377e60,
      msg=msg@entry=0x7f66705628b0 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qlogging.cpp:888
      #4 0x00007f6670268917 in qt_assert_x (
      where=where@entry=0x7f66711c6ab8 "QWidget::mapTo(const QWidget *parent, const QPoint &pos)",
      what=what@entry=0x7f66711c6a90 "parent must be in parent hierarchy",
      file=file@entry=0x7f66711bfd49 "kernel/qwidget.cpp", line=line@entry=4253) at global/qglobal.cpp:3216
      #5 0x00007f6670e36787 in QWidget::mapTo (this=this@entry=0x2005900, parent=parent@entry=0x2005b00, pos=...)
      at kernel/qwidget.cpp:4252
      #6 0x00007f6670e17b66 in QWidgetBackingStore::qt_flush (widget=widget@entry=0x2005900, region=...,
      backingStore=0x2091f30, tlw=0x2005b00, widgetTextures=<optimized out>,
      widgetBackingStore=widgetBackingStore@entry=0x20878c0) at kernel/qwidgetbackingstore.cpp:124
      #7 0x00007f6670e18e77 in QWidgetBackingStore::flush (this=this@entry=0x20878c0, widget=widget@entry=0x0)
      at kernel/qwidgetbackingstore.cpp:1468
      #8 0x00007f6670e18eec in QWidgetBackingStore::endPaint (this=this@entry=0x20878c0, cleaned=...,
      backingStore=<optimized out>, beginPaintInfo=beginPaintInfo@entry=0x7ffd843780b0) at kernel/qwidgetbackingstore.cpp:363
      #9 0x00007f6670e1a471 in QWidgetBackingStore::doSync (this=this@entry=0x20878c0) at kernel/qwidgetbackingstore.cpp:1426
      #10 0x00007f6670e1a891 in QWidgetBackingStore::sync (this=0x20878c0) at kernel/qwidgetbackingstore.cpp:1204
      #11 0x00007f6670e36b72 in QWidgetPrivate::syncBackingStore (this=this@entry=0x20828a0) at kernel/qwidget.cpp:1961
      #12 0x00007f6670e4f103 in QWidget::event (this=0x2005b00, event=0x205dba0) at kernel/qwidget.cpp:9264
      #13 0x00000000004036a0 in TestDialog::event (this=0x2005b00, e=0x205dba0) at TestDialog.cpp:32
      #14 0x00007f6670e09f4a in QApplicationPrivate::notify_helper (this=this@entry=0x1f4bcb0, receiver=receiver@entry=
      0x2005b00, e=e@entry=0x205dba0) at kernel/qapplication.cpp:3737
      #15 0x00007f6670e13161 in QApplication::notify (this=0x7ffd84378b90, receiver=0x2005b00, e=0x205dba0)
      at kernel/qapplication.cpp:3687
      #16 0x00007f667043e84d in QCoreApplication::notifyInternal2 (receiver=0x2005b00, event=0x205dba0)
      --Type <return> to continue, or q <return> to quit--quit
      at kernel/qcoreapplicationQuit
      (gdb) quit

       

      Here are the events for the QDialog subclass called TestDialog:

      TestDialog::event QEvent::Type::WindowTitleChange
      TestDialog::event QEvent::Type::ChildAdded
      TestDialog::event QEvent::Type::ChildAdded
      TestDialog::event QEvent::Type::PlatformSurface
      TestDialog::event QEvent::Type::WinIdChange
      TestDialog::event QEvent::Type::WindowIconChange
      TestDialog::event QEvent::Type::Polish
      TestDialog::event QEvent::Type::ChildPolished
      TestDialog::event QEvent::Type::Move
      TestDialog::event QEvent::Type::Resize
      TestDialog::event QEvent::Type::Show    [First show event]                 
      TestDialog::event QEvent::Type::Move
      TestDialog::event QEvent::Type::CursorChange
      TestDialog::event QEvent::Type::ShowToParent
      TestDialog::event QEvent::Type::FocusIn
      TestDialog::event QEvent::Type::PolishRequest
      TestDialog::event QEvent::Type::LayoutRequest
      TestDialog::event QEvent::Type::UpdateLater
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Paint    [Paint for first show event]
      TestDialog::event QEvent::Type::WindowActivate
      TestDialog::event QEvent::Type::ActivationChange
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::Enter
      TestDialog::event QEvent::Type::Leave
      TestDialog::event QEvent::Type::Close
      TestDialog::event QEvent::Type::WindowDeactivate
      TestDialog::event QEvent::Type::ActivationChange
      TestDialog::event QEvent::Type::Hide
      TestDialog::event QEvent::Type::HideToParent
      TestDialog::event QEvent::Type::Hide
      TestDialog::event QEvent::Type::HideToParent
      TestDialog::event QEvent::Type::PlatformSurface
      TestDialog::event QEvent::Type::WinIdChange
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Show     [Second show event]
      TestDialog::event QEvent::Type::Move
      TestDialog::event QEvent::Type::PlatformSurface
      TestDialog::event QEvent::Type::ShowToParent
      TestDialog::event QEvent::Type::UpdateLater  [No paint after this until the resize]
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::WindowActivate
      TestDialog::event QEvent::Type::ActivationChange
      TestDialog::event QEvent::Type::Enter
      TestDialog::event QEvent::Type::Leave
      TestDialog::event QEvent::Type::Enter
      TestDialog::event QEvent::Type::Leave
      TestDialog::event QEvent::Type::WindowDeactivate
      TestDialog::event QEvent::Type::ActivationChange
      TestDialog::event QEvent::Type::Resize
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::Resize
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Resize
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Resize
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Resize
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Resize
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Resize
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::WindowActivate
      TestDialog::event QEvent::Type::ActivationChange
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::Enter
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Paint
      TestDialog::event QEvent::Type::UpdateRequest
      TestDialog::event QEvent::Type::Paint

       

      The configure step for the Qt-5.12.4 install

      debug="-debug"

       

      cd qt-everywhere-src-5.12.4 && ./configure -v $debug \
      -prefix $HOME/$install_dir \
      -opensource \
      -platform linux-g++ \
      -qt-xcb \
      -no-opengl \
      -confirm-license \
      -no-sql-db2 \
      -no-sql-ibase \
      -no-sql-mysql \
      -no-sql-oci \
      -no-sql-odbc \
      -no-sql-psql \
      -no-sql-sqlite \
      -no-sql-sqlite2 \
      -no-sql-tds \
      -c+std c+11 \
      -skip gamepad \
      -skip activeqt \
      -skip graphicaleffects \
      -skip wayland \
      -skip multimedia \
      -skip location \
      -skip webengine \
      -skip webglplugin \
      -skip webview \
      -skip canvas3d \
      -skip networkauth \
      -skip datavis3d \
      -skip 3d \
      -skip declarative \
      -skip sensors \
      -skip speech \
      -skip script \
      -skip scxml \
      -skip macextras \
      -skip androidextras \
      -skip quickcontrols \
      -skip quickcontrols2 \
      -skip translations \
      -skip serialbus \
      -skip serialport \
      -skip connectivity \
      -skip winextras \
      -skip purchasing \
      -no-cups && \
      make && \
      make install

       

      $ uname -a
      Linux UNKNOWN 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

       

      g++ -v
      Using built-in specs.
      COLLECT_GCC=g++
      COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper
      Target: x86_64-redhat-linux
      Configured with: ../configure -enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-4/root/usr --mandir=/opt/rh/devtoolset-4/root/usr/share/man --infodir=/opt/rh/devtoolset-4/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-default-libstdcxx-abi=gcc4-compatible --with-isl=/builddir/build/BUILD/gcc-5.3.1-20160406/obj-x86_64-redhat-linux/isl-install --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
      Thread model: posix
      gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC)

       

      Many Thanks,

      Piers

       

      Attachments

        1. configure_ouput
          92 kB
        2. TestDialog.tgz
          2 kB

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              piersa Piers August
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes