Uploaded image for project: 'Qt Solutions'
  1. Qt Solutions
  2. QTSOLBUG-171

QtSingleApplication fails to compile under certain circumstances.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Next Major Release
    • Single Application
    • None
    • Qt 4.8.1,

    Description

      When compiling with QT_NO_CAST_FROM_ASCII or QT_NO_CAST_FROM_BYTEARRAY compile error result while compiling the file qtlocalpeer.cpp. On Macintosh:

      /qtbuild/install/macosx/include/QtCore/qstring.h: In constructor 'QtLocalPeer::QtLocalPeer(QObject*, const QString&)':
      /qtbuild/install/macosx/include/QtCore/qstring.h:597: error: 'QString::QString(const char*)' is private
      ../IgorSrc7/qtsingleapplication/src/qtlocalpeer.cpp:80: error: within this context
      /qtbuild/install/macosx/include/QtCore/qbytearray.h: In member function 'void QtLocalPeer::receiveConnection()':
      /qtbuild/install/macosx/include/QtCore/qbytearray.h:383: error: 'QByteArray::operator QNoImplicitBoolCast() const' is private
      ../IgorSrc7/qtsingleapplication/src/qtlocalpeer.cpp:197: error: within this context
      ../IgorSrc7/qtsingleapplication/src/qtlocalpeer.cpp:197: error: invalid conversion from 'QNoImplicitBoolCast' to 'const char*'
      ../IgorSrc7/qtsingleapplication/src/qtlocalpeer.cpp:197: error: initializing argument 1 of 'static QString QString::fromUtf8(const char*, int)'

      On Windows:

      ..\IgorSrc7\qtsingleapplication\src\qtlocalpeer.cpp(80) : error C2440: '<function-style-cast>' : cannot convert from 'const char [10]' to 'QRegExp'
      No constructor could take the source type, or constructor overload resolution was ambiguous
      ..\IgorSrc7\qtsingleapplication\src\qtlocalpeer.cpp(90) : error C2664: 'QLibrary::QLibrary(QObject *)' : cannot convert parameter 1 from 'const char [9]' to 'QObject *'
      Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
      ..\IgorSrc7\qtsingleapplication\src\qtlocalpeer.cpp(197) : error C2664: 'QString::fromUtf8' : cannot convert parameter 1 from 'QByteArray' to 'const char *'
      No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

      Fixes are simple, it seems:

      80c80
      < prefix.remove(QRegExp("[^a-zA-Z]"));

      > prefix.remove(QRegExp(QLatin1String("[^a-zA-Z]"))); // JW 130806 added QLatin1String()
      90c90
      < QLibrary lib("kernel32");

      > QLibrary lib(QLatin1String("kernel32")); // JW 130806 added QLatin1String()
      197c197
      < QString message(QString::fromUtf8(uMsg));

      > QString message(QString::fromUtf8(uMsgBuf)); // JW 130806 changed "uMsg" to "uMsgBuf"

      ?? where do I find the version? I cloned it from http://qt.gitorious.org/qt-solutions August 6, 2013.

      Attachments

        Activity

          People

            Unassigned Unassigned
            johnweeks John Weeks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: