Skip to content
Permalink
Browse files
Rebase 2
  • Loading branch information
elpaso committed Jul 6, 2021
1 parent 4201942 commit e1a8ef562512f2f0fb422e31e463236a9a91de9b
@@ -71,6 +71,7 @@ QgsQueryResultWidget::~QgsQueryResultWidget()
mApiFetcher->stopFetching();
mWorkerThread.quit();
mWorkerThread.wait();
mWorkerThread.deleteLater();
}
cancelRunningQuery();
}
@@ -94,7 +94,7 @@ void TestQgsQueryResultWidget::testWidgetCrash()
delete model;

// Test widget closed while fetching
auto d = qgis::make_unique<QDialog>( );
auto d = std::make_unique<QDialog>( );
QVBoxLayout *l = new QVBoxLayout();
QgsQueryResultWidget *w = new QgsQueryResultWidget( d.get(), makeConn() );
w->setQuery( QStringLiteral( "SELECT * FROM qgis_test.random_big_data" ) );
@@ -105,12 +105,14 @@ void TestQgsQueryResultWidget::testWidgetCrash()
QTimer::singleShot( 1, d.get(), [ & ] { exited = true; } );
while ( ! exited )
QgsApplication::processEvents();
// This prevents a crash in Qsci internal thread
std::this_thread::sleep_for( std::chrono::seconds( 1 ) );
}


void TestQgsQueryResultWidget::testWidget()
{
auto d = qgis::make_unique<QDialog>( );
auto d = std::make_unique<QDialog>( );
QVBoxLayout *l = new QVBoxLayout();
QgsQueryResultWidget *w = new QgsQueryResultWidget( d.get(), makeConn() );
w->setQuery( QStringLiteral( "SELECT * FROM qgis_test.random_big_data" ) );
@@ -135,7 +137,7 @@ void TestQgsQueryResultWidget::testWidgetInvalid()

void TestQgsQueryResultWidget::testCodeEditorApis()
{
auto w = qgis::make_unique<QgsQueryResultWidget>( nullptr, makeConn() );
auto w = std::make_unique<QgsQueryResultWidget>( nullptr, makeConn() );
bool exited = false;
connect( w->mApiFetcher, &QgsConnectionsApiFetcher::fetchingFinished, w.get(), [ & ] { exited = true; } );
while ( ! exited )
@@ -145,7 +147,7 @@ void TestQgsQueryResultWidget::testCodeEditorApis()
QVERIFY( w->mSqlEditor->fieldNames().contains( QStringLiteral( "descr" ) ) );

// Test feedback interrupt
w = qgis::make_unique<QgsQueryResultWidget>( nullptr, makeConn() );
w = std::make_unique<QgsQueryResultWidget>( nullptr, makeConn() );
QTimer::singleShot( 0, w.get(), [ & ]
{
QTest::mousePress( w->mStopButton, Qt::MouseButton::LeftButton );
@@ -380,7 +380,6 @@ if (ENABLE_PGTEST)
ADD_PYTHON_TEST(PyQgsImportIntoPostGIS test_processing_importintopostgis.py)
ADD_PYTHON_TEST(PyQgsVectorFileWriterPostgres test_qgsvectorfilewriter_postgres.py)
ADD_PYTHON_TEST(PyQgsQueryResultModel test_qgsqueryresultmodel.py)
ADD_PYTHON_TEST(PyQgsQueryResultWidget test_qgsqueryresultwidget.py)
ADD_PYTHON_TEST(PyQgsVectorLayerUtilsPostgres test_qgsvectorlayerutils_postgres.py)
ADD_PYTHON_TEST(PyQgsPostgresProvider test_provider_postgres.py)
ADD_PYTHON_TEST(PyQgsPostgresRasterProvider test_provider_postgresraster.py)
@@ -406,7 +405,7 @@ if (ENABLE_PGTEST)
SET_TESTS_PROPERTIES(PyQgsServerWMSGetFeatureInfoPG PyQgsServerAccessControlWMSGetPrintPG PyQgsServerAccessControlWMSGetMapPG
PROPERTIES LABELS "POSTGRES")
endif()
SET_TESTS_PROPERTIES(PyQgsImportIntoPostGIS PyQgsQueryResultWidget PyQgsQueryResultModel PyQgsVectorFileWriterPostgres PyQgsPostgresProvider
SET_TESTS_PROPERTIES(PyQgsImportIntoPostGIS PyQgsQueryResultModel PyQgsVectorFileWriterPostgres PyQgsPostgresProvider
PyQgsVectorLayerUtilsPostgres PyQgsPostgresRasterProvider PyQgsPostgresDomain PyQgsPostgresTransaction
PyQgsRelationEditWidget PyQgsRelationPostgres PyQgsVectorLayerTools PyQgsProjectStoragePostgres
PyQgsAuthManagerPKIPostgresTest PyQgsAuthManagerPasswordPostgresTest PyQgsAuthManagerOgrPostgresTest
@@ -104,7 +104,7 @@ def loop_exiter():
res = conn.execSql('SELECT * FROM qgis_test.random_big_data')

self.model = QgsQueryResultModel(res)
self.tester = QAbstractItemModelTester(model, QAbstractItemModelTester.FailureReportingMode.Warning)
self.tester = QAbstractItemModelTester(self.model, QAbstractItemModelTester.FailureReportingMode.Warning)

self.running = True

This file was deleted.

0 comments on commit e1a8ef5

Please sign in to comment.