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. Problem Simple Encryptacion QT5
Forum Updated to NodeBB v4.3 + New Features

Problem Simple Encryptacion QT5

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 22.1k 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.
  • T Offline
    T Offline
    topocc
    wrote on 1 Feb 2013, 22:19 last edited by
    #1

    I happen http://qt-project.org/wiki/Simple_encryption encrypt using simple, when I compile with the new version get this error:

    simplecrypt.cpp:-1: In member function 'QByteArray SimpleCrypt::encryptToByteArray(QByteArray)':
    simplecrypt.cpp:73: error: variable 'QDataStream s' has initializer but incomplete type
    simplecrypt.cpp:-1: In member function 'QString SimpleCrypt::encryptToString(const QString&)':
    simplecrypt.cpp:111: error: 'fromAscii' is not a member of 'QString'
    simplecrypt.cpp:-1: In member function 'QString SimpleCrypt::encryptToString(QByteArray)':
    simplecrypt.cpp:118: error: 'fromAscii' is not a member of 'QString'
    simplecrypt.cpp:-1: In member function 'QString SimpleCrypt::decryptToString(const QString&)':
    simplecrypt.cpp:124: error: 'const class QString' has no member named 'toAscii'
    simplecrypt.cpp:-1: In member function 'QByteArray SimpleCrypt::decryptToByteArray(const QString&)':
    simplecrypt.cpp:141: error: 'const class QString' has no member named 'toAscii'
    simplecrypt.cpp:-1: In member function 'QByteArray SimpleCrypt::decryptToByteArray(QByteArray)':
    simplecrypt.cpp:189: error: variable 'QDataStream s' has initializer but incomplete type

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 1 Feb 2013, 22:32 last edited by
      #2

      QString::toAscii() and QString::fromAscii() are now deprecated, but should still be there (they are replaced by QString::fromLatin1() and QString::toLatin1()). Anyway, that should not generate those errors. Do you include all the code from that example (all #includes), and do you have a valid .pro file? Did it work with Qt4? What compiler are you using?

      (Z(:^

      1 Reply Last reply
      0
      • T Offline
        T Offline
        topocc
        wrote on 1 Feb 2013, 22:54 last edited by
        #3

        use g++ (Built by MinGW-builds project) 4.7.2 y qt5.0.1 sdk.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 2 Feb 2013, 07:26 last edited by
          #4

          This still looks like missing includes to me. Or possibly a broken package, if you use precompiled stuff.

          Try building a minimal example that would use QDataStream and offending methods from QString to see if they work.

          (Z(:^

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on 2 Feb 2013, 14:41 last edited by
            #5

            Deprecated members (as for instance QString::toAscii()) are disabled by default in Qt5 and can be enabled using "QT_DISABLE_DEPRECATED_BEFORE":http://qt-project.org/doc/qt-5.0/qtcore/qtglobal.html#QT_DISABLE_DEPRECATED_BEFORE.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on 4 Feb 2013, 11:21 last edited by
              #6

              (I'm the author of the SimpleCrypt you're referencing).

              I have not updated to Qt5 yet, but it would be good to update the code to be usable on Qt5. I'll try to get around to do that, but if somebody else wants to step up to make the needed adjustments (preferably using the proper Qt 5 way, not by re-enabling decrecated features), then please go ahead!

              1 Reply Last reply
              0
              • T Offline
                T Offline
                topocc
                wrote on 14 Feb 2013, 22:47 last edited by
                #7

                good, and in QT5 probe, and all good the only thing that was included # include <QDataStream>, and change QString :: fromutf8 () and QString :: toutf8 ().

                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