|
ATLAS Offline Software
|
Go to the documentation of this file.
26 #include <Inventor/nodes/SoMaterial.h>
31 #include <QDataStream>
37 #include <QDoubleSpinBox>
41 #include <QRadioButton>
60 if (
w&&!
w->signalsBlocked()) {
61 w->blockSignals(
true);
77 +QString(
w->metaObject()->className())
78 +
", name="+
w->objectName());
109 if (!
m_d->
buffer->open(QIODevice::ReadOnly)) {
125 message(
"WARNING: warnUnrestored(..) was never called!");
127 message(
"Destructor WARNING: Buffer not at end!");
161 if (!
m||ba.isEmpty())
170 messageDebug(
"VP1Deserialise::restore(VP1MaterialButton)");
174 QList<SoMaterial*> mats =
mb ?
mb->handledMaterials() : QList<SoMaterial*>();
175 bool tempmat = mats.isEmpty() || !mats.at(0);
176 m = tempmat ?
new SoMaterial : mats.at(0);
181 mb->copyValuesFromMaterial(
m);
196 messageDebug(
"VP1Deserialise::restore(QColor) - name: " +
c.name());
207 messageDebug(
"VP1Deserialise::restore(VP1ColorSelectButton) - name: " + cb->objectName());
211 if (
c.isValid()&&cb&&cb->
color()!=
c) {
222 messageDebug(
"VP1Deserialise::restore(PhiSectionWidget) - name: " +
phi->objectName());
226 if (
phi&&ba != QByteArray()) {
248 messageDebug(
"VP1Deserialise::restore(QCheckBox) - name: " + cb->objectName());
260 if (cb->isChecked()!=
b) {
274 messageDebug(
"VP1Deserialise::restore(QGroupBox) - name: " + gb->objectName());
276 if (!gb->isCheckable())
277 message(
"WARNING: Asked to handled GroupBox which is not checkable: "+gb->objectName());
280 if (gb->isChecked()!=
b) {
291 messageDebug(
"VP1Deserialise::restore(QComboBox) - name: " + cb->objectName());
297 int i = cb->findText(
t);
298 if (i<0||i>cb->count()-1)
300 if (cb->currentIndex()!=
i) {
302 cb->setCurrentIndex(
i);
311 messageDebug(
"VP1Deserialise::restore(QLineEdit) - name: " + le->objectName());
326 messageDebug(
"VP1Deserialise::restore(QDoubleSpinBox) - name: " +
sb->objectName());
331 if (
sb->value()!=dbl) {
342 messageDebug(
"VP1Deserialise::restore(QSpinBox) - name: " +
sb->objectName());
347 if (
sb->value()!=
i) {
358 messageDebug(
"VP1Deserialise::restore(QSlider) - name: " +
s->objectName());
374 messageDebug(
"VP1Deserialise::restore(QToolBox) - name: " +
tb->objectName());
378 if (
i>=0&&i<tb->
count()&&
i!=
tb->currentIndex()) {
380 tb->setCurrentIndex(
i);
389 messageDebug(
"VP1Deserialise::restore(QToolBox) - name: " +
tb->objectName());
394 for (
int i = 0;
i <
tb->count(); ++
i) {
395 if (
tb->itemText(
i)==
s) {
400 if (itarget>0&&itarget<tb->
count()&&itarget!=
tb->currentIndex()) {
402 tb->setCurrentIndex(itarget);
463 QList<QRadioButton *>
l;
464 l << rb0 << rb1 << rb2 << rb3 << rb4 << rb5 << rb6 << rb7 << rb8 << rb9;
465 for (qint32
i = 0;
i <
l.count(); ++
i) {
468 messageDebug(
"VP1Deserialise::restore(QRadioButton) - name: " +
l.at(
i)->objectName());
474 if (ichecked<0||ichecked>=
l.count()||!
l.at(ichecked))
476 for (qint32
i = 0;
i <
l.count(); ++
i) {
477 QRadioButton *
rb =
l.at(
i);
478 if (
rb&&
rb->isChecked()!=(
i==ichecked)) {
480 rb->setChecked(
i==ichecked);
490 messageDebug(
"VP1Deserialise::restore(VP1CollectionWidget) - name: " + cw->objectName());
491 messageDebug(
"VP1Deserialise::restore(VP1CollectionWidget)- start...");
497 buffer.open(QIODevice::ReadOnly);
498 QDataStream state(&
buffer);
510 messageDebug(
"VP1Deserialise::restore(VP1CollectionWidget)- end.");
518 messageDebug(
"VP1Deserialise::restore(VP1CollectionSettingsButtonBase) - name: " +
w->objectName());
519 messageDebug(
"VP1Deserialise::restore(VP1CollectionSettingsButtonBase)- start...");
525 if (
w&&ba!=QByteArray()) {
527 w->restoreFromState(ba);
531 messageDebug(
"VP1Deserialise::restore(VP1CollectionSettingsButtonBase)- end.");
554 messageDebug(
"VP1Deserialise::restore(VP1EtaPhiCutWidget) - name: " +
w->objectName());
560 if (
w&&ba!=QByteArray()) {
562 w->restoreFromState(ba);
574 messageDebug(
"VP1Deserialise::restore(VP1DrawOptionsWidget) - name: " +
w->objectName());
580 if (
w&&ba!=QByteArray()) {
640 QPair<int,QList<int> > state;
651 messageDebug(
"VP1Deserialise::ignoreWidget(QWidget) - name: " +
w->objectName());
672 if (
w->inherits(
"QGroupBox"))
673 return static_cast<QGroupBox*
>(
w)->isCheckable();
675 return w->inherits(
"QCheckBox")
676 ||
w->inherits(
"QRadioButton")
677 ||
w->inherits(
"QComboBox")
678 ||
w->inherits(
"QAbstractSpinBox")
679 ||
w->inherits(
"QSlider")
680 ||
w->inherits(
"QToolBox")
681 ||
w->inherits(
"PhiSectionWidget")
682 ||
w->inherits(
"VP1EtaPhiCutWidget")
683 ||
w->inherits(
"VP1DrawOptionsWidget")
684 ||
w->inherits(
"QLineEdit")
685 ||
w->inherits(
"VP1ColorSelectButton")
686 ||
w->inherits(
"VP1MaterialButton");
709 if (
object->isWidgetType()&&!
object->objectName().startsWith(
"qt_")) {
710 QWidget * wid =
static_cast<QWidget*
>(
object);
712 QString
s(
"WARNING Unrestored widget of type: "+QString(wid->metaObject()->className())+
" and object name = "+wid->objectName());
722 for (QObject* o :
object->children())
QMap< QByteArray, QByteArray > VP1CollStates
virtual ~VP1Deserialise()
VP1Deserialise(const QByteArray &, IVP1System *sys=0)
QSet< QWidget * > ignoredWidgets
Scalar phi() const
phi method
void messageVerbose(const QString &) const
void disableUnrestoredChecks()
void restoreByTitle(QToolBox *)
VP1Deserialise * theclass
static void decrementNumberOfInstantiations()
static QString str(const QString &s)
void messageDebug(const QString &) const
static bool deserialiseSoMaterial(QByteArray &, SoMaterial *&)
void handle(const QWidget *w)
static unsigned numberOfInstantiations
static unsigned numberOfInstantiations()
QWidget * widgetNeedingUnblock
void widgetHandled(QWidget *)
void warnUnrestored(QObject *)
QSet< QWidget * > handledWidgets
const double mb
1mb to cm2
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
void ignoreObsoletePhiSectionWidgetState()
void message(const QString &) const
bool expectsPersistification(QWidget *w)
void ignoreWidget(QWidget *)
QByteArray restoreByteArray()