Author: kmachalkova Date: Mon Jun 22 11:46:46 2009 New Revision: 57678 URL: http://svn.opensuse.org/viewcvs/yast?rev=57678&view=rev Log: Select the module by left mouse click (I think much of this drag'n'drop code can be dropped as we're in single selection mode anyway) Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.cpp branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.h branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.cpp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.cpp?rev=57678&r1=57677&r2=57678&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.cpp (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.cpp Mon Jun 22 11:46:46 2009 @@ -902,7 +902,7 @@ d->updateScrollbars(); } -void KCategorizedView::setSelection(const QRect &rect, +/*void KCategorizedView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags) { if (!d->proxyModel || !d->categoryDrawer || !d->proxyModel->isCategorizedModel()) @@ -1042,7 +1042,7 @@ selectionModel()->select(selection, flags); } -} +}*/ void KCategorizedView::mouseMoveEvent(QMouseEvent *event) { @@ -1158,29 +1158,32 @@ initialPressPosition.setY(initialPressPosition.y() + verticalOffset()); initialPressPosition.setX(initialPressPosition.x() + horizontalOffset()); - if ((selectionMode() != SingleSelection) && (selectionMode() != NoSelection) && + if (/*(selectionMode() != SingleSelection) && (selectionMode() != NoSelection) &&*/ (initialPressPosition == d->initialPressPosition)) { - foreach(const QString &category, d->categories) + /*foreach(const QString &category, d->categories) { if (d->categoryVisualRect(category).contains(event->pos()) && selectionModel()) { - QItemSelection selection = selectionModel()->selection(); + QItemSelection selection; = selectionModel()->selection(); QModelIndexList indexList = d->categoriesIndexes[category]; foreach (const QModelIndex &index, indexList) { QModelIndex selectIndex = index.model()->index(index.row(), 0); - - selection << QItemSelectionRange(selectIndex); + if( d->visualRectInViewport( selectIndex ).contains(initialPressPosition)) + { + selection << QItemSelectionRange(selectIndex); + //selectionModel()->select(selection, QItemSelectionModel::SelectCurrent); + //selectionModel()->setCurrentIndex(selectIndex, QItemSelectionModel::SelectCurrent); + selectionModel()->select(selectIndex, QItemSelectionModel::SelectCurrent); + } } - selectionModel()->select(selection, QItemSelectionModel::SelectCurrent); - - break; - } - } + //} + }*/ + selectionModel()->select( d->hovered, QItemSelectionModel::SelectCurrent); } QRect rect; Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.h?rev=57678&r1=57677&r2=57678&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.h (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/kcategorizedview.h Mon Jun 22 11:46:46 2009 @@ -70,8 +70,8 @@ virtual void resizeEvent(QResizeEvent *event); - virtual void setSelection(const QRect &rect, - QItemSelectionModel::SelectionFlags flags); + //virtual void setSelection(const QRect &rect, + // QItemSelectionModel::SelectionFlags flags); virtual void mouseMoveEvent(QMouseEvent *event); Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp?rev=57678&r1=57677&r2=57678&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp Mon Jun 22 11:46:46 2009 @@ -159,7 +159,6 @@ //QString tooltip = d->infoProvider.provideInfo( this, index ); QString tooltip = translatedPropertyValue(index, "GenericName").toString(); - qDebug() << "tooltip requested: " << tooltip; return tooltip; } else // otherwise just use the parent class -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org