Skip to content

Commit

Permalink
fix Qt5.10 issues with column hiding and resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
ozmartian committed Feb 22, 2018
1 parent 3510d97 commit 9dddcf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _build/build.nuitka.linux
@@ -1,5 +1,5 @@
#!/bin/bash

cd ..
cd ../tvlinker
nuitka --recurse-all --remove-output tvlinker.py
mv tvlinker.exe tvlinker
7 changes: 3 additions & 4 deletions tvlinker/__main__.py
Expand Up @@ -217,20 +217,20 @@ def settings_menu(self) -> QMenu:
def init_table(self) -> QTableWidget:
self.table = QTableWidget(0, 4, self)
self.table.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.table.hideColumn(1)
self.table.verticalHeader().hide()
self.table.setAlternatingRowColors(True)
self.table.setSelectionMode(QAbstractItemView.SingleSelection)
self.table.setSelectionBehavior(QAbstractItemView.SelectRows)
self.table.setHorizontalHeaderLabels(('DATE', 'URL', 'DESCRIPTION', 'SIZE'))
self.table.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.table.horizontalHeader().setSectionResizeMode(2, QHeaderView.Stretch)
self.table.horizontalHeader().setMinimumSectionSize(100)
if sys.platform == 'win32':
self.table.setStyle(QStyleFactory.create('Fusion'))
self.table.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.table.sortByColumn(0, Qt.DescendingOrder)
self.table.doubleClicked.connect(self.show_hosters)
self.table.setColumnHidden(1, True)
self.table.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.table.horizontalHeader().setSectionResizeMode(2, QHeaderView.Stretch)
return self.table

def init_metabar(self) -> QHBoxLayout:
Expand Down Expand Up @@ -607,7 +607,6 @@ def main():
app.setOrganizationDomain(FixedSettings.organizationDomain)
app.setApplicationVersion(FixedSettings.applicationVersion)
app.setQuitOnLastWindowClosed(True)
app.setAttribute(Qt.AA_NativeWindows, True)
tvlinker = TVLinker(FixedSettings.get_app_settings())
sys.exit(app.exec_())

Expand Down

0 comments on commit 9dddcf7

Please sign in to comment.