QStackedWidget - 一页一页的换页 [英] QStackedWidget - Change page one by one

查看:64
本文介绍了QStackedWidget - 一页一页的换页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在不指定实际索引的情况下更改 QStackedWidget 的页面.

Is there a way to change the page of a QStackedWidget without appointing to the actual index.

self.homeb.clicked.connect(lambda: self.stackedWidget.setCurrentIndex(0))

因此,我想通过它们导航而不是仅使用按钮直接转到指定的索引 0,我的目的是创建下一个"、上一个"主页"功能.

So instead of just using a button to go directly to the appointed index 0, I want to navigate through them, my intentions are to create a "next", "previous" "home" function.

推荐答案

 self.homeb_3.clicked.connect(lambda: self.stackedWidget.setCurrentIndex(self.stackedWidget.currentIndex() + 1))

这篇关于QStackedWidget - 一页一页的换页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆