For anyone who is curious, the way Tim was describing how to set a path to images not in the same folder as the class is correct. For example, if you images are in a folder called "images" your photo.setPixmap looks like this: self.photo.setPixmap(QtGui.QPixmap("images/my_photo.png"))
true I dont like pyQt tutorials where people just show QT designer rather than creating with pyQt 5 itself.. Its just like showing HTML tutorial with a WYSIWYG editor XD These videos are just like clickbait
very informative tutorials. For your code above, if the piture has to be toggled between dog and cat pictures every 30s , how will you do it. How to use Qtimer for it.
Hi Tim..Great series, congrats for your work. can i ask you to make one about reading a json file and navigate the result like the photos? thank you in advance,
The code didn't work for me. When I clicked on the paste, copy... The window just closed. In the console it showed process finished with exit code -1073740791 (0xC0000409)
i suggest you at least watch a hard code tutorial, just to understand the basics so when you have to connect things and make changes, you will want to be able to read whats there
Is there a way in QT Designer to define all of the actions (similar to NetBeans) where actions are linked? i.e. clicking a button and defining all the actions it performs (in the GUI itself) rather than editing the converted python code?
Hi, thanks for guides. I've a question. For example I've made everything you shown, but I need to change my .py file which I've converted from .ui. I need to change it it Qt Designer. Is there any method to convert .py to .ui?
Perhaps a dumb question: is there a way to design interface, convert it to python, add methods and than later alter the design also in Qt designer? Same like in MS Visual Studio?
i'd say no... although you can save the original UI file and change it, then produce a new .py from it when you need it. Pity Qt Designer cannot convert UI->py on its own.
Oh, and, by the way - you know there's a direct method of who you can use UI files in your py code? I mean: window = uic.loadUi("myWindowDesignedInDesigner.ui")
Hey, thanks for the video! Just one question, is it possible to place the buttons over the images? I placed 5 radio buttons over a widget where a map png was placed, but when I ran it on VS code, the the buttons were there but the map wasn't. Any fix on this?
When I try to install pyqt5-tools using pip, it shows an error: metadata-generation-failed. I think it is because I am using Python 3.12, and pyqt5-tools hasn't been updated yet? So how do I get the Qt Designer?
Great question)) Then kind of overlay two PNGs and make a speedometer indeed. I'm looking into it right now. I want to try PyQt5.QtGui.QTransform. Want to see if I can apply it to the image drawn. If this works, then the tilt of the needle will be just the rotational transform applied to needle.png
If we change the ui file and overwrite the python file again, won't all of your changes and methods disappear? Edit: How do we fix this issue? Can we inherit the class Ui_MainWindow in another py file? That is what I used to do in PyQt4 Thanks in advance.
Hi Tim, I am only able to select .png image files in pixmap format, it is not allowing to select .jpeg files and any other image files,..can you please help me in this regard?
You mean - an image on the main form? Well... perhaps you can inherit from QMainWindow and make your own main worm where you'd override Paint and draw the image you like. That's the first thought...
MacOS automatically converts the relative path into the full absolute path ex: ../../Downloads/IMG_20200110_192632.jpg Otherwise, the path starts from the test.ui file
Hi Tim Thanks for tutorials can you make video later how to select image from directory and put that image in qlabel after that let it to be added to sqlite database and after that when we will call raw from database let image to be displayed in qlabel
bro do some projects on deep learning covolutional neural networks with PyQt5 like face based attendence system,face morphology etc.and tutorial is great as usual 😘😘
I love your videos but I am a designer not a coder and I don't know what I will do - I need to be able to do everything in one app, visually rather than 2. :(
if you think Tim's video is not enough try reading the documentation, it have a lot more fun stuffs in it. www.riverbankcomputing.com/static/Docs/PyQt5/index.html
For people who prefer tabs as indents instead of spaces: add '-i 0' option to pyuic5.
Thx
This video is better than others, It was very useful for me. Thank you! "Tech With Tim"
For anyone who is curious, the way Tim was describing how to set a path to images not in the same folder as the class is correct. For example, if you images are in a folder called "images" your photo.setPixmap looks like this:
self.photo.setPixmap(QtGui.QPixmap("images/my_photo.png"))
true I dont like pyQt tutorials where people just show QT designer rather than creating with pyQt 5 itself.. Its just like showing HTML tutorial with a WYSIWYG editor XD These videos are just like clickbait
Your way of teaching is amazing
you made me understand codes , thanks
Cool love your teaching way I subscribed your channel
You teach great. Your tutorials are loving.
You saved my life. Subscribed.
Great video I love this library! Thanks for making these useful videos
Hi Tim. Thanks. Precise.
Thank you brother
please continue you classes ,im most awaited for them.if possible upload videos faster
can you tell us where did you learn this stuff from
very informative tutorials.
For your code above, if the piture has to be toggled between dog and cat pictures every 30s , how will you do it. How to use Qtimer for it.
Hello Tim, Great Series and clear explanation. Thanks a lot.
Hi Tim..Great series, congrats for your work. can i ask you to make one about reading a json file and navigate the result like the photos? thank you in advance,
Great videos, very clear
most fantastic - thanks
The code didn't work for me. When I clicked on the paste, copy... The window just closed. In the console it showed process finished with exit code -1073740791 (0xC0000409)
For me, that was because I created a dialog in PyQt5 designer, not a main window.
excellent job !
great like always
many thanks
Thanks, It was helpful.
Awesome! Right to the point!
As a beginner, do you recommend using the QtDesigner or just hard coding? Thanks in advance!
i suggest you at least watch a hard code tutorial, just to understand the basics so when you have to connect things and make changes, you will want to be able to read whats there
@@codywanserski9585 Thanks!
Is there a way in QT Designer to define all of the actions (similar to NetBeans) where actions are linked? i.e. clicking a button and defining all the actions it performs (in the GUI itself) rather than editing the converted python code?
can use pyqt5 for developing games
Are there any requirements for the format of the picture? What format is the picture of that cat? I can’t use .jpg
Hi, thanks for guides. I've a question. For example I've made everything you shown, but I need to change my .py file which I've converted from .ui. I need to change it it Qt Designer. Is there any method to convert .py to .ui?
Just change your .ui file (it should be saved) and then convert it to .py again
I've got an error for the Pixmap, no images are being shown... AttributeError: 'Ui_MainWindow' object has no attribute 'setPixmap'
Can I add a GIF as the background for my window?
BTW Great Content!
Perhaps a dumb question: is there a way to design interface, convert it to python, add methods and than later alter the design also in Qt designer? Same like in MS Visual Studio?
i'd say no... although you can save the original UI file and change it, then produce a new .py from it when you need it.
Pity Qt Designer cannot convert UI->py on its own.
Oh, and, by the way - you know there's a direct method of who you can use UI files in your py code? I mean:
window = uic.loadUi("myWindowDesignedInDesigner.ui")
Hey, thanks for the video! Just one question, is it possible to place the buttons over the images? I placed 5 radio buttons over a widget where a map png was placed, but when I ran it on VS code, the the buttons were there but the map wasn't. Any fix on this?
When I try to install pyqt5-tools using pip, it shows an error: metadata-generation-failed. I think it is because I am using Python 3.12, and pyqt5-tools hasn't been updated yet? So how do I get the Qt Designer?
How can I rotate an image around give point ? Let's say like an arrow in a speedometer ?
Great question)) Then kind of overlay two PNGs and make a speedometer indeed. I'm looking into it right now. I want to try PyQt5.QtGui.QTransform. Want to see if I can apply it to the image drawn. If this works, then the tilt of the needle will be just the rotational transform applied to needle.png
If we change the ui file and overwrite the python file again, won't all of your changes and methods disappear?
Edit: How do we fix this issue? Can we inherit the class Ui_MainWindow in another py file? That is what I used to do in PyQt4
Thanks in advance.
Hi Tim, I am only able to select .png image files in pixmap format, it is not allowing to select .jpeg files and any other image files,..can you please help me in this regard?
i followed this tutorial step by step but not sure why the image is not showing at all. Im using pthon3 on VSC
using python 3.9 and same issue. also using in vscode :/
guess what, run this with sublime text, the image appears perfectly : may be vs code has something to do with it. cost me 1hr :3
Same Issue, VS Code doesn't load the images. You can instead run your app using your terminal. It will work perfectly ^_^
It opens in pycharm but not in VSC
Hi! Nice video. Do you know how to save the full image of the PyQt window?
You could use Alt+prt sc(print screen) on windows and then paste it in paint or something like that
Sir, can We play gif files from labels as we opened pictures? I tried to open but it didnt work out...Any other ways?
Bro, how do i have the image in the background!?
You mean - an image on the main form? Well... perhaps you can inherit from QMainWindow and make your own main worm where you'd override Paint and draw the image you like. That's the first thought...
how to add video instead images? inside the label?
MacOS automatically converts the relative path into the full absolute path
ex: ../../Downloads/IMG_20200110_192632.jpg
Otherwise, the path starts from the test.ui file
its same in windows
Hi Tim Thanks for tutorials can you make video later how to select image from directory and put that image in qlabel after that let it to be added to sqlite database and after that when we will call raw from database let image to be displayed in qlabel
Compared to using Page and tkinter this is like so easy to use it's actually ridiculous
I can only use the png file, jpeg file is not allowed, why?
Is it possible to view a multipage pdf file using PyQt5?
On MacOS, I could only get it work with the full absolute path, the relative path does not work for me. Just an FYI.
same
Great series! Only downside for me is that i cant use QtDesigner for my school project :p
Hi Tim Great Joooob!! Btw you from Uottawa?!
My image is not showing after compiling.......please help!!!!!!!!!!!!! @TechWithTim
It opens in pycharm but not in VSC
pls make a video on how to add animation to the gui in the qt designer pls pls
Is there any way that I can go back to Qt Designer and add stuff to my project, then that gets added back into my .py code?
you can create a widget and add its code to your project.
hey ! how convert this to exe with pictures in --onefile
bro do some projects on deep learning covolutional neural networks with PyQt5 like face based attendence system,face morphology etc.and tutorial is great as usual 😘😘
I love your videos but I am a designer not a coder and I don't know what I will do - I need to be able to do everything in one app, visually rather than 2. :(
Can you plse give a flowchart of python programming
if you think Tim's video is not enough try reading the documentation, it have a lot more fun stuffs in it. www.riverbankcomputing.com/static/Docs/PyQt5/index.html
how to zoom in
thanks.
play with css in PyQt5
How to do it with multiple images?
with code, multiple images, image viewer etc
www.learnpyqt.com/blog/adding-images-to-pyqt5-applications/
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QMainWindow, QApplication, QLabel
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.title = "Image Viewer"
self.setWindowTitle(self.title)
label = QLabel(self)
pixmap = QPixmap('cat.jpg')
label.setPixmap(pixmap)
self.setCentralWidget(label)
self.resize(pixmap.width(), pixmap.height())
app = QApplication(sys.argv)
w = MainWindow()
w.show()
sys.exit(app.exec_())
Legends says if you comment within 24 hours. Your comment will get pinned by Tim.