ATLAS Offline Software
Loading...
Searching...
No Matches
VP1GeoTreeView.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Implementation of class VP1GeoTreeView //
9// //
10// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11// Initial version: January 2008 //
12// //
14
16#include <QTimer>
17
18//____________________________________________________________________
20public:
22};
23
24
25//____________________________________________________________________
27 : QTreeView(parent), m_d(new Imp)
28{
29 m_d->updatescheduled = false;
30}
31
32//____________________________________________________________________
37
38//____________________________________________________________________
40{
41 if (m_d->updatescheduled)
42 m_d->updatescheduled = false;
43 bool save = updatesEnabled();
44 setUpdatesEnabled(false);
45
46 //The following is a bit of a hack. Could probably be done better?
47 QModelIndexList oldselection = selectionModel()->selectedIndexes();
48 selectAll();
49 QModelIndexList allindexes = selectionModel()->selectedIndexes();
50 for ( QModelIndex idx : allindexes) {
51 update(idx);
52 }
53 selectionModel()->clearSelection();
54 for ( QModelIndex idx : oldselection )
55 selectionModel()->select(idx,QItemSelectionModel::Select);
56
57
58 if (save) {
59 setUpdatesEnabled(true);
60 update();
61 }
62}
63
64//____________________________________________________________________
66{
67 if (m_d->updatescheduled)
68 return;
69 QTimer::singleShot(0, this, SLOT(updateAllNonHiddenIndices()));
70}
void updateAllNonHiddenIndices()
VP1GeoTreeView(QWidget *parent=0)
void scheduleUpdateOfAllNonHiddenIndices()
virtual ~VP1GeoTreeView()