In this example, we retrieve the active vector layer in QGIS and cast it into a QgsVectorLayer object. We then use the geometryType property to retrieve the geometry type of the layer and display it in the console. Example 2: Create a new vector layer and set its geometry type.c++ QgsVectorLayer *vectorLayer = new QgsVectorLayer("Point?crs=epsg:4326", "myLayer", "memory"); vectorLayer->setGeometryType(QgsWkbTypes::Point); QgsProject::instance()->addMapLayer(vectorLayer); ``` In this example, we create a new vector layer with the "Point" geometry type and add it to the QGIS project. We use the setGeometryType method to set the geometry type of the layer. These examples use the QGIS library package.