85 QModelIndex index = indexAt ( Event->pos() );
87 if ( index.isValid() )
89 if ( model()->data ( model()->index ( index.row(), 2 ) ).toString() ==
"RO" ) {
90 ContextMenu->actions().at ( 0 )->setVisible (
false );
93 ContextMenu->actions().at ( 0 )->setVisible (
true );
95 ContextMenu->actions().at ( 1 )->setVisible (
true );
97 setCurrentIndex ( index );
98 selectionModel()->setCurrentIndex ( index, QItemSelectionModel::NoUpdate );
112 QString UserType =
LineEdit->text();
114 if ( UserType.isEmpty() )
119 QAbstractItemModel * Model = model();
121 if ( Model !=
nullptr )
123 QVariant StringCriterium = QVariant ( UserType );
125 QModelIndex find_by_name = Model->index ( 0, 0 );
126 QModelIndex find_by_path = Model->index ( 0, 1 );
128 Qt::MatchFlags options = Qt::MatchContains;
132 options = options | Qt::MatchCaseSensitive;
137 options = Qt::MatchExactly;
140 ListOfMatch = Model->match ( find_by_name, Qt::DisplayRole, StringCriterium, 1000,
144 Model->match ( find_by_path, Qt::DisplayRole, StringCriterium, 1000, options ) );
156 disconnect (
LineEdit, SIGNAL ( returnPressed() ),
this, SLOT (
GoToFile() ) );
157 connect (
LineEdit, SIGNAL ( returnPressed() ),
this, SLOT (
GoToNext() ) );
201 FindFileDialog->setSizePolicy ( QSizePolicy::Preferred, QSizePolicy::Preferred );
202 FindFileDialog->setToolTip (
"Type string to edit line and press Enter." );
203 FindFileDialog->setWindowTitle (
"Search for a file name in the table" );
205 QHBoxLayout * FileLayout =
new QHBoxLayout();
206 QLabel * Label =
new QLabel ( QString (
"Find File:" ) );
208 GoButton =
new QPushButton (
"Go !" );
210 LineEdit->setToolTip (
"Type string and press Enter" );
212 FileLayout->addWidget ( Label );
217 QHBoxLayout * ButtonsLayout =
new QHBoxLayout();
224 QVBoxLayout * FindDialogLayout =
new QVBoxLayout();
225 FindDialogLayout->addItem ( FileLayout );
226 FindDialogLayout->addItem ( ButtonsLayout );
232 connect (
LineEdit, SIGNAL ( textEdited ( QString ) ),
this,
238 connect (
LineEdit, SIGNAL ( returnPressed() ),
this, SLOT (
GoToFile() ) );
259 QModelIndex index = currentIndex();
260 QString file = model()->data ( model()->index ( index.row(), 0,
261 index.parent() ) ).toString();
262 QString path = model()->data ( model()->index ( index.row(), 1,
263 index.parent() ) ).toString();
264 auto full_name = path +
"/" + file;
307 QString file = model()->data ( model()->index ( index.row(), 0,
308 index.parent() ) ).toString();
309 QString path = model()->data ( model()->index ( index.row(), 1,
310 index.parent() ) ).toString();
311 auto full_name = path +
"/" + file;