How to bring QtWidget in front of other QtWIdget?

607 views Asked by At

I have three independent QtWidget, there is parent child relation between them. I am displaying them in below order.

firstWidget.show();
SecondtWidget.show();
ThirdWidget.show();

In second widget I am loading a jar which is basically a black screen. So sometimes due to slowness in the system jar takes time to load which causes thirdwidget to go behind to the second widget.

Is there any way in Qt where no matter what is the order of showing the Widgets, a particular widget in my case thirdWidget is always on top.

I have already tried raise, activateWidow, setFocus, requestActiveWindow, SetWindowState and Window flags but nothing seems to work in my case.

Any help would be much appreciated.

1

There are 1 answers

1
ΦXocę 웃 Пepeúpa ツ On

is kind of hard because you dont get the info when the jar loading process is done

but supposing you know that, then you can bring a widget to the top by raising it :)

from the doc:

After this call the widget will be visually in front of any overlapping sibling widgets.

which is actually what you need... https://doc.qt.io/qt-5/qwidget.html#raise