11 setWindowTitle(
"Dock Widgets");
20 this, &MainWindow::updateText);
22 updateText(headingList->item(0));
23 headingList->setCurrentRow(0);
24 setCentralWidget(textBrowser);
27void MainWindow::setupContents()
29 QFile titlesFile(
":/Resources/titles.txt");
36 if (parts.size() != 2)
39 QString chapterTitle = parts[0];
52 }
while (titlesFile.isOpen());
57void MainWindow::setupDockWindow()
60 contentsWindow =
new QDockWidget(
tr(
"Table of Contents"),
this);
66 contentsWindow->setWidget(headingList);
70void MainWindow::setupMenus()
73 exitAct->setShortcut(
tr(
"Ctrl+Q"));
84 textBrowser->setHtml(
text);
The QAction class provides an abstraction for user commands that can be added to different user inter...
void setStatusTip(const QString &statusTip)
void triggered(bool checked=false)
This signal is emitted when an action is activated by the user; for example, when the user clicks a m...
static void quit()
\threadsafe
void setData(int key, const QVariant &value)
Sets this item's custom data for the key key to value.
void setFlags(GraphicsItemFlags flags)
Sets the item flags to flags.
QVariant data(int key) const
Returns this item's custom data for the key key as a QVariant.
The QMainWindow class provides a main application window.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
QString trimmed() const &
The QTextBrowser class provides a rich text browser with hypertext navigation.
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent