OTB  6.7.0
Orfeo Toolbox
otbWrapperQtWidgetListEditWidget.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbWrapperQtWidgetListEditWidget_h
22 #define otbWrapperQtWidgetListEditWidget_h
23 
24 #include "otbConfigure.h"
25 #include <QtWidgets>
26 #include "OTBQtWidgetExport.h"
27 
28 namespace otb
29 {
30 
31 namespace Wrapper
32 {
33 
34 // Internal classes forward declarations
35 class ListEditItemModel;
36 class StringListInterface;
37 
38 namespace Ui
39 {
40 class ListEditWidget;
41 };
42 
50 class OTBQtWidget_EXPORT ListEditWidget :
51  public QWidget
52 {
53 
54  Q_OBJECT;
55 
56 public:
57 
60  QWidget * p =NULL,
61  Qt::WindowFlags flags =0 );
62 
64  virtual ~ListEditWidget();
65 
66  const ListEditItemModel * GetItemModel() const;
67 
68  ListEditItemModel * GetItemModel();
69 
70 public slots:
71  void OnFilenameDropped(const QString &);
72 
73 signals:
74  void Updated();
75 
76  void ValueChanged();
77 
78 private:
80  {
81  LEFT = -1,
82  NONE = 0,
83  RIGHT = +1,
84  };
85 
86 private:
87  void Swap( int, int, SwapSelection = NONE );
88 
89  QStringList browseFilenames( bool multi = false, const QString & filename = QString());
90 
91  QString browseFilename( const QModelIndex & );
92 
93 private:
97  Ui::ListEditWidget * m_UI;
98 
99 private slots:
100  void on_addButton_clicked();
101  void on_browseButton_clicked();
102  void on_downButton_clicked();
103  void on_removeButton_clicked();
104  void on_removeAllButton_clicked();
105  void on_upButton_clicked();
106 
107  void OnDataChanged( const QModelIndex &, const QModelIndex & );
108  void OnModelReset();
109  void OnRowsInserted( const QModelIndex &, int, int );
110  void OnRowsRemoved( const QModelIndex &, int, int );
111  void OnSelectionChanged( const QItemSelection &, const QItemSelection & );
112 };
113 
114 } // end namespace 'Wrapper'
115 
116 } // end namespace 'otb'
117 
118 #endif // otbWrappersQtWidgetListEditWidget_h
Ui::ListEditWidget * m_UI
uic generated.
This class represents a list of InputFilename parameter.