diff --git a/openlp/core/ui/listpreviewwidget.py b/openlp/core/ui/listpreviewwidget.py index 94385dd91..ca04c9688 100644 --- a/openlp/core/ui/listpreviewwidget.py +++ b/openlp/core/ui/listpreviewwidget.py @@ -44,9 +44,7 @@ class ListPreviewWidget(QtGui.QTableWidget): One needs to call replace_service_manager_item() to make this widget display something. """ super(QtGui.QTableWidget, self).__init__(parent) - self.service_item = ServiceItem() - self.screen_ratio = screen_ratio - + # Set up the widget. self.setColumnCount(1) self.horizontalHeader().setVisible(False) self.setColumnWidth(0, parent.width()) @@ -55,6 +53,9 @@ class ListPreviewWidget(QtGui.QTableWidget): self.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.setAlternatingRowColors(True) + # Initialize variables. + self.service_item = ServiceItem() + self.screen_ratio = screen_ratio def resizeEvent(self, QResizeEvent): """ diff --git a/tests/utils/constants.py b/tests/utils/constants.py index 56a7a78ca..4b28fcc83 100644 --- a/tests/utils/constants.py +++ b/tests/utils/constants.py @@ -2,4 +2,4 @@ import os OPENLP_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), u'..', u'..')) -TEST_RESOURCES_PATH = os.path.join(OPENLP_PATH, u'tests', u'resources') \ No newline at end of file +TEST_RESOURCES_PATH = os.path.join(OPENLP_PATH, u'tests', u'resources')