Bug report #15495

qt5: QGIS freezes upon project loading, renders all composer map item caches

Added by Mathieu Pellerin - nIRV about 3 years ago. Updated about 2 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Unknown
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23419

Description

When QGIS is compiled against Qt5, there's an issue whereas the interface freezes upon project load due to QGIS rendering all composer(s)' map item(s)' cache. This makes big projects over here freeze QGIS for 10sec.

I somehow remembers a similar freeze way back a few years ago which was fixed. Seems whatever got fixed then doesn't work for Qt5.

It'd be good to address the cause of this, nowadays it's pretty much the only UI regression under Qt5 :) (wouhou!)

output.txt Magnifier (313 KB) Mathieu Pellerin - nIRV, 2016-08-29 03:16 AM

Associated revisions

Revision 08f5ae67
Added by Mathieu Pellerin - nIRV about 3 years ago

Remove composer window visibiliy state restoration upon project load
(fixes #15495)

Revision 7a8ab407
Added by Nyall Dawson about 3 years ago

Merge pull request #3440 from nirvn/qt5_fix_freeze

Remove composer window visibiliy state restoration upon project load (fixes #15495)

History

#1 Updated by Mathieu Pellerin - nIRV about 3 years ago

Attaching the debugging log QGIS outputs while loading a large project that freezes on initial rendering. All data sources are OGR driver based.

#2 Updated by Mathieu Pellerin - nIRV about 3 years ago

  • Subject changed from qt5: the initial canvas rendering upon project load freezes QGIS to qt5: QGIS freezes upon project loading, renders all composer map item caches

#3 Updated by Mathieu Pellerin - nIRV about 3 years ago

Note: the freeze occurs irrespective of whether the composer windows are open upon project load, or not. If a composer window is open, it makes sense for the cache to build, but if the window is closed, it should not.

#4 Updated by Mathieu Pellerin - nIRV about 3 years ago

After spending the morning debugging this issue, I've spotted the issue: under Qt5, closing a QMainWindow will reset its WindowState to Qt::WindowNoState value (whereas Qt4 would not do that). This would accidentally trigger another part of the code that renders a given composer's map item cache when it detects a window state change from minimized to non-minimized (which, under Qt4 would occur only when a user opens the window).

I've discussed this with Nyall over the morning. The solution we agreed upon is to disable the composer window visibility (i.e. the show() / close() calls when loading the composer from a project file) to be able to keep deferring map item cache rendering while preventing a Qt5 freeze.

#5 Updated by Nyall Dawson about 3 years ago

  • Status changed from Open to Closed

#6 Updated by Jürgen Fischer about 2 years ago

  • Category set to Unknown

Also available in: Atom PDF