VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
treeWidget.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
8 
9 #pragma once
10 
13 
15 
16 #include <QtWidgets/QTreeWidget>
17 #include <QtGui/QKeyEvent>
18 
19 #include <vlutil/vlPerformanceStats.h>
20 
21 class QMimeData;
22 
23 namespace makVrv
24 {
25  class DtDe;
26 }
27 
28 namespace makVrf
29 {
31  static const int DtUserRoleForDoubleClickEdit = Qt::UserRole + 100;
32 
34  {
35  Q_OBJECT
36 
37  public:
39  DtTreeWidget(makVrv::DtDe& de, QWidget* parent);
40 
42  virtual ~DtTreeWidget();
43 
45  virtual QTreeWidgetItem* lastItem() const;
46 
48  QTreeWidgetItem* itemFromIndex(const QModelIndex& idx) { return QTreeWidget::itemFromIndex(idx); };
49 
51  QModelIndex indexFromItem(QTreeWidgetItem *item, int column = 0) const
52  {
53  return QTreeWidget::indexFromItem(item, column);
54  }
55 
57  virtual void setMinimumSizeHint(const QSize&);
58  virtual QSize minimumSizeHint() const;
59 
61  virtual void setSizeHint(const QSize& s) { mySizeHint = s; };
62 
64  virtual int indexOfChild(QTreeWidgetItem*) const;
65 
67  unsigned int depth(QTreeWidgetItem*) const;
68 
70  QTreeWidgetItem* nextSibling(QTreeWidgetItem*) const;
71 
73  void setAllowEmptySelection(bool);
74 
76  bool allowEmptySelection() const;
77 
79  virtual bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event);
80  virtual void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint);
81 
82  virtual void itemRightClickedOn(QTreeWidgetItem*, QMouseEvent*, int col);
83 
85  virtual void mousePressEvent(QMouseEvent *event);
86 
88  virtual void mouseDoubleClickEvent(QMouseEvent *event);
89 
91  virtual void mouseReleaseEvent(QMouseEvent *event);
92 
93  virtual void itemLeftClickedOn(QTreeWidgetItem*, QMouseEvent*, int);
94 
95  virtual bool editingCanceled() const { return myEditingCanceled; };
96 
99  virtual void setAllowWindowsStyleNameEdit(bool);
101  {
102  return myAllowWindowsStyleNameEdit;
103  }
104 
106  virtual void setDisableNameEditIfNotWindowsStyleEdit(bool);
108  {
109  return myDisableNameEditIfNotWindowsStyleEnabled;
110  }
111 
112  virtual void setEditPressTime(double);
113  double editPressTime() const
114  {
115  return myEditPressTime;
116  }
118 
119  signals:
120 
123  void mouseLeftPressed(QTreeWidgetItem*, QMouseEvent*, int col);
124 
126  void rightClickOnItem(QTreeWidgetItem*, QMouseEvent*, int col);
127 
129  void contentsMoving(int, int);
130 
131  protected slots:
132  virtual void checkForEdit();
133 
134  protected:
135 
137  virtual void scrollContentsBy(int, int);
138 
140  virtual QSize sizeHint() const;
141 
143  virtual QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex &index,
144  const QEvent *event = 0) const;
145 
147  virtual QItemSelectionModel::SelectionFlags selectionBehaviorFlags() const;
148 
149  protected:
150 
158  QSize mySizeHint;
163  };
164 
166  {
168  }
169 
171  {
172  return myAllowEmptySelection;
173  }
174 }
QModelIndex indexFromItem(QTreeWidgetItem *item, int column=0) const
Definition: treeWidget.h:51
Definition: treeWidget.h:33
bool myDisableNameEditIfNotWindowsStyleEnabled
Definition: treeWidget.h:162
QSize mySizeHint
Definition: treeWidget.h:158
bool allowWindowsStyleNameEdit() const
Definition: treeWidget.h:100
makVrv::DtDe & myDe
Definition: treeWidget.h:155
QTreeWidgetItem * itemFromIndex(const QModelIndex &idx)
Definition: treeWidget.h:48
bool myNextReleaseMightBeEdit
Definition: treeWidget.h:159
virtual void setSizeHint(const QSize &s)
Sets the size hint in absence of minimum size.
Definition: treeWidget.h:61
bool allowEmptySelection() const
Definition: treeWidget.h:170
double myEditPressTime
Definition: treeWidget.h:154
bool myMouseRightClick
Definition: treeWidget.h:151
bool myLastEditEventWasDoubleClick
Definition: treeWidget.h:161
bool disableNameEditIfNotWindowsStyleEnabled() const
Definition: treeWidget.h:107
#define DT_DLL_VRFGUICOMMONQT
Definition: vrfGuiCommonQt.h:22
bool myAllowWindowsStyleNameEdit
Definition: treeWidget.h:153
static const int DtUserRoleForDoubleClickEdit
If in myAllowWindowsStyleNameEdit mode, set this user role in data column 0 to support double click e...
Definition: treeWidget.h:31
bool myEditingCanceled
Definition: treeWidget.h:156
bool myAllowEmptySelection
Definition: treeWidget.h:152
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
QTreeWidgetItem * myCheckForEditAfterTimer
Definition: treeWidget.h:160
void setAllowEmptySelection(bool)
Only valid in single selection mode.
Definition: treeWidget.h:165
QSize myMinimumSizeHint
Definition: treeWidget.h:157
double editPressTime() const
Definition: treeWidget.h:113
virtual bool editingCanceled() const
Definition: treeWidget.h:95

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)