コード例 #1
0
ファイル: qproxymodel.cpp プロジェクト: AlekSi/phantomjs
/*!
    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
0
ApplicationFilterModel::ApplicationFilterModel(QAbstractItemModel *sourceModel,
                                               QObject *parent) :
    QSortFilterProxyModel(parent)
{
    PANORAMA_INITIALIZE(ApplicationFilterModel);
    setSourceModel(sourceModel);
    setRoleNames(sourceModel->roleNames());
}
コード例 #3
0
ファイル: messagefilter.cpp プロジェクト: 2kah/quassel
MessageFilter::MessageFilter(MessageModel *source, const QList<BufferId> &buffers, QObject *parent)
    : QSortFilterProxyModel(parent),
    _validBuffers(buffers.toSet()),
    _messageTypeFilter(0)
{
    init();
    setSourceModel(source);
}
コード例 #4
0
HistoryFilterModel::HistoryFilterModel(QObject * parent)
        : QSortFilterProxyModel(parent)
{
    setSourceModel(HistoryManager::historyManager());

    setDynamicSortFilter(true);
    setFilterKeyColumn(-1);
}
コード例 #5
0
/******************************************************************************************
 * NickViewFilter
 ******************************************************************************************/
NickViewFilter::NickViewFilter(const BufferId &bufferId, NetworkModel *parent)
    : QSortFilterProxyModel(parent),
    _bufferId(bufferId)
{
    setSourceModel(parent);
    setDynamicSortFilter(true);
    setSortCaseSensitivity(Qt::CaseInsensitive);
    setSortRole(TreeModel::SortRole);
}
コード例 #6
0
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
0
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
0
ファイル: QCheckboxFilterModel.cpp プロジェクト: aralex/qtzoo
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
0
ファイル: FileModel.cpp プロジェクト: e-Mole/MoleGraph
FileModel::FileModel(QObject *parent):
    QSortFilterProxyModel(parent),
    m_model(new QFileSystemModel(this))
{
    setDynamicSortFilter(true);
    setSourceModel(m_model);

    m_model->setNameFilterDisables(false);
}
コード例 #10
0
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
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 );
}
コード例 #12
0
BufferViewOverlayFilter::BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay)
    : QSortFilterProxyModel(model),
    _overlay(0)
{
    setOverlay(overlay);
    setSourceModel(model);

    setDynamicSortFilter(true);
}
コード例 #13
0
SourcesProxyModel::SourcesProxyModel( SourcesModel* model, QObject* parent )
    : QSortFilterProxyModel( parent )
    , m_model( model )
    , m_filtered( false )
{
    setDynamicSortFilter( true );

    setSourceModel( model );
}
コード例 #14
0
ImapAccountListModel::ImapAccountListModel(QObject *parent) :
    QSortFilterProxyModel(parent)
{
    accountListModel = new QMailAccountListModel();
    accountListModel->setSynchronizeEnabled(true);
    setSourceModel(accountListModel);

    m_roles[AccountNameRole] = "accountName";
    m_roles[AccountIdRole] = "accountId";
}
コード例 #15
0
ファイル: textrecording.cpp プロジェクト: eXcomm/ring-lrc
/**
 * 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;
}
コード例 #16
0
ファイル: textrecording.cpp プロジェクト: eXcomm/ring-lrc
/**
 * 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;
}
コード例 #17
0
TaskSortFilter::TaskSortFilter(TaskModel *model, QObject* parent)
  : QSortFilterProxyModel(parent),
    m_model(model),
    filterOn(All),
    sortBy(SortPriority)
{
  setSourceModel(model);
  setDynamicSortFilter(true);
  setFilterCaseSensitivity(Qt::CaseInsensitive);
}
コード例 #18
0
void SortFilterModel::setModel(QObject *model)
{
    QAbstractItemModel* tmpModel = qobject_cast<QAbstractItemModel*>(model);
    if (tmpModel == NULL)
        return;
    setSourceModel(tmpModel);

    setSortRole(m_sortRole);
    setFilterRole(m_filterRole);
}
コード例 #19
0
BeerXMLSortProxyModel::BeerXMLSortProxyModel(QAbstractItemModel* sourceModel)
   : QSortFilterProxyModel(sourceModel)
{
   if( sourceModel )
   {
      setSourceModel(sourceModel);
      setDynamicSortFilter(true);
      sort(0);
   }
}
コード例 #20
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() ) );
}
コード例 #21
0
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()));
}
コード例 #22
0
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);
}
コード例 #23
0
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()) );
}
コード例 #24
0
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);
}
コード例 #25
0
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 );
}
コード例 #26
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);
}
コード例 #27
0
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);
}
コード例 #28
0
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 ) ) );
}
コード例 #29
0
ファイル: proxytrackmodel.cpp プロジェクト: Frydac/mixxx
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);
}
コード例 #30
0
ファイル: qgscomposermodel.cpp プロジェクト: AM7000000/QGIS
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 );
}