Navigation

    Qt Forum

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

    • SOLVED Bluetooth Low Energy Heart Game Example - reinterpret_cast?
      General and Desktop • c++ bluetooth low e casting • • TUStudi  

      4
      0
      Votes
      4
      Posts
      109
      Views

      Thank you both very much.
    • SOLVED QtPlugin: duplicate if-conditions in generated qt_metacast
      General and Desktop • plugin moc casting • • 0...-5  

      6
      0
      Votes
      6
      Posts
      759
      Views

      Well, a class name is not a unique identifier since it's already used to name said class.
    • SOLVED What is the best way to cast Quint16 to QBitarray(16) ?
      General and Desktop • casting qbitarray • • zeroptr  

      4
      0
      Votes
      4
      Posts
      1279
      Views

      Hi, @kshegunov I tried the same thing also your code but I could not manage it to work.. I have already have a Qdatastream, I get quint16 values from it... I tried your solution at first sight... @Wieland The code you send works fine thank you very much.. Have Nice day guys.. Thanks for your help.. It's very valuable..
    • UNSOLVED Casting from QList<InheritedFromQObject> to QList<QObject>
      General and Desktop • qobject casting staticcast • • Kofr  

      4
      0
      Votes
      4
      Posts
      3576
      Views

      The two list types are unrelated so casting pointers to them is still not ok at all. To push the previous analogy - for compiler it's like casting int* to string*. You can of course use reinterpret_cast and the compiler will be happy to trust you, but that is in no way correct and will obviously explode in your face at runtime.