【qt5基础---堆栈与目录列表】简洁的电子书qt5框架设计

实现目录与多行文本控件的链接

此案例可以实现电子书框架设计。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
源代码展示

import sys
from PyQt5.QtWidgets import *
class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.resize(400,300)
        self.initUi()
    #增加目录列表---姓名,班级,考号,每一行数据对应一个索引i
    def initUi(self):
        listWidget = QListWidget()
        listWidget.setMaximumWidth(80)
        listWidget.insertItem(0,'姓名')
        listWidget.insertItem(1, '班级')
        listWidget.insertItem(2, '考号')
        
        # 点击当前目录列表项连接到对应项多行文本控件所在的槽函数,点击对应项发出数据当前行索引,i
        listWidget.currentRowChanged.connect(self.cRChanged)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
For some time I have wanted to write a Qt book that covered topics that were too advanced for C++ GUI Programming with Qt 4,★ even though that book itself has proved quite challenging for some readers. There is also some specialized material—not all of it difficult—that I wanted to cover that simply does not belong in a first book on Qt programming. Furthermore, in view of the sheer size of Qt, no one book can possibly do justice to all that it offers, so there was clearly room for the presentation of new material. What I’ve done in this book is to take a selection of modules and classes from a variety of areas and shown how to make good use of them. The topics chosen reflect both my own interests and also those that seem to result in the most discussion on the qt-interest mailing list. Some of the topics are not covered in any other book, while other topics cover more familiar ground—for example, model/view programming. In all cases, I have tried to provide more comprehensive coverage than is available elsewhere. So the purposes of this book are to help Qt programmers deepen and broaden their Qt knowledge and to increase the repertoire of what they can achieve using Qt. The “advanced” aspect often refers more to what you will be able to achieve than to the means of achieving it. This is because—as always—Qt insulates us as far as possible from irrelevant detail and underlying complexity to provide easy-to-use APIs that we can use simply and directly to great effect. For example, we will see how to create a music player without having to know anything about how things work under the hood; we will need to know only the high-level API that Qt provides. On the other hand, even using the high-level QtConcurrent module, the coverage of threading is necessarily challenging. This book assumes that readers have a basic competence in C++ programming, and at least know how to create basic Qt applications—for example, having read a good Qt 4 book, and having had some practical

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值