开发者

Divide the application screen in Qt

开发者 https://www.devze.com 2023-02-08 05:05 出处:网络
I want to divide the application screen into parts like one part is fixed showing fixed controls & another one is variable which can be changed when user select something. Like in Qt Creator we ar

I want to divide the application screen into parts like one part is fixed showing fixed controls & another one is variable which can be changed when user select something. Like in Qt Creator we are having the left side column always fixed & the content of center screen is changing when user is selec开发者_开发知识库ting something. I have attached the screen shot. How to do it. if any one is having any idea please help me.


When you speak of the Qt Creator you certainly mean the controls on the left and right. In my opinion, the best thing to implement that are QDockWidgets. Have a look at them in the docs and as Martin said, look at the examples, they are perfect to learn each of the layout and composing issues.

QDockWidgets can be made floatable (undock them from the main window as toolboxes), they can have fixed sides to be docked on and it's easy to use them, because they can be filled with every widget you like. I often use them when I show a file explorer in an application, for example. Just look at the examples and play with it.

If you just want to have QActions visible all the time for the user, you can use a QToolBar.


You normally start with a QMainWindow and then put other toolbars, controls, widgets etc inside that.

Check out the Qt examples that come with the SDK src

0

精彩评论

暂无评论...
验证码 换一张
取 消