SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
SVGIconEngine.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 
11 #ifndef smtk_extension_SVGIconEngine_h
12 #define smtk_extension_SVGIconEngine_h
13 
14 #include "smtk/PublicPointerDefs.h"
15 #include "smtk/extension/qt/Exports.h" // For EXPORT macro.
16 #include "smtk/view/DescriptivePhrase.h"
17 #include "smtk/view/PhraseModel.h"
18 #include "smtk/view/PhraseModelObserver.h"
19 
20 #include <QByteArray>
21 #include <QIcon>
22 #include <QIconEngine>
23 
24 #include <map>
25 
26 namespace smtk
27 {
28 namespace extension
29 {
30 
36 class SMTKQTEXT_EXPORT SVGIconEngine : public QIconEngine
37 {
38 public:
39  explicit SVGIconEngine(const std::string& iconBuffer);
40  void paint(QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state) override;
41  QIconEngine* clone() const override;
42  QPixmap pixmap(const QSize& size, QIcon::Mode mode, QIcon::State state) override;
43 
44 protected:
45  QByteArray data;
46 };
47 
48 } // namespace extension
49 } // namespace smtk
50 
51 #endif // smtk_extension_SVGIconEngine_h
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
PublicPointerDefs.h
smtk::task::State
State
The set of states that a task may take on.
Definition: State.h:29
smtk::extension::SVGIconEngine
A class to render SVG into a QIcon.
Definition: SVGIconEngine.h:36