本文整理汇总了Python中PyQt5.QtWidgets.QScrollArea.setFixedSize方法的典型用法代码示例。如果您正苦于以下问题:Python QScrollArea.setFixedSize方法的具体用法?Python QScrollArea.setFixedSize怎么用?Python QScrollArea.setFixedSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QScrollArea
的用法示例。
在下文中一共展示了QScrollArea.setFixedSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QScrollArea [as 别名]
# 或者: from PyQt5.QtWidgets.QScrollArea import setFixedSize [as 别名]
class MainWindow(QMainWindow):
def __init__(self, autoTradingSystem):
super(MainWindow, self).__init__()
self.ATM = autoTradingSystem
self.initUI()
def initUI(self):
self.setStyle()
self.setWindowTitle('Auto Trading System')
self.initToolBar()
self.initMenuBar()
self.initMainBoard()
self.techAnPage()
#self.pairTrPage()
# make window in center point
self.setFixedSize(1000, 700)
qr = self.frameGeometry()
qr.moveCenter(QDesktopWidget().availableGeometry().center())
self.move(qr.topLeft())
self.show()
def initMainBoard(self):
self.mainBoard = QWidget()
self.setCentralWidget(self.mainBoard)
self.pagesStatus = [0]*5
self.pages = [QWidget(self.mainBoard) for i in self.pagesStatus]
self.toolButtons
self.mainBoard.setStyleSheet(self.mainBoardQSS)
for page in self.pages: page.setStyleSheet(self.pagesQSS)
def initToolBar(self):
self.toolBar = QToolBar("Tools")
self.toolBar.setMovable(False)
self.addToolBar(Qt.LeftToolBarArea, self.toolBar)
self.toolBar.setIconSize(QSize(20, 20))
self.techAnButton = QToolButton()
self.techAnButton.setText("Technical analysis")
self.techAnButton.setFixedSize(130, 25)
self.pairTrButton = QToolButton()
self.pairTrButton.setText("Pair Trading")
self.pairTrButton.setFixedSize(130, 25)
self.atoTrdButton = QToolButton()
self.atoTrdButton.setText("Monitor")
self.atoTrdButton.setFixedSize(130, 25)
self.trdPnlButton = QToolButton()
self.trdPnlButton.setText("PnL Report")
self.trdPnlButton.setFixedSize(130, 25)
self.trdHisButton = QToolButton()
self.trdHisButton.setText("Trade History")
self.trdHisButton.setFixedSize(130, 25)
self.techAnButton.clicked.connect(self.techAnPage)
self.pairTrButton.clicked.connect(self.pairTrPage)
self.atoTrdButton.clicked.connect(self.atoTrdPage)
self.trdPnlButton.clicked.connect(self.trdPnlPage)
self.trdHisButton.clicked.connect(self.trdHisPage)
self.toolBar.addWidget(self.techAnButton)
self.toolBar.addWidget(self.pairTrButton)
self.toolBar.addWidget(self.atoTrdButton)
self.toolBar.addWidget(self.trdPnlButton)
self.toolBar.addWidget(self.trdHisButton)
self.toolButtons = [self.techAnButton, self.pairTrButton, self.atoTrdButton, self.trdPnlButton, self.trdHisButton]
def initMenuBar(self):
exitAction = QAction('&Exit', self)
exitAction.setShortcut('Ctrl+Q')
exitAction.triggered.connect(qApp.quit)
techAnAction = QAction('&Technical Analysis', self)
techAnAction.setShortcut('Ctrl+T')
techAnAction.triggered.connect(self.techAnPage)
pairTrAction = QAction('&Pair Trading', self)
pairTrAction.setShortcut('Ctrl+P')
pairTrAction.triggered.connect(self.pairTrPage)
atoTrdAction = QAction('&Monitor', self)
atoTrdAction.setShortcut('Ctrl+M')
atoTrdAction.triggered.connect(self.atoTrdPage)
trdPnlAction = QAction('&Profit And Loss Report', self)
trdPnlAction.setShortcut('Ctrl+R')
trdPnlAction.triggered.connect(self.trdPnlPage)
trdHisAction = QAction('&Trade History', self)
trdHisAction.setShortcut('Ctrl+H')
trdHisAction.triggered.connect(self.trdHisPage)
menubar = self.menuBar()
menubar.setNativeMenuBar(False)
fannsMenu = menubar.addMenu('&App')
fannsMenu.addAction(exitAction)
naviMenu = menubar.addMenu('&Navigate')
#.........这里部分代码省略.........