Page 1 of 1

QSplitter indexOf() documentation bug

Posted: Tue Feb 22 2022 10:44 am
by seasoned_geek
All,

https://www.copperspice.com/docs/cs_api/class_qsplitter.html#af5098f12ce71992b9f31c175a3492ff2
Returns the index in the splitter's layout of the specified widget. This also works for handles. Handles are numbered starting from 0. There are as many handles as there are child widgets, but the handle at position 0 is always hidden.
So what does it return when it fails? I would assume -1 but that could be a fatal assumption.

Re: QSplitter indexOf() documentation bug

Posted: Wed Feb 23 2022 2:48 am
by ansel
seasoned_geek wrote: Tue Feb 22 2022 10:44 am
Returns the index in the splitter's layout of the specified widget. This also works for handles. Handles are numbered starting from 0. There are as many handles as there are child widgets, but the handle at position 0 is always hidden.
So what does it return when it fails? I would assume -1 but that could be a fatal assumption.
Thanks for noticing this omission. The QSplitter::indexOf() method does indeed return -1 when the widget is not found, we will update the documentation.