Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Problem with QJsonValue include QJsonObject
Qt 6.11 is out! See what's new in the release blog

Problem with QJsonValue include QJsonObject

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 3 Posters 2.9k 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.
  • S Offline
    S Offline
    selll_93
    wrote on last edited by
    #1

    I have a problem using QJsonValue and QJsonObject

    even when I add QT+=core. I am using QT 5.5 Does anyone knows what could be the problem.

    Here is mine code:

    Pro file:

    QT += core gui webkit network
    TEMPLATE = app
    SOURCES += main.cpp
    apiservis.cpp
    HEADERS +=
    apiservis.h
    QT = core
    QT -= gui
    QT += webkit
    QT += webkit webkitwidgets
    QT += network
    TARGET = cpp
    CONFIG += console
    CONFIG -= app_bundle
    TARGET = main
    DISTFILES +=
    API_kljuc.txt

    And in the .h file I have:
    #include <QCoreApplication>
    #include <iostream>
    #include <cmath>
    #include <iomanip>
    #include <vector>
    #include <string.h>
    #include <locale>
    #include <sstream>
    #include <fstream>
    #include <string>
    #include <curl/curl.h>
    #include <stdio.h>
    #include <QHash>
    #include <QVariantMap>
    #include <QWebFrame>
    #include <QWebView>
    #include <QNetworkReply>
    #include <QCoreApplication>
    #include <QDebug>
    #include <QNetworkAccessManager>
    #include <QNetworkRequest>
    #include <QUrl>
    #include <QObject>
    #include <QJsonArray>
    #include <QJsonValue>
    #include <QJsonObject>

    But when I try to build it, error is: QJsonARRay:No such file or directory.

    Thanks in advance

    1 Reply Last reply
    0
    • Vinod KuntojiV Offline
      Vinod KuntojiV Offline
      Vinod Kuntoji
      wrote on last edited by Vinod Kuntoji
      #2

      @selll_93,
      In pro file you have specified the modules twice.
      Comment the following lines.
      QT = core
      QT -= gui
      QT += webkit
      QT += webkit webkitwidgets
      QT += network

      C++, Qt, Qt Quick Developer,
      PthinkS, Bangalore

      1 Reply Last reply
      0
      • S Offline
        S Offline
        selll_93
        wrote on last edited by
        #3

        Thank you on your replay, but that was not the problem. I had QT 4.8 and QT 5.5 installed on my computer, and somehow it called only 4.8

        JKSHJ 1 Reply Last reply
        0
        • S selll_93

          Thank you on your replay, but that was not the problem. I had QT 4.8 and QT 5.5 installed on my computer, and somehow it called only 4.8

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by JKSH
          #4

          @selll_93 said in Problem with QJsonValue include QJsonObject:

          I had QT 4.8 and QT 5.5 installed on my computer, and somehow it called only 4.8

          1. Make sure Qt is not in your system PATH.
          2. If you are building from the command line, make sure you run qmake from Qt 5.5, not Qt 4.8.
          3. If you are building from Qt Creator, make sure your project is set up to use Qt 5.5, not Qt 4.8: http://doc.qt.io/qtcreator/creator-configuring-projects.html

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          1

          • Login

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