#include <QAction>
#include <QApplication>
#include <QClipboard>
+#include <QTimer>
#include <memory>
#include <string>
/// Redefinition of virtual method
virtual QSize minimumSizeHint() const
{
- int aHeight = 2*QFontMetrics( font() ).height();
+ int aHeight = 4/*2*/*QFontMetrics( font() ).height();
QSize aSize = QListWidget::minimumSizeHint();
return QSize( aSize.width(), aHeight );
}
+
+#ifndef WIN32
+// The code is necessary only for Linux because
+//it can not update viewport on widget resize
+protected:
+ void resizeEvent(QResizeEvent* theEvent)
+ {
+ QListWidget::resizeEvent(theEvent);
+ QTimer::singleShot(5, viewport(), SLOT(repaint()));
+ }
+#endif
};
ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParent,
//********************************************************************
void ModuleBase_WidgetMultiSelector::onSelectionTypeChanged()
{
- activateSelection(true);
- activateFilters(true);
+ activateSelectionAndFilters(true);
QList<ModuleBase_ViewerPrs> anEmptyList;
// This method will call Selection changed event which will call onSelectionChanged
// To clear mySelection, myListControl and storeValue()
// Set focus to List control in order to make possible
// to use Tab key for transfer the focus to next widgets
myListControl->setCurrentRow(myListControl->model()->rowCount() - 1);
- myListControl->setFocus();
+ ModuleBase_Tools::setFocus(myListControl,
+ "ModuleBase_WidgetMultiSelector::onSelectionTypeChanged()");
}
//********************************************************************
aShapeTypeName = myTypeCombo->itemText(idx);
TopAbs_ShapeEnum aRefType = ModuleBase_Tools::shapeType(aShapeTypeName);
if(aRefType == theShapeType && idx != myTypeCombo->currentIndex()) {
- activateSelection(false);
- activateFilters(false);
+ activateSelectionAndFilters(false);
bool isBlocked = myTypeCombo->blockSignals(true);
myTypeCombo->setCurrentIndex(idx);
myTypeCombo->blockSignals(isBlocked);
- activateSelection(true);
- activateFilters(true);
+ activateSelectionAndFilters(true);
break;
}
}