@@ -1178,7 +1178,7 @@ WTableView::ColumnWidget *WTableView::columnContainer(int renderedColumn) const
11781178{
11791179 assert (ajaxMode ());
11801180
1181- if (renderedColumn < rowHeaderCount () && renderedColumn >= 0 )
1181+ if (renderedColumn < headerColumnsTable_ -> count () && renderedColumn >= 0 )
11821182 return dynamic_cast < ColumnWidget * >
11831183 (headerColumnsTable_ -> widget (renderedColumn ));
11841184 else if (table_ -> count () > 0 ) {
@@ -1187,7 +1187,7 @@ WTableView::ColumnWidget *WTableView::columnContainer(int renderedColumn) const
11871187 return dynamic_cast < ColumnWidget * > (table_ -> widget (table_ -> count () - 1 ));
11881188 else
11891189 return dynamic_cast < ColumnWidget * >
1190- (table_ -> widget (renderedColumn - rowHeaderCount ()));
1190+ (table_ -> widget (renderedColumn - headerColumnsTable_ -> count ()));
11911191 } else
11921192 return nullptr ;
11931193}
@@ -1297,11 +1297,11 @@ WWidget* WTableView::headerWidget(int column, bool contentsOnly)
12971297
12981298 if (ajaxMode ()) {
12991299 if (headers_ ) {
1300- if (column < rowHeaderCount ()) {
1300+ if (column < headerColumnsTable_ -> count ()) {
13011301 if (column < headerColumnsHeaderContainer_ -> count ())
13021302 result = headerColumnsHeaderContainer_ -> widget (column );
1303- } else if (column - rowHeaderCount () < headers_ -> count ())
1304- result = headers_ -> widget (column - rowHeaderCount ());
1303+ } else if (column - headerColumnsTable_ -> count () < headers_ -> count ())
1304+ result = headers_ -> widget (column - headerColumnsTable_ -> count ());
13051305 }
13061306 } else
13071307 if (plainTable_ && column < plainTable_ -> columnCount ())
@@ -1964,16 +1964,16 @@ int WTableView::renderedColumnsCount() const
19641964
19651965WWidget * WTableView ::itemWidget (const WModelIndex & index ) const
19661966{
1967- if ((index .column () < rowHeaderCount () || isColumnRendered (index .column ())) &&
1967+ if ((index .column () < headerColumnsTable_ -> count () || isColumnRendered (index .column ())) &&
19681968 isRowRendered (index .row ()))
19691969 {
19701970 int renderedRow = index .row () - firstRow ();
19711971 int renderedCol ;
19721972
1973- if (index .column () < rowHeaderCount ())
1973+ if (index .column () < headerColumnsTable_ -> count ())
19741974 renderedCol = index .column ();
19751975 else
1976- renderedCol = rowHeaderCount () + index .column () - firstColumn ();
1976+ renderedCol = headerColumnsTable_ -> count () + index .column () - firstColumn ();
19771977
19781978 if (ajaxMode ()) {
19791979 ColumnWidget * column = columnContainer (renderedCol );
@@ -2189,16 +2189,7 @@ void WTableView::setRowHeaderCount(int count)
21892189{
21902190 WAbstractItemView ::setRowHeaderCount (count );
21912191
2192- if (ajaxMode ()) {
2193- int total = 0 ;
2194- for (int i = 0 ; i < count ; i ++ )
2195- if (!columnInfo (i ).hidden )
2196- total += (int )columnInfo (i ).width .toPixels () + 7 ;
2197-
2198- headerColumnsContainer_ -> setWidth (total );
2199- headerColumnsContainer_ -> setHidden (count == 0 );
2200- headerColumnsHeaderContainer_ -> setHidden (count == 0 );
2201- }
2192+ scheduleRerender (RenderState ::NeedRerender );
22022193}
22032194
22042195EventSignal < WScrollEvent > & WTableView ::scrolled (){
0 commit comments