Fix bug#633 - "bool of null QDate (possibly other empty QString/null QObj types?) returns True for empty instance; probably should be False"
This commit is contained in:
parent
9a4c439d7f
commit
286f9c6d09
2 changed files with 6 additions and 1 deletions
|
|
@ -156,7 +156,7 @@ if (NOT SITE_PACKAGE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
|
set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero)
|
||||||
|
|
||||||
add_subdirectory(libpyside)
|
add_subdirectory(libpyside)
|
||||||
if(QT_QTUITOOLS_FOUND AND QT_QTDESIGNER_FOUND)
|
if(QT_QTUITOOLS_FOUND AND QT_QTDESIGNER_FOUND)
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ class TestQDate (unittest.TestCase):
|
||||||
self.assertEqual(week, 52)
|
self.assertEqual(week, 52)
|
||||||
self.assertEqual(yearNumber, 1999)
|
self.assertEqual(yearNumber, 1999)
|
||||||
|
|
||||||
|
def testBooleanCast(self):
|
||||||
|
today = QDate.currentDate()
|
||||||
|
self.assertTrue(today)
|
||||||
|
nodate = QDate()
|
||||||
|
self.assertFalse(nodate)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue