I am using PyQGIS API
for developing the standalone application to load the certain VectorLayers
. I used the QgsMapCanvas
to load the map and QgsLayerTreeView
to show the layer tree view using code below-
# Layer Tree View
self.layerTreeRoot = QgsProject.instance().layerTreeRoot()
self.layerTreeModel = QgsLayerTreeModel(self.layerTreeRoot)
self.layerTreeView = QgsLayerTreeView()
self.layerTreeView.setModel(self.layerTreeModel)
self.layoutWidgetLayout = QHBoxLayout()
self.layoutWidgetLayout.addWidget(self.layerTreeView)
self.layerWidget.setLayout(self.layoutWidgetLayout)
Now I want to style the layer and change some behaviors of the style using Layer Properties. How can I get that LayerPropertiesWindow
by context menu of Layer as below.