PyQt4-Examples

所属分类:Python编程
开发工具:Python
文件大小:963KB
下载次数:0
上传日期:2015-03-09 17:31:09
上 传 者sh-1993
说明:  使用Python和Qt的快速GUI编程
(Rapid GUI Programming with Python and Qt)

文件列表:
.idea (0, 2015-03-10)
.idea\.name (12, 2015-03-10)
.idea\PyQT-Exaples.iml (284, 2015-03-10)
.idea\encodings.xml (164, 2015-03-10)
.idea\misc.xml (1130, 2015-03-10)
.idea\modules.xml (276, 2015-03-10)
.idea\scopes (0, 2015-03-10)
.idea\scopes\scope_settings.xml (139, 2015-03-10)
.idea\vcs.xml (180, 2015-03-10)
chap01 (0, 2015-03-10)
chap01\answers.txt (988, 2015-03-10)
chap01\hello.py (83, 2015-03-10)
chap02 (0, 2015-03-10)
chap02\answers.py (4912, 2015-03-10)
chap02\frange.py (2661, 2015-03-10)
chap02\simplified.py (2640, 2015-03-10)
chap03 (0, 2015-03-10)
chap03\SortedDict.py (13306, 2015-03-10)
chap03\__init__.py (0, 2015-03-10)
chap03\balloon.py (1224, 2015-03-10)
chap03\dimension.py (3067, 2015-03-10)
chap03\item.py (3812, 2015-03-10)
chap03\length.py (9407, 2015-03-10)
chap03\ordereddict.py (13570, 2015-03-10)
chap03\rectangle.py (3220, 2015-03-10)
chap03\stack.py (3077, 2015-03-10)
chap03\tribool.py (4468, 2015-03-10)
chap04 (0, 2015-03-10)
chap04\alert.pyw (1592, 2015-03-10)
chap04\alert_extra.pyw (2062, 2015-03-10)
chap04\calculate.pyw (1944, 2015-03-10)
chap04\connections.pyw (2575, 2015-03-10)
chap04\currency.pyw (3682, 2015-03-10)
chap04\currency2.pyw (3496, 2015-03-10)
chap04\interest.pyw (3193, 2015-03-10)
chap04\signals.pyw (4372, 2015-03-10)
chap05 (0, 2015-03-10)
chap05\numberformatdlg1.py (5156, 2015-03-10)
... ...

Rapid GUI Programming with Python and Qt: The Definitive Guide to PyQt Programming by Mark Summerfield ISBN: 0132354187 IMPORTANT NOTE The examples included in this archive are _not_ the ones shown in the book. The book's examples use Python 2.5/PyQt 4.3 and are available separately from the same web page, www.qtrac.eu/pyqtbook.html. The examples in this archive use Python 2.7/PyQt ‰4.5 and make use of the Python 3.0 features that are available in Python 2.7. Also, some of the examples include small improvements and most of them import the PyQt libraries using the form "from PyQt4.QtCore import (QWidget, QCombobox)" etc.---i.e., importing each item by name---rather than the "from PyQt4.QtCore import *" form used in the book's examples. One key difference with these examples is that they use PyQt 4.5's nicer more pythonic style of connecting signal and slots and emitting signals. All the example programs and modules are copyright (c) Qtrac Ltd. 2008-14. They are free software: you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or version 3 of the License, or (at your option) any later version. They are provided for educational purposes and are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licenses (in files gpl-2.0.txt and gpl-3.0.txt) for more details. Two helper programs are provided: mkpyqt.py (a console application), and makepyqt.pyw (a GUI application). These programs both do the same thing: They run pyuic4, pyrcc4, pylupdate4, and lrelease with the correct command line arguments. In some cases you may need to set the path to pyuic4 (pyuic4.bat on Windows), and possibly to the other programs as well. For mkpyqt.py this means editing the file itself (the paths are in variables near the top); for makepyqt.pyw, click "More->Options" and set the paths there. The use of these programs is described in Chapter 7. All the book's examples are designed to be educational, and many are also designed to be useful. I hope that you find them helpful, and are perhaps able to use some of them as starting points for your own projects. Qt is available with multiple licenses including the GPL and LGPL so in many cases a commercial license is not necessary. To download Qt and for the license terms visit http://www.qtsoftware.com. PyQt is dual licensed, GPL and commercial. To download PyQt and for the license terms visit http://www.riverbankcomputing.co.uk. Python itself can be obtained from http://www.python.org and can be used for both commercial and non-commercial purposes free of charge. See Appendix A for information on obtaining and installing the necessary software. Most of the icons are from KDE (The `K' Desktop Environment), and come under KDE's LGPL license. (Visit http:///www.kde.org for more information.) STOP PRESS Chapter 3 describes an "OrderedDict". Unfortunately this name is incorrect, it should have been called "SortedDict". (In Python mapping terminology "ordered" means "order of insertion" and "sorted" means "order of key"---I had used the C++ terminology.) I have kept the wrongly named ordereddict.py module in the archive---after all, it works fine---but also provided a correctly named SortedDict.py module that has the same behavior, and that ought to be used instead. I have put a more versatile (but theoretically slower) sorteddict module, with a different API, on PyPI: http://pypi.python.org/pypi/sorteddict (but this is no longer supported -- there are many better alternatives available). Chapter 4. I've now added a new example, currency2.pyw that has one extra line (to include Canadian dollars) and one line different (to sort currency names case-insensitively) compared to currency.pyw. I've also done a small theoretical improvement to the code. Chapter 9 shows an SDI text editor (sditexteditor.pyw) that has a Window menu in every main window with the list of all the application's windows. This application's Window menu works on the basis of window titles. But window titles may not be unique. For this reason I have now added a new version (sditexteditor2.pyw) that has more sophisticated updateWindowMenu() and raiseWindow() methods that use each window's unique id() rather than their possibly non-unique window title. Chapter 12. The exercise solution pagedesigner_ans.pyw has an improved setAlignment() implementation thanks to John Posner. Chapter 13 shows a PythonHighlighter (color syntax highlighting) class in the pythoneditor.pyw and pythoneditor_ans.pyw applications. I have fixed bugs in the syntax highlighter used in both of these and now added pythoneditor2.pyw which is a copy of pythoneditor_ans.pyw but with the PythonHighlighter replaced with one that uses improved highlighting logic since this works better in more corner cases (but is slower). I've also added printing2.pyw which has a bugfix and some tiny improvements for both HTML and QPainter printing.

近期下载者

相关文件


收藏者