 |
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());
82 handle(
const_cast<QWidget*
>(
w));
111 if (!
m_d->
buffer->open(QIODevice::ReadOnly)) {
127 message(
"WARNING: warnUnrestored(..) was never called!");
129 message(
"Destructor WARNING: Buffer not at end!");
163 if (!
m||ba.isEmpty())
172 messageDebug(
"VP1Deserialise::restore(VP1MaterialButton)");
176 QList<SoMaterial*> mats =
mb ?
mb->handledMaterials() : QList<SoMaterial*>();
177 bool tempmat = mats.isEmpty() || !mats.at(0);
178 m = tempmat ?
new SoMaterial : mats.at(0);
183 mb->copyValuesFromMaterial(
m);
198 messageDebug(
"VP1Deserialise::restore(QColor) - name: " +
c.name());
209 messageDebug(
"VP1Deserialise::restore(VP1ColorSelectButton) - name: " + cb->objectName());
213 if (
c.isValid()&&cb&&cb->
color()!=
c) {
224 messageDebug(
"VP1Deserialise::restore(PhiSectionWidget) - name: " +
phi->objectName());
228 if (
phi&&ba != QByteArray()) {
230 phi->setState(std::move(ba));
250 messageDebug(
"VP1Deserialise::restore(QCheckBox) - name: " + cb->objectName());
262 if (cb->isChecked()!=
b) {
276 messageDebug(
"VP1Deserialise::restore(QGroupBox) - name: " + gb->objectName());
278 if (!gb->isCheckable())
279 message(
"WARNING: Asked to handled GroupBox which is not checkable: "+gb->objectName());
282 if (gb->isChecked()!=
b) {
293 messageDebug(
"VP1Deserialise::restore(QComboBox) - name: " + cb->objectName());
299 int i = cb->findText(
t);
300 if (i<0||i>cb->count()-1)
302 if (cb->currentIndex()!=
i) {
304 cb->setCurrentIndex(
i);
313 messageDebug(
"VP1Deserialise::restore(QLineEdit) - name: " + le->objectName());
328 messageDebug(
"VP1Deserialise::restore(QDoubleSpinBox) - name: " +
sb->objectName());
333 if (
sb->value()!=dbl) {
344 messageDebug(
"VP1Deserialise::restore(QSpinBox) - name: " +
sb->objectName());
349 if (
sb->value()!=
i) {
360 messageDebug(
"VP1Deserialise::restore(QSlider) - name: " +
s->objectName());
376 messageDebug(
"VP1Deserialise::restore(QToolBox) - name: " +
tb->objectName());
380 if (
i>=0&&i<tb->
count()&&
i!=
tb->currentIndex()) {
382 tb->setCurrentIndex(
i);
391 messageDebug(
"VP1Deserialise::restore(QToolBox) - name: " +
tb->objectName());
396 for (
int i = 0;
i <
tb->count(); ++
i) {
397 if (
tb->itemText(
i)==
s) {
402 if (itarget>0&&itarget<tb->
count()&&itarget!=
tb->currentIndex()) {
404 tb->setCurrentIndex(itarget);
465 QList<QRadioButton *>
l;
466 l << rb0 << rb1 << rb2 << rb3 << rb4 << rb5 << rb6 << rb7 << rb8 << rb9;
467 for (qint32
i = 0;
i <
l.count(); ++
i) {
470 messageDebug(
"VP1Deserialise::restore(QRadioButton) - name: " +
l.at(
i)->objectName());
476 if (ichecked<0||ichecked>=
l.count()||!
l.at(ichecked))
478 for (qint32
i = 0;
i <
l.count(); ++
i) {
479 QRadioButton *
rb =
l.at(
i);
480 if (
rb&&
rb->isChecked()!=(
i==ichecked)) {
482 rb->setChecked(
i==ichecked);
492 messageDebug(
"VP1Deserialise::restore(VP1CollectionWidget) - name: " + cw->objectName());
493 messageDebug(
"VP1Deserialise::restore(VP1CollectionWidget)- start...");
499 buffer.open(QIODevice::ReadOnly);
500 QDataStream state(&
buffer);
512 messageDebug(
"VP1Deserialise::restore(VP1CollectionWidget)- end.");
520 messageDebug(
"VP1Deserialise::restore(VP1CollectionSettingsButtonBase) - name: " +
w->objectName());
521 messageDebug(
"VP1Deserialise::restore(VP1CollectionSettingsButtonBase)- start...");
527 if (
w&&ba!=QByteArray()) {
529 w->restoreFromState(ba);
533 messageDebug(
"VP1Deserialise::restore(VP1CollectionSettingsButtonBase)- end.");
556 messageDebug(
"VP1Deserialise::restore(VP1EtaPhiCutWidget) - name: " +
w->objectName());
562 if (
w&&ba!=QByteArray()) {
564 w->restoreFromState(ba);
576 messageDebug(
"VP1Deserialise::restore(VP1DrawOptionsWidget) - name: " +
w->objectName());
582 if (
w&&ba!=QByteArray()) {
642 QPair<int,QList<int> > state;
653 messageDebug(
"VP1Deserialise::ignoreWidget(QWidget) - name: " +
w->objectName());
674 if (
w->inherits(
"QGroupBox"))
675 return static_cast<QGroupBox*
>(
w)->isCheckable();
677 return w->inherits(
"QCheckBox")
678 ||
w->inherits(
"QRadioButton")
679 ||
w->inherits(
"QComboBox")
680 ||
w->inherits(
"QAbstractSpinBox")
681 ||
w->inherits(
"QSlider")
682 ||
w->inherits(
"QToolBox")
683 ||
w->inherits(
"PhiSectionWidget")
684 ||
w->inherits(
"VP1EtaPhiCutWidget")
685 ||
w->inherits(
"VP1DrawOptionsWidget")
686 ||
w->inherits(
"QLineEdit")
687 ||
w->inherits(
"VP1ColorSelectButton")
688 ||
w->inherits(
"VP1MaterialButton");
711 if (
object->isWidgetType()&&!
object->objectName().startsWith(
"qt_")) {
712 QWidget * wid =
static_cast<QWidget*
>(
object);
714 QString
s(
"WARNING Unrestored widget of type: "+QString(wid->metaObject()->className())+
" and object name = "+wid->objectName());
724 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()