Toolbar - PyQt with Python GUI Programming tutorial 6

preview_player
Показать описание
In this PyQT4 GUI application development tutorial, we cover how to add a toolbar to our app. Generally, a toolbar is a bar that goes under the menubar by default, but it has larger buttons, is dynamic according to the current view/page your are on in the app, and can be moved around if the user wants to.

Рекомендации по теме
Комментарии
Автор

Dex, you're incredibly intelligent and very easy to understand. This is an excellent tutorial series; these videos are really helping me develop my GUI!

dannydk
Автор

Your examples are the best! Cool series, love it ;)

deadbunnyeyes
Автор

Really interested to know this:
Why is it for the menuBar you made it a normal variable but for the you did self.toolBar?
Thanks

salahhamza
Автор

Any way I can set the toolbar to initialize on the bottom instead of the top? I don't want to drag it down there every time.

cadewalton
Автор

Why did you use 'self.toolBar' instead of using just ' toolBar' as you did for the variable 'mainMenu' ? Does it create any problem while making multi-window applications? By the way using just 'toolBar' instead of 'self.toolBar' works in PyQt5.

ssc
Автор

Great tutorial! The only thing that still worries me is the "close_application vs close_application()". The difference between a method and a parameter in Python classes is clear to me (or I've been quite sure until now at least), but in this case I need further explanation... Any ideas?

filipes
Автор

Hey bro i tried to go to the site to download pyqt at riverbank but the website isn't even responding and other sites are working i have tried switching the browser but no help

typedeckeralt
Автор

Very good tutorial but I wonder, How can I create a vertical toolbar?

AmgadElsaiegh
Автор

What Python IDE are you using for these training videos? They are very helpful for me as a beginner in Pyqt4.

ronrobinson
Автор

How do you add a second window? Do you make another class like window 2? You have def home (self) which calls the window class. If you want to be able to navigate to a secondary window from the "home menu" what would you do?

brettzook
Автор

I was not understanding why my app used to close immediately upon:

now you solved my issue :D

tanweerahmad
Автор

I dont understand what "flee the scene" means? it is connected with who or what? why that?

yuyetasatcham
Автор

I'm Python-Beginner. I want to know, how to add a combobox to a toolbar in python Qt

markuslemcke
Автор

When I try to add several icons, they all stack up on the left. How would I get them to line up on the tool bar?

ginoskotheon
Автор

Hi Sentdex, thank you for your wonderful tubes
In this tube I did the same code but unfortunately it haven't work
 extractAction =

  self.toolBar = self.addToolBar("Extraction")
   
and this message is appear

extractAction =
TypeError: arguments did not match any overloaded call:
  QAction(QObject): argument 1 has unexpected type 'QIcon'
  QAction(str, QObject): argument 1 has unexpected type 'QIcon'
  QAction(QIcon, str, QObject): not enough arguments


please help if possible
thank you

haribalsulimani
Автор

i am not getting icon, ,,,i am using Ubuntu

manzoorshaik
Автор

I prefer using the qt Designer over placing elements manually

dayvie
Автор

I laughed when he said imagine babies in reference to "Get to CHOPPAH!" It's from an Arnold Schwarzenegger movie Predator. "Hit the baby" hahaha

diehardAMD
Автор

I found this easier than tkinter so far.

HexagonalClosePacked
Автор

another great tutorial. thanks!

relevant documentation.
QAction.__init__ (self, QIcon icon, QString text, QObject parent)
I get it that the self is not required in our code.
I'm a little confused why we needed to reference 'self' in the code in place of 'QObject parent'

extractAction = QtGui.QAction(QtGui.QIcon('todachoppa.png'), 'Flee the Scene', self)

thoughts?

MatthewTaylorAu