21 , mProxyModel( nullptr )
27 connect( mProxyModel, SIGNAL( rowsInserted(
QModelIndex,
int,
int ) ),
this, SLOT( rowsChanged() ) );
28 connect( mProxyModel, SIGNAL( rowsRemoved(
QModelIndex,
int,
int ) ),
this, SLOT( rowsChanged() ) );
35 connect( mProxyModel, SIGNAL( rowsInserted(
QModelIndex,
int,
int ) ),
this, SLOT( rowsChanged() ) );
36 connect( mProxyModel, SIGNAL( rowsRemoved(
QModelIndex,
int,
int ) ),
this, SLOT( rowsChanged() ) );
66 void QgsComposerItemComboBox::indexChanged(
int i )
72 void QgsComposerItemComboBox::rowsChanged()
79 else if (
count() == 0 )
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
void setItem(const QgsComposerItem *item)
Sets the currently selected item in the combo box.
QgsComposerItemComboBox(QWidget *parent=nullptr, QgsComposition *composition=nullptr)
QgsComposerItemComboBox creates a combo box to display a list of items in a composition.
void setExceptedItemList(const QList< QgsComposerItem * > &exceptList)
Sets a list of specific items to exclude from the combo box.
void setComposition(QgsComposition *composition)
Sets the composition containing the items to list in the combo box.
A item that forms part of a map composition.
QModelIndex indexForItem(QgsComposerItem *item, const int column=0)
Returns the QModelIndex corresponding to a QgsComposerItem, if possible.
QList< QgsComposerItem *> exceptedItemList() const
Returns the list of specific items excluded from the combo box.
QgsComposerItem * item(int index) const
Return the item currently shown at the specified index within the combo box.
void setExceptedItemList(const QList< QgsComposerItem * > &exceptList)
Sets a list of specific items to exclude from the model.
QgsComposerItem * currentItem() const
Returns the item currently selected in the combo box.
QgsComposerItem::ItemType filterType() const
Returns the current item type filter, or QgsComposerItem::ComposerItem if no item type filter is set...
void setModelColumn(int visibleColumn)
QList< QgsComposerItem *> exceptedItemList() const
Returns the list of specific items excluded from the model.
QgsComposerModel * sourceLayerModel() const
Returns the QgsComposerModel used in this proxy model.
Graphics scene for map printing.
void setItemType(QgsComposerItem::ItemType itemType)
Sets a filter for the item type to show in the combo box.
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const
void setModel(QAbstractItemModel *model)
QgsComposerItem::ItemType itemType() const
Returns the filter for the item types to show in the combo box.
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
void setCurrentIndex(int index)
void itemChanged(QgsComposerItem *item)
Emitted whenever the currently selected item changes.
Allows for filtering a QgsComposerModel by item type.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setFilterType(QgsComposerItem::ItemType itemType)
Sets the item type filter.
void currentIndexChanged(int index)
QgsComposerItem * itemFromSourceIndex(const QModelIndex &sourceIndex) const
Returns the QgsComposerItem corresponding to an index from the source QgsComposerModel model...