
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
PyQt "select the font" dialog and widget
PyQt5 >= 5.8
python -m pip install pyqt-font-dialog
FontDialog(font: QFont = QFont('Arial', 10), title='Font')
- font is font, title is title of the dialog.
getFont()
- get the selected font.FontWidget(font: QFont = QFont('Arial', 10))
fontChanged(QFont)
- When current font item is changed, this will be emitted.
getFont()
- get the selected font.
dialog = FontDialog(textEdit.currentFont())
reply = dialog.exec()
if reply == QDialog.Accepted:
textEdit.setCurrentFont(dialog.getFont())
from PyQt5.QtWidgets import QMainWindow, QApplication, QHBoxLayout, QWidget, QTextEdit
from pyqt_font_dialog.fontWidget import FontWidget
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.__initUi()
def __initUi(self):
self.__te = QTextEdit()
fontWidget = FontWidget()
fontWidget.fontChanged.connect(self.fontChanged)
lay = QHBoxLayout()
lay.addWidget(self.__te)
lay.addWidget(fontWidget)
mainWidget = QWidget()
mainWidget.setLayout(lay)
self.setCentralWidget(mainWidget)
def fontChanged(self, font):
self.__te.selectAll()
self.__te.setFont(font)
cur = self.__te.textCursor()
cur.clearSelection()
self.__te.setTextCursor(cur)
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
ex = Window()
ex.show()
sys.exit(app.exec_())
FAQs
PyQt font dialog and widget
We found that pyqt-font-dialog 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.