Search code examples
qtqwidget

Why `QComboBoxListView` documentation is not available at qt.io


I'm trying to get information about QComboBoxListView to understand that "How QComboBox and QComboBoxListView are related?".

I understand that, on GUI level, when we click on QComboBox then QComboBoxListView is shown as a drop-down. But "How QComboBoxListView is related to QComboBox and is shown when QComboBox is clicked?".

I suspect that, Qt creates QComboBoxListView and populate it with items of QComboBox. But not sure.

I'm not able to find information about it on Qts official documentation website doc.qt.io.

Moreover, in Google search also, I'm not able to find information about it, except the following link and I'm not sure about authenticity of presented information:
https://cep.xray.aps.anl.gov/software/qt4-x11-4.8.6-browser/df/d2d/class_q_combo_box_list_view.html

I'm interested in following information there:

  • Link for information about QComboBoxListView
  • How QComboBox and QComboBoxListView are related? Relationship diagram will be very helpful

I'm using Qt version 5.12.3


Solution

  • Well, as far as you are using Qt 5.x QComboBoxListView should not be available for direct usage (AFAIK it existed all by itself in Qt 4.8).

    If you check the Qt's code base, the mentioned class can be found in qcombobox_p.h which means it is a part of the QComboBox's implementation details. This header is commonly used for PIMPL of the widget and for some support/helper classes like in this case.

    It also means that there is no guarantee that in future versions of Qt that class would not change or perish. Why using it at all?


    There was also a question about relationship. Well, if there is some need to know that, sources show something like the following:

    1. QComboBox's private implementation (PIMPL) contains QComboBoxPrivateContainer (derived from QFrame)
    2. QComboBoxPrivateContainer contains some view, QComboBoxListView by default, it can be changed via the well-documented QComboBox::setView
    3. QComboBoxListView is an ancestor of QListView with some view options customized