QCAD
Open Source 2D CAD
RLinetypeComboDelegate.h
Go to the documentation of this file.
1 
20 #ifndef RLINETYPECOMBODELEGATE_H_
21 #define RLINETYPECOMBODELEGATE_H_
22 
23 #include "gui_global.h"
24 
25 #include <QStyledItemDelegate>
26 
27 #include "RLinetypePattern.h"
28 
32 class QCADGUI_EXPORT RLinetypeComboDelegate: public QStyledItemDelegate {
33 public:
34  RLinetypeComboDelegate(QObject* parent);
35 
36  void paint(QPainter* painter,
37  const QStyleOptionViewItem& option, const QModelIndex& index) const;
38  QSize sizeHint(const QStyleOptionViewItem& option,
39  const QModelIndex& index) const;
40 
41  QImage getPreviewImage(const RLinetypePattern& pattern, int width) const;
42 
43 private:
44  static int previewHeight;
45  mutable QMap<int, QMap<QString, QImage> > previewCache;
46 };
47 
49 
50 #endif
#define QCADGUI_EXPORT
Definition: gui_global.h:10
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RLinetypePattern.h:45
static int previewHeight
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RLinetypeComboDelegate.h:44
Q_DECLARE_METATYPE(RMath *)
QMap< int, QMap< QString, QImage > > previewCache
Definition: RLinetypeComboDelegate.h:45
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RLinetypeComboDelegate.h:32