Pyqt-oriented process

Source: Internet
Author: User

My environment is Python 2.6 + pyqt v4.1

The introduction of pyqt will not be mentioned. This procedural code can give you a good understanding of how pyqt is going, so it is unrealistic to write programs, we still need to implement it in an object-oriented way.

My code comments are in Chinese and may not be supported by most python. If you want to run the comments, delete them and run them in idle. This will cause problems, after Python and pyqt are installed, run them in command line mode.

:

After exiting, the printf function will be called to display a line in the command line:

Import sysfrom pyqt4 import qtgui, qtcoreapp = qtgui. qapplication (sys. argv) def printf (): Print 'window has finished ') # The default path is in the same directory of the Code # You can write it as window. setmediawicon (qtgui. qicon ('e: \ Python code \ 1.jpg ') # sets the floating window. settooltip ('this is a window') # Set the floating font style and size qtgui. qtooltip. setfont (qtgui. qfont ('oldenglish ', 10) # display window. show () # create a button q = qtgui. qpushbutton ("quit", window) Q. setgeometry (500,300,) Q. settooltip ('close the same C _())

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.