11#include <QAbstractItemModel>
12#include <QItemSelection>
13#include <QItemSelectionModel>
24 setWindowTitle(
"Selected Items in a Table Model");
41 selectionModel =
table->selectionModel();
44 setCentralWidget(
table);
47void MainWindow::fillSelection()
59void MainWindow::clearSelection()
67void MainWindow::selectAll()
virtual Q_INVOKABLE int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
virtual Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
virtual Q_INVOKABLE int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
virtual Q_INVOKABLE QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index.
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...
QModelIndexList selectedIndexes
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
The QMainWindow class provides a main application window.
QObject * parent() const
Returns a pointer to the parent object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
The QTableView class provides a default model/view implementation of a table view.
GLenum GLenum GLsizei void * table
QSqlQueryModel * model
[16]
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
mimeData setData("text/csv", csvData)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent