Fix bug#252.
Reviewer: Renato Araújo <renato.filho@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
c62c36a64d
commit
cb7d3e95a2
2 changed files with 15 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ void DeleteQApplicationAtExit() {
|
||||||
if (QApplication::instance()) {
|
if (QApplication::instance()) {
|
||||||
//disconnect and decref all widgets used on signals before destroy qApp
|
//disconnect and decref all widgets used on signals before destroy qApp
|
||||||
PySide::SignalManager::instance().clear();
|
PySide::SignalManager::instance().clear();
|
||||||
delete QApplication::instance();
|
QApplication::instance()->deleteLater();
|
||||||
for (int i = 0; i < QApplicationArgCount; ++i)
|
for (int i = 0; i < QApplicationArgCount; ++i)
|
||||||
delete[] QApplicationArgValues[i];
|
delete[] QApplicationArgValues[i];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,12 @@ import unittest
|
||||||
|
|
||||||
from PySide import QtSql
|
from PySide import QtSql
|
||||||
from PySide.QtCore import *
|
from PySide.QtCore import *
|
||||||
|
from PySide.QtGui import *
|
||||||
|
|
||||||
|
class Foo(QWidget):
|
||||||
|
def __init__(self):
|
||||||
|
QWidget.__init__(self)
|
||||||
|
self.model = QtSql.QSqlTableModel()
|
||||||
|
|
||||||
class SqlDatabaseCreationDestructionAndQueries(unittest.TestCase):
|
class SqlDatabaseCreationDestructionAndQueries(unittest.TestCase):
|
||||||
'''Test cases for QtSql database creation, destruction and queries'''
|
'''Test cases for QtSql database creation, destruction and queries'''
|
||||||
|
|
@ -51,6 +57,14 @@ class SqlDatabaseCreationDestructionAndQueries(unittest.TestCase):
|
||||||
lastname = query.value(0)
|
lastname = query.value(0)
|
||||||
self.assertEqual(lastname, 'Harrison')
|
self.assertEqual(lastname, 'Harrison')
|
||||||
|
|
||||||
|
def testTableModelDeletion(self):
|
||||||
|
app = QApplication([])
|
||||||
|
|
||||||
|
bar = Foo()
|
||||||
|
model = bar.model
|
||||||
|
del bar
|
||||||
|
del app
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue