本文整理汇总了C++中QTreeView::scrollToBottom方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeView::scrollToBottom方法的具体用法?C++ QTreeView::scrollToBottom怎么用?C++ QTreeView::scrollToBottom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTreeView
的用法示例。
在下文中一共展示了QTreeView::scrollToBottom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createListView
QTreeView* OutputWidget::createListView(int id)
{
auto createHelper = [&]() -> QTreeView* {
KDevelop::FocusedTreeView* listview = new KDevelop::FocusedTreeView(this);
listview->setEditTriggers( QAbstractItemView::NoEditTriggers );
listview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); //Always enable the scrollbar, so it doesn't flash around
listview->setHeaderHidden(true);
listview->setUniformRowHeights(true);
listview->setRootIsDecorated(false);
listview->setSelectionMode( QAbstractItemView::ContiguousSelection );
if (data->outputdata.value(id)->behaviour & KDevelop::IOutputView::AutoScroll) {
listview->setAutoScrollAtEnd(true);
}
connect(listview, &QTreeView::activated, this, &OutputWidget::activate);
connect(listview, &QTreeView::clicked, this, &OutputWidget::activate);
return listview;
};
QTreeView* listview = 0;
if( !views.contains(id) )
{
bool newView = true;
if( data->type & KDevelop::IOutputView::MultipleView || data->type & KDevelop::IOutputView::HistoryView )
{
qCDebug(PLUGIN_STANDARDOUTPUTVIEW) << "creating listview";
listview = createHelper();
if( data->type & KDevelop::IOutputView::MultipleView )
{
tabwidget->addTab( listview, data->outputdata.value(id)->title );
} else
{
stackwidget->addWidget( listview );
stackwidget->setCurrentWidget( listview );
}
} else
{
if( views.isEmpty() )
{
listview = createHelper();
layout()->addWidget( listview );
} else
{
listview = views.begin().value();
newView = false;
}
}
views[id] = listview;
changeModel( id );
changeDelegate( id );
if (newView)
listview->scrollToBottom();
} else
{
listview = views.value(id);
}
enableActions();
return listview;
}