26 : QTableView ( parent ),
40 verticalHeader()->setVisible(
true);
41 verticalHeader()->setSectionResizeMode ( QHeaderView::Interactive );
43 horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
44 horizontalHeader()->setMaximumSectionSize(750);
45 setSortingEnabled (
true );
46 setAlternatingRowColors (
true );
47 setSelectionMode ( SelectionMode::SingleSelection );
48 setSelectionBehavior ( QAbstractItemView::SelectionBehavior::SelectRows );
49 setHorizontalScrollMode(ScrollMode::ScrollPerPixel);
50 setVerticalScrollMode(ScrollMode::ScrollPerPixel);
52 setTextElideMode(Qt::ElideRight);
54 connect (
this, SIGNAL ( activated(
const QModelIndex&) ),
this, SLOT (
slot_edit_object() ) );
130 QString UserType =
LineEdit->text();
132 if ( UserType.isEmpty() )
137 QAbstractItemModel * Model = model();
139 if ( Model !=
nullptr )
141 QVariant StringCriterium = QVariant ( UserType );
142 QModelIndex WhereToStartSearch = Model->index ( 0, 0 );
143 ListOfMatch = Model->match ( WhereToStartSearch, Qt::DisplayRole, StringCriterium, 1000,
144 Qt::MatchContains | Qt::MatchWrap );
150 selectRow ( val.row() );
152 scrollTo (val , QAbstractItemView::PositionAtCenter );
158 connect (
LineEdit, SIGNAL ( returnPressed() ),
this, SLOT (
GoToNext() ) );
306 if ( this->model() !=
nullptr )
308 QModelIndexList qindices = this->selectedIndexes();
309 std::vector<QModelIndex> indices;
311 for ( QModelIndex q : qindices )
315 indices.push_back ( q );
322 casted->delete_objects ( indices.begin(), indices.end() );
327 casted->delete_objects ( indices.begin(), indices.end() );
331 WARN (
"Object Deleting",
332 "Object deletion failed due to the internal model being in invalid state",
333 "You are advised to restart the application before proceeding any further" );
343 editObject =
new QAction ( tr (
"&Edit Object" ),
this );
351 refByAc =
new QAction ( tr (
"Referenced B&y (All objects)" ),
this );
352 refByAc->setToolTip (
"Find all objects which reference the selected object" );
357 refByAcOnlyComp =
new QAction ( tr (
"Referenced B&y (Only Composite)" ),
this );
359 "Find objects (ONLY Composite ones) which reference the selected object" );
365 copyObjectAc =
new QAction ( tr (
"Copy This Object Into A &New One" ),
this );
372 FindObject =
new QAction ( tr (
"&Find Object" ),
this );
cptr< dbe::CustomTreeView > get_view() const
static MainWindow * findthis()