SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
smtk
extension
qt
qtFileItem.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_qtFileItem_h
12
#define smtk_extension_qtFileItem_h
13
14
#include "smtk/extension/qt/Exports.h"
15
#include "smtk/extension/qt/qtItem.h"
16
17
class
qtFileItemInternals
;
18
class
QBoxLayout;
19
class
QComboBox;
20
class
QLineEdit;
21
class
QWidget;
22
23
namespace
smtk
24
{
25
namespace
extension
26
{
27
68
class
SMTKQTEXT_EXPORT
qtFileItem
:
public
qtItem
69
{
70
Q_OBJECT
71
72
public
:
74
static
qtItem
* createItemWidget(
const
qtAttributeItemInfo
& info);
75
qtFileItem
(
const
qtAttributeItemInfo
& info);
76
~
qtFileItem
()
override
;
77
void
setLabelVisible(
bool
)
override
;
78
79
void
enableFileBrowser(
bool
state =
true
);
81
bool
isDirectory()
const
;
84
bool
showRecentFiles()
const
;
87
bool
showExtensions()
const
;
95
bool
useFileDirectory()
const
;
97
bool
hasDefaultDirectory()
const
;
99
const
std::string& defaultDirectory()
const
;
100
virtual
void
setInputValue(
int
i,
const
QString&);
101
void
updateItemValue(
int
i);
102
void
updateEditorValue(
int
i);
103
public
Q_SLOTS:
104
virtual
void
onUpdateItemValue();
105
void
setOutputOptional(
int
);
106
virtual
bool
onLaunchFileBrowser();
107
void
updateItemData()
override
;
108
void
showContextMenu(
const
QPoint& pt,
int
elementIdx);
109
110
Q_SIGNALS:
111
bool
launchFileBrowser();
112
113
protected
Q_SLOTS:
114
virtual
void
onAddNewValue();
115
virtual
void
onRemoveValue();
116
117
protected
:
118
void
createWidget()
override
;
119
QWidget* createFileBrowseWidget(
120
int
elementIdx,
121
const
smtk::attribute::FileSystemItem
& item,
122
const
smtk::attribute::FileSystemItemDefinition
& itemDef);
123
virtual
void
loadInputValues(
124
const
smtk::attribute::FileSystemItem
& item,
125
const
smtk::attribute::FileSystemItemDefinition
& itemDef);
126
virtual
void
updateUI();
127
virtual
void
addInputEditor(
128
int
i,
129
const
smtk::attribute::FileSystemItem
& item,
130
const
smtk::attribute::FileSystemItemDefinition
& itemDef);
131
virtual
void
clearChildWidgets();
132
bool
updateRecentValues(
const
std::string& val);
133
virtual
void
updateFileComboLists();
134
void
getEditor(
int
i, QComboBox** cbox, QLineEdit** lineEdit);
135
136
private
:
137
qtFileItemInternals
* m_internals;
138
139
};
// class
140
};
// namespace extension
141
};
// namespace smtk
142
143
#endif
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition:
doc.h:33
smtk::extension::qtItem
an abstract UI class for attribute item
Definition:
qtItem.h:61
smtk::extension::qtFileItem
Provides the QT UI for a smtk::attribute::FileSystemItem.
Definition:
qtFileItem.h:68
smtk::attribute::FileSystemItem
Definition:
FileSystemItem.h:29
qtFileItemInternals
Definition:
qtFileItem.cxx:50
smtk::extension::qtAttributeItemInfo
Class used to generate widgets for Attribute Items.
Definition:
qtAttributeItemInfo.h:39
smtk::attribute::FileSystemItemDefinition
Definition:
FileSystemItemDefinition.h:27
Generated by
1.8.17