How to place one widget over another in Qt

亡梦爱人 提交于 2019-12-22 03:48:43

问题


i have a window in Qt, on that i am drawing a picture. now i want to place the progressbar over it. how can i do that?..

steps i am following to do

  1. Create a window,

  2. Draw picture in paint event of window

  3. Then create QGridLayout layout, add your window

  4. Display over it.

suppose i want to add progress bar, over a portion of picture window. how can i do that

i dont think its possible to implement in window paint event.

please assist me

Thanks


回答1:


You can add the progress bar as child of your QWidget without adding it in the layout. This will draw the QProgressBar into the QWidget. Since you are not using the layout you will have to manually manage the position of the QProgressBar.




回答2:


I think that just adding a progress bar widget to your grid layout should work.



来源:https://stackoverflow.com/questions/2295900/how-to-place-one-widget-over-another-in-qt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!