本文整理汇总了Python中PySide.QtGui.QComboBox.setGeometry方法的典型用法代码示例。如果您正苦于以下问题:Python QComboBox.setGeometry方法的具体用法?Python QComboBox.setGeometry怎么用?Python QComboBox.setGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QComboBox
的用法示例。
在下文中一共展示了QComboBox.setGeometry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UiMain
# 需要导入模块: from PySide.QtGui import QComboBox [as 别名]
# 或者: from PySide.QtGui.QComboBox import setGeometry [as 别名]
#.........这里部分代码省略.........
super(UiMain, self).changeEvent(event)
def on_systray_activated(self, reason):
if reason == QSystemTrayIcon.DoubleClick:
self.show()
@staticmethod
def toggle_split(event):
# 0 = Qt.Unchecked The item is unchecked.
# 1 = Qt.PartiallyChecked The item is partially checked. Items in
# hierarchical models may be partially checked if some, but not all,
# of
# their children are checked.
# 2 = Qt.Checked The item is checked.
if event == 0:
Constants.OPTIONS['splitText'] = False
elif event == 2:
Constants.OPTIONS['splitText'] = True
def update(self):
""" Checks a webpage for current version, compares this to built-in
current versions, and shows update dialog if necessary
"""
try:
ver = urlopen('http://league-insanity.tk/Azeirah_content/version')\
.read()
except IOError:
# if for some reason it couldn't retrieve the version, set it to
# automatically ignore the update: False
ver = False
if not float(VERSION) >= float(ver):
self.popup = QDialog(self)
self.popup.setModal(True)
self.popup.setGeometry(200, 100, 500, 100)
self.popup.show()
self.popup_text = QLabel(self.popup)
self.popup_text.setGeometry(5, 5, 500, 30)
self.popup_text.setOpenExternalLinks(True)
self.popup_text.show()
self.popup_text.setText(
"""There is an update available. Run update.exe or <a href='https://sourceforge.net/projects/obsmusicstreamd'>download the update manually</a>""")
# reply = QMessageBox.question(Constants.UI, 'Message',
# "Do you want to update?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
# if reply == QMessageBox.Yes:
# import atexit
# import subprocess
# def runUpdater():
# import time
# time.sleep(3)
# subprocess.Popen(resource_path('update.exe'))
# atexit.register(runUpdater)
# sys.exit()
# Constants.update_dialog = QWidget()
# Constants.update_dialog.resize(350, 100)
# Constants.update_dialog.setWindowIcon(QIcon(resource_path\
# ('icon.png')))
# Constants.update_dialog.setWindowTitle('Updater')
# Constants.update_dialog_lbl = QLabel(Constants.update_dialog)
# Constants.update_dialog_lbl.setGeometry(10, 40, 340, 12)
# Constants.update_dialog.show()
# updateThread = Thread(target = update.update)
# updateThread.setName('updateThread')
示例2: Ui_MainWindow
# 需要导入模块: from PySide.QtGui import QComboBox [as 别名]
# 或者: from PySide.QtGui.QComboBox import setGeometry [as 别名]
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.setFixedSize(800, 600)
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.FilterLbl = QLabel(self.centralwidget)
self.FilterLbl.setGeometry(QtCore.QRect(30, 150, 60, 15))
self.FilterLbl.setObjectName("FilterLbl")
self.FilterCB = QComboBox(self.centralwidget)
self.FilterCB.setGeometry(QtCore.QRect(450, 150, 100, 22))
self.FilterCB.setObjectName("FilterCB")
self.FilterCB.addItem("")
self.FilterCB.addItem("")
self.FilterCB.addItem("")
self.FilterCB.addItem("")
self.FilterTF = QLineEdit(self.centralwidget)
self.FilterTF.setGeometry(QtCore.QRect(100, 150, 320, 20))
self.tableView = QTableWidget(self.centralwidget)
self.tableView.setGeometry(QtCore.QRect(10, 180, 781, 511))
self.tableView.setObjectName("tableView")
self.tableView.setColumnCount(4)
self.tableView.setRowCount(0)
item = QTableWidgetItem("Cena za kg/l")
self.tableView.setHorizontalHeaderItem(0, item)
item = QTableWidgetItem("Cena ze kus")
self.tableView.setHorizontalHeaderItem(1, item)
item = QTableWidgetItem(u"Gramaž")
self.tableView.setHorizontalHeaderItem(2, item)
item = QTableWidgetItem("Popis")
item.setTextAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter|QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setPointSize(8)
item.setFont(font)
self.tableView.setHorizontalHeaderItem(3, item)
self.tableView.horizontalHeader().setStretchLastSection(True)
self.SaveBtn = QPushButton(self.centralwidget)
self.SaveBtn.setGeometry(QtCore.QRect(30, 10, 100, 23))
self.SaveBtn.setObjectName("SaveBtn")
self.PrintSelectedToFileBtn = QPushButton(self.centralwidget)
self.PrintSelectedToFileBtn.setGeometry(QtCore.QRect(225, 10, 100, 23))
self.PrintSelectedToFileBtn.setObjectName("PrintSelectedToFileBtn")
self.PriceForUnitTF = QLineEdit(self.centralwidget)
self.PriceForUnitTF.setGeometry(QtCore.QRect(100, 70, 113, 20))
self.PriceForUnitTF.setObjectName("PriceForUnitTF")
self.PriceForUnitLbl = QLabel(self.centralwidget)
self.PriceForUnitLbl.setGeometry(QtCore.QRect(30, 70, 60, 13))
self.PriceForUnitLbl.setObjectName("PriceForUnitLbl")
self.ArtikelTF = QLineEdit(self.centralwidget)
self.ArtikelTF.setGeometry(QtCore.QRect(100, 100, 113, 20))
self.ArtikelTF.setObjectName("ArtikelTF")
self.ArtikelLbl = QLabel(self.centralwidget)
self.ArtikelLbl.setGeometry(QtCore.QRect(30, 100, 46, 13))
self.ArtikelLbl.setObjectName("ArtikelLbl")
self.DescriptionLbl = QLabel(self.centralwidget)
self.DescriptionLbl.setGeometry(QtCore.QRect(455, 70, 75, 13))
self.DescriptionLbl.setObjectName("DescriptionLbl")
self.UnitLbl = QLabel(self.centralwidget)
self.UnitLbl.setGeometry(QtCore.QRect(250, 70, 60, 15))
self.UnitLbl.setObjectName("UnitLbl")
self.WeightLbl = QLabel(self.centralwidget)
self.WeightLbl.setGeometry(QtCore.QRect(250, 100, 60, 13))
self.WeightLbl.setObjectName("UnitLbl")
self.WeightTF = QLineEdit(self.centralwidget)
self.WeightTF.setGeometry(QtCore.QRect(320, 100, 100, 20))
self.WeightTF.setObjectName("WeightTF")
self.UnitCB = QComboBox(self.centralwidget)
self.UnitCB.setGeometry(QtCore.QRect(320, 70, 100, 22))
self.UnitCB.setObjectName("UnitCB")
self.UnitCB.addItem("")
self.UnitCB.addItem("")
self.DescriptionTE = QPlainTextEdit(self.centralwidget)
self.DescriptionTE.setGeometry(QtCore.QRect(540, 30, 241, 61))
self.DescriptionTE.setObjectName("DescriptionTE")
self.PrintToFileBtn = QPushButton(self.centralwidget)
self.PrintToFileBtn.setGeometry(QtCore.QRect(140, 10, 75, 23))
self.PrintToFileBtn.setObjectName("PrintToFileBtn")
self.AddRecordBtn = QPushButton(self.centralwidget)
self.AddRecordBtn.setGeometry(QtCore.QRect(450, 100, 75, 23))
self.AddRecordBtn.setObjectName("AddRecordBtn")
self.SaveChangeBtn = QPushButton(self.centralwidget)
self.SaveChangeBtn.setGeometry(QtCore.QRect(550, 100, 75, 23))
self.SaveChangeBtn.setObjectName("SaveChangeBtn")
self.DeleteRecordBtn = QPushButton(self.centralwidget)
self.DeleteRecordBtn.setGeometry(QtCore.QRect(650, 100, 75, 23))
self.DeleteRecordBtn.setObjectName("DeleteRecordBtn")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
self.FilterTF.textChanged.connect(self.on_lineEdit_textChanged)
self.FilterCB.currentIndexChanged.connect(self.on_comboBox_currentIndexChanged)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
#.........这里部分代码省略.........