本文整理汇总了Python中PyQt4.QtCore.Qt.AlignCenter方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.AlignCenter方法的具体用法?Python Qt.AlignCenter怎么用?Python Qt.AlignCenter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.AlignCenter方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignCenter [as 别名]
def __init__(self, parent, rect, myname):
self.myname = myname
self.rect = rect
QtGui.QLabel.__init__(self, parent)
self.pause = False
self.count = 0
self.img_list = []
self.img_inc = 1
self.get_images()
self.setObjectName("slideShow")
self.setGeometry(rect)
self.setStyleSheet("#slideShow { background-color: " +
Config.slide_bg_color + "; }")
self.setAlignment(Qt.AlignHCenter | Qt.AlignCenter)
示例2: __init__
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignCenter [as 别名]
def __init__(self, tableName=None, layer=None, size=None, rows=None):
CartoDBDatasetsListItem.__init__(self, tableName, None, size, rows)
'''
self.ui.statusLB = QLabel(self)
self.ui.statusLB.setMaximumSize(QSize(100, 16777215))
self.ui.statusLB.setAlignment(Qt.AlignCenter | Qt.AlignTrailing | Qt.AlignVCenter)
self.ui.statusLB.setWordWrap(True)
self.ui.horizontalLayout.insertWidget(1, self.ui.statusLB)
'''
self.ui.statusBar = QProgressBar(self)
self.ui.statusBar.setProperty("value", 0)
self.ui.statusBar.setFormat("Init")
self.ui.statusBar.setAutoFillBackground(True)
self.ui.statusBar.hide()
self.ui.horizontalLayout.insertWidget(1, self.ui.statusBar)
self.layer = layer
示例3: initUI
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignCenter [as 别名]
def initUI(self):
self.vbox = QVBoxLayout()
self.heading = QLabel()
self.size= "480x360"
#self.source="the-times-of-india"
self.fbox = QFormLayout()
self.fbox.setAlignment(Qt.AlignLeft)
self.fbox.setSpacing(8)
self.heading.setAlignment(Qt.AlignCenter)
self.heading.setFont(font2)
self.vbox.addWidget(self.heading)
self.vbox.addLayout(self.fbox)
self.setLayout(self.vbox)
self.news_fetcher()
#self.addWidget(News)
#updating news
示例4: alignCenter
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignCenter [as 别名]
def alignCenter(self):
self.text.setAlignment(Qt.AlignCenter)
示例5: drawModeBox
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignCenter [as 别名]
def drawModeBox(self, qp, xy, col, txt):
#qp = QtGui.QPainter()
qp.save()
qp.translate(xy)
qp.setBrush(col.dark())
qp.setPen(QPen(col, 0.5, Qt.SolidLine))
qp.setFont(QFont('Monospace', 14, QFont.Monospace))
rh = 11
rw = 20
r=QRectF(-rw,-rh, 2*rw, 2*rh)
qp.drawRect(r)
qp.drawText(r, Qt.AlignCenter, txt)
qp.restore()
示例6: drawBar
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignCenter [as 别名]
def drawBar(self, qp, rect, col, txt, val, minVal=0, maxVal=100):
valN = (float(val)-minVal)/(maxVal-minVal)*100.
percent = min(max(valN,0),100)
#qp = QtGui.QPainter()
qp.setBrush(QColor(0,0,0,0))
qp.setPen(col)
qp.drawRect(rect)
qp.setBrush(col.light())
qp.drawText(rect, Qt.AlignCenter, txt)
qp.setBrush(col.dark())
qp.drawRect(QRectF(rect.left(), rect.top(), rect.width()/100.*percent, rect.height()))
示例7: __init__
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignCenter [as 别名]
def __init__(self, controller, parent = None):
super(AboutDialog, self).__init__(parent)
self.controller = controller
self.different_version = True
#self.actual_version = '1.0.2'
self.your_version = self.controller.app_config.version
self.slic3r_version = self.controller.slicer_manager.get_version()
layout = QVBoxLayout(self)
self.prusa_control_label = QLabel("PrusaControl")
self.prusa_control_label.setAlignment(Qt.AlignCenter)
self.prusa_control_text = QLabel(controller.view.tr("PrusaControl\nTibor Vavra, Prusa Research\nDominik Cisar, Prusa Research\n\nSlic3r engine\nVojtech Bubnik, Prusa Research\nAlessandro Ranellucci"))
self.local_version_label = QLabel(controller.view.tr("PrusaControl version is ") + str(self.your_version))
self.slic3r_engine_version_label = QLabel(controller.view.tr("Slic3r engine version is ") + str(self.slic3r_version))
#self.check_version_button = QtGui.QPushButton(self.tr("Check version"))
#TODO:Doplnit
#self.checkVersionButton.clicked.connect(self.controller.checkVersion)
#self.checkVersionButton.setEnabled(self.differentVersion)
layout.addWidget(self.prusa_control_label)
layout.addWidget(self.prusa_control_text)
layout.addWidget(self.local_version_label)
layout.addWidget(self.slic3r_engine_version_label)
#layout.addWidget(self.check_version_button)
# Close button
buttons = QDialogButtonBox(
QDialogButtonBox.Ok,
Qt.Horizontal, self)
buttons.clicked.connect(self.close)
layout.addWidget(buttons)
示例8: set_progress_bar
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignCenter [as 别名]
def set_progress_bar(self, value):
self.progressBar.setValue(value)
#self.progressBar.setAlignment(Qt.AlignCenter)
示例9: initUI
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignCenter [as 别名]
def initUI(self):
self.points = []
self.init_points()
self.rangeMin = 0.
self.rangeMax = 0.
self.max_label = QLabel(self)
self.max_label.setObjectName("gcode_slider_max_label")
#self.max_label.setFixedWidth(150)
self.max_label.setText("Max")
self.max_label.setAlignment(Qt.AlignCenter)
self.min_label = QLabel(self)
self.min_label.setObjectName("gcode_slider_min_label")
self.min_label.setText("Min")
self.min_label.setAlignment(Qt.AlignCenter)
main_layout = QVBoxLayout(self)
main_layout.setAlignment(Qt.AlignCenter)
self.slider = QSlider()
self.slider.setOrientation(Qt.Vertical)
#self.slider.setFixedWidth(144)
#self.connect(self.slider, SIGNAL("valueChanged(int)"), self.set_value_label)
self.slider.valueChanged.connect(self.set_value_label)
self.slider.setTickInterval(1)
self.value_label = QLabel(self)
self.value_label.setObjectName("gcode_slider_value_label")
self.value_label.setVisible(False)
self.value_label.setText(u"─ 0.00mm")
self.value_label.setFixedWidth((int)(70*self.controller.dpi_coef))
self.add_button = QPushButton("", self)
if self.controller.app_config.system_platform in ["Darwin"]:
self.add_button.setStyle(QStyleFactory.create("Macintosh"))
self.add_button.setObjectName("gcode_slider_add_button")
self.add_button.setVisible(False)
self.add_button.setFixedWidth((int)(20*self.controller.dpi_coef))
self.add_button.setToolTip(self.tr("Add color change point"))
self.add_button.clicked.connect(self.add_point)
main_layout.addWidget(self.max_label)
main_layout.addWidget(self.slider)
main_layout.addWidget(self.min_label)
self.setLayout(main_layout)
self.style = QApplication.style()
self.opt = QStyleOptionSlider()
self.slider.initStyleOption(self.opt)
self.set_value_label(0.00)