void BarlowsDataMapper::teardownConnections()
{
	disconnect(widget->addBarlowButton, SIGNAL(clicked()), this, SLOT(insertNewBarlow()));
	disconnect(widget->deleteBarlowButton, SIGNAL(clicked()), this, SLOT(deleteSelectedBarlow()));
	disconnect(widget->barlowsListView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(barlowSelected(const QModelIndex &)));
	disconnect(widget->barlowsListView->selectionModel() , SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), 
			this, SLOT(barlowSelected(QModelIndex)));
	disconnect(widget->modelLineEdit, SIGNAL(editingFinished()), this, SLOT(modelChanged()));
	disconnect(widget->vendorLineEdit, SIGNAL(editingFinished()), this, SLOT(vendorChanged()));
	disconnect(widget->factorLineEdit, SIGNAL(editingFinished()), this, SLOT(factorChanged()));
}
Beispiel #2
0
    void properties()
    {
        // GIVEN
        Qt3DRender::QGraphicsApiFilter apiFilter;

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(apiChanged(Qt3DRender::QGraphicsApiFilter::Api)));
            apiFilter.setApi(Qt3DRender::QGraphicsApiFilter::OpenGL);

            // THEN
            QCOMPARE(apiFilter.api(), Qt3DRender::QGraphicsApiFilter::OpenGL);
            bool shouldEmitSignal = (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL);
            QCOMPARE(spy.isEmpty(), !shouldEmitSignal);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(profileChanged(Qt3DRender::QGraphicsApiFilter::OpenGLProfile)));
            apiFilter.setProfile(Qt3DRender::QGraphicsApiFilter::CoreProfile);

            // THEN
            QCOMPARE(apiFilter.profile(), Qt3DRender::QGraphicsApiFilter::CoreProfile);
            QCOMPARE(spy.count(), 1);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(majorVersionChanged(int)));
            apiFilter.setMajorVersion(4);

            // THEN
            QCOMPARE(apiFilter.majorVersion(), 4);
            QCOMPARE(spy.count(), 1);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(minorVersionChanged(int)));
            apiFilter.setMinorVersion(5);

            // THEN
            QCOMPARE(apiFilter.minorVersion(), 5);
            QCOMPARE(spy.count(), 1);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(extensionsChanged(QStringList)));
            const auto extensions = (QStringList() << QLatin1String("extension1") << QLatin1String("extension2"));
            apiFilter.setExtensions(extensions);

            // THEN
            QCOMPARE(apiFilter.extensions(), extensions);
            QCOMPARE(spy.count(), 1);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(vendorChanged(QString)));
            const QLatin1String vendor("Triangles McTriangleFace");
            apiFilter.setVendor(vendor);

            // THEN
            QCOMPARE(apiFilter.vendor(), vendor);
            QCOMPARE(spy.count(), 1);
        }
    }