当前位置:网站首页>基于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,下一章介绍代码实现。不要走开,经常继续。
边栏推荐
- STM32串口DAM接收253字节就死机原因排查
- 损失函数~
- Niuke network: maximum submatrix
- Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月1日08:43:06
- Start from the bottom structure to learn the customization and testing of FPGA --- Xilinx ROM IP
- 深度剖析数据在内存中的存储----C语言篇
- Jerry's fast touch does not respond [chapter]
- Strictly abide by the construction period and ensure the quality, this AI data annotation company has done it!
- Numerical solution of partial differential equations with MATLAB
- Hisilicon VI access video process
猜你喜欢

Getting started with golang: for Range an alternative method of modifying the values of elements in slices

详解Promise使用
![[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM](/img/5d/c23ec16df6ce8d78207b635f59dc20.png)
[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM

The first batch of Tencent cloud completed the first cloud native security maturity assessment in China
![[hardware] origin of standard resistance value](/img/d1/b9184c508d363eb0fa018ea6a57a10.png)
[hardware] origin of standard resistance value

Win11自动关机设置在哪?Win11设置自动关机的两种方法

“一个优秀程序员可抵五个普通程序员!”

STM32之ADC

Hisilicon VI access video process

Detailed explanation and application of merging and sorting
随机推荐
在SOUI里使用真窗口时使用SOUI的滚动条
潘多拉 IOT 开发板学习(HAL 库)—— 实验3 按键输入实验(学习笔记)
STM32串口DAM接收253字节就死机原因排查
Jericho's thimble reaction when directly touching the prototype is abnormal [chapter]
Lambda expression: an article takes you through
【Redis笔记】压缩列表(ziplist)
实现BottomNavigationView和Navigation联动
China Academy of information technology, Tsinghua University, Tencent security, cloud native security, industry university research and use strong alliance!
Talk about memory model and memory order
从底层结构开始学习FPGA----Xilinx ROM IP的定制与测试
损失函数~
密码技术---密钥和SSL/TLS
Pandora IOT development board learning (HAL Library) - Experiment 4 serial port communication experiment (learning notes)
电路设计者常用的学习网站
Antd component upload uploads xlsx files and reads the contents of the files
Methods to solve the tampering of Chrome browser and edeg browser homepage
ServletContext learning diary 1
20220524_ Database process_ Statement retention
【Proteus仿真】51单片机+LCD12864推箱子游戏
Catalogue of digital image processing experiments