How do I get rid of the whitespace in my application:
I would like to get rid of the whitespace in my QTableWidget (blue arrow). How do I do it?
Here is the code for my application:
gridLayout = QGridLayout()
#add other widgets
currentItemsTable = QTableWidget(4, 2)
currentDeviceIconLabel = QLabel("Current Device Icon: ")
self.currentDeviceIcon = QLabel()
currentAppIconLabel = QLabel("Current App Icon: ")
self.currentAppIcon = QLabel()
currentTitleLabel = QLabel("Current Title: ")
self.currentTitle = QLabel(self.getCurrentTitle())
currentSubtitleLabel = QLabel("Current Subtitle: ")
self.currentSubtitle = QLabel(self.getCurrentSubtitle())
currentItemsTable.setCellWidget(0, 0, currentDeviceIconLabel)
currentItemsTable.setCellWidget(0, 1, self.currentDeviceIcon)
currentItemsTable.setCellWidget(1, 0, currentAppIconLabel)
currentItemsTable.setCellWidget(1, 1, self.currentAppIcon)
currentItemsTable.setCellWidget(2, 0, currentTitleLabel)
currentItemsTable.setCellWidget(2, 1, self.currentTitle)
currentItemsTable.setCellWidget(3, 0, currentSubtitleLabel)
currentItemsTable.setCellWidget(3, 1, self.currentSubtitle)
currentItemsTable.horizontalHeader().hide()
currentItemsTable.resizeColumnsToContents()
currentItemsTable.resizeRowsToContents()
currentItemsTable.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
gridLayout.addWidget(currentItemsTable, 1, 4, 8, 2)
Additionally, how do I get the QTableWidget to resize with the row and column contents? I don't want any scroll bars.