本文整理汇总了Python中PyQt4.Qt.QFrame.setFrameStyle方法的典型用法代码示例。如果您正苦于以下问题:Python QFrame.setFrameStyle方法的具体用法?Python QFrame.setFrameStyle怎么用?Python QFrame.setFrameStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QFrame
的用法示例。
在下文中一共展示了QFrame.setFrameStyle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.Qt import QFrame [as 别名]
# 或者: from PyQt4.Qt.QFrame import setFrameStyle [as 别名]
def __init__(self, parent, label, extra_widgets=[], style=QFrame.HLine + QFrame.Raised, offset=16):
QWidget.__init__(self, parent)
lo = QHBoxLayout(self)
lo.setContentsMargins(0, 0, 0, 0)
lo.setSpacing(4)
if offset:
frame = QFrame(self)
frame.setFrameStyle(style)
frame.setMinimumWidth(offset)
lo.addWidget(frame, 0)
lo.addWidget(QLabel(label, self), 0)
frame = QFrame(self)
frame.setFrameStyle(style)
lo.addWidget(frame, 1)
for w in extra_widgets:
lo.addWidget(w, 0)
示例2: MainWindow
# 需要导入模块: from PyQt4.Qt import QFrame [as 别名]
# 或者: from PyQt4.Qt.QFrame import setFrameStyle [as 别名]
class MainWindow(QMainWindow):
about_message = """
<P>PURR ("<B>P</B>URR is <B>U</B>seful for <B>R</B>emembering <B>R</B>eductions", for those working with
a stable version, or "<B>P</B>URR <B>U</B>sually <B>R</B>emembers <B>R</B>eductions", for those
working with a development version, or "<B>P</B>URR <B>U</B>sed to <B>R</B>emember <B>R</B>eductions",
for those working with a broken version) is a tool for
automatically keeping a log of your data reduction operations. PURR will monitor your working directories
for new or updated files (called "data products"), and upon seeing any, it can "pounce" -- that is, offer
you the option of saving the files to a log, along with descriptive comments. It will then
generate an HTML page with a pretty rendering of your log and data products.</P>
"""
def __init__(self, parent, hide_on_close=False):
QMainWindow.__init__(self, parent)
self._hide_on_close = hide_on_close
# replace the BusyIndicator class with a GUI-aware one
Purr.BusyIndicator = BusyIndicator
self._pounce = False
# we keep a small stack of previously active purrers. This makes directory changes
# faster (when going back and forth between dirs)
# current purrer
self.purrer = None
self.purrer_stack = []
# Purr pipes for receiving remote commands
self.purrpipes = {}
# init GUI
self.setWindowTitle("PURR")
self.setWindowIcon(pixmaps.purr_logo.icon())
cw = QWidget(self)
self.setCentralWidget(cw)
cwlo = QVBoxLayout(cw)
cwlo.setContentsMargins(0, 0, 0, 0)
cwlo.setMargin(5)
cwlo.setSpacing(0)
toplo = QHBoxLayout();
cwlo.addLayout(toplo)
# About dialog
self._about_dialog = QMessageBox(self)
self._about_dialog.setWindowTitle("About PURR")
self._about_dialog.setText(self.about_message + """
<P>PURR is not watching any directories right now. You may need to restart it, and give it
some directory names on the command line.</P>""")
self._about_dialog.setIconPixmap(pixmaps.purr_logo.pm())
# Log viewer dialog
self.viewer_dialog = HTMLViewerDialog(self, config_name="log-viewer",
buttons=[(pixmaps.blue_round_reload, "Regenerate",
"""<P>Regenerates your log's HTML code from scratch. This can be useful if
your PURR version has changed, or if there was an error of some kind
the last time the files were generated.</P>
""")])
self._viewer_timestamp = None
self.connect(self.viewer_dialog, SIGNAL("Regenerate"), self._regenerateLog)
self.connect(self.viewer_dialog, SIGNAL("viewPath"), self._viewPath)
# Log title toolbar
title_tb = QToolBar(cw)
title_tb.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
title_tb.setIconSize(QSize(16, 16))
cwlo.addWidget(title_tb)
title_label = QLabel("Purrlog title:", title_tb)
title_tb.addWidget(title_label)
self.title_editor = QLineEdit(title_tb)
title_tb.addWidget(self.title_editor)
self.connect(self.title_editor, SIGNAL("editingFinished()"), self._titleChanged)
tip = """<P>This is your current log title. To rename the log, enter new name here and press Enter.</P>"""
title_label.setToolTip(tip)
self.title_editor.setToolTip(tip)
self.wviewlog = title_tb.addAction(pixmaps.openbook.icon(), "View", self._showViewerDialog)
self.wviewlog.setToolTip("Click to see an HTML rendering of your current log.")
qa = title_tb.addAction(pixmaps.purr_logo.icon(), "About...", self._about_dialog.exec_)
qa.setToolTip("<P>Click to see the About... dialog, which will tell you something about PURR.</P>")
self.wdirframe = QFrame(cw)
cwlo.addWidget(self.wdirframe)
self.dirs_lo = QVBoxLayout(self.wdirframe)
self.dirs_lo.setMargin(5)
self.dirs_lo.setContentsMargins(5, 0, 5, 5)
self.dirs_lo.setSpacing(0)
self.wdirframe.setFrameStyle(QFrame.Box | QFrame.Raised)
self.wdirframe.setLineWidth(1)
## Directories toolbar
dirs_tb = QToolBar(self.wdirframe)
dirs_tb.setToolButtonStyle(Qt.ToolButtonIconOnly)
dirs_tb.setIconSize(QSize(16, 16))
self.dirs_lo.addWidget(dirs_tb)
label = QLabel("Monitoring directories:", dirs_tb)
self._dirs_tip = """<P>PURR can monitor your working directories for new or updated files. If there's a checkmark
next to the directory name in this list, PURR is monitoring it.</P>
<P>If the checkmark is grey, PURR is monitoring things unobtrusively. When a new or updated file is detected in he monitored directory,
it is quietly added to the list of files in the "New entry" window, even if this window is not currently visible.</P>
<P>If the checkmark is black, PURR will be more obtrusive. Whenever a new or updated file is detected, the "New entry" window will
pop up automatically. This is called "pouncing", and some people find it annoying.</P>
"""
label.setToolTip(self._dirs_tip)
label.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Minimum)
dirs_tb.addWidget(label)
#.........这里部分代码省略.........
示例3: __init__
# 需要导入模块: from PyQt4.Qt import QFrame [as 别名]
# 或者: from PyQt4.Qt.QFrame import setFrameStyle [as 别名]
def __init__(self, parent, hide_on_close=False):
QMainWindow.__init__(self, parent)
self._hide_on_close = hide_on_close
# replace the BusyIndicator class with a GUI-aware one
Purr.BusyIndicator = BusyIndicator
self._pounce = False
# we keep a small stack of previously active purrers. This makes directory changes
# faster (when going back and forth between dirs)
# current purrer
self.purrer = None
self.purrer_stack = []
# Purr pipes for receiving remote commands
self.purrpipes = {}
# init GUI
self.setWindowTitle("PURR")
self.setWindowIcon(pixmaps.purr_logo.icon())
cw = QWidget(self)
self.setCentralWidget(cw)
cwlo = QVBoxLayout(cw)
cwlo.setContentsMargins(0, 0, 0, 0)
cwlo.setMargin(5)
cwlo.setSpacing(0)
toplo = QHBoxLayout();
cwlo.addLayout(toplo)
# About dialog
self._about_dialog = QMessageBox(self)
self._about_dialog.setWindowTitle("About PURR")
self._about_dialog.setText(self.about_message + """
<P>PURR is not watching any directories right now. You may need to restart it, and give it
some directory names on the command line.</P>""")
self._about_dialog.setIconPixmap(pixmaps.purr_logo.pm())
# Log viewer dialog
self.viewer_dialog = HTMLViewerDialog(self, config_name="log-viewer",
buttons=[(pixmaps.blue_round_reload, "Regenerate",
"""<P>Regenerates your log's HTML code from scratch. This can be useful if
your PURR version has changed, or if there was an error of some kind
the last time the files were generated.</P>
""")])
self._viewer_timestamp = None
self.connect(self.viewer_dialog, SIGNAL("Regenerate"), self._regenerateLog)
self.connect(self.viewer_dialog, SIGNAL("viewPath"), self._viewPath)
# Log title toolbar
title_tb = QToolBar(cw)
title_tb.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
title_tb.setIconSize(QSize(16, 16))
cwlo.addWidget(title_tb)
title_label = QLabel("Purrlog title:", title_tb)
title_tb.addWidget(title_label)
self.title_editor = QLineEdit(title_tb)
title_tb.addWidget(self.title_editor)
self.connect(self.title_editor, SIGNAL("editingFinished()"), self._titleChanged)
tip = """<P>This is your current log title. To rename the log, enter new name here and press Enter.</P>"""
title_label.setToolTip(tip)
self.title_editor.setToolTip(tip)
self.wviewlog = title_tb.addAction(pixmaps.openbook.icon(), "View", self._showViewerDialog)
self.wviewlog.setToolTip("Click to see an HTML rendering of your current log.")
qa = title_tb.addAction(pixmaps.purr_logo.icon(), "About...", self._about_dialog.exec_)
qa.setToolTip("<P>Click to see the About... dialog, which will tell you something about PURR.</P>")
self.wdirframe = QFrame(cw)
cwlo.addWidget(self.wdirframe)
self.dirs_lo = QVBoxLayout(self.wdirframe)
self.dirs_lo.setMargin(5)
self.dirs_lo.setContentsMargins(5, 0, 5, 5)
self.dirs_lo.setSpacing(0)
self.wdirframe.setFrameStyle(QFrame.Box | QFrame.Raised)
self.wdirframe.setLineWidth(1)
## Directories toolbar
dirs_tb = QToolBar(self.wdirframe)
dirs_tb.setToolButtonStyle(Qt.ToolButtonIconOnly)
dirs_tb.setIconSize(QSize(16, 16))
self.dirs_lo.addWidget(dirs_tb)
label = QLabel("Monitoring directories:", dirs_tb)
self._dirs_tip = """<P>PURR can monitor your working directories for new or updated files. If there's a checkmark
next to the directory name in this list, PURR is monitoring it.</P>
<P>If the checkmark is grey, PURR is monitoring things unobtrusively. When a new or updated file is detected in he monitored directory,
it is quietly added to the list of files in the "New entry" window, even if this window is not currently visible.</P>
<P>If the checkmark is black, PURR will be more obtrusive. Whenever a new or updated file is detected, the "New entry" window will
pop up automatically. This is called "pouncing", and some people find it annoying.</P>
"""
label.setToolTip(self._dirs_tip)
label.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Minimum)
dirs_tb.addWidget(label)
# add directory list widget
self.wdirlist = DirectoryListWidget(self.wdirframe)
self.wdirlist.setToolTip(self._dirs_tip)
QObject.connect(self.wdirlist, SIGNAL("directoryStateChanged"), self._changeWatchedDirState)
self.dirs_lo.addWidget(self.wdirlist)
# self.wdirlist.setMaximumSize(1000000,64)
# add directory button
add = dirs_tb.addAction(pixmaps.list_add.icon(), "Add", self._showAddDirectoryDialog)
add.setToolTip("<P>Click to add another directory to be monitored.</P>")
#.........这里部分代码省略.........
示例4: VLine
# 需要导入模块: from PyQt4.Qt import QFrame [as 别名]
# 或者: from PyQt4.Qt.QFrame import setFrameStyle [as 别名]
def VLine(self):
line = QFrame()
line.setFrameStyle(QFrame.VLine)
line.setFrameShape(QFrame.VLine)
line.setFrameShadow(QFrame.Sunken)
return line