Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. bytearray
    Log in to post

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

      10
      0
      Votes
      10
      Posts
      110
      Views

      @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
    • UNSOLVED QImage to byte array doesn't work
      General and Desktop • qimage image bytearray epd esp8266 • • Gh0stShell  

      5
      0
      Votes
      5
      Posts
      538
      Views

      QImage::save() doesn't get the raw bytes of the image, it converts the image to a file format. If you really want the raw bytes, do something like QByteArray ba((const char *)preview.constBits(), preview.byteCount());
    • SOLVED Bluetooth low Energy: Sensor Data is split up using QByteArray
      General and Desktop • bluetooth low e containers bytearray sensor readings • • TUStudi  

      7
      0
      Votes
      7
      Posts
      197
      Views

      Okay, I have solved the problem with a workaround: In the code for my development board I added a new line character after every value. Then, in my Qt code I check every time the SLOT is called if the value does have a new line char. Either the value is saved in another variable until it receives a value with a new line character or it is output immediately (if it has a new line character). static QString newValue= ""; void MainWindow::updateData(const QLowEnergyCharacteristic &c,const QByteArray &value) { newValue = newValue + (QString)value; if (newValue.contains("\n") || newValue.contains("\r")){ ui->dataList->addItem(newValue.simplified()); ui->dataList->scrollToBottom(); newValue = ""; } }
    • SOLVED Strange Json issue, conversion from QByteArray to QJsonDocument not working as intended
      General and Desktop • qtcreator json installation bytearray • • DanBar  

      16
      0
      Votes
      16
      Posts
      3867
      Views

      @jsulm we make an installation file for our combined system, including multiple programs sharing some but not other resources. we use an nsi script to manage this. usually works fine. I just missed updating some of the .dll files.
    • SOLVED readRawData(char *s, int len) build-in function doesn't read char *buff of the len size and doesn't return number of data read
      General and Desktop • bytearray • • ainu  

      10
      0
      Votes
      10
      Posts
      3409
      Views

      @JNBarchan thank you for the detailed answer.
    • How to convert ASCII Hex string to Byte array?
      General and Desktop • bytearray ascii hex • • kahlenberg  

      15
      0
      Votes
      15
      Posts
      27006
      Views

      @mganesh This works fine for me. Your output can not match on what you've written. Please post all your test code int main(int argc, char **argv) { QCoreApplication app(argc, argv); QString monitorCommand = "020400000006703B"; QByteArray data_to_transmit = QByteArray::fromHex(monitorCommand.toUtf8()); qDebug() << monitorCommand << data_to_transmit; return 0; } --> "020400000006703B" "\x02\x04\x00\x00\x00\x06p;"