本文整理汇总了C++中QTreeView::setExpandsOnDoubleClick方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeView::setExpandsOnDoubleClick方法的具体用法?C++ QTreeView::setExpandsOnDoubleClick怎么用?C++ QTreeView::setExpandsOnDoubleClick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTreeView
的用法示例。
在下文中一共展示了QTreeView::setExpandsOnDoubleClick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupGUI
void setupGUI()
{
QBoxLayout *layout = new QVBoxLayout(p);
tabWidget = new QTabWidget(p);
layout->addWidget(tabWidget);
QWidget *container = new QWidget(tabWidget);
tabWidget->addTab(container, QIcon::fromTheme(QStringLiteral("preferences-web-browser-identification")), i18n("Library"));
connect(tabWidget, &QTabWidget::currentChanged, p, &ZoteroBrowser::tabChanged);
QBoxLayout *containerLayout = new QVBoxLayout(container);
/// Personal or Group Library
QGridLayout *gridLayout = new QGridLayout();
containerLayout->addLayout(gridLayout);
gridLayout->setMargin(0);
gridLayout->setColumnMinimumWidth(0, 16); // TODO determine size of a radio button
radioPersonalLibrary = new QRadioButton(i18n("Personal library"), container);
gridLayout->addWidget(radioPersonalLibrary, 0, 0, 1, 2);
radioGroupLibrary = new QRadioButton(i18n("Group library"), container);
gridLayout->addWidget(radioGroupLibrary, 1, 0, 1, 2);
comboBoxGroupList = new KComboBox(false, container);
gridLayout->addWidget(comboBoxGroupList, 2, 1, 1, 1);
QSizePolicy sizePolicy = comboBoxGroupList->sizePolicy();
sizePolicy.setHorizontalPolicy(QSizePolicy::MinimumExpanding);
comboBoxGroupList->setSizePolicy(sizePolicy);
radioPersonalLibrary->setChecked(true);
comboBoxGroupList->setEnabled(false);
comboBoxGroupList->addItem(i18n("No groups available"));
connect(radioGroupLibrary, &QRadioButton::toggled, p, &ZoteroBrowser::radioButtonsToggled);
connect(radioPersonalLibrary, &QRadioButton::toggled, p, &ZoteroBrowser::radioButtonsToggled);
connect(comboBoxGroupList, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), p, &ZoteroBrowser::groupListChanged);
containerLayout->addStretch(10);
/// Credentials
QFormLayout *containerForm = new QFormLayout();
containerLayout->addLayout(containerForm, 1);
containerForm->setMargin(0);
lineEditNumericUserId = new KLineEdit(container);
lineEditNumericUserId->setSizePolicy(sizePolicy);
lineEditNumericUserId->setReadOnly(true);
containerForm->addRow(i18n("Numeric user id:"), lineEditNumericUserId);
connect(lineEditNumericUserId, &KLineEdit::textChanged, p, &ZoteroBrowser::invalidateGroupList);
lineEditApiKey = new KLineEdit(container);
lineEditApiKey->setSizePolicy(sizePolicy);
lineEditApiKey->setReadOnly(true);
containerForm->addRow(i18n("API key:"), lineEditApiKey);
connect(lineEditApiKey, &KLineEdit::textChanged, p, &ZoteroBrowser::invalidateGroupList);
QBoxLayout *containerButtonLayout = new QHBoxLayout();
containerLayout->addLayout(containerButtonLayout, 0);
containerButtonLayout->setMargin(0);
QPushButton *buttonGetOAuthCredentials = new QPushButton(QIcon::fromTheme(QStringLiteral("preferences-web-browser-identification")), i18n("Get New Credentials"), container);
containerButtonLayout->addWidget(buttonGetOAuthCredentials, 0);
connect(buttonGetOAuthCredentials, &QPushButton::clicked, p, &ZoteroBrowser::getOAuthCredentials);
containerButtonLayout->addStretch(1);
/// Collection browser
collectionBrowser = new QTreeView(tabWidget);
tabWidget->addTab(collectionBrowser, QIcon::fromTheme(QStringLiteral("folder-yellow")), i18n("Collections"));
collectionBrowser->setHeaderHidden(true);
collectionBrowser->setExpandsOnDoubleClick(false);
connect(collectionBrowser, &QTreeView::doubleClicked, p, &ZoteroBrowser::collectionDoubleClicked);
/// Tag browser
tagBrowser = new QListView(tabWidget);
tabWidget->addTab(tagBrowser, QIcon::fromTheme(QStringLiteral("mail-tagged")), i18n("Tags"));
connect(tagBrowser, &QListView::doubleClicked, p, &ZoteroBrowser::tagDoubleClicked);
}