class_docstr: QSpectrumAnalyzer main window
class_docstr_tok: ["QSpectrumAnalyzer","main","window"]
code: def __init__(self, parent=None):
      # Initialize UI
      super().__init__(parent)
      self.setupUi(self)
  
      # Set window icon
      icon_path = os.path.join(
          os.path.dirname(os.path.realpath(__file__)),
          "qspectrumanalyzer.svg",
      )
      self.setWindowIcon(QtGui.QIcon(icon_path))
  
      # Create progress bar
      self.progressbar = QtWidgets.QProgressBar()
      self.progressbar.setMaximumWidth(250)
      self.progressbar.setVisible(False)
      self.statusbar.addPermanentWidget(self.progressbar)
  
      # Create plot widgets and update UI
      self.spectrumPlotWidget = SpectrumPlotWidget(self.mainPlotLayout)
      self.waterfallPlotWidget = WaterfallPlotWidget(
          self.waterfallPlotLayout, self.histogramPlotLayout
      )
  
      # Link main spectrum plot to waterfall plot
      self.spectrumPlotWidget.plot.setXLink(
          self.waterfallPlotWidget.plot
      )
  
      # Setup power thread and connect signals
      self.update_status_timer = QtCore.QTimer()
      self.update_status_timer.timeout.connect(self.update_status)
      self.prev_sweep_time = None
      self.prev_data_timestamp = None
      self.start_timestamp = None
      self.data_storage = None
      self.power_thread = None
      self.backend = None
      self.setup_power_thread()
  
      self.update_buttons()
      self.load_settings()
  
imports: import sys, os, signal, time, argparse
  from Qt import QtCore, QtGui, QtWidgets
  from qspectrumanalyzer import backends
  from qspectrumanalyzer.version import __version__
  from qspectrumanalyzer.data import DataStorage
  from qspectrumanalyzer.plot import SpectrumPlotWidget, WaterfallPlotWidget
  from qspectrumanalyzer.utils import str_to_color, human_time
  from qspectrumanalyzer.settings import QSpectrumAnalyzerSettings
  from qspectrumanalyzer.smoothing import QSpectrumAnalyzerSmoothing
  from qspectrumanalyzer.persistence import QSpectrumAnalyzerPersistence
  from qspectrumanalyzer.colors import QSpectrumAnalyzerColors
  from qspectrumanalyzer.baseline import QSpectrumAnalyzerBaseline
  from qspectrumanalyzer.ui_qspectrumanalyzer import Ui_QSpectrumAnalyzerMainWindow
label_desc: Use image node_id 1 to create a new QSpectrumAnalyzerMainWindow object from inherited base classes: QtWidgets, Ui_QSpectrumAnalyzerMainWindow with example: obj = QSpectrumAnalyzerMainWindow(parent)