Python Forum
Cannot Import stylesheet BG?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot Import stylesheet BG?
#1
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
Reply
#2
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] QTreeView, StyleSheet resizes last column malonn 2 861 Sep-15-2023, 03:50 PM
Last Post: malonn
  [PyQt] QTableWidget stylesheet error mart79 3 6,326 Feb-26-2020, 04:54 PM
Last Post: Denni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020