在PYQT5中QscrollArea(滚动条)的使用方法
2019-06-14 20:42
1086 查看
如下所示:
import sys from PyQt5.QtWidgets import * class MainWindow(QMainWindow): def __init__(self,): super(QMainWindow,self).__init__() self.number = 0 w = QWidget() self.setCentralWidget(w) self.topFiller = QWidget() self.topFiller.setMinimumSize(250, 2000)#######设置滚动条的尺寸 for filename in range(20): self.MapButton = QPushButton(self.topFiller) self.MapButton.setText(str(filename)) self.MapButton.move(10,filename*40) ##创建一个滚动条 self.scroll = QScrollArea() self.scroll.setWidget(self.topFiller) self.vbox = QVBoxLayout() self.vbox.addWidget(self.scroll) w.setLayout(self.vbox) self.statusBar().showMessage("底部信息栏") self.resize(300, 500) if __name__ == "__main__": app = QApplication(sys.argv) mainwindow = MainWindow() mainwindow.show() sys.exit(app.exec_())
出来的效果
以上这篇在PYQT5中QscrollArea(滚动条)的使用方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- MFC中把viewl类的基类由CView转换成CScrollView,使用滚动条的方法
- 使用jQuery的animate()方法让滚动条滚动到指定的位置,同时设置滚动的速度
- 使用winpe安装系统后不能进入滚动条的方法
- DevExpress的GridControl中自定义列中使用RadioButton在拉动滚动条后数据丢失的解决方法
- 使用 Selenium 将滚动条移动到目标元素位置的方法
- 使用CSS设置滚动条样式以及如何去掉滚动条的方法
- android中关于使用scrollview嵌套LinearLayout,页面滚动条不到底的解决方法
- jquery滚动条插件slimScroll的使用方法总结
- Android WebApp无法使用ScrollTo等方法控制滚动条位置
- jQuery 自定义网页滚动条样式插件 mCustomScrollbar 的介绍和使用方法
- jQuery使用scrollTop获取div标签的滚动条已滚动高度(jQuery版本1.6+时,用prop()方法代替attr()方法)
- Android学习笔记十四:Android TextView的append方法与滚动条同时使用
- jQuery 自定义网页滚动条样式插件 mCustomScrollbar 的介绍和使用方法
- DIV滚动条使用方法
- 在.net 2.0中使用iframe并且控制不出现横向的滚动条的方法
- 使用框架framset在IE6出现横向滚动条的解决方法
- jQuery 自定义网页滚动条样式插件 mCustomScrollbar 的介绍和使用方法(转)
- jQuery 自定义网页滚动条样式插件 mCustomScrollbar 的介绍和使用方法
- Android TextView的append方法与滚动条同时使用
- jQuery 自定义网页滚动条样式插件 mCustomScrollbar 的介绍和使用方法