Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] save value of qint16 to qint8

[SOLVED] save value of qint16 to qint8

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 698 Views
  • 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.
  • S Offline
    S Offline
    Salvatello
    wrote on last edited by
    #1

    i have a lineedit.
    @qint16 moduliINT
    moduliINT=ui->lineEdit_2->text().toInt(&result,10);@
    in moduliINT I have value converted to decimal
    Now, I have a structure:
    @typedef struct {
    unsigned char moduli;
    } _PROTEZ;@

    @_PROTEZ prot@

    I want to save the value of moduliINT in port.moduli.

    but moduliINT is 2 bytes, while prot.moduli is 1 byte.

    @prot.moduli=(char)moduliINT;@

    I did so but it does not work.

    how can I do?

    1 Reply Last reply
    0

    • Login

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