Hello,
this is my first post here, so hello to everyone.
I googled considerable amount of time for a solution to my problem, but was unable to find, so I decided to post here.
My application uses QTableView subclass (called VideoTableView), where columns should have proportional width:
first 50%, second 20%, etc.
I've reimplemented resizeEvent in my subclass, so when I resize widget containing my VideoTableView, columns width is updated (code below).
What I need, is to somehow intercept event or signal, when columns (not whole widget) in VideoTableView get resized. I found there is a slot QTableView::columnResized(), but I don't know, what event/signal triggers itd.
Code below is triggered in resizeEvent reimplemented in VideoTableView.
int tableWidth = width();
setColumnWidth(FilmTag::FileName, tableWidth*columnsWidth[FileName]/100);
setColumnWidth(FilmTag::TagList, tableWidth*columnsWidth[Tags]/100);
setColumnWidth(FilmTag::Size, tableWidth*columnsWidth[Size]/100);
int tableWidth = width();
setColumnWidth(FilmTag::FileName, tableWidth*columnsWidth[FileName]/100);
setColumnWidth(FilmTag::TagList, tableWidth*columnsWidth[Tags]/100);
setColumnWidth(FilmTag::Size, tableWidth*columnsWidth[Size]/100);
To copy to clipboard, switch view to plain text mode
columnsWidth is an array, which stores width of each column as a percentage of total width of VideoTableView. I'd like it to update when someone manually changes width of a column. If I don't, on another widget resize it would resize it's columns to predefined values.
Thank you upfront for any help.
Bookmarks