Results 1 to 4 of 4

Thread: Good looking app wihout QtQuick?

  1. #1
    Join Date
    Nov 2015
    Posts
    3
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Question Good looking app wihout QtQuick?

    Hi.
    I have to make an application that would use C++ and QSerialPort (smart house system) and look minimalistic and user-friendly (like QtQuick apps).
    Should I go for the QtQuick and (somehow???) connect it to the QWidget classes (or backwards - QtQuick UI to QWidget project) or is there a good way to make an phone-like app with QtWidget?
    Thank You in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Good looking app wihout QtQuick?

    If you want a phone like app, then you definitely want to go with QtQuick.

    Any reason you can't use it?

    Cheers,
    _

  3. #3
    Join Date
    Nov 2015
    Posts
    3
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Good looking app wihout QtQuick?

    Well I am new to Qt and especially QtQuick, so I don't know how to, f.e. make a MouseArea that will onclicked send signal to main.cpp to use a function that will return a number between 0 and 5, then print the number into a QtQuick Text field. I am trying to do something with QQmlProperty. I have smth like

    Qt Code:
    1. QApplication app(argc, argv);
    2. QQmlApplicationEngine engine2;
    3. QQmlEngine engine;
    4. QQmlComponent component(&engine,QUrl::fromLocalFile("/home/smth/main.qml"));
    5. QObject *object = component.create();
    6. QObject *rect = object->findChild<QObject*>("applicationWindow1");
    7. }
    To copy to clipboard, switch view to plain text mode 

    How do I add smth like
    Qt Code:
    1. rect->setProperty("visibility", "FullScreen");
    To copy to clipboard, switch view to plain text mode 
    to applicationWindow1

    or change a Text field in smth like.
    Qt Code:
    1. name->setProperty("thisisthename")
    To copy to clipboard, switch view to plain text mode 

    Or in any other way i need to make a connection between QML and .cpp files.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Good looking app wihout QtQuick?

    That's way to complicated.

    Just use the QQmlApplicationEngine with a Window in the QML file or a QQuickWindow.

    In either case prepare a QObject derived class as the interface that your C++ offers to QML.
    Create an object of that class before loading the QML into the engine/view and set it via the root context's setContextPropery() method.

    Any slot or Q_INVOKABLE marked method on that object can then be called from QML.

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 27th February 2016, 03:34
  2. Replies: 3
    Last Post: 6th March 2014, 10:09
  3. Import QtQuick 2.0 or 2.1 or 2.2?
    By pherthyl in forum Qt Quick
    Replies: 2
    Last Post: 9th January 2014, 20:13
  4. QtQuick 2.1
    By shadowroot in forum Qt Quick
    Replies: 1
    Last Post: 6th April 2013, 08:44
  5. What is QtQuick/QML really for?
    By Huk in forum Qt Quick
    Replies: 7
    Last Post: 21st June 2012, 20:33

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.