Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
address Nyall's comments:
 - add TransferThis to parent argument
 - QSignalSpy always available with Qt5
  • Loading branch information
alexbruy committed Apr 8, 2017
1 parent 4a4b318 commit fc4ce3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion python/gui/qgscheckablecombobox.sip
Expand Up @@ -23,7 +23,7 @@ class QgsCheckableComboBox : QComboBox

public:

QgsCheckableComboBox( QWidget *parent = 0 );
QgsCheckableComboBox( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsCheckableComboBox.
\param parent parent object
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgscheckablecombobox.h
Expand Up @@ -124,7 +124,7 @@ class GUI_EXPORT QgsCheckableComboBox : public QComboBox
/** Constructor for QgsCheckableComboBox.
* \param parent parent object
*/
QgsCheckableComboBox( QWidget *parent = nullptr );
QgsCheckableComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );

/** Returns separator used to separate items in the display text.
* \see setSeparator()
Expand Down
10 changes: 2 additions & 8 deletions tests/src/python/test_qgscheckablecombobox.py
Expand Up @@ -15,14 +15,9 @@
import qgis # NOQA

from qgis.PyQt.QtCore import Qt
from qgis.gui import QgsCheckableComboBox

try:
from qgis.PyQt.QtTest import QSignalSpy
use_signal_spy = True
except:
use_signal_spy = False
from qgis.PyQt.QtTest import QSignalSpy

from qgis.gui import QgsCheckableComboBox
from qgis.testing import start_app, unittest

start_app()
Expand Down Expand Up @@ -51,7 +46,6 @@ def testGettersSetters(self):
w.setItemCheckState(2, Qt.Unchecked)
self.assertEqual(w.itemCheckState(2), Qt.Unchecked)

@unittest.skipIf(not use_signal_spy, "No QSignalSpy available")
def test_ChangedSignals(self):
""" test that signals are correctly emitted when clearing"""

Expand Down

0 comments on commit fc4ce3c

Please sign in to comment.