本文整理汇总了Python中PyQt5.QtWidgets.QScrollArea.setFrameShadow方法的典型用法代码示例。如果您正苦于以下问题:Python QScrollArea.setFrameShadow方法的具体用法?Python QScrollArea.setFrameShadow怎么用?Python QScrollArea.setFrameShadow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QScrollArea
的用法示例。
在下文中一共展示了QScrollArea.setFrameShadow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UIPreviewer
# 需要导入模块: from PyQt5.QtWidgets import QScrollArea [as 别名]
# 或者: from PyQt5.QtWidgets.QScrollArea import setFrameShadow [as 别名]
class UIPreviewer(E5MainWindow):
"""
Class implementing the UI Previewer main window.
"""
def __init__(self, filename=None, parent=None, name=None):
"""
Constructor
@param filename name of a UI file to load
@param parent parent widget of this window (QWidget)
@param name name of this window (string)
"""
self.mainWidget = None
self.currentFile = QDir.currentPath()
super(UIPreviewer, self).__init__(parent)
if not name:
self.setObjectName("UIPreviewer")
else:
self.setObjectName(name)
self.setStyle(Preferences.getUI("Style"),
Preferences.getUI("StyleSheet"))
self.resize(QSize(600, 480).expandedTo(self.minimumSizeHint()))
self.statusBar()
self.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
self.setWindowTitle(self.tr("UI Previewer"))
self.cw = QWidget(self)
self.cw.setObjectName("centralWidget")
self.UIPreviewerLayout = QVBoxLayout(self.cw)
self.UIPreviewerLayout.setContentsMargins(6, 6, 6, 6)
self.UIPreviewerLayout.setSpacing(6)
self.UIPreviewerLayout.setObjectName("UIPreviewerLayout")
self.styleLayout = QHBoxLayout()
self.styleLayout.setContentsMargins(0, 0, 0, 0)
self.styleLayout.setSpacing(6)
self.styleLayout.setObjectName("styleLayout")
self.styleLabel = QLabel(self.tr("Select GUI Theme"), self.cw)
self.styleLabel.setObjectName("styleLabel")
self.styleLayout.addWidget(self.styleLabel)
self.styleCombo = QComboBox(self.cw)
self.styleCombo.setObjectName("styleCombo")
self.styleCombo.setEditable(False)
self.styleCombo.setToolTip(self.tr("Select the GUI Theme"))
self.styleLayout.addWidget(self.styleCombo)
self.styleCombo.addItems(sorted(QStyleFactory().keys()))
currentStyle = Preferences.Prefs.settings.value('UIPreviewer/style')
if currentStyle is not None:
self.styleCombo.setCurrentIndex(int(currentStyle))
styleSpacer = QSpacerItem(
40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.styleLayout.addItem(styleSpacer)
self.UIPreviewerLayout.addLayout(self.styleLayout)
self.previewSV = QScrollArea(self.cw)
self.previewSV.setObjectName("preview")
self.previewSV.setFrameShape(QFrame.NoFrame)
self.previewSV.setFrameShadow(QFrame.Plain)
self.previewSV.setSizePolicy(
QSizePolicy.Expanding, QSizePolicy.Expanding)
self.UIPreviewerLayout.addWidget(self.previewSV)
self.setCentralWidget(self.cw)
self.styleCombo.activated[str].connect(self.__guiStyleSelected)
self.__initActions()
self.__initMenus()
self.__initToolbars()
self.__updateActions()
# defere loading of a UI file until we are shown
self.fileToLoad = filename
def show(self):
"""
Public slot to show this dialog.
This overloaded slot loads a UI file to be previewed after
the main window has been shown. This way, previewing a dialog
doesn't interfere with showing the main window.
"""
super(UIPreviewer, self).show()
if self.fileToLoad is not None:
fn, self.fileToLoad = (self.fileToLoad, None)
self.__loadFile(fn)
def __initActions(self):
"""
Private method to define the user interface actions.
"""
#.........这里部分代码省略.........
示例2: XNova_MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QScrollArea [as 别名]
# 或者: from PyQt5.QtWidgets.QScrollArea import setFrameShadow [as 别名]
class XNova_MainWindow(QWidget):
STATE_NOT_AUTHED = 0
STATE_AUTHED = 1
def __init__(self, parent=None):
super(XNova_MainWindow, self).__init__(parent, Qt.Window)
# state vars
self.config_store_dir = './cache'
self.cfg = configparser.ConfigParser()
self.cfg.read('config/net.ini', encoding='utf-8')
self.state = self.STATE_NOT_AUTHED
self.login_email = ''
self.cookies_dict = {}
self._hidden_to_tray = False
#
# init UI
self.setWindowIcon(QIcon(':/i/xnova_logo_64.png'))
self.setWindowTitle('XNova Commander')
# main layouts
self._layout = QVBoxLayout()
self._layout.setContentsMargins(0, 2, 0, 0)
self._layout.setSpacing(3)
self.setLayout(self._layout)
self._horizontal_layout = QHBoxLayout()
self._horizontal_layout.setContentsMargins(0, 0, 0, 0)
self._horizontal_layout.setSpacing(6)
# flights frame
self._fr_flights = QFrame(self)
self._fr_flights.setMinimumHeight(22)
self._fr_flights.setFrameShape(QFrame.NoFrame)
self._fr_flights.setFrameShadow(QFrame.Plain)
# planets bar scrollarea
self._sa_planets = QScrollArea(self)
self._sa_planets.setMinimumWidth(125)
self._sa_planets.setMaximumWidth(125)
self._sa_planets.setFrameShape(QFrame.NoFrame)
self._sa_planets.setFrameShadow(QFrame.Plain)
self._sa_planets.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
self._sa_planets.setWidgetResizable(True)
self._panel_planets = QWidget(self._sa_planets)
self._layout_pp = QVBoxLayout()
self._panel_planets.setLayout(self._layout_pp)
self._lbl_planets = QLabel(self.tr('Planets:'), self._panel_planets)
self._lbl_planets.setMaximumHeight(32)
self._layout_pp.addWidget(self._lbl_planets)
self._layout_pp.addStretch()
self._sa_planets.setWidget(self._panel_planets)
#
# tab widget
self._tabwidget = XTabWidget(self)
self._tabwidget.enableButtonAdd(False)
self._tabwidget.tabCloseRequested.connect(self.on_tab_close_requested)
self._tabwidget.addClicked.connect(self.on_tab_add_clicked)
#
# create status bar
self._statusbar = XNCStatusBar(self)
self.set_status_message(self.tr('Not connected: Log in!'))
#
# tab widget pages
self.login_widget = None
self.flights_widget = None
self.overview_widget = None
self.imperium_widget = None
#
# settings widget
self.settings_widget = SettingsWidget(self)
self.settings_widget.settings_changed.connect(self.on_settings_changed)
self.settings_widget.hide()
#
# finalize layouts
self._horizontal_layout.addWidget(self._sa_planets)
self._horizontal_layout.addWidget(self._tabwidget)
self._layout.addWidget(self._fr_flights)
self._layout.addLayout(self._horizontal_layout)
self._layout.addWidget(self._statusbar)
#
# system tray icon
self.tray_icon = None
show_tray_icon = False
if 'tray' in self.cfg:
if (self.cfg['tray']['icon_usage'] == 'show') or \
(self.cfg['tray']['icon_usage'] == 'show_min'):
self.create_tray_icon()
#
# try to restore last window size
ssz = self.load_cfg_val('main_size')
if ssz is not None:
self.resize(ssz[0], ssz[1])
#
# world initialization
self.world = XNovaWorld_instance()
self.world_timer = QTimer(self)
self.world_timer.timeout.connect(self.on_world_timer)
# overrides QWidget.closeEvent
# cleanup just before the window close
def closeEvent(self, close_event: QCloseEvent):
logger.debug('closing')
if self.tray_icon is not None:
#.........这里部分代码省略.........