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

C++ setSourceModel函数代码示例

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

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



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

示例1: Q_D

/*!
    Returns MIME data for the specified \a indexes in the model.
*/
QMimeData *QProxyModel::mimeData(const QModelIndexList &indexes) const
{
    Q_D(const QProxyModel);
    QModelIndexList lst;
    for (int i = 0; i < indexes.count(); ++i)
        lst.append(setSourceModel(indexes.at(i)));
    return d->model->mimeData(lst);
}
开发者ID:AlekSi,项目名称:phantomjs,代码行数:11,代码来源:qproxymodel.cpp


示例2: QSortFilterProxyModel

ApplicationFilterModel::ApplicationFilterModel(QAbstractItemModel *sourceModel,
                                               QObject *parent) :
    QSortFilterProxyModel(parent)
{
    PANORAMA_INITIALIZE(ApplicationFilterModel);
    setSourceModel(sourceModel);
    setRoleNames(sourceModel->roleNames());
}
开发者ID:Cloudef,项目名称:panorama,代码行数:8,代码来源:applicationfiltermodel.cpp


示例3: QSortFilterProxyModel

MessageFilter::MessageFilter(MessageModel *source, const QList<BufferId> &buffers, QObject *parent)
    : QSortFilterProxyModel(parent),
    _validBuffers(buffers.toSet()),
    _messageTypeFilter(0)
{
    init();
    setSourceModel(source);
}
开发者ID:2kah,项目名称:quassel,代码行数:8,代码来源:messagefilter.cpp


示例4: QSortFilterProxyModel

HistoryFilterModel::HistoryFilterModel(QObject * parent)
        : QSortFilterProxyModel(parent)
{
    setSourceModel(HistoryManager::historyManager());

    setDynamicSortFilter(true);
    setFilterKeyColumn(-1);
}
开发者ID:tasosbull,项目名称:yewtic,代码行数:8,代码来源:historyfiltermodel.cpp


示例5: QSortFilterProxyModel

/******************************************************************************************
 * NickViewFilter
 ******************************************************************************************/
NickViewFilter::NickViewFilter(const BufferId &bufferId, NetworkModel *parent)
    : QSortFilterProxyModel(parent),
    _bufferId(bufferId)
{
    setSourceModel(parent);
    setDynamicSortFilter(true);
    setSortCaseSensitivity(Qt::CaseInsensitive);
    setSortRole(TreeModel::SortRole);
}
开发者ID:AGBrown,项目名称:quassel-ABContrib,代码行数:12,代码来源:nickviewfilter.cpp


示例6: QSortFilterProxyModel

BufferModel::BufferModel(NetworkModel *parent)
  : QSortFilterProxyModel(parent),
    _selectionModelSynchronizer(this)
{
  setSourceModel(parent);
  if(Quassel::isOptionSet("debugbufferswitches")) {
    connect(_selectionModelSynchronizer.selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
	    this, SLOT(debug_currentChanged(const QModelIndex &, const QModelIndex &)));
  }
开发者ID:Yofel,项目名称:quassel-log-export,代码行数:9,代码来源:buffermodel.cpp


示例7: WalletWindowedItemModel

WindowedBlockModel::WindowedBlockModel(ICryptoNoteAdapter* _cryptoNoteAdapter, QAbstractItemModel* _blockChainModel,
  QObject* _parent) : WalletWindowedItemModel(BlockchainModel::ROLE_BLOCK_HEIGHT, _parent),
  m_cryptoNoteAdapter(_cryptoNoteAdapter) {
  setSourceModel(new FilteredBlockModel(m_cryptoNoteAdapter, _blockChainModel, this));
  setDynamicSortFilter(true);
  sort(BlockchainModel::COLUMN_BLOCK_HEIGHT, Qt::DescendingOrder);
  connect(sourceModel(), &QAbstractItemModel::rowsInserted, this, &WindowedBlockModel::blocksAdded);
  connect(sourceModel(), &QAbstractItemModel::rowsRemoved, this, &WindowedBlockModel::blocksRemoved);
}
开发者ID:BitcoinNero,项目名称:Archives2,代码行数:9,代码来源:WindowedBlockModel.cpp


示例8: QSortFilterProxyModel

qCheckboxFilterModel::qCheckboxFilterModel(QAbstractItemModel *src_mdl, int visible_col, int id_col, QObject *parent):
  QSortFilterProxyModel(parent),
  srcModel(src_mdl, parent),
  ShowCheckboxes(false),
  Checkboxed_Column(visible_col),
  Id_Column(id_col)
{
  setSourceModel(&srcModel);
}
开发者ID:aralex,项目名称:qtzoo,代码行数:9,代码来源:QCheckboxFilterModel.cpp


示例9: QSortFilterProxyModel

FileModel::FileModel(QObject *parent):
    QSortFilterProxyModel(parent),
    m_model(new QFileSystemModel(this))
{
    setDynamicSortFilter(true);
    setSourceModel(m_model);

    m_model->setNameFilterDisables(false);
}
开发者ID:e-Mole,项目名称:MoleGraph,代码行数:9,代码来源:FileModel.cpp


示例10: QSortFilterProxyModel

DevicesSortProxyModel::DevicesSortProxyModel(DevicesModel* devicesModel)
    : QSortFilterProxyModel(devicesModel)
{
    setSourceModel(devicesModel);
    setSortRole(DevicesModel::StatusModelRole);
    connect(devicesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
            this, SLOT(sourceDataChanged(QModelIndex,QModelIndex)));
    sort(0);
}
开发者ID:Bjoe,项目名称:kdeconnect-kde,代码行数:9,代码来源:devicessortproxymodel.cpp


示例11: QSortFilterProxyModel

QgsAttributeTableFilterModel::QgsAttributeTableFilterModel( QgsMapCanvas *canvas, QgsAttributeTableModel *sourceModel, QObject *parent )
  : QSortFilterProxyModel( parent )
  , mCanvas( canvas )
{
  setSourceModel( sourceModel );
  setDynamicSortFilter( true );
  setSortRole( QgsAttributeTableModel::SortRole );
  connect( layer(), &QgsVectorLayer::selectionChanged, this, &QgsAttributeTableFilterModel::selectionChanged );
}
开发者ID:anitagraser,项目名称:QGIS,代码行数:9,代码来源:qgsattributetablefiltermodel.cpp


示例12: QSortFilterProxyModel

BufferViewOverlayFilter::BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay)
    : QSortFilterProxyModel(model),
    _overlay(0)
{
    setOverlay(overlay);
    setSourceModel(model);

    setDynamicSortFilter(true);
}
开发者ID:sandsmark,项目名称:quassel-proxy,代码行数:9,代码来源:bufferviewoverlayfilter.cpp


示例13: QSortFilterProxyModel

SourcesProxyModel::SourcesProxyModel( SourcesModel* model, QObject* parent )
    : QSortFilterProxyModel( parent )
    , m_model( model )
    , m_filtered( false )
{
    setDynamicSortFilter( true );

    setSourceModel( model );
}
开发者ID:LittleForker,项目名称:tomahawk,代码行数:9,代码来源:sourcesproxymodel.cpp


示例14: QSortFilterProxyModel

ImapAccountListModel::ImapAccountListModel(QObject *parent) :
    QSortFilterProxyModel(parent)
{
    accountListModel = new QMailAccountListModel();
    accountListModel->setSynchronizeEnabled(true);
    setSourceModel(accountListModel);

    m_roles[AccountNameRole] = "accountName";
    m_roles[AccountIdRole] = "accountId";
}
开发者ID:ruedigergad,项目名称:synctoimap,代码行数:10,代码来源:imapaccountlistmodel.cpp


示例15: TextProxyModel

/**
 * Subset of the instantMessagingModel() with only plain text and HTML
 * messages. This model can be displayed directly to the user.
 */
QAbstractItemModel* Media::TextRecording::instantTextMessagingModel() const
{
    if (!d_ptr->m_pTextMessagesModel) {
        auto p = new TextProxyModel(const_cast<TextRecording*>(this));
        p->setSourceModel(instantMessagingModel());
        d_ptr->m_pTextMessagesModel = p;
    }

    return d_ptr->m_pTextMessagesModel;
}
开发者ID:eXcomm,项目名称:ring-lrc,代码行数:14,代码来源:textrecording.cpp


示例16: UnreadProxyModel

/**
 * Subset of the instantTextMessagingModel() with only unread plain text and HTML
 * messages. This model can be used to get the number of unread messages.
 */
QAbstractItemModel* Media::TextRecording::unreadInstantTextMessagingModel() const
{
    if (!d_ptr->m_pUnreadTextMessagesModel) {
        auto p = new UnreadProxyModel(instantTextMessagingModel());
        p->setSourceModel(instantTextMessagingModel());
        d_ptr->m_pUnreadTextMessagesModel = p;
    }

    return d_ptr->m_pUnreadTextMessagesModel;
}
开发者ID:eXcomm,项目名称:ring-lrc,代码行数:14,代码来源:textrecording.cpp


示例17: QSortFilterProxyModel

TaskSortFilter::TaskSortFilter(TaskModel *model, QObject* parent)
  : QSortFilterProxyModel(parent),
    m_model(model),
    filterOn(All),
    sortBy(SortPriority)
{
  setSourceModel(model);
  setDynamicSortFilter(true);
  setFilterCaseSensitivity(Qt::CaseInsensitive);
}
开发者ID:fluxer,项目名称:kde-extraapps,代码行数:10,代码来源:tasksortfilter.cpp


示例18: setSourceModel

void SortFilterModel::setModel(QObject *model)
{
    QAbstractItemModel* tmpModel = qobject_cast<QAbstractItemModel*>(model);
    if (tmpModel == NULL)
        return;
    setSourceModel(tmpModel);

    setSortRole(m_sortRole);
    setFilterRole(m_filterRole);
}
开发者ID:qt-labs,项目名称:talk-schedule,代码行数:10,代码来源:sortfiltermodel.cpp


示例19: QSortFilterProxyModel

BeerXMLSortProxyModel::BeerXMLSortProxyModel(QAbstractItemModel* sourceModel)
   : QSortFilterProxyModel(sourceModel)
{
   if( sourceModel )
   {
      setSourceModel(sourceModel);
      setDynamicSortFilter(true);
      sort(0);
   }
}
开发者ID:EvansMike,项目名称:brewtarget,代码行数:10,代码来源:BeerXMLSortProxyModel.cpp


示例20: QSortFilterProxyModel

QgsAttributeTableFilterModel::QgsAttributeTableFilterModel( QgsMapCanvas* canvas, QgsAttributeTableModel* sourceModel, QObject* parent )
    : QSortFilterProxyModel( parent )
    , mCanvas( canvas )
    , mFilterMode( ShowAll )
    , mSelectedOnTop( false )
{
  setSourceModel( sourceModel );
  setDynamicSortFilter( true );
  setSortRole( QgsAttributeTableModel::SortRole );
  connect( layer(), SIGNAL( selectionChanged() ), SLOT( selectionChanged() ) );
}
开发者ID:RenShuYuan,项目名称:UAVplatform,代码行数:11,代码来源:qgsattributetablefiltermodel.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setSpacing函数代码示例发布时间:2022-05-30
下一篇:
C++ setSortingEnabled函数代码示例发布时间: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