[Interest] Tool tip for a QTableView column heading?

David Boosalis david.boosalis at gmail.com
Thu Apr 26 06:55:21 CEST 2012


Here is an example with a QTreeView, it should work for QTableView.


 _model = new ModelItemModel(this);
  setModel(_model);
  for(int i=0;i<NumColumns;i++) {
    headerItem[i] = new QStandardItem(headerLabel[i]);
    _model->setHorizontalHeaderItem(i,headerItem[i]);
    headerItem[i]->setToolTip(headerToolTips[i]);
  }

The above code is not complete, but I think you get the picture

-David

On Wed, Apr 25, 2012 at 2:38 PM, Carl Schumann <schumann at fnal.gov> wrote:

> Qt community,
>
> I would like to add tool tips to the column headings of a QTableView
> instance.   Is there a way to do this please?   I see that I can get a
> QHeaderView and add a tool tip to it but that would be for the whole set
> of headings not one tool tip for each heading, if I understand things
> correctly.    Thanks for any help please.
>
> Sincerely,
> Carl Schumann
> _______________________________________________
> 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/20120425/602bd608/attachment.html>


More information about the Interest mailing list