PyQt5 Programs | Sidebar example of application

  Рет қаралды 56,103

CodeQuestions

CodeQuestions

Күн бұрын

➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖
Sidebar of the application is like Bootstrap sidebar example.
⭐ Uesed Widgets ⭐
〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
QWidget、QLabel、QStackedWidget、QPushButton、QLineEdit
🔗Links 🔗
〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
Source Code: github.com/ingwant/PyQt5-Vide...
Icons: www.iconsdb.com/
🧩 Timestamps 🧩
〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
0:00 App Function Preview
0:17 #1 - Create project folder and prepare icons
0:37 #2- Create UI file: Remove menubar and statusbar
1:24 #3 - Add QWidget for sidebar and main window
2:37 #5 - Create Resource file
2:55 #6 - Set APP logo(50X50)
3:20 #7 - Set icon for each menu pushButton
4:13 #8 - Set logo(40X40) and app title(15)
4:37 #9 - Set icon for each menu pushbutton
5:10 #10 - Set icon size: 14X14 and 20X20
5:20 #11 - Set layout for each widget
5:53 #12 - Set icon and layout for header widget
6:43 #13 - Set layout values
7:42 #14 - Set QPushButton checkable and autoExxlusive
7:58 #15 - Set Signal/Slot for function QPushButtons
9:18 #16 - Change objectName for each widget
10:35 #17 - Create menu pages
11:43 #18 - Convert the UI file to PY file
12:13 #19 - Create main PY file for starting app
14:42 #20 - Create exit signal/slot
15:20 #21 - Create stylesheet qss file
16:44 #22 - Loading style file
19:46 #23 - Function for searching and user information
21:03 #24 - Function for changing QPushButton checked status
22:45 #25 - Function for changing pages
24:00 Example 2: loading stylesheet file
✨ Hashtags ✨
〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
#PyQt5 #python3 #python #pythonprojects

Пікірлер: 112
@Asm0nd
@Asm0nd Жыл бұрын
Thank you for sharing this. Awesome! Keep going!
@blackjack_26
@blackjack_26 7 ай бұрын
You rescued my univesity project. God bless you
@codequestions
@codequestions 7 ай бұрын
Glad I could help!
@damahouxp
@damahouxp Жыл бұрын
Super super cool; thanks for generosity!
@incremental_failure
@incremental_failure 2 ай бұрын
Seems like Qt is pushed hard in universities now, lol. But a lot of good info here and you're very proficient with Designer.
@335haan5
@335haan5 7 ай бұрын
im crying, tysm finally a comprehensive tutorial
@codequestions
@codequestions 7 ай бұрын
😂😂😂
@edmonddeng3577
@edmonddeng3577 Жыл бұрын
Awesome work!
@nasurudeenr7849
@nasurudeenr7849 6 ай бұрын
very nice more details. Rocking man....
@berkinylm
@berkinylm 6 ай бұрын
You are pure gold
@milan_085
@milan_085 4 ай бұрын
Thank you so much for your efforts.👏👏🔥🔥
@mtmotoki2
@mtmotoki2 6 ай бұрын
I just started learning PyQt, your video was very helpful.
@codequestions
@codequestions 6 ай бұрын
Glad it was helpful!
@Raybow-vq8mj
@Raybow-vq8mj Жыл бұрын
really helpful, thank you very much❤
@codequestions
@codequestions Жыл бұрын
Glad it was helpful!
@emrahkaplan2228
@emrahkaplan2228 9 ай бұрын
Thank you. Very good job.
@codequestions
@codequestions 8 ай бұрын
Glad it was helpful!
@rinaaiko5619
@rinaaiko5619 4 ай бұрын
you saved my university project
@captainmustard1
@captainmustard1 8 ай бұрын
everything work well for me. Good Video. Thank you :D
@codequestions
@codequestions 7 ай бұрын
Great to hear!
@aliyananwar7633
@aliyananwar7633 2 ай бұрын
Your channel is awesome thanks for such great content
@codequestions
@codequestions 2 ай бұрын
Glad you enjoy it!
@francescoanastasio2021
@francescoanastasio2021 8 ай бұрын
This channel is a discovery! FInally someone who knows how to program professionally. You should turn all these videos in a udemy online course.
@codequestions
@codequestions 8 ай бұрын
Appreciate it!
@cornevanzyl5880
@cornevanzyl5880 7 ай бұрын
From some that's used PyQT for about year, you've teached many things. I prefer implementing visual changes in the Qt designer rather than in the style sheet. Knowing both methods are a must and you're also doing it for time sake
@codequestions
@codequestions 7 ай бұрын
Yes, I agree with you
@juniorMr
@juniorMr 10 ай бұрын
Thanks a lot
@_workenx_3764
@_workenx_3764 6 ай бұрын
Amazing work! i have one question i'm trying to do this work but in C++ and its really hard any tips to traslate it better
@jotarojoestar1399
@jotarojoestar1399 Ай бұрын
hello, is there a way for the frame that corresponds to the option in the sidebar not to collapse when the sidebar is fully opened?
@IEEE7
@IEEE7 4 ай бұрын
freaking legend
@ironF5
@ironF5 Жыл бұрын
what is QAbstractItemModel in QComplete, i cannot quite comprehend it ! can u elaborate it!
@abloh123
@abloh123 3 ай бұрын
You are GOAT
@untizioqualunque2466
@untizioqualunque2466 Ай бұрын
goated video
@_desouzaa_
@_desouzaa_ 5 ай бұрын
👏👏👏👏👏👏👏👏
@taominh
@taominh Жыл бұрын
please make more tutorial videos like this. about set signal/slot for function
@codequestions
@codequestions Жыл бұрын
Sure. Since I have time, I will do more videos
@taominh
@taominh Жыл бұрын
@@codequestions❤️
@EsraaSalah-lg4mc
@EsraaSalah-lg4mc Жыл бұрын
at 8:30 min, when you press the pushbutton how can you make the second menu (with details) replace the first one?
@codequestions
@codequestions Жыл бұрын
Set the Menu button checkable first, then set toggled signal and solt between menu button and menu frame
@Sylarman1
@Sylarman1 2 ай бұрын
This is awesome. I'm having a really hard time though, trying to figure out, where the heck the mouse disappears to on section #17 on min 10:35 I know we want to create menu pages with QLabel, but what exactly are you doing here? Where are you pasting from? Please help. Thanks.
@codequestions
@codequestions 2 ай бұрын
Just put some labels into each page for identiting pages
@ironF5
@ironF5 Жыл бұрын
i am using the same code as shown in this video, and doing a bit of editting and calling label_5 (which is in page2 as per video) on page3 as well. logically speaking the label_5 should appear on both page2 and page 3 but label_5 appears on page3 only and page2 shows nothing. how to make it appear on both pages?
@codequestions
@codequestions Жыл бұрын
The objectname should not be duplicate in one ui file
@ironF5
@ironF5 Жыл бұрын
@@codequestions what to do if i want similar QObject on multiple QWidgets (for example textbox=QTextBox on 2 different QWidgets)? is their a way?
@codequestions
@codequestions Жыл бұрын
@@ironF5 just use designer to create the ui
@simbapfaira1340
@simbapfaira1340 Жыл бұрын
This is beautiful🥵🥵
@codequestions
@codequestions Жыл бұрын
Thanks
@ironF5
@ironF5 Жыл бұрын
how to add margins on QTextEdit .... so that itshows margins on all sides as it shows on microsoft-word and google-docs?
@codequestions
@codequestions Жыл бұрын
do you the width of text to border? if that, you can use (padding: 10px) to set the margins
@ironF5
@ironF5 Жыл бұрын
@@codequestions will try and update
@ironF5
@ironF5 Жыл бұрын
how to zoomin zoomout using QSlideBar(horizontal) on QTextEdit?
@codequestions
@codequestions Жыл бұрын
QSlideBar.valueChanged.connect(set_font_size_of_QTextEdit)
@ironF5
@ironF5 Жыл бұрын
@@codequestions can u also write code for set_font_size_of_QTextEdit function, i have spin box for font sizes in my app. but i cannot understand how the app is going to understand which slider way does the font increases and vice versa...
@alirics
@alirics 9 ай бұрын
Hi! Very nice video! I have one question: Why my icons are not changing colors after I clicked on them?
@codequestions
@codequestions 9 ай бұрын
When you set the icon for button in designer, you need to set different icons for on and off
@omer-halaby
@omer-halaby 7 ай бұрын
Amazing work! Although can anyone help me with a problem I encountered while trying to use the code? I can't see the logos.
@codequestions
@codequestions 7 ай бұрын
Make sure you have the QLabel for logo first.
@omer-halaby
@omer-halaby 7 ай бұрын
@@codequestions Oh thank you but I think I solved it by now. I had to change the file paths used to get the icons. I changed it in the designer and saved and it wotked. Thanks anyways!
@ironF5
@ironF5 Жыл бұрын
how to change theme of your application at run time? how to add multiple themese and chagne at run time?
@codequestions
@codequestions Жыл бұрын
for this question, you need create different theme file first. then you can use the method in the last video to change themes.
@ironF5
@ironF5 Жыл бұрын
my completer code works on the main QTextEdit but when i add mdi functionality, it works on the first window and doesnot work on new mdi's !
@codequestions
@codequestions Жыл бұрын
do you mean mdiArea?
@ironF5
@ironF5 Жыл бұрын
@@codequestions yes
@ironF5
@ironF5 Жыл бұрын
@@codequestions yes mdi area
@tuongnguyenvan7951
@tuongnguyenvan7951 Жыл бұрын
how to insert icon? What tool do you use? 12:00
@codequestions
@codequestions Жыл бұрын
What do you mean inserting icon? I just use qt designer.
@ironF5
@ironF5 Жыл бұрын
can we do speelchecking on QTextEdit as it shows red underline in misspelled words on microsoft-word and google-docs? can u make video on that?
@codequestions
@codequestions Жыл бұрын
for spellchecking, the the basic theory if check all the input words to a words list. so you need a word list. use textChanged signal to connect check function. you can follow this article first:nethumlamahewage.medium.com/integrating-spellchecking-into-a-qtextedit-widget-in-pyqt5-with-enchant-f025f4097e5c
@ironF5
@ironF5 Жыл бұрын
@@codequestions i have successfully integrated this spellcheck module in my application, and it is working at my end with my QTextEdit applicaiton with full functionality, it shows red line on misspelled words and give suggestions as well .... thank you
@codequestions
@codequestions Жыл бұрын
@@ironF5 Congratulations!
@ironF5
@ironF5 Жыл бұрын
@@codequestions thank you.. is there any library that gives synonyms and antonyms like this spell check? preferably offline (like this spellcheck example)??
@ironF5
@ironF5 Жыл бұрын
@@codequestions can u also tell me how can i add more dictionaries (currently only english language works) for other languages and make it work aswell !! 1). how to add more dictionaries and 2). how to make it work in QTextEdit!
@ashwinkumar5223
@ashwinkumar5223 5 ай бұрын
What's the name of this editor you used here
@codequestions
@codequestions 5 ай бұрын
capcut
@ironF5
@ironF5 Жыл бұрын
my QCompleter code works, with QLineEdit and QTextEdit as well. now i have another query normally QCompleter code words when a list of words is provided, and QCompleter matches a word from that list and provide suggestions what to do if i have dictionary, key value pair in case of keyvalue pair, i want the QCompleter code to search on Key item and suggest the value item. please make a video on it if possible.!
@codequestions
@codequestions Жыл бұрын
kzbin.info/www/bejne/bnPXlnaVjKyhiNU
@codequestions
@codequestions Жыл бұрын
Do you watch this video? I think it may help you
@codequestions
@codequestions Жыл бұрын
@@ironF5 this is a smaple example for the function that you want def InitCompleter(self): self.data = { "word": "defination", "word1": "defination of word1", "word2": "defination of word2", "word3": "defination of word3", } completer = QCompleter(self.data.keys()) self.lineEdit = self.ui.lineEdit self.lineEdit.setCompleter(completer) def on_lineEdit_textChanged(self, text): defination = self.data.get(text) if defination: self.ui.label.setText(defination)
@ironF5
@ironF5 Жыл бұрын
@@codequestions hello, the minimum working code is pasted below that works at my end. when i press 'w' it suggests all words starting from 'w'(like a normal QCompleter), whereas i want the content of the corresponding second column (QCompleter working should be on the first column but the suggestions should be from second column) code start after this line _____________________________ import sys from PyQt5.QtWidgets import ( QApplication, QCompleter, QLineEdit, QVBoxLayout, QWidget ) data = { "word": "defination", "word1": "synonym of word1", "word2": "example of word2", "word3": "working of word3", } class mywin(QWidget): # doesnot work with QMainWindow def __init__(self): super(mywin,self).__init__() self.initUI() def initUI(self): vbox=QVBoxLayout() self.setWindowTitle('Ayyaz application') self.setGeometry(200,200,400,200) self.l=QLineEdit() completer=QCompleter(data.keys()) self.l.setCompleter(completer) vbox.addWidget(self.l) self.setLayout(vbox) def mymain(): app = QApplication(sys.argv) win=mywin() win.show() sys.exit(app.exec_()) if __name__=='__main__': mymain() ________________ code ends before this line
@codequestions
@codequestions Жыл бұрын
@@ironF5 whats the purpose of your app? if you just want search the value by the key. I think it’s no matter where the result shows. If you want to show result in the lineEdit, change the label to LineEdit. But if you want to show the value as suggestions list by input key word. I don’t know how to do it. I don’t think it works.
@quennyborromeo4653
@quennyborromeo4653 Жыл бұрын
Hi. why does my icon doesn't show up?
@codequestions
@codequestions Жыл бұрын
When you create the ui file or after convert it into py file?
@huynhduyphuong7787
@huynhduyphuong7787 Жыл бұрын
how can you change the pages without call any signal clicked.connect in __init__ of mainWindow I see you just define some function such as on_home_btn_1_toggled,... and don't need call self.ui.home_btn_1.clicked.connect(self.on_home_btn_1_toggled()) in your __init__?? Is there any linked I haven't understand here?? Thank you so much
@codequestions
@codequestions Жыл бұрын
This is from C++. when you create C++ programs with qt, the function is automatically created in *.h file.
@huynhduyphuong7787
@huynhduyphuong7787 Жыл бұрын
@@codequestionsit means that on'_button_name_'toggle is built in function and it id automatically called when the butoon toggle and we don't need do anything else, right?
@huynhduyphuong7787
@huynhduyphuong7787 Жыл бұрын
can you give me the link talk about those functions, I don'f find any document whoch mention about them
@codequestions
@codequestions Жыл бұрын
@@huynhduyphuong7787 can we chat with discord? Then I can send you the screenshot of the book I learn it from. This is a Chinese book,but I think we can translate to English
@huynhduyphuong7787
@huynhduyphuong7787 Жыл бұрын
@@codequestions yeah of course, can you give me link your discord
@muhammadprawirayuda3510
@muhammadprawirayuda3510 Жыл бұрын
sory brother, i would like to ask about this : ## functions for changing menu page def on_home_btn_1_toggled(self): self.ui.stackedWidget.setCurrentIndex(0) def on_home_btn_2_toggled(self): self.ui.stackedWidget.setCurrentIndex(0) my question is , where the signal of this slot (on_home_btn_toggled) ? thanks
@codequestions
@codequestions Жыл бұрын
Use on to connect signal(toggled) and slot(home_btn_2). "home_btn_1" and "home_btn_2" are object name
@muhammadprawirayuda3510
@muhammadprawirayuda3510 Жыл бұрын
@@codequestions this one >> self.home_btn_1.toggled['bool'].connect(self.home_btn_2.setChecked) ?? sory im still dont get it:( can you make it clearly, thanks
@codequestions
@codequestions Жыл бұрын
@@muhammadprawirayuda3510 this code is automatic generated when use pyuic5 convert ui file to python file. and I think this is from the signal and slot setting in designer.
@tuongnguyenvan7951
@tuongnguyenvan7951 Жыл бұрын
How do you do this step? 10:35
@codequestions
@codequestions Жыл бұрын
just add QStackedWidget into QWidget, then add QLabel into each page
@regisgambiza1808
@regisgambiza1808 Жыл бұрын
share the code please?
@codequestions
@codequestions Жыл бұрын
github.com/ingwant/PyQt5-Video-Book.git
@ucphanai4286
@ucphanai4286 8 ай бұрын
My icon doesn't show up when I conver ui -> py
@codequestions
@codequestions 8 ай бұрын
If you are using a resource file, there may be an issue with importing. If you are only using images for the icons, it could be a path issue.
@ucphanai4286
@ucphanai4286 8 ай бұрын
@@codequestions I just use your resource file, but still cannot show the icons ;-;
@codequestions
@codequestions 8 ай бұрын
Please watch this video starting at 12:13 #19 - Create main PY file for starting app@@ucphanai4286
@codequestions
@codequestions 8 ай бұрын
@@ucphanai4286 11:43 #18 - Convert the UI file to PY file
@RPXGAMING01
@RPXGAMING01 9 ай бұрын
can you please help me with this i used the same code in the video but cant pass 14:00 Error: Traceback (most recent call last): File "C:\OneDrive\Documents\main.py", line 20, in window = MainWindow() ^^^^^^^^^^^^ File "C:\OneDrive\Documents\main.py", line 12, in __init__ self.ui.setupUi(self) File "C:\OneDrive\Documents\main.py", line 16, in setupUi MainWindow.setMinimumSize(QtCore.QSize(0, 40)) TypeError: arguments did not match any overloaded call: setMinimumSize(self, minw: int, minh: int): argument 1 has unexpected type 'QSize' setMinimumSize(self, s: QSize): argument 1 has unexpected type 'QSize'
@codequestions
@codequestions 9 ай бұрын
It’s hard to debug without code.
@RPXGAMING01
@RPXGAMING01 9 ай бұрын
is there anyway to contact you to help me solve it
@codequestions
@codequestions 9 ай бұрын
@@RPXGAMING01 you can find a discord link in the top of my channel page
@user-bl1yw9rg4r
@user-bl1yw9rg4r 8 ай бұрын
Qt модель питон
@chanceybassell1202
@chanceybassell1202 Жыл бұрын
PЯӨMӨƧM ❗
GUI Moderna en Python  con  PyQt5 - Menú Lateral  CRUD con SQLite
43:11
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 45 МЛН
Ouch.. 🤕
00:30
Celine & Michiel
Рет қаралды 27 МЛН
Let's Recreate the Tesla UI in Qt and QML PART 1!
51:16
MontyTheSoftwareEngineer
Рет қаралды 67 М.
PyQt6 Programs | Stock Management Example with SQLite3
1:01:20
CodeQuestions
Рет қаралды 4,4 М.
Creating Your Own Qt Applications...It's Easy!
15:27
DistroTube
Рет қаралды 36 М.