PyQt5 QTableWidget tutorial: Load data from SQL table into Table Widget [Python, SQLite, PyQT5]

PyQt5 QTableWidget tutorial: Load data from SQL table into Table Widget [Python, SQLite, PyQT5]

Code First with Hala

3 года назад

61,539 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

TechCare
TechCare - 05.10.2023 09:14

filters?

Ответить
lobo
lobo - 10.09.2023 08:36

While watching your tutorial, I know my empty brain is filling up.
You teach so well that it's easy to understand. ❗❗❗
... And every time I heard your lovely voice, it make me smile and laugh. 💚🧡❤

Ответить
Paul Divers
Paul Divers - 29.07.2023 10:11

Great tutorial. Keep them coming.

Ответить
Márcio Ngolo
Márcio Ngolo - 06.06.2023 00:29

Hello its possible to use QTableWidget to insert, modify and delete data?

Ответить
Hassaballah Ibn Adef
Hassaballah Ibn Adef - 22.05.2023 14:18

System email Qt creator

Ответить
cybrixx 252
cybrixx 252 - 17.01.2023 14:19

mine just return nonetype TypeError: 'NoneType' object is not iterable

Ответить
OSCAR ALVARADO LOPEZ
OSCAR ALVARADO LOPEZ - 17.10.2022 23:47

Increíble vídeo!!!

Ответить
Matthew VanDruff
Matthew VanDruff - 09.08.2022 17:53

please please more :) this is so informative!!! please keep this program going :) would love more tutorials on this like the dropdowns your mentioned!

Ответить
fritz samuel chery
fritz samuel chery - 01.08.2022 14:38

how can I disable the resize column

Ответить
Jesús Ramón Do Vale
Jesús Ramón Do Vale - 06.06.2022 19:35

Thank you

Ответить
IDoNot Comply
IDoNot Comply - 17.05.2022 11:08

your really good at this! please more videos on the subject of database tables in pyqt5/6!!! slow down and breath though!!!! and get a microphone that focuses on your voice and cancels out everything else, apart from that your awesome!!

Ответить
Alice Freischmidt
Alice Freischmidt - 05.04.2022 00:10

love love love your videos, absolutely saved my coursework, so well explained, THANK YOU

Ответить
Md Ibrahim Ayaz
Md Ibrahim Ayaz - 27.01.2022 09:52

yes please make more content on pyqt

Ответить
Simpotyga
Simpotyga - 29.12.2021 11:21

Thanks a lot👍

Ответить
CRISTIAN ALVAREZ
CRISTIAN ALVAREZ - 29.11.2021 09:32

Muchas gracias, muy bien explicado!!!

Ответить
One of the Sidemen
One of the Sidemen - 18.11.2021 05:15

Is there a difference between mySQL and SQLlite implementation?

Ответить
Dan Musser
Dan Musser - 17.11.2021 02:07

Great Video!! Is there a way to modify the code to change the alignment for certain columns? It looks like the default alignment is left, but there are times when you might want a center alignment on certain columns. Thanks!!

Ответить
Scanito
Scanito - 11.11.2021 05:12

Hey Hala, thanks so much for this great tutorial. Clear and straight to the point. For my project, I have been facing a problem that still cannot resolve: One of my columns (imported as a string from SQLite) represents a date. Format is MM/dd/yyyy. I am able to use the TableWidget sort tool to correctly sort by means of a Qt.DisplayRole. However, for clarity purposes, I need the date to be displayed as dd/MMM/yyyy. How can I implement this to work on the QTableWidget? I will highly appreciate your comments!

Ответить
Gyanam Shah
Gyanam Shah - 27.10.2021 17:22

Can we use Mysql database instead of sqlite to import into pycharm or any other text editors such as vscode or etc?
Kindly explain to me

Ответить
Jack Williams
Jack Williams - 17.10.2021 20:33

Hala, I gave a thumbs up for the content as it helped me greatly. However, I was tempted not to as there are some great responses below with questions. You've not responded to ANY of them as I see. Just a critique (not trolling) but interacting with your viewers is quite an important part of hosting a channel. Obviously you can't respond to EVERYONE and some posts, well there isn't a response for but....

Ответить
8PIN
8PIN - 16.10.2021 18:01

Thank you so much, I've been looking for video like this for so long

Ответить
Bruno Vinicius
Bruno Vinicius - 24.09.2021 06:04

How did i seach a row whith a qlineedit?

Ответить
Dante Alonso
Dante Alonso - 12.07.2021 09:30

Thanks a lot, that is what exactly I was searching for!

Ответить
Sekiro
Sekiro - 25.04.2021 02:59

i did the same thing you did but with sql server database
ty so much

Ответить
zf
zf - 23.04.2021 20:16

if u wanna do it with postgres using psycopg2
import psycopg2
def loaddata(self):
DB_HOST = "DB_HOST"
DB_NAME = "DB_NAME"
DB_USER = "DB_USER"
DB_PASS = "DB_PASS"
con = psycopg2.connect(dbname = DB_NAME, user =DB_USER, password= DB_PASS, host= DB_HOST)
cur = con.cursor()
cur.execute("SELECT * FROM worldcities ;")
self.tableWidget.setRowCount(50)
row = cur.fetchall()
tableRow = 0
for r in row:
self.tableWidget.setItem(tableRow, 0,QtWidgets.QTableWidgetItem(r[0]))
self.tableWidget.setItem(tableRow, 1,QtWidgets.QTableWidgetItem(r[1]))
self.tableWidget.setItem(tableRow, 2,QtWidgets.QTableWidgetItem(r[2]))
tableRow+=1
con.commit()
cur.close()

Ответить
Pratik Honnakore
Pratik Honnakore - 18.04.2021 12:34

Hello, I am using MacOS platform, python, PostgreSQL database and pyqt5 for my application development. I am using QSqlDatabase to add the database. The application is packaged with pyinstaller works fine on developer's machine but after deploying to end user's machine the error pops up "Driver not loaded". Could you provide insights on this?

Ответить
Septimus Severus
Septimus Severus - 13.04.2021 15:59

Thank you

Ответить
Nhu Nguyễn
Nhu Nguyễn - 01.04.2021 17:06

Thank You for Your sharing ! <3

Ответить
Marcela Juarez
Marcela Juarez - 31.03.2021 09:58

Hi, if i have 200k records in my table using for "it takes a long time" there is a way to load the table without using for or while

Ответить
KURDISH SHA
KURDISH SHA - 26.02.2021 21:58

can i ask where are u from

Ответить
HiwaB41
HiwaB41 - 09.02.2021 18:56

How can i make search filter with this?

Ответить
ishudshutup
ishudshutup - 07.02.2021 19:27

Yes yes yes, would love to see this series continued with more advanced queries based on user selections! Thanks so much for these videos, very helpful!!!

Ответить
Mohammed Albazi
Mohammed Albazi - 30.12.2020 01:40

thank u , how can i print the data in the table using the printer(A4) ,pls

Ответить
Wicked Blue
Wicked Blue - 26.12.2020 07:46

would it be the same way putting an excel spreadsheet into the QTableWidget? I cant find information on this. I do love your videos and they have helped me a ton!!! ty

Ответить
lightning 666
lightning 666 - 25.12.2020 15:04

How can we add feature like double clicking on a row will send it's data to QlineEdit?

Ответить
Pola Gerges Younan
Pola Gerges Younan - 25.12.2020 14:40

I was waiting this video thank you❤️❤️❤️
You are the best instructor❤️

Ответить