Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] C++ Function Calls
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] C++ Function Calls

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 2 Posters 1.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.
  • O Offline
    O Offline
    overtime
    wrote on last edited by
    #1

    I get this error:

    @C:\Users\Darrel\Desktop\smartphonebrainscanner2-Brain3D\qmlapplicationviewer\qmlapplicationviewer.cpp:77: error: no matching function for call to 'QQuickView::QQuickView(QWidget*&)'
    , d(new QmlApplicationViewerPrivate())
    ^@

    From this code:

    @
    QmlApplicationViewer::QmlApplicationViewer(QWidget *parent)
    : QQuickView(parent)
    , d(new QmlApplicationViewerPrivate())
    {
    connect(engine(), SIGNAL(quit()), SLOT(close()));
    setResizeMode(QQuickView::SizeRootObjectToView); //(QDeclarativeView::SizeRootObjectToView); Qt 4.8

    // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
    

    #if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
    #if !defined(NO_JSDEBUGGER)
    new QmlJSDebugger::JSDebuggerAgent(engine());
    #endif
    #if !defined(NO_QMLOBSERVER)
    new QmlJSDebugger::QDeclarativeViewObserver(this, this);
    #endif
    #endif
    }@

    @class QmlApplicationViewer : public QQuickView //QDeclarativeView // Qt 4.8
    {
    Q_OBJECT

    public:
    enum ScreenOrientation {
    ScreenOrientationLockPortrait,
    ScreenOrientationLockLandscape,
    ScreenOrientationAuto
    };

    explicit QmlApplicationViewer(QWidget *parent = 0);
    virtual ~QmlApplicationViewer();
    
    static QmlApplicationViewer *create();
    
    void setMainQmlFile&#40;const QString &file&#41;;
    void addImportPath(const QString &path&#41;;
    
    // Note that this will only have an effect on Fremantle.
    void setOrientation(ScreenOrientation orientation);
    
    void showExpanded();
    

    private:
    class QmlApplicationViewerPrivate *d;
    };@

    It's been awhile since I've worked on C++ classes so I'm pretty rusty. I don't see the problem.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      LonniB
      wrote on last edited by
      #2

      You are calling a constructor while you haven't defined any for the class you mention, I think that might be the reason why it is not working.
      First define a constructor then you can call @new QmlApplicationViewerPrivate()@

      1 Reply Last reply
      0
      • O Offline
        O Offline
        overtime
        wrote on last edited by
        #3

        isn't it already defined in

        @private:
        class QmlApplicationViewerPrivate *d;@

        and then here is this:

        @
        class QmlApplicationViewerPrivate
        {
        QString mainQmlFile;
        friend class QmlApplicationViewer;
        static QString adjustPath(const QString &path);
        };@

        1 Reply Last reply
        0
        • L Offline
          L Offline
          LonniB
          wrote on last edited by
          #4

          Well the first thing is that I don't see why you are using the key word "class" here
          @private:
          class QmlApplicationViewerPrivate *d;@
          Indeed, if your class QmlApplicationViewerPrivate is defined in a .h you can simply include it in your QmlApplicationViewer file ;).

          As for this part of the code here :
          @class QmlApplicationViewerPrivate
          {
          QString mainQmlFile;
          friend class QmlApplicationViewer;
          static QString adjustPath(const QString &path);
          };@

          You are indeed defining a class with its attributes and methods, but I don't see any constructor which goes like : QmlApplicationViewer(type1 att1, type2 att2...){
          }

          1 Reply Last reply
          0
          • O Offline
            O Offline
            overtime
            wrote on last edited by
            #5

            perfect, thank you :)

            1 Reply Last reply
            0
            • L Offline
              L Offline
              LonniB
              wrote on last edited by
              #6

              You're very welcome ! Please mark the topic as solved and good luck with the rest of your coding ;-)

              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