https://bugs.kde.org/show_bug.cgi?id=426698

--- Comment #9 from David Hurka <david.hu...@mailbox.org> ---
>From qscroller.cpp, I can tell:

prepareScrolling() is called with QPointF().
setDpiFromWidget() is called with `target`, i. e. our PageView widget.

> void QScrollerPrivate::setDpiFromWidget(QWidget *widget)
> {
>     const QScreen *screen = widget ? widget->screen() : 
> QGuiApplication::primaryScreen();
>     Q_ASSERT(screen);
>     setDpi(QPointF(screen->physicalDotsPerInchX(), 
> screen->physicalDotsPerInchY()));
> }

This means either widget->screen() or QGuiApplication::primaryScreen() must
have returned 0x200000000. From reading QWidget code, I have no idea where that
could have happened. There appears to be a QTLWExtra object with a window
member of type QWidgetWindow*, and that must have been written with
0x20x200000000 probably...

This is my backtrace when I break on setDpiFromWidget():

> Thread 1 "okular" hit Breakpoint 2, QScrollerPrivate::setDpiFromWidget 
> (this=this@entry=0x555555868680, widget=0x5555557c5750) at 
> util/qscroller.cpp:1033
> 1033    in util/qscroller.cpp
> (gdb) bt
> #0  QScrollerPrivate::setDpiFromWidget (this=this@entry=0x555555868680, 
> widget=0x5555557c5750) at util/qscroller.cpp:1033
> #1  0x00007ffff760cbcc in QScrollerPrivate::prepareScrolling 
> (this=this@entry=0x555555868680, position=...) at util/qscroller.cpp:1431
> #2  0x00007ffff760e0bf in QScroller::scrollTo (this=0x55555582d210, pos=..., 
> scrollTime=0) at ../../include/QtCore/../../src/corelib/tools/qpoint.h:289
> #3  0x00007ffff03971e3 in PageView::scrollTo (this=0x5555558491b0, x=-1, 
> y=21, smoothMove=false) at ../ui/pageview.cpp:4018
> #4  0x00007ffff03970a6 in PageView::center (this=0x5555558491b0, cx=620, 
> cy=380, smoothMove=false) at ../ui/pageview.cpp:4002
> #5  0x00007ffff0399352 in PageView::slotRelayoutPages (this=0x5555558491b0) 
> at ../ui/pageview.cpp:4307
> #6  0x00007ffff029a1c5 in PageView::qt_static_metacall (_o=0x5555558491b0, 
> _c=QMetaObject::InvokeMetaMethod, _id=17, _a=0x55555603af18) at 
> okularpart_autogen/UYX5XTB5RZ/moc_pageview.cpp:342
> #7  0x00007ffff66c9129 in QObject::event (this=this@entry=0x5555558491b0, 
> e=e@entry=0x55555603aed0) at kernel/qobject.cpp:1314
> #8  0x00007ffff72b4d5d in QWidget::event (this=this@entry=0x5555558491b0, 
> event=event@entry=0x55555603aed0) at kernel/qwidget.cpp:9088
> #9  0x00007ffff7365062 in QFrame::event (this=this@entry=0x5555558491b0, 
> e=e@entry=0x55555603aed0) at widgets/qframe.cpp:550
> #10 0x00007ffff7367da9 in QAbstractScrollArea::event (this=0x5555558491b0, 
> e=0x55555603aed0) at widgets/qabstractscrollarea.cpp:1042
> #11 0x00007ffff038770a in PageView::event (this=0x5555558491b0, 
> event=0x55555603aed0) at ../ui/pageview.cpp:1543
> #12 0x00007ffff7271cc3 in QApplicationPrivate::notify_helper 
> (this=this@entry=0x5555555abcd0, receiver=receiver@entry=0x5555558491b0, 
> e=e@entry=0x55555603aed0) at kernel/qapplication.cpp:3671
> #13 0x00007ffff727ac70 in QApplication::notify (this=0x7fffffffdbe0, 
> receiver=0x5555558491b0, e=0x55555603aed0) at kernel/qapplication.cpp:3417
> #14 0x00007ffff669b6aa in QCoreApplication::notifyInternal2 
> (receiver=0x5555558491b0, event=0x55555603aed0) at 
> ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
> #15 0x00007ffff669dfa1 in QCoreApplicationPrivate::sendPostedEvents 
> (receiver=0x0, event_type=0, data=0x5555555a2b20) at 
> kernel/qcoreapplication.cpp:1815
> #16 0x00007ffff66f6837 in postEventSourceDispatch (s=0x555555613080) at 
> kernel/qeventdispatcher_glib.cpp:277
> #17 0x00007ffff4d67fbd in g_main_context_dispatch () from 
> /lib/x86_64-linux-gnu/libglib-2.0.so.0                                        
>                                     
> #18 0x00007ffff4d68240 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #19 0x00007ffff4d682e3 in g_main_context_iteration () from 
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #20 0x00007ffff66f5e92 in QEventDispatcherGlib::processEvents 
> (this=0x555555619bb0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
> #21 0x00007ffff669a1bb in QEventLoop::exec (this=this@entry=0x7fffffffdb10, 
> flags=..., flags@entry=...) at 
> ../../include/QtCore/../../src/corelib/global/qflags.h:141
> #22 0x00007ffff66a2354 in QCoreApplication::exec () at 
> ../../include/QtCore/../../src/corelib/global/qflags.h:121
> #23 0x000055555556578a in main (argc=1, argv=0x7fffffffdd08) at 
> ../shell/main.cpp:109

The delivered event is of type QEvent::MetaCall. The breakpoint triggered when
I launched Okular and then opened a document using “Open...”. It already shows
the “Loaded a 2-page document.” message in the corner.

Of course this breakpoint triggers more often, with every call to scrollTo().
But the other backtraces don’t say anything more (which I can see).

My conclusion is that this is probably a bug in Qt.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to