当前位置: 首页>>代码示例>>C++>>正文


C++ QTreeView::hideColumn方法代码示例

本文整理汇总了C++中QTreeView::hideColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeView::hideColumn方法的具体用法?C++ QTreeView::hideColumn怎么用?C++ QTreeView::hideColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTreeView的用法示例。


在下文中一共展示了QTreeView::hideColumn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createDockWindows

void MainWindow::createDockWindows() {
    /* Add HOL widget */
    QDockWidget *dock = new QDockWidget(tr("HOL Process"), this);
    dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
    mHOLWidget = new HOLWidget;
    dock->setWidget(mHOLWidget);
    addDockWidget(Qt::RightDockWidgetArea, dock);

    /* File System View */
    QDockWidget *fileDock = new QDockWidget(tr("Project"), this);
    fileDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
    mFileViewSplitter = new QSplitter;

    QFileSystemModel *fileSystemModel = new QFileSystemModel;
    fileSystemModel->setRootPath(QDir::currentPath());
    QItemSelectionModel *itemSelectionModel = new QItemSelectionModel(fileSystemModel);
    connect(itemSelectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(fileViewItemSelected(QModelIndex,QModelIndex)));

    QTreeView* tree = new QTreeView(mFileViewSplitter);
    tree->setModel(fileSystemModel);
    tree->setRootIndex(fileSystemModel->index(QDir::currentPath()));
    tree->setSelectionModel(itemSelectionModel);
    tree->hideColumn(2);
    tree->hideColumn(3);
    tree->hideColumn(1);
    fileDock->setWidget(mFileViewSplitter);
    addDockWidget(Qt::RightDockWidgetArea, fileDock);
}
开发者ID:c0nrad,项目名称:HOLIDE,代码行数:28,代码来源:mainwindow.cpp

示例2: buildFileBrowser

void MainWindow::buildFileBrowser()
{
    QString rootPath = qgetenv("HOME");
    this->drivesModel->setFilter(QDir::NoDotAndDotDot | QDir::Dirs);

    QTreeView *treeView = this->treeView = new QTreeView(this->ui->dockDir);
    treeView->setModel(this->drivesModel);
    treeView->setRootIndex(this->drivesModel->setRootPath(rootPath + "/../"));
    treeView->hideColumn(1);
    treeView->hideColumn(2);
    treeView->hideColumn(3);
    treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treeView->setDragEnabled(true);
    treeView->setDragDropMode(QAbstractItemView::DragOnly);
    this->ui->dockDir->setWidget(treeView);

    this->filesModel->setFilter(QDir::NoDotAndDotDot | QDir::Files);
    QListView *listView = this->listView = new QListView(this->ui->dockFile);
    listView->setModel(this->filesModel);
    listView->setRootIndex(this->filesModel->setRootPath(rootPath));
    listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    listView->setDragEnabled(true);
    listView->setSelectionMode(QAbstractItemView::ExtendedSelection);
    this->ui->dockFile->setWidget(listView);

    listView->show();
    treeView->show();
}
开发者ID:derselbst,项目名称:ANMP,代码行数:28,代码来源:mainwindow.cpp

示例3: QWidget

TimeWidget::TimeWidget(JointModel *model, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::TimeWidget),
    m_model(model),
    m_delegate(new JointDelegate(this)),
    m_leftProxy(new JointProxyModel(model, this)),
    m_rightProxy(new JointProxyModel(model, this))
{
    ui->setupUi(this);

    QTreeView *namesView = ui->namesView;
    QTreeView *timeLineView = ui->timeLineView;

    // Sync views
    connect(namesView->verticalScrollBar(), SIGNAL(valueChanged(int)), timeLineView->verticalScrollBar(), SLOT(setValue(int)));
    connect(timeLineView->verticalScrollBar(), SIGNAL(valueChanged(int)), namesView->verticalScrollBar(), SLOT(setValue(int)));
    connect(namesView, SIGNAL(expanded(QModelIndex)), SLOT(onExpanded(QModelIndex)));
    connect(namesView, SIGNAL(collapsed(QModelIndex)), SLOT(onCollapsed(QModelIndex)));

    // Configure names view
    m_leftProxy->showAnims(false);

    namesView->setModel(m_leftProxy);
//    namesView->setModel(model);
    namesView->setItemDelegate(m_delegate);
    namesView->setHeader(new JointHeaderView(false));
    namesView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    namesView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

    // Configure time line view
    JointHeaderView *header = new JointHeaderView(true);

    m_rightProxy->showVisibleColumn(false);
    m_rightProxy->showAnim(0);

    timeLineView->setModel(m_rightProxy);
    timeLineView->setItemDelegate(m_delegate);
    timeLineView->setHeader(header);
    timeLineView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    timeLineView->hideColumn(JointModel::NameColumn);
    timeLineView->setAutoScroll(false);
    timeLineView->setMouseTracking(true);
    timeLineView->setItemsExpandable(false);

    connect(timeLineView, SIGNAL(entered(QModelIndex)), SLOT(openEditor(QModelIndex)));
    connect(model->animModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), SLOT(resetEditor()));
    connect(model->animModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), SLOT(resetEditor()));
    connect(model->animModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(resetEditor()));

    connect(m_delegate, SIGNAL(currentFrameChanged(int)), header, SLOT(setCurrentFrame(int)));
    connect(header, SIGNAL(currentFrameChanged(int)), m_delegate, SLOT(setCurrentFrame(int)));
    connect(header, SIGNAL(currentFrameChanged(int)), timeLineView->viewport(), SLOT(update()));
    connect(header, SIGNAL(currentFrameChanged(int)), SIGNAL(currentFrameChanged(int)));

    // Configure push buttons
    connect(ui->frameCount, SIGNAL(pressed()), SLOT(showFrameCountDialog()));
    connect(ui->fps, SIGNAL(pressed()), SLOT(showFpsDialog()));

    // Initialize
    setCurrentAnim(-1);
}
开发者ID:skyrpex,项目名称:flatty,代码行数:61,代码来源:TimeWidget.cpp


注:本文中的QTreeView::hideColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。