6int main(
int argc,
char *argv[])
12 numbers <<
"One" <<
"Two" <<
"Three" <<
"Four" <<
"Five";
18 filterModel->setSourceModel(stringListModel);
27 filteredView->setWindowTitle(
"Filtered view onto a string list model");
virtual void setModel(QAbstractItemModel *model)
Sets the model for the view to present.
The QApplication class manages the GUI application's control flow and main settings.
static int exec()
Enters the main event loop and waits until exit() is called, then returns the value that was set to e...
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment.
The QLineEdit widget is a one-line text editor.
void textChanged(const QString &)
This signal is emitted whenever the text changes.
The QListView class provides a list or icon view onto a model.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
The QSortFilterProxyModel class provides support for sorting and filtering data passed between anothe...
void setFilterWildcard(const QString &pattern)
Sets the wildcard expression used to filter the contents of the source model to the given pattern.
The QVBoxLayout class lines up widgets vertically.
QApplication app(argc, argv)
[0]