From e40df3cf8e1de9fae81c90b1c5afe7e6db960b26 Mon Sep 17 00:00:00 2001 From: Thomasedv Date: Fri, 23 Nov 2018 18:55:18 +0100 Subject: [PATCH] Fixed branch lines showing in pyinstaller build --- Modules/parameterTree.py | 4 ++-- core.py | 25 +++++++++++++++++++++++-- utils/utilities.py | 16 ---------------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/Modules/parameterTree.py b/Modules/parameterTree.py index 253796c..aab21fc 100644 --- a/Modules/parameterTree.py +++ b/Modules/parameterTree.py @@ -17,7 +17,7 @@ class ParameterTree(QTreeWidget): addOption = pyqtSignal(QTreeWidgetItem) itemRemoved = pyqtSignal(QTreeWidgetItem, int) - def __init__(self, profile: dict): + def __init__(self, profile: dict, parent=None): """ Data table: All data is in column 0. @@ -30,7 +30,7 @@ def __init__(self, profile: dict): 37 - List of QModelIndex to items that this depends on. """ - super().__init__() + super().__init__(parent=parent) self.favorite = False diff --git a/core.py b/core.py index 4299965..351656a 100644 --- a/core.py +++ b/core.py @@ -174,8 +174,8 @@ def build_gui(self): self.tab2_download_lineedit.setContextMenuPolicy(Qt.ActionsContextMenu) # Sets up the parameter tree. - self.tab2_options = ParameterTree(options) - self.tab2_favorites = ParameterTree(favorites) + self.tab2_options = ParameterTree(options, self) + self.tab2_favorites = ParameterTree(favorites, self) self.tab2_favorites.favorite = True self.tab2_download_option = self.find_download_widget() @@ -442,6 +442,27 @@ def build_gui(self): QTreeWidget::indicator:unchecked {{ image: url({self.unchecked_icon}); }} + + QTreeWidget::branch {{ + image: none; + border-image: none; + }} + + QTreeWidget::branch:has-siblings:!adjoins-item {{ + image: none; + border-image: none; + }} + + QTreeWidget::branch:has-siblings:adjoins-item {{ + border-image: none; + image: none; + }} + + QTreeWidget::branch:!has-children:!has-siblings:adjoins-item {{ + border-image: none; + image: none; + }} + """ ### Configuration main widget. # Adds tabs to the tab widget, and names the tabs. diff --git a/utils/utilities.py b/utils/utilities.py index f0b543d..3965ceb 100644 --- a/utils/utilities.py +++ b/utils/utilities.py @@ -457,22 +457,6 @@ def _validate_settings(self): selection-background-color: blue; }} - QTreeWidget::branch {{ - border-image: none 0; - }} - - QTreeWidget::branch:has-siblings:!adjoins-item {{ - border-image: none 0; - }} - - QTreeWidget::branch:has-siblings:adjoins-item {{ - border-image: none 0; - }} - - QTreeWidget::branch:!has-children:!has-siblings:adjoins-item {{ - border-image: none 0; - }} - QTreeWidget::item {{ height: 16px; }}