KTextWidgets

kpluralhandlingspinbox.h
1/*
2 SPDX-FileCopyrightText: 2014 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef KPLURALHANDLINGSPINBOX_H
8#define KPLURALHANDLINGSPINBOX_H
9
10#include <ktextwidgets_export.h>
11
12#if KTEXTWIDGETS_ENABLE_DEPRECATED_SINCE(6, 6)
13#include <KLocalizedString>
14
15#include <QSpinBox>
16
17#include <memory>
18
19/**
20 * @class KPluralHandlingSpinBox kpluralhandlingspinbox.h <KPluralHandlingSpinBox>
21 *
22 * @brief A QSpinBox with plural handling for the suffix.
23 *
24 * @author Laurent Montel <montel@kde.org>
25 *
26 * @since 5.0
27 * @deprecated since 6.6, use KLocalization::setupSpinBoxFormatString() from KF6::I18n instead,
28 * which is more powerful and does not require inheriting from a specific QSpinBox subclass.
29 */
30KTEXTWIDGETS_DEPRECATED_VERSION(6, 6, "use KLocalization::setupSpinBoxFormatString() from KF6::I18n instead")
31class KTEXTWIDGETS_EXPORT KPluralHandlingSpinBox : public QSpinBox
32{
33 Q_OBJECT
34public:
35 /**
36 * Default constructor
37 */
38
39 explicit KPluralHandlingSpinBox(QWidget *parent = nullptr);
40 ~KPluralHandlingSpinBox() override;
41
42 /**
43 * Sets the suffix to @p suffix.
44 * Use this to add a plural-aware suffix, e.g. by using ki18np("singular", "plural").
45 */
46 void setSuffix(const KLocalizedString &suffix);
47
48private:
49 friend class KPluralHandlingSpinBoxPrivate;
50 std::unique_ptr<class KPluralHandlingSpinBoxPrivate> const d;
51
52 Q_DISABLE_COPY(KPluralHandlingSpinBox)
53};
54#endif
55
56#endif // KPLURALHANDLINGSPINBOX_H
A QSpinBox with plural handling for the suffix.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:49:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.