From ee786d8d350d3f018dca167d1a6b7b686a0b5038 Mon Sep 17 00:00:00 2001 From: keventhen4 Date: Sun, 14 Jul 2024 14:55:21 -0700 Subject: [PATCH] QtGui has no attribute QApplication Fixes error #19 --- terrain_audio.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/terrain_audio.py b/terrain_audio.py index b81a225..dc238bd 100644 --- a/terrain_audio.py +++ b/terrain_audio.py @@ -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 @@ -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) @@ -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): """