当前位置:网站首页>基于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,下一章介绍代码实现。不要走开,经常继续。
边栏推荐
- Generics and reflection, this is enough
- Redis expiration policy +conf record
- Learning Websites commonly used by circuit designers
- 编辑卡顿
- Use of recyclerview with viewbinding
- LINQ usage collection in C #
- Is 408 not fragrant? The number of universities taking the 408 examination this year has basically not increased!
- RecyclerView结合ViewBinding的使用
- 聊聊内存模型与内存序
- AES高級加密協議的動機闡述
猜你喜欢

Jinglianwen technology's low price strategy helps AI enterprises reduce model training costs

Construction of Hisilicon 3559 universal platform: rotation operation on the captured YUV image

Li Kou brush questions (2022-6-28)

Catalogue of digital image processing experiments

面试过了,起薪16k

Chow-Liu Tree

RecyclerView结合ViewBinding的使用

AES高級加密協議的動機闡述
![[adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)](/img/a3/d8421ea1539eba08bf7a5a629d92e6.jpg)
[adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)

高数有多难?AI 卷到数学圈,高数考试正确率 81%!
随机推荐
Win11自动关机设置在哪?Win11设置自动关机的两种方法
MarkDown基本语法
Cryptographic technology -- key and ssl/tls
Looking at Ctrip's toughness and vision from the Q1 financial report in 2022
Loss function~
Is 408 not fragrant? The number of universities taking the 408 examination this year has basically not increased!
程序员版本的八荣八耻~
LC173. 二叉搜索树迭代器
Methods to solve the tampering of Chrome browser and edeg browser homepage
[hardware] origin of standard resistance value
Jerry's built-in short press and long press, no matter how long it is, it is a short press [chapter]
Quantitative analysis of PSNR, SSIM and RMSE
实现BottomNavigationView和Navigation联动
景联文科技低价策略帮助AI企业降低模型训练成本
Getting started with golang: for Range an alternative method of modifying the values of elements in slices
Easyclick, EC Quanlang network verification source code
AES高级加密协议的动机阐述
ServletContext learning diary 1
Successfully changed Splunk default URL root path
20220527_数据库过程_语句留档