| 37 | } |
| 38 | |
| 39 | static void qwtSetTabOrder( |
| 40 | QWidget* first, QWidget* second, bool withChildren ) |
| 41 | { |
| 42 | QList< QWidget* > tabChain; |
| 43 | tabChain += first; |
| 44 | tabChain += second; |
| 45 | |
| 46 | if ( withChildren ) |
| 47 | { |
| 48 | QList< QWidget* > children = second->findChildren< QWidget* >(); |
| 49 | |
| 50 | QWidget* w = second->nextInFocusChain(); |
| 51 | while ( children.contains( w ) ) |
| 52 | { |
| 53 | children.removeAll( w ); |
| 54 | |
| 55 | tabChain += w; |
| 56 | w = w->nextInFocusChain(); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | for ( int i = 0; i < tabChain.size() - 1; i++ ) |
| 61 | { |
| 62 | QWidget* from = tabChain[i]; |
| 63 | QWidget* to = tabChain[i + 1]; |
| 64 | |
| 65 | const Qt::FocusPolicy policy1 = from->focusPolicy(); |
| 66 | const Qt::FocusPolicy policy2 = to->focusPolicy(); |
| 67 | |
| 68 | QWidget* proxy1 = from->focusProxy(); |
| 69 | QWidget* proxy2 = to->focusProxy(); |
| 70 | |
| 71 | from->setFocusPolicy( Qt::TabFocus ); |
| 72 | from->setFocusProxy( NULL); |
| 73 | |
| 74 | to->setFocusPolicy( Qt::TabFocus ); |
| 75 | to->setFocusProxy( NULL); |
| 76 | |
| 77 | QWidget::setTabOrder( from, to ); |
| 78 | |
| 79 | from->setFocusPolicy( policy1 ); |
| 80 | from->setFocusProxy( proxy1); |
| 81 | |
| 82 | to->setFocusPolicy( policy2 ); |
| 83 | to->setFocusProxy( proxy2 ); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | class QwtPlot::PrivateData |
| 88 | { |
no test coverage detected