简体   繁体   中英

HTML-like tables in pyqt

I'm currently starting a little program in python and pyqt . I have little to no experience on GUI programming but I need a table to present some items (like one in this website HERE ). I was wondering if there was any way to do this in pyqt ( qtquick would be better) .

I know there is qtableview in pyqt but I need to make it look like an html table. Can Qtableview be made to look like a CSS style HTML table?

Since QTableView s inherit from QWidget s you can just use the setStyleSheet method to override any default styles for the table.

Depending on how you want to style the table specifically, you'll definitely want to review the Qt Style Syntax .

As per the comment, if you just want to disable sorting call yourTable.setSortingEnabled(False) , and call yourTable.verticalHeader().setMovable(False) (or horizontalHeader ) to disable moving the headers, when creating the table.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM