GSoC '21 KMyMoney : Identification Selector(QComboBox) unable to make work.

Thomas Baumgart thb at net-bembel.de
Sun Aug 15 21:56:35 BST 2021


Suraj,

  m_editIdSelector->currentData().toInt() != static_cast<int>(m_currentItem.idSelector())

does not work, as m_editIdSelector->currentData() returns the models Qt::Display role
which does not seem to be an int but a string. It might be better to use

  m_editIdSelector->currentIndex() != static_cast<int>(m_currentItem.idSelector())

Same here:

  m_currentItem.setIdSelector(static_cast<AlkOnlineQuoteSource::IdSelector>(m_editIdSelector->currentData().toInt()));

which should be

  m_currentItem.setIdSelector(static_cast<AlkOnlineQuoteSource::IdSelector>(m_editIdSelector->currentIndex()));

Hope that helps (the above written w/o compiling it, so it might have bugs).
Read https://doc.qt.io/qt-5/qcombobox.html#currentIndex-prop for more details.

Thomas


On Sonntag, 15. August 2021 19:33:38 CEST Suraj Kumar Mahto via Kde-finance-apps wrote:

> Hello, I am stuck for few days to make the IdSelector combo box work. The
> IdNumber entry works fine. I have tried to debug the same to find out the
> possible cause but wasn't able to figure it out.
> I have pushed the respective changes to
> https://invent.kde.org/surajsloth/alkimia/-/tree/gsoc21 Please direct me
> where I am going wrong.
> 
> Also, there isn't any enum type in AlkOnlineQuote::Errors::Type for the two
> members added. So, I need to add the same. Please correct me if I am wrong.
> 
> Regards
> Suraj Kumar Mahto
> 

-- 

Regards

Thomas Baumgart

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
Q: What did the drummer name his twin daughters? A: Anna one ... Anna Two ...
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-finance-apps/attachments/20210815/f353ea1f/attachment.sig>


More information about the Kde-finance-apps mailing list