from PyQt5 import QtWidgets, uic
from pyqtgraph import PlotWidget
import pyqtgraph as pg
import sys
import os
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
# Load the UI Page
self.ui = uic.loadUi("mainwindow.ui", self)
"""
ui->UtilityTabs_tabWidget->setStyleSheet("QTabWidget::pane {" "border: 1px solid lightgray;"
"background-color: rgb(245, 245, 245); }"
"color: lightgray;"
"background-color: #654321;"
"border: 1px solid red;}"
"QTabBar::tab:selected {"
"color: black;"
"background-color: #EEEE9B;"
"margin-bottom: -1px; }");
"""
self.ui.tabWidget.setTabText(self.ui.tabWidget.indexOf(self.ui.tab), " PGN ")
self.ui.tabWidget.setTabText(
self.ui.tabWidget.indexOf(self.ui.tab_2), " tab 2 "
)
self.ui.tabWidget.setStyleSheet(
"border: 1px solid lightgray;}"
"color: lightgray;"
"background-color: #654321;"
"border: 1px solid red;}"
"QTabBar::tab:selected {"
"color: black;"
"background-color: #EEEE9B;"
"padding-left: 4px;"
"padding-right: 4px;"
"margin-bottom: -1px; }"
) # "width: 52px;" "background-color: rgb(245, 245, 245); }" "background-color: #654321; }"
# background-color: rgb(101, 67, 33); # brown
# self.graphicsProxyWidget().resizeEvent()
# self.ui.graphWidget.
self.plot(
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [30, 32, 34, 32, 33, 31, 29, 32, 35, 45]
)
def plot(self, hour, temperature):
self.graphWidget.plot(hour, temperature)
def main():
main = MainWindow()
main.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()
from PyQt5 import QtWidgets, uic
from PyQt5.QtWidgets import QTabWidget, QTabBar
from pyqtgraph import PlotWidget
import pyqtgraph as pg
import sys
import os
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
# Load the UI Page
self.ui = uic.loadUi("mainwindow.ui", self)
"""
ui->UtilityTabs_tabWidget->setStyleSheet("QTabWidget::pane {"
"border: 1px solid lightgray;"
"background-color: rgb(245, 245, 245); }"
"QTabBar::tab {"
"color: lightgray;"
"background-color: #654321;"
"border: 1px solid red;}"
"QTabBar::tab:selected {"
"color: black;"
"background-color: #EEEE9B;"
"margin-bottom: -1px; }");
"""
self.ui.tabWidget.setTabText(self.ui.tabWidget.indexOf(self.ui.tab), " PGN ")
self.ui.tabWidget.setTabText(
self.ui.tabWidget.indexOf(self.ui.tab_2), " tab 2 "
)
self.ui.tabWidget.setStyleSheet(
"QTabWidget::pane {"
"border: 1px solid lightgray;}"
"QTabBar::tab {"
"color: lightgray;"
"background-color: #654321;"
"border: 1px solid red;}"
"QTabBar::tab:selected {"
"color: black;"
"background-color: #EEEE9B;"
"padding-left: 4px;"
"padding-right: 4px;"
"margin-bottom: -1px; }"
) # "width: 52px;" "background-color: rgb(245, 245, 245); }" "background-color: #654321; }"
# background-color: rgb(101, 67, 33); # brown
# self.graphicsProxyWidget().resizeEvent()
# self.ui.graphWidget.
self.plot(
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [30, 32, 34, 32, 33, 31, 29, 32, 35, 45]
)
def plot(self, hour, temperature):
self.graphWidget.plot(hour, temperature)
def main():
app = QtWidgets.QApplication(sys.argv)
main = MainWindow()
main.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()
To copy to clipboard, switch view to plain text mode
Bookmarks