diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-11-08 15:38:39 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-11-08 15:38:39 +0100 |
commit | deb35230eb8ded52e9450cf1cc0aa218c62b9e02 (patch) | |
tree | e6570d9c9d2465ec0ccac7343282d45ec90e3350 /nephilim/plugin.py | |
parent | ded8496439c0a1bfa2d244470cbd99113b8e84be (diff) |
plugin: more pyqt5 port fixes
Diffstat (limited to 'nephilim/plugin.py')
-rw-r--r-- | nephilim/plugin.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nephilim/plugin.py b/nephilim/plugin.py index 6760868..f0ce498 100644 --- a/nephilim/plugin.py +++ b/nephilim/plugin.py @@ -104,8 +104,9 @@ class Plugin(QtCore.QObject): def _add_widget(self, widget, label = '', tooltip = ''): """adds a widget with label""" - if not self.layout(): - self.logger.error('Attempted to call add_widget with no layout set.') + if self.layout() is None: + raise ValueError('Attempted to call add_widget with no layout set.') + widget.setToolTip(tooltip) layout = QtWidgets.QHBoxLayout() layout.addWidget(QtWidgets.QLabel(label)) |