Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. conversion

    Log in to post
    • All categories
    • D

      Solved converting from float or double to QString results in output being 0
      General and Desktop • c++ qstring conversion line edit float • • Dean21

      23
      0
      Votes
      23
      Posts
      907
      Views

      Kent-Dorfman

      @JonB said in converting from float or double to QString results in output being 0:

      Warning: The QString content may only contain valid numerical characters which includes the plus/minus sign, the character e used in scientific notation, and the decimal point. Including the unit or additional characters leads to a conversion error.

      In which case RTFM is the rule of the day! but I'm lazy.

    • U

      Unsolved QByteArray to LabVIEW Byte Array conversion
      General and Desktop • labview conversion qbytearray bytearray const char • • UvQtcYZJuD7J5VW7

      10
      0
      Votes
      10
      Posts
      546
      Views

      JKSH

      @UvQtcYZJuD7J5VW7 said in QByteArray to LabVIEW Byte Array conversion:

      I need to include Labview extcode.h

      Yes, that's right.

      and when I include it, I get errors about my compiler (platdefines.h doens't recognize my compiler when I'm in Qt Creator).

      Then you just need to address the error.

      If you use MSVC, it will work fine out-of-the-box.

      If you want to use MinGW, you can modify platdefines.h and add these 2 lines to define your compiler:

      ... #elif defined(__GNUC__) // <-- Add this #define Compiler kGCC // <-- Add this #else #error "We don't know the Compiler" #endif
    • P

      Unsolved ArrayBuffer <-> QByteArray
      QML and Qt Quick • qbytearray arraybuffer conversion • • pderocco

      1
      0
      Votes
      1
      Posts
      504
      Views

      No one has replied

    • T

      Int16 to QByteArray
      General and Desktop • bits bytes conversion • • TomHoe

      11
      0
      Votes
      11
      Posts
      5188
      Views

      JKSH

      @TomHoe said in Int16 to QByteArray:

      didn't knew that '!' is the same as 0x21..

      See http://www.ascii-code.com/

      '!' == 33 == 0x21 == 0b00100001

      @TomHoe said in Int16 to QByteArray:

      Is there a way to rewrite it to regular hex codes ? Or does every controller understand this notation ?

      Again, '!' == 33 == 0x21 == 0b00100001

      Those are different ways of displaying the same bytes. The controller does not see any "hex" or "notation"; it only sees the sequence of 0's and 1's.

      I recommend you learn about how bits/bytes are stored in computer memory: http://statmath.wu.ac.at/courses/data-analysis/itdtHTML/node55.html

    • D

      Solved Binary numbers on Raspberry Pi
      Mobile and Embedded • raspberry pi 2 spi binary binary format conversion • • Dan90

      11
      0
      Votes
      11
      Posts
      3255
      Views

      jsulm

      @Dan90 You are assigning a value to a pointer, but data is actually an array of "unsigned char":

      unsigned char *data = 0b10000000;

      Instead you should do (C++11):

      unsigned char data[] = { (unsigned char)0b10000000 };
    • Z

      QQuickItem to QImage
      General and Desktop • qquickitem qimage conversion slow • • Zondar

      1
      0
      Votes
      1
      Posts
      935
      Views

      No one has replied

    • MrBolton

      [Solved] QDateTime to PostgreSQL
      General and Desktop • sql postgresql conversion qt 5.5 • • MrBolton

      5
      0
      Votes
      5
      Posts
      3639
      Views

      MrBolton

      Thanks, that should do it!

    • Halo_Hao

      I have two questions about converting MFC to QT
      General and Desktop • qt5 mfc conversion • • Halo_Hao

      4
      0
      Votes
      4
      Posts
      1636
      Views

      Halo_Hao

      @JKSH Copy that. Thanks a lot for your kind help.

    • R

      [SOLVED] How to convert a double to a QString for writing into a SQL table (QString::number not working properly)?
      General and Desktop • mysql double conversion qstring • • RolBri

      3
      0
      Votes
      3
      Posts
      8747
      Views

      R

      Thank you very much :-)

      You gave me the right hint.

      There was a cast before which I did not see.
      And since everything was casted to int MySQL deleted the Zeros after the '.'

      Now everything works fine and thanks for the other variation :-)

    • A7Victor

      [SOLVED] (BEGINNER) How to print barcodes
      General and Desktop • beginner print barcode c++ starter newbie font code39 string conversion • • A7Victor

      3
      0
      Votes
      3
      Posts
      2611
      Views

      A7Victor

      @mcosta Hi,

      I'll certainly take a look at it. So I guess it's not only changing the font xD

      Thank you.