所以我一直在努力为Qt设计器设置背景。
我发现了如何设置背景图像,并遇到另一个问题,似乎我拥有的每个小部件都是透明的,您看不到任何小部件,通常它们是白色的,并且idk如何设置
我的.ui代码:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="styleSheet">
<string notr="true">background-image: url(:/img/Programming/Eclipse/Encrypter and Decrypter/Images/matrix.png);</string>
</property>
<widget class="QPushButton" name="pushbutton">
<property name="geometry">
<rect>
<x>140</x>
<y>310</y>
<width>75</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Encrypt</string>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>280</x>
<y>310</y>
<width>75</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Decrypt</string>
</property>
</widget>
<widget class="QTextEdit" name="textEdit">
<property name="geometry">
<rect>
<x>30</x>
<y>80</y>
<width>201</width>
<height>201</height>
</rect>
</property>
<property name="toolTip">
<string><html><head/><body><p>Input your text here</p></body></html></string>
</property>
</widget>
<zorder>pushButton</zorder>
<zorder>pushbutton</zorder>
<zorder>textEdit</zorder>
</widget>
<resources>
<include location="resource.qrc"/>
</resources>
<connections/>
</ui>