Skip to content
Permalink
Browse files
remove redundant class qgsquickutils
  • Loading branch information
tomasMizera authored and github-actions committed Dec 20, 2021
1 parent c88ea90 commit 1d29e7ad763538f176a1ea2f3275139068f66dd0
@@ -5,15 +5,13 @@ set(QGIS_QUICK_GUI_MOC_HDRS
qgsquickmapcanvasmap.h
qgsquickmapsettings.h
qgsquickmaptransform.h
qgsquickutils.h
)

set(QGIS_QUICK_GUI_SRC
qgsquickcoordinatetransformer.cpp
qgsquickmapcanvasmap.cpp
qgsquickmapsettings.cpp
qgsquickmaptransform.cpp
qgsquickutils.cpp
)

include_directories(
@@ -35,14 +35,6 @@
#include "qgsquickmapsettings.h"
#include "qgsquickmaptransform.h"
#include "qgsquickplugin.h"
#include "qgsquickutils.h"

static QObject *_utilsProvider( QQmlEngine *engine, QJSEngine *scriptEngine )
{
Q_UNUSED( engine )
Q_UNUSED( scriptEngine )
return new QgsQuickUtils(); // the object will be owned by QML engine and destroyed by the engine on exit
}

void QgsQuickPlugin::registerTypes( const char *uri )
{
@@ -66,7 +58,4 @@ void QgsQuickPlugin::registerTypes( const char *uri )
qmlRegisterType< QgsQuickMapSettings >( uri, 0, 1, "MapSettings" );
qmlRegisterType< QgsQuickMapTransform >( uri, 0, 1, "MapTransform" );
qmlRegisterType< QgsVectorLayer >( uri, 0, 1, "VectorLayer" );

qmlRegisterSingletonType< QgsQuickUtils >( uri, 0, 1, "Utils", _utilsProvider );
}

This file was deleted.

This file was deleted.

@@ -32,7 +32,7 @@ include_directories(SYSTEM
#############################################################
# Tests:

add_qgis_test(testqgsquickutils.cpp MODULE quick LINKEDLIBRARIES qgis_quick)
add_qgis_test(testqgsquickmapsettings.cpp MODULE quick LINKEDLIBRARIES qgis_quick)

#############################################################
# Add also test application
@@ -1,5 +1,5 @@
/***************************************************************************
testqgsquickutils.cpp
testqgsquickmapsettings.cpp
--------------------------------------
Date : Nov 2017
Copyright : (C) 2017 by Peter Petrik
@@ -17,33 +17,28 @@
#include <QDesktopWidget>

#include "qgsapplication.h"
#include "qgscoordinatereferencesystem.h"
#include "qgscoordinatetransformcontext.h"
#include "qgspoint.h"
#include "qgspointxy.h"
#include "qgstest.h"
#include "qgis.h"
#include "qgsunittypes.h"

#include "qgsquickutils.h"
#include "qgsquickmapsettings.h"

class TestQgsQuickUtils: public QObject
class TestQgsQuickSettings: public QObject
{
Q_OBJECT
private slots:
void init() {} // will be called before each testfunction is executed.
void cleanup() {} // will be called after every testfunction.

void screen_density();
private:
QgsQuickUtils utils;
void test_project_existency();
};

void TestQgsQuickUtils::screen_density()
void TestQgsQuickMapSettings::test_project_existency()
{
qreal dp = utils.screenDensity();
QVERIFY( ( dp > 0 ) && ( dp < 1000 ) );
QgsQuickMapSettings *settings = new QgsQuickMapSettings();
QVERIFY( !settings->project() );
delete settings;
}

QGSTEST_MAIN( TestQgsQuickUtils )
#include "testqgsquickutils.moc"
QGSTEST_MAIN( TestQgsQuickMapSettings )
#include "testqgsquickmapsettings.moc"

0 comments on commit 1d29e7a

Please sign in to comment.