24 #include <QPushButton>
29 #include <QDoubleSpinBox>
30 #include <QRadioButton>
32 #include <QScrollArea>
35 #include <QButtonGroup>
38 #include <Inventor/C/errors/debugerror.h>
39 #include <Inventor/SbColor4f.h>
40 #include <Inventor/nodes/SoMaterial.h>
86 setObjectName(classname);
102 return par?
"On":
"Off";
109 for(
int i=0;
i<
l.count();++
i)
110 s+=
l.at(
i).toString()+(
i==
l.count()-1?
"":
", ");
118 p.getValue(
r,
g,
b,
a);
125 QString txt(enabledButton?enabledButton->text():launchButton->text());
126 txt.replace(
"&&",
"&");
128 dialog->setWindowIcon(QIcon(QString(
":/vp1/icons/icons/3d_32x32.png")));
129 launchButton->setMaximumHeight(
static_cast<int>(0.5+QFontMetricsF(launchButton->font()).height()*1.05+2));
130 launchButton->setMinimumHeight(launchButton->maximumHeight());
131 launchButton->setCheckable(
true);
133 QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
134 sizePolicy.setHorizontalStretch(0);
135 sizePolicy.setVerticalStretch(0);
136 sizePolicy.setHeightForWidth(launchButton->sizePolicy().hasHeightForWidth());
137 launchButton->setSizePolicy(sizePolicy);
138 launchButton->setFocusPolicy(Qt::NoFocus);
141 launchButton->setEnabled(enabledButton->isChecked());
149 dialog->installEventFilter(closeEventEater);
152 closeButton->setText(
"&Close");
153 closeButton->setToolTip(
"Close this dialog [Esc]");
154 connect(closeButton,SIGNAL(clicked()),dialog,SLOT(close()));
156 connect(
new QShortcut(QKeySequence(Qt::Key_Escape), dialog),SIGNAL(activated()),dialog,SLOT(close()));
177 message(
"ERROR: enabledButtonStateChanged() triggered with unrecognised sender() ="
178 +QString(sender()?sender()->objectName():
"NULL"));
188 if (di->
dialogWidget->windowState()==Qt::WindowMinimized)
205 message(
"ERROR: toggleDialogState() triggered with unrecognised sender() ="
206 +QString(sender()?sender()->objectName():
"NULL"));
212 if (oldvis&&di->
dialogWidget->windowState()==Qt::WindowMinimized) {
235 message(
"ERROR: Unexpected signal in collWidgetContentChanged slot!!");
238 QScrollArea* scrollarea =
dynamic_cast<QScrollArea*
>(
m_d->
collWidget->parent());
240 scrollarea =
dynamic_cast<QScrollArea*
>(
m_d->
collWidget->parent()->parent());
242 message(
"ERROR: m_d->collWidget not child or grandchild of a scroll area!!");
248 QScrollBar *
sb = scrollarea->verticalScrollBar();
251 scrollarea->setMinimumWidth(
width+2);
257 if (!scrollarea || !collWidget) {
258 message(
"ERROR: NULL scrollarea or collWidget");
261 QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
262 sizePolicy.setHorizontalStretch(0);
263 sizePolicy.setVerticalStretch(scrollarea->sizePolicy().verticalStretch());
264 sizePolicy.setHeightForWidth(scrollarea->sizePolicy().hasHeightForWidth());
265 scrollarea->setSizePolicy(sizePolicy);
267 collWidget->setContentsMargins(0,0,0,0);
268 if (!collWidget->children().isEmpty()&&collWidget->children().at(0)->isWidgetType()) {
269 static_cast<QWidget*
>(collWidget->children().at(0))->setContentsMargins(0,0,0,0);
271 scrollarea->setContentsMargins(0,0,0,0);
273 scrollarea->setWidgetResizable(
true);
274 scrollarea->setFrameShape(QFrame::NoFrame);
275 scrollarea->setFrameShadow(QFrame::Plain);
276 collWidget->setParent(scrollarea);
277 scrollarea->setWidget(collWidget);
278 scrollarea->viewport()->setContentsMargins(0,0,0,0);
279 scrollarea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
280 collWidget->setObjectName(objectName()+
"_CollWidget");
281 scrollarea->setObjectName(objectName()+
"_CollWidgetScrollArea");
289 QRadioButton * rb3,QRadioButton * rb4,QRadioButton * rb5,
290 QRadioButton * rb6,QRadioButton * rb7,QRadioButton * rb8,
293 QList<QRadioButton *>
l;
294 l << rb0 << rb1 << rb2 << rb3 << rb4 << rb5 << rb6 << rb7 << rb8 << rb9;
302 QRadioButton * rb_checked(0);
303 for (QRadioButton *
rb :
l) {
304 if (
rb->isChecked()) {
309 QButtonGroup * radiogroup =
new QButtonGroup(
this);
310 for (QRadioButton *
rb :
l)
311 radiogroup->addButton(
rb);
313 rb_checked->setChecked(
true);
397 s.warnUnrestored((QWidget*)(
this));
418 s.warnUnsaved((QWidget*)(
this));
440 message(
"ERROR: Null material button pointer");
443 QList<SoMaterial*> mats =
mb->handledMaterials();
444 if (mats.count()!=1) {
445 message(
"ERROR: No material in button "+
mb->objectName());