From 792257d387e56dbfad9cf7a242957de41ba47950 Mon Sep 17 00:00:00 2001 From: halida Date: Thu, 25 Nov 2010 13:59:59 +0800 Subject: [PATCH] update --- "pyqt\344\273\213\347\273\215.rst" | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git "a/pyqt\344\273\213\347\273\215.rst" "b/pyqt\344\273\213\347\273\215.rst" index afa8c81..b204510 100644 --- "a/pyqt\344\273\213\347\273\215.rst" +++ "b/pyqt\344\273\213\347\273\215.rst" @@ -37,7 +37,9 @@ .. class:: handout - 这个是计算器的代码:: + 这个是计算器的代码: + +.. code-block:: python #!/usr/bin/env python #-*- coding:utf-8 -*- @@ -110,7 +112,9 @@ layout |----- QLineEdit |----- QListWidget -* 代码:: +* 代码: + +.. code-block:: python l = QVBoxLayout(self) for w in self.leInput, self.lwResult: @@ -127,11 +131,15 @@ Signal and Slot in Qt Qt和PyQt 事件机制区别 ============================ -* Qt:: +* Qt: + +.. code-block:: c++ this->connect(leInput, SINGAL(returnPressed()), this, caculate)) -* PyQt:: +* PyQt: + +.. code-block:: python self.leInput.returnPressed.connect(self.caculate) @@ -163,7 +171,8 @@ UI designer UI with Code ============================ -:: + +.. code-block:: python form, base = uic.loadUiType("score.ui") class ScoreDlg(QDialog, form): @@ -177,7 +186,8 @@ UI with Code Event ============================ -:: + +.. code-block:: python def mouseReleaseEvent(self, event): if event.button() == Qt.LeftButton: