python类AlignCenter()的实例源码

son.py 文件源码 项目:Milis-Yukleyici 作者: sonakinci41 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self, ebeveyn=None):
        super(Son, self).__init__(ebeveyn)
        self.e = ebeveyn
        self.kapanacak_mi =False

        kutu = QGridLayout()
        self.setLayout(kutu)

        milis_logo = QLabel()
        milis_logo.setAlignment(Qt.AlignCenter)
        milis_logo.setPixmap(QPixmap("./resimler/milis-logo.svg"))
        kutu.addWidget(milis_logo,0,0,1,2)

        self.veda_label = QLabel()
        self.veda_label.setAlignment(Qt.AlignCenter)
        self.veda_label.setWordWrap(True)
        kutu.addWidget(self.veda_label,1,0,1,2)

        self.denemeye_devam = QRadioButton()
        self.denemeye_devam.setIcon(QIcon("./resimler/cik.svg"))
        self.denemeye_devam.setIconSize(QSize(50,50))
        self.denemeye_devam.toggled.connect(self.degisti)
        kutu.addWidget(self.denemeye_devam,2,0,1,1)
        self.kapat = QRadioButton()
        self.kapat.setIcon(QIcon("./resimler/yeniden-baslat.svg"))
        self.kapat.setIconSize(QSize(50,50))
        self.kapat.toggled.connect(self.degisti)
        kutu.addWidget(self.kapat,2,1,1,1)

        self.denemeye_devam.setChecked(True)
qtpropertybrowserutils.py 文件源码 项目:QtPropertyBrowserV2.6-for-pyqt5 作者: theall 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def fontValuePixmap(font):
        f = QFont(font)
        img = QImage(16, 16, QImage.Format_ARGB32_Premultiplied)
        img.fill(0)
        p = QPainter(img)
        p.setRenderHint(QPainter.TextAntialiasing, True)
        p.setRenderHint(QPainter.Antialiasing, True)
        f.setPointSize(13)
        p.setFont(f)
        t = QTextOption()
        t.setAlignment(Qt.AlignCenter)
        p.drawText(QRectF(0, 0, 16, 16), 'A', t)
        p.end()
        return QPixmap.fromImage(img)
about.py 文件源码 项目:pytc-gui 作者: harmslab 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def layout(self):
        """
        """
        main_layout = QW.QVBoxLayout(self)
        form_layout = QW.QFormLayout()

        version = pkg_resources.require("pytc-gui")[0].version

        name_label = QW.QLabel("pytc: GUI")
        name_font = name_label.font()
        name_font.setPointSize(20)
        name_label.setFont(name_font)
        name_label.setAlignment(Qt.AlignCenter)

        version_label = QW.QLabel("Version " + version)
        version_font = version_label.font()
        version_font.setPointSize(14)
        version_label.setFont(version_font)
        version_label.setAlignment(Qt.AlignCenter)

        author_info = QW.QLabel("Hiranmayi Duvvuri, Mike Harms")
        author_font = author_info.font()
        author_font.setPointSize(10)
        author_info.setFont(author_font)

        OK_button = QW.QPushButton("OK", self)
        OK_button.clicked.connect(self.close)

        main_layout.addWidget(name_label)
        main_layout.addWidget(version_label)
        main_layout.addWidget(author_info)
        main_layout.addWidget(OK_button)

        self.setWindowTitle("About")
__init__.py 文件源码 项目:binja_dynamics 作者: nccgroup 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def _makewidget(val, center=False):
    """ Small helper function that builds a TableWidgetItem and sets up the font the way we want"""
    out = QtWidgets.QTableWidgetItem(str(val))
    out.setFlags(Qt.ItemIsEnabled)
    out.setFont(monospace)
    if(center):
        out.setTextAlignment(Qt.AlignCenter)
    return out
Home.py 文件源码 项目:TorrentBro 作者: subins2000 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def initUI(self):
        self.ui = Ui_Home()
        self.ui.setupUi(self)

        self.setGeometry(
            QStyle.alignedRect(
                Qt.LeftToRight,
                Qt.AlignCenter,
                self.size(),
                qApp.desktop().availableGeometry()
            )
        )
        self.show()

        self.ui.searchButton.clicked.connect(self.onSearch)
        self.ui.searchTextbox.returnPressed.connect(self.onSearch)

        self.ui.torrentList.selectionModel().selectionChanged.connect(self.onTorrentSelect)

        self.ui.torrentInfoMagnetLink.linkActivated.connect(self.onLinkClick)
        self.ui.torrentInfoTorrentLink.linkActivated.connect(self.onLinkClick)
direct_download.py 文件源码 项目:tvlinker 作者: ozmartian 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def __init__(self, parent, f=Qt.WindowCloseButtonHint):
        super(DirectDownload, self).__init__(parent, f)
        self.parent = parent
        self.setWindowTitle('Download Progress')
        self.setWindowModality(Qt.ApplicationModal)
        self.setMinimumWidth(485)
        self.setContentsMargins(20, 20, 20, 20)
        layout = QVBoxLayout()
        self.progress_label = QLabel(alignment=Qt.AlignCenter)
        self.progress = QProgressBar(self.parent)
        self.progress.setMinimum(0)
        self.progress.setMaximum(100)
        layout.addWidget(self.progress_label)
        layout.addWidget(self.progress)
        self.setLayout(layout)
mpvQC.py 文件源码 项目:mpvQC 作者: Frechdachs 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def writeCommentListViewContents(comments, seconds=False):
    commentmodel.clear()
    for comment in comments:
        if not seconds:
            timestamp = QStandardItem(comment[0])
        else:
            timestamp = QStandardItem(secondsToTimestamp(comment[0]))
        timestamp.setEditable(False)
        timestamp.setTextAlignment(Qt.AlignRight|Qt.AlignVCenter)
        commenttype = QStandardItem(comment[1])
        commenttype.setEditable(False)
        commenttype.setTextAlignment(Qt.AlignCenter)
        commentmodel.appendRow([timestamp, commenttype, QStandardItem(comment[2])])
    commentlistview.horizontalHeader().setSectionResizeMode(2, QHeaderView.Stretch)
    resizeCommentListViewToContents()
{{cookiecutter.application_name}}.py 文件源码 项目:cookiecutter-pyqt5 作者: mandeep 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        """Display a dialog that shows application information."""
        super(AboutDialog, self).__init__(parent)

        self.setWindowTitle('About')
        help_icon = pkg_resources.resource_filename('{{ cookiecutter.package_name }}.images',
                                                    'ic_help_black_48dp_1x.png')
        self.setWindowIcon(QIcon(help_icon))
        self.resize(300, 200)

        author = QLabel('{{ cookiecutter.full_name }}')
        author.setAlignment(Qt.AlignCenter)

        icons = QLabel('Material design icons created by Google')
        icons.setAlignment(Qt.AlignCenter)

        github = QLabel('GitHub: {{ cookiecutter.github_username }}')
        github.setAlignment(Qt.AlignCenter)

        self.layout = QVBoxLayout()
        self.layout.setAlignment(Qt.AlignVCenter)

        self.layout.addWidget(author)
        self.layout.addWidget(icons)
        self.layout.addWidget(github)

        self.setLayout(self.layout)
konum.py 文件源码 项目:Milis-Yukleyici 作者: sonakinci41 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, ebeveyn=None):
        super(Konum, self).__init__(ebeveyn)
        self.e = ebeveyn
        kutu = QGridLayout()
        kutu.setAlignment(Qt.AlignCenter)
        self.setLayout(kutu)
        self.bigli_label = QLabel()
        kutu.addWidget(self.bigli_label,0,0,1,2)

        self.harita = HaritaWidget(self)
        kutu.addWidget(self.harita,1,0,1,2)

        self.bolge_label = QLabel()
        kutu.addWidget(self.bolge_label,2,0,1,1)

        self.sehir_label = QLabel()
        kutu.addWidget(self.sehir_label,2,1,1,1)

        self.bolge_combo = QComboBox()
        self.bolge_combo.currentTextChanged.connect(self.sehir_combo_doldur)
        kutu.addWidget(self.bolge_combo,3,0,1,1)
        self.sehir_combo = QComboBox()
        self.sehir_combo.currentTextChanged.connect(self.sehir_combo_degisti)
        kutu.addWidget(self.sehir_combo,3,1,1,1)
        self.bolge_combo_doldur()
        self.bolge_combo.setCurrentText("Europe")
        self.sehir_combo.setCurrentText("Istanbul")
videosliderwidget.py 文件源码 项目:vidcutter 作者: ozmartian 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, parent, slider: VideoSlider):
        super(VideoSliderWidget, self).__init__(parent)
        self.parent = parent
        self.slider = slider
        self.loaderEffect = OpacityEffect()
        self.loaderEffect.setEnabled(False)
        self.setGraphicsEffect(self.loaderEffect)
        self.setContentsMargins(0, 0, 0, 0)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.layout().setStackingMode(QStackedLayout.StackAll)
        self.genlabel = QLabel(self.parent)
        self.genlabel.setContentsMargins(0, 0, 0, 14)
        self.genlabel.setPixmap(QPixmap(':/images/generating-thumbs.png'))
        self.genlabel.setAlignment(Qt.AlignCenter)
        self.genlabel.hide()
        sliderLayout = QGridLayout()
        sliderLayout.setContentsMargins(0, 0, 0, 0)
        sliderLayout.setSpacing(0)
        sliderLayout.addWidget(self.slider, 0, 0)
        sliderLayout.addWidget(self.genlabel, 0, 0)
        sliderWidget = QWidget(self.parent)
        sliderWidget.setLayout(sliderLayout)
        self.addWidget(sliderWidget)
widgets.py 文件源码 项目:vidcutter 作者: ozmartian 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def __init__(self, parent=None, flags=Qt.Dialog | Qt.FramelessWindowHint):
        super(VCProgressBar, self).__init__(parent, flags)
        self.parent = parent
        self.setWindowModality(Qt.ApplicationModal)
        self.setStyleSheet('QDialog { border: 2px solid #000; }')
        self._progress = QProgressBar(self)
        self._progress.setRange(0, 0)
        self._progress.setTextVisible(False)
        self._progress.setStyle(QStyleFactory.create('Fusion'))
        self._label = QLabel(self)
        self._label.setAlignment(Qt.AlignCenter)
        layout = QGridLayout()
        layout.addWidget(self._progress, 0, 0)
        layout.addWidget(self._label, 0, 0)
        self._timerprefix = QLabel('<b>Elapsed time:</b>', self)
        self._timerprefix.setObjectName('progresstimer')
        self._timervalue = QLabel(self)
        self._timervalue.setObjectName('progresstimer')
        timerlayout = QHBoxLayout()
        timerlayout.addWidget(self._timerprefix)
        timerlayout.addWidget(self._timervalue)
        self._timerwidget = QWidget(self)
        self._timerwidget.setLayout(timerlayout)
        self._timerwidget.hide()
        self._time = QTime()
        self._timer = QTimer(self)
        self._timer.timeout.connect(self.updateTimer)
        self.setLayout(layout)
        self.setFixedWidth(550)
healthbar.py 文件源码 项目:thegame 作者: afg984 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def paint(
            self,
            painter: QPainter,
            option: QStyleOptionGraphicsItem,
            widget: QWidget):
        super().paint(painter, option, widget)

        painter.setPen(const.HeroNamePen)
        painter.setRenderHint(QPainter.Antialiasing)
        painter.drawText(
            QRectF(
                -self.width / 2 - 15,
                -self.offsetY - 14,
                self.width + 30,
                14),
            Qt.AlignCenter,
            self.name)
view.py 文件源码 项目:thegame 作者: afg984 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def setAbilityButtonStyle(self):
        for i, (label, button) in enumerate(self.abilityButtons):
            label.setStyleSheet(const.AbilityLabelStyle)
            label.setAlignment(Qt.AlignCenter)
            if button.isEnabled():
                button.setStyleSheet(
                    const.AbilityButtonCommonStyle +
                    const.AbilityButtonEnabledStyleList[i])
            else:
                button.setStyleSheet(
                    const.AbilityButtonCommonStyle +
                    const.AbilityButtonDisabledStyle)
__init__.py 文件源码 项目:binja_dynamics 作者: ehennenfent 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def _makewidget(val, center=False):
    """ Small helper function that builds a TableWidgetItem and sets up the font the way we want"""
    out = QtWidgets.QTableWidgetItem(str(val))
    out.setFlags(Qt.ItemIsEnabled)
    out.setFont(monospace)
    if(center):
        out.setTextAlignment(Qt.AlignCenter)
    return out
application.py 文件源码 项目:Mausoleum 作者: mandeep 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def __init__(self, path, parent=None):
        """Initialize the close page's configuration group."""
        super(CloseTomb, self).__init__(parent)

        self.path = path

        layout = QVBoxLayout()

        close_group = QGroupBox('Close Tomb')

        close_layout = QVBoxLayout()
        self.close_all_button = QPushButton('Close All Tombs')
        self.close_all_button.setFixedWidth(200)
        self.force_close_button = QPushButton('Force Close Tombs')
        self.force_close_button.setFixedWidth(200)
        close_layout.addWidget(self.close_all_button, alignment=Qt.AlignCenter)
        close_layout.addWidget(self.force_close_button, alignment=Qt.AlignCenter)

        close_group.setLayout(close_layout)

        layout.addWidget(close_group)
        layout.addStretch(1)

        self.setLayout(layout)

        self.close_all_button.clicked.connect(lambda: wrapper.close_tombs(self.path))
        self.force_close_button.clicked.connect(lambda: wrapper.slam_tombs(self.path))
application.py 文件源码 项目:Mausoleum 作者: mandeep 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, path, parent=None):
        """Initialize the list page's configuration group."""
        super(ListTomb, self).__init__(parent)

        self.path = path

        layout = QVBoxLayout()

        list_group = QGroupBox('Active Tombs')

        list_layout = QVBoxLayout()
        self.tomb_list = QListWidget()

        self.update_list_button = QPushButton('Update')
        self.update_list_button.setFixedWidth(200)

        list_layout.addWidget(self.tomb_list)
        list_layout.addWidget(self.update_list_button, alignment=Qt.AlignCenter)

        list_group.setLayout(list_layout)
        layout.addWidget(list_group)
        self.setLayout(layout)

        self.update_list_button.clicked.connect(self.update_list_items)
invite.py 文件源码 项目:tahoe-gui 作者: LeastAuthority 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super(self.__class__, self).__init__()
        self.parent = parent
        font = QFont()
        font.setPointSize(16)
        model = QStringListModel()
        model.setStringList(wordlist)
        completer = Completer()
        completer.setModel(model)
        self.setFont(font)
        self.setCompleter(completer)
        self.setAlignment(Qt.AlignCenter)
        #self.setPlaceholderText("Enter invite code")
Setting.py 文件源码 项目:OpenMineMods 作者: OpenMineMods 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, curse: CurseAPI):
        super().__init__()

        self.curse = curse

        self.setWindowTitle(translate("title.settings"))

        self.layout = QVBoxLayout(self)

        mmc_box = QGroupBox(translate("label.mmc.location"))
        mmc_layout = QHBoxLayout()

        mmc_box.setLayout(mmc_layout)

        self.mmcDir = QLineEdit(self.curse.baseDir)
        self.mmcDir.setReadOnly(True)
        self.mmcDir.setMinimumWidth(250)
        mmc_layout.addWidget(self.mmcDir, 0, Qt.AlignLeft)

        self.mmcEb = makeIconButton(self, "edit", translate("tooltip.mmc.change"))
        self.mmcEb.clicked.connect(partial(self.browse_clicked))
        mmc_layout.addWidget(self.mmcEb, 0, Qt.AlignRight)

        self.layout.addWidget(mmc_box)

        analytics_box = QGroupBox(translate("label.analytics"))
        analytics_layout = QHBoxLayout()

        analytics_box.setLayout(analytics_layout)

        self.analyticsToggle = QCheckBox()
        self.analyticsToggle.setChecked(self.curse.db["analytics"])
        self.analyticsToggle.setToolTip(translate("tooltip.toggle.analytics"))
        self.analyticsToggle.stateChanged.connect(self.analytics_toggle)
        analytics_layout.addWidget(self.analyticsToggle, 1, Qt.AlignCenter)

        self.layout.addWidget(analytics_box)

        self.show()
conflict_tag.py 文件源码 项目:uitester 作者: IfengAutomation 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self, refresh_signal, conflict_tags_message_dict, case_data_manager, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.refresh_signal = refresh_signal
        self.case_data_manager = case_data_manager
        ui_dir_path = os.path.dirname(__file__)
        ui_file_path = os.path.join(ui_dir_path, "conflict_tag.ui")
        uic.loadUi(ui_file_path, self)
        self.setWindowTitle("conflict tag")
        self.conflict_tags_message_dict = conflict_tags_message_dict
        self.set_conflict_tags_table_widget()

        config = Config()
        image = QImage(os.path.join(config.images, 'notice.png'))
        result = image.scaled(40, 40)
        self.notice_image_label.setPixmap(QPixmap.fromImage(result))
        self.notice_image_label.setAlignment(Qt.AlignCenter)
        self.notice_text_label.setText(
            '?????????\n'
            '1???????????????????????????????\n'
            '2???????????????')  # todo ??????
        self.conflict_tags_submit_button.clicked.connect(self.conflict_tags_submit)
        self.button_style(self.conflict_tags_submit_button)
        self.cancel_submit_button.clicked.connect(self.cancel_submit)
        self.button_style(self.cancel_submit_button)
install.py 文件源码 项目:lilii 作者: LimeLinux 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super().__init__()
        self.parent = parent
        self.setWindowTitle(self.tr("System Installation"))
        self.setLayout(QVBoxLayout())

        self.slide_widget = SlideWidget()
        self.layout().addWidget(self.slide_widget)

        self.progress = QProgressBar()
        self.layout().addWidget(self.progress)

        self.desc_label = QLabel()
        self.desc_label.setAlignment(Qt.AlignCenter)
        self.layout().addWidget(self.desc_label)

        self.addSlides()
schema.py 文件源码 项目:Mac-Python-3.X 作者: L1nwatch 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self):
        super(MainWindow, self).__init__()

        self.setupUi(self)

        XmlSyntaxHighlighter(self.schemaView.document())
        XmlSyntaxHighlighter(self.instanceEdit.document())

        self.schemaSelection.addItem("Contact Schema")
        self.schemaSelection.addItem("Recipe Schema")
        self.schemaSelection.addItem("Order Schema")

        self.instanceSelection.addItem("Valid Contact Instance")
        self.instanceSelection.addItem("Invalid Contact Instance")

        self.schemaSelection.currentIndexChanged.connect(self.schemaSelected)
        self.instanceSelection.currentIndexChanged.connect(self.instanceSelected)
        self.validateButton.clicked.connect(self.validate)
        self.instanceEdit.textChanged.connect(self.textChanged)

        self.validationStatus.setAlignment(Qt.AlignCenter | Qt.AlignVCenter)

        self.schemaSelected(0)
        self.instanceSelected(0)
2dpainting.py 文件源码 项目:Mac-Python-3.X 作者: L1nwatch 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def paint(self, painter, event, elapsed):
        painter.fillRect(event.rect(), self.background)
        painter.translate(100, 100)

        painter.save()
        painter.setBrush(self.circleBrush)
        painter.setPen(self.circlePen)
        painter.rotate(elapsed * 0.030)

        r = elapsed / 1000.0
        n = 30
        for i in range(n):
            painter.rotate(30)
            radius = 0 + 120.0*((i+r)/n)
            circleRadius = 1 + ((i+r)/n)*20
            painter.drawEllipse(QRectF(radius, -circleRadius,
                    circleRadius*2, circleRadius*2))

        painter.restore()

        painter.setPen(self.textPen)
        painter.setFont(self.textFont)
        painter.drawText(QRect(-50, -50, 100, 100), Qt.AlignCenter, "Qt")
dropsite.py 文件源码 项目:Mac-Python-3.X 作者: L1nwatch 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def __init__(self, parent = None):
        super(DropArea, self).__init__(parent)

        self.setMinimumSize(200, 200)
        self.setFrameStyle(QFrame.Sunken | QFrame.StyledPanel)
        self.setAlignment(Qt.AlignCenter)
        self.setAcceptDrops(True)
        self.setAutoFillBackground(True)
        self.clear()
screenshot.py 文件源码 项目:Mac-Python-3.X 作者: L1nwatch 项目源码 文件源码 阅读 35 收藏 0 点赞 0 评论 0
def __init__(self):
        super(Screenshot, self).__init__()

        self.screenshotLabel = QLabel()
        self.screenshotLabel.setSizePolicy(QSizePolicy.Expanding,
                QSizePolicy.Expanding)
        self.screenshotLabel.setAlignment(Qt.AlignCenter)
        self.screenshotLabel.setMinimumSize(240, 160)

        self.createOptionsGroupBox()
        self.createButtonsLayout()

        mainLayout = QVBoxLayout()
        mainLayout.addWidget(self.screenshotLabel)
        mainLayout.addWidget(self.optionsGroupBox)
        mainLayout.addLayout(self.buttonsLayout)
        self.setLayout(mainLayout)

        self.shootScreen()
        self.delaySpinBox.setValue(5)

        self.setWindowTitle("Screenshot")
        self.resize(300, 200)
ovirtclient.py 文件源码 项目:ovirt-desktop-client 作者: nkovacne 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def make_button(self, filename, tooltip, alignment=Qt.AlignCenter):
        """
            Description: Creates a QLabel which will contain an image and will
                         simulate a button. No associated text will be shown.
            Arguments: 1. filename: The filename of the icon/image to show 
                       2. tooltip: Some text to show as a tooltip to the image
                       3. alignment: Alignment of the button (center by default)
            Returns: The created QLabel button
        """

        global STANDARDCELLCSS, IMGDIR

        filepath = '%s%s%s' % (IMGDIR, filename, '.png')
        icon = QImage(filepath)
        image = QLabel()
        image.setToolTip('<span style="color:#B9B900">%s</span>' % (tooltip))
        image.setStyleSheet(STANDARDCELLCSS)
        image.setPixmap(QPixmap.fromImage(icon))
        image.setAlignment(alignment)

        return image
schema.py 文件源码 项目:examples 作者: pyqt 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def __init__(self):
        super(MainWindow, self).__init__()

        self.setupUi(self)

        XmlSyntaxHighlighter(self.schemaView.document())
        XmlSyntaxHighlighter(self.instanceEdit.document())

        self.schemaSelection.addItem("Contact Schema")
        self.schemaSelection.addItem("Recipe Schema")
        self.schemaSelection.addItem("Order Schema")

        self.instanceSelection.addItem("Valid Contact Instance")
        self.instanceSelection.addItem("Invalid Contact Instance")

        self.schemaSelection.currentIndexChanged.connect(self.schemaSelected)
        self.instanceSelection.currentIndexChanged.connect(self.instanceSelected)
        self.validateButton.clicked.connect(self.validate)
        self.instanceEdit.textChanged.connect(self.textChanged)

        self.validationStatus.setAlignment(Qt.AlignCenter | Qt.AlignVCenter)

        self.schemaSelected(0)
        self.instanceSelected(0)
2dpainting.py 文件源码 项目:examples 作者: pyqt 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def paint(self, painter, event, elapsed):
        painter.fillRect(event.rect(), self.background)
        painter.translate(100, 100)

        painter.save()
        painter.setBrush(self.circleBrush)
        painter.setPen(self.circlePen)
        painter.rotate(elapsed * 0.030)

        r = elapsed / 1000.0
        n = 30
        for i in range(n):
            painter.rotate(30)
            radius = 0 + 120.0*((i+r)/n)
            circleRadius = 1 + ((i+r)/n)*20
            painter.drawEllipse(QRectF(radius, -circleRadius,
                    circleRadius*2, circleRadius*2))

        painter.restore()

        painter.setPen(self.textPen)
        painter.setFont(self.textFont)
        painter.drawText(QRect(-50, -50, 100, 100), Qt.AlignCenter, "Qt")
screenshot.py 文件源码 项目:examples 作者: pyqt 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self):
        super(Screenshot, self).__init__()

        self.screenshotLabel = QLabel()
        self.screenshotLabel.setSizePolicy(QSizePolicy.Expanding,
                QSizePolicy.Expanding)
        self.screenshotLabel.setAlignment(Qt.AlignCenter)
        self.screenshotLabel.setMinimumSize(240, 160)

        self.createOptionsGroupBox()
        self.createButtonsLayout()

        mainLayout = QVBoxLayout()
        mainLayout.addWidget(self.screenshotLabel)
        mainLayout.addWidget(self.optionsGroupBox)
        mainLayout.addLayout(self.buttonsLayout)
        self.setLayout(mainLayout)

        self.shootScreen()
        self.delaySpinBox.setValue(5)

        self.setWindowTitle("Screenshot")
        self.resize(300, 200)
BFMainWindow.py 文件源码 项目:BannerFactory 作者: xuning0 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self):
        super().__init__()
        self.opened_image_path = None
        self.opened_image = None
        self.processed_image = None

        self.image_view = QLabel()
        self.image_view.setStyleSheet('QLabel { background-color : black; }')
        self.image_view.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
        self.image_view.setAlignment(Qt.AlignCenter)

        self.combo_box = QComboBox()
        self.combo_box.addItems(tag_types)
        for i in range(len(tag_types)):
            self.combo_box.setItemData(i, QColor(*(ImageProcess.TAG_COLOR_LIST[i])), Qt.ForegroundRole)

        self.tag_edit = QLineEdit()
        self.title_edit = QLineEdit()
        self.desc_edit = QLineEdit()

        self.setup_ui()
widgets.py 文件源码 项目:BigBrotherBot-For-UrT43 作者: ptitbigorneau 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def initUI(self):
        """
        Initialize the Help label user interface.
        """
        self.setText('drop your configuration(s) file here')
        self.setFixedSize(594, GEOMETRY[b3.getPlatform()]['MAIN_TABLE_HEIGHT'])
        self.setAlignment(Qt.AlignCenter)
        self.setVisible(len(B3App.Instance().processes) == 0)
        self.setAcceptDrops(True)
        self.setStyleSheet("""
        QLabel {
            background: transparent;
            font-size: 20px;
            font-style: italic;
            color: #CCCCCC;
        }
        """)

    ############################################# EVENT HANDLERS #######################################################


问题


面经


文章

微信
公众号

扫码关注公众号