Pyqt button call example

Source: Internet
Author: User

Ui files and code files: http://yunpan.cn/QCktWsjsgRakf (extract code: d330)

For example:

The. py file code is as follows:

From a import ui_form

From B Import ui_form1

Import sys

From pyqt4.qtgui import *

From pyqt4.qtcore import *

From pyqt4.qt import *

Class exr02 (qdialog, ui_form ):

Def _ init _ (self, parent = none ):

Super (exr02, self). _ init _ (parent)

Self. setupui (Self)

Self. textnr ()

Self. Pushbutton. clicked. Connect (self. dianyong)

Def dianyong (Self ):

Self. YN = yn ()

Self. YN. Show ()

Def textnr (Self ):

Self. addlabel. settext ('Hello Python \ N'

'Hello QT \ N'

'Win7 64bit \ N'

'Python2. 7.8 \ N'

'Zh ')

Class yn (qdialog, ui_form1 ):

Def _ init _ (self, parnet = none ):

Super (YN, self). _ init _ (parnet)

Self. setupui (Self)

Self. Pushbutton. clicked. Connect (self. yesclose)

Self. pushbutton_2.clicked.connect (self. noclose)

Def yesclose (Self ):

Self. Close ()

Def noclose (Self ):

Pass

APP = qapplication ([])

E = exr02 ()

E. Show ()

Sys.exit(app.exe C _())

Pyqt button call example

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.