Results 1 to 20 of 22

Thread: Convert a QByteArray to a QVariantList

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Convert a QByteArray to a QVariantList

    I can't help you because I don't know what the call expects. Contact the authors of the DLL and ask them. Nobody here will be able to guess what the contents of the list should be just by looking at the function name.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convert a QByteArray to a QVariantList

    Quote Originally Posted by wysota View Post
    I can't help you because I don't know what the call expects. Contact the authors of the DLL and ask them. Nobody here will be able to guess what the contents of the list should be just by looking at the function name.
    I already contacted the author and it gave to me a doc containing the routines list.
    The routine I have to call is named
    RegUserData
    .

    I list here the parameters wanted by such routine:
    CardID(string/10)
    OverWrite(0: no overwrite. If ID is already registered, return with result 06.,1: overwrite.)
    idxDesignation
    idxDepartment
    FirstName(string /15)
    LastName(string /15)
    idxGroup (integer/0~255)
    Status(1: Activate, 0: Deactivate)
    WorkMode(0:finger+pass ,1:finger,2ass,3:finger or pass,4:Only Crad,5:Only from external Reader,6:Matching on Mifare card)
    WorkTimeStart()
    WorkTimeEnd()
    EmployeeID
    RegisterMode( Finger =1, Password = 2, Finger and Password = 3, Card=4, Max=4)
    CheckExpire
    ExpireDateStart
    ExpireDateEnd
    Password(string/10)
    NF(Number of fingerprint data per user Max. 2)
    TemplateSize
    FingerData (byte,User Fingerprint data total size depends on the number of fingerprints registered per user)
    The param that give problems to me is the last: FingerData, that should be an array of bytes nothing more.
    When I generated the documentation with dumpcpp it says that I have to pass FingerData as QVariantList and here is where I would have your help.

    Thanx in advance.
    Franco Amato

  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convert a QByteArray to a QVariantList

    This is the output of generateDocumentation:

    Qt Code:
    1. bool RegUserData(QString CardID, QVariantList FingerData, bool OverWrite = 0, int idxDesignation = 0, int idxDepartment = 0, QString FirstName = 0, QString LastName = 0, int idxGroup = 0, bool Status = 0, int WorkMode = 0, QString WorkTimeStart = 0, QString WorkTimeEnd = 0, QString EmployeeID = 0, int RegisterMode = 0, bool CheckExpire = 0, QDateTime ExpireDateStart = 0, QDateTime ExpireDateEnd = 0, QString Password = 0, int NF = 0, int TemplateSize = 0);
    To copy to clipboard, switch view to plain text mode 

    You can see that it ask for FingerData as second param and of type QVariantList.
    Franco Amato

  4. #4
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs down Re: Convert a QByteArray to a QVariantList

    Well I think Qt can not solve this problem.
    I have to implement it in C#
    Franco Amato

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Convert a QByteArray to a QVariantList

    Quote Originally Posted by franco.amato View Post
    Well I think Qt can not solve this problem.
    I'm sure it can, you just can't blindly do different things hoping that one thing you try might be the correct one. You need to read some documentation, maybe browse and analyze some code and develop a solution to your problem. You won't be given an answer on a silver platter.

    I would guess (but only guess) the argument in question awaits a list of byte arrays where each byte array corresponds to a single fingerprint data. But again, that's just a guess based on some logical deduction.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convert a QByteArray to a QVariantList

    Quote Originally Posted by wysota View Post
    I'm sure it can, you just can't blindly do different things hoping that one thing you try might be the correct one. You need to read some documentation, maybe browse and analyze some code and develop a solution to your problem. You won't be given an answer on a silver platter.

    I would guess (but only guess) the argument in question awaits a list of byte arrays where each byte array corresponds to a single fingerprint data. But again, that's just a guess based on some logical deduction.
    Wysota I don't want a solution on a silver plate. I only would convert a QByteArray to a QVariantList because I'm not able to do it. I tried many ways without success.
    And yes the the argument in question awaits a list of byte arrays where each byte array corresponds to a single fingerprint data. This device store a fingerprint with 352 bytes so my QByteArray has 352 elements and I would convert this 352 elements of my QByteArray to a QVariantList.

    Best
    Franco Amato

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Convert a QByteArray to a QVariantList

    Quote Originally Posted by franco.amato View Post
    Wysota I don't want a solution on a silver plate. I only would convert a QByteArray to a QVariantList because I'm not able to do it. I tried many ways without success.
    Because you first have to know what result you want to achieve before "trying many ways".

    And yes the the argument in question awaits a list of byte arrays where each byte array corresponds to a single fingerprint data.
    And how do you know that? Maybe it expects the number of byte arrays in the first cell of the list?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convert a QByteArray to a QVariantList

    Quote Originally Posted by wysota View Post
    Because you first have to know what result you want to achieve before "trying many ways".


    And how do you know that? Maybe it expects the number of byte arrays in the first cell of the list?
    No, the number of byte arrays is in another cell called template size that's 352
    NF(Number of fingerprint data per user Max. 2) //number of fingerprint per user ( maximum 2 )
    TemplateSize //352
    FingerData (byte,User Fingerprint data total size depends on the number of fingerprints registered per user) = templatesize * NF
    Franco Amato

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Convert a QByteArray to a QVariantList

    If you are sure you are sending the parameters correctly then dive into the sourcecode of ActiveQt to see when the message you get is generated to see what the possible cause might be. So far we don't even know if it is Qt that generates this message or some other library underneath ActiveQt.

    There is also another thing - if you have the dll, maybe you call the function directly instead of using COM?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convert a QByteArray to a QVariantList

    Quote Originally Posted by wysota View Post
    If you are sure you are sending the parameters correctly then dive into the sourcecode of ActiveQt to see when the message you get is generated to see what the possible cause might be. So far we don't even know if it is Qt that generates this message or some other library underneath ActiveQt.

    There is also another thing - if you have the dll, maybe you call the function directly instead of using COM?
    Hi,
    how can I call the function directly instead using COM? I don't have the associated *.lib and the dll is a com ( I have no experience with com )
    Franco Amato

  11. #11
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convert a QByteArray to a QVariantList

    QImage ( const QByteArray & array )
    QVariant::QVariant ( const QImage & val )
    Got to keep the loonies on the path ...

  12. #12
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convert a QByteArray to a QVariantList

    Quote Originally Posted by JD2000 View Post
    QImage ( const QByteArray & array )
    QVariant::QVariant ( const QImage & val )
    I already tried your idea JD2000 and it doesn't work.
    Unfortunately I'm developing the source code in C# that I hate
    Franco Amato

  13. #13
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Convert a QByteArray to a QVariantList

    Quote Originally Posted by franco.amato View Post
    how can I call the function directly instead using COM? I don't have the associated *.lib and the dll is a com ( I have no experience with com )
    Check the exports of the DLL with a PE viewer. If the function is exported, you can link with it. You don't need the .lib

Similar Threads

  1. how to convert an int to QByteArray
    By babu198649 in forum Qt Programming
    Replies: 12
    Last Post: 19th September 2014, 09:47
  2. Convert QPixmap to QByteArray ?
    By probine in forum Qt Programming
    Replies: 5
    Last Post: 13th March 2014, 08:23
  3. convert QString to QByteArray
    By morgana in forum Qt Programming
    Replies: 5
    Last Post: 2nd March 2011, 13:33
  4. how can we convert QByteArray to Qstring?
    By learning_qt in forum Qt Programming
    Replies: 2
    Last Post: 21st July 2009, 14:05
  5. Convert from QByteArray to String ?
    By probine in forum Newbie
    Replies: 3
    Last Post: 25th March 2006, 15:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.