本文整理汇总了C++中QListView::setSortColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ QListView::setSortColumn方法的具体用法?C++ QListView::setSortColumn怎么用?C++ QListView::setSortColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListView
的用法示例。
在下文中一共展示了QListView::setSortColumn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: text
QWidget *LayoutConfig::makeOptionsTab()
{
QListView *listView = widget->listOptions;
listView->setMinimumHeight(150);
listView->setSortColumn(-1);
listView->setColumnText(0, i18n("Options"));
listView->clear();
connect(listView, SIGNAL(clicked(QListViewItem *)), SLOT(changed()));
connect(listView, SIGNAL(clicked(QListViewItem *)), SLOT(updateOptionsCommand()));
connect(widget->chkEnableOptions, SIGNAL(toggled(bool)), SLOT(changed()));
connect(widget->checkResetOld, SIGNAL(toggled(bool)), SLOT(changed()));
connect(widget->checkResetOld, SIGNAL(toggled(bool)), SLOT(updateOptionsCommand()));
// Create controllers for all options
QDictIterator< char > it(m_rules->options());
OptionListItem *parent;
for(; it.current(); ++it)
{
if(!it.currentKey().contains(':'))
{
if(it.currentKey() == "ctrl" || it.currentKey() == "caps" || it.currentKey() == "altwin")
{
parent = new OptionListItem(listView, i18n(it.current()), QCheckListItem::RadioButtonController, it.currentKey());
OptionListItem *item = new OptionListItem(parent, i18n("None"), QCheckListItem::RadioButton, "none");
item->setState(QCheckListItem::On);
}
else
{
parent = new OptionListItem(listView, i18n(it.current()), QCheckListItem::CheckBoxController, it.currentKey());
}
parent->setOpen(true);
m_optionGroups.insert(i18n(it.currentKey().local8Bit()), parent);
}
}
it.toFirst();
for(; it.current(); ++it)
{
QString key = it.currentKey();
int pos = key.find(':');
if(pos >= 0)
{
OptionListItem *parent = m_optionGroups[key.left(pos)];
if(parent == NULL)
parent = m_optionGroups["misc"];
if(parent != NULL)
{
// workaroung for mistake in rules file for xkb options in XFree 4.2.0
QString text(it.current());
text = text.replace("Cap$", "Caps.");
if(parent->type() == QCheckListItem::RadioButtonController)
new OptionListItem(parent, i18n(text.utf8()), QCheckListItem::RadioButton, key);
else
new OptionListItem(parent, i18n(text.utf8()), QCheckListItem::CheckBox, key);
}
}
}
// scroll->setMinimumSize(450, 330);
return listView;
}