QTabWidget documenttion issue

Report any problems with CopperSpice
Post Reply
seasoned_geek
Posts: 254
Joined: Thu Jun 11 2020 12:18 pm

QTabWidget documenttion issue

Post 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.
ansel
Posts: 152
Joined: Fri Apr 10 2015 8:23 am

Re: QTabWidget documenttion issue

Post 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.
Ansel Sermersheim
CopperSpice Cofounder
seasoned_geek
Posts: 254
Joined: Thu Jun 11 2020 12:18 pm

Re: QTabWidget documenttion issue

Post 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.
Post Reply