How to promote the ui file to the QtGraphviews window?
-
I already made a ui file used 2 classess.
Chart.pyimport sys, time, datetime, pyupbit import pandas as pd import finplot as fplt from PyQt5 import QtWidgets, uic from PyQt5.QtWidgets import * from PyQt5.QtCore import * # candle chart setting fplt.display_timezone = datetime.timezone.utc fplt.candle_bull_color = "#FF0000" fplt.candle_bull_body_color = "#FF0000" fplt.candle_bear_color = "#0000FF" chart = uic.loadUiType("chart.ui")[0] class Worker(QThread): timeout = pyqtSignal(pd.DataFrame) def __init__(self): super().__init__() def get_ohlcv(self): self.df = pyupbit.get_ohlcv(ticker="KRW-XRP", interval="minute1") self.df = self.df[['open', 'high', 'low', 'close']] self.df.columns = ['Open', 'High', 'Low', 'Close'] def run(self): self.get_ohlcv() while True: data3 = pyupbit.get_current_price("KRW-XRP", verbose=True) price3 = data3['trade_price'] time_stamp = data3['trade_timestamp'] / 1000 cur_min_time_stamp = time_stamp - time_stamp % (60) cur_min_dt = datetime.datetime.fromtimestamp(cur_min_time_stamp) if cur_min_dt > self.df.index[-1]: self.get_ohlcv() else: self.df.iloc[-1]['Close'] = price3 if price3 > self.df.iloc[-1]['High']: self.df.iloc[-1]['High'] = price3 if price3 < self.df.iloc[-1]['High']: self.df.iloc[-1]['Low'] = price3 CurrentPrice3 = pyupbit.get_current_price("KRW-XRP") print("Current Price of KRW-XRP :", CurrentPrice3) self.timeout.emit(self.df) time.sleep(1) class MyWindow(QWidget, chart): def __init__(self): super().__init__() self.setupUi(self) self.df = None self.plot = None self.w = Worker() self.w.timeout.connect(self.update_data) self.w.start() self.timer = QTimer(self) self.timer.start(1000) self.timer.timeout.connect(self.update) self.ax = fplt.create_plot(init_zoom_periods=100) self.axs = [self.ax] self.gridLayout_2.addWidget(self.ax.vb.win, 0, 0) def update(self): if self.df is not None: if self.plot is None: self.plot = fplt.candlestick_ochl(self.df[['Open', 'Close', 'High', 'Low']]) fplt.show(qt_exec=False) else: self.plot.update_data(self.df[['Open', 'Close', 'High', 'Low']]) @pyqtSlot(pd.DataFrame) def update_data(self, df): self.df = df if __name__ == "__main__": app = QApplication(sys.argv) window = MyWindow() window.show() app.exec_()and chart.ui has 1 gridLayout in 1 graphicsView

then I' want to print out the chart.ui on the QGraphicsview screen in the main.ui.
But I don't know about how to promote QGrphicsview widget and write the Python code.
Could you please tell me what I should do?