Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
halida committed Nov 25, 2010
1 parent db2b53f commit 792257d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions pyqt介绍.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

.. class:: handout

这个是计算器的代码::
这个是计算器的代码:

.. code-block:: python
#!/usr/bin/env python
#-*- coding:utf-8 -*-
Expand Down Expand Up @@ -110,7 +112,9 @@ layout
|----- QLineEdit
|----- QListWidget

* 代码::
* 代码:

.. code-block:: python
l = QVBoxLayout(self)
for w in self.leInput, self.lwResult:
Expand All @@ -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)
Expand Down Expand Up @@ -163,7 +171,8 @@ UI designer

UI with Code
============================
::

.. code-block:: python
form, base = uic.loadUiType("score.ui")
class ScoreDlg(QDialog, form):
Expand All @@ -177,7 +186,8 @@ UI with Code

Event
============================
::

.. code-block:: python
def mouseReleaseEvent(self, event):
if event.button() == Qt.LeftButton:
Expand Down

0 comments on commit 792257d

Please sign in to comment.