IMDTouchKnowledge BaseShop main store

How-to

How to Fix Overlapping Graphics Hiding HMI Symbols

HMI and touchscreens Published 6 min read

Short answer

Put the static background picture inside a frame container so it sits behind the process symbols, bring each symbol forward through the editor's object list, and leave the generated source alone. Assign z-values ten apart by role so new layers insert without renumbering. Stacking fixes visibility only; click handling and state-driven colors need their own runtime checks.

On this page
  1. Why the background image covers your symbols
  2. Fix the stacking inside the editor
  3. A z-order ladder with room to insert
  4. What stacking order does not fix
  5. When to stop stacking widgets
  6. Verify the screen before it ships
  7. Questions asked

An HMI symbol disappears under a background image because the designer raised the backdrop in the stacking order, the z-order: every overlapping object has a front-to-back position, and the object higher in that order draws over everything inside its rectangle. Fix it in the editable project, not in the generated source: hold the static backdrop inside a frame container at z = 0, bring each valve, pump and pipe forward through the editor's object list to z = 10 for pipes and z = 20 for instruments, and space every layer ten apart (z = 30 for text, z = 100 for popups) so later layers insert without renumbering. That repairs visibility only; click handling — check autoFillBackground on the covering widget — and state-driven colors on a QPixmap are separate mechanisms with their own runtime checks.

Why the background image covers your symbols #

Qt documents that every QWidget is rectangular and that widgets are sorted in a Z-order. When two widgets overlap, the one higher in that order covers the other across the entire shared rectangle, transparent-looking corners included, because the widget's geometry is the rectangle, not the artwork painted inside it.

The workflow that produced this fault is one-sided. In the Qt Designer workflow reported for this fault, double-clicking an entry in the object list brings that item to the foreground, and there is no matching command to push a widget behind its siblings. The moment you click the background picture to move or resize it, it rises to the front and every smaller symbol inside its rectangle vanishes. You can put the order back by editing the generated source, but the next regeneration overwrites the edit while the editor keeps showing the unusable composition, so graphical editing stops.

Decision: treat generated source as an output, never as the place where stacking lives. Repair the editable project.

Fix the stacking inside the editor #

  1. Save a working copy of the screen project together with its referenced pictures and generated source, so the screen reopens with no missing resources.
  2. Create a frame container and load the background picture into it, or move the existing picture into the frame. The frame becomes the single backdrop object and stays the lowest thing on the screen.
  3. Add every process symbol — valves, pumps, instruments, pipe segments — after the frame, so each one starts life above the backdrop.
  4. If a symbol is already buried, select it through the object list: double-clicking its entry raises it to the foreground in this workflow. Repeat for each overlapping object, diagonal pipe runs included.
  5. Exercise the overlaps: click the backdrop, then select each symbol that crosses it. Every object must stay reachable and the intended order must be restorable from inside the editor.
  6. Save, close and reopen the project. The stacking must persist with no source edit.
  7. Run the generated interface. Runtime visibility must match the saved design, and a click on a valve must reach the valve, not the backdrop.

A z-order ladder with room to insert #

Give each role one layer and space the values ten apart:

Layer Contents z-value
Backdrop static plant picture in its frame z = 0
Pipe runs line segments, crossings included z = 10
Valves, pumps, instruments state-colored symbols z = 20
Labels and live values text z = 30
Faceplates and popups transient windows z = 100

Worked example: the integers strictly between the pipe layer (z = 10) and the valve layer (z = 20) run from 11 to 19, which is 19 − 11 + 1 = 9 free slots. An instrument-bubble layer that must sit between pipes and valves takes z = 15, and nothing above or below it renumbers. With unit spacing (z = 0, z = 1, z = 2, z = 3), the integers strictly between 1 and 2 number 2 − 1 − 1 = 0, so every insertion forces renumbering of the layers above. That is the whole argument for spacing by ten.

The same ladder carries into a Qt graphics scene, where each item's z-value decides its stacking order in the scene, independent of any layout manager.

What stacking order does not fix #

Three mechanisms decide whether a process picture works, and z-order is only the first. Drawing order controls visibility. Hit testing decides which object receives a pointer action. State binding connects process data to an object's appearance. Fixing the order leaves the other two unchecked.

A visible valve can still receive no clicks if another QWidget's rectangle covers it, even where that widget looks transparent. QWidget documents an autoFillBackground property that holds whether the widget background is filled automatically; it is the first thing to check when a container paints a solid rectangle over something meant to show through. Confirm hit testing by clicking every symbol on the running screen.

A QPixmap is raster image data. Placing one on screen does not turn its pipes into independently recolorable objects. Each pipe that must change color with process state needs its own drawable element, a set of image variants switched by state, or explicit painting logic. Decision: nothing that changes state is ever baked into the backdrop.

QStackedWidget is documented as a stack in which only one widget is visible at a time. That is the right tool for alternating screens and the wrong one for overlapping process graphics.

Keep visual overlap separate from process connectivity. Two pipes that cross on screen are not necessarily joined, and decorative artwork must never intercept a command meant for a valve. Define process associations in the data behind the objects, not by which picture is on top. Driving every process state from the controller and watching the result is covered in testing HMI simulation against a live PLC.

When to stop stacking widgets #

Widget layouts arrange children by layout rules, not by pipe geometry, and an editor without z-value control turns every overlap into a fight. Commit to the switch the moment two overlapping objects must each stay individually selectable and clickable: move the process picture into a graphics scene, where items stack by z-value and crossing, non-axis-aligned pipe runs are ordinary geometry. Before building from scratch, take apart existing projects that already layer process graphics — that is the fastest way to put learning advanced HMI features from demo projects to work and to see a working ladder in practice.

Verify the screen before it ships #

Run the downloaded project on the target panel, not the designer preview. Click every symbol, force every state color, and reopen the project once more after the runtime test. Stacking faults belong to the same family as HMI text running off the screen after a project download: both are layout defects that only the running screen reveals. If the panel also hosts the controller executable, confirm it runs alongside the HMI on the same operating system.

One safety note: a symbol buried behind the backdrop can hide a running-state or alarm color from the operator, so release the screen only after every state of every object has been seen on the running system.

Questions asked

Why does clicking the background image hide every symbol under it?

Widget-based designers keep a stacking list, and selecting an item usually raises it. In the Qt Designer workflow reported for this fault, double-clicking an object-list entry brings that item to the foreground and no matching send-to-back command exists, so the raised backdrop covers everything inside its rectangle. Because every widget is rectangular, even the transparent-looking corners of the picture block the symbols beneath. Frame the backdrop and raise symbols through the list instead.

Is editing the generated source an acceptable fix?

Only as a stopgap for one running build, never as the repair. Regenerating the project overwrites your edit while the editor keeps showing the wrong composition, so graphical editing is blocked from then on. The durable fix lives in the editable project: backdrop in a frame, symbols raised through the object list, stacking order saved with the screen.

What z-values should I assign to each layer?

Space them ten apart by role: backdrop `z = 0`, pipes `z = 10`, valves and instruments `z = 20`, text `z = 30`, popups `z = 100`. Integers strictly between 10 and 20 run from 11 to 19, which is 19 minus 11 plus 1, or 9 free slots, so a new layer inserts without renumbering anything. Renumber only when a layer must drop below the backdrop itself.

The order is fixed but my pipe still will not change color. Why?

Stacking controls visibility only. A `QPixmap` is one raster image, so its pipes are not separately recolorable objects; each state-changing pipe needs its own drawable element, a set of state-switched image variants, or explicit painting logic. Bind the process state to that object and drive every state during testing, because a hidden or static color can mask a fault indication.

When should I stop using widget stacking altogether?

As soon as two overlapping objects must each stay individually selectable and clickable and your editor offers no z-value control, move the process picture to a graphics scene. Scene items are documented to carry a z-value that sets stacking order independent of any layout manager, which suits the crossing, non-axis-aligned pipe runs that widget layouts handle badly.

Keep reading

  • Selection guide

    Where WinCC Unified Runtime Can Run and Remote HMI Options

    The Unified runtime executes only on a PC, a Panel IPC, a Unified Comfort Panel or the MD-34 tablet; a browser or Sm@rtServer VNC client displays it and never replaces the host. With no PC in the cabinet, a Unified Comfort Panel is the host and the tablet browser is the client. If a safety function must travel with the operator, no Unified mobile panel exists and the design stays Comfort-based.

    HMI and touchscreens

  • Explainer

    HMI OPC UA Server vs Client: Which Direction Works

    OPC UA support on an HMI spec sheet almost always means the panel runs a server that serves its tags to external clients. Reading PLC symbols by name needs an OPC UA client driver, a separate capability you verify in the driver list for your exact software release, target and license.

    HMI and touchscreens

  • How-to

    Redownloading an HMI Project After a User Lockout

    Yes — WinCC flexible 2008 SP3 opens and converts an SP2 project, and the converted project downloads to the panel. The lockout itself only clears if you remove the failed-login limit in the project and transfer with the option that replaces user administration on the panel; a plain application download leaves the locked account in place.

    HMI and touchscreens