What is Z-order ?

  • I'm trying to understand how to read Qt documentation.
    I'm reading the QWidget section and i don't understand the part when they say : Z-order ...?
    Here is the extract :

    Every widget is rectangular, and they are sorted in a Z-order. A widget is clipped by its parent and by the widgets in front of it.

    Thks in advance, any help would be appreciated!

  • Widgets can be placed on top of each other.
    See Wikipedia for a definition of "z-order":http://en.wikipedia.org/wiki/Z-order

  • Moderators

    Basically it comes from a 3 dimensional axis naming convention. left/right position is the X coordinate, top/bottom is the Y coordinate and depth (closer/farther) is Z coordinate.

  • As the others said, the Z coordinates represent the position of an object in terms of depth. When two windows are on top of each other, the window with a higher Z value will be placed on top of the other one, thus masking a part of it (or maybe entirely).

  • Great explanations, understand well now, thks all :) .(it reminds me now the z-index in html which is also about how the elements are arranged in terms of depth).

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.