QT--窗口设置Z方向的层叠顺序
方法1:在ui 文件中设置
在UI文件中,设置Z方向的层叠顺序,只能将窗口放到其父窗口的最上面,或者放到父窗口的最下面。
见下图

方法2:在cpp中通过代码实现(Qt自带API)
(1)将窗口置顶
void QWidget::raise()
[slot] void QWidget::raise()
Raises this widget to the top of the parent widget’s stack.
After this call the widget will be visually in front of any overlapping sibling widgets.
Note: When using activateWindow(), you can call this function to ensure that the window is stacked on top.
(2)将窗口放到最底层
void QWidget::lower()
[slot] void QWidget::lower()
Lowers the widget to the bottom of the parent widget’s stack.
After this call the widget will be visually behind (and therefore obscured by) any overlapping sibling widgets.
(3)将窗口放


2247

被折叠的 条评论
为什么被折叠?



