QComboBox Documentation Issue

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

QComboBox Documentation Issue

Post by seasoned_geek »

All,

Really wish we could put screen shots up here.

When you go here:
https://www.copperspice.com/docs/cs_api/class_qcombobox.html#ad327ec54dc1f47543d2407bdc28282fb

You see this
https://www.logikalsolutions.com/wordpress/wp-content/uploads/2023/08/Screenshot-from-2023-08-22-16-12-56.png

When you go here
https://www.copperspice.com/docs/cs_api/class_qcombobox.html

You see this
https://www.logikalsolutions.com/wordpress/wp-content/uploads/2023/08/Screenshot-from-2023-08-22-16-15-17.png

Note that cs_currentIndexChanged() isn't there. What is there is the old SIGNAL() SLOT() stuff for currentIndexChanged()
barbara
Posts: 443
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QComboBox Documentation Issue

Post by barbara »

The SIGNAL currentIndexChanged is overloaded however this is the name of the signal users should be looking for. The NOTIFY property you mentioned is showing our internal SIGNAL name. We will modify the documentation and not list the internal name.

Barbara
seasoned_geek
Posts: 242
Joined: Thu Jun 11 2020 12:18 pm

Re: QComboBox Documentation Issue

Post by seasoned_geek »

Well the internal name is currently the only one that works, so please leave it.
barbara
Posts: 443
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QComboBox Documentation Issue

Post by barbara »

We verified the method which emits the SIGNAL and both cs_currentIndexChanged(int) and currentIndexChange(int) are emitted. So you can use either one but for consistency it would be better to use the one without the prefix.

You mentioned there was an issue so I am including the connect() used our testing. The cs_mp_cast<> is only required to resolve overloads. There are two signals with the same name, one which passes an int and another which passes a QString.

Code: Select all

 connect(split_A, cs_mp_cast<int>(&QComboBox::currentIndexChanged), this,
      [] () { QMessageBox::information(nullptr, "Test Signal / Slot", "Signal was emitted"); }
 );
seasoned_geek
Posts: 242
Joined: Thu Jun 11 2020 12:18 pm

Re: QComboBox Documentation Issue

Post by seasoned_geek »

Did not get compile or runtime error, simply didn't work. The internal did work but I didn't really like so ripped out that code and rewrote to use currentTextChanged().

I have no doubt your internal testing shows "emitted." There were no connect errors what-so-ever yet the slot never got called.
barbara
Posts: 443
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: QComboBox Documentation Issue

Post by barbara »

Please email or post the exact code which did not trigger the slot method. We would like to test this and figure out what was not working.

Thanks,

Barbara
seasoned_geek
Posts: 242
Joined: Thu Jun 11 2020 12:18 pm

Re: QComboBox Documentation Issue

Post by seasoned_geek »

I don't have a snippet or nice test case for you. The code will be in one of these 3 check-ins if I still have it.

https://sourceforge.net/p/reddiamond/code/ci/e5dd3abd1afd66ecc270f1e94d2976fff408f332/log/?path=

78103c
c7cffc
933cb9

I might have found it and fixed it before the check-in though.
Post Reply