Python PyQt5.QtGui.QTabWidget() Examples
The following are 6 code examples for showing how to use PyQt5.QtGui.QTabWidget(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
You may check out the related API usage on the sidebar.
You may also want to check out all available functions/classes of the module
PyQt5.QtGui
, or try the search function
.
Example 1
Project: Quantdom Author: constverum File: ui.py License: Apache License 2.0 | 6 votes |
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()
Example 2
Project: evo Author: MichaelGrupp File: plot.py License: GNU General Public License v3.0 | 6 votes |
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_()
Example 3
Project: evo Author: MichaelGrupp File: plot.py License: GNU General Public License v3.0 | 6 votes |
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_()
Example 4
Project: evo_slam Author: lyy-ai File: plot.py License: GNU General Public License v3.0 | 6 votes |
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_()
Example 5
Project: evo_slam Author: lyy-ai File: plot.py License: GNU General Public License v3.0 | 6 votes |
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_()
Example 6
Project: grap Author: AirbusCyber File: QtShim.py License: MIT License | 5 votes |
def get_QTabWidget(): """QTabWidget getter.""" try: import PySide.QtGui as QtGui return QtGui.QTabWidget except ImportError: import PyQt5.QtWidgets as QtWidgets return QtWidgets.QTabWidget