我在QTabBar.cpp源代码里找到这个函数,
首先第一句我读不明白,是什么意思呢?Q_D是什么函数,我找来找去都找不到它的定义
然后QTabBarPrivate是一个什么类?怎么在demo里搜索不到呢?
void QTabBar::setTabText(int index, const QString &text)
{
Q_D(QTabBar);
if (QTabBarPrivate::Tab *tab = d->at(index)) {
tab->text = text;
#ifndef QT_NO_SHORTCUT
releaseShortcut(tab->shortcutId);
tab->shortcutId = grabShortcut(QKeySequence::mnemonic(text));
setShortcutEnabled(tab->shortcutId, tab->enabled);
#endif
d->refresh();
}
}