swift
namevariantpairview.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_NAMEVARIANTPAIRVIEW_H
7 #define SWIFT_GUI_NAMEVARIANTPAIRVIEW_H
8 
9 #include <QString>
10 
12 #include "gui/swiftguiexport.h"
13 #include "gui/views/viewbase.h"
14 #include "misc/icon.h"
15 #include "misc/variant.h"
16 
17 namespace swift::misc
18 {
19  class CNameVariantPair;
20 }
21 namespace swift::gui::views
22 {
24  class SWIFT_GUI_EXPORT CNameVariantPairView : public CViewBase<models::CNameVariantPairModel>
25  {
26  Q_OBJECT
27 
28  public:
30  explicit CNameVariantPairView(QWidget *parent = nullptr);
31 
33  void setIconMode(bool withIcon);
34 
36  bool addOrUpdateByName(const QString &name, const swift::misc::CVariant &value,
37  const swift::misc::CIcon &icon = swift::misc::CIcon(), bool isResizeConditionMet = true,
38  bool skipEqualValues = true);
39 
41  void removeByName(const QString &name, bool isResizeConditionMet = true);
42 
44  bool containsName(const QString &name);
45  };
46 } // namespace swift::gui::views
47 #endif // SWIFT_GUI_NAMEVARIANTPAIRVIEW_H
Base class for views.
Definition: viewbase.h:648
Value object for icons. An icon is stored in the global icon repository and identified by its index....
Definition: icon.h:39
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Definition: variant.h:66
Views, mainly QTableView.
Free functions in swift::misc.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.