当前位置:网站首页>基于Pyqt5工具栏按钮可实现界面切换-1
基于Pyqt5工具栏按钮可实现界面切换-1
2022-07-02 22:13:00 【疯狂的豆包】
Pyqt5是Python中一个可视化超级好用的库,接下来就跟着一起看一下如何实现工具栏按钮切换界面。
1. 本文使用了Qt Designer工具,如何添加该工具,这里就不详细介绍,不懂的同学可自行搜索。首先打开界面后,“新建窗体”选择"Main Window",点击创建,界面如下,当然大家也可以调整属性,这里也不详细介绍了。
2. 在MainWindow窗体下,右键,可添加工具栏。
3. 在右边动作编辑器里点击“新建动作”,在“文本”里输入“打开界面1” ,同样操作,在“文本”里输入“打开界面2”,这样在动作编辑器会生成action_1和action_2。
4. 在动作编辑里,左键选中action_1,移动到工具栏中,松开左键,打开界面1就会自动添加到工具栏中,同样动作操作打开界面2。
5. 左键选中“Widget”,移动到主界面中,自动添加,设置颜色为黄色,为界面1。同样的动作操作界面2,设置颜色为蓝色。
到此保存该窗体为mainwindow.ui,下一章介绍代码实现。不要走开,经常继续。
边栏推荐
- Doorplate making C language
- Explain promise usage in detail
- 深度剖析数据在内存中的存储----C语言篇
- 20220524_ Database process_ Statement retention
- Prometheus deployment
- Use the scroll bar of souI when using the real window in souI
- Jerry's built-in short press and long press, no matter how long it is, it is a short press [chapter]
- Use of recyclerview with viewbinding
- Construction of Hisilicon 3559 universal platform: draw a frame on the captured YUV image
- 【Redis笔记】压缩列表(ziplist)
猜你喜欢
BBR 遭遇 CUBIC
FOC矢量控制及BLDC控制中的端电压、相电压、线电压等概念别还傻傻分不清楚
Compose 中的 'ViewPager' 详解 | 开发者说·DTalk
golang入门:for...range修改切片中元素的值的另类方法
Looking at Ctrip's toughness and vision from the Q1 financial report in 2022
[hardware] origin of standard resistance value
景联文科技低价策略帮助AI企业降低模型训练成本
BBR encounters cubic
MySQL queries nearby data And sort by distance
Eight honors and eight disgraces of the programmer version~
随机推荐
@BindsInstance在Dagger2中怎么使用
[favorite poems] OK, song
Doorplate making C language
SQL进阶语法
xshell配置xforward转发火狐浏览器
Construction of Hisilicon 3559 universal platform: draw a frame on the captured YUV image
地平线2022年4月最新方案介绍
高数有多难?AI 卷到数学圈,高数考试正确率 81%!
Boost库链接错误解决方案
CDN 加速,需要域名先备案
Win11系统explorer频繁卡死无响应的三种解决方法
Motivation du Protocole de chiffrement avancé AES
Win11麦克风测试在哪里?Win11测试麦克风的方法
Editor Caton
Chow-Liu Tree
Win11启用粘滞键关闭不了怎么办?粘滞键取消了但不管用怎么解决
“一个优秀程序员可抵五个普通程序员!”
Niuke network: maximum submatrix
Value sequence < detailed explanation of daily question >
golang中new与make的区别