本文整理汇总了C++中setSourceModel函数的典型用法代码示例。如果您正苦于以下问题:C++ setSourceModel函数的具体用法?C++ setSourceModel怎么用?C++ setSourceModel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setSourceModel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: QSortFilterProxyModel
ApplicationFilterModel::ApplicationFilterModel(QAbstractItemModel *sourceModel,
QObject *parent) :
QSortFilterProxyModel(parent)
{
PANORAMA_INITIALIZE(ApplicationFilterModel);
setSourceModel(sourceModel);
setRoleNames(sourceModel->roleNames());
}
示例3: QSortFilterProxyModel
MessageFilter::MessageFilter(MessageModel *source, const QList<BufferId> &buffers, QObject *parent)
: QSortFilterProxyModel(parent),
_validBuffers(buffers.toSet()),
_messageTypeFilter(0)
{
init();
setSourceModel(source);
}
示例4: QSortFilterProxyModel
HistoryFilterModel::HistoryFilterModel(QObject * parent)
: QSortFilterProxyModel(parent)
{
setSourceModel(HistoryManager::historyManager());
setDynamicSortFilter(true);
setFilterKeyColumn(-1);
}
示例5: QSortFilterProxyModel
/******************************************************************************************
* NickViewFilter
******************************************************************************************/
NickViewFilter::NickViewFilter(const BufferId &bufferId, NetworkModel *parent)
: QSortFilterProxyModel(parent),
_bufferId(bufferId)
{
setSourceModel(parent);
setDynamicSortFilter(true);
setSortCaseSensitivity(Qt::CaseInsensitive);
setSortRole(TreeModel::SortRole);
}
示例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 &)));
}
示例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);
}
示例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);
}
示例9: QSortFilterProxyModel
FileModel::FileModel(QObject *parent):
QSortFilterProxyModel(parent),
m_model(new QFileSystemModel(this))
{
setDynamicSortFilter(true);
setSourceModel(m_model);
m_model->setNameFilterDisables(false);
}
示例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);
}
示例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 );
}
示例12: QSortFilterProxyModel
BufferViewOverlayFilter::BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay)
: QSortFilterProxyModel(model),
_overlay(0)
{
setOverlay(overlay);
setSourceModel(model);
setDynamicSortFilter(true);
}
示例13: QSortFilterProxyModel
SourcesProxyModel::SourcesProxyModel( SourcesModel* model, QObject* parent )
: QSortFilterProxyModel( parent )
, m_model( model )
, m_filtered( false )
{
setDynamicSortFilter( true );
setSourceModel( model );
}
示例14: QSortFilterProxyModel
ImapAccountListModel::ImapAccountListModel(QObject *parent) :
QSortFilterProxyModel(parent)
{
accountListModel = new QMailAccountListModel();
accountListModel->setSynchronizeEnabled(true);
setSourceModel(accountListModel);
m_roles[AccountNameRole] = "accountName";
m_roles[AccountIdRole] = "accountId";
}
示例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;
}