PDA

View Full Version : Qtableview margin/padding



Zoner
24th February 2021, 06:35
Hi Team

I have a small problem with tableview.
The problem I have is that the QT designer view and the actual application view differ (as shown in the in the pic below).
The table is somehow split in two columns, but when populating all data appears on the left side, including scroll bars.
After import of my data, these views stay the same. My data appears in the left field (with scroll adjuster) whilst the right field stays blank.

13598
Does anybody know what setting may need to change in QTdesigner (or in my code) to resolve this?


from PyQt5 import QtCore, QtWidgets, uic
from PyQt5.QtCore import Qt
from PyQt5.QtGui import *
from PyQt5.QtWidgets import (qApp, QComboBox, QMainWindow, QApplication, QMessageBox, QFileDialog)

#define class
class Bathyui(QtWidgets.QDialog):
def __init__(self, parent=None):
super(Bathyui, self).__init__(parent)
uic.loadUi('Open_File_UWN_Model.ui', self)

#connect to widget
self.table = QtWidgets.QTableView(self.tableView)

#populate with dataframe
self.table.setModel(file_reader)



Below the .ui code
13599

Im a littlebit lost how to solve this. I pretty much hit every setting in the QT Designer formatting menu

d_stranz
24th February 2021, 17:08
Note - this is not a double-post. The OP's first post was marked as "Moderated" and was therefore not visible to the Forum until approval. Because this post has attachments that are also probably used by the repost, I have not deleted it.

Please make replies to the other post (https://www.qtcentre.org/threads/71521-Qtableview-margin-padding).