Bug report #20371

messageBar() messages getting lost/capped at 22

Added by Jonathan Willitts about 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:GUI
Affected QGIS version:3.4.1 Regression?:Yes
Operating System:Windows 10 (64 bit) Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:28191

Description

It seems in the latest release, the maximum number of messageBar() messages that the GUI can handle is 22 (i.e. the one being displayed, plus "21 more").

Other messages just seem to go missing.

To replicate the issue:

  1. Load QGIS 3.4.1
  2. Open Python console (Ctrl + Alt + P)
  3. Type the following:
for i in range(25):
    iface.messageBar().pushMessage("Error", f"I'm sorry Dave, I'm afraid I can't do that {i}", level=Qgis.Critical, duration=0)

You will see messages appear in the message bar at the top, in the following order:

Error: I'm sorry Dave, I'm afraid I can't do that 24
Error: I'm sorry Dave, I'm afraid I can't do that 23
Error: I'm sorry Dave, I'm afraid I can't do that 19
Error: I'm sorry Dave, I'm afraid I can't do that 18
...
Error: I'm sorry Dave, I'm afraid I can't do that 2
Error: I'm sorry Dave, I'm afraid I can't do that 1
Error: I'm sorry Dave, I'm afraid I can't do that 0

i.e. messages 22, 21 and 20 are lost/missing

Note: this worked fine in QGIS 3.2.3

History

#2 Updated by Jonathan Willitts about 6 years ago

  • Status changed from Open to Closed

Ah, so not a bug, but a feature!

I couldn't see anything in the docs, so thanks for the pointer.

Also available in: Atom PDF