Details
-
Bug
-
Resolution: Out of scope
-
P4: Low
-
4.5.3, 4.6.0
-
None
Description
When clicking on an index widget in an itemview that takes focus while another indexwidget has focus then it will not pass the focus on.
To reproduce with the following example, click on the first label, then click on the second label.
#include <QtGui> class ListWidget : public QTreeWidget { public: ListWidget() { setAcceptDrops(true); setDragEnabled(true); QTreeWidgetItem *tmp2 = new QTreeWidgetItem(this); tmp2->setText(0, "A QTreeWidgetItem"); addTopLevelItem(tmp2); QTreeWidgetItem *widgetContainer = new QTreeWidgetItem(this); addTopLevelItem(widgetContainer); QLabel *label = new QLabel("<a href=#>this is a link</a>", this); label->setFocusPolicy(Qt::ClickFocus); setItemWidget(widgetContainer, 0, label); QTreeWidgetItem *tmp3 = new QTreeWidgetItem(this); tmp3->setText(0, "A QTreeWidgetItem"); addTopLevelItem(tmp3); QTreeWidgetItem *widgetContainer2 = new QTreeWidgetItem(this); addTopLevelItem(widgetContainer2); QLabel *label2 = new QLabel("<a href=#>this is another link</a>", this); label2->setFocusPolicy(Qt::ClickFocus); setItemWidget (widgetContainer2, 0, label2); } }; int main(int argc, char **argv) { QApplication app(argc, argv); QApplication::setAttribute(Qt::AA_NativeWindows); ListWidget box; box.setFocus(); box.show(); return app.exec(); }