本文整理匯總了Python中PySide.QtGui.QFrame.setFrameStyle方法的典型用法代碼示例。如果您正苦於以下問題:Python QFrame.setFrameStyle方法的具體用法?Python QFrame.setFrameStyle怎麽用?Python QFrame.setFrameStyle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PySide.QtGui.QFrame
的用法示例。
在下文中一共展示了QFrame.setFrameStyle方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: createDisplayFields
# 需要導入模塊: from PySide.QtGui import QFrame [as 別名]
# 或者: from PySide.QtGui.QFrame import setFrameStyle [as 別名]
def createDisplayFields(self):
display_widget = QFrame()
display_widget.setFrameStyle(QtGui.QFrame.Panel | QtGui.QFrame.Sunken)
self.left_layout.addWidget(display_widget)
self.display_layout = QHBoxLayout()
# self.turn = self.transcript.current_turn()
self.time_field = qHotField("time", str, "00:00:00", min_size=75, max_size=75, pos="top", handler=self.update_time)
self.display_layout.addWidget(self.time_field)
self.speaker_field = qHotField("speaker", str, " ", min_size=75, max_size=75, pos="top", handler=self.update_speaker)
self.display_layout.addWidget(self.speaker_field)
self.utt_field = qHotField("utterance", str, " ", min_size=350, max_size=500, pos="top", handler=self.update_utterance, multiline=True)
self.utt_field.setStyleSheet("font: 14pt \"Courier\";")
# self.utt_field.efield.setFont(QFont('SansSerif', 12))
self.display_layout.addWidget(self.utt_field)
display_widget.setLayout(self.display_layout)
self.display_layout.setStretchFactor(self.speaker_field, 0)
self.display_layout.setStretchFactor(self.utt_field, 1)
self.transcript_slider = QSlider(QtCore.Qt.Horizontal, self)
self.display_layout.addWidget(self.transcript_slider)
self.transcript_slider.setMaximum(100)
self.connect(self.transcript_slider,
QtCore.SIGNAL("sliderMoved(int)"), self.position_transcript)
self.left_layout.addWidget(self.transcript_slider)
示例2: __init__
# 需要導入模塊: from PySide.QtGui import QFrame [as 別名]
# 或者: from PySide.QtGui.QFrame import setFrameStyle [as 別名]
def __init__(self, options, parent=None):
_OptionsWizardPage.__init__(self, options, parent=parent)
self.setTitle("Conversion warnings")
# Widgets
self._lbl_count = SimulationCountLabel()
self._lbl_count.setAlignment(Qt.AlignCenter)
# Layouts
layout = self.layout()
frm_line = QFrame()
frm_line.setFrameStyle(QFrame.HLine)
frm_line.setFrameShadow(QFrame.Sunken)
layout.addWidget(frm_line)
sublayout = QHBoxLayout()
sublayout.setContentsMargins(10, 0, 10, 0)
sublayout.addWidget(self._lbl_count)
layout.addLayout(sublayout)
示例3: __init__
# 需要導入模塊: from PySide.QtGui import QFrame [as 別名]
# 或者: from PySide.QtGui.QFrame import setFrameStyle [as 別名]
def __init__(self, options, parent=None):
_OptionsWizardPage.__init__(self, options, parent)
# Widgets
self._lbl_count = SimulationCountLabel()
self._lbl_count.setAlignment(Qt.AlignCenter)
self._lbl_count.setValue(1)
# Layouts
layout = self.layout()
frm_line = QFrame()
frm_line.setFrameStyle(QFrame.HLine)
frm_line.setFrameShadow(QFrame.Sunken)
layout.addWidget(frm_line)
sublayout = QHBoxLayout()
sublayout.setContentsMargins(10, 0, 10, 0)
sublayout.addWidget(self._lbl_count)
layout.addLayout(sublayout)
# Signals
self.valueChanged.connect(self._onChanged)
示例4: CmdPrompt
# 需要導入模塊: from PySide.QtGui import QFrame [as 別名]
# 或者: from PySide.QtGui.QFrame import setFrameStyle [as 別名]
class CmdPrompt(QWidget):
"""
CmdPrompt for Embroidermodder.
"""
def __init__(self, parent=None):
"""Default class constructor."""
super(CmdPrompt, self).__init__(parent)
qDebug("CmdPrompt Constructor")
self.setObjectName("Command Prompt")
self.promptInput = promptInput = CmdPromptInput(self)
self.promptHistory = CmdPromptHistory()
self.promptDivider = QFrame(self)
promptVBoxLayout = QVBoxLayout(self)
self.promptSplitter = CmdPromptSplitter(self)
self.setFocusProxy(promptInput)
self.promptHistory.setFocusProxy(promptInput)
self.promptDivider.setLineWidth(1)
self.promptDivider.setFrameStyle(QFrame.HLine)
QWIDGETSIZE_MAX = 1 # TODO/FIXME. What is QWIDGETSIZE_MAX???
self.promptDivider.setMaximumSize(QWIDGETSIZE_MAX, 1)
promptVBoxLayout.addWidget(self.promptSplitter)
promptVBoxLayout.addWidget(self.promptHistory)
promptVBoxLayout.addWidget(self.promptDivider)
promptVBoxLayout.addWidget(promptInput)
promptVBoxLayout.setSpacing(0)
promptVBoxLayout.setContentsMargins(0, 0, 0, 0)
self.setLayout(promptVBoxLayout)
#TODO# self.styleHash = QHash<QString, QString>()
#TODO# self.styleHash.insert("color", "#000000") # Match -------|
#TODO# self.styleHash.insert("background-color", "#FFFFFF") # |
#TODO# self.styleHash.insert("selection-color", "#FFFFFF") # |
#TODO# self.styleHash.insert("selection-background-color", "#000000") # Match -------|
#TODO# self.styleHash.insert("font-family", "Monospace")
#TODO# self.styleHash.insert("font-style", "normal")
#TODO# self.styleHash.insert("font-size", "12px")
# self.updateStyle()
self.blinkState = False
self.blinkTimer = QTimer(self)
self.blinkTimer.timeout.connect(self.blink)
self.show()
#### stopBlinking = SIGNAL(str)
#TODO# I'm guessing these are custom Signals...
#TODO# promptInput.stopBlinking.connect(self.stopBlinking)
#TODO# connect(promptInput, SIGNAL(appendHistory(const QString&, int)), promptHistory, SLOT(appendHistory(const QString&, int)));
#TODO# connect(this, SIGNAL(appendTheHistory(const QString&, int)), promptHistory, SLOT(appendHistory(const QString&, int)));
# For use outside of command prompt
#TODO# connect(promptInput, SIGNAL(startCommand(const QString&)), this, SIGNAL(startCommand(const QString&)));
#TODO# connect(promptInput, SIGNAL(runCommand(const QString&, const QString&)), this, SIGNAL(runCommand(const QString&, const QString&)));
#TODO# connect(promptInput, SIGNAL(deletePressed()), this, SIGNAL(deletePressed()));
#TODO# connect(promptInput, SIGNAL(tabPressed()), this, SIGNAL(tabPressed()));
#TODO# connect(promptInput, SIGNAL(escapePressed()), this, SIGNAL(escapePressed()));
#TODO# connect(promptInput, SIGNAL(upPressed()), this, SIGNAL(upPressed()));
#TODO# connect(promptInput, SIGNAL(downPressed()), this, SIGNAL(downPressed()));
#TODO# connect(promptInput, SIGNAL(F1Pressed()), this, SIGNAL(F1Pressed()));
#TODO# connect(promptInput, SIGNAL(F2Pressed()), this, SIGNAL(F2Pressed()));
#TODO# connect(promptInput, SIGNAL(F3Pressed()), this, SIGNAL(F3Pressed()));
#TODO# connect(promptInput, SIGNAL(F4Pressed()), this, SIGNAL(F4Pressed()));
#TODO# connect(promptInput, SIGNAL(F5Pressed()), this, SIGNAL(F5Pressed()));
#TODO# connect(promptInput, SIGNAL(F6Pressed()), this, SIGNAL(F6Pressed()));
#TODO# connect(promptInput, SIGNAL(F7Pressed()), this, SIGNAL(F7Pressed()));
#TODO# connect(promptInput, SIGNAL(F8Pressed()), this, SIGNAL(F8Pressed()));
#TODO# connect(promptInput, SIGNAL(F9Pressed()), this, SIGNAL(F9Pressed()));
#TODO# connect(promptInput, SIGNAL(F10Pressed()), this, SIGNAL(F10Pressed()));
#TODO# connect(promptInput, SIGNAL(F11Pressed()), this, SIGNAL(F11Pressed()));
#TODO# connect(promptInput, SIGNAL(F12Pressed()), this, SIGNAL(F12Pressed()));
#TODO# connect(promptInput, SIGNAL(cutPressed()), this, SIGNAL(cutPressed()));
#TODO# connect(promptInput, SIGNAL(copyPressed()), this, SIGNAL(copyPressed()));
#TODO# connect(promptInput, SIGNAL(pastePressed()), this, SIGNAL(pastePressed()));
#TODO# connect(promptInput, SIGNAL(selectAllPressed()), this, SIGNAL(selectAllPressed()));
#TODO# connect(promptInput, SIGNAL(undoPressed()), this, SIGNAL(undoPressed()));
#TODO# connect(promptInput, SIGNAL(redoPressed()), this, SIGNAL(redoPressed()));
#TODO#
#TODO# connect(promptInput, SIGNAL(shiftPressed()), this, SIGNAL(shiftPressed()));
#TODO# connect(promptInput, SIGNAL(shiftReleased()), this, SIGNAL(shiftReleased()));
#TODO#
#TODO# connect(promptHistory, SIGNAL(historyAppended(const QString&)), this, SIGNAL(historyAppended(const QString&)));
def floatingChanged(self, isFloating): #TODO
"""
TOWRITE
:param `isFloating`: TOWRITE
:type `isFloating`: bool
"""
qDebug("CmdPrompt floatingChanged(%d)", isFloating)
if isFloating:
#.........這裏部分代碼省略.........
示例5: MainWindow
# 需要導入模塊: from PySide.QtGui import QFrame [as 別名]
# 或者: from PySide.QtGui.QFrame import setFrameStyle [as 別名]
class MainWindow(QMainWindow):
def __init__(self, parent = None):
super(MainWindow, self).__init__(parent)
self.app = app = QCoreApplication.instance()
self.setWindowTitle('Button Size Test')
self.stupidSize = 3
self.dummyWidget = QFrame()
self.dummyWidget.setFrameStyle(QFrame.Box)
self.organizeContent(self.dummyWidget)
self.setCentralWidget(self.dummyWidget)
def sizeHint(self):
return QSize(500, 400)
def organizeContent(self, widget):
# get style metrics
leftMargin = self.app.style().pixelMetric(QStyle.PM_LayoutLeftMargin)
topMargin = self.app.style().pixelMetric(QStyle.PM_LayoutTopMargin)
standHeight = self.app.style().pixelMetric(QStyle.PM_ButtonMargin) +\
self.app.fontMetrics().height()
doubleStandHeight = standHeight * 2
hsepara = self.app.style().pixelMetric(QStyle.PM_LayoutHorizontalSpacing)
vsepara = self.app.style().pixelMetric(QStyle.PM_LayoutVerticalSpacing)
# calculate grids
col0Left = leftMargin
col1Left = leftMargin + doubleStandHeight + vsepara
col2Left = leftMargin + doubleStandHeight + standHeight + 2*vsepara
col3Left = leftMargin + 2*doubleStandHeight + standHeight + 4*vsepara
row0Top = topMargin
row1Top = topMargin + standHeight + hsepara
row2Top = topMargin + 3*standHeight + 2*hsepara
row3Top = topMargin + 4*standHeight + 3*hsepara
btnUp = QPushButton('Up', widget)
btnUp.setGeometry(col1Left, row1Top, standHeight, doubleStandHeight)
btnLeft = QPushButton('Left', widget)
btnLeft.setGeometry(col0Left, row2Top, doubleStandHeight, standHeight)
txtQuant = QLineEdit(widget)
txtQuant.setGeometry(col1Left, row2Top, standHeight, standHeight)
txtQuant.setAlignment(Qt.AlignVCenter | Qt.AlignCenter)
btnRight = QPushButton('Right', widget)
btnRight.setGeometry(col2Left, row2Top, doubleStandHeight, standHeight)
btnDown = QPushButton('Dn', widget)
btnDown.setGeometry(col1Left, row3Top, standHeight, doubleStandHeight)
lb3 = QLabel('Elevation:', widget)
lb3.setGeometry(col3Left, row2Top, lb3.sizeHint().width(), standHeight)
wi = self.app.fontMetrics().width('Horizontal:') + 2
lb4 = QLabel('Horizontal:', widget)
lb4.setGeometry(col3Left, row3Top, wi, standHeight)
col4Left = leftMargin + 2*doubleStandHeight + standHeight + 5*vsepara + wi
txtElev = QLineEdit(widget)
txtElev.setGeometry(col4Left, row2Top, doubleStandHeight, standHeight)
txtElev.setAlignment(Qt.AlignVCenter | Qt.AlignCenter)
txtHoriz = QLineEdit(widget)
txtHoriz.setGeometry(col4Left, row3Top, doubleStandHeight, standHeight)
txtHoriz.setAlignment(Qt.AlignVCenter | Qt.AlignCenter)
lb2 = QLabel('Angles in degrees', widget)
lb2.setGeometry(col3Left, row2Top - standHeight - hsepara, wi + hsepara + doubleStandHeight, standHeight)
lb2.setAlignment(Qt.AlignVCenter | Qt.AlignCenter) #Qt.AlignVCenter
totalWi = col4Left + doubleStandHeight - col0Left
totalHi = row3Top + doubleStandHeight - row0Top
lb1 = QLabel('Camera position control panel', widget)
lb1.setGeometry(col0Left, row0Top, totalWi, standHeight)
lb1.setAlignment(Qt.AlignVCenter | Qt.AlignCenter)
lb1.setFrameStyle(QFrame.Box)
示例6: __create_ui
# 需要導入模塊: from PySide.QtGui import QFrame [as 別名]
# 或者: from PySide.QtGui.QFrame import setFrameStyle [as 別名]
def __create_ui(self):
""" Create main UI """
self.setWindowTitle(CREATE_NODE_TITLE)
# remove window decoration if path and type is set
if self.defined_path and self.defined_type:
self.setWindowFlags(Qt.FramelessWindowHint | Qt.Popup)
main_layout = QVBoxLayout(self)
main_layout.setSpacing(1)
main_layout.setContentsMargins(2, 2, 2, 2)
# content layout
content_layout = QVBoxLayout()
self.files_model = QFileSystemModel()
self.files_model.setNameFilterDisables(False)
self.files_list = MTTFileList()
self.files_list.setAlternatingRowColors(True)
self.files_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
self.files_list.selectionValidated.connect(self.do_validate_selection)
self.files_list.goToParentDirectory.connect(self.on_go_up_parent)
self.files_list.doubleClicked.connect(self.on_double_click)
self.files_list.setModel(self.files_model)
buttons_layout = QHBoxLayout()
content_layout.addLayout(self.__create_filter_ui())
content_layout.addWidget(self.files_list)
content_layout.addLayout(buttons_layout)
self.files_list.filter_line = self.filter_line
if not self.defined_path:
# path line
path_layout = QHBoxLayout()
# bookmark button
bookmark_btn = QPushButton('')
bookmark_btn.setFlat(True)
bookmark_btn.setIcon(QIcon(':/addBookmark.png'))
bookmark_btn.setToolTip('Bookmark this Folder')
bookmark_btn.setStatusTip('Bookmark this Folder')
bookmark_btn.clicked.connect(self.on_add_bookmark)
# path line edit
self.path_edit = QLineEdit()
self.path_edit.editingFinished.connect(self.on_enter_path)
# parent folder button
self.parent_folder_btn = QPushButton('')
self.parent_folder_btn.setFlat(True)
self.parent_folder_btn.setIcon(QIcon(':/SP_FileDialogToParent.png'))
self.parent_folder_btn.setToolTip('Parent Directory')
self.parent_folder_btn.setStatusTip('Parent Directory')
self.parent_folder_btn.clicked.connect(self.on_go_up_parent)
# browse button
browse_btn = QPushButton('')
browse_btn.setFlat(True)
browse_btn.setIcon(QIcon(':/navButtonBrowse.png'))
browse_btn.setToolTip('Browse Directory')
browse_btn.setStatusTip('Browse Directory')
browse_btn.clicked.connect(self.on_browse)
# parent widget and layout
path_layout.addWidget(bookmark_btn)
path_layout.addWidget(self.path_edit)
path_layout.addWidget(self.parent_folder_btn)
path_layout.addWidget(browse_btn)
main_layout.addLayout(path_layout)
# bookmark list
bookmark_parent_layout = QHBoxLayout()
bookmark_frame = QFrame()
bookmark_frame.setFixedWidth(120)
bookmark_layout = QVBoxLayout()
bookmark_layout.setSpacing(1)
bookmark_layout.setContentsMargins(2, 2, 2, 2)
bookmark_frame.setLayout(bookmark_layout)
bookmark_frame.setFrameStyle(QFrame.Sunken)
bookmark_frame.setFrameShape(QFrame.StyledPanel)
self.bookmark_list = MTTBookmarkList()
self.bookmark_list.bookmarkDeleted.connect(self.do_delete_bookmark)
self.bookmark_list.setAlternatingRowColors(True)
self.bookmark_list.dragEnabled()
self.bookmark_list.setAcceptDrops(True)
self.bookmark_list.setDropIndicatorShown(True)
self.bookmark_list.setDragDropMode(QListView.InternalMove)
self.bookmark_list_sel_model = self.bookmark_list.selectionModel()
self.bookmark_list_sel_model.selectionChanged.connect(
self.on_select_bookmark)
bookmark_layout.addWidget(self.bookmark_list)
bookmark_parent_layout.addWidget(bookmark_frame)
bookmark_parent_layout.addLayout(content_layout)
main_layout.addLayout(bookmark_parent_layout)
self.do_populate_bookmarks()
else:
main_layout.addLayout(content_layout)
if not self.defined_type:
# type layout
self.types = QComboBox()
self.types.addItems(self.supported_node_type)
#.........這裏部分代碼省略.........
示例7: CmdPrompt
# 需要導入模塊: from PySide.QtGui import QFrame [as 別名]
# 或者: from PySide.QtGui.QFrame import setFrameStyle [as 別名]
class CmdPrompt(QWidget):
"""
Subclass of `QWidget`_
CmdPrompt for Embroidermodder.
.. sphinx_generate_methods_summary::
CmdPrompt
"""
def QWIDGETSIZE_MAX(self):
return (1 << 24) - 1
def __init__(self, parent=None):
"""
Default class constructor.
:param `parent`: Pointer to a parent widget instance.
:type `parent`: `QWidget`_
"""
super(CmdPrompt, self).__init__(parent)
qDebug("CmdPrompt Constructor")
self.setObjectName("Command Prompt")
self.promptInput = promptInput = CmdPromptInput(self)
self.promptHistory = promptHistory = CmdPromptHistory()
self.promptDivider = QFrame(self)
promptVBoxLayout = QVBoxLayout(self)
self.promptSplitter = CmdPromptSplitter(self)
self.setFocusProxy(promptInput)
self.promptHistory.setFocusProxy(promptInput)
self.promptDivider.setLineWidth(1)
self.promptDivider.setFrameStyle(QFrame.HLine)
self.promptDivider.setMaximumSize(self.QWIDGETSIZE_MAX(), 1)
promptVBoxLayout.addWidget(self.promptSplitter)
promptVBoxLayout.addWidget(self.promptHistory)
promptVBoxLayout.addWidget(self.promptDivider)
promptVBoxLayout.addWidget(promptInput)
promptVBoxLayout.setSpacing(0)
promptVBoxLayout.setContentsMargins(0, 0, 0, 0)
self.setLayout(promptVBoxLayout)
self.styleHash = {} # QHash<QString, QString>()
self.styleHash["color"] = "#000000" # Match -------|
self.styleHash["background-color"] = "#FFFFFF" # |
self.styleHash["selection-color"] = "#FFFFFF" # |
self.styleHash["selection-background-color"] = "#000000" # Match -------|
self.styleHash["font-family"] = "Monospace"
self.styleHash["font-style"] = "normal"
self.styleHash["font-size"] = "12px"
self.updateStyle()
self.blinkState = False
self.blinkTimer = QTimer(self)
self.blinkTimer.timeout.connect(self.blink)
self.show()
self.connect(promptInput, SIGNAL("stopBlinking()"), self, SLOT("stopBlinking()"))
self.connect(promptInput, SIGNAL("appendHistory(QString, int)"), promptHistory, SLOT("appendHistory(const QString&, int)"))
self.connect(self, SIGNAL("appendTheHistory(QString, int)"), promptHistory, SLOT("appendHistory(const QString&, int)"))
# For use outside of command prompt
self.connect(promptInput, SIGNAL("startCommand(QString)"), self, SIGNAL("startCommand(QString)"))
self.connect(promptInput, SIGNAL("runCommand(QString, QString)"), self, SIGNAL("runCommand(QString, QString)"))
self.connect(promptInput, SIGNAL("deletePressed()"), self, SIGNAL("deletePressed()"))
self.connect(promptInput, SIGNAL("tabPressed()"), self, SIGNAL("tabPressed()"))
self.connect(promptInput, SIGNAL("escapePressed()"), self, SIGNAL("escapePressed()"))
self.connect(promptInput, SIGNAL("upPressed()"), self, SIGNAL("upPressed()"))
self.connect(promptInput, SIGNAL("downPressed()"), self, SIGNAL("downPressed()"))
self.connect(promptInput, SIGNAL("F1Pressed()"), self, SIGNAL("F1Pressed()"))
self.connect(promptInput, SIGNAL("F2Pressed()"), self, SIGNAL("F2Pressed()"))
self.connect(promptInput, SIGNAL("F3Pressed()"), self, SIGNAL("F3Pressed()"))
self.connect(promptInput, SIGNAL("F4Pressed()"), self, SIGNAL("F4Pressed()"))
self.connect(promptInput, SIGNAL("F5Pressed()"), self, SIGNAL("F5Pressed()"))
self.connect(promptInput, SIGNAL("F6Pressed()"), self, SIGNAL("F6Pressed()"))
self.connect(promptInput, SIGNAL("F7Pressed()"), self, SIGNAL("F7Pressed()"))
self.connect(promptInput, SIGNAL("F8Pressed()"), self, SIGNAL("F8Pressed()"))
self.connect(promptInput, SIGNAL("F9Pressed()"), self, SIGNAL("F9Pressed()"))
self.connect(promptInput, SIGNAL("F10Pressed()"), self, SIGNAL("F10Pressed()"))
self.connect(promptInput, SIGNAL("F11Pressed()"), self, SIGNAL("F11Pressed()"))
self.connect(promptInput, SIGNAL("F12Pressed()"), self, SIGNAL("F12Pressed()"))
self.connect(promptInput, SIGNAL("cutPressed()"), self, SIGNAL("cutPressed()"))
self.connect(promptInput, SIGNAL("copyPressed()"), self, SIGNAL("copyPressed()"))
self.connect(promptInput, SIGNAL("pastePressed()"), self, SIGNAL("pastePressed()"))
self.connect(promptInput, SIGNAL("selectAllPressed()"), self, SIGNAL("selectAllPressed()"))
self.connect(promptInput, SIGNAL("undoPressed()"), self, SIGNAL("undoPressed()"))
self.connect(promptInput, SIGNAL("redoPressed()"), self, SIGNAL("redoPressed()"))
self.connect(promptInput, SIGNAL("shiftPressed()"), self, SIGNAL("shiftPressed()"))
self.connect(promptInput, SIGNAL("shiftReleased()"), self, SIGNAL("shiftReleased()"))
#.........這裏部分代碼省略.........