qt用户界面扩展
quite的Python项目详细描述
相当:python3的qt ui扩展
功能
- 强大的信号插槽
- 用户友好的小部件类
用户友好的小部件类
常用小部件上的统一包装,包括:
容器小部件:
value小部件:
行为小部件:
容器小部件
示例1:create widget
importquitew=quite.Widget()w.exec()
示例2:nested widget
importquiteclassCustomWidget(quite.Widget):defpaint(self,painter:quite.Painter):painter.setFont(quite.QFont("Courier New",14.0))painter.draw_text_bottom_right(quite.PointF(0,0),"Custom Widget")painter.end()main_window=quite.MainWindow()custom_widget=CustomWidget(parent=main_window)main_window.set_central_widget(custom_widget)main_window.exec()
importosfromquiteimport*classCustomWidget(Widget):defpaint(self,painter:Painter):w,_=self.sizepainter.setFont(QFont("Courier New",14.0))painter.draw_text_bottom_right(PointF(0,0),"So Cool!")painter.draw_text_bottom_left(PointF(w,0),"From Custom Widget")painter.end()main_window=load_ui(filename=os.path.join(os.path.dirname(__file__),'main_window.ui'))main_window.set_central_widget(CustomWidget(parent=main_window))main_window.exec()
使用qtdesigner创建ui文件: