Python uses QT for development (i)

Source: Internet
Author: User

Qt is a cross-platform C + + graphical user Interface application Development framework developed by QT Company in 1991. It can either develop GUI programs or be used to develop non-GUI programs, such as console tools and servers.

Let's start by simply using QT to develop a gadget page

ImportOs,sys,time fromPyQt5ImportQtcore,qtwidgets,qtguiclassTest (qtwidgets.qwidget):defSetui (self):#set the size of the tool windowSelf.setgeometry (400,400,400,200)        #set the title of the tool windowSelf.setwindowtitle ("Test")        #set the icon for the windowSelf.setwindowicon (Qtgui.qicon ('xxx.jpg') ) self.show ()if __name__=='__main__':    #Creating applications and ObjectsApp =Qtwidgets.qapplication (SYS.ARGV) UI=test () Ui.setui () Sys.exit (App.exec_ ())

The display page is as follows

Python uses QT for development (i)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.