QTreeView *StManagerStudyListComp::createDirectoryTreeView ()
{
  QTreeView *directoryTree = new QTreeView;

  QDirModel *model = new QDirModel();
  model->setFilter( QDir::Dirs | QDir::NoDotAndDotDot | QDir::Drives );

  directoryTree->setModel( model );
  directoryTree->setColumnWidth( 0, 150 );
  // hide size and type in filesystem tree view
  directoryTree->setColumnHidden( 1, true );
  directoryTree->setColumnHidden( 2, true );

  return directoryTree;
}
示例#2
0
RecorderTool::RecorderTool(QWidget * parent) :
    AbstractTool(parent)
{
    QHBoxLayout * layout = new QHBoxLayout(this);

    // Model view
    QTreeView * view = new QTreeView(this);
    // TODO view->setModel(&m_model);
    layout->addWidget(view);
    view->setMaximumWidth(300);
    view->setColumnWidth(0, 210);

    setLayout(layout);

    setMinimumSize(650, 400);
}
ParametersFromFilesTool::ParametersFromFilesTool(QWidget * parent) :
    QWidget(parent), m_operation(NULL)
{
    QHBoxLayout * layout = new QHBoxLayout(this);

    // Model view
    QTreeView * view = new QTreeView(this);
    view->setModel(&m_model);
    layout->addWidget(view);
    view->setMaximumWidth(300);
    view->setColumnWidth(0, 210);

    // Files
    m_group = new qt::SortableGroup(this);
    m_group->setDelete(false);
    layout->addWidget(m_group);

    setLayout(layout);

    // widget signals
    connect(m_group,
            SIGNAL(deleteRequested(corbasim::qt::SortableGroupItem *)),
            this,
            SLOT(deleteRequested(corbasim::qt::SortableGroupItem *)));

    // connect model signals
    connect(&m_model,
            SIGNAL(checked(
                    OperationDescriptor_ptr,
                    const QList< int >&)),
            this,
            SLOT(createFilesItem(
                    OperationDescriptor_ptr,
                    const QList< int >&)));
    connect(&m_model,
            SIGNAL(unchecked(
                    OperationDescriptor_ptr,
                    const QList< int >&)),
            this,
            SLOT(deleteFilesItem(
                    OperationDescriptor_ptr,
                    const QList< int >&)));

    setMinimumSize(450, 300);
}
示例#4
0
int TreeView::setColumnWidth(lua_State * L) // ( int column, int width )
{
    QTreeView* obj = QtObject<QTreeView>::check( L, 1);
	obj->setColumnWidth( Util::toInt( L, 2 ), Util::toInt( L, 3 ) );
	return 0;
}