本文整理汇总了Python中PySide.QtGui.QFrame.setFrameShape方法的典型用法代码示例。如果您正苦于以下问题:Python QFrame.setFrameShape方法的具体用法?Python QFrame.setFrameShape怎么用?Python QFrame.setFrameShape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QFrame
的用法示例。
在下文中一共展示了QFrame.setFrameShape方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BorderBox
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
def BorderBox(self, layout):
from PySide.QtGui import QFrame
toto = QFrame()
toto.setLayout(layout)
toto.setFrameShape(QFrame.Box)
toto.setFrameShadow(QFrame.Sunken)
return toto
示例2: HorizontalDivider
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
def HorizontalDivider():
"""
Creates a horizontal divider line.
:return:
"""
divider = QFrame()
divider.setFrameShape(QFrame.HLine)
divider.setFrameShadow(QFrame.Raised)
return divider
示例3: VerticalDivider
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
def VerticalDivider():
"""
Creates a vertical divider line.
:return:
"""
divider = QFrame()
divider.setFrameShape(QFrame.VLine)
divider.setFrameShadow(QFrame.Raised)
return divider
示例4: __init__
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
def __init__(self):
generic.GenericGui.__init__(self)
window = QWidget()
window.setWindowTitle('quichem-pyside')
self.compiler_view = QListWidget()
self.compiler_view.currentRowChanged.connect(self.show_source)
self.stacked_widget = QStackedWidget()
self.stacked_widget.setFrameStyle(QFrame.StyledPanel | QFrame.Raised)
self.edit = QLineEdit()
self.edit.setPlaceholderText('Type quichem input...')
self.edit.textChanged.connect(self.change_value)
self.view = QWebView()
self.view.page().mainFrame().setScrollBarPolicy(Qt.Vertical,
Qt.ScrollBarAlwaysOff)
self.view.page().action(QWebPage.Reload).setVisible(False)
self.view.setMaximumHeight(0)
self.view.setUrl('qrc:/web/page.html')
self.view.setZoomFactor(2)
self.view.page().mainFrame().contentsSizeChanged.connect(
self._resize_view)
# For debugging JS:
## from PySide.QtWebKit import QWebSettings
## QWebSettings.globalSettings().setAttribute(
## QWebSettings.DeveloperExtrasEnabled, True)
button_image = QPushButton('Copy as Image')
button_image.clicked.connect(self.set_clipboard_image)
button_image.setToolTip('Then paste into any graphics program')
button_word = QPushButton('Copy as MS Word Equation')
button_word.clicked.connect(self.set_clipboard_word)
button_html = QPushButton('Copy as Formatted Text')
button_html.clicked.connect(self.set_clipboard_html)
line = QFrame()
line.setFrameShape(QFrame.HLine)
line.setFrameShadow(QFrame.Sunken)
button_layout = QHBoxLayout()
button_layout.addStretch()
button_layout.addWidget(button_image)
button_layout.addWidget(button_word)
button_layout.addWidget(button_html)
source_layout = QHBoxLayout()
source_layout.addWidget(self.compiler_view)
source_layout.addWidget(self.stacked_widget, 1)
QVBoxLayout(window)
window.layout().addWidget(self.edit)
window.layout().addWidget(self.view)
window.layout().addLayout(button_layout)
window.layout().addWidget(line)
window.layout().addLayout(source_layout, 1)
window.show()
window.resize(window.minimumWidth(), window.height())
# To prevent garbage collection of internal Qt object.
self._window = window
示例5: create_separator
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
def create_separator(self, parent, is_vertical=True):
""" Returns an adapted separator line control.
"""
control = QFrame()
control.setFrameShadow(QFrame.Sunken)
if is_vertical:
control.setFrameShape(QFrame.VLine)
control.setMinimumWidth(5)
else:
control.setFrameShape(QFrame.HLine)
control.setMinimumHeight(5)
return control_adapter_for(control)
示例6: add_separator
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
def add_separator ( self, parent ):
""" Adds a separator to the layout.
"""
control = QFrame()
control.setFrameShadow( QFrame.Sunken )
if self.is_vertical or (self.columns > 0):
control.setFrameShape( QFrame.HLine )
control.setMinimumHeight( 5 )
else:
control.setFrameShape( QFrame.VLine )
control.setMinimumWidth( 5 )
if self.columns > 0:
self.layout.addWidget( control, self._row, 0, 1, self.columns )
self._row += 1
else:
self.layout.addWidget( control )
示例7: __init__
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
def __init__(self, *args, **kwargs ):
QDialog.__init__( self, *args, **kwargs )
self.installEventFilter( self )
self.setWindowTitle( Window.title )
mainLayout = QVBoxLayout( self )
sep1 = QFrame();sep1.setFrameShape(QFrame.HLine)
sep2 = QFrame();sep2.setFrameShape(QFrame.HLine)
sep3 = QFrame();sep3.setFrameShape(QFrame.HLine)
hl_loadVtx = QHBoxLayout(); hl_loadVtx.setSpacing(5)
w_loadVtx_src = Widget_LoadVertex( title="Source Root Vertex" )
w_loadVtx_trg = Widget_LoadVertex( title="Target Root Vertex" )
hl_loadVtx.addWidget( w_loadVtx_src )
hl_loadVtx.addWidget( w_loadVtx_trg )
hl_loadJoints = QHBoxLayout(); hl_loadJoints.setSpacing(5)
w_loadJoints_src = Widget_loadJoints("Source Joints")
w_loadJoints_trg = Widget_loadJoints("Target Joints")
w_loadJoints_src.otherWidget = w_loadJoints_trg;w_loadJoints_trg.otherWidget = w_loadJoints_src;
hl_loadJoints.addWidget( w_loadJoints_src )
hl_loadJoints.addWidget( w_loadJoints_trg )
w_selectionGrow = Widget_SelectionGrow()
hl_select = QHBoxLayout(); hl_select.setSpacing(5)
b_selectSrc = QPushButton( "Select Source Vertices" )
b_selectTrg = QPushButton( "Select Target Vertices" )
hl_select.addWidget( b_selectSrc )
hl_select.addWidget( b_selectTrg )
b_copyWeight = QPushButton( "Copy Weight" )
mainLayout.addLayout( hl_loadVtx )
mainLayout.addWidget( sep1 )
mainLayout.addLayout( hl_loadJoints )
mainLayout.addWidget( sep2 )
mainLayout.addWidget( w_selectionGrow )
mainLayout.addLayout( hl_select )
mainLayout.addWidget( sep3 )
mainLayout.addWidget( b_copyWeight )
self.resize( Window.defaultWidth, Window.defaultHeight )
self.li_sourceVertex = w_loadVtx_src.lineEdit
self.li_targetVertex = w_loadVtx_trg.lineEdit
self.li_numGrow = w_selectionGrow.lineEdit
self.lw_srcJoints = w_loadJoints_src.listWidget
self.lw_trgJoints = w_loadJoints_trg.listWidget
QtCore.QObject.connect( b_selectSrc, QtCore.SIGNAL( "clicked()" ), self.selectSourceVertices )
QtCore.QObject.connect( b_selectTrg, QtCore.SIGNAL( "clicked()" ), self.selectTargetVertices )
QtCore.QObject.connect( b_copyWeight, QtCore.SIGNAL( 'clicked()' ), self.copyWeight )
示例8: View
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
class View(QWidget):
"""Base `View` class. Defines behavior common in all views"""
# Selecting a good font family for each platform
osname = platform.system()
if osname == 'Windows':
fontFamily = 'Segoe UI'
elif osname == 'Linux':
fontFamily = ''
else:
fontFamily = ''
def __init__(self, parent=None):
"""
Init method. Initializes parent classes
:param parent: Reference to a `QWidget` object to be used as parent
"""
super(View, self).__init__(parent)
@staticmethod
def labelsFont():
"""Returns the `QFont` that `QLabels` should use"""
return View.font(True)
@staticmethod
def editsFont():
"""Returns the `QFont` that `QLineEdits` should use"""
return View.font(False)
@staticmethod
def font(bold):
"""
Returns a `QFont` object to be used in `View` derived classes.
:param bold: Indicates whether or not the font will be bold
"""
font = QFont(View.fontFamily, 9, 50, False)
font.setBold(bold)
return font
def setLogo(self):
"""Sets the company logo in the same place in all views"""
logoPixmap = QPixmap(':/resources/logo.png')
self.iconLabel = QLabel(self)
self.iconLabel.setPixmap(logoPixmap)
self.iconLabel.setGeometry(20, 20, logoPixmap.width(), logoPixmap.height())
self.linkLabel = QLabel(self)
self.linkLabel.setText(
"""<font size="1"><a href="http://www.iqstorage.com/fromiqbox.php">
Developed at IQ Storage FTP Hosing Services</a></font>""")
self.linkLabel.setOpenExternalLinks(True)
# Defines a visual line separator to be placed under the `logoPixmap` `QLabel`
self.line = QFrame()
self.line.setFrameShape(QFrame.HLine);
self.line.setFrameShadow(QFrame.Sunken);
示例9: HLine
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
def HLine(self):
from PySide.QtGui import QFrame
toto = QFrame()
toto.setFrameShape(QFrame.HLine)
toto.setFrameShadow(QFrame.Sunken)
return toto
示例10: __create_ui
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [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)
#.........这里部分代码省略.........
示例11: MainWindow
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFrameShape [as 别名]
class MainWindow(QMainWindow):
def __init__(self, datta):
QMainWindow.__init__(self)
self.setWindowTitle('Project Parser')
appIcon = QIcon('search.png')
self.setWindowIcon(appIcon)
self.viewPortBL = QDesktopWidget().availableGeometry().topLeft()
self.viewPortTR = QDesktopWidget().availableGeometry().bottomRight()
self.margin = int(QDesktopWidget().availableGeometry().width()*0.1/2)
self.shirina = QDesktopWidget().availableGeometry().width() - self.margin*2
self.visota = QDesktopWidget().availableGeometry().height() - self.margin*2
self.setGeometry(self.viewPortBL.x() + self.margin, self.viewPortBL.y() + self.margin,
self.shirina, self.visota)
# statusbar
self.myStatusBar = QStatusBar()
self.setStatusBar(self.myStatusBar)
#lower long layout
self.lowerLong = QFrame()
self.detailsLabel = QLabel()
self.skillsLabel = QLabel()
self.urlLabel = QLabel()
self.locationLabel = QLabel()
self.skillsLabel.setText('skills')
self.detailsLabel.setWordWrap(True)
self.la = QVBoxLayout()
self.la.addWidget(self.detailsLabel)
self.la.addWidget(self.skillsLabel)
self.la.addWidget(self.urlLabel)
self.la.addWidget(self.locationLabel)
self.lowerLong.setLayout(self.la)
# table
self.source_model = MyTableModel(self, datta, ['Id', 'Date', 'Title'])
self.proxy_model = myTableProxy(self)
self.proxy_model.setSourceModel(self.source_model)
self.proxy_model.setDynamicSortFilter(True)
self.table_view = QTableView()
self.table_view.setModel(self.proxy_model)
self.table_view.setAlternatingRowColors(True)
self.table_view.resizeColumnsToContents()
self.table_view.resizeRowsToContents()
self.table_view.horizontalHeader().setStretchLastSection(True)
self.table_view.setSortingEnabled(True)
self.table_view.sortByColumn(2, Qt.AscendingOrder)
# events
self.selection = self.table_view.selectionModel()
self.selection.selectionChanged.connect(self.handleSelectionChanged)
#DO NOT use CreateIndex() method, use index()
index = self.proxy_model.index(0,0)
self.selection.select(index, QItemSelectionModel.Select)
self.upperLong = self.table_view
# right side widgets
self.right = QFrame()
self.la1 = QVBoxLayout()
self.btnDownload = QPushButton('Download data')
self.btnDownload.clicked.connect(self.download)
self.myButton = QPushButton('Show Skillls')
self.myButton.clicked.connect(self.showAllSkills)
self.btnSearchByWord = QPushButton('Search by word(s)')
self.btnSearchByWord.clicked.connect(self.onSearchByWord)
self.btnResetFilter= QPushButton('Discard Filter')
self.btnResetFilter.clicked.connect(self.discardFilter)
self.btnCopyURL = QPushButton('URL to Clipboard')
self.btnCopyURL.clicked.connect(self.copyToClipboard)
self.btnExit = QPushButton('Exit')
self.btnExit.clicked.connect(lambda: sys.exit())
self.dateTimeStamp = QLabel()
self.la1.addWidget(self.btnDownload)
self.la1.addSpacing(10)
self.la1.addWidget(self.myButton)
self.la1.addSpacing(10)
self.la1.addWidget(self.btnSearchByWord)
self.la1.addSpacing(10)
self.la1.addWidget(self.btnResetFilter)
self.la1.addSpacing(10)
self.la1.addWidget(self.btnCopyURL)
self.la1.addSpacing(70)
self.la1.addWidget(self.btnExit)
self.la1.addStretch(stretch=0)
self.la1.addWidget(self.dateTimeStamp)
self.right.setLayout(self.la1)
self.right.setFrameShape(QFrame.StyledPanel)
# splitters
self.horiSplit = QSplitter(Qt.Vertical)
self.horiSplit.addWidget(self.upperLong)
self.horiSplit.addWidget(self.lowerLong)
self.horiSplit.setSizes([self.visota/2, self.visota/2])
self.vertiSplit = QSplitter(Qt.Horizontal)
self.vertiSplit.addWidget(self.horiSplit)
self.vertiSplit.addWidget(self.right)
self.vertiSplit.setSizes([self.shirina*3/4, self.shirina*1/4])
self.setCentralWidget(self.vertiSplit)
self.settings = QSettings('elance.ini', QSettings.IniFormat)
self.settings.beginGroup('DATE_STAMP')
#.........这里部分代码省略.........