qsplitter

How to force QAbstractItemView recalculate items sizeHints

☆樱花仙子☆ 提交于 2019-11-28 01:56:23
I have QListView and QTabWidget inside QSplitter. QListView is using custom model and custom delegates. In delegate I reimplemented paint and sizeHint methods. But when I resize view - height of elements doesn't recalculated. How can I fix it? Sample images: In google I found that it is possible to emit layoutChanged from the model, but I want only current view to be updated, because content of model doesn't change. Delegate code: void ChatItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const { painter->save(); ChatItem *item = static_cast

How to manage QSplitter in Qt Designer

我只是一个虾纸丫 提交于 2019-11-27 22:58:36
问题 When I press a button, I bring up a dialog where user select things and press 'Ok' at the end. I want a splitter in this dialog. Left pane will show tree and right will show something else. How do I do that right? From Qt example itself: QSplitter *splitter = new QSplitter(parent); QListView *listview = new QListView; QTreeView *treeview = new QTreeView; QTextEdit *textedit = new QTextEdit; splitter->addWidget(listview); splitter->addWidget(treeview); splitter->addWidget(textedit); So in this

How to force QAbstractItemView recalculate items sizeHints

a 夏天 提交于 2019-11-26 22:03:16
问题 I have QListView and QTabWidget inside QSplitter. QListView is using custom model and custom delegates. In delegate I reimplemented paint and sizeHint methods. But when I resize view - height of elements doesn't recalculated. How can I fix it? Sample images: In google I found that it is possible to emit layoutChanged from the model, but I want only current view to be updated, because content of model doesn't change. Delegate code: void ChatItemDelegate::paint( QPainter *painter, const