本文整理汇总了C++中QTreeView::setAnimated方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeView::setAnimated方法的具体用法?C++ QTreeView::setAnimated怎么用?C++ QTreeView::setAnimated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTreeView
的用法示例。
在下文中一共展示了QTreeView::setAnimated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QFileSystemModel model;
QWidget window;
QTreeView *tree = new QTreeView(&window);
tree->setMaximumSize(1000, 600);
QHBoxLayout *layout = new QHBoxLayout;
layout->setSizeConstraint(QLayout::SetFixedSize);
layout->addWidget(tree);
window.setLayout(layout);
model.setRootPath("");
tree->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
tree->setModel(&model);
tree->setAnimated(false);
tree->setIndentation(20);
tree->setSortingEnabled(true);
tree->header()->setStretchLastSection(false);
window.setWindowTitle(QObject::tr("Dir View"));
tree->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
window.show();
return app.exec();
}
示例2: QTableWidget
FileInspector::FileInspector(QString root, QWidget *parent) : QTableWidget(parent){
_model.setRootPath(root);
QTreeView *tree = new QTreeView(this);
tree->setModel(&_model);
tree->setRootIndex(_model.index(_model.rootPath()));
// look and feel
tree->setAnimated(true);
tree->setIndentation(10);
tree->setSortingEnabled(true);
tree->setFixedHeight(295);
}
示例3: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QDirModel model;
QTreeView tree;
tree.setModel(&model);
// Demonstrating look and feel features
tree.setAnimated(false);
tree.setIndentation(20);
tree.setSortingEnabled(true);
tree.setWindowTitle(QObject::tr("Dir View"));
tree.resize(640, 480);
tree.show();
return app.exec();
}