VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtFileWidgetDelegate.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCoreQt/vrvCoreQt.h>
13 
14 #include <QtCore/QString>
15 #include <QtCore/QMap>
16 
17 #include <QtWidgets/QStyledItemDelegate>
18 
19 #include <map>
20 #include <string>
21 
22 class QModelIndex;
23 class QString;
24 class QStyleOptionViewItem;
25 
26 
27 namespace makVrv
28 {
29  class DtDe;
30 
31 
38  {
39  Q_OBJECT
40  public:
44  DtFileWidgetDelegate( DtDe& de, QObject* parent = NULL );
45 
47  virtual ~DtFileWidgetDelegate();
48 
52  void setCaption( const QString& cap = QString("") );
53 
59  void addFileTypeFilter( const QString& name, const QString& ext );
60 
63  QString fileTypeFilterString() const;
64 
79  static QString generateFileFilterItem(
80  const QString& name, const QString& ext );
81 
84  static std::string rootDirectory();
85 
92  static std::string lastDirectory( const std::string& ext = "" );
93 
99  static void setDataDirectory(
100  const std::string& ext, const std::string& dir );
101 
102  protected:
109  virtual QWidget* createEditor( QWidget* parent,
110  const QStyleOptionViewItem& option, const QModelIndex& index ) const;
111 
116  virtual QString displayText( const QVariant& value,
117  const QLocale& locale ) const;
118 
119  protected:
121  static std::string RootPath;
122 
124  static std::string LastDirectory;
125 
127  typedef std::map<std::string, std::string> ExtDirMap;
129 
130  protected:
133 
135  QString myCaption;
136 
138  QMap<QString, QString> myFilters;
139  };
140 }
141 
static std::string RootPath
The absolute root (were the application was run from).
Definition: DtFileWidgetDelegate.h:121
A custom delegate for the file field to allow editing with the use of a file browser in a Qt item vie...
Definition: DtFileWidgetDelegate.h:37
static ExtDirMap LastDirectories
Definition: DtFileWidgetDelegate.h:128
DtDe & myDe
The display engine.
Definition: DtFileWidgetDelegate.h:132
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
static std::string LastDirectory
The absolute data directory (were the data files are stored).
Definition: DtFileWidgetDelegate.h:124
std::map< std::string, std::string > ExtDirMap
Map of absolute data directories keyed off of extensions.
Definition: DtFileWidgetDelegate.h:127
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
QString myCaption
The caption for the browser dialog.
Definition: DtFileWidgetDelegate.h:135
QMap< QString, QString > myFilters
The map of file filter strings keyed off the file-type name.
Definition: DtFileWidgetDelegate.h:138

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)