13 quitAction->setShortcut(
tr(
"Ctrl+Q"));
18 removeAction = itemsMenu->
addAction(
tr(
"&Remove Item"));
21 ascendingAction = itemsMenu->
addAction(
tr(
"Sort in &Ascending Order"));
22 descendingAction = itemsMenu->
addAction(
tr(
"Sort in &Descending Order"));
23 autoSortAction = itemsMenu->
addAction(
tr(
"&Automatically Sort Items"));
24 autoSortAction->setCheckable(
true);
27 findItemsAction->setShortcut(
tr(
"Ctrl+F"));
42 headers <<
tr(
"Subject") <<
tr(
"Default");
63void MainWindow::setupTreeItems()
97void MainWindow::findItems()
100 tr(
"Text to find (including wildcards):"));
120void MainWindow::insertItem()
128 tr(
"Input text for the new item:"));
146void MainWindow::removeItem()
168void MainWindow::sortAscending()
173void MainWindow::sortDescending()
184void MainWindow::updateSortItems()
186 ascendingAction->setEnabled(!autoSortAction->isChecked());
187 descendingAction->setEnabled(!autoSortAction->isChecked());
The QAction class provides an abstraction for user commands that can be added to different user inter...
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...
void setSelected(bool selected)
If selected is true and this item is selectable, this item is selected; otherwise,...
void setCentralWidget(QWidget *widget)
Sets the given widget to be the main window's central widget.
QObject * parent() const
Returns a pointer to the parent object.
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
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void setSortingEnabled(bool enable)
insertRed setText("insert red text")