/*! 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); }
ApplicationFilterModel::ApplicationFilterModel(QAbstractItemModel *sourceModel, QObject *parent) : QSortFilterProxyModel(parent) { PANORAMA_INITIALIZE(ApplicationFilterModel); setSourceModel(sourceModel); setRoleNames(sourceModel->roleNames()); }
MessageFilter::MessageFilter(MessageModel *source, const QList<BufferId> &buffers, QObject *parent) : QSortFilterProxyModel(parent), _validBuffers(buffers.toSet()), _messageTypeFilter(0) { init(); setSourceModel(source); }
HistoryFilterModel::HistoryFilterModel(QObject * parent) : QSortFilterProxyModel(parent) { setSourceModel(HistoryManager::historyManager()); setDynamicSortFilter(true); setFilterKeyColumn(-1); }
/****************************************************************************************** * NickViewFilter ******************************************************************************************/ NickViewFilter::NickViewFilter(const BufferId &bufferId, NetworkModel *parent) : QSortFilterProxyModel(parent), _bufferId(bufferId) { setSourceModel(parent); setDynamicSortFilter(true); setSortCaseSensitivity(Qt::CaseInsensitive); setSortRole(TreeModel::SortRole); }
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 &))); }
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); }
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); }
FileModel::FileModel(QObject *parent): QSortFilterProxyModel(parent), m_model(new QFileSystemModel(this)) { setDynamicSortFilter(true); setSourceModel(m_model); m_model->setNameFilterDisables(false); }
DevicesSortProxyModel::DevicesSortProxyModel(DevicesModel* devicesModel) : QSortFilterProxyModel(devicesModel) { setSourceModel(devicesModel); setSortRole(DevicesModel::StatusModelRole); connect(devicesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(sourceDataChanged(QModelIndex,QModelIndex))); sort(0); }
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 ); }
BufferViewOverlayFilter::BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay) : QSortFilterProxyModel(model), _overlay(0) { setOverlay(overlay); setSourceModel(model); setDynamicSortFilter(true); }
SourcesProxyModel::SourcesProxyModel( SourcesModel* model, QObject* parent ) : QSortFilterProxyModel( parent ) , m_model( model ) , m_filtered( false ) { setDynamicSortFilter( true ); setSourceModel( model ); }
ImapAccountListModel::ImapAccountListModel(QObject *parent) : QSortFilterProxyModel(parent) { accountListModel = new QMailAccountListModel(); accountListModel->setSynchronizeEnabled(true); setSourceModel(accountListModel); m_roles[AccountNameRole] = "accountName"; m_roles[AccountIdRole] = "accountId"; }
/** * 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; }
/** * 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; }
TaskSortFilter::TaskSortFilter(TaskModel *model, QObject* parent) : QSortFilterProxyModel(parent), m_model(model), filterOn(All), sortBy(SortPriority) { setSourceModel(model); setDynamicSortFilter(true); setFilterCaseSensitivity(Qt::CaseInsensitive); }
void SortFilterModel::setModel(QObject *model) { QAbstractItemModel* tmpModel = qobject_cast<QAbstractItemModel*>(model); if (tmpModel == NULL) return; setSourceModel(tmpModel); setSortRole(m_sortRole); setFilterRole(m_filterRole); }
BeerXMLSortProxyModel::BeerXMLSortProxyModel(QAbstractItemModel* sourceModel) : QSortFilterProxyModel(sourceModel) { if( sourceModel ) { setSourceModel(sourceModel); setDynamicSortFilter(true); sort(0); } }
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() ) ); }
SearchHistoryModel::SearchHistoryModel(QObject *parent) : QSortFilterProxyModel(parent), m_model(new QStringListModel(Settings::instance()->searchHistory(), this)), m_alignment(Qt::AlignCenter) { setSourceModel(m_model); setFilterCaseSensitivity(Qt::CaseInsensitive); setDynamicSortFilter(true); connect(Settings::instance(), SIGNAL(searchHistoryChanged()), this, SLOT(reload())); }
TorrentContentFilterModel::TorrentContentFilterModel(QObject *parent): QSortFilterProxyModel(parent), m_model(new TorrentContentModel(this)) { connect(m_model, SIGNAL(filteredFilesChanged()), this, SIGNAL(filteredFilesChanged())); setSourceModel(m_model); // Filter settings setFilterKeyColumn(TorrentContentModelItem::COL_NAME); setFilterRole(Qt::DisplayRole); setDynamicSortFilter(true); setSortCaseSensitivity(Qt::CaseInsensitive); }
ProxyBase::ProxyBase( AbstractModel *belowModel, QObject *parent ) : QSortFilterProxyModel( parent ) , m_belowModel( belowModel ) { setSourceModel( m_belowModel->qaim() ); // Proxy the Playlist::AbstractModel signals. // If you need to do something special in a subclass, disconnect() this signal and // do your own connect() call. connect( sourceModel(), SIGNAL(activeTrackChanged(quint64)), this, SIGNAL(activeTrackChanged(quint64)) ); connect( sourceModel(), SIGNAL(queueChanged()), this, SIGNAL(queueChanged()) ); }
MessageListModel::MessageListModel( const std::shared_ptr<Kullo::Api::Session> &session, ApiMirror::EventDispatcher &eventDispatcher, Kullo::id_type convId, QObject *parent) : QSortFilterProxyModel(parent) , source_(new MessageListSource(session, eventDispatcher, convId, nullptr)) { setSourceModel(source_.get()); sort(0, Qt::DescendingOrder); setDynamicSortFilter(true); }
QgsMapLayerProxyModel::QgsMapLayerProxyModel( QObject *parent ) : QSortFilterProxyModel( parent ) , mFilters( All ) , mExceptList( QList<QgsMapLayer*>() ) , mModel( new QgsMapLayerModel( parent ) ) { setSourceModel( mModel ); setDynamicSortFilter( true ); setSortLocaleAware( true ); setFilterCaseSensitivity( Qt::CaseInsensitive ); sort( 0 ); }
SeasideProxyModel::SeasideProxyModel(QObject *parent) { Q_UNUSED(parent); priv = new SeasideProxyModelPriv; priv->filterType = FilterAll; priv->localeHelper = LocaleUtils::self(); setDynamicSortFilter(true); setFilterKeyColumn(-1); setSourceModel(SeasidePeopleModel::instance()); sort(0, Qt::AscendingOrder); }
MessagesProxyModel::MessagesProxyModel(QObject *parent) : QSortFilterProxyModel(parent) { m_sourceModel = new MessagesModel(this); setObjectName(QSL("MessagesProxyModel")); setSortRole(Qt::EditRole); setSortCaseSensitivity(Qt::CaseInsensitive); setFilterCaseSensitivity(Qt::CaseInsensitive); setFilterKeyColumn(-1); setFilterRole(Qt::EditRole); setDynamicSortFilter(false); setSourceModel(m_sourceModel); }
EventModelFilter::EventModelFilter( CharmDataModel* model, QObject* parent ) : QSortFilterProxyModel( parent ) , m_model( model ) { setSourceModel( &m_model ); setDynamicSortFilter( true ); sort( 0, Qt::AscendingOrder ); connect( &m_model, SIGNAL( eventActivationNotice( EventId ) ), SIGNAL( eventActivationNotice( EventId ) ) ); connect( &m_model, SIGNAL( eventDeactivationNotice( EventId ) ), SIGNAL( eventDeactivationNotice( EventId ) ) ); }
ProxyTrackModel::ProxyTrackModel(QAbstractItemModel* pTrackModel, bool bHandleSearches) // ProxyTrackModel proxies settings requests to the composed TrackModel, // don't initialize its TrackModel with valid parameters. : TrackModel(QSqlDatabase(), ""), m_pTrackModel(dynamic_cast<TrackModel*>(pTrackModel)), m_currentSearch(""), m_bHandleSearches(bHandleSearches) { DEBUG_ASSERT_AND_HANDLE(m_pTrackModel && pTrackModel) { return; } setSourceModel(pTrackModel); }
QgsComposerProxyModel::QgsComposerProxyModel( QgsComposition *composition, QObject *parent ) : QSortFilterProxyModel( parent ) , mComposition( composition ) , mItemTypeFilter( QgsComposerItem::ComposerItem ) { if ( mComposition ) setSourceModel( mComposition->itemsModel() ); // TODO doesn't seem to work correctly - not updated when item changes setDynamicSortFilter( true ); setSortLocaleAware( true ); sort( QgsComposerModel::ItemId ); }