當前位置: 首頁>>代碼示例>>Python>>正文


Python QPalette.Background方法代碼示例

本文整理匯總了Python中PyQt5.QtGui.QPalette.Background方法的典型用法代碼示例。如果您正苦於以下問題:Python QPalette.Background方法的具體用法?Python QPalette.Background怎麽用?Python QPalette.Background使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtGui.QPalette的用法示例。


在下文中一共展示了QPalette.Background方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from PyQt5.QtGui import QPalette [as 別名]
# 或者: from PyQt5.QtGui.QPalette import Background [as 別名]
def __init__(self):
        super().__init__()
        pal = QPalette()
        pal.setColor(QPalette.Background, QColor("#fff"))
        self.setPalette(pal)
        self.setAutoFillBackground(True)
        self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)
        self.frame_no = 1
        self.angle_factor = ANGLE_FACTOR_DEF  # related to degrees offset of each dot
        self.num_dots = NUM_DOTS_DEF
        self.dot_size = DOT_SIZE_DEF
        self.x_multiplier = X_MULT_DEF
        self.y_multiplier = Y_MULT_DEF
        self.halfmax = HALFMAX_DEF
        self.speedmult = SPEED_MULT_DEF
        self.draw_axes = AXES_DEF
        self.join_end_dots = JOIN_ENDS_DEF
        self.col1 = COL1_DEF
        self.col2 = COL2_DEF
        self.draw_lines = LINES_DEF
        self.connect_lines = CONNECT_LINES_DEF 
開發者ID:expectocode,項目名稱:captivox,代碼行數:23,代碼來源:captivox.py

示例2: actualizarEstado

# 需要導入模塊: from PyQt5.QtGui import QPalette [as 別名]
# 或者: from PyQt5.QtGui.QPalette import Background [as 別名]
def actualizarEstado(self):
        # Si la posicion x del boton mas la mitad de su ancho
        # es menor que la mitad del ancho del widget padre,
        # entonces esta apagado (NO)
        if (self.parent.button.x() + (self.parent.button.width() / 2)) < Frame.VALOR / 2:
            self.habilitado = False
            
        # Si la posicion x del boton mas la mitad de su ancho
        # es mayor que la mitad del ancho del widget padre,
        # entonces esta encendido (SI)
        if (self.parent.button.x() + (self.parent.button.width() / 2)) > Frame.VALOR / 2:
            self.habilitado = True
            
        if self.habilitado:
            self.parent.button.setText("SI")
            color = QColor(206, 61, 59)
        elif not self.habilitado:
            self.parent.button.setText("NO")
            color = QColor(147, 183, 89)

        colorFrame = self.palette()
        colorFrame.setColor(QPalette.Background, color)
        self.setPalette(colorFrame) 
開發者ID:andresnino,項目名稱:PyQt5,代碼行數:25,代碼來源:interruptorPalanca.py

示例3: setup_ui

# 需要導入模塊: from PyQt5.QtGui import QPalette [as 別名]
# 或者: from PyQt5.QtGui.QPalette import Background [as 別名]
def setup_ui(self):
        self.battleWindow.setWindowTitle(self.battleWindow.config.get_text('battle.window.title') + ' v' + str(self.battleWindow.config.version))
        background = self.battleWindow.config.theme_selected.get_background_pixmap()
        palette = QPalette()
        palette.setBrush(QPalette.Background, QBrush(background))
        self.battleWindow.setMinimumSize(constants.get_min_resolution_qsize())
        self.battleWindow.setAutoFillBackground(True)
        self.gridLayout.setVerticalSpacing(0)

        self.setup_hint_label()  # Labels
        self.setup_turn_label()  # Labels
        self.setup_space()  # Space item

        self.setup_help_button()  # Help Push Button
        self.setup_next_target_button()  # Next Target Button
        self.setup_end_unit_button()  # End Unit Button
        self.setup_retreat_button()  # Retreat Button
        self.setup_auto_combat_button()  # Automatic battle button

        self.setup_targeted_unit_view()  # Targeted Unit view
        self.setup_current_unit_view()  # Current Unit View
        self.setup_coat_of_arms_view()  # Coat of Arm view

        self.setup_map()  # Main view
        self.battleWindow.setPalette(palette)
        self.battleWindow.setCentralWidget(self.centralWidget)

        # noinspection PyArgumentList
        QMetaObject.connectSlotsByName(self.battleWindow) 
開發者ID:Trilarion,項目名稱:imperialism-remake,代碼行數:31,代碼來源:battleView.py

示例4: addMessage

# 需要導入模塊: from PyQt5.QtGui import QPalette [as 別名]
# 或者: from PyQt5.QtGui.QPalette import Background [as 別名]
def addMessage(self, message, persist=3):

        end_color = _hex_to_rgb(self.palette().color(QPalette.Background).name())

        if not message or len(message) < 2:
            return
        if message in self.current_messages.keys():
            self.current_messages[message].refresh()

        else:
            self.current_messages[message] = DisplayedMessage(
                message, persist=persist, end_color=end_color
            )
            self.new_messages.append(self.current_messages[message]) 
開發者ID:portugueslab,項目名稱:stytra,代碼行數:16,代碼來源:status_display.py

示例5: _qcolorstring

# 需要導入模塊: from PyQt5.QtGui import QPalette [as 別名]
# 或者: from PyQt5.QtGui.QPalette import Background [as 別名]
def _qcolorstring(self, color):
        colorname = self.palette().color(QPalette.Background).name().lstrip("#")
        return "rgb({},{},{})".format(
            *(int(colorname[i * 2 : i * 2 + 2], 16) for i in range(3))
        ) 
開發者ID:portugueslab,項目名稱:stytra,代碼行數:7,代碼來源:multiscope.py

示例6: __init__

# 需要導入模塊: from PyQt5.QtGui import QPalette [as 別名]
# 或者: from PyQt5.QtGui.QPalette import Background [as 別名]
def __init__(self, parent=None):
        super(Configuracion, self).__init__(parent)
        
        self.setWindowFlags(Qt.Popup)
        self.setFixedSize(450, 500)

        paleta = self.palette()
        paleta.setColor(QPalette.Background, QColor("white"))
        self.setPalette(paleta)

        self.initUI() 
開發者ID:andresnino,項目名稱:PyQt5,代碼行數:13,代碼來源:siacle.py

示例7: __init__

# 需要導入模塊: from PyQt5.QtGui import QPalette [as 別名]
# 或者: from PyQt5.QtGui.QPalette import Background [as 別名]
def __init__(self, parent=None):
        super(ventanaLogin, self).__init__(parent)
        
        self.setWindowTitle("Login con PyQt5 por: ANDRES NIÑO")
        self.setWindowIcon(QIcon("icono.png"))
        self.setWindowFlags(Qt.WindowCloseButtonHint | Qt.MSWindowsFixedSizeDialogHint)
        self.setFixedSize(400, 380)

        paleta = QPalette()
        paleta.setColor(QPalette.Background, QColor(243, 243, 243))
        self.setPalette(paleta)

        self.initUI() 
開發者ID:andresnino,項目名稱:PyQt5,代碼行數:15,代碼來源:login.py


注:本文中的PyQt5.QtGui.QPalette.Background方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。