• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ setSelectionBehavior函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setSelectionBehavior函数的典型用法代码示例。如果您正苦于以下问题:C++ setSelectionBehavior函数的具体用法?C++ setSelectionBehavior怎么用?C++ setSelectionBehavior使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: QTreeWidget

//----------------------------------------------------------------------------------------
OfsTreeWidget::OfsTreeWidget(QWidget *parent, unsigned int capabilities, QStringList initialSelection) : QTreeWidget(parent), mCapabilities(capabilities) 
{
    mSelectedItems = initialSelection;
    mRecycleBinParent = NULL;

    setColumnCount(1);
    setHeaderHidden(true);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setSelectionBehavior(QAbstractItemView::SelectItems);
    setContextMenuPolicy(Qt::CustomContextMenu);
    setDragDropOverwriteMode(false);
    setAutoScroll(true);
    
    if(capabilities & CAP_ALLOW_DROPS)
        setDragDropMode(QAbstractItemView::DragDrop);

    mUnknownFileIcon = mOgitorMainWindow->mIconProvider.icon(QFileIconProvider::File);

    mFile = Ogitors::OgitorsRoot::getSingletonPtr()->GetProjectFile();
    mFile->addTrigger(this, OFS::_OfsBase::CLBK_CREATE, &triggerCallback);
    mFile->addTrigger(this, OFS::_OfsBase::CLBK_DELETE, &triggerCallback);

    refreshWidget();

    mAddFilesThread = new AddFilesThread();
    mExtractorThread = new ExtractorThread();
    connect(mAddFilesThread, SIGNAL(finished()), this, SLOT(threadFinished()));
    connect(mExtractorThread, SIGNAL(finished()), this, SLOT(threadFinished()));
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:30,代码来源:ofstreewidget.cpp


示例2: QTableView

QgsAttributeTableView::QgsAttributeTableView( QWidget *parent )
  : QTableView( parent )
  , mFilterModel( nullptr )
  , mFeatureSelectionModel( nullptr )
  , mFeatureSelectionManager( nullptr )
  , mActionPopup( nullptr )
  , mRowSectionAnchor( 0 )
  , mCtrlDragSelectionFlag( QItemSelectionModel::Select )
{
  QgsSettings settings;
  restoreGeometry( settings.value( QStringLiteral( "BetterAttributeTable/geometry" ) ).toByteArray() );

  //verticalHeader()->setDefaultSectionSize( 20 );
  horizontalHeader()->setHighlightSections( false );

  // We need mouse move events to create the action button on hover
  mTableDelegate = new QgsAttributeTableDelegate( this );
  setItemDelegate( mTableDelegate );

  setEditTriggers( QAbstractItemView::AllEditTriggers );

  setSelectionBehavior( QAbstractItemView::SelectRows );
  setSelectionMode( QAbstractItemView::ExtendedSelection );
  setSortingEnabled( true ); // At this point no data is in the model yet, so actually nothing is sorted.
  horizontalHeader()->setSortIndicatorShown( false ); // So hide the indicator to avoid confusion.

  verticalHeader()->viewport()->installEventFilter( this );

  connect( verticalHeader(), &QHeaderView::sectionPressed, this, [ = ]( int row ) { selectRow( row, true ); } );
  connect( verticalHeader(), &QHeaderView::sectionEntered, this, &QgsAttributeTableView::_q_selectRow );
  connect( horizontalHeader(), &QHeaderView::sectionResized, this, &QgsAttributeTableView::columnSizeChanged );
  connect( horizontalHeader(), &QHeaderView::sortIndicatorChanged, this, &QgsAttributeTableView::showHorizontalSortIndicator );
  connect( QgsGui::mapLayerActionRegistry(), &QgsMapLayerActionRegistry::changed, this, &QgsAttributeTableView::recreateActionWidgets );
}
开发者ID:exlimit,项目名称:QGIS,代码行数:34,代码来源:qgsattributetableview.cpp


示例3: QTableWidget

QQuestionsTableWidget::QQuestionsTableWidget(QWidget *parent,unsigned int rating, unsigned int choice_count) :
    QTableWidget(parent),
    RATING(rating),
    CHOICE_COUNT(choice_count),
    shortcut_new(QKeySequence(Qt::CTRL + Qt::Key_N),this)
{
    table_width = -1;
    QStringList sl;
    sl << tr("Вопрос");
    for (unsigned int i = 0; i < CHOICE_COUNT; i++)
        sl << tr("Ответ №%1").arg(QString::number(i + 1));
    sl << tr("Правильный ответ");
    if (RATING)
        sl << tr("Сложность");
    setColumnCount(sl.count());
    setHorizontalHeaderLabels(sl);
    initMenu();
    setSelectionBehavior(SelectRows);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    connect(this,SIGNAL(itemChanged(QTableWidgetItem*)),this,SIGNAL(signalNeedSave()));
    connect(&shortcut_new,SIGNAL(activated()),this,SLOT(addQuestionRow()));

}
开发者ID:ed-soiam,项目名称:Quiz,代码行数:25,代码来源:qquestionstablewidget.cpp


示例4: QTableView

QgsAttributeTableView::QgsAttributeTableView( QWidget *parent )
    : QTableView( parent )
    , mMasterModel( NULL )
    , mFilterModel( NULL )
    , mFeatureSelectionModel( NULL )
    , mFeatureSelectionManager( NULL )
    , mModel( NULL )
    , mActionPopup( NULL )
    , mLayerCache( NULL )
    , mRowSectionAnchor( 0 )
    , mCtrlDragSelectionFlag( QItemSelectionModel::Select )
{
  QSettings settings;
  restoreGeometry( settings.value( "/BetterAttributeTable/geometry" ).toByteArray() );

  //verticalHeader()->setDefaultSectionSize( 20 );
  horizontalHeader()->setHighlightSections( false );

  mTableDelegate = new QgsAttributeTableDelegate( this );
  setItemDelegate( mTableDelegate );

  setSelectionBehavior( QAbstractItemView::SelectRows );
  setSelectionMode( QAbstractItemView::ExtendedSelection );
  setSortingEnabled( true );

  verticalHeader()->viewport()->installEventFilter( this );

  connect( verticalHeader(), SIGNAL( sectionPressed( int ) ), this, SLOT( selectRow( int ) ) );
  connect( verticalHeader(), SIGNAL( sectionEntered( int ) ), this, SLOT( _q_selectRow( int ) ) );
}
开发者ID:dakcarto,项目名称:QGIS,代码行数:30,代码来源:qgsattributetableview.cpp


示例5: setColumnCount

CodeViewWidget::CodeViewWidget()
{
  setColumnCount(5);
  setShowGrid(false);
  setContextMenuPolicy(Qt::CustomContextMenu);
  setSelectionMode(QAbstractItemView::SingleSelection);
  setSelectionBehavior(QAbstractItemView::SelectRows);

  setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

  for (int i = 0; i < columnCount(); i++)
  {
    horizontalHeader()->setSectionResizeMode(i, QHeaderView::Fixed);
  }

  verticalHeader()->hide();
  horizontalHeader()->hide();
  horizontalHeader()->setStretchLastSection(true);

  setFont(Settings::Instance().GetDebugFont());

  Update();

  connect(this, &CodeViewWidget::customContextMenuRequested, this, &CodeViewWidget::OnContextMenu);
  connect(this, &CodeViewWidget::itemSelectionChanged, this, &CodeViewWidget::OnSelectionChanged);
  connect(&Settings::Instance(), &Settings::DebugFontChanged, this, &QWidget::setFont);
  connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this] {
    m_address = PC;
    Update();
  });

  connect(&Settings::Instance(), &Settings::ThemeChanged, this, &CodeViewWidget::Update);
}
开发者ID:MerryMage,项目名称:dolphin,代码行数:33,代码来源:CodeViewWidget.cpp


示例6: QTableView

TableView::TableView(QWidget *parent) : QTableView(parent)
{
    passModel = new PasswordModel;
    setModel(passModel);
    setSelectionBehavior(QAbstractItemView::SelectRows);
    show();
}
开发者ID:upcomingGit,项目名称:PasswordManager,代码行数:7,代码来源:tableview.cpp


示例7: TreeView

START_NS

ModelViewReadOnly::ModelViewReadOnly(QWidget * parent):
	TreeView(parent)
{
	setHeaderHidden(true);
	//header()->setResizeMode(QHeaderView::Stretch);
	setRootIsDecorated(false);
	setIndentation(0);
	setExpandsOnDoubleClick(true);
	setItemDelegateForColumn(0, new ModelTreeDelegate());
	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);

	setSelectionMode( SingleSelection );
	setSelectionBehavior(SelectRows);
	// we disable the provided dnd features,
	// as we use a proprietary solution
	setDragDropMode(QAbstractItemView::DragDrop);
	setDragEnabled(true);
	setAcceptDrops(false);


	overlay()->setText(tr("Please load a model"));

	connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(__clicked(QModelIndex)));
}
开发者ID:ohager,项目名称:kantalupe,代码行数:27,代码来源:ModelViewReadOnly.cpp


示例8: _column_config

DbTable::DbTable(list<ColumnConfig> cc,const litesql::Expr & expr,Wt::WContainerWidget * parent):
    Wt::Ext::TableView(parent),
    _column_config(cc),
    _sql(sql) {
    setBorder(false);
    model=new DbTableModel(cc,expr,parent);
    setModel(model);
    setAlternatingRowColors(true);
    resizeColumnsToContents(true);
    setHighlightMouseOver(true);
    setSelectionBehavior(Wt::SelectRows);
    setSelectionMode(Wt::SingleSelection);
    std::list<ColumnConfig>::iterator confit=cc.begin();
    for(int a=0; confit!=cc.end(); confit++, a++) {
//          enableColumnHiding(a, true);
//          setColumnSortable(a, true);
        setColumnWidth(a,(*confit).getWidth());
    }
    _clickCount=0;
    cellClicked().connect(SLOT(this,DbTable::itemSelected));
    doubleClickTimer=new Wt::WTimer(this);
    doubleClickTimer->setInterval(200);
    doubleClickTimer->timeout().connect(SLOT(this, DbTable::emitClickCount));

}
开发者ID:psychobob666,项目名称:MediaEncodingCluster,代码行数:25,代码来源:DbTable.cpp


示例9: QSortFilterProxyModel

UProcessView::UProcessView(QWidget *parent /*= 0*/)
:QTableView(parent)
,killProcessAction_(0)
,selectColumnAction_(0)
{
    //设置Model。
    QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
    UProcessModel *processModel = new UProcessModel(this);
    connect(this,SIGNAL(processTerminated(unsigned int)),processModel,SLOT(refresh()));

    proxyModel->setSourceModel(processModel);
    proxyModel->setDynamicSortFilter(true);
    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    setModel(proxyModel);
    setSortingEnabled(true);
    
    setSelectionBehavior(QAbstractItemView::SelectRows);
    horizontalHeader()->setStretchLastSection(true);
    verticalHeader()->hide();
    setSelectionMode(QAbstractItemView::SingleSelection);

    setContextMenuPolicy(Qt::ActionsContextMenu);
    setupActions();

    setupConnections();
}
开发者ID:gauldoth,项目名称:UniCore,代码行数:26,代码来源:UProcessView.cpp


示例10: QTableView

AvailableMusicView::AvailableMusicView(DataStore *dataStore, QWidget *parent):
  QTableView(parent),
  dataStore(dataStore)
{
  setEditTriggers(QAbstractItemView::NoEditTriggers);
  availableMusicModel = new MusicModel(getDataQuery(), dataStore, this);
  setModel(availableMusicModel);
//  horizontalHeader()->setStretchLastSection(true);
  configHeaders();
  setSelectionBehavior(QAbstractItemView::SelectRows);
  setContextMenuPolicy(Qt::CustomContextMenu);
  createActions();
  connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
    this, SLOT(handleContextMenuRequest(const QPoint&)));
  connect(
    this,
    SIGNAL(activated(const QModelIndex&)),
    this,
    SLOT(addSongToActivePlaylist(const QModelIndex&)));
  connect(
    dataStore,
    SIGNAL(availableSongsModified()),
    availableMusicModel,
    SLOT(refresh()));
}
开发者ID:jeung2,项目名称:UDJ,代码行数:25,代码来源:AvailableMusicView.cpp


示例11: QTreeView

KNMusicStoreAlbumTreeView::KNMusicStoreAlbumTreeView(QWidget *parent) :
    QTreeView(parent),
    m_mouseAnime(new QTimeLine(200, this))
{
    //Set properties.
    setAllColumnsShowFocus(true);
    setAlternatingRowColors(false); //We will use our own alternating drawing.
    setContentsMargins(0, 0, 0, 0);
    setFrameShape(QFrame::NoFrame);
    setIndentation(0);
    setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
    setSelectionBehavior(QAbstractItemView::SelectRows);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setUniformRowHeights(true);
    setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);

    //Configure the time line.
    m_mouseAnime->setEasingCurve(QEasingCurve::OutCubic);
    m_mouseAnime->setUpdateInterval(10);
    //Link the time line.
    connect(m_mouseAnime, &QTimeLine::frameChanged,
            this, &KNMusicStoreAlbumTreeView::onActionMouseInOut);

    //Initial the sense header.
    KNMouseSenseHeader *header=new KNMouseSenseHeader(this);
    header->setSectionsMovable(false);
    header->setSectionsClickable(false);
    header->setFixedHeight(38);
    setHeader(header);

    //Link with theme manager.
    connect(knTheme, &KNThemeManager::themeChange,
            this, &KNMusicStoreAlbumTreeView::onActionThemeUpdate);
}
开发者ID:ZhenZinian,项目名称:Mu,代码行数:34,代码来源:knmusicstorealbumtreeview.cpp


示例12: setSelectionMode

void OnlineList::createViewTitle()
{
	// 只允许单选
	setSelectionMode(QAbstractItemView::SingleSelection);
	
	// 每次选中一行
	setSelectionBehavior(QAbstractItemView::SelectRows);
	
	// 默认不允许用户编辑数据
	setEditTriggers(QAbstractItemView::NoEditTriggers);
	
	// 使列完全填充并平分
	horizontalHeader()->setResizeMode(QHeaderView::Stretch);
	
	// 数据头左对齐
	horizontalHeader()->setDefaultAlignment(Qt::AlignHCenter);
	
	// 隐藏左边垂直列号
	// verticalHeader()->setVisible(false);
	// 设置列数
	setColumnCount(3);
	
	// 设置不显示格子线
	setShowGrid(false);
	
	// 设置表头
	setHorizontalHeaderItem(0, new QTableWidgetItem(tr("昵称")));
	setHorizontalHeaderItem(1, new QTableWidgetItem(tr("主机名")));
	setHorizontalHeaderItem(2, new QTableWidgetItem(tr("IP地址")));
}
开发者ID:hurley25,项目名称:xylchat,代码行数:30,代码来源:OnlineList.cpp


示例13: setItemDelegate

SessionView::SessionView(QWidget *parent)
    : Utils::TreeView(parent)
{
    setItemDelegate(new RemoveItemFocusDelegate(this));
    setSelectionBehavior(QAbstractItemView::SelectRows);
    setSelectionMode(QAbstractItemView::SingleSelection);
    setWordWrap(false);
    setRootIsDecorated(false);

    setModel(&m_sessionModel);

    // Ensure that the full session name is visible.
    header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);

    QItemSelection firstRow(m_sessionModel.index(0,0), m_sessionModel.index(
        0, m_sessionModel.columnCount() - 1));
    selectionModel()->select(firstRow, QItemSelectionModel::QItemSelectionModel::
        SelectCurrent);

    connect(this, &Utils::TreeView::activated, [this](const QModelIndex &index){
        emit activated(m_sessionModel.sessionAt(index.row()));
    });
    connect(selectionModel(), &QItemSelectionModel::currentRowChanged, [this]
            (const QModelIndex &index) {
        emit selected(m_sessionModel.sessionAt(index.row()));
    });

    connect(&m_sessionModel, &SessionModel::sessionSwitched,
        this, &SessionView::sessionSwitched);
    connect(&m_sessionModel, &SessionModel::modelReset,
        this, &SessionView::selectActiveSession);
    connect(&m_sessionModel, &SessionModel::sessionCreated,
        this, &SessionView::selectSession);
 }
开发者ID:kai66673,项目名称:qt-creator,代码行数:34,代码来源:sessionview.cpp


示例14: QListView

ActionView::ActionView(QWidget * parent /*= nullptr*/)
    : QListView(parent)
    , mModel{new QStandardItemModel{this}}
    , mProxy{new QSortFilterProxyModel{this}}
    , mMaxItemsToShow(10)
{
    setEditTriggers(QAbstractItemView::NoEditTriggers);
    setSizeAdjustPolicy(AdjustToContents);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setSelectionBehavior(SelectRows);
    setSelectionMode(SingleSelection);

    SingleActivateStyle * s = new SingleActivateStyle;
    s->setParent(this);
    setStyle(s);
    mProxy->setSourceModel(mModel);
    mProxy->setDynamicSortFilter(true);
    mProxy->setFilterRole(FilterRole);
    mProxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
    mProxy->sort(0);
    {
        QScopedPointer<QItemSelectionModel> guard{selectionModel()};
        setModel(mProxy);
    }
    {
        QScopedPointer<QAbstractItemDelegate> guard{itemDelegate()};
        setItemDelegate(new DelayedIconDelegate{this});
    }
    connect(this, &QAbstractItemView::activated, this, &ActionView::onActivated);
}
开发者ID:jsm222,项目名称:lxqt-panel,代码行数:30,代码来源:actionview.cpp


示例15: setSelectionBehavior

void Sbrowse::configureView()
{
	setSelectionBehavior(QAbstractItemView::SelectRows);
	resizeColumnsToContents();
	horizontalHeader()->setStretchLastSection(true);
	selectRow(0);
}
开发者ID:newey499,项目名称:genlib,代码行数:7,代码来源:sbrowse.cpp


示例16: setItemDelegate

void TupFramesTable::setup()
{
    setItemDelegate(new TupFramesTableItemDelegate(this));
    setSelectionBehavior(QAbstractItemView::SelectItems);
    setSelectionMode(QAbstractItemView::SingleSelection);
    
    setHorizontalHeader(k->ruler);

    connect(this, SIGNAL(currentCellChanged(int, int, int, int)), this, SLOT(emitRequestSelectFrame(int, int, int, int)));

    connect(k->ruler, SIGNAL(logicalSectionSelected(int)), this, SLOT(emitFrameSelected(int)));

    // connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(emitFrameSelectionChanged()));

    connect(this, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), this, 
            SLOT(emitFrameSelected(QTableWidgetItem *, QTableWidgetItem *)));

    verticalHeader()->hide();
    
    setItemSize(10, 25);
    
    horizontalHeader()->setResizeMode(QHeaderView::Custom);
    verticalHeader()->setResizeMode(QHeaderView::Custom);

    // horizontalHeader()->setSectionResizeMode(QHeaderView::Custom);
    // verticalHeader()->setSectionResizeMode(QHeaderView::Custom);
}
开发者ID:nanox,项目名称:tupi,代码行数:27,代码来源:tupframestable.cpp


示例17: QTableWidget

pTableWidget::pTableWidget(QWidget *parent) :
    QTableWidget(parent),
    m_defaultSortedColumn(0)
{
    setSortingEnabled(true);

    QHeaderView *header;

    // Horizontal header
    header = horizontalHeader();
    header->setHighlightSections(false);
    header->setSortIndicatorShown(false);
    header->setDefaultSectionSize(50);
    header->show();

    // Vertical header
    header = verticalHeader();
    header->setDefaultSectionSize(21);
    header->hide();

    // Frame
    //setFrameStyle(QFrame::NoFrame);

    setSelectionMode(QAbstractItemView::SingleSelection);
    setSelectionBehavior(QAbstractItemView::SelectRows);
    setEditTriggers(QAbstractItemView::NoEditTriggers);

    setAlternatingRowColors(true);

    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));

    connect(horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(updateToolButtonNumber()));
}
开发者ID:qkthings,项目名称:qkwidget,代码行数:34,代码来源:ptablewidget.cpp


示例18: QTableView

FilmsViewList::FilmsViewList( QWidget* parent ) : QTableView( parent )
{
      // Appearance
    setAlternatingRowColors( true );
    setHorizontalScrollMode( QAbstractItemView::ScrollPerPixel );
    setSelectionBehavior( QAbstractItemView::SelectRows );
    setSelectionMode( QAbstractItemView::ExtendedSelection );
    setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );
    setEditTriggers( QAbstractItemView::NoEditTriggers );
    setContextMenuPolicy( Qt::CustomContextMenu );
    setSortingEnabled( true );
    setShowGrid( false );

    verticalHeader()->setVisible( false );
    horizontalHeader()->setSectionsMovable( true );
    horizontalHeader()->setHighlightSections( false );
    horizontalHeader()->setStretchLastSection( true );
    horizontalHeader()->setDefaultSectionSize( 50 );
    horizontalHeader()->setMinimumSectionSize( 20 );
    horizontalHeader()->setContextMenuPolicy( Qt::CustomContextMenu );

      // Signals
    connect( horizontalHeader(), &QHeaderView::customContextMenuRequested, this, &FilmsViewList::ShowHeaderContextMenu );

    connect( this, SIGNAL(activated(QModelIndex)), this, SIGNAL(CurrentActivated(QModelIndex)) );

    connect( this, &QTableView::customContextMenuRequested, this, [this] (const QPoint& pos)
    {
        if( currentIndex().isValid() )
        {
            emit ContextMenuRequested( pos, selectionModel()->currentIndex() );
        }
    });
}
开发者ID:david-geiger,项目名称:alexandra,代码行数:34,代码来源:filmsviewlist.cpp


示例19: QTableView

ActivePlaylistView::ActivePlaylistView(DataStore* dataStore, QWidget* parent):
  QTableView(parent),
  dataStore(dataStore)
{
  setContextMenuPolicy(Qt::CustomContextMenu);
  setFocusPolicy(Qt::TabFocus);
  setEditTriggers(QAbstractItemView::NoEditTriggers);
  model = new ActivePlaylistModel(getDataQuery(), dataStore, this);
  horizontalHeader()->setStretchLastSection(true);
  createActions();
  setModel(model);
  setSelectionBehavior(QAbstractItemView::SelectRows);
  setSelectionMode(QAbstractItemView::ContiguousSelection);
  configureHeaders();
  connect(
    dataStore,
    SIGNAL(activePlaylistModified()),
    model,
    SLOT(refresh()));
  connect(
    this,
    SIGNAL(activated(const QModelIndex&)),
    this,
    SLOT(setCurrentSong(const QModelIndex&)));
  connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
    this, SLOT(handleContextMenuRequest(const QPoint&)));
  connect(
    selectionModel(),
    SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
    this,
    SLOT(handleSelectionChange(const QItemSelection&, const QItemSelection&)));
}
开发者ID:UDJ,项目名称:UDJ-Desktop-Client,代码行数:32,代码来源:ActivePlaylistView.cpp


示例20: QTableView

FolderView::FolderView(QWidget *parent /*=0*/)
 : QTableView(parent)
{
  setObjectName("FolderView");

  //FileSystemModel *fsm = new FileSystemModel();
  //fsm->setRootPath(path);
  //fsm->setReadOnly(false);
  //fsm->setSorting( QDir::DirsFirst | QDir::IgnoreCase );
  //setModel(fsm);

  setSortingEnabled(false);
  setShowGrid(false);
  setWordWrap(false);
  setSelectionMode(QAbstractItemView::ExtendedSelection);
  setSelectionBehavior(QAbstractItemView::SelectRows);

  verticalHeader()->hide();
  horizontalHeader()->setSortIndicator(0, Qt::AscendingOrder);
  horizontalHeader()->setSortIndicatorShown(true);
  //horizontalHeader()->setClickable(true); // not qt 5.1

  connect(this, SIGNAL(doubleClicked(const QModelIndex &)),
          this, SLOT(doubleClicked(const QModelIndex &)));
  connect(this, SIGNAL(directoryLoaded(const QString &)),
          this, SLOT(directoryLoaded(const QString &)));
}
开发者ID:BackupTheBerlios,项目名称:open-egov-svn,代码行数:27,代码来源:FolderView.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setSerialNumber函数代码示例发布时间:2022-05-30
下一篇:
C++ setSelection函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap