27#include <QDesktopServices>
34#include "moc_qgstiledscenelayerproperties.cpp"
36using namespace Qt::StringLiterals;
47 connect( buttonBox, &QDialogButtonBox::helpRequested,
this, &QgsTiledSceneLayerProperties::showHelp );
51 mScaleRangeWidget->setMapCanvas(
mCanvas );
52 chkUseScaleDependentRendering->setChecked( mLayer->hasScaleBasedVisibility() );
53 mScaleRangeWidget->setScaleRange( mLayer->minimumScale(), mLayer->maximumScale() );
60 mOptsPage_Information->setContentsMargins( 0, 0, 0, 0 );
62 QVBoxLayout *layout =
new QVBoxLayout( metadataFrame );
63 layout->setContentsMargins( 0, 0, 0, 0 );
64 metadataFrame->setContentsMargins( 0, 0, 0, 0 );
66 mMetadataWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
67 mMetadataWidget->setMapCanvas(
mCanvas );
68 layout->addWidget( mMetadataWidget );
69 metadataFrame->setLayout( layout );
70 mOptsPage_Metadata->setContentsMargins( 0, 0, 0, 0 );
78 if ( !settings.
contains( u
"/Windows/TiledSceneLayerProperties/tab"_s ) )
83 mBtnStyle =
new QPushButton( tr(
"Style" ) );
84 QMenu *menuStyle =
new QMenu(
this );
87 menuStyle->addSeparator();
91 connect( menuStyle, &QMenu::aboutToShow,
this, &QgsTiledSceneLayerProperties::aboutToShowStyleMenu );
93 buttonBox->addButton(
mBtnStyle, QDialogButtonBox::ResetRole );
95 mBtnMetadata =
new QPushButton( tr(
"Metadata" ),
this );
96 QMenu *menuMetadata =
new QMenu(
this );
99 menuMetadata->addSeparator();
104 buttonBox->addButton(
mBtnMetadata, QDialogButtonBox::ResetRole );
108 mOptsPage_Information->setProperty(
"helpPage", u
"working_with_point_clouds/point_clouds.html#information-properties"_s );
109 mOptsPage_Source->setProperty(
"helpPage", u
"working_with_point_clouds/point_clouds.html#source-properties"_s );
110 mOptsPage_Rendering->setProperty(
"helpPage", u
"working_with_point_clouds/point_clouds.html#rendering-properties"_s );
111 mOptsPage_Metadata->setProperty(
"helpPage", u
"working_with_point_clouds/point_clouds.html#metadata-properties"_s );
114 mBackupCrs = mLayer->crs();
121 mMetadataWidget->acceptMetadata();
123 mLayer->setName( mLayerOrigNameLineEdit->text() );
125 mLayer->setScaleBasedVisibility( chkUseScaleDependentRendering->isChecked() );
126 mLayer->setMinimumScale( mScaleRangeWidget->minimumScale() );
127 mLayer->setMaximumScale( mScaleRangeWidget->maximumScale() );
129 mBackupCrs = mLayer->crs();
134 mLayer->triggerRepaint();
139 if ( mBackupCrs != mLayer->crs() )
140 mLayer->setCrs( mBackupCrs );
148 mLayerOrigNameLineEdit->setText( mLayer->name() );
152 myStyle.append( u
"body { margin: 10px; }\n "_s );
153 mInformationTextBrowser->clear();
154 mInformationTextBrowser->document()->setDefaultStyleSheet( myStyle );
155 mInformationTextBrowser->setHtml( mLayer->htmlMetadata() );
156 mInformationTextBrowser->setOpenLinks(
false );
159 mCrsSelector->setCrs( mLayer->crs() );
162 w->syncToLayer( mLayer );
165void QgsTiledSceneLayerProperties::aboutToShowStyleMenu()
167 QMenu *m = qobject_cast<QMenu *>( sender() );
175void QgsTiledSceneLayerProperties::showHelp()
177 const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property(
"helpPage" );
179 if ( helpPage.isValid() )
194 mLayer->setCrs( crs );
195 mMetadataWidget->crsChanged();
static QString reportStyleSheet(QgsApplication::StyleSheetType styleSheetType=QgsApplication::StyleSheetType::Qt)
Returns a css style sheet for reports, the styleSheetType argument determines what type of stylesheet...
Represents a coordinate reference system (CRS).
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
QPushButton * mBtnStyle
Style button.
void saveMetadataToFile()
Allows the user to save the layer's metadata as a file.
virtual void rollback()
Rolls back changes made to the layer.
void saveStyleAsDefault()
Saves the current layer style as the default for the layer.
QList< QgsMapLayerConfigWidget * > mConfigWidgets
Layer config widgets.
void setMetadataWidget(QgsMetadataWidget *widget, QWidget *page)
Sets the metadata widget and page associated with the dialog.
void loadDefaultStyle()
Reloads the default style for the layer.
void saveStyleToFile()
Allows the user to save the layer's style to a file.
QgsMapCanvas * mCanvas
Associated map canvas.
void loadDefaultMetadata()
Reloads the default layer metadata for the layer.
QgsLayerPropertiesDialog(QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsSettings *settings=nullptr)
Constructor for QgsLayerPropertiesDialog.
void loadMetadataFromFile()
Allows the user to load layer metadata from a file.
void loadStyleFromFile()
Allows the user to load layer style from a file.
QPushButton * mBtnMetadata
Metadata button.
void initialize()
Initialize the dialog.
void saveMetadataAsDefault()
Saves the current layer metadata as the default for the layer.
void openUrl(const QUrl &url)
Handles opening a url from the dialog.
Map canvas is a class for displaying all GIS data types on a canvas.
void removesExtraMenuSeparators(QMenu *m)
removes extra separators from the menu
void addStyleManagerActions(QMenu *m, QgsMapLayer *layer)
adds actions to the menu in accordance to the layer
static QgsMapLayerStyleGuiUtils * instance()
returns a singleton instance of this class
A bar for displaying non-blocking messages to the user.
QStackedWidget * mOptStackedWidget
void initOptionsBase(bool restoreUi=true, const QString &title=QString())
Set up the base ui connections for vertical tabs.
static QgsProject * instance()
Returns the QgsProject singleton instance.
Stores settings for use within QGIS.
bool contains(const QString &key, QgsSettings::Section section=QgsSettings::NoSection) const
Returns true if there exists a setting called key; returns false otherwise.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
QgsTiledSceneLayerProperties(QgsTiledSceneLayer *layer, QgsMapCanvas *canvas, QgsMessageBar *messageBar, QWidget *parent=nullptr, Qt::WindowFlags=QgsGuiUtils::ModalDialogFlags)
Constructor.
Represents a map layer supporting display of tiled scene objects.