+void findDirectChildren(QWidget* theParent, QList<QWidget*>& theWidgets, const bool theDebug)
+{
+ QList<QWidget*> aWidgets;
+
+ if (theParent) {
+ QLayout* aLayout = theParent->layout();
+ if (aLayout) {
+ for (int i = 0, aCount = aLayout->count(); i < aCount; i++) {
+ QLayoutItem* anItem = aLayout->itemAt(i);
+ QWidget* aWidget = anItem ? anItem->widget() : 0;
+ if (aWidget) {
+ if (aWidget->isVisible()) {
+ if (aWidget->focusPolicy() != Qt::NoFocus)
+ theWidgets.append(aWidget);
+ findDirectChildren(aWidget, theWidgets, false);
+ }
+ }
+ else if (anItem->layout()) {
+ QLayout* aLayout = anItem->layout();
+ for (int i = 0, aCount = aLayout->count(); i < aCount; i++) {
+ QLayoutItem* anItem = aLayout->itemAt(i);
+ QWidget* aWidget = anItem ? anItem->widget() : 0;
+ if (aWidget) {
+ if (aWidget->isVisible()) {
+ if (aWidget->focusPolicy() != Qt::NoFocus)
+ theWidgets.append(aWidget);
+ findDirectChildren(aWidget, theWidgets, false);
+ }
+ }
+ else {
+ // TODO: improve recursive search for the case when here QLayout is used
+ // currently, the switch widget uses only 1 level of qlayout in qlayout using for
+ // example for construction plane feature. If there are more levels,
+ // it should be implemented here
+ }
+ }
+ }
+ }
+ }
+ }
+#ifdef DEBUG_TAB_WIDGETS
+ if (theDebug) {
+ QStringList aWidgetTypes;
+ QList<QWidget*>::const_iterator anIt = theWidgets.begin(), aLast = theWidgets.end();
+ for (; anIt != aLast; anIt++) {
+ QWidget* aWidget = *anIt;
+ if (aWidget)
+ aWidgetTypes.append(aWidget->objectName());
+ }
+ QString anInfo = QString("theWidgets[%1]: %2")
+ .arg(theWidgets.count()).arg(aWidgetTypes.join(","));
+ qDebug(anInfo.toStdString().c_str());
+ }
+#endif
+}
+
+bool XGUI_PropertyPanel::setFocusNextPrevChild(bool theIsNext)
+{
+ return focusNextPrevChild(theIsNext);
+}
+