Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
pyqt-checkbox-file-list-widget
Readme
PyQt QListWidget for files and supporting the checkbox.
The main class CheckBoxFileListWidget
inherits from both FileListWidget
(pyqt-file-list-widget) and CheckBoxListWidget
(pyqt-checkbox-list-widget).
PyQt5 >= 5.8
pyqt-file-list-widget - Parent class
pyqt-checkbox-list-widget - Parent class
getCheckedFilenames() -> list
python -m pip install pyqt-checkbox-file-list-widget
import os
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMainWindow, QCheckBox, QHBoxLayout, \
QVBoxLayout, QWidget, QApplication, QPushButton
from pyqt_checkbox_file_list_widget import CheckBoxFileListWidget
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.__initUi()
def __initUi(self):
allChkBox = QCheckBox('Check all')
showFilesNameOnlyChkBox = QCheckBox('Show files name only')
self.__listWidget = CheckBoxFileListWidget()
self.__listWidget.setFilenames([os.path.join(os.getcwd(), filename) for filename in os.listdir(os.getcwd())])
allChkBox.stateChanged.connect(self.__listWidget.toggleState)
showFilesNameOnlyChkBox.stateChanged.connect(self.__listWidget.setFilenameOnly)
lay = QHBoxLayout()
lay.setAlignment(Qt.AlignLeft)
lay.addWidget(allChkBox)
lay.addWidget(showFilesNameOnlyChkBox)
lay.setContentsMargins(0, 0, 0, 0)
topLeftWidget = QWidget()
topLeftWidget.setLayout(lay)
self.__deleteBtn = QPushButton('Delete')
self.__deleteBtn.clicked.connect(self.__delete)
lay = QHBoxLayout()
lay.setAlignment(Qt.AlignRight)
lay.addWidget(self.__deleteBtn)
lay.setContentsMargins(0, 0, 0, 0)
topRightWidget = QWidget()
topRightWidget.setLayout(lay)
lay = QHBoxLayout()
lay.addWidget(topLeftWidget)
lay.addWidget(topRightWidget)
lay.setContentsMargins(0, 0, 0, 0)
topWidget = QWidget()
topWidget.setLayout(lay)
lay = QVBoxLayout()
lay.addWidget(topWidget)
lay.addWidget(self.__listWidget)
mainWidget = QWidget()
mainWidget.setLayout(lay)
self.setCentralWidget(mainWidget)
def __delete(self):
self.__listWidget.removeCheckedRows()
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
htmlViewer = MainWindow()
htmlViewer.show()
app.exec_()
Result
FAQs
PyQt QListWidget for files and supporting the checkbox
We found that pyqt-checkbox-file-list-widget demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.