本文整理汇总了C++中QListView::clearSelection方法的典型用法代码示例。如果您正苦于以下问题:C++ QListView::clearSelection方法的具体用法?C++ QListView::clearSelection怎么用?C++ QListView::clearSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListView
的用法示例。
在下文中一共展示了QListView::clearSelection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bodyclicked
void MainWindow::bodyclicked(int bodyIndex)
{
indexSelected = bodyIndex;
QListView * objectList = findChild<QListView*>(QString("objectList"));
if(indexSelected == -1) //used clicked on empty space
{
objectList->clearSelection();
}
else
{
QModelIndex qIndex = objectListSource->index(indexSelected);
objectList->setCurrentIndex(qIndex);
}
}
示例2:
/**
* @brief MainWindow::setDocumentModel
*
* Will be called whe a new q2d::Project is created, to link the projects
* document model with the appropriate list view in the UI.
* @param model
*/
void
MainWindow::slot_setDocumentModel(QStandardItemModel* model) {
// close all tabs related to the old model
m_ui->schematicsTabWidget->clear();
QListView* documentView = m_ui->documentListView;
documentView->clearSelection();
QAbstractItemModel* oldModel = documentView->model();
m_ui->documentListView->setModel(model);
if (oldModel != nullptr) {
oldModel->disconnect();
oldModel->deleteLater();
}
}
示例3: clearSelection
void FileDialog::clearSelection()
{
QListView *view = findChild<QListView*>();
Q_ASSERT( view );
view->clearSelection();
}