Loading two columns at start in QColumnView

  • I would like to load two columns at start in QColumnView. In the first column with First level of rows. Second column with a particular row's children with a particular row being selected[ie., highlighted].

    I tried calling the createColumn with the model index of the row in first column. But it didn't work. Is there any way? However in tree view it looks straight forward with QTreeView.expand(QModelIndex). Any help is much appreciated.

  • have you tried something like columnView->selectionModel()->select(index,QItemSelectionModel::ClearAndSelect);?

  • @VRonin Yes, tried this already. It selects the row[with grey background - not with blue background] but the next column is not loaded.

    Even tried invoking the clicked() event on QColumnView with the desired index. It also failed.

  • Had a peak at the sources, the solution is:

    Not well documented, I agree

  • @VRonin That's Gr8. Works like a charm. Thanks much :)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.