本文整理汇总了Python中PyQt5.QtWidgets.QMenuBar.setGeometry方法的典型用法代码示例。如果您正苦于以下问题:Python QMenuBar.setGeometry方法的具体用法?Python QMenuBar.setGeometry怎么用?Python QMenuBar.setGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QMenuBar
的用法示例。
在下文中一共展示了QMenuBar.setGeometry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Main_Window
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [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: DirectoriesDialog
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
class DirectoriesDialog(QMainWindow):
def __init__(self, app, **kwargs):
super().__init__(None, **kwargs)
self.app = app
self.lastAddedFolder = platform.INITIAL_FOLDER_IN_DIALOGS
self.recentFolders = Recent(self.app, 'recentFolders')
self._setupUi()
self._updateScanTypeList()
self.directoriesModel = DirectoriesModel(self.app.model.directory_tree, view=self.treeView)
self.directoriesDelegate = DirectoriesDelegate()
self.treeView.setItemDelegate(self.directoriesDelegate)
self._setupColumns()
self.app.recentResults.addMenu(self.menuLoadRecent)
self.app.recentResults.addMenu(self.menuRecentResults)
self.recentFolders.addMenu(self.menuRecentFolders)
self._updateAddButton()
self._updateRemoveButton()
self._updateLoadResultsButton()
self._updateActionsState()
self._setupBindings()
def _setupBindings(self):
self.appModeRadioBox.itemSelected.connect(self.appModeButtonSelected)
self.showPreferencesButton.clicked.connect(self.app.actionPreferences.trigger)
self.scanButton.clicked.connect(self.scanButtonClicked)
self.loadResultsButton.clicked.connect(self.actionLoadResults.trigger)
self.addFolderButton.clicked.connect(self.actionAddFolder.trigger)
self.removeFolderButton.clicked.connect(self.removeFolderButtonClicked)
self.treeView.selectionModel().selectionChanged.connect(self.selectionChanged)
self.app.recentResults.itemsChanged.connect(self._updateLoadResultsButton)
self.recentFolders.itemsChanged.connect(self._updateAddButton)
self.recentFolders.mustOpenItem.connect(self.app.model.add_directory)
self.directoriesModel.foldersAdded.connect(self.directoriesModelAddedFolders)
self.app.willSavePrefs.connect(self.appWillSavePrefs)
def _setupActions(self):
# (name, shortcut, icon, desc, func)
ACTIONS = [
('actionLoadResults', 'Ctrl+L', '', tr("Load Results..."), self.loadResultsTriggered),
('actionShowResultsWindow', '', '', tr("Results Window"), self.app.showResultsWindow),
('actionAddFolder', '', '', tr("Add Folder..."), self.addFolderTriggered),
]
createActions(ACTIONS, self)
def _setupMenu(self):
self.menubar = QMenuBar(self)
self.menubar.setGeometry(QRect(0, 0, 42, 22))
self.menuFile = QMenu(self.menubar)
self.menuFile.setTitle(tr("File"))
self.menuView = QMenu(self.menubar)
self.menuView.setTitle(tr("View"))
self.menuHelp = QMenu(self.menubar)
self.menuHelp.setTitle(tr("Help"))
self.menuLoadRecent = QMenu(self.menuFile)
self.menuLoadRecent.setTitle(tr("Load Recent Results"))
self.setMenuBar(self.menubar)
self.menuFile.addAction(self.actionLoadResults)
self.menuFile.addAction(self.menuLoadRecent.menuAction())
self.menuFile.addSeparator()
self.menuFile.addAction(self.app.actionClearPictureCache)
self.menuFile.addSeparator()
self.menuFile.addAction(self.app.actionQuit)
self.menuView.addAction(self.app.actionPreferences)
self.menuView.addAction(self.actionShowResultsWindow)
self.menuView.addAction(self.app.actionIgnoreList)
self.menuHelp.addAction(self.app.actionShowHelp)
self.menuHelp.addAction(self.app.actionOpenDebugLog)
self.menuHelp.addAction(self.app.actionAbout)
self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuView.menuAction())
self.menubar.addAction(self.menuHelp.menuAction())
# Recent folders menu
self.menuRecentFolders = QMenu()
self.menuRecentFolders.addAction(self.actionAddFolder)
self.menuRecentFolders.addSeparator()
# Recent results menu
self.menuRecentResults = QMenu()
self.menuRecentResults.addAction(self.actionLoadResults)
self.menuRecentResults.addSeparator()
def _setupUi(self):
self.setWindowTitle(self.app.NAME)
self.resize(420, 338)
self.centralwidget = QWidget(self)
self.verticalLayout = QVBoxLayout(self.centralwidget)
hl = QHBoxLayout()
label = QLabel(tr("Application Mode:"), self)
label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
hl.addWidget(label)
self.appModeRadioBox = RadioBox(
self,
items=[tr("Standard"), tr("Music"), tr("Picture")],
spread=False
)
hl.addWidget(self.appModeRadioBox)
self.verticalLayout.addLayout(hl)
#.........这里部分代码省略.........
示例3: MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
class MainWindow(QMainWindow):
def __init__(self, app):
QMainWindow.__init__(self, None)
self.documentPath = None
self.doc = DocumentModel(app=app.model)
self.app = app
self._setupUi()
# Create base elements
self.model = MainWindowModel(document=self.doc)
self.model2view = {}
self.alookup = Lookup(self, model=self.model.account_lookup)
self.clookup = Lookup(self, model=self.model.completion_lookup)
self.drsel = DateRangeSelector(mainwindow=self, view=self.dateRangeSelectorView)
self.sfield = SearchField(model=self.model.search_field, view=self.searchLineEdit)
self.recentDocuments = Recent(self.app, 'recentDocuments')
self.recentDocuments.addMenu(self.menuOpenRecent)
self.doc.view = self
self.model.view = self
self._updateUndoActions()
self._bindSignals()
def _setupUi(self): # has to take place *before* base elements creation
self.setWindowTitle("moneyGuru")
self.resize(700, 580)
self.centralwidget = QWidget(self)
self.verticalLayout = QVBoxLayout(self.centralwidget)
self.verticalLayout.setSpacing(0)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.topBar = QWidget(self.centralwidget)
self.horizontalLayout_2 = QHBoxLayout(self.topBar)
self.horizontalLayout_2.setContentsMargins(2, 0, 2, 0)
spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.dateRangeSelectorView = DateRangeSelectorView(self.topBar)
self.dateRangeSelectorView.setMinimumSize(QSize(220, 0))
self.horizontalLayout_2.addWidget(self.dateRangeSelectorView)
spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem1)
self.searchLineEdit = SearchEdit(self.topBar)
self.searchLineEdit.setMaximumSize(QSize(240, 16777215))
self.horizontalLayout_2.addWidget(self.searchLineEdit)
self.verticalLayout.addWidget(self.topBar)
self.tabBar = TabBarPlus(self.centralwidget)
self.tabBar.setMinimumSize(QSize(0, 20))
self.verticalLayout.addWidget(self.tabBar)
self.mainView = QStackedWidget(self.centralwidget)
self.verticalLayout.addWidget(self.mainView)
# Bottom buttons & status label
self.bottomBar = QWidget(self.centralwidget)
self.horizontalLayout = QHBoxLayout(self.bottomBar)
self.horizontalLayout.setContentsMargins(2, 2, 2, 2)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.newItemButton = QPushButton(self.bottomBar)
buttonSizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Fixed)
buttonSizePolicy.setHorizontalStretch(0)
buttonSizePolicy.setVerticalStretch(0)
buttonSizePolicy.setHeightForWidth(self.newItemButton.sizePolicy().hasHeightForWidth())
self.newItemButton.setSizePolicy(buttonSizePolicy)
self.newItemButton.setIcon(QIcon(QPixmap(':/plus_8')))
self.horizontalLayout.addWidget(self.newItemButton)
self.deleteItemButton = QPushButton(self.bottomBar)
self.deleteItemButton.setSizePolicy(buttonSizePolicy)
self.deleteItemButton.setIcon(QIcon(QPixmap(':/minus_8')))
self.horizontalLayout.addWidget(self.deleteItemButton)
self.editItemButton = QPushButton(self.bottomBar)
self.editItemButton.setSizePolicy(buttonSizePolicy)
self.editItemButton.setIcon(QIcon(QPixmap(':/info_gray_12')))
self.horizontalLayout.addWidget(self.editItemButton)
self.horizontalLayout.addItem(horizontalSpacer(size=20))
self.graphVisibilityButton = QPushButton()
self.graphVisibilityButton.setSizePolicy(buttonSizePolicy)
self.graphVisibilityButton.setIcon(QIcon(QPixmap(':/graph_visibility_on_16')))
self.horizontalLayout.addWidget(self.graphVisibilityButton)
self.piechartVisibilityButton = QPushButton()
self.piechartVisibilityButton.setSizePolicy(buttonSizePolicy)
self.piechartVisibilityButton.setIcon(QIcon(QPixmap(':/piechart_visibility_on_16')))
self.horizontalLayout.addWidget(self.piechartVisibilityButton)
self.columnsVisibilityButton = QPushButton()
self.columnsVisibilityButton.setSizePolicy(buttonSizePolicy)
self.columnsVisibilityButton.setIcon(QIcon(QPixmap(':/columns_16')))
self.horizontalLayout.addWidget(self.columnsVisibilityButton)
self.statusLabel = QLabel(tr("Status"))
self.statusLabel.setAlignment(Qt.AlignCenter)
self.horizontalLayout.addWidget(self.statusLabel)
self.verticalLayout.addWidget(self.bottomBar)
self.setCentralWidget(self.centralwidget)
self.menubar = QMenuBar(self)
self.menubar.setGeometry(QRect(0, 0, 700, 20))
self.menuFile = QMenu(tr("File"))
self.menuOpenRecent = QMenu(tr("Open Recent"))
self.menuView = QMenu(tr("View"))
self.menuDateRange = QMenu(tr("Date Range"))
#.........这里部分代码省略.........
示例4: __init__
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
#.........这里部分代码省略.........
mc = markups.find_markup_class_by_name(globalSettings.defaultMarkup)
if mc and mc.available():
self.defaultMarkup = mc
if len(availableMarkups) > 1:
self.chooseGroup = QActionGroup(self)
markupActions = []
for markup in availableMarkups:
markupAction = self.act(markup.name, trigbool=self.markupFunction(markup))
if markup == self.defaultMarkup:
markupAction.setChecked(True)
self.chooseGroup.addAction(markupAction)
markupActions.append(markupAction)
self.actionBold = self.act(self.tr('Bold'), shct=QKeySequence.Bold,
trig=lambda: self.insertChars('**'))
self.actionItalic = self.act(self.tr('Italic'), shct=QKeySequence.Italic,
trig=lambda: self.insertChars('*'))
self.actionUnderline = self.act(self.tr('Underline'), shct=QKeySequence.Underline,
trig=lambda: self.insertTag('u'))
self.usefulTags = ('a', 'big', 'center', 'img', 's', 'small', 'span',
'table', 'td', 'tr', 'u')
self.usefulChars = ('deg', 'divide', 'dollar', 'hellip', 'laquo', 'larr',
'lsquo', 'mdash', 'middot', 'minus', 'nbsp', 'ndash', 'raquo',
'rarr', 'rsquo', 'times')
self.tagsBox = QComboBox(self.editBar)
self.tagsBox.addItem(self.tr('Tags'))
self.tagsBox.addItems(self.usefulTags)
self.tagsBox.activated.connect(self.insertTag)
self.symbolBox = QComboBox(self.editBar)
self.symbolBox.addItem(self.tr('Symbols'))
self.symbolBox.addItems(self.usefulChars)
self.symbolBox.activated.connect(self.insertSymbol)
self.updateStyleSheet()
menubar = QMenuBar(self)
menubar.setGeometry(QRect(0, 0, 800, 25))
self.setMenuBar(menubar)
menuFile = menubar.addMenu(self.tr('File'))
menuEdit = menubar.addMenu(self.tr('Edit'))
menuHelp = menubar.addMenu(self.tr('Help'))
menuFile.addAction(self.actionNew)
menuFile.addAction(self.actionOpen)
self.menuRecentFiles = menuFile.addMenu(self.tr('Open recent'))
self.menuRecentFiles.aboutToShow.connect(self.updateRecentFiles)
menuFile.addMenu(self.menuRecentFiles)
menuFile.addAction(self.actionShow)
menuFile.addAction(self.actionSetEncoding)
menuFile.addAction(self.actionReload)
menuFile.addSeparator()
menuFile.addAction(self.actionSave)
menuFile.addAction(self.actionSaveAs)
menuFile.addSeparator()
menuFile.addAction(self.actionNextTab)
menuFile.addAction(self.actionPrevTab)
menuFile.addSeparator()
menuExport = menuFile.addMenu(self.tr('Export'))
menuExport.addAction(self.actionSaveHtml)
menuExport.addAction(self.actionOdf)
menuExport.addAction(self.actionPdf)
if self.extensionActions:
menuExport.addSeparator()
for action, mimetype in self.extensionActions:
menuExport.addAction(action)
menuExport.aboutToShow.connect(self.updateExtensionsVisibility)
menuFile.addAction(self.actionPrint)
menuFile.addAction(self.actionPrintPreview)
menuFile.addSeparator()
menuFile.addAction(self.actionQuit)
示例5: DirectoriesDialog
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
class DirectoriesDialog(QMainWindow):
def __init__(self, app, **kwargs):
super().__init__(None, **kwargs)
self.app = app
self.lastAddedFolder = platform.INITIAL_FOLDER_IN_DIALOGS
self.recentFolders = Recent(self.app, "recentFolders")
self._setupUi()
self.directoriesModel = DirectoriesModel(self.app.model.directory_tree, view=self.treeView)
self.directoriesDelegate = DirectoriesDelegate()
self.treeView.setItemDelegate(self.directoriesDelegate)
self._setupColumns()
self.app.recentResults.addMenu(self.menuLoadRecent)
self.app.recentResults.addMenu(self.menuRecentResults)
self.recentFolders.addMenu(self.menuRecentFolders)
self._updateAddButton()
self._updateRemoveButton()
self._updateLoadResultsButton()
self._setupBindings()
def _setupBindings(self):
self.scanButton.clicked.connect(self.scanButtonClicked)
self.loadResultsButton.clicked.connect(self.actionLoadResults.trigger)
self.addFolderButton.clicked.connect(self.actionAddFolder.trigger)
self.removeFolderButton.clicked.connect(self.removeFolderButtonClicked)
self.treeView.selectionModel().selectionChanged.connect(self.selectionChanged)
self.app.recentResults.itemsChanged.connect(self._updateLoadResultsButton)
self.recentFolders.itemsChanged.connect(self._updateAddButton)
self.recentFolders.mustOpenItem.connect(self.app.model.add_directory)
self.directoriesModel.foldersAdded.connect(self.directoriesModelAddedFolders)
self.app.willSavePrefs.connect(self.appWillSavePrefs)
def _setupActions(self):
# (name, shortcut, icon, desc, func)
ACTIONS = [
("actionLoadResults", "Ctrl+L", "", tr("Load Results..."), self.loadResultsTriggered),
("actionShowResultsWindow", "", "", tr("Results Window"), self.app.showResultsWindow),
("actionAddFolder", "", "", tr("Add Folder..."), self.addFolderTriggered),
]
createActions(ACTIONS, self)
def _setupMenu(self):
self.menubar = QMenuBar(self)
self.menubar.setGeometry(QRect(0, 0, 42, 22))
self.menuFile = QMenu(self.menubar)
self.menuFile.setTitle(tr("File"))
self.menuView = QMenu(self.menubar)
self.menuView.setTitle(tr("View"))
self.menuHelp = QMenu(self.menubar)
self.menuHelp.setTitle(tr("Help"))
self.menuLoadRecent = QMenu(self.menuFile)
self.menuLoadRecent.setTitle(tr("Load Recent Results"))
self.setMenuBar(self.menubar)
self.menuFile.addAction(self.actionLoadResults)
self.menuFile.addAction(self.menuLoadRecent.menuAction())
self.menuFile.addSeparator()
self.menuFile.addAction(self.app.actionQuit)
self.menuView.addAction(self.app.actionPreferences)
self.menuView.addAction(self.actionShowResultsWindow)
self.menuView.addAction(self.app.actionIgnoreList)
self.menuHelp.addAction(self.app.actionShowHelp)
self.menuHelp.addAction(self.app.actionOpenDebugLog)
self.menuHelp.addAction(self.app.actionAbout)
self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuView.menuAction())
self.menubar.addAction(self.menuHelp.menuAction())
# Recent folders menu
self.menuRecentFolders = QMenu()
self.menuRecentFolders.addAction(self.actionAddFolder)
self.menuRecentFolders.addSeparator()
# Recent results menu
self.menuRecentResults = QMenu()
self.menuRecentResults.addAction(self.actionLoadResults)
self.menuRecentResults.addSeparator()
def _setupUi(self):
self.setWindowTitle(self.app.NAME)
self.resize(420, 338)
self.centralwidget = QWidget(self)
self.verticalLayout = QVBoxLayout(self.centralwidget)
self.promptLabel = QLabel(tr('Select folders to scan and press "Scan".'), self.centralwidget)
self.verticalLayout.addWidget(self.promptLabel)
self.treeView = QTreeView(self.centralwidget)
self.treeView.setSelectionMode(QAbstractItemView.ExtendedSelection)
self.treeView.setSelectionBehavior(QAbstractItemView.SelectRows)
self.treeView.setAcceptDrops(True)
triggers = (
QAbstractItemView.DoubleClicked | QAbstractItemView.EditKeyPressed | QAbstractItemView.SelectedClicked
)
self.treeView.setEditTriggers(triggers)
self.treeView.setDragDropOverwriteMode(True)
self.treeView.setDragDropMode(QAbstractItemView.DropOnly)
self.treeView.setUniformRowHeights(True)
self.verticalLayout.addWidget(self.treeView)
self.horizontalLayout = QHBoxLayout()
self.removeFolderButton = QPushButton(self.centralwidget)
self.removeFolderButton.setIcon(QIcon(QPixmap(":/minus")))
#.........这里部分代码省略.........
示例6: Dimili
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
class Dimili(QMainWindow):
def baslat(self, anaPencere):
anaPencere.resize(600, 400)
anaPencere.setWindowTitle("Dimili-Türkçe Sözlük")
anaPencere.setFixedSize(600,400)
icon =QIcon()
icon.addPixmap(QPixmap("Dictionary.png"),QIcon.Normal,QIcon.Off)
anaPencere.setWindowIcon(icon)
zemin=QWidget(anaPencere)
zemin.setGeometry(QRect(0,30,600,390))
zemin.setStyleSheet("background-color:rgb(167, 196, 233);")
self.araKutu = QLineEdit(anaPencere)
self.araKutu.setGeometry(QRect(10, 80, 200, 20))
self.araKutu.textChanged.connect(self.benzerKelimeler)
self.kelimeGir = QLabel("Kelimeler:",anaPencere)
self.kelimeGir.setGeometry(QRect(10, 110, 141, 21))
self.kelimeGor = QLabel("Kelime Ara",anaPencere)
self.kelimeGor.setGeometry(QRect(10, 30, 91, 16))
self.harfGrup=QButtonGroup(anaPencere)
aharf=QPushButton("â",anaPencere)
aharf.setGeometry(QRect(10,50,25,25))
eharf=QPushButton("é",anaPencere)
eharf.setGeometry(QRect(30,50,25,25))
self.DilGrup=QButtonGroup(anaPencere)
self.Dil1 = QPushButton("Zazaca-Türkçe",anaPencere)
self.Dil1.setGeometry(QRect(230, 80, 91, 23))
self.Dil1.setCheckable(True)
self.Dil1.setAutoExclusive(True)
self.Dil1.setChecked(True)
self.Dil1.setStyleSheet("background-color: rgb(102, 255, 0);")
self.Dil2 = QPushButton("Türkçe-Zazaca",anaPencere)
self.Dil2.setGeometry(QRect(330, 80, 91, 23))
self.Dil2.setCheckable(True)
self.Dil2.setAutoExclusive(True)
self.Dil2.setStyleSheet("background-color: rgb(255, 94, 105);")
self.DilGrup.addButton(self.Dil1,1)
self.DilGrup.addButton(self.Dil2,2)
self.DilGrup.buttonClicked[int].connect(self.dilSecme)
self.kelimeListesi=QListWidget(anaPencere)
self.kelimeListesi.setGeometry(QRect(10, 130, 191, 231))
self.kelimeListesi.itemClicked.connect(self.kelimeAcikla)
self.kelimeAnlam = QLabel("Kelimenin Anlamı:",anaPencere)
self.kelimeAnlam.setGeometry(QRect(230, 110, 131, 21))
self.cumleList1 = QListWidget(anaPencere)
self.cumleList1.setGeometry(QRect(230, 130, 351, 51))
self.ornekCumle1 = QLabel("Örnek Zazaca Cümle:",anaPencere)
self.ornekCumle1.setGeometry(QRect(230, 200, 101, 21))
self.cumleList2 = QListWidget(anaPencere)
self.cumleList2.setGeometry(QRect(230, 220, 351, 51))
self.ornekCumle2 = QLabel("Örnek Türkçe Cümle:",anaPencere)
self.ornekCumle2.setGeometry(QRect(230, 290, 111, 16))
self.cumleList3 = QListWidget(anaPencere)
self.cumleList3.setGeometry(QRect(230, 310, 351, 51))
self.anaMenu = QMenuBar(anaPencere)
self.anaMenu.setGeometry(QRect(0, 0, 600, 21))
self.menuDosya = QMenu("Dosya",self.anaMenu)
self.menuDuzenle = QMenu("Düzenle",self.anaMenu)
self.menuYardim = QMenu("Yardım",self.anaMenu)
anaPencere.setMenuBar(self.anaMenu)
self.durum = QStatusBar(zemin)
anaPencere.setStatusBar(self.durum)
self.durum.setStyleSheet("background-color:white")
self.durum.showMessage("Hazır")
self.cikis= QAction(QIcon("Exit.ico"),"&Çıkış",anaPencere)
self.cikis.setShortcut("Ctrl+X")
self.cikis.triggered.connect(anaPencere.close)
self.actionHakkinda = QAction("Hakkında",anaPencere)
self.actionHakkinda.triggered.connect(self.hakkinda)
self.actionSecenekler = QAction("Seçenekler",anaPencere)
self.menuDosya.addAction(self.cikis)
self.menuDuzenle.addAction(self.actionSecenekler)
self.menuYardim.addAction(self.actionHakkinda)
#.........这里部分代码省略.........
示例7: MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [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)
#.........这里部分代码省略.........
示例8: VGenesTextMain
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
#.........这里部分代码省略.........
triggered=self.DecreaseFont)
self.printAct = QAction(QIcon(':/PNG-Icons/print.png'), "&Print...", self,
shortcut=QKeySequence.Print,
statusTip="Print the current form letter",
triggered=self.print_)
self.copyAct = QAction(QIcon(':/PNG-Icons/pages.png'), "&Copy", self,
shortcut=QKeySequence.Copy,
statusTip="Copy the current selection's contents to the clipboard",
triggered=self.textEdit.copy)
self.pasteAct = QAction(QIcon(':/PNG-Icons/Paste.png'), "&Paste", self,
shortcut=QKeySequence.Paste,
statusTip="Paste the clipboard's contents into the current selection",
triggered=self.textEdit.paste)
self.aboutAct = QAction("&About", self,
statusTip="Show the application's About box",
triggered=self.about)
# self.aboutQtAct = QAction("About &Qt", self,
# statusTip="Show the Qt library's About box",
# triggered=QApplication.instance().aboutQt)
self.cutAct.setEnabled(False)
self.copyAct.setEnabled(False)
self.textEdit.copyAvailable.connect(self.cutAct.setEnabled)
self.textEdit.copyAvailable.connect(self.copyAct.setEnabled)
def createMenus(self):
self.menubar = QMenuBar(self)
self.menubar.setGeometry(QRect(0, 0, 1029, 22))
self.menubar.setDefaultUp(False)
self.menubar.setNativeMenuBar(False)
self.menubar.setObjectName("menubar")
self.menuFile = QMenu(self.menubar)
self.setMenuBar(self.menubar)
self.fileMenu = self.menuBar().addMenu("&File")
self.fileMenu.addAction(self.newAct)
self.fileMenu.addAction(self.openAct)
self.fileMenu.addAction(self.closeAct)
self.fileMenu.addAction(self.saveAct)
self.fileMenu.addAction(self.saveAsAct)
self.fileMenu.addAction(self.printAct)
self.fileMenu.addSeparator();
self.fileMenu.addAction(self.exitAct)
self.editMenu = self.menuBar().addMenu("&Edit")
self.editMenu.addAction(self.cutAct)
self.editMenu.addAction(self.copyAct)
self.editMenu.addAction(self.pasteAct)
self.menuBar().addSeparator()
self.helpMenu = self.menuBar().addMenu("&Help")
self.helpMenu.addAction(self.aboutAct)
# self.helpMenu.addAction(self.aboutQtAct)
def createToolBars(self):
示例9: Ui_MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [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)
#.........这里部分代码省略.........
示例10: __init__
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
def __init__(self, parent=None):
super(Assembler, self).__init__(parent)
self.resize(800, 600)
self.filename = None
self.filetuple = None
self.dirty = False # Refers to Data Page only.
self.nb = None
centralwidget = QWidget(self)
gridLayout = QGridLayout(centralwidget)
self.tabWidget = QTabWidget(centralwidget)
# textbox
self.tab = QWidget()
font = QFont()
font.setFamily("Inconsolata")
font.setPointSize(14)
self.tab.setFont(font)
gridLayout_3 = QGridLayout(self.tab)
self.plainTextEdit = QPlainTextEdit(self.tab)
self.plainTextEdit.installEventFilter(self)
self.plainTextEdit.setAcceptDrops(True)
gridLayout_3.addWidget(self.plainTextEdit, 0, 0, 1, 1)
self.tabWidget.addTab(self.tab, "")
self.tab_2 = QWidget()
self.tab_2.setFont(font)
gridLayout_2 = QGridLayout(self.tab_2)
self.plainTextEdit_2 = QPlainTextEdit(self.tab_2)
gridLayout_2.addWidget(self.plainTextEdit_2, 0, 0, 1, 1)
self.tabWidget.addTab(self.tab_2, "")
self.tab_3 = QWidget()
self.tab_3.setFont(font)
gridLayout_3 = QGridLayout(self.tab_3)
self.checkbox = QCheckBox("Cloning genes by tailed primers (no pYPKa_A vectors constructed)")
self.checkbox.setChecked(True)
gridLayout_3.addWidget(self.checkbox, 0, 0, 0, 0)
self.tabWidget.addTab(self.tab_3, "")
gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
self.setCentralWidget(centralwidget)
menubar = QMenuBar(self)
menubar.setGeometry(QRect(0, 0, 800, 29))
menu_File = QMenu(menubar)
self.menu_Solve = QMenu(menubar)
self.menu_Help = QMenu(menubar)
self.setMenuBar(menubar)
self.statusbar = QStatusBar(self)
self.setStatusBar(self.statusbar)
self.action_New = QAction(self)
self.actionSave_As = QAction(self)
self.action_Save = QAction(self)
self.action_Open = QAction(self)
self.action_Quit = QAction(self)
self.action_About = QAction(self)
self.actionShow_CCPL = QAction(self)
self.action_Solve = QAction(self)
self.action_OpenNB = QAction(self)
self.action_CCPL = QAction(self)
self.action_Help = QAction(self)
menu_File.addAction(self.action_New)
menu_File.addAction(self.action_Open)
menu_File.addAction(self.actionSave_As)
menu_File.addAction(self.action_Save)
menu_File.addSeparator()
menu_File.addAction(self.action_Quit)
self.menu_Solve.addAction(self.action_Solve)
self.menu_Solve.addAction(self.action_OpenNB)
self.menu_Help.addAction(self.action_About)
#self.menu_Help.addAction(self.action_CCPL)
#self.menu_Help.addAction(self.action_Help)
menubar.addAction(menu_File.menuAction())
menubar.addAction(self.menu_Solve.menuAction())
menubar.addAction(self.menu_Help.menuAction())
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab),\
"Data Page")
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2),\
"Assembly log")
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3),\
"Settings")
menu_File.setTitle("&File")
self.menu_Solve.setTitle("&Assemble")
self.menu_Help.setTitle("&About")
self.tabWidget.setCurrentIndex(0)
self.action_New.setText("&New")
self.action_Open.setText("&Open")
self.actionSave_As.setText("Save &As")
self.action_Save.setText("&Save")
self.action_Quit.setText("&Quit")
self.action_Solve.setText("&Assemble")
self.action_OpenNB.setText("&Open &pathway")
self.action_About.setText("&About")
#self.action_CCPL.setText("&CCPL")
#.........这里部分代码省略.........
示例11: MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
class MainWindow(QMainWindow):
tableContents = []
tableColumnCount = 8
tableRowCount = 10
workerCount = config['worker_num'] # 线程数
workers = [] # 保存线程对象
q = Queue()
wtime = [0, 0]
bgColor = QColor(180, 200, 230, 40)
progressVal = 0
taskVal = 0
def __init__(self):
super(MainWindow, self).__init__()
self.description = self.tr("""<b>Checker</b><br /><br />
Version: %s<br />
%s<br /><br />
Project: <a href=\"%s\">1dot75cm/repo-checker</a><br />
License: %s<br />
Author: <a href=\"mailto:%s\">%s</a>""") % (__version__,
__descript__, __url__, __license__, __email__, __author__)
self.tableHeaders = [self.tr("Name"), self.tr("URL"), self.tr("Branch"),
self.tr("RPM date [commit]"), self.tr("Release date [commit]"),
self.tr("Latest date [commit]"), self.tr("Status"), self.tr("Comment")]
self.setupUi(self)
def setupUi(self, MainWindow):
"""初始化主窗口"""
MainWindow.setObjectName("MainWindow")
MainWindow.setMinimumSize(QSize(910, 450))
MainWindow.setWindowTitle(self.tr("Checker"))
MainWindow.setAnimated(True)
self.centralwidget = QWidget(MainWindow)
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.centralwidget.setSizePolicy(sizePolicy)
self.verticalLayout = QVBoxLayout(self.centralwidget)
self.verticalLayout.setContentsMargins(5, 5, 5, 5)
self.tableWidget = QTableWidget(self.centralwidget)
self.setupTable()
self.verticalLayout.addWidget(self.tableWidget)
self.horizontalLayout = QHBoxLayout()
self.horizontalLayout.setContentsMargins(5, 5, 5, 5)
self.addButton = QPushButton(self.centralwidget)
self.addButton.setFixedSize(QSize(25, 25))
self.addButton.setText("+")
self.horizontalLayout.addWidget(self.addButton)
self.delButton = QPushButton(self.centralwidget)
self.delButton.setFixedSize(QSize(25, 25))
self.delButton.setText("-")
self.horizontalLayout.addWidget(self.delButton)
self.upButton = QPushButton(self.centralwidget)
self.upButton.setFixedSize(QSize(25, 25))
self.upButton.setText("↑")
self.upButton.setObjectName("up")
self.horizontalLayout.addWidget(self.upButton)
self.downButton = QPushButton(self.centralwidget)
self.downButton.setFixedSize(QSize(25, 25))
self.downButton.setText("↓")
self.horizontalLayout.addWidget(self.downButton)
spacerItem = QSpacerItem(40, 20, QSizePolicy.MinimumExpanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.progressBar = QProgressBar(self.centralwidget)
self.progressBar.hide()
self.horizontalLayout.addWidget(self.progressBar)
self.label = QLabel(self.centralwidget)
self.horizontalLayout.addWidget(self.label)
spacerItem = QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.checkButton = QPushButton(self.centralwidget)
self.checkButton.setText(self.tr("Check"))
self.horizontalLayout.addWidget(self.checkButton)
self.updateButton = QPushButton(self.centralwidget)
self.updateButton.setText(self.tr("Update item"))
self.horizontalLayout.addWidget(self.updateButton)
self.editRuleButton = QPushButton(self.centralwidget)
self.editRuleButton.setText(self.tr("Edit rule"))
self.horizontalLayout.addWidget(self.editRuleButton)
self.verticalLayout.addLayout(self.horizontalLayout)
MainWindow.setCentralWidget(self.centralwidget)
# 菜单
self.menubar = QMenuBar(MainWindow)
self.menubar.setGeometry(QRect(0, 0, 780, 34))
MainWindow.setMenuBar(self.menubar)
#.........这里部分代码省略.........
示例12: MainWindow_Ui
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
class MainWindow_Ui(QMainWindow):
def __init__(self):
super().__init__()
#MainWindow
self.resize(600, 400)
self.setMinimumSize(QSize(600, 400))
self.setMaximumSize(QSize(16777215, 16777215))
self.setWindowTitle("Persepolis Download Manager")
self.setWindowIcon(QIcon('icon'))
self.centralwidget = QWidget(self)
self.verticalLayout = QVBoxLayout(self.centralwidget)
#enable drag and drop
self.setAcceptDrops(True)
#frame
self.frame = QFrame(self.centralwidget)
self.frame.setGeometry(QRect(10, 10, 581, 251))
self.frame.setFrameShape(QFrame.StyledPanel)
self.frame.setFrameShadow(QFrame.Raised)
self.gridLayout = QGridLayout(self.frame)
#tablewidget
self.download_table = QTableWidget(self.frame)
self.download_table.setGeometry(QRect(10, 10, 560, 231))
self.download_table.setSizeIncrement(QSize(0, 0))
self.download_table.setColumnCount(10)
self.download_table.setSelectionBehavior(QAbstractItemView.SelectRows)
self.download_table.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.download_table.verticalHeader().hide()
self.download_table.setColumnHidden(8 , True)
self.download_table.setColumnHidden(9 , True)
self.gridLayout.addWidget(self.download_table, 0, 0, 1, 1)
self.verticalLayout.addWidget(self.frame)
self.setCentralWidget(self.centralwidget)
download_table_header = ['File Name' , 'Status' , 'Size' , 'Downloaded' , 'Percentage' , 'Connections' , 'Transfer rate' , 'Estimate time left' , 'Gid' , 'Info']
self.download_table.setHorizontalHeaderLabels(download_table_header)
#fixing the size of download_table when window is Maximized!
self.download_table.horizontalHeader().setSectionResizeMode(0)
self.download_table.horizontalHeader().setStretchLastSection(True)
#finding number od row that user selected!
self.download_table.itemSelectionChanged.connect(self.selectedRow)
#menubar
self.menubar = QMenuBar(self)
self.menubar.setGeometry(QRect(0, 0, 600, 24))
self.setMenuBar(self.menubar)
fileMenu = self.menubar.addMenu('File')
editMenu = self.menubar.addMenu('Edit')
viewMenu = self.menubar.addMenu('View')
downloadMenu = self.menubar.addMenu('Download')
helpMenu = self.menubar.addMenu('Help')
#statusbar
self.statusbar = QStatusBar(self)
self.setStatusBar(self.statusbar)
self.statusbar.showMessage("Persepolis Download Manager")
#toolBar
self.toolBar = QToolBar(self)
self.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
self.toolBar.setWindowTitle("toolBar")
self.toolBar.setIconSize(QSize(38 , 38))
self.toolBar.setFloatable(False)
self.toolBar.setMovable(False)
#toolBar and menubar and actions
self.stopAllAction = QAction(QIcon(icons + 'stop_all') , 'Stop all active downloads' , self , statusTip = 'Stop all active downloads', triggered = self.stopAllDownloads )
downloadMenu.addAction(self.stopAllAction)
self.pauseAllAction = QAction(QIcon(icons + 'pause_all') , 'Pause all active downloads' , self , statusTip = 'Pause all active downloads', triggered = self.pauseAllDownloads )
downloadMenu.addAction(self.pauseAllAction)
self.minimizeAction = QAction(QIcon(icons + 'minimize') , 'Minimize to system tray' , self , shortcut = "Ctrl+W" , statusTip = "Minimize to system tray" , triggered = self.minMaxTray)
viewMenu.addAction(self.minimizeAction)
self.addlinkAction = QAction(QIcon(icons + 'add') , 'Add New Download Link' , self , shortcut = "Ctrl+N" , statusTip = "Add New Download Link" , triggered = self.addLinkButtonPressed)
fileMenu.addAction(self.addlinkAction)
self.resumeAction = QAction(QIcon(icons + 'play') , 'Resume Download' , self , shortcut = "Ctrl+R" , statusTip = "Resume Download" , triggered = self.resumeButtonPressed)
downloadMenu.addAction(self.resumeAction)
self.pauseAction = QAction(QIcon(icons + 'pause') , 'Pause Download' , self , shortcut = "Ctrl+C" , statusTip = "Pause Download" , triggered = self.pauseButtonPressed)
downloadMenu.addAction(self.pauseAction)
self.stopAction = QAction(QIcon(icons + 'stop') , 'Stop Download' , self , shortcut = "Ctrl+S" , statusTip = "Stop/Cancel Download" , triggered = self.stopButtonPressed)
downloadMenu.addAction(self.stopAction)
#.........这里部分代码省略.........
示例13: MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
class MainWindow(QMainWindow, metaclass=QSingleton):
new_session = pyqtSignal()
save_session = pyqtSignal(str)
open_session = pyqtSignal(str)
def __init__(self):
super().__init__()
self.setMinimumSize(500, 400)
self._cue_add_menu = {}
self.layout = None
# Status Bar
self.statusBar = QStatusBar(self)
self.setStatusBar(self.statusBar)
MainActionsHandler().action_done.connect(self._action_done)
MainActionsHandler().action_undone.connect(self._action_undone)
MainActionsHandler().action_redone.connect(self._action_redone)
# Menubar
self.menubar = QMenuBar(self)
self.menubar.setGeometry(QtCore.QRect(0, 0, 0, 25))
self.menubar.setContextMenuPolicy(QtCore.Qt.PreventContextMenu)
self.menuFile = QMenu(self.menubar)
self.menuEdit = QMenu(self.menubar)
self.menuLayout = QMenu(self.menubar)
self.menuTools = QMenu(self.menubar)
self.menuAbout = QMenu(self.menubar)
self.menubar.addMenu(self.menuFile)
self.menubar.addMenu(self.menuEdit)
self.menubar.addMenu(self.menuLayout)
self.menubar.addMenu(self.menuTools)
self.menubar.addMenu(self.menuAbout)
self.setMenuBar(self.menubar)
# menuFile
self.newSessionAction = QAction(self)
self.newSessionAction.triggered.connect(self._new_session)
self.openSessionAction = QAction(self)
self.openSessionAction.triggered.connect(self._load_from_file)
self.saveSessionAction = QAction(self)
self.saveSessionAction.triggered.connect(self._save)
self.saveSessionWithName = QAction(self)
self.saveSessionWithName.triggered.connect(self._save_with_name)
self.editPreferences = QAction(self)
self.editPreferences.triggered.connect(self._show_preferences)
self.fullScreenAction = QAction(self)
self.fullScreenAction.triggered.connect(self._fullscreen)
self.fullScreenAction.setCheckable(True)
self.exitAction = QAction(self)
self.exitAction.triggered.connect(self._exit)
self.menuFile.addAction(self.newSessionAction)
self.menuFile.addAction(self.openSessionAction)
self.menuFile.addSeparator()
self.menuFile.addAction(self.saveSessionAction)
self.menuFile.addAction(self.saveSessionWithName)
self.menuFile.addSeparator()
self.menuFile.addAction(self.editPreferences)
self.menuFile.addSeparator()
self.menuFile.addAction(self.fullScreenAction)
self.menuFile.addSeparator()
self.menuFile.addAction(self.exitAction)
# menuEdit
self.actionUndo = QAction(self)
self.actionUndo.triggered.connect(MainActionsHandler().undo_action)
self.actionRedo = QAction(self)
self.actionRedo.triggered.connect(MainActionsHandler().redo_action)
self.multiEdit = QAction(self)
self.selectAll = QAction(self)
self.deselectAll = QAction(self)
self.invertSelection = QAction(self)
self.cueSeparator = self.menuEdit.addSeparator()
self.menuEdit.addAction(self.actionUndo)
self.menuEdit.addAction(self.actionRedo)
self.menuEdit.addSeparator()
self.menuEdit.addAction(self.selectAll)
self.menuEdit.addAction(self.deselectAll)
self.menuEdit.addAction(self.invertSelection)
self.menuEdit.addSeparator()
self.menuEdit.addAction(self.multiEdit)
# menuAbout
self.actionAbout = QAction(self)
self.actionAbout.triggered.connect(about.About(self).show)
self.actionAbout_Qt = QAction(self)
self.actionAbout_Qt.triggered.connect(qApp.aboutQt)
self.menuAbout.addAction(self.actionAbout)
self.menuAbout.addSeparator()
self.menuAbout.addAction(self.actionAbout_Qt)
# Set component text
#.........这里部分代码省略.........
示例14: EditorMainWindow
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
#.........这里部分代码省略.........
self.label_object_id = QLabel(self.centralwidget)
self.label_object_id.setObjectName("label_object_id")
#TextSelectableByCursor
self.label_position = QLabel(self.centralwidget)
self.label_position.setObjectName("label_position")
self.label_model_name = QLabel(self.centralwidget)
self.label_model_name.setObjectName("label_model_name")
self.label_4 = QLabel(self.centralwidget)
self.label_4.setObjectName("label_4")
self.label_5 = QLabel(self.centralwidget)
self.label_5.setObjectName("label_5")
for label in (self.label_object_id, self.label_position, self.label_model_name, self.label_4, self.label_5):
label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
self.verticalLayout_2.addWidget(self.lineedit_angle)
self.verticalLayout_2.addWidget(self.label_object_id)
self.verticalLayout_2.addWidget(self.label_position)
self.verticalLayout_2.addWidget(self.label_model_name)
self.verticalLayout_2.addWidget(self.label_4)
self.verticalLayout_2.addWidget(self.label_5)
self.verticalLayout.addLayout(self.verticalLayout_2)
self.horizontalLayout.addWidget(self.vertLayoutWidget)
self.menubar = QMenuBar(MainWindow)
self.menubar.setGeometry(QRect(0, 0, 820, 29))
self.menubar.setObjectName("menubar")
self.file_menu = QMenu(self.menubar)
self.file_menu.setObjectName("menuLoad")
self.file_load_action = QAction("Load", self)
self.file_load_action.triggered.connect(self.button_load_level)
self.file_menu.addAction(self.file_load_action)
self.file_save_action = QAction("Save", self)
self.file_save_action.triggered.connect(self.button_save_level)
self.file_menu.addAction(self.file_save_action)
self.visibility_menu = MenuDontClose(self.menubar)#QMenu(self.menubar)
self.visibility_menu.setObjectName("visibility")
#self.visibility_menu.addAction(self.toggle_action)
self.visibility_actions = []
self.terrain_menu = QMenu(self.menubar)
self.terrain_menu.setObjectName("terrain")
self.terrain_load_action = QAction("Load Terrain", self)
self.terrain_load_action.triggered.connect(self.button_terrain_load_action)
self.terrain_menu.addAction(self.terrain_load_action)
self.terrain_display_actions = []
self.setup_terrain_display_toggles()
#self.menuLoad_2 = QMenu(self.menubar)
#self.menuLoad_2.setObjectName("menuLoad_2")
示例15: MainWindow_Ui
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setGeometry [as 别名]
#.........这里部分代码省略.........
self.download_table = DownloadTableWidget(self)
download_table_content_widget_verticalLayout.addWidget(
self.download_table)
tabels_splitter.addWidget(self.download_table_content_widget)
self.download_table.setColumnCount(13)
self.download_table.setSelectionBehavior(QAbstractItemView.SelectRows)
self.download_table.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.download_table.verticalHeader().hide()
# hide gid and download dictioanry section
self.download_table.setColumnHidden(8, True)
self.download_table.setColumnHidden(9, True)
download_table_header = [QCoreApplication.translate("mainwindow_ui_tr", 'File Name'), QCoreApplication.translate("mainwindow_ui_tr",'Status'), QCoreApplication.translate("mainwindow_ui_tr", 'Size'), QCoreApplication.translate("mainwindow_ui_tr", 'Downloaded'), QCoreApplication.translate("mainwindow_ui_tr", 'Percentage'), QCoreApplication.translate("mainwindow_ui_tr", 'Connections'),
QCoreApplication.translate("mainwindow_ui_tr", 'Transfer rate'), QCoreApplication.translate("mainwindow_ui_tr",'Estimated time left'), 'Gid', QCoreApplication.translate("mainwindow_ui_tr",'Link'), QCoreApplication.translate("mainwindow_ui_tr", 'First try date'), QCoreApplication.translate("mainwindow_ui_tr", 'Last try date'), QCoreApplication.translate("mainwindow_ui_tr",'Category')]
self.download_table.setHorizontalHeaderLabels(download_table_header)
# fixing the size of download_table when window is Maximized!
self.download_table.horizontalHeader().setSectionResizeMode(0)
self.download_table.horizontalHeader().setStretchLastSection(True)
tabels_splitter.setStretchFactor(0, 3) # category_tree width
tabels_splitter.setStretchFactor(1, 10) # ratio of tables's width
download_table_horizontalLayout.addWidget(tabels_splitter)
self.frame.setLayout(download_table_horizontalLayout)
self.verticalLayout.addWidget(self.frame)
self.setCentralWidget(self.centralwidget)
# menubar
self.menubar = QMenuBar(self)
self.menubar.setGeometry(QRect(0, 0, 600, 24))
self.setMenuBar(self.menubar)
fileMenu = self.menubar.addMenu(QCoreApplication.translate("mainwindow_ui_tr", '&File'))
editMenu = self.menubar.addMenu(QCoreApplication.translate("mainwindow_ui_tr", '&Edit'))
viewMenu = self.menubar.addMenu(QCoreApplication.translate("mainwindow_ui_tr", '&View'))
downloadMenu = self.menubar.addMenu(QCoreApplication.translate("mainwindow_ui_tr", '&Download'))
queueMenu = self.menubar.addMenu(QCoreApplication.translate("mainwindow_ui_tr", '&Queue'))
videoFinderMenu = self.menubar.addMenu(QCoreApplication.translate("mainwindow_ui_tr", 'V&ideo Finder'))
helpMenu = self.menubar.addMenu(QCoreApplication.translate("mainwindow_ui_tr", '&Help'))
# viewMenu submenus
sortMenu = viewMenu.addMenu(QCoreApplication.translate("mainwindow_ui_tr", 'Sort by'))
# statusbar
self.statusbar = QStatusBar(self)
self.setStatusBar(self.statusbar)
self.statusbar.showMessage(QCoreApplication.translate("mainwindow_ui_tr", "Persepolis Download Manager"))
# toolBar
self.toolBar2 = QToolBar(self)
self.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar2)
self.toolBar2.setWindowTitle(QCoreApplication.translate("mainwindow_ui_tr", 'Menu'))
self.toolBar2.setFloatable(False)
self.toolBar2.setMovable(False)
self.toolBar = QToolBar(self)
self.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
self.toolBar.setWindowTitle(QCoreApplication.translate("mainwindow_ui_tr", 'Toolbar'))
self.toolBar.setFloatable(False)
self.toolBar.setMovable(False)
#toolBar and menubar and actions
self.videoFinderAddLinkAction = QAction(QIcon(icons + 'video_finder'), QCoreApplication.translate("mainwindow_ui_tr", 'Find Video Links'), self, statusTip=QCoreApplication.translate("mainwindow_ui_tr", 'Download video or audio from Youtube, Vimeo, etc...'),