QGIS API Documentation 4.1.0-Master (d6fb7a379fb)
Loading...
Searching...
No Matches
qgsgroupwmsdatadialog.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsscalevisibilitydialog.cpp
3 --------------------------------------
4 Date : 20.05.2014
5 Copyright : (C) 2014 Denis Rouzaud
7***************************************************************************
8* *
9* This program is free software; you can redistribute it and/or modify *
10* it under the terms of the GNU General Public License as published by *
11* the Free Software Foundation; either version 2 of the License, or *
12* (at your option) any later version. *
13* *
14***************************************************************************/
15
17
18#include "qgsgui.h"
20
21#include <QRegularExpressionValidator>
22
23#include "moc_qgsgroupwmsdatadialog.cpp"
24
25QgsGroupWmsDataDialog::QgsGroupWmsDataDialog( QWidget *parent, Qt::WindowFlags fl )
27{}
28
30 : QDialog( parent, fl )
31 , mServerProperties( std::make_unique<QgsMapLayerServerProperties>() )
32{
33 setupUi( this );
35
36 //init widgets
37 mGroupRequestModeCombo->addItem( tr( "Normal" ), QVariant::fromValue( Qgis::WmsGroupRequestMode::Normal ) );
38 mGroupRequestModeCombo->addItem( tr( "Opaque" ), QVariant::fromValue( Qgis::WmsGroupRequestMode::Opaque ) );
39
40 serverProperties.copyTo( mServerProperties.get() );
41
42 mMapLayerServerPropertiesWidget->setHasWfsTitle( false );
43 mMapLayerServerPropertiesWidget->setServerProperties( mServerProperties.get() );
44}
45
47{
48 mMapLayerServerPropertiesWidget->save();
49 return mServerProperties->shortName();
50}
51
52void QgsGroupWmsDataDialog::setGroupShortName( const QString &shortName )
53{
54 mServerProperties->setShortName( shortName );
55 mMapLayerServerPropertiesWidget->sync();
56}
57
59{
60 mMapLayerServerPropertiesWidget->save();
61 return mServerProperties->title();
62}
63
64void QgsGroupWmsDataDialog::setGroupTitle( const QString &title )
65{
66 mServerProperties->setTitle( title );
67 mMapLayerServerPropertiesWidget->sync();
68}
69
71{
72 mMapLayerServerPropertiesWidget->save();
73 return mServerProperties->abstract();
74}
75
76void QgsGroupWmsDataDialog::setGroupAbstract( const QString &abstract )
77{
78 mServerProperties->setAbstract( abstract );
79 mMapLayerServerPropertiesWidget->sync();
80}
81
83{
84 return mServerProperties.get();
85}
86
88{
89 return mServerProperties.get();
90}
91
93{
94 mMapLayerServerPropertiesWidget->save();
95 QDialog::accept();
96}
97
99{
100 return mComputeTimeDimension->checkState() == Qt::Checked;
101}
102
104{
105 mComputeTimeDimension->setCheckState( hasTimeDimension ? Qt::Checked : Qt::Unchecked );
106}
107
109{
110 return mGroupRequestModeCombo->currentData().value<Qgis::WmsGroupRequestMode>();
111}
112
114{
115 mGroupRequestModeCombo->setCurrentIndex( mGroupRequestModeCombo->findData( QVariant::fromValue( groupRequestMode ) ) );
116}
WmsGroupRequestMode
Request mode of groups in a WMS context.
Definition qgis.h:6764
@ Normal
Group and children can be requested.
Definition qgis.h:6765
@ Opaque
Group can be requested, children cannot (appears like a single layer).
Definition qgis.h:6766
void setHasTimeDimension(bool hasTimeDimension)
Sets whether the time dimension should be computed for this group or not.
bool hasTimeDimension() const
Returns whether the time dimension should be computed for this group or not.
Qgis::WmsGroupRequestMode groupRequestMode() const
Returns the request mode of the group.
void setGroupRequestMode(Qgis::WmsGroupRequestMode groupRequestMode)
Sets the request mode of the group.
Q_DECL_DEPRECATED void setGroupAbstract(const QString &abstract)
Sets group WMS abstract.
QgsGroupWmsDataDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Constructor.
Q_DECL_DEPRECATED void setGroupShortName(const QString &shortName)
Sets group WMS short name.
Q_DECL_DEPRECATED void setGroupTitle(const QString &title)
Sets group WMS title.
Q_DECL_DEPRECATED QString groupAbstract() const
Returns group WMS abstract.
Q_DECL_DEPRECATED QString groupTitle() const
Returns group WMS title.
Q_DECL_DEPRECATED QString groupShortName() const
Returns group WMS short name.
QgsMapLayerServerProperties * serverProperties()
Returns QGIS Server Properties for the layer tree group.
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
Definition qgsgui.cpp:224
Manages QGIS Server properties for a map layer.