digiKam
wscomboboxintermediate.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 : 2009-07-05
7  * Description : A combobox which also has an intermediate state.
8  * This is akin to the intermediate state in a checkbox and
9  * needed when a single combobox controls more than one item,
10  * which are manually set to different states.
11  * The intermediate state is indicated by appending an extra item
12  * with a user specified text (default is "Various"). Whenever an
13  * other item is set, this special state is removed from the list
14  * so it can never be selected explicitly.
15  *
16  * Copyright (C) 2009 by Pieter Edelman <pieter dot edelman at gmx dot net>
17  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
18  *
19  * This program is free software; you can redistribute it
20  * and/or modify it under the terms of the GNU General
21  * Public License as published by the Free Software Foundation;
22  * either version 2, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * ============================================================ */
30 
31 #ifndef DIGIKAM_WS_COMBO_BOX_INTERMEDIATE_H
32 #define DIGIKAM_WS_COMBO_BOX_INTERMEDIATE_H
33 
34 // Qt includes
35 
36 #include <QComboBox>
37 #include <QString>
38 
39 // Local includes
40 
41 #include "digikam_export.h"
42 
43 namespace Digikam
44 {
45 
46 class DIGIKAM_EXPORT WSComboBoxIntermediate : public QComboBox
47 {
48  Q_OBJECT
49 
50 public:
51 
56  explicit WSComboBoxIntermediate(QWidget* const = nullptr, const QString& = QString());
57  ~WSComboBoxIntermediate() override;
58 
63  void setIntermediate(bool);
64 
65 private Q_SLOTS:
66 
67  void slotIndexChanged(int);
68 
69 private:
70 
71  class Private;
72  Private* const d;
73 };
74 
75 } // namespace Digikam
76 
77 #endif // DIGIKAM_WS_COMBO_BOX_INTERMEDIATE_H
Definition: wscomboboxintermediate.h:47
Definition: datefolderview.cpp:43