questions.py 文件源码

python
阅读 110 收藏 0 点赞 0 评论 0

项目:well-being-diary 作者: SunyataZero 项目源码 文件源码
def __init__(self):
        super().__init__()

        self.show_archived_questions_bool = False

        self.last_entry_clicked_id_int = wbd.wbd_global.NO_ACTIVE_QUESTION_INT

        vbox_l2 = QtWidgets.QVBoxLayout()
        self.setLayout(vbox_l2)

        # Creating widgets
        # ..for ten practices (left column)
        ##habits_label = QtWidgets.QLabel("<h3>Journals</h3>")
        ##vbox_l2.addWidget(habits_label)
        self.list_widget = QtWidgets.QListWidget()
        ###self.list_widget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
        vbox_l2.addWidget(self.list_widget)
        self.list_widget.currentRowChanged.connect(self.on_current_row_changed)
        ###self.list_widget.itemPressed.connect(self.on_item_selection_changed)
        # -itemClicked didn't work, unknown why (it worked on the first click but never when running in debug mode)
        # -currentItemChanged cannot be used here since it is activated before the list of selected items is updated
        # ..for adding a new question
        hbox_l3 = QtWidgets.QHBoxLayout()
        vbox_l2.addLayout(hbox_l3)
        self.adding_new_practice_qle = QtWidgets.QLineEdit()
        self.adding_new_practice_qle.setPlaceholderText("New question")
        hbox_l3.addWidget(self.adding_new_practice_qle)
        self.adding_new_practice_bn = QtWidgets.QPushButton("Add")
        hbox_l3.addWidget(self.adding_new_practice_bn)
        self.adding_new_practice_bn.clicked.connect(self.on_add_new_practice_button_pressed)

        hbox_l3 = QtWidgets.QHBoxLayout()
        vbox_l2.addLayout(hbox_l3)
        self.show_archived_qpb = QtWidgets.QPushButton("Show archived")
        hbox_l3.addWidget(self.show_archived_qpb)
        self.show_archived_qpb.setCheckable(True)
        self.show_archived_qpb.toggled.connect(self.on_show_archived_button_toggled)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号