本文整理汇总了Python中PyQt4.QtGui.QStatusBar类的典型用法代码示例。如果您正苦于以下问题:Python QStatusBar类的具体用法?Python QStatusBar怎么用?Python QStatusBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QStatusBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent=None):
QStatusBar.__init__(self, parent)
self._widgetStatus = QWidget()
vbox = QVBoxLayout(self._widgetStatus)
vbox.setContentsMargins(0, 0, 0, 0)
vbox.setSpacing(0)
# Search Layout
self._searchWidget = SearchWidget(self)
vbox.addWidget(self._searchWidget)
# Replace Layout
self._replaceWidget = ReplaceWidget(self)
vbox.addWidget(self._replaceWidget)
self._replaceWidget.setVisible(False)
# Code Locator
self._codeLocator = locator.CodeLocatorWidget(self)
vbox.addWidget(self._codeLocator)
self._codeLocator.setVisible(False)
# File system completer
self._fileSystemOpener = FileSystemOpener()
vbox.addWidget(self._fileSystemOpener)
self._fileSystemOpener.setVisible(False)
self.addWidget(self._widgetStatus)
self.connect(self, SIGNAL("messageChanged(QString)"), self.message_end)
self.connect(
self._replaceWidget._btnCloseReplace, SIGNAL("clicked()"), lambda: self._replaceWidget.setVisible(False)
)
self.connect(self._replaceWidget._btnReplace, SIGNAL("clicked()"), self.replace)
self.connect(self._replaceWidget._btnReplaceAll, SIGNAL("clicked()"), self.replace_all)
self.connect(self._replaceWidget._btnReplaceSelection, SIGNAL("clicked()"), self.replace_selected)
self.connect(self._fileSystemOpener.btnClose, SIGNAL("clicked()"), self.hide_status)
self.connect(self._fileSystemOpener, SIGNAL("requestHide()"), self.hide_status)
示例2: __init__
def __init__(self):
QStatusBar.__init__(self)
self.hide()
Edis.load_component("status_bar", self)
# Conexiones
self.messageChanged.connect(self._clean_status)
示例3: Ui_SLim
class Ui_SLim(object):
def setupUi(self, SLim):
SLim.setObjectName(_fromUtf8("SLim"))
SLim.resize(800, 601)
self.centralwidget = QWidget(SLim)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.verticalLayout = QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
SLim.setCentralWidget(self.centralwidget)
self.menubar = QMenuBar(SLim)
self.menubar.setGeometry(QRect(0, 0, 800, 20))
self.menubar.setObjectName(_fromUtf8("menubar"))
SLim.setMenuBar(self.menubar)
self.statusbar = QStatusBar(SLim)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
SLim.setStatusBar(self.statusbar)
ui_settings = slimUISettings()
QMetaObject.connectSlotsByName(SLim)
self.loopers = []
self.loopers.append(LooperWidget(self.centralwidget, 0, ui_settings.looper))
self.loopers.append(LooperWidget(self.centralwidget, 1, ui_settings.looper))
for looper in self.loopers:
self.verticalLayout.addWidget(looper)
self.retranslateUi(SLim)
def retranslateUi(self, SLim):
for looper in SLim.ui.loopers:
looper.retranslateUi()
SLim.setWindowTitle(QApplication.translate("SLim", "MainWindow", None, QApplication.UnicodeUTF8))
示例4: __init__
def __init__(self, parent):
QStatusBar.__init__(self, parent)
self.setWindowOpacity(1.50)
self.compt = 0
self.timerEvent(self.compt)
self.startTimer(5000)
示例5: __init__
def __init__(self, parent = None):
QStatusBar.__init__(self, parent)
self.prnt = parent
self.clearMessage()
self.reformat()
self.status = QLabel()
self.addPermanentWidget(self.status)
示例6: message_end
def message_end(self, message):
if message == '':
self.hide()
QStatusBar.clearMessage(self)
self._widgetStatus.show()
widget = main_container.MainContainer().get_actual_widget()
if widget:
widget.setFocus()
示例7: show
def show(self):
self.clearMessage()
QStatusBar.show(self)
editor = main_container.MainContainer().get_actual_editor()
if editor and editor.textCursor().hasSelection():
text = editor.textCursor().selectedText()
self._searchWidget._line.setText(text)
if self._widgetStatus.isVisible():
self._searchWidget._line.setFocus()
self._searchWidget._line.selectAll()
示例8: __init__
def __init__(self, config):
# Initialize the object as a QWidget and
# set its title and minimum width
QWidget.__init__(self)
self.config = config
self.peerList = config.peerList
self.setWindowTitle('BlastShare')
self.setMinimumSize(320, 480)
self.setMaximumWidth(320)
self.prefw = None
# connects the signals!
self.connect(self.peerList,
SIGNAL("initTransfer"), self.sendFileToPeer)
''' Will add feature in future version '''
'''
shareFilesAction = QAction(QIcon('exit.png'), '&Share File(s)', self)
shareFilesAction.setShortcut('Ctrl+O')
shareFilesAction.setStatusTip('Share File(s)')
shareFilesAction.triggered.connect(quitApp)
'''
preferencesAction = QAction(QIcon('exit.png'), '&Preferences', self)
preferencesAction.setShortcut('Ctrl+P')
preferencesAction.setStatusTip('Preferences')
preferencesAction.triggered.connect(self.editPreferences)
exitAction = QAction(QIcon('exit.png'), '&Exit', self)
exitAction.setShortcut('Ctrl+Q')
exitAction.setStatusTip('Exit application')
exitAction.triggered.connect(quitApp)
menubar = QMenuBar()
fileMenu = menubar.addMenu('&File')
''' Will enable in future versions '''
# fileMenu.addAction(shareFilesAction)
fileMenu.addAction(preferencesAction)
fileMenu.addAction(exitAction)
layout = QVBoxLayout()
layout.setContentsMargins(QMargins(0, 0, 0, 0))
self.setLayout(layout)
statusBar = QStatusBar()
statusBar.showMessage('Ready')
layout.addWidget(menubar)
layout.addWidget(self.peerList)
layout.addWidget(statusBar)
示例9: __init__
def __init__(self):
QStatusBar.__init__(self)
self.editor = None
self.widgetStatus = QWidget()
vbox = QVBoxLayout(self.widgetStatus)
vbox.setContentsMargins(0, 0, 0, 0)
#Search Layout
hSearch = QHBoxLayout()
self.line = TextLine(self)
self.line.setMinimumWidth(250)
self.checkBackward = QCheckBox('Find Backward')
self.checkSensitive = QCheckBox('Respect Case Sensitive')
self.checkWholeWord = QCheckBox('Find Whole Words')
self.btnClose = QPushButton(self.style().standardIcon(QStyle.SP_DialogCloseButton), '')
self.btnFind = QPushButton(QIcon(resources.images['find']), '')
self.btnPrevious = QPushButton(self.style().standardIcon(QStyle.SP_ArrowLeft), '')
self.btnNext = QPushButton(self.style().standardIcon(QStyle.SP_ArrowRight), '')
hSearch.addWidget(self.btnClose)
hSearch.addWidget(self.line)
hSearch.addWidget(self.btnFind)
hSearch.addWidget(self.btnPrevious)
hSearch.addWidget(self.btnNext)
hSearch.addWidget(self.checkBackward)
hSearch.addWidget(self.checkSensitive)
hSearch.addWidget(self.checkWholeWord)
vbox.addLayout(hSearch)
#Replace Layout
hReplace = QHBoxLayout()
self.lineReplace = TextLine(self)
self.lineReplace.setMinimumWidth(250)
self.btnCloseReplace = QPushButton(self.style().standardIcon(QStyle.SP_DialogCloseButton), '')
self.btnReplace = QPushButton('Replace')
self.btnReplaceAll = QPushButton('Replace All')
hReplace.addWidget(self.btnCloseReplace)
hReplace.addWidget(self.lineReplace)
hReplace.addWidget(self.btnReplace)
hReplace.addWidget(self.btnReplaceAll)
vbox.addLayout(hReplace)
self.replace_visibility(False)
self.addWidget(self.widgetStatus)
self.shortEsc = QShortcut(QKeySequence(Qt.Key_Escape), self)
self.connect(self.btnClose, SIGNAL("clicked()"), self.hide_status)
self.connect(self.btnFind, SIGNAL("clicked()"), self.find)
self.connect(self.btnNext, SIGNAL("clicked()"), self.find_next)
self.connect(self.btnPrevious, SIGNAL("clicked()"), self.find_previous)
self.connect(self, SIGNAL("messageChanged(QString)"), self.message_end)
self.connect(self.btnCloseReplace, SIGNAL("clicked()"), lambda: self.replace_visibility(False))
self.connect(self.btnReplace, SIGNAL("clicked()"), self.replace)
self.connect(self.btnReplaceAll, SIGNAL("clicked()"), self.replace_all)
self.connect(self.shortEsc, SIGNAL("activated()"), self.hide_status)
示例10: __init__
def __init__(self, parent):
QStatusBar.__init__(self, parent)
if not Config.SERV:
print("Not Serveur ")
return
self.rsp = {}
self.check = TaskThreadServer(self)
QObject.connect(self.check, SIGNAL("download_"), self.download_)
self.check.start()
示例11: __init__
def __init__(self, *args):
QStatusBar.__init__(self, *args)
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.setSizeGripEnabled(False)
self.setStyleSheet("QStatusBar {border: 0} QStatusBar::item {border: 0}")
self._label = QLabel(self)
self._label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self._label.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
self._label.setStyleSheet("color: red")
self.addWidget(self._label)
self._timer = QTimer()
self._timer.setSingleShot(True)
self._timer.timeout.connect(self.clearMessage)
示例12: setupUi
def setupUi(self, SLim):
SLim.setObjectName(_fromUtf8("SLim"))
SLim.resize(800, 601)
self.centralwidget = QWidget(SLim)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.verticalLayout = QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
SLim.setCentralWidget(self.centralwidget)
self.menubar = QMenuBar(SLim)
self.menubar.setGeometry(QRect(0, 0, 800, 20))
self.menubar.setObjectName(_fromUtf8("menubar"))
SLim.setMenuBar(self.menubar)
self.statusbar = QStatusBar(SLim)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
SLim.setStatusBar(self.statusbar)
ui_settings = slimUISettings()
QMetaObject.connectSlotsByName(SLim)
self.loopers = []
self.loopers.append(LooperWidget(self.centralwidget, 0, ui_settings.looper))
self.loopers.append(LooperWidget(self.centralwidget, 1, ui_settings.looper))
for looper in self.loopers:
self.verticalLayout.addWidget(looper)
self.retranslateUi(SLim)
示例13: paint_mainWindow
def paint_mainWindow(self):
# Define and use a "Grid Layout" for the main window.
grid = QGridLayout()
grid.addWidget(self.textArea, 1, 1)
grid.addWidget(self.tabs, 2, 1)
# Create central widget, add layout, and set
central_widget = QWidget()
central_widget.setLayout(grid)
self.setCentralWidget(central_widget)
# Fun feature for users. If you are going to have a toolbar then you
# really need this status bar to show what the icons do.
self.statusbar = QStatusBar(self)
self.statusbar.setObjectName( "statusbar")
MainWindow.setStatusBar(self, self.statusbar)
self.statusbar.show()
# Initial settings for the main window
#
# Set the Main Window Geometry
top = 100 # Main Window initial 'top' position (as pixels from top of screen)
left = 100 # Main Window initial 'left' position (as pixels from left side of screen)
width = 1000 # Main Window initial 'width' (as pixels)
height = 700 # Main Window initial 'height' (as pixels)
self.setGeometry(QRect(top, left, width, height))
# Create connection(s)
# If the contents of the text area are changed then call a function
# to set the appropriate file menu state. This file menu state can
# also be used to ensure clean exits. In english, keep track
# of changes to the text editor. It affects the "state" of the
# application. See setState()
self.connect(self.textArea, SIGNAL("textChanged()"), self.textChanged)
示例14: __init__
def __init__(self, parent=None):
QStatusBar.__init__(self, parent)
self._widgetStatus = QWidget()
vbox = QVBoxLayout(self._widgetStatus)
vbox.setContentsMargins(0, 0, 0, 0)
vbox.setSpacing(0)
#Search Layout
self._searchWidget = SearchWidget(self)
vbox.addWidget(self._searchWidget)
#Replace Layout
self._replaceWidget = ReplaceWidget(self)
vbox.addWidget(self._replaceWidget)
self._replaceWidget.setVisible(False)
#Code Locator
self._codeLocator = locator.CodeLocatorWidget(self)
vbox.addWidget(self._codeLocator)
self._codeLocator.setVisible(False)
#File system completer
self._fileSystemOpener = FileSystemOpener()
vbox.addWidget(self._fileSystemOpener)
self._fileSystemOpener.setVisible(False)
self.addWidget(self._widgetStatus)
self._shortEsc = QShortcut(QKeySequence(Qt.Key_Escape), self)
self.connect(self._searchWidget._btnClose, SIGNAL("clicked()"),
self.hide_status)
self.connect(self._searchWidget._btnFind, SIGNAL("clicked()"),
self.find)
self.connect(self._searchWidget.btnNext, SIGNAL("clicked()"),
self.find_next)
self.connect(self._searchWidget.btnPrevious, SIGNAL("clicked()"),
self.find_previous)
self.connect(self, SIGNAL("messageChanged(QString)"), self.message_end)
self.connect(self._replaceWidget._btnCloseReplace, SIGNAL("clicked()"),
lambda: self._replaceWidget.setVisible(False))
self.connect(self._replaceWidget._btnReplace, SIGNAL("clicked()"),
self.replace)
self.connect(self._replaceWidget._btnReplaceAll, SIGNAL("clicked()"),
self.replace_all)
self.connect(self._shortEsc, SIGNAL("activated()"), self.hide_status)
self.connect(self._fileSystemOpener.btnClose, SIGNAL("clicked()"),
self.hide_status)
self.connect(self._fileSystemOpener, SIGNAL("requestHide()"),
self.hide_status)
示例15: __init__
def __init__(self, settings, parent=None):
super(MikiWindow, self).__init__(parent)
self.setObjectName("mikiWindow")
self.settings = settings
self.notePath = settings.notePath
################ Setup core components ################
self.notesTree = MikiTree(self)
self.notesTree.setObjectName("notesTree")
self.initTree(self.notePath, self.notesTree)
self.notesTree.sortItems(0, Qt.AscendingOrder)
self.ix = None
self.setupWhoosh()
self.viewedList = QToolBar(self.tr('Recently Viewed'), self)
self.viewedList.setIconSize(QSize(16, 16))
self.viewedList.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
self.viewedListActions = []
self.noteSplitter = QSplitter(Qt.Horizontal)
self.dockIndex = QDockWidget("Index")
self.dockSearch = QDockWidget("Search")
self.searchEdit = QLineEdit()
self.searchView = MikiSearch(self)
self.searchTab = QWidget()
self.dockToc = QDockWidget("TOC")
self.tocTree = TocTree()
self.dockAttachment = QDockWidget("Attachment")
self.attachmentView = AttachmentView(self)
self.notesEdit = MikiEdit(self)
self.notesEdit.setObjectName("notesEdit")
MikiHighlighter(self.notesEdit)
self.notesView = MikiView(self)
self.findBar = QToolBar(self.tr('Find'), self)
self.findBar.setFixedHeight(30)
self.findEdit = QLineEdit(self.findBar)
self.checkBox = QCheckBox(self.tr('Match case'), self.findBar)
self.statusBar = QStatusBar(self)
self.statusLabel = QLabel(self)
self.altPressed = False
################ Setup actions ################
self.actions = dict()
self.setupActions()
################ Setup mainwindow ################
self.setupMainWindow()
# show changelogs after upgrade mikidown
if self.settings.version < __version__:
self.changelogHelp()
self.settings.qsettings.setValue("version", __version__)