ATLAS Offline Software
Loading...
Searching...
No Matches
VP1Collection.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// //
7// Implementation of class VP1Collection //
8// //
9// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
10// Initial version: June 2008 //
11// //
13
15#include "VP1Base/VP1Msg.h"
16
17
18//____________________________________________________________________
34
35
36//____________________________________________________________________
41
42//____________________________________________________________________
47
48//____________________________________________________________________
50{
51 VP1Msg::messageDebug("VP1Collection::persistifiableID()");
52
53 if (!m_d->persistIDProvided) {
54 m_d->persistIDProvided = true;
55 m_d->persistID = providePersistifiableID().toHex();//toHex() necessary for some unknown reason!
56 //Without it keys in maps are apparently considered similar! (Qt bug??)
57 }
58 return m_d->persistID;
59}
60
61//____________________________________________________________________
62QList<QWidget*> VP1Collection::widgetsForGuiRow() const
63{
64 if (!m_d->widgetsForGuiRowProvided) {
65 m_d->widgetsForGuiRowProvided = true;
66 m_d->widgetsForGuiRow = provideWidgetsForGuiRow();
67 }
68 return m_d->widgetsForGuiRow;
69}
70
71//____________________________________________________________________
73{
74 if (!m_d->sectionProvided) {
75 m_d->sectionProvided = true;
76 m_d->section = provideSection();
77 }
78 return m_d->section;
79}
80
81//____________________________________________________________________
83{
84 if (!m_d->sectionToolTipProvided) {
85 m_d->sectionToolTipProvided = true;
86 m_d->sectionToolTip = provideSectionToolTip();
87 }
88 return m_d->sectionToolTip;
89}
90
91//____________________________________________________________________
92VP1CollStates VP1Collection::getStates(const QList<VP1Collection*>& cols)
93{
94 VP1Msg::messageDebug("VP1Collection::getStates() - start...");
95
96 VP1CollStates states;
97 for (VP1Collection* col : cols) {
98 VP1Msg::messageDebug("inserting collection: " + col->section() );
99 states.insert(col->persistifiableID(),col->persistifiableState());
100 }
101
102 VP1Msg::messageDebug("VP1Collection::getStates() - end.");
103
104 return states;
105}
106
107//____________________________________________________________________
108void VP1Collection::applyStates(const QList<VP1Collection*>& cols, const VP1CollStates& states)
109{
110 VP1Msg::messageDebug("VP1Collection::applyStates() - start...");
111 for (VP1Collection* col : cols)
112 if (states.contains(col->persistifiableID()))
113 col->setState(states.value(col->persistifiableID()));
114 VP1Msg::messageDebug("VP1Collection::applyStates() - end.");
115}
116
117//____________________________________________________________________
119{
120 VP1Msg::messageDebug("VP1Collection::updateStates() - start...");
121 QMapIterator<QByteArray,QByteArray> it(newInfo);
122 while (it.hasNext()) {
123 it.next();
124 state.insert(it.key(),it.value());
125 }
126 VP1Msg::messageDebug("VP1Collection::updateStates() - end.");
127}
QMap< QByteArray, QByteArray > VP1CollStates
QList< QWidget * > widgetsForGuiRow
virtual QString provideSectionToolTip() const
virtual ~VP1Collection()
VP1Collection(IVP1System *sys=0, const QString &helperClassName="VP1Collection")
QString section() const
static void updateStates(VP1CollStates &state, const VP1CollStates &newInfo)
static void applyStates(const QList< VP1Collection * > &, const VP1CollStates &)
QString sectionToolTip() const
virtual QString provideSection() const =0
virtual QByteArray providePersistifiableID() const =0
QByteArray persistifiableID() const
virtual QList< QWidget * > provideWidgetsForGuiRow() const =0
static VP1CollStates getStates(const QList< VP1Collection * > &)
virtual QList< QWidget * > widgetsForGuiRow() const
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
const QString & helperClassName() const
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39