In PyCharm I have a python environment setup with a Bat file so that I can use QGIS and OSGeo python environment in my scripts. I started looking into ui's and using this code
from PyQt5 import QtWidgets, uic
import sys
class Ui(QtWidgets.QMainWindow):
def __init__(self):
super(Ui, self).__init__()
uic.loadUi('basic.ui', self)
self.show()
app = QtWidgets.QApplication(sys.argv)
window = Ui()
app.exec_()
I get a window pop up error
"This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem"
Is there some way to use the QtCreator installed with OSGeo for QGIS by changing my imports or environment settings or do I need to install QtCreator Community to get this to work?
BAT File
@echo off
SET OSGEO4W_ROOT=C:\OSGeo4W64
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass78\etc\env.bat
@echo off
path %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
path %PATH%;%OSGEO4W_ROOT%\apps\grass\grass78\lib
path %PATH%;C:\OSGeo4W64\apps\Qt5\bin
path %PATH%;C:\OSGeo4W64\apps\Python37\Scripts
set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37
set PATH=C:\Program Files\Git\bin;%PATH%
start "PyCharm aware of QGIS" /B "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.1.1\bin\pycharm64.exe"
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins