Forum Home
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    My FTC Wallet DIY\#2, report class

    Technical Development
    3
    7
    2274
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • lizhi
      lizhi last edited by

      I have a different purpose accounts,There are a number of transmit and receive daily,I need to count the daily changes in accounts, including the payment amount and the number of payments. So I developed a simple report class.

      800px-Report_1.jpg

      800px-Report_2.jpg

      I add reportview.h and reportview.cpp, Some of the code released. I intend to put them to use GridView to display, need to continue to improve . :)

      void ReportView::showTotal()

      {

      float fTotal=0;

      float iTotal=0;

      int i=0;

      QString addressname = “”;

      QVector addresslist;

      QVector totallist;

      QVector timelist;

      //accountReport from every address

      for (i=0;i

      {

      fTotal+=transactionProxyModel->data(transactionProxyModel->index(i,4)).toFloat();

      iTotal=transactionProxyModel->data(transactionProxyModel->index(i,4)).toFloat();

      addressname=transactionProxyModel->data(transactionProxyModel->index(i,3)).toString();

      int t = addresslist.indexOf(addressname);

      if (t != -1)

      {

      totallist[t]=totallist.at(t)+iTotal;

      timelist[t]=timelist.at(t)+1;

      }

      else

      {

      addresslist.append(addressname);

      totallist.append(iTotal);

      timelist.append(1);

      }

      }

      totalnumslWidget->setText(“Date:”+dateWidget->currentText()+" Type:“+typeWidget->currentText()+” “+QObject::tr(”%1").arg(fTotal)+" FTC");

      totaltimesWidget->setText(QObject::tr(“%1”).arg(i)+" times payment");

      QString account = “”;

      for (int i=0;i!=addresslist.size();++i)

      {

      account.append(addresslist.at(i)+" Total:“+QObject::tr(”%1").arg(totallist.at(i))+" “+QObject::tr(”%1").arg(timelist.at(i))+" times payment \n");

      rptTotal->setText(account);

      }

      }

      1 Reply Last reply Reply Quote 0
      • Wellenreiter
        Wellenreiter Moderators last edited by

        good work :)

        When your code ist stable and working well, will you send in a pull request on Github?

        If yes we could include it in the next wallet release

        Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
        Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

        1 Reply Last reply Reply Quote 0
        • lizhi
          lizhi last edited by

          Yes, If I completed those new feature, I will submit to Github.

          1 Reply Last reply Reply Quote 0
          • lizhi
            lizhi last edited by

            1) TransactionView , add Total, add new Date ranges for filter : Yesterday and LastWeek

            800px-Wallet_2.jpg

            2) Add ReportView , Total transaction records for each address

            800px-Wallet_1.jpg

            1 Reply Last reply Reply Quote 0
            • lizhi
              lizhi last edited by

              I will commit those code to GitHub ,at dev-0.8 .

              change file:

              \src\qt\walletview.h

              \src\qt\walletview.cpp

              \src\qt\walletframe.h

              \src\qt\walletframe.cpp

              \src\qt\walletstack.h

              \src\qt\walletstack.cpp

              \src\qt\bitcoingui.h

              \src\qt\bitcoingui.cpp

              \src\qt\transactionview.h

              \src\qt\transactionview.cpp

              \src\qt\bitcoin.qrc

              \src\qt\locale\bitcoin_zh_CN.ts

              add file:

              \src\qt\reportview.h

              \src\qt\reportview.cpp

              \src\qt\res\icons\account-report.png

              Account-report.png

              \src\qt\res\images\LOGO.png

              LOGO.png

              1 Reply Last reply Reply Quote 0
              • wrapper
                wrapper Moderators last edited by

                Cheers Lizhi, good idea.

                1 Reply Last reply Reply Quote 0
                • lizhi
                  lizhi last edited by

                  transactionview.cpp:

                  I add a QMenu ,“Trading Show this address” , It show this address all transaction record. This is more convenient, do not need to copy the address ^-^

                  I commit code to dev-0.8 in Github.

                  800px-QMenu.jpg

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post