File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1893,6 +1893,14 @@ WModelIndex WTableView::modelIndexAt(WWidget *widget) const
18931893 return WModelIndex ();
18941894}
18951895
1896+ int WTableView ::visibleRowCount () const
1897+ {
1898+ if (ajaxMode ())
1899+ return viewportHeight_ / static_cast < int > (rowHeight ().toPixels ());
1900+ else
1901+ return renderedLastRow_ - renderedFirstRow_ ;
1902+ }
1903+
18961904WModelIndex WTableView ::translateModelIndex (bool headerColumns ,
18971905 const WMouseEvent & event )
18981906{
Original file line number Diff line number Diff line change @@ -158,6 +158,12 @@ class WT_API WTableView : public WAbstractItemView
158158 */
159159 WModelIndex modelIndexAt (WWidget *widget) const ;
160160
161+ /* ! \brief Returns the number of entirely visible rows.
162+ *
163+ * \note In plain HTML mode, it returns a guess based on the rendered rows.
164+ */
165+ int visibleRowCount () const ;
166+
161167 virtual EventSignal<WScrollEvent>& scrolled () override ;
162168
163169#ifdef WT_TEST_VISIBILITY
You can’t perform that action at this time.
0 commit comments