nabil.me

Cross Platform Crypto Currency Tracker

January 11, 2018 #software

coinagecap

I built a cryptocurrency tracker for the desktop to experiment with building and deploying a Qt5 application. Getting the initial prototype ready was easy, but I quickly ran into a few problems integrating QML, JavaScript, and C++. Initially the entire application was written in QML, but I could not find an elegant way to sort and filter the list simultaneously, so I turned to the C++ class QSortFilterProxyModel. However, there are examples on sorting without filtering.

After exposing the QSortFilterProxyModel class to QML, I was able to define custom filters based on each item's name and "star" while also sorting based on multiple criteria. While this solution worked well, it broke data change animations because QSortFilterProxyModel does not emit the correct beginMoveRows() signal. This is something I don't have a solution for yet.

I am continually impressed by how much Qt has expanded their product. You can now build for embedded devices, Android, iOS, and all major desktop platforms. However, the trade-off for a standardized toolkit is inflexibility. Developing a plugin or adapter to the outside world — which could be calling a Java API on Android or calling Qt's C++ APIs from QML — will probably be required for moderately complex applications.

Source: https://github.com/nabilt/coinagecap

← Back to blog