Page 1 of 1

QTabWidget documenttion issue

Posted: Fri Mar 04 2022 12:42 am
by seasoned_geek
In case I didn't report this before

https://www.copperspice.com/docs/cs_api/class_qtabwidget.html#a439fc78d0153dd984cc9980b98ff45c7

====
void QTabWidget::setCurrentIndex ( int index )
slot

Sets the value of the property to index.
====

Do indexes start at zero or one?

Every place that documents an index needs to specify the starting value. Assuming zero can really burn a person.

Re: QTabWidget documenttion issue

Posted: Sun Mar 13 2022 3:34 am
by ansel
seasoned_geek wrote: Fri Mar 04 2022 12:42 am Do indexes start at zero or one?

Every place that documents an index needs to specify the starting value. Assuming zero can really burn a person.
In general, all indexes in C++ programs start from zero. The QTabWidget class conforms to this convention. We are not aware right now of any class in CopperSpice which uses an index starting with one.

Re: QTabWidget documenttion issue

Posted: Wed Mar 23 2022 1:05 pm
by seasoned_geek
In general, all indexes in C++ programs start from zero. The QTabWidget class conforms to this convention. We are not aware right now of any class in CopperSpice which uses an index starting with one.
Well see this discussion.

https://forum.copperspice.com/viewtopic.php?f=8&t=2006

Where "index = 0" is the default argument but it isn't an actual index, it is the entire enchilada. The first valid match index is 1.

From a documentation and developer standpoint one cannot assume 0 because, as in the case above, it gets a special value.