Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Trying to embed QtRpt in my app
Forum Updated to NodeBB v4.3 + New Features

Trying to embed QtRpt in my app

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
5 Posts 3 Posters 2.4k Views 2 Watching
  • 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.
  • P Offline
    P Offline
    Panoss
    wrote on last edited by
    #1

    I 'm trying to embed QtRpt (2.0.0) in my application.
    My first poblem is I can't compile the Demo (QtRptDemo.pro) that comes with it.
    I tried with Qt Creator 5.0.2 and 5.2.1.
    With 5.0.2 I get this error:

    ...\qtrptproject 2.0.0\qtrptproject\commonfiles\CommonClasses.h:30: error: C1083: Cannot open include file: 'QtMath': No such file or directory
    

    The code is this:

    #if QT_VERSION >= 0x50000
        #include <QtMath>
    #else
        #include <QtCore/qmath.h>
    #endif
    

    With 5.2.1:

    ...\QtRptProject 2.0.0\QtRptProject\CommonFiles\CommonClasses.cpp:920: error: C2668: 'floor' : ambiguous call to overloaded function
    G:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(567): could be 'long double floor(long double)'
    G:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(519): or       'float floor(float)'
    G:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(136): or       'double floor(double)'
    while trying to match the argument list '(int)'
    
    
    ...\QtRptProject 2.0.0\QtRptProject\QtRPT\qtrpt.cpp:758: error: C2143: syntax error : missing ',' before ':'
    
    and a few more...
    

    Help!!! :)

    K 1 Reply Last reply
    0
    • P Panoss

      I 'm trying to embed QtRpt (2.0.0) in my application.
      My first poblem is I can't compile the Demo (QtRptDemo.pro) that comes with it.
      I tried with Qt Creator 5.0.2 and 5.2.1.
      With 5.0.2 I get this error:

      ...\qtrptproject 2.0.0\qtrptproject\commonfiles\CommonClasses.h:30: error: C1083: Cannot open include file: 'QtMath': No such file or directory
      

      The code is this:

      #if QT_VERSION >= 0x50000
          #include <QtMath>
      #else
          #include <QtCore/qmath.h>
      #endif
      

      With 5.2.1:

      ...\QtRptProject 2.0.0\QtRptProject\CommonFiles\CommonClasses.cpp:920: error: C2668: 'floor' : ambiguous call to overloaded function
      G:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(567): could be 'long double floor(long double)'
      G:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(519): or       'float floor(float)'
      G:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(136): or       'double floor(double)'
      while trying to match the argument list '(int)'
      
      
      ...\QtRptProject 2.0.0\QtRptProject\QtRPT\qtrpt.cpp:758: error: C2143: syntax error : missing ',' before ':'
      
      and a few more...
      

      Help!!! :)

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @Panoss

      QtRpt is not part of Qt but an application using Qt as a toolkit.

      Probably it is better to contact the author QtRpt and consult the documentation provided with the source.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Panoss
        wrote on last edited by
        #3

        I contacted him but he didn't help me at all.

        mrjjM 1 Reply Last reply
        0
        • P Panoss

          I contacted him but he didn't help me at all.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Panoss
          Hi , you should try a newer Qt.
          Seems QtMath was first added in QtCore 5.1
          http://stackoverflow.com/questions/22864872/how-to-add-use-qtmath-with-qt-5-0-2

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Panoss
            wrote on last edited by Panoss
            #5

            Ok, I managed to run it.

            1. I put:
            #if QT_VERSION >= 0x50000
                #include <qmath.h>
            #else
                #include <QtCore/qmath.h>
            #endif
            
            1. I deleted the content of the function "double2MoneyFrench" in CommonClasses.cpp and just made it return 0.
            2. I commented out this code in CommonClasses.cpp line 758:
            //            for(auto field : fieldObject->crossTab->fieldList) {
            //                drawFields(field,bandTop_,true);
            //            }
            
            1. I commented out line 537 in CommonClasses.cpp:
             //nWidth = ((int)rint(nHeight * dblAspectRatio)) & -3;
            
            1. in config.pri I put my project 's debug path in DEST_DIRECTORY variable.

            And...worked!!!
            Thank you guys anyway.

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved