KNewStuff
Go to the documentation of this file.
23 #include <QTreeWidget>
34 class ProviderItem :
public QTreeWidgetItem
38 QTreeWidgetItem(parent), mProvider(provider) {
62 QBoxLayout *topLayout =
new QVBoxLayout(topPage);
64 QLabel *description =
new QLabel(
i18n(
"Please select one of the providers listed below:"), topPage);
65 topLayout->addWidget(description);
69 topLayout->addWidget(mListWidget);
80 new ProviderItem(mListWidget, provider);
81 if (mListWidget->model()->rowCount() == 1) {
82 QModelIndex index = mListWidget->model()->index(0, 0);
83 mListWidget->selectionModel()->setCurrentIndex(index, QItemSelectionModel::Select);
84 }
else if (mListWidget->model()->rowCount() > 1) {
85 QModelIndex index = mListWidget->model()->index(0, 0);
86 mListWidget->selectionModel()->setCurrentIndex(index, QItemSelectionModel::Deselect);
92 QList<QTreeWidgetItem*> items = mListWidget->selectedItems();
93 ProviderItem *item =
static_cast<ProviderItem *
>(items.first());
101 m_provider = item->provider();
111 #include "providerdialog.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 22:02:24 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.