Skip to content

Commit

Permalink
QtGui has no attribute QApplication
Browse files Browse the repository at this point in the history
Fixes error markjay4k#19
  • Loading branch information
keventhen4 authored Jul 14, 2024
1 parent 3ce5afd commit ee786d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions terrain_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import numpy as np
from opensimplex import OpenSimplex
import pyqtgraph.opengl as gl
from pyqtgraph.Qt import QtCore, QtGui
from pyqtgraph.Qt import QtCore#, QtGui
from PyQt5 import QtWidgets #Fixes issue with QtGui has no attribute QApplication
import struct
import pyaudio
import sys
Expand All @@ -25,7 +26,7 @@ def __init__(self):
"""

# setup the view window
self.app = QtGui.QApplication(sys.argv)
self.app = QtWidgets.QApplication(sys.argv)
self.window = gl.GLViewWidget()
self.window.setWindowTitle('Terrain')
self.window.setGeometry(0, 110, 1920, 1080)
Expand Down Expand Up @@ -129,7 +130,7 @@ def start(self):
get the graphics window open and setup
"""
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
QtWidgets.QApplication.instance().exec_()

def animation(self, frametime=10):
"""
Expand Down

0 comments on commit ee786d8

Please sign in to comment.