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. MAKELONGLONG macro
Qt 6.11 is out! See what's new in the release blog

MAKELONGLONG macro

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 963 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.
  • KutyusK Offline
    KutyusK Offline
    Kutyus
    wrote on last edited by
    #1

    Hi!

    I woluld like to use a macro to create QListWidgetItem longlong data. I would like to store two long variable in it. I created this macro like MAKELONG, but not working, contains only lower long, the higher is always zero:

    #define MAKELONGLONG(l, h) ((LONGLONG)(((LONG)(l) & 0xffffffff) | (((LONG)(h) & 0xffffffff) << 32)))
    

    Any ideas?
    Thanks in advance.

    1 Reply Last reply
    0
    • KutyusK Offline
      KutyusK Offline
      Kutyus
      wrote on last edited by Kutyus
      #2

      Ok, I found the solution, before shifting left the hilong, required to cast it to LONGLONG, this code is working:

      #define MAKELONGLONG(l, h) ((LONGLONG)(((LONG)(l) & 0xffffffff) | (((LONGLONG)(h) & 0xffffffff) << 32)))
      
      1 Reply Last reply
      2

      • Login

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