On 2012/11/08 09:23 AM, Alex Strickland wrote: > However, when the QTreeView gets long enough to automatically add a > scroll bar - my calculations don't work and one of the check box columns > is obscured by the scrollbar. How can I check if the scroll bar is > activated and, if so, obtain it's width to factor into my calculation?
I should write the message and just not send it... : class CrossTabTreeView : public QTreeView { public: CrossTabTreeView(QWidget* parent = 0) : QTreeView(parent) {} void resizeEvent(QResizeEvent* /*event - suppress unused warning*/) { if (model()->columnCount() == CrossTabView::ColumnCount) { int scrollBarWidth = 0; QScrollBar* scrollBar = verticalScrollBar(); if (scrollBar) { if (scrollBar->isVisible()) scrollBarWidth = scrollBar->width(); } resizeColumnToContents(CrossTabView::RowColumn); resizeColumnToContents(CrossTabView::ColumnColumn); setColumnWidth(CrossTabView::QuestionColumn, width() - columnWidth(CrossTabView::RowColumn) - columnWidth(CrossTabView::ColumnColumn) - scrollBarWidth); } } }; -- Regards Alex _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest