本文整理汇总了Python中PyQt5.QtWidgets.QStatusBar.setObjectName方法的典型用法代码示例。如果您正苦于以下问题:Python QStatusBar.setObjectName方法的具体用法?Python QStatusBar.setObjectName怎么用?Python QStatusBar.setObjectName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QStatusBar
的用法示例。
在下文中一共展示了QStatusBar.setObjectName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Main_Window
# 需要导入模块: from PyQt5.QtWidgets import QStatusBar [as 别名]
# 或者: from PyQt5.QtWidgets.QStatusBar import setObjectName [as 别名]
class Main_Window(QMainWindow):
def __init__(self):
super(Main_Window, self).__init__()
self.menubar = QMenuBar(self)
self.statusbar = QStatusBar(self)
self.centralwidget = QWidget(self)
self.image_view = Image_View(self.centralwidget)
self.horizontal_slider = QSlider(self.centralwidget)
self.setup_ui()
def setup_ui(self):
# 1. self info
self.setObjectName("Demo_1")
self.resize(800, 600)
# 2.1 sub widgets
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 22))
self.menubar.setObjectName("menubar")
self.setMenuBar(self.menubar)
# 2.2
self.statusbar.setObjectName("statusbar")
self.setStatusBar(self.statusbar)
# 2.3
self.centralwidget.setObjectName("centralwidget")
self.setCentralWidget(self.centralwidget)
self.image_view.setGeometry(QtCore.QRect(144, 10, 512, 512))
self.image_view.setObjectName("image_view")
self.horizontal_slider.setGeometry(QtCore.QRect(144, 530, 512, 22))
self.horizontal_slider.setOrientation(QtCore.Qt.Horizontal)
self.horizontal_slider.setObjectName("horizontal_slider")
# 3 signals and slots
self.horizontal_slider.valueChanged['int'].connect(self.image_view.repaint)
示例2: EditorMainWindow
# 需要导入模块: from PyQt5.QtWidgets import QStatusBar [as 别名]
# 或者: from PyQt5.QtWidgets.QStatusBar import setObjectName [as 别名]
#.........这里部分代码省略.........
except:
traceback.print_exc()
def button_terrain_load_action(self):
try:
print("ok", self.default_path)
filepath, choosentype = QFileDialog.getOpenFileName(
self, "Open File",
self.default_path,
"BW terrain files (*.out *out.gz);;All files (*)")
print("doooone")
if filepath:
if filepath.endswith(".gz"):
file_open = gzip.open
else:
file_open = open
with file_open(filepath, "rb") as f:
try:
terrain = BWArchiveBase(f)
if self.level is not None:
waterheight = get_water_height(self.level)
else:
waterheight = None
image, light_image = parse_terrain_to_image(terrain, waterheight)
self.bw_map_screen.set_terrain(image, light_image)
except:
traceback.print_exc()
except:
traceback.print_exc()
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(820, 760)
MainWindow.setMinimumSize(QSize(720, 560))
MainWindow.setWindowTitle("BW-MapEdit")
#MainWindow.setWindowTitle("Nep-Nep")
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
MainWindow.setCentralWidget(self.centralwidget)
self.horizontalLayout = QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName("horizontalLayout")
self.scrollArea = QScrollArea(self.centralwidget)
self.scrollArea.setWidgetResizable(True)
self.bw_map_screen = BWMapViewer(self.centralwidget)
self.scrollArea.setWidget(self.bw_map_screen)
self.horizontalLayout.addWidget(self.scrollArea)
#self.horizontalLayout.addWidget(self.bw_map_screen)
self.entity_list_widget = BWEntityListWidget(self.centralwidget)
self.entity_list_widget.setMaximumSize(QSize(300, 16777215))
self.entity_list_widget.setObjectName("entity_list_widget")
self.horizontalLayout.addWidget(self.entity_list_widget)
spacerItem = QSpacerItem(10, 20, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.horizontalLayout.addItem(spacerItem)
self.vertLayoutWidget = QWidget(self.centralwidget)
示例3: StringsEditorMainWindow
# 需要导入模块: from PyQt5.QtWidgets import QStatusBar [as 别名]
# 或者: from PyQt5.QtWidgets.QStatusBar import setObjectName [as 别名]
#.........这里部分代码省略.........
if filepath:
print("resetting")
self.reset()
print("done")
with open(filepath, "rb") as f:
try:
self.stringfile = BWLanguageFile(f)
for i, msg in enumerate(self.stringfile.messages):
entry = BWEntityEntry(i, "({0}): '{1}'-'{2}'".format(i,
msg.get_path(),
msg.get_message()))
self.strings_list.addItem(entry)
pass
self.default_path = filepath
except Exception as error:
print("error", error)
traceback.print_exc()
except Exception as er:
print("errrorrr", error)
traceback.print_exc()
print("loaded")
def button_save_strings(self):
if self.stringfile is not None:
filepath, choosentype = QFileDialog.getSaveFileName(
self, "Save File",
self.default_path,
"BW level files (*.str);;All files (*)")
print(filepath, "saved")
if filepath:
with open(filepath, "wb") as f:
self.stringfile.write(f)
self.default_path = filepath
set_default_path(filepath)
else:
pass # no level loaded, do nothing
def setup_ui(self):
self.setObjectName("MainWindow")
self.resize(820, 760)
self.setMinimumSize(QSize(720, 560))
self.setWindowTitle("BW-StringsEdit")
self.centralwidget = QWidget(self)
self.centralwidget.setObjectName("centralwidget")
self.setCentralWidget(self.centralwidget)
self.horizontalLayout = QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName("horizontalLayout")
self.strings_list = QListWidget(self.centralwidget)
self.horizontalLayout.addWidget(self.strings_list)
self.vertLayoutWidget = QWidget(self.centralwidget)
self.verticalLayout = QVBoxLayout(self.vertLayoutWidget)
self.button_add_message = QPushButton(self.centralwidget)
self.button_remove_message = QPushButton(self.centralwidget)
self.button_set_message = QPushButton(self.centralwidget)
self.button_add_message.setText("Add Message")
self.button_remove_message.setText("Delete Last Message")
self.button_set_message.setText("Set Message Content")
self.lineedit_path = QLineEdit(self.centralwidget)
self.lineedit_audioname = QLineEdit(self.centralwidget)
self.lineedit_playtime = QLineEdit(self.centralwidget)
self.textedit_content = QTextEdit(self.centralwidget)
for widget in ( self.button_remove_message, self.button_add_message, self.button_set_message,
self.lineedit_path, self.lineedit_audioname, self.lineedit_playtime, self.textedit_content):
self.verticalLayout.addWidget(widget)
self.horizontalLayout.addWidget(self.vertLayoutWidget)
self.menubar = self.menuBar()#QMenuBar(self)
#self.menubar.setGeometry(QRect(0, 0, 820, 30))
#self.menubar.setObjectName("menubar")
self.file_menu = self.menubar.addMenu("File")#QMenu(self.menubar)
self.file_menu.setObjectName("menuLoad")
#self.menubar.addMenu(self.file_menu)
self.file_load_action = QAction("Load", self)
self.file_load_action.triggered.connect(self.button_load_strings)
self.file_menu.addAction(self.file_load_action)
self.file_save_action = QAction("Save", self)
self.file_save_action.triggered.connect(self.button_save_strings)
self.file_menu.addAction(self.file_save_action)
self.statusbar = QStatusBar(self)
self.statusbar.setObjectName("statusbar")
self.setStatusBar(self.statusbar)
#self.setMenuBar(self.menubar)
print("done")
示例4: MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QStatusBar [as 别名]
# 或者: from PyQt5.QtWidgets.QStatusBar import setObjectName [as 别名]
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.lastyear = int(time.strftime('%Y', time.localtime(time.time()))) - 1
self.in_parameters = {u'datetime': str(self.lastyear) + u'年',
u'target_area': u'绍兴市',
u'density_cell': u'10',
u'density_class': 10,
u'day_cell': u'15',
u'day_class': 10,
u'out_type': u'tiff'}
self.setupUi()
def setupUi(self):
self.setObjectName("MainWindow")
self.setFixedSize(1040, 915)
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
self.setSizePolicy(sizePolicy)
icon = QIcon()
icon.addPixmap(QPixmap('./resource/weather-thunder.png'),QIcon.Normal, QIcon.Off)
self.setWindowIcon(icon)
self.centralwidget = QWidget(self)
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
self.centralwidget.setSizePolicy(sizePolicy)
self.centralwidget.setObjectName("centralwidget")
self.layoutWidget = QWidget(self.centralwidget)
self.layoutWidget.setGeometry(QRect(32, 10, 979, 851))
self.layoutWidget.setObjectName("layoutWidget")
self.verticalLayout_5 =QVBoxLayout(self.layoutWidget)
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.horizontalLayout = QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem = QSpacerItem(300, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.datetime_label = QLabel(self.layoutWidget)
self.datetime_label.setObjectName("datetime_label")
self.horizontalLayout.addWidget(self.datetime_label)
self.datetime = QDateEdit(self.layoutWidget)
self.datetime.setDateTime(QDateTime(QDate(self.lastyear, 1, 1), QTime(0, 0, 0)))
self.datetime.setObjectName("datetime")
self.horizontalLayout.addWidget(self.datetime)
spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem1)
self.target_area_label = QLabel(self.layoutWidget)
self.target_area_label.setObjectName("target_area_label")
self.horizontalLayout.addWidget(self.target_area_label)
self.target_area = QComboBox(self.layoutWidget)
self.target_area.setObjectName("target_area")
self.target_area.addItem("")
self.target_area.addItem("")
self.target_area.addItem("")
self.target_area.addItem("")
self.target_area.addItem("")
self.target_area.addItem("")
self.horizontalLayout.addWidget(self.target_area)
spacerItem2 = QSpacerItem(300, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem2)
self.verticalLayout_5.addLayout(self.horizontalLayout)
self.tabWidget = QTabWidget(self.layoutWidget)
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
self.tabWidget.setSizePolicy(sizePolicy)
self.tabWidget.setObjectName("tabWidget")
self.density_tab = QWidget()
self.density_tab.setObjectName("density_tab")
self.verticalLayout_3 =QVBoxLayout(self.density_tab)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.verticalLayout_2 =QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.horizontalLayout_2 = QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.density_cell_label = QLabel(self.density_tab)
self.density_cell_label.setObjectName("density_cell_label")
self.horizontalLayout_2.addWidget(self.density_cell_label)
self.density_cell = QSpinBox(self.density_tab)
self.density_cell.setProperty("value", 10)
self.density_cell.setObjectName("density_cell")
self.horizontalLayout_2.addWidget(self.density_cell)
spacerItem3 = QSpacerItem(40, 0, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem3)
self.density_class_label = QLabel(self.density_tab)
self.density_class_label.setObjectName("density_class_label")
self.horizontalLayout_2.addWidget(self.density_class_label)
self.density_class = QSpinBox(self.density_tab)
self.density_class.setProperty("value", 10)
self.density_class.setObjectName("density_class")
self.horizontalLayout_2.addWidget(self.density_class)
spacerItem4 = QSpacerItem(478, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem4)
self.density_mxd = QPushButton(self.density_tab)
#.........这里部分代码省略.........
示例5: Ui_MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QStatusBar [as 别名]
# 或者: from PyQt5.QtWidgets.QStatusBar import setObjectName [as 别名]
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(500, 262)
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.button_find_id = QPushButton(self.centralwidget)
self.button_find_id.setGeometry(QtCore.QRect(370, 10, 110, 32))
self.button_find_id.setObjectName(_fromUtf8("button_find_id"))
self.button_find_name = QPushButton(self.centralwidget)
self.button_find_name.setGeometry(QtCore.QRect(370, 50, 110, 32))
self.button_find_name.setObjectName(_fromUtf8("button_find_name"))
self.button_find_cas = QPushButton(self.centralwidget)
self.button_find_cas.setGeometry(QtCore.QRect(370, 90, 110, 32))
self.button_find_cas.setObjectName(_fromUtf8("button_find_cas"))
self.button_find_vpid = QPushButton(self.centralwidget)
self.button_find_vpid.setGeometry(QtCore.QRect(370, 130, 110, 32))
self.button_find_vpid.setObjectName(_fromUtf8("button_find_cas"))
self.button_add = QPushButton(self.centralwidget)
self.button_add.setGeometry(QtCore.QRect(150, 180, 110, 32))
self.button_add.setObjectName(_fromUtf8("button_add"))
self.button_stop = QPushButton(self.centralwidget)
self.button_stop.setGeometry(QtCore.QRect(150, 210, 110, 32))
self.button_stop.setObjectName(_fromUtf8("button_stop"))
self.button_invent = QPushButton(self.centralwidget)
self.button_invent.setGeometry(QtCore.QRect(20, 180, 120, 32))
self.button_invent.setObjectName(_fromUtf8("button_invent"))
self.button_invent_2 = QPushButton(self.centralwidget)
self.button_invent_2.setGeometry(QtCore.QRect(20, 210, 120, 32))
self.button_invent_2.setObjectName(_fromUtf8("button_invent_2"))
self.button_delete = QPushButton(self.centralwidget)
self.button_delete.setGeometry(QtCore.QRect(260, 210, 120, 32))
self.button_delete.setObjectName(_fromUtf8("button_delete"))
self.button_manual = QPushButton(self.centralwidget)
self.button_manual.setGeometry(QtCore.QRect(260, 180, 120, 32))
self.button_manual.setObjectName(_fromUtf8("button_delete"))
self.button_repop = QPushButton(self.centralwidget)
self.button_repop.setGeometry(QtCore.QRect(380, 195, 110, 32))
self.button_repop.setObjectName(_fromUtf8("button_repop"))
self.line_id = QLineEdit(self.centralwidget)
self.line_id.setGeometry(QtCore.QRect(90, 10, 251, 21))
self.line_id.setObjectName(_fromUtf8("line_id"))
self.line_name = QLineEdit(self.centralwidget)
self.line_name.setGeometry(QtCore.QRect(90, 50, 251, 21))
self.line_name.setObjectName(_fromUtf8("line_name"))
self.line_cas = QLineEdit(self.centralwidget)
self.line_cas.setGeometry(QtCore.QRect(90, 90, 251, 21))
self.line_cas.setObjectName(_fromUtf8("line_cas"))
self.line_vpid = QLineEdit(self.centralwidget)
self.line_vpid.setGeometry(QtCore.QRect(90, 130, 251, 21))
self.line_vpid.setObjectName(_fromUtf8("line_cas"))
self.label_id = QLabel(self.centralwidget)
self.label_id.setGeometry(QtCore.QRect(10, 10, 56, 13))
self.label_id.setObjectName(_fromUtf8("label_id"))
self.label_name = QLabel(self.centralwidget)
self.label_name.setGeometry(QtCore.QRect(10, 50, 56, 13))
self.label_name.setObjectName(_fromUtf8("label_name"))
self.label_cas = QLabel(self.centralwidget)
self.label_cas.setGeometry(QtCore.QRect(10, 90, 56, 13))
self.label_cas.setObjectName(_fromUtf8("label_cas"))
self.label_vpid = QLabel(self.centralwidget)
self.label_vpid.setGeometry(QtCore.QRect(10, 130, 56, 13))
self.label_vpid.setObjectName(_fromUtf8("label_cas"))
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 500, 22))
self.menubar.setObjectName(_fromUtf8("menubar"))
MainWindow.setMenuBar(self.menubar)
self.statusbar = QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
#connection
#self.trigger=QtCore.pyqtSignal()
#self.trigger.connect(self.button_add, QtCore.SIGNAL("released()"), self.new)
#self.connect(self.button_stop, QtCore.SIGNAL("released()"), self.quit)
#self.connect(self.button_find_id, QtCore.SIGNAL("released()"), self.find_id)
#self.connect(self.button_find_name, QtCore.SIGNAL("released()"), self.find_name)
#self.connect(self.button_find_vpid, QtCore.SIGNAL("released()"), self.find_vpid)
#self.connect(self.button_find_cas, QtCore.SIGNAL("released()"), self.find_cas)
#self.connect(self.button_invent, QtCore.SIGNAL("released()"), self.invent)
#self.connect(self.button_invent_2, QtCore.SIGNAL("released()"), self.invent_2)
#self.connect(self.button_delete, QtCore.SIGNAL("released()"), self.delete)
#self.connect(self.button_manual, QtCore.SIGNAL("released()"), self.manu)
#self.connect(self.button_repop, QtCore.SIGNAL("released()"), self.repop)
self.button_stop.clicked.connect(self.quit)
self.button_add.clicked.connect(self.new)
self.button_find_id.clicked.connect(self.find_id)
#.........这里部分代码省略.........
示例6: DeckEditorMainWindow
# 需要导入模块: from PyQt5.QtWidgets import QStatusBar [as 别名]
# 或者: from PyQt5.QtWidgets.QStatusBar import setObjectName [as 别名]
#.........这里部分代码省略.........
deck.setText("[CPU] {0:>7} [rank:{1:>1}] {2}".format(leader, rank,cardname))
self.deck_list.addItem(deck)
print("loaded decks")
except Exception as error:
print("error", error)
except Exception as er:
print("errrorrr", error)
traceback.print_exc()
print("loaded")
def button_save_decks(self):
if self.deck_data is not None:
filepath, choosentype = QFileDialog.getSaveFileName(
self, "Save File",
self.default_path,
"PS2 iso (*.iso);;All files (*)")
print(filepath, "saved")
if filepath:
with open(filepath, "r+b") as f:
f.seek(STARTER_DECK_OFFSET)
f.write(self.deck_data[0:17*41*2])
f.seek(CPU_DECK_OFFSET)
f.write(self.deck_data[17*41*2:17*41*2+24*41*2])
self.default_path = filepath
set_default_path(filepath)
else:
pass # no level loaded, do nothing
def setup_ui(self):
self.setObjectName("MainWindow")
self.resize(820, 760)
self.setMinimumSize(QSize(720, 560))
self.setWindowTitle("Yugioh Duelist of Roses - Deck Edit")
self.centralwidget = QWidget(self)
self.centralwidget.setObjectName("centralwidget")
self.setCentralWidget(self.centralwidget)
self.horizontalLayout = QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName("horizontalLayout")
self.deck_list = QListWidget(self.centralwidget)
self.horizontalLayout.addWidget(self.deck_list)
self.vertLayoutWidget = QWidget(self.centralwidget)
self.verticalLayout = QVBoxLayout(self.vertLayoutWidget)
self.button_set_deck = QPushButton(self.centralwidget)
self.button_set_deck.setText("Set Deck")
self.leader_layoutwidget = QWidget(self.centralwidget)
self.leader_layout = QHBoxLayout(self.leader_layoutwidget)
self.leader_layoutwidget.setLayout(self.leader_layout)
self.lineedit_leader = QLineEdit(self.centralwidget)
self.leader_label = QLabel(self.centralwidget)
self.leader_layout.addWidget(self.lineedit_leader)
self.leader_layout.addWidget(self.leader_label)
self.lineedit_leader_rank = QLineEdit(self.centralwidget)
for widget in (self.button_set_deck, self.leader_layoutwidget, self.lineedit_leader_rank):