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. Convert from int to hex
Forum Updated to NodeBB v4.3 + New Features

Convert from int to hex

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 28.2k Views 1 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.
  • R Offline
    R Offline
    Ruzik
    wrote on last edited by
    #1

    Hello, i need to convert from int to hex, i find method QByteArray::toHex, but it is dont worke
    @lineEdit_7->setText(QString("%1").arg(QVariant(QByteArray(QVariant(c.red()).toByteArray()).toHex()).toString()));@
    It is get some number(for example 323535), what do i do wrong?
    And how can it be easier to write?
    Advance many thanks for your help!

    1 Reply Last reply
    0
    • H Offline
      H Offline
      HuXiKa
      wrote on last edited by
      #2

      "Tada.":http://lmgtfy.com/?q=qt+decimal+to+hex

      If you can find faults of spelling in the text above, you can keep them.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        loladiro
        wrote on last edited by
        #3

        Have a look at "QString::number()":http://doc.qt.nokia.com/4.7/qstring.html#number

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          @
          lineEdit_7->setText( QString::number( c.red(), 16 ) );
          @

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          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