ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Base
src
VP1Deserialise.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
7
// //
8
// Implementation of class VP1Deserialise //
9
// //
10
// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11
// Initial version: June 2008 //
12
// //
14
15
#include "
VP1Base/VP1Deserialise.h
"
16
#include "
VP1Base/VP1QtInventorUtils.h
"
17
#include "
VP1Base/PhiSectionWidget.h
"
18
#include "
VP1Base/VP1MaterialButton.h
"
19
#include "
VP1Base/VP1ColorSelectButton.h
"
20
#include "
VP1Base/VP1CollectionWidget.h
"
21
#include "
VP1Base/VP1EtaPhiCutWidget.h
"
22
#include "
VP1Base/VP1DrawOptionsWidget.h
"
23
#include "
VP1Base/VP1CollectionSettingsButtonBase.h
"
24
//#include "VP1AODSystems/JetCollectionSettingsButton.h"
25
26
#include <Inventor/nodes/SoMaterial.h>
27
28
#include <QSet>
29
#include <QBuffer>
30
#include <QByteArray>
31
#include <QDataStream>
32
33
#include <QCheckBox>
34
#include <QGroupBox>
35
#include <QComboBox>
36
#include <QLineEdit>
37
#include <QDoubleSpinBox>
38
#include <QSpinBox>
39
#include <QSlider>
40
#include <QToolBox>
41
#include <QRadioButton>
42
43
//____________________________________________________________________
44
class
VP1Deserialise::Imp
{
45
public
:
46
Imp
(
VP1Deserialise
*
tc
) :
theclass
(
tc
),
buffer
(0),
state
(0),
checkedUnused
(false),
version
(-1),
widgetNeedingUnblock
(0) {}
47
VP1Deserialise
*
theclass
;
48
QByteArray
byteArray
;
49
QBuffer *
buffer
;
50
QDataStream *
state
;
51
bool
checkedUnused
;
52
qint32
version
;
53
54
QSet<const QWidget*>
handledWidgets
;
55
QSet<QWidget*>
ignoredWidgets
;
56
57
QWidget *
widgetNeedingUnblock
;
58
void
block
(QWidget*w) {
59
assert(!
widgetNeedingUnblock
);
60
if
(w&&!w->signalsBlocked()) {
61
w->blockSignals(
true
);
62
widgetNeedingUnblock
=w;
63
}
64
}
65
void
unblock
() {
66
if
(
widgetNeedingUnblock
) {
67
widgetNeedingUnblock
->blockSignals(
false
);
68
widgetNeedingUnblock
= 0;
69
}
70
}
71
72
void
handle
(
const
QWidget*w) {
73
if
(!w)
74
return
;
75
if
(
handledWidgets
.contains(w))
76
theclass
->message(
"ERROR: Handled widget more than once: Type="
77
+QString(w->metaObject()->className())
78
+
", name="
+w->objectName());
79
handledWidgets
.insert(w);
80
}
81
bool
expectsPersistification
(QWidget*w);
82
83
static
unsigned
numberOfInstantiations
;
84
};
85
86
unsigned
VP1Deserialise::Imp::numberOfInstantiations
= 0;
87
88
//____________________________________________________________________
89
unsigned
VP1Deserialise::numberOfInstantiations
()
90
{
91
return
Imp::numberOfInstantiations
;
92
}
93
94
//____________________________________________________________________
95
void
VP1Deserialise::decrementNumberOfInstantiations
()
96
{
97
--(
Imp::numberOfInstantiations
);
98
}
99
100
//____________________________________________________________________
101
VP1Deserialise::VP1Deserialise
(
const
QByteArray & ba,
IVP1System
* sys)
102
:
VP1HelperClassBase
(sys,
"VP1Deserialise"
),
m_d
(new
Imp
(this))
103
{
104
++(
Imp::numberOfInstantiations
);
105
106
m_d
->byteArray = ba;
107
m_d
->buffer =
new
QBuffer(&(
m_d
->byteArray));
108
if
(!
m_d
->buffer->open(QIODevice::ReadOnly)) {
109
delete
m_d
->buffer;
110
m_d
->buffer = 0;
111
m_d
->version = -1;
112
//Fixme: ensure that other methods do not do anything (or are not called!)
113
//Ensure that we are at end of stream when finished - and print versions (data+preferred).
114
}
else
{
115
m_d
->state =
new
QDataStream(
m_d
->buffer);
116
m_d
->version =
restoreInt
();
117
}
118
}
119
120
//____________________________________________________________________
121
VP1Deserialise::~VP1Deserialise
()
122
{
123
if
(!
m_d
->checkedUnused)
124
message
(
"WARNING: warnUnrestored(..) was never called!"
);
125
if
(!
atEnd
())
126
message
(
"Destructor WARNING: Buffer not at end!"
);
127
m_d
->buffer->close();
128
delete
m_d
->state;
129
m_d
->state = 0;
130
delete
m_d
->buffer;
131
m_d
->buffer = 0;
132
delete
m_d
;
133
}
134
135
//____________________________________________________________________
136
bool
VP1Deserialise::atEnd
()
const
137
{
138
return
m_d
->buffer->atEnd();
139
}
140
141
//____________________________________________________________________
142
qint32
VP1Deserialise::version
()
const
143
{
144
return
m_d
->version;
145
}
146
147
//____________________________________________________________________
148
QDataStream *
VP1Deserialise::stream
()
149
{
150
return
m_d
->state;
151
}
152
153
//____________________________________________________________________
154
void
VP1Deserialise::restore
( SoMaterial* m )
155
{
156
if
(
VP1Msg::debug
()){
157
messageDebug
(
"VP1Deserialise::restore(SoMaterial)"
);
158
}
159
QByteArray ba(
restoreByteArray
());
160
if
(!m||ba.isEmpty())
161
return
;
162
VP1QtInventorUtils::deserialiseSoMaterial
(ba,m);
163
}
164
165
//____________________________________________________________________
166
void
VP1Deserialise::restore
(
VP1MaterialButton
* mb)
167
{
168
if
(
VP1Msg::debug
()){
169
messageDebug
(
"VP1Deserialise::restore(VP1MaterialButton)"
);
170
}
171
m_d
->handle(mb);
172
SoMaterial * m(0);
173
QList<SoMaterial*> mats = mb ? mb->handledMaterials() : QList<SoMaterial*>();
174
bool
tempmat = mats.isEmpty() || !mats.at(0);
175
m = tempmat ?
new
SoMaterial : mats.at(0);
176
m->ref();
177
restore
(m);
178
if
(mb) {
179
m_d
->block(mb);
180
mb->copyValuesFromMaterial(m);
181
m_d
->unblock();
182
}
183
if
(tempmat)
184
m->unref();
185
else
186
m->unrefNoDelete();
187
}
188
189
//____________________________________________________________________
190
QColor
VP1Deserialise::restoreColor
()
191
{
192
QColor c;
193
(*(
m_d
->state)) >> c;
194
if
(
VP1Msg::debug
()){
195
messageDebug
(
"VP1Deserialise::restore(QColor) - name: "
+ c.name());
196
}
197
if
(
VP1Msg::verbose
())
198
messageVerbose
(
"Restoring color "
+
str
(c));
199
return
c;
200
}
201
202
//____________________________________________________________________
203
void
VP1Deserialise::restore
(
VP1ColorSelectButton
*cb)
204
{
205
if
(
VP1Msg::debug
()){
206
messageDebug
(
"VP1Deserialise::restore(VP1ColorSelectButton) - name: "
+ cb->objectName());
207
}
208
m_d
->handle(cb);
209
QColor c =
restoreColor
();
210
if
(c.isValid()&&cb&&cb->
color
()!=c) {
211
m_d
->block(cb);
212
cb->
setColor
(c);
213
m_d
->unblock();
214
}
215
}
216
217
//____________________________________________________________________
218
void
VP1Deserialise::restore
(
PhiSectionWidget
*
phi
)
219
{
220
if
(
VP1Msg::debug
()){
221
messageDebug
(
"VP1Deserialise::restore(PhiSectionWidget) - name: "
+
phi
->objectName());
222
}
223
m_d
->handle(
phi
);
224
QByteArray ba(
restoreByteArray
());
225
if
(
phi
&&ba != QByteArray()) {
226
m_d
->block(
phi
);
227
phi
->setState(std::move(ba));
228
m_d
->unblock();
229
}
230
}
231
232
//____________________________________________________________________
233
QByteArray
VP1Deserialise::restoreByteArray
()
234
{
235
QByteArray ba;
236
(*(
m_d
->state)) >> ba;
237
if
(
VP1Msg::verbose
()){
238
messageVerbose
(
"Restoring byte array (length = "
+QString::number(ba.count())+
")"
);
239
}
240
return
ba;
241
}
242
243
//____________________________________________________________________
244
void
VP1Deserialise::restore
(QCheckBox *cb )
245
{
246
if
(
VP1Msg::debug
()){
247
messageDebug
(
"VP1Deserialise::restore(QCheckBox) - name: "
+ cb->objectName());
248
}
249
250
m_d
->handle(cb);
251
252
bool
b =
restoreBool
();
253
254
if
(
VP1Msg::debug
()){
255
messageDebug
(
"bool b: "
+QString::number(b));
256
messageDebug
(
"bool cb: "
+QString::number( cb->isChecked() ));
257
}
258
259
if
(cb->isChecked()!=b) {
260
m_d
->block(cb);
261
if
(
VP1Msg::debug
()){
262
messageDebug
(
"setting - checked: "
+QString::number( b ));
263
}
264
cb->setChecked(b);
265
m_d
->unblock();
266
}
267
}
268
269
//____________________________________________________________________
270
void
VP1Deserialise::restore
(QGroupBox*gb)
271
{
272
if
(
VP1Msg::debug
()){
273
messageDebug
(
"VP1Deserialise::restore(QGroupBox) - name: "
+ gb->objectName());
274
}
275
if
(!gb->isCheckable())
276
message
(
"WARNING: Asked to handled GroupBox which is not checkable: "
+gb->objectName());
277
m_d
->handle(gb);
278
bool
b =
restoreBool
();
279
if
(gb->isChecked()!=b) {
280
m_d
->block(gb);
281
gb->setChecked(b);
282
m_d
->unblock();
283
}
284
}
285
286
//____________________________________________________________________
287
void
VP1Deserialise::restore
(QComboBox *cb)
288
{
289
if
(
VP1Msg::debug
()){
290
messageDebug
(
"VP1Deserialise::restore(QComboBox) - name: "
+ cb->objectName());
291
}
292
m_d
->handle(cb);
293
QString t =
restoreString
();
294
if
(t.isEmpty())
295
return
;
296
int
i = cb->findText(t);
297
if
(i<0||i>cb->count()-1)
298
return
;
299
if
(cb->currentIndex()!=i) {
300
m_d
->block(cb);
301
cb->setCurrentIndex(i);
302
m_d
->unblock();
303
}
304
}
305
306
//____________________________________________________________________
307
void
VP1Deserialise::restore
(QLineEdit* le)
308
{
309
if
(
VP1Msg::debug
()){
310
messageDebug
(
"VP1Deserialise::restore(QLineEdit) - name: "
+ le->objectName());
311
}
312
m_d
->handle(le);
313
QString s =
restoreString
();
314
if
(s!=le->text()) {
315
m_d
->block(le);
316
le->setText(s);
317
m_d
->unblock();
318
}
319
}
320
321
//____________________________________________________________________
322
void
VP1Deserialise::restore
(QDoubleSpinBox *sb,
const
double
&
unit
)
323
{
324
if
(
VP1Msg::debug
()){
325
messageDebug
(
"VP1Deserialise::restore(QDoubleSpinBox) - name: "
+ sb->objectName());
326
}
327
m_d
->handle(sb);
328
double
dbl = (
unit
== 1.0 ?
restoreDouble
() :
restoreDouble
()/
unit
);
329
dbl = std:: max(std::min(dbl,sb->maximum()),sb->minimum());
330
if
(sb->value()!=dbl) {
331
m_d
->block(sb);
332
sb->setValue(dbl);
333
m_d
->unblock();
334
}
335
}
336
337
//____________________________________________________________________
338
void
VP1Deserialise::restore
(QSpinBox *sb)
339
{
340
if
(
VP1Msg::debug
()){
341
messageDebug
(
"VP1Deserialise::restore(QSpinBox) - name: "
+ sb->objectName());
342
}
343
m_d
->handle(sb);
344
qint32 i =
restoreInt
();
345
i = std:: max(std::min(i,sb->maximum()),sb->minimum());
346
if
(sb->value()!=i) {
347
m_d
->block(sb);
348
sb->setValue(i);
349
m_d
->unblock();
350
}
351
}
352
353
//____________________________________________________________________
354
void
VP1Deserialise::restore
(QSlider *s)
355
{
356
if
(
VP1Msg::debug
()){
357
messageDebug
(
"VP1Deserialise::restore(QSlider) - name: "
+ s->objectName());
358
}
359
m_d
->handle(s);
360
qint32 i =
restoreInt
();
361
i = std:: max(std::min(i,s->maximum()),s->minimum());
362
if
(s->value()!=i) {
363
m_d
->block(s);
364
s->setValue(i);
365
m_d
->unblock();
366
}
367
}
368
369
//____________________________________________________________________
370
void
VP1Deserialise::restore
(QToolBox *tb)
371
{
372
if
(
VP1Msg::debug
()){
373
messageDebug
(
"VP1Deserialise::restore(QToolBox) - name: "
+ tb->objectName());
374
}
375
m_d
->handle(tb);
376
qint32 i =
restoreInt
();
377
if
(i>=0&&i<tb->
count
()&&i!=tb->currentIndex()) {
378
m_d
->block(tb);
379
tb->setCurrentIndex(i);
380
m_d
->unblock();
381
}
382
}
383
384
//____________________________________________________________________
385
void
VP1Deserialise::restoreByTitle
(QToolBox *tb)
386
{
387
if
(
VP1Msg::debug
()){
388
messageDebug
(
"VP1Deserialise::restore(QToolBox) - name: "
+ tb->objectName());
389
}
390
m_d
->handle(tb);
391
QString s =
restoreString
();
392
int
itarget (-1);
393
for
(
int
i = 0; i < tb->count(); ++i) {
394
if
(tb->itemText(i)==s) {
395
itarget = i;
396
break
;
397
}
398
}
399
if
(itarget>0&&itarget<tb->
count
()&&itarget!=tb->currentIndex()) {
400
m_d
->block(tb);
401
tb->setCurrentIndex(itarget);
402
m_d
->unblock();
403
}
404
}
405
406
407
//____________________________________________________________________
408
QString
VP1Deserialise::restoreString
()
409
{
410
QString t;
411
(*(
m_d
->state)) >> t;
412
if
(
VP1Msg::verbose
()){
413
messageVerbose
(
"Restoring string "
+t);
414
}
415
return
t;
416
}
417
//____________________________________________________________________
418
bool
VP1Deserialise::restoreBool
()
419
{
420
bool
b;
421
(*(
m_d
->state)) >> b;
422
if
(
VP1Msg::verbose
()){
423
messageVerbose
(
"Restoring bool "
+
str
(b));
424
}
425
return
b;
426
}
427
//____________________________________________________________________
428
double
VP1Deserialise::restoreDouble
()
429
{
430
double
dbl;
431
(*(
m_d
->state)) >> dbl;
432
if
(
VP1Msg::verbose
()){
433
messageVerbose
(
"Restoring double "
+
str
(dbl));
434
}
435
return
dbl;
436
}
437
438
//____________________________________________________________________
439
qint32
VP1Deserialise::restoreInt
()
440
{
441
qint32 i;
442
(*(
m_d
->state)) >> i;
443
if
(
VP1Msg::verbose
()){
444
messageVerbose
(
"Restoring int "
+
str
(i));
445
}
446
return
i;
447
}
448
449
//____________________________________________________________________
450
void
VP1Deserialise::restore
( QRadioButton * rb0,
451
QRadioButton * rb1,
452
QRadioButton * rb2,
453
QRadioButton * rb3,
454
QRadioButton * rb4,
455
QRadioButton * rb5,
456
QRadioButton * rb6,
457
QRadioButton * rb7,
458
QRadioButton * rb8,
459
QRadioButton * rb9 )
460
{
461
qint32 ichecked =
restoreInt
();
462
QList<QRadioButton *> l;
463
l << rb0 << rb1 << rb2 << rb3 << rb4 << rb5 << rb6 << rb7 << rb8 << rb9;
464
for
(qint32 i = 0; i < l.count(); ++i) {
465
if
(l.at(i)) {
466
if
(
VP1Msg::debug
()){
467
messageDebug
(
"VP1Deserialise::restore(QRadioButton) - name: "
+ l.at(i)->objectName());
468
}
469
m_d
->handle(l.at(i));
470
}
471
}
472
//We only change any state if we have a pointer to the one needing to be checked:
473
if
(ichecked<0||ichecked>=l.count()||!l.at(ichecked))
474
return
;
475
for
(qint32 i = 0; i < l.count(); ++i) {
476
QRadioButton * rb = l.at(i);
477
if
(rb&&rb->isChecked()!=(i==ichecked)) {
478
m_d
->block(rb);
479
rb->setChecked(i==ichecked);
480
m_d
->unblock();
481
}
482
}
483
}
484
485
//____________________________________________________________________
486
void
VP1Deserialise::restore
(
VP1CollectionWidget
*cw)
487
{
488
if
(
VP1Msg::debug
()){
489
messageDebug
(
"VP1Deserialise::restore(VP1CollectionWidget) - name: "
+ cw->objectName());
490
messageDebug
(
"VP1Deserialise::restore(VP1CollectionWidget)- start..."
);
491
}
492
m_d
->handle(cw);
493
ignoreWidget
(cw);
//To ignore all children of the collection widget.
494
QByteArray ba(
restoreByteArray
());
495
QBuffer buffer(&ba);
496
buffer.open(QIODevice::ReadOnly);
497
QDataStream state(&buffer);
498
qint32
version
;
499
state >>
version
;
500
if
(
version
!=0)
501
return
;
//We ignore wrong versions silently here.
502
VP1CollStates
cwstates;
503
state >> cwstates;
504
buffer.close();
505
m_d
->block(cw);
506
cw->
addStateInfo
(cwstates,
true
/*overwrite existing*/
);
507
m_d
->unblock();
508
if
(
VP1Msg::debug
()){
509
messageDebug
(
"VP1Deserialise::restore(VP1CollectionWidget)- end."
);
510
}
511
}
512
513
//____________________________________________________________________
514
void
VP1Deserialise::restore
(
VP1CollectionSettingsButtonBase
*w)
515
{
516
if
(
VP1Msg::debug
()){
517
messageDebug
(
"VP1Deserialise::restore(VP1CollectionSettingsButtonBase) - name: "
+ w->objectName());
518
messageDebug
(
"VP1Deserialise::restore(VP1CollectionSettingsButtonBase)- start..."
);
519
}
520
m_d
->handle(w);
521
ignoreWidget
(w);
//To ignore all children of the widget.
522
523
QByteArray ba =
restoreByteArray
();
524
if
(w&&ba!=QByteArray()) {
525
m_d
->block(w);
526
w->restoreFromState(ba);
527
m_d
->unblock();
528
}
529
if
(
VP1Msg::debug
()){
530
messageDebug
(
"VP1Deserialise::restore(VP1CollectionSettingsButtonBase)- end."
);
531
}
532
}
533
534
//void VP1Deserialise::restore(JetCollectionSettingsButton*w)
535
//{
536
// m_d->handle(w);
537
// ignoreWidget(w);//To ignore all children of the widget.
538
//
539
// QByteArray ba = restoreByteArray();
540
// if (w&&ba!=QByteArray()) {
541
// m_d->block(w);
542
// w->restoreFromState(ba);
543
// m_d->unblock();
544
// }
545
//}
546
547
548
549
//____________________________________________________________________
550
void
VP1Deserialise::restore
(
VP1EtaPhiCutWidget
*w)
551
{
552
if
(
VP1Msg::debug
()){
553
messageDebug
(
"VP1Deserialise::restore(VP1EtaPhiCutWidget) - name: "
+ w->objectName());
554
}
555
m_d
->handle(w);
556
ignoreWidget
(w);
//To ignore all children of the widget.
557
558
QByteArray ba =
restoreByteArray
();
559
if
(w&&ba!=QByteArray()) {
560
m_d
->block(w);
561
w->restoreFromState(ba);
562
m_d
->unblock();
563
}
564
}
565
566
567
568
569
//____________________________________________________________________
570
void
VP1Deserialise::restore
(
VP1DrawOptionsWidget
*w)
571
{
572
if
(
VP1Msg::debug
()){
573
messageDebug
(
"VP1Deserialise::restore(VP1DrawOptionsWidget) - name: "
+ w->objectName());
574
}
575
m_d
->handle(w);
576
ignoreWidget
(w);
//To ignore all children of the widget.
577
578
QByteArray ba =
restoreByteArray
();
579
if
(w&&ba!=QByteArray()) {
580
m_d
->block(w);
581
w->applyState(ba);
582
m_d
->unblock();
583
}
584
}
585
586
//____________________________________________________________________
587
void
VP1Deserialise::ignoreBool
()
588
{
589
bool
b;
590
(*(
m_d
->state)) >> b;
591
if
(
VP1Msg::verbose
()){
592
messageVerbose
(
"Ignoring bool "
+
str
(b));
593
}
594
}
595
596
//____________________________________________________________________
597
void
VP1Deserialise::ignoreInt
()
598
{
599
qint32 i;
600
(*(
m_d
->state)) >> i;
601
if
(
VP1Msg::verbose
()){
602
messageVerbose
(
"Ignoring int "
+
str
(i));
603
}
604
}
605
606
//____________________________________________________________________
607
void
VP1Deserialise::ignoreDouble
()
608
{
609
double
dbl;
610
(*(
m_d
->state)) >> dbl;
611
if
(
VP1Msg::verbose
()){
612
messageVerbose
(
"Ignoring double "
+
str
(dbl));
613
}
614
}
615
616
//____________________________________________________________________
617
void
VP1Deserialise::ignoreString
()
618
{
619
QString t;
620
(*(
m_d
->state)) >> t;
621
if
(
VP1Msg::verbose
()){
622
messageVerbose
(
"Ignoring string "
+t);
623
}
624
}
625
626
//____________________________________________________________________
627
void
VP1Deserialise::ignoreByteArray
()
628
{
629
QByteArray ba;
630
(*(
m_d
->state)) >> ba;
631
if
(
VP1Msg::verbose
()){
632
messageVerbose
(
"Ignoring byte array (length = "
+QString::number(ba.count())+
")"
);
633
}
634
}
635
636
//____________________________________________________________________
637
void
VP1Deserialise::ignoreObsoletePhiSectionWidgetState
()
638
{
639
QPair<int,QList<int> > state;
640
(*(
m_d
->state)) >> state;
641
if
(
VP1Msg::verbose
()){
642
messageVerbose
(
"Ignoring obsolete phi section widget state"
);
643
}
644
}
645
646
//____________________________________________________________________
647
void
VP1Deserialise::ignoreWidget
(QWidget*w)
648
{
649
if
(
VP1Msg::debug
()){
650
messageDebug
(
"VP1Deserialise::ignoreWidget(QWidget) - name: "
+ w->objectName());
651
}
652
if
(w)
653
m_d
->ignoredWidgets.insert(w);
654
}
655
656
//____________________________________________________________________
657
void
VP1Deserialise::widgetHandled
(QWidget*w)
658
{
659
m_d
->handle(w);
660
}
661
662
//____________________________________________________________________
663
bool
VP1Deserialise::Imp::expectsPersistification
(QWidget*w)
664
{
665
//NB: Same code as in VP1Serialise::Imp::expectsPersistification
666
if
(!w)
667
return
false
;
668
669
//Fixme: Something faster than string based? Or only do this in verbose mode?
670
671
if
(w->inherits(
"QGroupBox"
))
672
return
static_cast<
QGroupBox*
>
(w)->isCheckable();
673
674
return
w->inherits(
"QCheckBox"
)
675
|| w->inherits(
"QRadioButton"
)
676
|| w->inherits(
"QComboBox"
)
677
|| w->inherits(
"QAbstractSpinBox"
)
678
|| w->inherits(
"QSlider"
)
679
|| w->inherits(
"QToolBox"
)
680
|| w->inherits(
"PhiSectionWidget"
)
681
|| w->inherits(
"VP1EtaPhiCutWidget"
)
682
|| w->inherits(
"VP1DrawOptionsWidget"
)
683
|| w->inherits(
"QLineEdit"
)
684
|| w->inherits(
"VP1ColorSelectButton"
)
685
|| w->inherits(
"VP1MaterialButton"
);
686
}
687
688
//____________________________________________________________________
689
void
VP1Deserialise::disableUnrestoredChecks
()
690
{
691
m_d
->checkedUnused =
true
;
692
}
693
694
//____________________________________________________________________
695
void
VP1Deserialise::warnUnrestored
(QObject*
object
)
696
{
697
//NB: Same code as in VP1Serialise::warnUnsaved
698
699
if
(!
m_d
->checkedUnused)
700
m_d
->checkedUnused =
true
;
701
702
if
(!
object
)
703
return
;
704
705
if
(object->isWidgetType()&&
m_d
->ignoredWidgets.contains(
static_cast<
QWidget*
>
(
object
)))
706
return
;
707
708
if
(object->isWidgetType()&&!object->objectName().startsWith(
"qt_"
)) {
709
QWidget * wid =
static_cast<
QWidget*
>
(object);
710
if
(!
m_d
->handledWidgets.contains(wid)&&
m_d
->expectsPersistification(wid)) {
711
QString s(
"WARNING Unrestored widget of type: "
+QString(wid->metaObject()->className())+
" and object name = "
+wid->objectName());
712
if
(
VP1Msg::verbose
()){
713
message
(s);
714
}
715
if
(
VP1Msg::debug
()){
716
messageDebug
(s);
717
}
718
}
719
}
720
//Call recursively on all "children":
721
for
(QObject* o : object->children())
722
warnUnrestored
(
static_cast<
QWidget*
>
(o));
723
}
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
unit
detray::unit< scalar_t > unit
Definition
DeviceTripletSeedingAlg.h:22
tc
static Double_t tc
Definition
LArPhysWaveHECTool.cxx:38
PhiSectionWidget.h
VP1CollectionSettingsButtonBase.h
VP1CollectionWidget.h
VP1CollStates
QMap< QByteArray, QByteArray > VP1CollStates
Definition
VP1Collection.h:29
VP1ColorSelectButton.h
VP1Deserialise.h
VP1DrawOptionsWidget.h
VP1EtaPhiCutWidget.h
VP1MaterialButton.h
VP1QtInventorUtils.h
IVP1System
Definition
IVP1System.h:36
PhiSectionWidget
Definition
PhiSectionWidget.h:26
VP1CollectionSettingsButtonBase
Definition
VP1CollectionSettingsButtonBase.h:17
VP1CollectionWidget
Definition
VP1CollectionWidget.h:32
VP1CollectionWidget::addStateInfo
void addStateInfo(const VP1CollStates &, bool overwritesExisting=true)
Definition
VP1CollectionWidget.cxx:289
VP1ColorSelectButton
Definition
VP1ColorSelectButton.h:20
VP1ColorSelectButton::color
QColor color() const
Definition
VP1ColorSelectButton.cxx:108
VP1ColorSelectButton::setColor
void setColor(const QColor &)
Definition
VP1ColorSelectButton.cxx:95
VP1Deserialise::Imp
Definition
VP1Deserialise.cxx:44
VP1Deserialise::Imp::expectsPersistification
bool expectsPersistification(QWidget *w)
Definition
VP1Deserialise.cxx:663
VP1Deserialise::Imp::state
QDataStream * state
Definition
VP1Deserialise.cxx:50
VP1Deserialise::Imp::handle
void handle(const QWidget *w)
Definition
VP1Deserialise.cxx:72
VP1Deserialise::Imp::handledWidgets
QSet< const QWidget * > handledWidgets
Definition
VP1Deserialise.cxx:54
VP1Deserialise::Imp::numberOfInstantiations
static unsigned numberOfInstantiations
Definition
VP1Deserialise.cxx:83
VP1Deserialise::Imp::checkedUnused
bool checkedUnused
Definition
VP1Deserialise.cxx:51
VP1Deserialise::Imp::theclass
VP1Deserialise * theclass
Definition
VP1Deserialise.cxx:47
VP1Deserialise::Imp::block
void block(QWidget *w)
Definition
VP1Deserialise.cxx:58
VP1Deserialise::Imp::version
qint32 version
Definition
VP1Deserialise.cxx:52
VP1Deserialise::Imp::Imp
Imp(VP1Deserialise *tc)
Definition
VP1Deserialise.cxx:46
VP1Deserialise::Imp::ignoredWidgets
QSet< QWidget * > ignoredWidgets
Definition
VP1Deserialise.cxx:55
VP1Deserialise::Imp::byteArray
QByteArray byteArray
Definition
VP1Deserialise.cxx:48
VP1Deserialise::Imp::buffer
QBuffer * buffer
Definition
VP1Deserialise.cxx:49
VP1Deserialise::Imp::widgetNeedingUnblock
QWidget * widgetNeedingUnblock
Definition
VP1Deserialise.cxx:57
VP1Deserialise::Imp::unblock
void unblock()
Definition
VP1Deserialise.cxx:65
VP1Deserialise::restoreDouble
double restoreDouble()
Definition
VP1Deserialise.cxx:428
VP1Deserialise::VP1Deserialise
VP1Deserialise(const QByteArray &, IVP1System *sys=0)
Definition
VP1Deserialise.cxx:101
VP1Deserialise::numberOfInstantiations
static unsigned numberOfInstantiations()
Definition
VP1Deserialise.cxx:89
VP1Deserialise::restoreByteArray
QByteArray restoreByteArray()
Definition
VP1Deserialise.cxx:233
VP1Deserialise::ignoreWidget
void ignoreWidget(QWidget *)
Definition
VP1Deserialise.cxx:647
VP1Deserialise::m_d
Imp * m_d
Definition
VP1Deserialise.h:127
VP1Deserialise::atEnd
bool atEnd() const
Definition
VP1Deserialise.cxx:136
VP1Deserialise::restoreColor
QColor restoreColor()
Definition
VP1Deserialise.cxx:190
VP1Deserialise::disableUnrestoredChecks
void disableUnrestoredChecks()
Definition
VP1Deserialise.cxx:689
VP1Deserialise::ignoreByteArray
void ignoreByteArray()
Definition
VP1Deserialise.cxx:627
VP1Deserialise::ignoreInt
void ignoreInt()
Definition
VP1Deserialise.cxx:597
VP1Deserialise::restoreString
QString restoreString()
Definition
VP1Deserialise.cxx:408
VP1Deserialise::restoreInt
qint32 restoreInt()
Definition
VP1Deserialise.cxx:439
VP1Deserialise::ignoreBool
void ignoreBool()
Definition
VP1Deserialise.cxx:587
VP1Deserialise::ignoreString
void ignoreString()
Definition
VP1Deserialise.cxx:617
VP1Deserialise::~VP1Deserialise
virtual ~VP1Deserialise()
Definition
VP1Deserialise.cxx:121
VP1Deserialise::restoreBool
bool restoreBool()
Definition
VP1Deserialise.cxx:418
VP1Deserialise::ignoreObsoletePhiSectionWidgetState
void ignoreObsoletePhiSectionWidgetState()
Definition
VP1Deserialise.cxx:637
VP1Deserialise::ignoreDouble
void ignoreDouble()
Definition
VP1Deserialise.cxx:607
VP1Deserialise::warnUnrestored
void warnUnrestored(QObject *)
Definition
VP1Deserialise.cxx:695
VP1Deserialise::decrementNumberOfInstantiations
static void decrementNumberOfInstantiations()
Definition
VP1Deserialise.cxx:95
VP1Deserialise::stream
QDataStream * stream()
Definition
VP1Deserialise.cxx:148
VP1Deserialise::restore
T restore()
Definition
VP1Deserialise.h:137
VP1Deserialise::widgetHandled
void widgetHandled(QWidget *)
Definition
VP1Deserialise.cxx:657
VP1Deserialise::version
qint32 version() const
Definition
VP1Deserialise.cxx:142
VP1Deserialise::restoreByTitle
void restoreByTitle(QToolBox *)
Definition
VP1Deserialise.cxx:385
VP1DrawOptionsWidget
Definition
VP1DrawOptionsWidget.h:25
VP1EtaPhiCutWidget
Definition
VP1EtaPhiCutWidget.h:26
VP1HelperClassBase::VP1HelperClassBase
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
Definition
VP1HelperClassBase.cxx:28
VP1HelperClassBase::messageVerbose
void messageVerbose(const QString &) const
Definition
VP1HelperClassBase.cxx:78
VP1HelperClassBase::message
void message(const QString &) const
Definition
VP1HelperClassBase.cxx:49
VP1HelperClassBase::messageDebug
void messageDebug(const QString &) const
Definition
VP1HelperClassBase.cxx:65
VP1MaterialButton
Definition
VP1MaterialButton.h:46
VP1Msg::debug
static bool debug()
Definition
VP1Msg.h:32
VP1Msg::verbose
static bool verbose()
Definition
VP1Msg.h:31
VP1QtInventorUtils::deserialiseSoMaterial
static bool deserialiseSoMaterial(QByteArray &, SoMaterial *&)
Definition
VP1QtInventorUtils.cxx:1184
count
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Definition
hcg.cxx:148
str
Definition
BTagTrackIpAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0