Marble

LegendWidget.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Bastian Holst <bastianholst@gmx.de>
4//
5
6// Self
7#include "LegendWidget.h"
8
9// Marble
10#include "MarbleModel.h"
11
12using namespace Marble;
13// Ui
14#ifdef MARBLE_NO_WEBKITWIDGETS
15#include "ui_NullLegendWidget.h"
16#else
17#include "ui_LegendWidget.h"
18#endif
19
20namespace Marble
21{
22
23class LegendWidgetPrivate : public Ui::LegendWidget
24{
25public:
26 LegendWidgetPrivate();
27};
28
29LegendWidgetPrivate::LegendWidgetPrivate() = default;
30
31LegendWidget::LegendWidget(QWidget *parent, Qt::WindowFlags f)
32 : QWidget(parent, f)
33 , d(new LegendWidgetPrivate)
34{
35 d->setupUi(this);
36 layout()->setContentsMargins({});
37 connect(d->m_marbleLegendBrowser, SIGNAL(tourLinkClicked(QString)), this, SIGNAL(tourLinkClicked(QString)));
38}
39
40LegendWidget::~LegendWidget()
41{
42 delete d;
43}
44
45void LegendWidget::setMarbleModel(MarbleModel *model)
46{
47 // Initialize the MarbleLegendBrowser
48 d->m_marbleLegendBrowser->setMarbleModel(model);
49
50 // connect signals for the Legend
51 connect(d->m_marbleLegendBrowser, SIGNAL(toggledShowProperty(QString, bool)), this, SIGNAL(propertyValueChanged(QString, bool)));
52}
53
54}
55
56#include "moc_LegendWidget.cpp"
This file contains the headers for MarbleModel.
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition MarbleModel.h:84
Binds a QML item to a specific geodetic location in screen coordinates.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
typedef WindowFlags
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void setupUi(QWidget *widget)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.