我是新来的PyQt,我要设计一个UI,主要问题是当我运行.py文件,在Qt Designer中缺省主题系统主题在两个窗口10和Debian 8,但在Linux丑陋运行后的.py将显示主题,我想在编译python后拥有当前的系统主题样式.
PyQt4.11.1,Qt Designer 5.3,Debian 8.
当前的系统主题

PyQt4经典主题

如何在此代码中使用while循环每2秒读取一次串行并在Label中显示?这个应用程序将在运行中挂起,我是python的新手来解决这个问题.
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from time import sleep
import serial
class LoginScreen(GridLayout):
def __init__(self, **kwargs):
super(LoginScreen, self).__init__(**kwargs)
self.cols = 2
self.rows = 2
ser = serial.Serial('COM3', 9600, timeout=0)
while 1:
sleep(2)
ser.read()
data = ser.read()
self.add_widget(Label(text=str(data)))
class MyApp(App):
def build(self):
return LoginScreen()
if __name__ == '__main__':
MyApp().run()
Run Code Online (Sandbox Code Playgroud) 我要Kivy为我的机器人项目创建一个UI,我唯一的问题是使用布局,我很困惑.
我将附加我要为其创建布局的GUI图像,Kivy请指导什么是最佳选择(BOX,Grid,Relative,..)我知道我必须将它们混合使用2个或更多布局但我无法选择正确的,我阅读Kivy文档,我试图使用KivyDesigner,但我仍然无法选择最佳的布局.最大窗口大小为800x600.