GammaRay  2.3.0
propertywidgettab.h
1 /*
2  propertywidgettab.h
3 
4  This file is part of GammaRay, the Qt application inspection and
5  manipulation tool.
6 
7  Copyright (C) 2014-2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
8  Author: Anton Kreuzkamp <anton.kreuzkamp@kdab.com>
9 
10  Licensees holding valid commercial KDAB GammaRay licenses may use this file in
11  accordance with GammaRay Commercial License Agreement provided with the Software.
12 
13  Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 
15  This program is free software; you can redistribute it and/or modify
16  it under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 2 of the License, or
18  (at your option) any later version.
19 
20  This program is distributed in the hope that it will be useful,
21  but WITHOUT ANY WARRANTY; without even the implied warranty of
22  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  GNU General Public License for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with this program. If not, see <http://www.gnu.org/licenses/>.
27 */
28 
29 #ifndef PROPERTYWIDGETTAB_H
30 #define PROPERTYWIDGETTAB_H
31 
32 #include <QWidget>
33 #include <QString>
34 
35 namespace GammaRay {
36 
37 class PropertyWidget;
38 
41 {
42  public:
43  explicit PropertyWidgetTabFactoryBase() {}
44  virtual QWidget *createWidget(PropertyWidget *parent) = 0;
45  virtual const QString &name() const = 0;
46  virtual const QString &label() const = 0;
47 };
48 
50 template <typename T>
52 {
53  public:
54  explicit PropertyWidgetTabFactory(const QString &name, const QString &label)
55  : m_name(name),
56  m_label(label)
57  {
58  }
59  QWidget *createWidget(PropertyWidget *parent)
60  {
61  return new T(parent);
62  }
63  const QString &name() const
64  {
65  return m_name;
66  }
67  const QString &label() const
68  {
69  return m_label;
70  }
71  private:
72  QString m_name;
73  QString m_label;
74 };
75 
76 }
77 
78 #endif // PROPERTYWIDGETTAB_H
Template implementation of PropertyWidgetTabFactoryBase.
Definition: propertywidgettab.h:51
Interface for tabs in the property widget.
Definition: propertywidgettab.h:40
Definition: endpoint.h:41
Client-side counter-part GammaRay::PropertyController.
Definition: propertywidget.h:50

Klarälvdalens Datakonsult AB (KDAB)
"The Qt Experts"
http://www.kdab.com/
GammaRay
Qt-application inspection and manipulation tool
http://www.kdab.com/kdab-products/gammaray/