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. [SOLVED] main.cpp procedure question
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] main.cpp procedure question

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 603 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.
  • J Offline
    J Offline
    jediengineer
    wrote on last edited by
    #1

    I'm still a little new to Qt - please bear with me.

    When I create a new QtQuick Application, in the main.cpp file I have the following in my main function:

    @
    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/01-048-2801-Rev1/main.qml"));
    viewer.showExpanded();
    @

    What is the difference between that method of initialization and this one:

    @
    QQuickView* view = new QQuickView(QUrl("qml/01-048-2801-Rev1/main.qml"));
    view->show();
    @

    And if I'm writing a GUI that calls a lot of C++ functions, which is proper, or rather which is proper convention? I see both as accomplishing the same task, but I've only ever used the latter, which is prevelant in most of the examples I've seen.

    Thanks for your time, all!

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jediengineer
      wrote on last edited by
      #2

      Nevermind, figured it out. Thanks all!

      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