670 { |
670 { |
671 Q_Q(QColumnView); |
671 Q_Q(QColumnView); |
672 QAbstractItemView *view = 0; |
672 QAbstractItemView *view = 0; |
673 if (model->hasChildren(index)) { |
673 if (model->hasChildren(index)) { |
674 view = q->createColumn(index); |
674 view = q->createColumn(index); |
675 q->connect(view, SIGNAL(clicked(const QModelIndex &)), |
675 q->connect(view, SIGNAL(clicked(QModelIndex)), |
676 q, SLOT(_q_clicked(const QModelIndex &))); |
676 q, SLOT(_q_clicked(QModelIndex))); |
677 } else { |
677 } else { |
678 if (!previewColumn) |
678 if (!previewColumn) |
679 setPreviewWidget(new QWidget(q)); |
679 setPreviewWidget(new QWidget(q)); |
680 view = previewColumn; |
680 view = previewColumn; |
681 view->setMinimumWidth(qMax(view->minimumWidth(), previewWidget->minimumWidth())); |
681 view->setMinimumWidth(qMax(view->minimumWidth(), previewWidget->minimumWidth())); |
682 } |
682 } |
683 |
683 |
684 q->connect(view, SIGNAL(activated(const QModelIndex &)), |
684 q->connect(view, SIGNAL(activated(QModelIndex)), |
685 q, SIGNAL(activated(const QModelIndex &))); |
685 q, SIGNAL(activated(QModelIndex))); |
686 q->connect(view, SIGNAL(clicked(const QModelIndex &)), |
686 q->connect(view, SIGNAL(clicked(QModelIndex)), |
687 q, SIGNAL(clicked(const QModelIndex &))); |
687 q, SIGNAL(clicked(QModelIndex))); |
688 q->connect(view, SIGNAL(doubleClicked(const QModelIndex &)), |
688 q->connect(view, SIGNAL(doubleClicked(QModelIndex)), |
689 q, SIGNAL(doubleClicked(const QModelIndex &))); |
689 q, SIGNAL(doubleClicked(QModelIndex))); |
690 q->connect(view, SIGNAL(entered(const QModelIndex &)), |
690 q->connect(view, SIGNAL(entered(QModelIndex)), |
691 q, SIGNAL(entered(const QModelIndex &))); |
691 q, SIGNAL(entered(QModelIndex))); |
692 q->connect(view, SIGNAL(pressed(const QModelIndex &)), |
692 q->connect(view, SIGNAL(pressed(QModelIndex)), |
693 q, SIGNAL(pressed(const QModelIndex &))); |
693 q, SIGNAL(pressed(QModelIndex))); |
694 |
694 |
695 view->setFocusPolicy(Qt::NoFocus); |
695 view->setFocusPolicy(Qt::NoFocus); |
696 view->setParent(viewport); |
696 view->setParent(viewport); |
697 Q_ASSERT(view); |
697 Q_ASSERT(view); |
698 |
698 |