digiKam
Loading...
Searching...
No Matches
dcombobox.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2008-08-16
7 * Description : a combo box widget re-implemented with a
8 * reset button to switch to a default item
9 *
10 * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18// Qt includes
19
20#include <QWidget>
21#include <QComboBox>
22#include <QVariant>
23
24// Local includes
25
26#include "digikam_export.h"
27
28namespace Digikam
29{
30
31class DIGIKAM_EXPORT DComboBox : public QWidget
32{
33
34 Q_OBJECT
35
36public:
37
38 explicit DComboBox(QWidget* const parent = nullptr);
39 ~DComboBox() override;
40
41 void setCurrentIndex(int d);
42 int currentIndex() const;
43
44 void setDefaultIndex(int d);
45 int defaultIndex() const;
46
47 QComboBox* combo() const;
48
49 void addItem(const QString& t,
50 const QVariant& data = QVariant());
51 void insertItem(int index, const QString& t,
52 const QVariant& data = QVariant());
53
54Q_SIGNALS:
55
56 void reset();
57 void activated(int);
59
60public Q_SLOTS:
61
62 void slotReset();
63
64private Q_SLOTS:
65
66 void slotItemActivated(int);
67 void slotCurrentIndexChanged(int);
68
69private:
70
71 class Private;
72 Private* const d = nullptr;
73};
74
75} // namespace Digikam
Definition dcombobox.h:32
void currentIndexChanged(int)
Definition datefolderview.cpp:34