本文整理汇总了Python中PyQt5.QtGui.QTabWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QTabWidget方法的具体用法?Python QtGui.QTabWidget怎么用?Python QtGui.QTabWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui
的用法示例。
在下文中一共展示了QtGui.QTabWidget方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QTabWidget [as 别名]
def __init__(self, parent=None):
super().__init__(parent)
self.select_source = QtGui.QTabWidget(self)
self.select_source.setGeometry(210, 50, 340, 200)
self.init_shares_tab_ui()
self.init_external_tab_ui()
self.symbols_loader = SymbolsLoaderThread()
self.symbols_loader.started.connect(self.on_symbols_loading)
self.symbols_loader.symbols_loaded.connect(
self.on_symbols_loaded, QtCore.Qt.QueuedConnection
)
self.symbols_loader.start()
self.date_from = self.shares_date_from.date().toPyDate()
self.date_to = self.shares_date_to.date().toPyDate()
示例2: tabbed_qt4_window
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QTabWidget [as 别名]
def tabbed_qt4_window(self):
from PyQt4 import QtGui
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg, NavigationToolbar2QT
# mpl backend can already create instance
# https://stackoverflow.com/a/40031190
app = QtGui.QApplication.instance()
if app is None:
app = QtGui.QApplication([self.title])
self.root_window = QtGui.QTabWidget()
self.root_window.setWindowTitle(self.title)
for name, fig in self.figures.items():
tab = QtGui.QWidget(self.root_window)
tab.canvas = FigureCanvasQTAgg(fig)
vbox = QtGui.QVBoxLayout(tab)
vbox.addWidget(tab.canvas)
toolbar = NavigationToolbar2QT(tab.canvas, tab)
vbox.addWidget(toolbar)
tab.setLayout(vbox)
for axes in fig.get_axes():
if isinstance(axes, Axes3D):
# must explicitly allow mouse dragging for 3D plots
axes.mouse_init()
self.root_window.addTab(tab, name)
self.root_window.show()
app.exec_()
示例3: tabbed_qt5_window
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QTabWidget [as 别名]
def tabbed_qt5_window(self):
from PyQt5 import QtGui, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT
# mpl backend can already create instance
# https://stackoverflow.com/a/40031190
app = QtGui.QGuiApplication.instance()
if app is None:
app = QtWidgets.QApplication([self.title])
self.root_window = QtWidgets.QTabWidget()
self.root_window.setWindowTitle(self.title)
for name, fig in self.figures.items():
tab = QtWidgets.QWidget(self.root_window)
tab.canvas = FigureCanvasQTAgg(fig)
vbox = QtWidgets.QVBoxLayout(tab)
vbox.addWidget(tab.canvas)
toolbar = NavigationToolbar2QT(tab.canvas, tab)
vbox.addWidget(toolbar)
tab.setLayout(vbox)
for axes in fig.get_axes():
if isinstance(axes, Axes3D):
# must explicitly allow mouse dragging for 3D plots
axes.mouse_init()
self.root_window.addTab(tab, name)
self.root_window.show()
app.exec_()
示例4: get_QTabWidget
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QTabWidget [as 别名]
def get_QTabWidget():
"""QTabWidget getter."""
try:
import PySide.QtGui as QtGui
return QtGui.QTabWidget
except ImportError:
import PyQt5.QtWidgets as QtWidgets
return QtWidgets.QTabWidget