Hands-On Blockchain for Python Developers by Arjuna Sky Kok

Hands-On Blockchain for Python Developers by Arjuna Sky Kok

Author:Arjuna Sky Kok
Language: eng
Format: epub, pdf
Tags: COM083000 - COMPUTERS / Security / Cryptography, COM021030 - COMPUTERS / Databases / Data Mining, COM018000 - COMPUTERS / Data Processing
Publisher: Packt Publishing
Published: 2019-02-13T11:53:51+00:00


def fillPosts(self, posts):

self.clearTweetsField()

for post in posts:

label_field = QtWidgets.QLabel(post)

self.tweets_layout.addWidget(label_field)

The same strategy is used in the two following methods. We clear the bookmark widgets from the bookmarks layout by iterating them one by one and deleting the widget. Then we fill the bookmarks inside the bookmarks layout through the addWidget method. One difference between dealing with tweets and bookmarks is that we configure the label in the bookmark section so it can be selected using the mouse. The method responsible for this is the setTextInteractionFlags method.

The parameter is the current flag of the label that's masked with the Qt.TextSelectableByMouse flag. If you use this code without masking it with the previous value, label_field.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse), you can delete all current label selection configuration flags that the label widget has. Most of the time, you don't want to do that:

def clearBookmarkField(self):

while True:

label_item = self.bookmark_layout.takeAt(0)

if label_item is None:

break

else:

label_item.widget().close()



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.