habe leider ein kleines Problem mit dem QT-Designer.
Ich habe ein UI über den Designer erstellt (mit resourcefile), wenn ich das UI dann in meiner Applikation lade, wird alles außer das background-image vom QWidget angezeigt.
Ich verstehe nicht was ich falsch mache.
Python code:
Code: Alles auswählen
import sys
from PyQt5 import uic
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
uifile_1 = 'login.ui'
base_1, form_1 = uic.loadUiType(uifile_1)
class LoginPage(base_1, form_1):
def __init__(self):
super().__init__()
self.setupUi(self)
if __name__ == '__main__':
app = QApplication(sys.argv)
l = LoginPage()
l.show()
sys.exit(app.exec_())
Code: Alles auswählen
*{
font-family:century-gothic;
font-size:24px;
}
QWidget{
background-image: url(:/images/cyber.jpg);
}
QFrame
{
background:#333;
border-radius:15px;
}
QPushButton
{
color:white;
background:rgb(0,79,159);
border-radius:15px;
}
QPushButton:hover
{
color:rgb(0,79,159);
background:white;
}
QToolButton
{
background:white;
border-radius:60px;
}
QLabel
{
color:white;
background:transparent;
}
QLineEdit
{
background:transparent;
border:none;
color:#717072;
border-bottom:1px solid #717072;
}
Code: Alles auswählen
<RCC>
<qresource prefix="images">
<file>cyber.jpg</file>
<file>icon.png</file>
</qresource>
</RCC>
Grüße,
Sev