Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
PyQt color picker dialog which contains color picker widget.
You can either use dialog or widget.
PyQt5 >= 5.8
python -m pip install pyqt-color-picker
ColorPickerDialog
ColorPickerDialog(color=QColor(255, 255, 255), orientation='horizontal')
color
argument's type can be QColor
or str
.
orientation
argument decides the overall layout direction of the dialog. There are two values. 'horizontal'
, 'vertical'
. See layout preview below.
getColor() -> QColor
- get the color.
If you only want to use this as a part of window(not as whole dialog), use ColorPickerWidget(color=QColor(255, 255, 255), orientation='horizontal')
. See the example below.
ColorPickerWidget
colorChanged(color: QColor)
- signal. After color being changed, this will be emitted.
getCurrentColor() -> QColor
- get the current color.
Horizontal
Vertical
dialog = ColorPickerDialog()
reply = dialog.exec()
if reply == QDialog.Accepted:
color = dialog.getColor() # return type is QColor
//..
from PyQt5.QtWidgets import QMainWindow, QApplication, QHBoxLayout, QWidget, QTextEdit
from pyqt_color_picker import ColorPickerWidget
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.__initUi()
def __initUi(self):
self.__te = QTextEdit()
self.__colorPicker = ColorPickerWidget(orientation='vertical')
self.__colorPicker.colorChanged.connect(self.colorChanged) # when color has changed, call the colorChanged function
lay = QHBoxLayout()
lay.addWidget(self.__te)
lay.addWidget(self.__colorPicker)
mainWidget = QWidget()
mainWidget.setLayout(lay)
self.setCentralWidget(mainWidget)
def colorChanged(self, color):
self.__te.setStyleSheet(f'QTextEdit {{ color: {color.name()} }}')
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
ex = Window()
ex.show()
sys.exit(app.exec_())
FAQs
PyQt color picker dialog
We found that pyqt-color-picker 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.