void InputLayout::createTabOrder(uint index) { QWidget *widget = widgetAt(index); QWidget *preceding = (index == 0 ? m_preceding : widgetAt(index - 1)); QWidget *following = (static_cast(index + 1) == count() ? m_following : widgetAt(index + 1)); if (widget && preceding && following) { QWidget::setTabOrder(preceding, widget); QWidget::setTabOrder(widget, following); } }