本文整理汇总了C++中QListView::setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ QListView::setWindowTitle方法的具体用法?C++ QListView::setWindowTitle怎么用?C++ QListView::setWindowTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListView
的用法示例。
在下文中一共展示了QListView::setWindowTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//! [0]
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// Unindented for quoting purposes:
//! [1]
QStringList numbers;
numbers << "One" << "Two" << "Three" << "Four" << "Five";
QAbstractItemModel *model = new StringListModel(numbers);
//! [0] //! [1] //! [2] //! [3]
QListView *view = new QListView;
//! [2]
view->setWindowTitle("View onto a string list model");
//! [4]
view->setModel(model);
//! [3] //! [4]
model->insertRows(5, 7, QModelIndex());
for (int row = 5; row < 12; ++row) {
QModelIndex index = model->index(row, 0, QModelIndex());
model->setData(index, QString::number(row+1));
}
//! [5]
view->show();
return app.exec();
}
示例2: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QObject *parent = &app;
QStringList numbers;
numbers << "One" << "Two" << "Three" << "Four" << "Five";
QAbstractItemModel *stringListModel = new QStringListModel(numbers, parent);
//! [0]
QSortFilterProxyModel *filterModel = new QSortFilterProxyModel(parent);
filterModel->setSourceModel(stringListModel);
//! [0]
QWidget *window = new QWidget;
//! [1]
QListView *filteredView = new QListView;
filteredView->setModel(filterModel);
//! [1]
filteredView->setWindowTitle("Filtered view onto a string list model");
QLineEdit *patternEditor = new QLineEdit;
QObject::
connect(patternEditor, SIGNAL(textChanged(const QString &)),
filterModel, SLOT(setFilterRegExp(const QString &)));
QVBoxLayout *layout = new QVBoxLayout(window);
layout->addWidget(filteredView);
layout->addWidget(patternEditor);
window->show();
return app.exec();
}
示例3: main
int main( int argc, char** argv ) {
QApplication app( argc, argv );
CityEngine *engine = new CityEngine(QCoreApplication::instance());
CityTableModel *model = new CityTableModel(QCoreApplication::instance());
model->setInput(engine);
QListView* list = new QListView;
list->setModel( model );
list->setWindowTitle( "QListView" );
list->show();
QTreeView* tree = new QTreeView;
tree->setModel( model );
tree->setWindowTitle( "QTreeView" );
tree->show();
QTableView* table = new QTableView;
table->setModel( model );
table->setWindowTitle( "QTableView" );
table->show();
return app.exec();
}
示例4: main
int main(int argc, char **argv)
{
QApplication app(argc, argv);
//QCoreApplication app(argc, argv);
if(0)
{
ImageRecord rec("foobar.jpg");
rec.setImageId("abc");
ImageRecord::addRecord(&rec);
qDebug() << "New Record:"<<rec;
ImageRecord * rec2 = ImageRecord::retrieveImageId("abc");
qDebug() << "Record 'ABC':"<<rec2;
}
else
if(0)
{
QListView * lv = new QListView;
lv->setWindowTitle(IMAGEDB_FILE);
lv->setModel(ImageRecordListModel::instance());
lv->show();
}
else
{
ImageRecord * rec = ImageRecord::retrieve(99);
//rec->setFile("test.jpg");
qDebug() << "Record#1: "<<rec;
}
// ImageRecord::db().close();
return -1;
return app.exec();
}