Test bridge: modal popup toggles, argument marshalling, and duplicate objectNames #911

Open
opened 2026-09-18 17:50:37 +00:00 by epicleafies · 0 comments
epicleafies commented 2026-09-18 17:50:37 +00:00 (Migrated from github.com)

Three bridge limitations that force workarounds or leave flows without functional-test coverage (qml/test/testbridge.cpp):

  1. Clicking a modal popup's own toggle button reopens it (Qt < 6.8). The synthesized press lands on the modal overlay, which closes the popup and swallows the click; the fallback then emits clicked() raw, whose handler sees opened == false and reopens. Since the bridge bypasses modality afterwards, the popup floats over unrelated pages and poisons later reads. Possible fix: skip the raw-signal fallback when the synthesized press dismissed a modal popup. Test-side workaround meanwhile: close with invoke(popup, "close").
  2. invoke marshals at most one string argument, so bool property setters (AddressListModel::setShowUsed) and multi-argument invokables (setAddressLabel) cannot be driven. A JSON array mapped to bool/int/double/string parameters would cover them.
  3. Pushed page instances share one objectName during StackView transitions, so findObjectByName can resolve the outgoing instance: a property read right after navigation returned the previous page's value. Prefer the visible/topmost match, or add an instance discriminator.
Three bridge limitations that force workarounds or leave flows without functional-test coverage (qml/test/testbridge.cpp): 1. Clicking a modal popup's own toggle button reopens it (Qt < 6.8). The synthesized press lands on the modal overlay, which closes the popup and swallows the click; the fallback then emits clicked() raw, whose handler sees opened == false and reopens. Since the bridge bypasses modality afterwards, the popup floats over unrelated pages and poisons later reads. Possible fix: skip the raw-signal fallback when the synthesized press dismissed a modal popup. Test-side workaround meanwhile: close with invoke(popup, "close"). 2. invoke marshals at most one string argument, so bool property setters (AddressListModel::setShowUsed) and multi-argument invokables (setAddressLabel) cannot be driven. A JSON array mapped to bool/int/double/string parameters would cover them. 3. Pushed page instances share one objectName during StackView transitions, so findObjectByName can resolve the outgoing instance: a property read right after navigation returned the previous page's value. Prefer the visible/topmost match, or add an instance discriminator.
Sign in to join this conversation.
No description provided.