myTextLine->setToolTip(aToolTip);
myTextLine->installEventFilter(this);
- myBasePalet = myTextLine->palette();
- myInactivePalet = myBasePalet;
- myInactivePalet.setBrush(QPalette::Base, QBrush(Qt::gray, Qt::Dense6Pattern));
- myTextLine->setPalette(myInactivePalet);
-
aLayout->addWidget(myTextLine, 1);
std::string aTypes = theData->getProperty("shape_types");
QList<QWidget*> ModuleBase_WidgetShapeSelector::getControls() const
{
QList<QWidget*> aControls;
- aControls.append(myLabel);
aControls.append(myTextLine);
return aControls;
}
myTextLine->setText(QString::fromStdString(aName));
} else {
if (myIsActive) {
- QString aMsg = tr("Select a ");
- int i = 0;
- foreach (QString aType, myShapeTypes) {
- if (i > 0)
- aMsg += " or ";
- aMsg += aType;
- i++;
- }
- myTextLine->setText(aMsg);
- } else
- myTextLine->setText(tr("No object selected"));
+ myTextLine->setText("");
+ }
}
}
void ModuleBase_WidgetShapeSelector::activateSelection(bool toActivate)
{
myIsActive = toActivate;
- if (myIsActive)
- myTextLine->setPalette(myBasePalet);
- else
- myTextLine->setPalette(myInactivePalet);
updateSelectionName();
if (myIsActive) {
bool ModuleBase_WidgetShapeSelector::focusTo()
{
activateSelection(true);
- return true;
+ return ModuleBase_ModelWidget::focusTo();
}
//********************************************************************