QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgs3dsymbolwidget.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgs3dsymbolwidget.cpp
3
--------------------------------------
4
Date : July 2020
5
Copyright : (C) 2020 by Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
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
16
#include "
qgs3dsymbolwidget.h
"
17
18
#include "
qgs3dsymbolregistry.h
"
19
#include "
qgsabstract3dsymbol.h
"
20
#include "
qgsapplication.h
"
21
#include "
qgsgui.h
"
22
#include "
qgshelp.h
"
23
24
#include <QDialogButtonBox>
25
#include <QString>
26
#include <QVBoxLayout>
27
28
#include "moc_qgs3dsymbolwidget.cpp"
29
30
using namespace
Qt::StringLiterals;
31
32
Qgs3DSymbolWidget::Qgs3DSymbolWidget
( QWidget *parent )
33
:
QgsPanelWidget
( parent )
34
{}
35
36
Qgs3DSymbolDialog::Qgs3DSymbolDialog
(
const
QgsAbstract3DSymbol
*
symbol
, QWidget *parent )
37
: QDialog( parent )
38
{
39
Q_ASSERT(
symbol
);
40
41
QgsGui::enableAutoGeometryRestore
(
this
);
42
43
QVBoxLayout *vLayout =
new
QVBoxLayout();
44
45
if
(
Qgs3DSymbolAbstractMetadata
*metadata =
QgsApplication::symbol3DRegistry
()->symbolMetadata(
symbol
->type() ) )
46
{
47
mWidget = metadata->createSymbolWidget(
nullptr
);
48
vLayout->addWidget( mWidget );
49
mWidget->setSymbol(
symbol
,
nullptr
);
50
}
51
52
mButtonBox =
new
QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
53
connect( mButtonBox, &QDialogButtonBox::accepted,
this
, &QDialog::accept );
54
connect( mButtonBox, &QDialogButtonBox::rejected,
this
, &QDialog::reject );
55
connect( mButtonBox, &QDialogButtonBox::helpRequested,
this
, [] {
QgsHelp::openHelp
( u
"style_library/3d_symbols.html"
_s ); } );
56
vLayout->addStretch();
57
vLayout->addWidget( mButtonBox );
58
setLayout( vLayout );
59
setWindowTitle( tr(
"3D Symbol"
) );
60
}
61
62
QgsAbstract3DSymbol
*
Qgs3DSymbolDialog::symbol
()
const
63
{
64
return
mWidget ? mWidget->symbol() :
nullptr
;
65
}
66
67
QDialogButtonBox *
Qgs3DSymbolDialog::buttonBox
()
const
68
{
69
return
mButtonBox;
70
}
Qgs3DSymbolAbstractMetadata
Stores metadata about one 3D symbol class.
Definition
qgs3dsymbolregistry.h:42
Qgs3DSymbolDialog::symbol
QgsAbstract3DSymbol * symbol() const
Returns a new instance of the symbol defined by the dialog.
Definition
qgs3dsymbolwidget.cpp:62
Qgs3DSymbolDialog::buttonBox
QDialogButtonBox * buttonBox() const
Returns a reference to the dialog's button box.
Definition
qgs3dsymbolwidget.cpp:67
Qgs3DSymbolDialog::Qgs3DSymbolDialog
Qgs3DSymbolDialog(const QgsAbstract3DSymbol *symbol, QWidget *parent=nullptr)
Constructor for Qgs3DSymbolDialog, initially showing the specified symbol.
Definition
qgs3dsymbolwidget.cpp:36
Qgs3DSymbolWidget::Qgs3DSymbolWidget
Qgs3DSymbolWidget(QWidget *parent)
Constructor for Qgs3DSymbolWidget with the specified parent widget.
Definition
qgs3dsymbolwidget.cpp:32
QgsAbstract3DSymbol
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Definition
qgsabstract3dsymbol.h:48
QgsApplication::symbol3DRegistry
static Qgs3DSymbolRegistry * symbol3DRegistry()
Returns registry of available 3D symbols.
Definition
qgsapplication.cpp:2764
QgsGui::enableAutoGeometryRestore
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:225
QgsHelp::openHelp
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Definition
qgshelp.cpp:41
QgsPanelWidget::QgsPanelWidget
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
Definition
qgspanelwidget.cpp:30
qgs3dsymbolregistry.h
qgs3dsymbolwidget.h
qgsabstract3dsymbol.h
qgsapplication.h
qgsgui.h
qgshelp.h
Generated on
for QGIS API Documentation by
1.17.0