[Interest] hide entry in QComboBox

Qt Gardener qtgardener at gmail.com
Fri May 2 17:55:13 CEST 2014


You can use something like follows.

QComboBox *box = new QComboBox;
QListView *view = (QListView*)box->view()
view.setRowHidden(2,true)

//QAbstractItemView *view = box->view();




-Dheeru

@Community Service
On Fri, May 2, 2014 at 4:40 PM, André Somers <andre at familiesomers.nl> wrote:

> Harish Surana schreef op 2-5-2014 13:01:
> > Is there a way around to hide/show entries in QComboBox?
> You could use the model-view framework to do this. You can provide the
> entries that appear in the box via a model (a class derived from
> QAbstractItemModel). You can then filter that model using a
> QSortFilterProxyModel. What exactly the best way is, depends on your
> exact requirements.
>
>
> André
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140502/2eb44879/attachment.html>


More information about the Interest mailing list