Python Forum

Full Version: Cannot Import stylesheet BG?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I merged my old code with new interface look, it has 4 tabs menu, and the 2nd tab is my old graph sound visualizer (https://python-forum.io/Thread-PyQt-Assi...mber-in-Hz).

so I using stylesheet CSS for the bg image (using qrc) in the Qgraphicsview, I have everything including the .qrc file (named as img.qrc), image file (named as tCbmr4w - Copy.jpg) and the python files itself inside 1 folder... and I run the code, but it said

Error:
Traceback (most recent call last): File "C:\Users\user\Desktop\Python sound recog\qt_audio_recognition_viol\go.py", line 4, in <module> import ui_main File "C:\Users\user\Desktop\Python sound recog\qt_audio_recognition_viol\ui_main.py", line 102, in <module> import img_rc ImportError: No module named img_rc
but if I put off the import img_rc inside the ui_main (this py file only for the design no additional code I add after being converted from .ui to .py) the code running well but no image in it, and the tab goes immediately to the 2nd tab... Where did I do it wrong??? Wall
I found out that everytime I used CSS Stylesheet, I always cannot run the code and the error is the same... it's the import img_rc thing that can't be declared or something

so it doesn't matter what I used; tabs, frame, button, etc
if I still used CSS Stylesheet I can't run the code no matter what

so any IDEA how to put a background on my tabs? I'm using PyQt4