本文整理汇总了Python中PyQt5.QtCore.Qt.white方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.white方法的具体用法?Python Qt.white怎么用?Python Qt.white使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.white方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def __init__(self):
QtWidgets.QWidget.__init__(self)
uic.loadUi("window.ui", self)
self.scene = Scene(0, 0, 561, 581)
self.scene.win = self
self.view.setScene(self.scene)
self.image = QImage(561, 581, QImage.Format_ARGB32_Premultiplied)
self.image.fill(Qt.white)
self.bars.clicked.connect(lambda : set_bars(self))
self.erase.clicked.connect(lambda: clean_all(self))
self.paint.clicked.connect(lambda: clipping(self))
self.rect.clicked.connect(lambda: set_rect(self))
self.ect.clicked.connect(lambda: add_bars(self))
self.lines = []
self.clip = None
self.point_now = None
self.input_bars = False
self.input_rect = False
self.pen = QPen(red)
示例2: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def __init__(self):
QtWidgets.QWidget.__init__(self)
uic.loadUi("window.ui", self)
self.scene = Scene(0, 0, 561, 581)
self.scene.win = self
self.view.setScene(self.scene)
self.image = QImage(561, 581, QImage.Format_ARGB32_Premultiplied)
self.image.fill(Qt.white)
self.bars.clicked.connect(lambda : set_bars(self))
self.erase.clicked.connect(lambda: clean_all(self))
self.paint.clicked.connect(lambda: clipping(self))
self.rect.clicked.connect(lambda: set_rect(self))
self.ect.clicked.connect(lambda: add_bars(self))
self.lock.clicked.connect(lambda: lock(self))
self.lines = []
self.edges = []
self.clip = None
self.point_now_rect = None
self.point_now_bars = None
self.point_lock = None
self.input_bars = False
self.input_rect = False
self.pen = QPen(black)
示例3: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def __init__(self):
QtWidgets.QWidget.__init__(self)
uic.loadUi("window.ui", self)
self.scene = QtWidgets.QGraphicsScene(0, 0, 511, 511)
self.mainview.setScene(self.scene)
self.image = QImage(511, 511, QImage.Format_ARGB32_Premultiplied)
self.pen = QPen()
self.color_line = QColor(Qt.black)
self.color_bground = QColor(Qt.white)
self.draw_once.clicked.connect(lambda: draw_once(self))
self.clean_all.clicked.connect(lambda: clear_all(self))
self.btn_bground.clicked.connect(lambda: get_color_bground(self))
self.btn_line.clicked.connect(lambda: get_color_line(self))
self.draw_centr.clicked.connect(lambda: draw_centr(self))
layout = QtWidgets.QHBoxLayout()
layout.addWidget(self.what)
layout.addWidget(self.other)
self.setLayout(layout)
self.circle.setChecked(True)
self.canon.setChecked(True)
#self.circle.toggled.connect(lambda : change_text(self))
示例4: _updateAutoForegroundColForeground
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def _updateAutoForegroundColForeground(self, row):
item = self.item(row, self._autoForegroundCol)
if item is None: return
try:
value = float(item.data(self._role))
except Exception as ex:
value = 0 # if referenced item doesn't have value or not number, think it as default 0.
if value > 0:
color = Qt.red
elif value < 0:
color = Qt.darkGreen
else:
if item.background() == Qt.white: # for qdarkstyle
color = Qt.black
else:
color = QColor('#C0C0C0')
item.setForeground(color)
示例5: _getForeground
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def _getForeground(self, rowData, autoForegroundCol, item):
# 如果@rowData的item个数小于等于@autoForegroundCol
# 支持row数据比header少的状况
try:
value = rowData[autoForegroundCol]
color = self.getForegroundOverride(value)
except Exception as ex:
color = None
if color is None:
if item.background() == Qt.white:
color = Qt.black
else: # for qdarkstyle
color = QColor(192, 192, 192)
return color
示例6: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def __init__(self):
super(VideoStyleLight, self).__init__()
palette = qApp.palette()
palette.setColor(QPalette.Window, QColor(239, 240, 241))
palette.setColor(QPalette.WindowText, QColor(49, 54, 59))
palette.setColor(QPalette.Base, QColor(252, 252, 252))
palette.setColor(QPalette.AlternateBase, QColor(239, 240, 241))
palette.setColor(QPalette.ToolTipBase, QColor(239, 240, 241))
palette.setColor(QPalette.ToolTipText, QColor(49, 54, 59))
palette.setColor(QPalette.Text, QColor(49, 54, 59))
palette.setColor(QPalette.Button, QColor(239, 240, 241))
palette.setColor(QPalette.ButtonText, QColor(49, 54, 59))
palette.setColor(QPalette.BrightText, QColor(255, 255, 255))
palette.setColor(QPalette.Link, QColor(41, 128, 185))
# palette.setColor(QPalette.Highlight, QColor(126, 71, 130))
# palette.setColor(QPalette.HighlightedText, Qt.white)
palette.setColor(QPalette.Disabled, QPalette.Light, Qt.white)
palette.setColor(QPalette.Disabled, QPalette.Shadow, QColor(234, 234, 234))
qApp.setPalette(palette)
示例7: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def __init__(self, parentChart, color=Qt.white):
super().__init__()
self.textColor = color
self.parentChart = parentChart
self.hovered.connect(self.onHover)
self.callout = Callout(self.name(), parentChart, self.textColor)
self.callout.setZValue(100)
self.clicked.connect(self.onClicked)
self.labelTimer = QTimer()
self.labelTimerTimeout = 3000
self.labelTimer.timeout.connect(self.onLabelTimer)
self.labelTimer.setSingleShot(True)
self.timerRunning = False
示例8: createSpectrumLine
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def createSpectrumLine(self):
if not self.spectrum24Line:
# add it
# 2.4 GHz
self.spectrum24Line = self.createNewSeries(Qt.white, self.chart24)
self.spectrum24Line.setName('Spectrum')
self.chart24.addSeries(self.spectrum24Line)
self.spectrum24Line.attachAxis(self.chart24.axisX())
self.spectrum24Line.attachAxis(self.chart24.axisY())
if not self.spectrum5Line:
# 5 GHz
self.spectrum5Line = self.createNewSeries(Qt.white, self.chart5)
self.spectrum5Line.setName('Spectrum')
self.chart5.addSeries(self.spectrum5Line)
self.spectrum5Line.attachAxis(self.chart5.axisX())
self.spectrum5Line.attachAxis(self.chart5.axisY())
# self.spectrum5Line.setUseOpenGL(True) # This causes the entire window to go blank
示例9: paintEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def paintEvent(self, event):
super(ScaleWindow, self).paintEvent(event)
if self._image:
painter = QPainter(self)
painter.setRenderHint(QPainter.Antialiasing, True)
path = QPainterPath()
radius = min(self.width(), self.height()) / 2
path.addRoundedRect(QRectF(self.rect()), radius, radius)
painter.setClipPath(path)
# 图片
painter.drawImage(self.rect(), self._image)
# 中间蓝色十字线
painter.setPen(QPen(QColor(0, 174, 255), 3))
hw = self.width() / 2
hh = self.height() / 2
painter.drawLines(
QLineF(hw, 0, hw, self.height()),
QLineF(0, hh, self.width(), hh)
)
# 边框
painter.setPen(QPen(Qt.white, 3))
painter.drawRoundedRect(self.rect(), radius, radius)
示例10: paintEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def paintEvent(self, event):
ancho, altura = self.width(), self.height()
icono = self.icono.scaled(ancho, altura, Qt.KeepAspectRatio, Qt.SmoothTransformation)
pintor = QPainter()
pintor.begin(self)
pintor.setRenderHint(QPainter.Antialiasing, True)
pintor.setPen(Qt.NoPen)
pintor.drawPixmap(0, 0, icono, 0, 0, 0, 0)
pintor.setPen(Qt.white)
pintor.drawText(event.rect(), Qt.AlignCenter, self.etiqueta)
pintor.setPen(Qt.NoPen)
pintor.setBrush(self.opacidad)
pintor.drawEllipse(0, 0, ancho, altura)
pintor.end()
self.setMask(icono.mask())
示例11: paintEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def paintEvent(self, event):
super(Label, self).paintEvent(event)
# 中正间画十字
painter = QPainter(self)
painter.setPen(Qt.red)
x = int(self.width() / 2)
y = int(self.height() / 2)
painter.drawLine(x, 0, x, self.height())
painter.drawLine(0, y, self.width(), y)
if self.ismd:
# 画坐标点
pos = QCursor.pos()
ret = win32gui.GetPixel(win32gui.GetWindowDC(
win32gui.GetDesktopWindow()), pos.x(), pos.y())
r, g, b = ret & 0xff, (ret >> 8) & 0xff, (ret >> 16) & 0xff
print(r, g, b)
painter.setPen(Qt.white)
painter.drawText(self.rect(), Qt.AlignLeft |
Qt.AlignBottom, '({}, {})\nRGB: ({}, {}, {})\n{}'.format(
pos.x(), pos.y(), r, g, b, QColor(r, g, b).name()))
示例12: paint_status
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def paint_status(self):
a_offs = 20
base_x = self.rect_x + self.get_pixel_qty_per_line() * self.pixelSize + a_offs + 10
lines = []
lines.append("[Data]")
lines.append(" Type: %s" % self.formatters[self.cur_formatter_idx][1])
lines.append(" Mode: %s" % self.composition_modes[self.cur_compos_mode][1])
cur_line = 1
text_x_pos = base_x + 10
self.qp.setPen(QColor(Qt.white))
for line in lines:
text_y_pos = self.rect().height() - (self.qp.fontMetrics().height()/2) - (len(lines) - cur_line) * (self.qp.fontMetrics().height())
# draw status
self.qp.drawText(text_x_pos,
text_y_pos,
line)
cur_line += 1
# functions that can be called by filters
# must no be called from within on_process_buffer()
示例13: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def __init__(self):
super().__init__()
self.setColor(QPalette.Window, QColor(56, 56, 56))
self.setColor(QPalette.WindowText, Qt.white)
self.setColor(QPalette.Base, QColor(56, 56, 56))
self.setColor(QPalette.AlternateBase, QColor(63, 63, 63))
self.setColor(QPalette.ToolTipBase, Qt.white)
self.setColor(QPalette.ToolTipText, Qt.white)
self.setColor(QPalette.Text, Qt.white)
self.setColor(QPalette.Button, QColor(56, 56, 56))
self.setColor(QPalette.ButtonText, Qt.white)
self.setColor(QPalette.BrightText, QColor(0, 128, 152))
self.setColor(QPalette.Link, QColor(42, 130, 218))
self.setColor(QPalette.Highlight, QColor(0, 128, 152))
self.setColor(QPalette.HighlightedText, Qt.white)
self.setColor(QPalette.Disabled, QPalette.Window, QColor(51, 51, 51))
self.setColor(QPalette.Disabled, QPalette.ButtonText,
QColor(111, 111, 111))
self.setColor(QPalette.Disabled, QPalette.Text, QColor(122, 118, 113))
self.setColor(QPalette.Disabled, QPalette.WindowText,
QColor(122, 118, 113))
self.setColor(QPalette.Disabled, QPalette.Base, QColor(32, 32, 32))
示例14: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def __init__(self):
QtWidgets.QWidget.__init__(self)
uic.loadUi("window.ui", self)
self.scene = QtWidgets.QGraphicsScene(0, 0, 511, 511)
self.mainview.setScene(self.scene)
self.image = QImage(511, 511, QImage.Format_ARGB32_Premultiplied)
self.pen = QPen()
self.color_line = QColor(Qt.black)
self.color_bground = QColor(Qt.white)
self.draw_line.clicked.connect(lambda: draw_line(self))
self.clean_all.clicked.connect(lambda : clear_all(self))
self.btn_bground.clicked.connect(lambda: get_color_bground(self))
self.btn_line.clicked.connect(lambda: get_color_line(self))
self.draw_sun.clicked.connect(lambda: draw_sun(self))
self.cda.setChecked(True)
示例15: get_color_bground
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import white [as 别名]
def get_color_bground(win):
color = QtWidgets.QColorDialog.getColor(initial=Qt.white, title='Цвет фона',
options=QtWidgets.QColorDialog.DontUseNativeDialog)
if color.isValid():
win.color_bground = color
win.image.fill(color)
s = QtWidgets.QGraphicsScene(0, 0, 10, 10)
s.setBackgroundBrush(color)
win.bground_color.setScene(s)
win.scene.setBackgroundBrush(color)