SlideShare a Scribd company logo
How to approach building
GUIs using PyQt
Jerlyn Manohar
Summary:
● Draw your problem
● Know your widgets: choosing the right widget for the job
● Building a simple PyQT form: understanding PyQT’s class hierarchy,
inheritance, and Signals/Slots
● GUI, but make it aesthetically pleasing: adding CSS to your application
● Distributing your application: Packaging the scripts as .exe and distributing
them to client machines
● Q/A
Introduction
Desktop applications are a GREAT idea if:
● Your user base only uses one platform
● You want to view/study/analyze device content
● You want to let people interact with sensitive data, but are worried about
external penetration
● Your users don’t rely on internet connectivity to perform their work
● Etc...
So, you’ve decided that a native desktop app fits
your business purpose better. What’s next?
Draw your problem
How to approach building GUIs using PyQT
Draw -
● How you want the user to interact with the ‘ingredients’ of your app
● What the user should not be doing
● What the reward for a successful interaction is
Let’s try building a simple form.
How to approach building GUIs using PyQT
Understanding how PyQt works beneath the
hood
● PyQT has several classes
● QtGui to initialize UI elements, QtCore to define/edit behavior of the UI
elements, QtDesigner to generate a .ui file, uic to convert .ui to .py files, etc
● A QApplication is the main app
● Let's convert our drawing into an application
You now have a form...how can a user
meaningfully interact with it now?
● By connecting widgets to functions
● These can be established through establishing signals and slots connections
using the widgets’ in-built methods
● Put it this way: a signal is the switch being pressed, the slot is the electrical
wiring that connects it to the fan, and the function is the fan turning on
● The different signal/slot connections can be studied from the official docs
However, the discussed isn't the 'only’ way to
create PyQt UI elements
● You can use the QtDesigner application that ships with PyQt4/5 .whl for
windows
● If you're on Linux/OSX you might have to search for and download the
compiled version or do it yourself
● QtDesigner is a wysiwyg UI editor that generates .ui files
● You can load the .ui file into your main python program by using uic and its
loadUi method
● Or, use pyuic to convert the .ui file into a python file
You can also add CSS to the widgets
● Either directly from the QtDesigner
● Or, using the setStylesheet method of each QWidget
Distributing your application
● Use “freeze” method to package your application for distribution to client
systems
● For windows, you can convert .py to .exe with all the necessary windows .dlls,
any custom python modules, etc
● Some libraries to help you do it are py2exe, cxfreeze, PyInstaller, etc.
For further questions/assistance:
● Mail me at jerlynmanohar@gmail.com
● Find me on LinkedIn at
https://www.linkedin.com/in/jerlyn-manohar-605649101/
Ad

More Related Content

What's hot (20)

Tranquilizer
TranquilizerTranquilizer
Tranquilizer
Albert DeFusco
 
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François SaussetFrom Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
Pôle Systematic Paris-Region
 
So I Downloaded Qt, Now What?
So I Downloaded Qt, Now What?So I Downloaded Qt, Now What?
So I Downloaded Qt, Now What?
Janel Heilbrunn
 
OpenAPIを利用したPythonWebアプリケーション開発
OpenAPIを利用したPythonWebアプリケーション開発OpenAPIを利用したPythonWebアプリケーション開発
OpenAPIを利用したPythonWebアプリケーション開発
Takuro Wada
 
Open data for good
Open data for goodOpen data for good
Open data for good
Marco Liberati
 
The state of Jenkins pipelines or do I still need freestyle jobs
The state of Jenkins pipelines or do I still need freestyle jobsThe state of Jenkins pipelines or do I still need freestyle jobs
The state of Jenkins pipelines or do I still need freestyle jobs
Andrey Devyatkin
 
Building End-to-End Apps Using Typescript
Building End-to-End Apps Using TypescriptBuilding End-to-End Apps Using Typescript
Building End-to-End Apps Using Typescript
Gil Fink
 
Android clean architecture workshop 3h edition
Android clean architecture workshop 3h editionAndroid clean architecture workshop 3h edition
Android clean architecture workshop 3h edition
Jorge Ortiz
 
C++ and Software Engineering 2015
C++ and Software Engineering 2015C++ and Software Engineering 2015
C++ and Software Engineering 2015
Juraj Michálek
 
How do we test nodejs apps?
How do we test nodejs apps?How do we test nodejs apps?
How do we test nodejs apps?
Michal Juhas
 
Groovy android
Groovy androidGroovy android
Groovy android
Mario García
 
freeCodeCamp Tokyo meetup 19
freeCodeCamp Tokyo meetup 19freeCodeCamp Tokyo meetup 19
freeCodeCamp Tokyo meetup 19
健太 田上
 
Typescript kata The TDD style 2 edition
Typescript kata The TDD style 2 editionTypescript kata The TDD style 2 edition
Typescript kata The TDD style 2 edition
Ronnie Hegelund
 
Standing out as a new grad candidate
Standing out as a new grad candidateStanding out as a new grad candidate
Standing out as a new grad candidate
Sashko Stubailo
 
Golang skills pre-session
Golang skills pre-sessionGolang skills pre-session
Golang skills pre-session
sofianinho
 
Reactive declarative UI as code - DroidCon Vietnam 2019
Reactive declarative UI as code - DroidCon Vietnam 2019Reactive declarative UI as code - DroidCon Vietnam 2019
Reactive declarative UI as code - DroidCon Vietnam 2019
oradoe
 
Kivy for you
Kivy for youKivy for you
Kivy for you
Николай Скрыпник
 
Git workflows (Basics)
Git workflows (Basics)Git workflows (Basics)
Git workflows (Basics)
Roman Kuba
 
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Adopting language server for apache camel  feedback from a java/Eclipse plugi...Adopting language server for apache camel  feedback from a java/Eclipse plugi...
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Aurélien Pupier
 
Visual studio live share e intellicode
Visual studio live share e intellicodeVisual studio live share e intellicode
Visual studio live share e intellicode
Miguel Angel Teheran Garcia
 
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François SaussetFrom Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
Pôle Systematic Paris-Region
 
So I Downloaded Qt, Now What?
So I Downloaded Qt, Now What?So I Downloaded Qt, Now What?
So I Downloaded Qt, Now What?
Janel Heilbrunn
 
OpenAPIを利用したPythonWebアプリケーション開発
OpenAPIを利用したPythonWebアプリケーション開発OpenAPIを利用したPythonWebアプリケーション開発
OpenAPIを利用したPythonWebアプリケーション開発
Takuro Wada
 
The state of Jenkins pipelines or do I still need freestyle jobs
The state of Jenkins pipelines or do I still need freestyle jobsThe state of Jenkins pipelines or do I still need freestyle jobs
The state of Jenkins pipelines or do I still need freestyle jobs
Andrey Devyatkin
 
Building End-to-End Apps Using Typescript
Building End-to-End Apps Using TypescriptBuilding End-to-End Apps Using Typescript
Building End-to-End Apps Using Typescript
Gil Fink
 
Android clean architecture workshop 3h edition
Android clean architecture workshop 3h editionAndroid clean architecture workshop 3h edition
Android clean architecture workshop 3h edition
Jorge Ortiz
 
C++ and Software Engineering 2015
C++ and Software Engineering 2015C++ and Software Engineering 2015
C++ and Software Engineering 2015
Juraj Michálek
 
How do we test nodejs apps?
How do we test nodejs apps?How do we test nodejs apps?
How do we test nodejs apps?
Michal Juhas
 
freeCodeCamp Tokyo meetup 19
freeCodeCamp Tokyo meetup 19freeCodeCamp Tokyo meetup 19
freeCodeCamp Tokyo meetup 19
健太 田上
 
Typescript kata The TDD style 2 edition
Typescript kata The TDD style 2 editionTypescript kata The TDD style 2 edition
Typescript kata The TDD style 2 edition
Ronnie Hegelund
 
Standing out as a new grad candidate
Standing out as a new grad candidateStanding out as a new grad candidate
Standing out as a new grad candidate
Sashko Stubailo
 
Golang skills pre-session
Golang skills pre-sessionGolang skills pre-session
Golang skills pre-session
sofianinho
 
Reactive declarative UI as code - DroidCon Vietnam 2019
Reactive declarative UI as code - DroidCon Vietnam 2019Reactive declarative UI as code - DroidCon Vietnam 2019
Reactive declarative UI as code - DroidCon Vietnam 2019
oradoe
 
Git workflows (Basics)
Git workflows (Basics)Git workflows (Basics)
Git workflows (Basics)
Roman Kuba
 
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Adopting language server for apache camel  feedback from a java/Eclipse plugi...Adopting language server for apache camel  feedback from a java/Eclipse plugi...
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Aurélien Pupier
 

Similar to How to approach building GUIs using PyQT (20)

Exploring Python GUI Programming_ Creating User-Friendly Applications
Exploring Python GUI Programming_ Creating User-Friendly ApplicationsExploring Python GUI Programming_ Creating User-Friendly Applications
Exploring Python GUI Programming_ Creating User-Friendly Applications
swethag283189
 
Final presentation aldy ian - pwa
Final presentation   aldy ian - pwaFinal presentation   aldy ian - pwa
Final presentation aldy ian - pwa
Muhamad Aldy Bintang
 
20190826 ianjoseph_FinalPresentation
20190826 ianjoseph_FinalPresentation20190826 ianjoseph_FinalPresentation
20190826 ianjoseph_FinalPresentation
Ian Joseph
 
python pre-submission.pdf
python pre-submission.pdfpython pre-submission.pdf
python pre-submission.pdf
AbhishekKumar66407
 
UX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATIONUX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATION
DrupalCamp Kyiv
 
Intro to Flutter SDK
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDK
digitaljoni
 
Software Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicSoftware Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business Logic
ICS
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneurs
Rodrigo Gil
 
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
CybercomChannel
 
App Development with Swift, by Apple
App Development with Swift, by AppleApp Development with Swift, by Apple
App Development with Swift, by Apple
Franco Cedillo
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDoku
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
OW2
 
Cloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT ApplicationsCloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT Applications
Corley S.r.l.
 
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Parth Lawate
 
Introduction to UX for Mesiniaga Academy
Introduction to UX for Mesiniaga AcademyIntroduction to UX for Mesiniaga Academy
Introduction to UX for Mesiniaga Academy
Zainul Zain
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
MulesoftMunichMeetup
 
Feature Development with jQuery
Feature Development with jQueryFeature Development with jQuery
Feature Development with jQuery
Michael Edwards
 
Akademy 2010 presentation
Akademy 2010 presentationAkademy 2010 presentation
Akademy 2010 presentation
Marco Martin
 
presentation about internship project details
presentation about internship project detailspresentation about internship project details
presentation about internship project details
rajwork2
 
Workshop-BuildingSoftware-June2023.pptx
Workshop-BuildingSoftware-June2023.pptxWorkshop-BuildingSoftware-June2023.pptx
Workshop-BuildingSoftware-June2023.pptx
Rajmohan Kathiresan
 
Exploring Python GUI Programming_ Creating User-Friendly Applications
Exploring Python GUI Programming_ Creating User-Friendly ApplicationsExploring Python GUI Programming_ Creating User-Friendly Applications
Exploring Python GUI Programming_ Creating User-Friendly Applications
swethag283189
 
20190826 ianjoseph_FinalPresentation
20190826 ianjoseph_FinalPresentation20190826 ianjoseph_FinalPresentation
20190826 ianjoseph_FinalPresentation
Ian Joseph
 
UX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATIONUX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATION
DrupalCamp Kyiv
 
Intro to Flutter SDK
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDK
digitaljoni
 
Software Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicSoftware Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business Logic
ICS
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneurs
Rodrigo Gil
 
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
CybercomChannel
 
App Development with Swift, by Apple
App Development with Swift, by AppleApp Development with Swift, by Apple
App Development with Swift, by Apple
Franco Cedillo
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDoku
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
OW2
 
Cloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT ApplicationsCloud Conf 2015 - Develop and Deploy IOT Applications
Cloud Conf 2015 - Develop and Deploy IOT Applications
Corley S.r.l.
 
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Parth Lawate
 
Introduction to UX for Mesiniaga Academy
Introduction to UX for Mesiniaga AcademyIntroduction to UX for Mesiniaga Academy
Introduction to UX for Mesiniaga Academy
Zainul Zain
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
MulesoftMunichMeetup
 
Feature Development with jQuery
Feature Development with jQueryFeature Development with jQuery
Feature Development with jQuery
Michael Edwards
 
Akademy 2010 presentation
Akademy 2010 presentationAkademy 2010 presentation
Akademy 2010 presentation
Marco Martin
 
presentation about internship project details
presentation about internship project detailspresentation about internship project details
presentation about internship project details
rajwork2
 
Workshop-BuildingSoftware-June2023.pptx
Workshop-BuildingSoftware-June2023.pptxWorkshop-BuildingSoftware-June2023.pptx
Workshop-BuildingSoftware-June2023.pptx
Rajmohan Kathiresan
 
Ad

Recently uploaded (20)

Environment .................................
Environment .................................Environment .................................
Environment .................................
shadyozq9
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Dahua Smart Cityyyyyyyyyyyyyyyyyy2025.pdf
Dahua Smart Cityyyyyyyyyyyyyyyyyy2025.pdfDahua Smart Cityyyyyyyyyyyyyyyyyy2025.pdf
Dahua Smart Cityyyyyyyyyyyyyyyyyy2025.pdf
PawachMetharattanara
 
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
Guru Nanak Technical Institutions
 
Unleashing the Power of Salesforce Flows &amp_ Slack Integration!.pptx
Unleashing the Power of Salesforce Flows &amp_ Slack Integration!.pptxUnleashing the Power of Salesforce Flows &amp_ Slack Integration!.pptx
Unleashing the Power of Salesforce Flows &amp_ Slack Integration!.pptx
SanjeetMishra29
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdfLittle Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
gori42199
 
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic AlgorithmDesign Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Journal of Soft Computing in Civil Engineering
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
Deepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber ThreatsDeepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber Threats
RaviKumar256934
 
GROUP 2 - MANUFACTURE OF LIME, GYPSUM AND CEMENT.pdf
GROUP 2 - MANUFACTURE OF LIME, GYPSUM AND CEMENT.pdfGROUP 2 - MANUFACTURE OF LIME, GYPSUM AND CEMENT.pdf
GROUP 2 - MANUFACTURE OF LIME, GYPSUM AND CEMENT.pdf
kemimafe11
 
Environment .................................
Environment .................................Environment .................................
Environment .................................
shadyozq9
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Dahua Smart Cityyyyyyyyyyyyyyyyyy2025.pdf
Dahua Smart Cityyyyyyyyyyyyyyyyyy2025.pdfDahua Smart Cityyyyyyyyyyyyyyyyyy2025.pdf
Dahua Smart Cityyyyyyyyyyyyyyyyyy2025.pdf
PawachMetharattanara
 
Unleashing the Power of Salesforce Flows &amp_ Slack Integration!.pptx
Unleashing the Power of Salesforce Flows &amp_ Slack Integration!.pptxUnleashing the Power of Salesforce Flows &amp_ Slack Integration!.pptx
Unleashing the Power of Salesforce Flows &amp_ Slack Integration!.pptx
SanjeetMishra29
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdfLittle Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
gori42199
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
Deepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber ThreatsDeepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber Threats
RaviKumar256934
 
GROUP 2 - MANUFACTURE OF LIME, GYPSUM AND CEMENT.pdf
GROUP 2 - MANUFACTURE OF LIME, GYPSUM AND CEMENT.pdfGROUP 2 - MANUFACTURE OF LIME, GYPSUM AND CEMENT.pdf
GROUP 2 - MANUFACTURE OF LIME, GYPSUM AND CEMENT.pdf
kemimafe11
 
Ad

How to approach building GUIs using PyQT

  • 1. How to approach building GUIs using PyQt Jerlyn Manohar
  • 2. Summary: ● Draw your problem ● Know your widgets: choosing the right widget for the job ● Building a simple PyQT form: understanding PyQT’s class hierarchy, inheritance, and Signals/Slots ● GUI, but make it aesthetically pleasing: adding CSS to your application ● Distributing your application: Packaging the scripts as .exe and distributing them to client machines ● Q/A
  • 3. Introduction Desktop applications are a GREAT idea if: ● Your user base only uses one platform ● You want to view/study/analyze device content ● You want to let people interact with sensitive data, but are worried about external penetration ● Your users don’t rely on internet connectivity to perform their work ● Etc...
  • 4. So, you’ve decided that a native desktop app fits your business purpose better. What’s next? Draw your problem
  • 6. Draw - ● How you want the user to interact with the ‘ingredients’ of your app ● What the user should not be doing ● What the reward for a successful interaction is Let’s try building a simple form.
  • 8. Understanding how PyQt works beneath the hood ● PyQT has several classes ● QtGui to initialize UI elements, QtCore to define/edit behavior of the UI elements, QtDesigner to generate a .ui file, uic to convert .ui to .py files, etc ● A QApplication is the main app ● Let's convert our drawing into an application
  • 9. You now have a form...how can a user meaningfully interact with it now? ● By connecting widgets to functions ● These can be established through establishing signals and slots connections using the widgets’ in-built methods ● Put it this way: a signal is the switch being pressed, the slot is the electrical wiring that connects it to the fan, and the function is the fan turning on ● The different signal/slot connections can be studied from the official docs
  • 10. However, the discussed isn't the 'only’ way to create PyQt UI elements ● You can use the QtDesigner application that ships with PyQt4/5 .whl for windows ● If you're on Linux/OSX you might have to search for and download the compiled version or do it yourself ● QtDesigner is a wysiwyg UI editor that generates .ui files ● You can load the .ui file into your main python program by using uic and its loadUi method ● Or, use pyuic to convert the .ui file into a python file
  • 11. You can also add CSS to the widgets ● Either directly from the QtDesigner ● Or, using the setStylesheet method of each QWidget
  • 12. Distributing your application ● Use “freeze” method to package your application for distribution to client systems ● For windows, you can convert .py to .exe with all the necessary windows .dlls, any custom python modules, etc ● Some libraries to help you do it are py2exe, cxfreeze, PyInstaller, etc.
  • 13. For further questions/assistance: ● Mail me at [email protected] ● Find me on LinkedIn at https://www.linkedin.com/in/jerlyn-manohar-605649101/