当前位置: 首页>>代码示例>>Python>>正文


Python Qt.AlignVCenter方法代码示例

本文整理汇总了Python中PyQt5.QtCore.Qt.AlignVCenter方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.AlignVCenter方法的具体用法?Python Qt.AlignVCenter怎么用?Python Qt.AlignVCenter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore.Qt的用法示例。


在下文中一共展示了Qt.AlignVCenter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def __init__(self, icon: str, parent=None):
        super(Notification, self).__init__(parent)
        self.parent = parent
        self.theme = self.parent.theme
        self.setObjectName('notification')
        self.setContentsMargins(10, 10, 10, 10)
        self.setModal(True)
        self.setWindowFlags(Qt.Window | Qt.Dialog | Qt.FramelessWindowHint)
        self.setMinimumWidth(550)
        self.shown.connect(lambda: QTimer.singleShot(self.duration * 1000, self.close))
        self._title, self._message = '', ''
        self.buttons = []
        self.msgLabel = QLabel(self._message, self)
        self.msgLabel.setWordWrap(True)
        logo_label = QLabel('<img src="{}" width="82" />'.format(icon), self)
        logo_label.setFixedSize(82, 82)
        self.left_layout = QVBoxLayout()
        self.left_layout.addWidget(logo_label)
        layout = QHBoxLayout()
        layout.addStretch(1)
        layout.addLayout(self.left_layout)
        layout.addSpacing(10)
        layout.addWidget(self.msgLabel, Qt.AlignVCenter)
        layout.addStretch(1)
        self.setLayout(layout) 
开发者ID:ozmartian,项目名称:vidcutter,代码行数:27,代码来源:notifications.py

示例2: on_list_success

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def on_list_success(self, job):
        self.layout_workspaces.clear()
        workspaces = job.ret

        if not workspaces:
            self.line_edit_search.hide()
            label = QLabel(_("TEXT_WORKSPACE_NO_WORKSPACES"))
            label.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            self.layout_workspaces.addWidget(label)
            return

        self.line_edit_search.show()
        for count, workspace in enumerate(workspaces):
            workspace_fs, ws_entry, users_roles, files, timestamped = workspace

            try:
                self.add_workspace(
                    workspace_fs, ws_entry, users_roles, files, timestamped=timestamped
                )
            except JobSchedulerNotAvailable:
                pass 
开发者ID:Scille,项目名称:parsec-cloud,代码行数:23,代码来源:workspaces_widget.py

示例3: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def __init__(self, parent=None):
        super().__init__(parent=parent)

        self._border_radius = 10
        self.label = QLabel('...', self)
        self._size_grip = QSizeGrip(self)
        self._size_grip.setFixedWidth(self._border_radius * 2)

        font = self.font()
        font.setPointSize(24)
        self.label.setFont(font)
        self.label.setAlignment(Qt.AlignBaseline | Qt.AlignVCenter | Qt.AlignHCenter)
        self.label.setWordWrap(False)

        self._layout = QHBoxLayout(self)
        self._layout.setContentsMargins(0, 0, 0, 0)
        self._layout.setSpacing(0)
        self._layout.addSpacing(self._border_radius * 2)
        self._layout.addWidget(self.label)
        self._layout.addWidget(self._size_grip)
        self._layout.setAlignment(self._size_grip, Qt.AlignBottom) 
开发者ID:feeluown,项目名称:FeelUOwn,代码行数:23,代码来源:lyric.py

示例4: paint

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def paint(self, painter, rect, mode, state):
        painter.save()
        self.font.setPixelSize(round(0.875 * min(rect.width(), rect.height())))
        painter.setFont(self.font)
        if self.icon:
            if self.icon.animation:
                self.icon.animation.paint(painter, rect)
            ms = self.icon._getMode(mode) * self.icon._getState(state)
            text, color = self.icon.icons.get(ms, (None, None))
            if text == None and color == None:
                return
            painter.setPen(color)
            self.text = text if text else self.text
            painter.drawText(
                rect, int(Qt.AlignCenter | Qt.AlignVCenter), self.text)
        painter.restore() 
开发者ID:PyQt5,项目名称:CustomWidgets,代码行数:18,代码来源:CFontIcon.py

示例5: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def __init__(self, *args, **kwargs):
        super(WidgetCode, self).__init__(*args, **kwargs)
        self._sensitive = False  # 是否大小写敏感
        self.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.setBackgroundRole(QPalette.Midlight)
        self.setAutoFillBackground(True)
        # 字体
        newFont = self.font()
        newFont.setPointSize(16)
        newFont.setFamily("Kristen ITC")
        newFont.setBold(True)
        self.setFont(newFont)
        self.reset()
        # 定时器
        self.step = 0
        self.timer = QBasicTimer()
        self.timer.start(60, self) 
开发者ID:PyQt5,项目名称:PyQt,代码行数:19,代码来源:VerificationCode.py

示例6: addExecute

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def addExecute(self, dataDict):
        values = self._formatMonitorInfo(dataDict)

        if not values:
            return

        strategyId = dataDict["StrategyId"]
        strategy_id_list = self.get_run_strategy_id()
        try:
            if strategyId in strategy_id_list:
                self.updateRunStage(strategyId, dataDict[5])
                return
        except Exception as e:
            self._logger.warn("addExecute exception")
        else:
            row = self.strategy_table.rowCount()
            self.strategy_table.setRowCount(row + 1)
            for j in range(len(values)):
                item = QTableWidgetItem(str(values[j]))
                if isinstance(values[j], int) or isinstance(values[j], float):
                    item.setTextAlignment(Qt.AlignRight | Qt.AlignVCenter)
                elif isinstance(values[j], str):
                    item.setTextAlignment(Qt.AlignCenter)
                self.strategy_table.setItem(row, j, item) 
开发者ID:epolestar,项目名称:equant,代码行数:26,代码来源:view.py

示例7: updateValue

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def updateValue(self, strategyId, dataDict):
        """更新策略ID对应的运行数据"""

        colValues = {
            8: "{:.2f}".format(dataDict["Available"]),
            9: "{:.2f}".format(dataDict["MaxRetrace"]),
            10: "{:.2f}".format(dataDict["NetProfit"]),
            11: "{:.2f}".format(dataDict["WinRate"])
        }

        row = self.get_row_from_strategy_id(strategyId)
        if row != -1:
            for k, v in colValues.items():
                try:
                    item = QTableWidgetItem(str(v))
                    if isinstance(eval(v), int) or isinstance(eval(v), float):
                        item.setTextAlignment(Qt.AlignRight | Qt.AlignVCenter)
                    elif isinstance(eval(v), str):
                        item.setTextAlignment(Qt.AlignCenter)
                    self.strategy_table.setItem(row, k, item)
                except Exception as e:
                    self._logger.error(f"[UI][{strategyId}]: 更新策略执行数据时出错,执行列表中该策略已删除!") 
开发者ID:epolestar,项目名称:equant,代码行数:24,代码来源:view.py

示例8: data

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def data(self, index, role):
        """Re-implemented method to get the data for a given index and role"""
        node = index.internalPointer()
        parent = node.parent
        if parent:
            if role == Qt.DisplayRole and index.column() == 5:
                return node.name
        elif not parent and role == Qt.DisplayRole and index.column() == 5:
            return node.var_list()
        elif not parent and role == Qt.DisplayRole:
            if index.column() == 0:
                return node.id
            if index.column() == 1:
                return node.name
            if index.column() == 2:
                return str(node.period)
        if role == Qt.TextAlignmentRole and \
                (index.column() == 4 or index.column() == 3):
            return Qt.AlignHCenter | Qt.AlignVCenter

        return None 
开发者ID:bitcraze,项目名称:crazyflie-clients-python,代码行数:23,代码来源:LogBlockTab.py

示例9: TabelaEntrega

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def TabelaEntrega(self, tabela, row, col, data, cor, status):
        item = QtWidgets.QLabel()
        item.setAlignment(Qt.AlignLeading|Qt.AlignHCenter|
        Qt.AlignVCenter)
        item.setIndent(3)
        item.setMargin(0)
        item.setStyleSheet("background: #FFF")
        html = ("""
                <strong style="font-family:Arial; font-size: 13px;">{}<br/>
                <span style="color:{}; font-size: 12px">{}</span></strong>"""
                ).format(data, cor, status)
        item.setText(html)
        tabela.setCellWidget(row, col, item)


    # Texto Tabela Valor Produtos 
开发者ID:andrersp,项目名称:controleEstoque,代码行数:18,代码来源:main.py

示例10: paint_slider_on

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def paint_slider_on(self, painter):
        swidth = int((self.width() / 2) - 2)
        sheight = int(self.height() - 2)
        painter.setBrush(QtGui.QBrush(QtGui.QColor(60,90,150,200)))
        painter.drawRoundedRect(self.contentsRect(), 3, 3)
        painter.setBrush(QtGui.QBrush(self.bgcolor_slider))
        painter.drawRoundedRect(swidth+3, 1, swidth, sheight, 2, 2)
        painter.setPen(QtGui.QColor(255,255,255,220))
        painter.drawText(2, 1, swidth, sheight, Qt.AlignCenter | Qt.AlignVCenter, 'On') 
开发者ID:pkkid,项目名称:pkmeter,代码行数:11,代码来源:pkwidgets.py

示例11: paint_slider_off

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def paint_slider_off(self, painter):
        swidth = int((self.width() / 2) - 2)
        sheight = int(self.height() - 2)
        painter.setBrush(QtGui.QBrush(QtGui.QColor(0,0,0,50)))
        painter.drawRoundedRect(self.contentsRect(), 3, 3)
        painter.setBrush(QtGui.QBrush(self.bgcolor_slider))
        painter.drawRoundedRect(3, 1, swidth, sheight, 2, 2)
        painter.setPen(QtGui.QColor(0,0,0,150))
        painter.drawText(swidth+3, 1, swidth, sheight, Qt.AlignCenter | Qt.AlignVCenter, 'Off') 
开发者ID:pkkid,项目名称:pkmeter,代码行数:11,代码来源:pkwidgets.py

示例12: paintEvent

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def paintEvent(self, event):
        painter = QPainter(self)
        painter.setFont(self.font)
        
        linear = QLinearGradient(QPoint(self.rect().topLeft()), QPoint(self.rect().bottomLeft()))
        linear.setStart(0, 10)
        linear.setFinalStop(0, 50)
        linear.setColorAt(0.1, QColor(14, 179, 255));
        linear.setColorAt(0.5, QColor(154, 232, 255));
        linear.setColorAt(0.9, QColor(14, 179, 255));
        
        linear2 = QLinearGradient(QPoint(self.rect().topLeft()), QPoint(self.rect().bottomLeft()))
        linear2.setStart(0, 10)
        linear2.setFinalStop(0, 50)
        linear2.setColorAt(0.1, QColor(222, 54, 4));
        linear2.setColorAt(0.5, QColor(255, 172, 116));
        linear2.setColorAt(0.9, QColor(222, 54, 4));
        
        painter.setPen(QColor(0, 0, 0, 200));
        painter.drawText(QRect(1, 1, self.screen.width(), 60), Qt.AlignHCenter | Qt.AlignVCenter, self.lyric)
        
        painter.setPen(QColor('transparent'));
        self.textRect = painter.drawText(QRect(0, 0, self.screen.width(), 60), Qt.AlignHCenter | Qt.AlignVCenter, self.lyric)

        painter.setPen(QPen(linear, 0))
        painter.drawText(self.textRect, Qt.AlignLeft | Qt.AlignVCenter, self.lyric)
        if self.intervel != 0:
            self.widthBlock = self.textRect.width()/(self.intervel/150.0)
        else:
            self.widthBlock = 0
        self.maskRect = QRectF(self.textRect.x(), self.textRect.y(), self.textRect.width(), self.textRect.height())
        self.maskRect.setWidth(self.maskWidth)
        painter.setPen(QPen(linear2, 0));
        painter.drawText(self.maskRect, Qt.AlignLeft | Qt.AlignVCenter, self.lyric) 
开发者ID:HuberTRoy,项目名称:MusicBox,代码行数:36,代码来源:player.py

示例13: setup_hint_label

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def setup_hint_label(self):
        size_policy = constants.default_size_policy(self.hintLabel, QSizePolicy.Preferred, QSizePolicy.Fixed)
        self.hintLabel.setSizePolicy(size_policy)
        self.hintLabel.setFont(constants.default_font())
        self.hintLabel.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.hintLabel, 0, 0, 1, 1) 
开发者ID:Trilarion,项目名称:imperialism-remake,代码行数:8,代码来源:battleView.py

示例14: setup_turn_label

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def setup_turn_label(self):
        size_policy = constants.default_size_policy(self.dateLabel, QSizePolicy.Preferred, QSizePolicy.Fixed)
        self.dateLabel.setSizePolicy(size_policy)
        self.dateLabel.setFont(constants.default_font())
        self.dateLabel.setText('Turn ' + str(self.battleView.turn))
        self.dateLabel.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
        self.gridLayout.addWidget(self.dateLabel, 0, 0, 1, 1) 
开发者ID:Trilarion,项目名称:imperialism-remake,代码行数:9,代码来源:battleView.py

示例15: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import AlignVCenter [as 别名]
def __init__(self, experiment, **kwargs):

        super().__init__(**kwargs)
        self.experiment = experiment
        self.container_layout = QVBoxLayout()
        self.container_layout.setContentsMargins(0, 0, 0, 0)

        StimDisplay = type("StimDisplay", (StimDisplayWidgetConditional, QWidget), {})
        self.widget_display = StimDisplay(
            self,
            calibrator=self.experiment.calibrator,
            protocol_runner=self.experiment.protocol_runner,
            record_stim_framerate=None,
        )

        self.layout_inner = QVBoxLayout()
        self.layout_inner.addWidget(self.widget_display)
        self.button_show_display = QPushButton(
            "Show stimulus (showing stimulus may impair performance)"
        )
        self.widget_display.display_state = False
        self.button_show_display.clicked.connect(self.change_button)
        self.layout_inner.addWidget(self.button_show_display)

        self.layout_inner.setContentsMargins(12, 0, 12, 12)
        self.container_layout.addLayout(self.layout_inner)
        self.setLayout(self.container_layout)
        self.container_layout.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)

        self.widget_display.sizeHint = lambda: QSize(100, 100)
        sizePolicy = QSizePolicy(
            QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding
        )
        self.widget_display.setSizePolicy(sizePolicy)

        self.widget_display.setMaximumSize(500, 500) 
开发者ID:portugueslab,项目名称:stytra,代码行数:38,代码来源:stimulus_display.py


注:本文中的PyQt5.QtCore.Qt.AlignVCenter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。