{"id":13595862,"url":"https://github.com/EricThomson/PySideSummer","last_synced_at":"2025-04-09T13:33:44.827Z","repository":{"id":19220527,"uuid":"22454737","full_name":"EricThomson/PySideSummer","owner":"EricThomson","description":"PySide port of Summerfield's book 'Rapid GUI Programming with Python and Qt.'","archived":false,"fork":false,"pushed_at":"2020-03-17T14:27:42.000Z","size":1022,"stargazers_count":50,"open_issues_count":1,"forks_count":26,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T05:12:22.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EricThomson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-31T03:24:54.000Z","updated_at":"2025-02-21T03:29:39.000Z","dependencies_parsed_at":"2022-09-22T21:40:47.324Z","dependency_job_id":null,"html_url":"https://github.com/EricThomson/PySideSummer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricThomson%2FPySideSummer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricThomson%2FPySideSummer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricThomson%2FPySideSummer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricThomson%2FPySideSummer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EricThomson","download_url":"https://codeload.github.com/EricThomson/PySideSummer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248049731,"owners_count":21039267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T16:01:59.549Z","updated_at":"2025-04-09T13:33:42.428Z","avatar_url":"https://github.com/EricThomson.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"﻿# PySideSummer\nAnnotated PySide port of code from Mark Summerfield's 'Rapid GUI Programming with Python and Qt' (2008). The book's web site is at:\n http://www.qtrac.eu/pyqtbook.html. \n\nThe programs should run without mishap in your favorite Python environment, as long as you have PySide installed. It has thus far been tested on Python 2.7 in Windows 7. Unless otherwise noted, if the original name of Summerfield's script was _name.pyw_, the name of the adapted PySide script is _namePyside.py_.  \n\nAnnotations include comments in code, but each chapter also contains _README.md_ and _usefulStuff.md_ files (the latter contains curated excerpts from PySide documentation and links from other relevant resources). When possible, we link to PySide documentation, but sometimes we have to go with Qt or PyQt when it is better.\n\nThanks to Mark Summerfield for encouragement, suggestions for improvement in innumerable places.\n  \n\n## Table of contents\n**Chapter 4**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter4\"\u003eIntroduction to GUI Programming\u003c/a\u003e\n\n**Chapter 5**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter5\"\u003eDialogs\u003c/a\u003e\n\n**Chapter 6**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter6\"\u003eMain Windows\u003c/a\u003e\n\n**Chapter 7**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter7\"\u003eUsing Qt Designer\u003c/a\u003e\n\n**Chapter 8**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter8\"\u003eData Handling and Custom File Formats\u003c/a\u003e\n\n**Chapter 9**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter9\"\u003eLayouts and Multiple Documents\u003c/a\u003e\n\n**Chapter 10**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter10\"\u003eEvents, the Clipboard, and Drag and Drop\u003c/a\u003e\n\n**Chapter 11**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter11\"\u003eCustom Widgets\u003c/a\u003e\n\n**Chapter 12**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter12\"\u003eItem-Based Graphics\u003c/a\u003e\n\n**Chapter 13**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter13\"\u003eRich Text and Printing\u003c/a\u003e\n\n**Chapter 14**: \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter14\"\u003eModel/View Programming\u003c/a\u003e\n\n**Chapter 15**:  \u003ca href=\"https://github.com/EricThomson/PySideSummer/tree/master/Chapter15\"\u003eDatabases\u003c/a\u003e\n\n**Chapter 16**: \u003ca href = \"https://github.com/EricThomson/PySideSummer/tree/master/Chapter16\"\u003eAdvanced Model/View Programming\u003c/a\u003e\n\n**Chapter 17**: \u003ca href = \"https://github.com/EricThomson/PySideSummer/tree/master/Chapter17\"\u003eOnline Help and Internationalization\u003c/a\u003e\n\n**Chapter 18**: \u003ca href = \"https://github.com/EricThomson/PySideSummer/tree/master/Chapter18\"\u003eNetworking\u003c/a\u003e\n\n**Chapter 19**: \u003ca href = \"https://github.com/EricThomson/PySideSummer/tree/master/Chapter19\"\u003eMultithreading\u003c/a\u003e\n\n### Some of the guidelines followed\n1. Follow \u003ca href=\"http://www.qtrac.eu/pyqtbook.html#pyside\"\u003eSummerfield's recommendations\u003c/a\u003e for converting to Pyside, unless that would conflict with the remaining guidelines.\n\n2. Change old-style to new-style signals and slots.\n\n3. Replace `from PyQt4.QtCore import *`-type imports with `from PySide import QtGui`-type imports.\n\n4. Replace `Qt.escape()`, which is not used in PySide, with `xml.sax.saxutils.escape()` (see \u003ca href=\"http://srinikom.github.io/pyside-bz-archive/229.html\"\u003ehttp://srinikom.github.io/pyside-bz-archive/229.html\u003c/a\u003e ).\n\n5. When opening files with `codecs` module, change the mode from \"wt\" to \"w\". \n\n6. Replace `QtGui.QWorkspace` (deprecated) with `QtGui.QMdiArea.` This entails a great deal of other relatively minor changes (see Chapter 9 texteditor code).\n\n7. For drawpolygon to work (Chapter 11) change list of numbers to list of QPoints. \nFor instance, change:\n\tdrawPolygon(QtGui.QPolygon([x1, y1, x2, y2]))\nto:\n    drawPolygon(QtGui.QPolygon([QtCore.QPoint(x1, y1), QtCore.QPoint(x2,y2)]))\n\t\n8. Replace deprecated `QMatrix` and `.matrix()` with 'QTransform' and '.transform()` (Chapter 12).\n\n9. Replace the single line:\n\n          self.assetView.selectionModel().currentRowChanged.connect(self.assetChanged)\n        \n With the two lines:\n\n        selectionModel = self.assetView.selectionModel()\n        selectionModel.currentRowChanged.connect(self.assetChanged)\n        \n This seems to be due to a bug in PySide (Chapter 15).\n\n10. Get sqlite to work by adding:\n\n        site_pack_path = site.getsitepackages()[1] \n        QtGui.QApplication.addLibraryPath('{0}\\\\PySide\\\\plugins'.format(site_pack_path))\n\n Before `QtSql.QSqlDatabase.adDatabase(\"QSQLITE\")`.  Be sure to `import site`. Not sure how platform-dependent this problem  is. (Chapter 15)\n\n11. Replace obsolete `Qt.TextColorRole` with `Qt.ForegroundRole`.\n\n12. Replace `.toPyDateTime()` with `.toPython()` \n\n13. For Chapter 17, to get the *_fr.html pages to show up in the help pages, add:\n\n        QtCore.QLocale.setDefault(QtCore.QLocale(locale)) \n\n Where 'locale' is the value entered by the user at the command line. Note this may not be required on all systems. I needed it in Python 2.7.6, Qt 4.8.4, PySide 1.2.1 on Windows 7.\n\n14. Replace `isAlive(qObj)` function, which uses sip, with:\n\n        from Shiboken import shiboken\n        def isAlive(qObj):\n            return shiboken.isValid(qObj)\n\n If you get the error that shiboken is not installed, in Windows command line:\n\n\tpip install --use-wheel -U shiboken\n\n Not sure what to do in Linux/Mac.\n\n\n15. At least in the first few chapters, we replace 'super' with explicit base class initialization, just to try it both ways (see \u003ca href=\"http://stackoverflow.com/questions/23981625/why-is-super-used-so-much-in-pyside-pyqt\"\u003ehttp://stackoverflow.com/questions/23981625/why-is-super-used-so-much-in-pyside-pyqt\u003c/a\u003e).\n    \n### LICENSE\nPySideSummer is under the GPL license (\u003ca href=\"http://www.gnu.org/copyleft/gpl.html\"\u003ehttp://www.gnu.org/copyleft/gpl.html\u003c/a\u003e)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEricThomson%2FPySideSummer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEricThomson%2FPySideSummer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEricThomson%2FPySideSummer/lists"}