Questions tagged [qheaderview]

A QHeaderView is a class from the Qt Toolkit which provides a header row or header column for item views.

A QHeaderView displays the headers used in item views such as the QTableView and QTreeView classes. It uses Qt's model/view architecture for consistency with the other item view classes.

The header gets the data for each section from the underlying model. Each header has an orientation and a number of sections. A section refers to a part of the header - either a row or a column, depending on the orientation. The sections can be moved and resized, and can also be hidden and shown.

Each section of a header is described by a specified section ID, and can be located at a particular visual index in the header. A section can have a sort indicator, which indicates whether the items in the associated item view will be sorted in the order given by the section.

For horizontal headers, the section is equivalent to a column in the model, and for vertical headers, the section is equivalent to a row in the model.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

101 questions
0
votes
1 answer

QHeaderView mouse tracking fails

I need to connect some simple filter functionality, to a mouse click on a QTreeView header item. Simple enough, I implemented a slot function that connects to: QTreeView::header()->sectionClicked(int) After setting…
Basti Vagabond
  • 1,458
  • 1
  • 18
  • 26
0
votes
1 answer

Trim text in a table column header with sort indicator

I have a table with styled column headers. Header height is limited so the headers are actually narrow. The header has also the sort indicator (the default arrow/triangle). When the user changes the width of a column such that it is smaller than the…
ClimbingLung
  • 219
  • 2
  • 8
0
votes
0 answers

How to make QHeaderView editable like data in cells?

I'm using a QAbstractTableModel to edit a panda dataframe. Editing the contents of the table was easy but i can't find the way to rename columns and rows inplace(like the rest of the data in the table). How I can do that?
eemagic
  • 1
  • 2
0
votes
2 answers

Change QHeaderView data

I try to modify the text of my QHeaderView (Horizontal) in my QTableWidget. First question: Is it possible to set it editable like a QTableWidgetItem ? Second question: If it's not possible, how can I do that, I tried to repaint it like this: void…
Slot
  • 1,006
  • 2
  • 13
  • 27
0
votes
0 answers

How to make QHeaderView width synchronizing with parent

I subclassed QHeaderView for QTreeWidget and called setHeader with its object. Now the header has fixed width instead of width equaling to the parent width. How can I synchronize them?
Ufx
  • 2,595
  • 12
  • 44
  • 83
0
votes
1 answer

How can I write the text of QHeaderView's section into a file?

I'm trying to write an exporter, which takes in a QTableView and writes all its data into a .csv-file, so it can be viewed in MS Excel. Now I can't seem to find a way to read the text from the horizontal header's sections. There doesn't seem to be…
LarissaGodzilla
  • 620
  • 2
  • 10
  • 21
0
votes
1 answer

how to avoid leading spaces in qtreeview with qfilesystem model header text?

I am using QFileSystem Model with QTreeView, and I am able to change the text by sub classing QFileSystem model like this... QVariant customFileSystemModel::headerData(int section, Qt::Orientation…
Prady
  • 663
  • 3
  • 11
  • 28
0
votes
1 answer

Relative re-sizing of QTableWidget's columns

I am using a QTableWidget with 4-5 columns in a dialog. The dialog is resizable, I want table widget columns to resize according to dialog size i.e. if I increase dialog width, columns which are initially set with large width should expand more than…
Anwar Shaikh
  • 1,591
  • 3
  • 22
  • 43
0
votes
2 answers

vertical header labels in QTreeWidget

I have a QTreeWidget with horizontal header labels at the moment and my intention is to draw only the headerLabels vertically and the rest horizontally. I don't want to reimplement everything in QTreeWidgets's paintEvent method, so I am thinking…
Arnab Datta
  • 5,356
  • 10
  • 41
  • 67
0
votes
1 answer

How to set height of horizontal header QHeaderView?

I need adjust headers of two tables, standing near each other, because headers have different lines of text. It seems impossible. Please any help!
TatianaP
  • 177
  • 2
  • 10
-1
votes
1 answer

Sort Arrows Disappear When Subclassing QHeaderView

I am subclassing QHeaderView to add a filtering icon in the horizontal header of a QTableView. The QTableView has sorting capability activated consume a QSortFilterProxyModel, until now it works fine. However when I try to subclass QHeaderView and…
user2019716
  • 587
  • 4
  • 13
1 2 3 4 5 6
7