Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Portuguese
  4. Integração C++/QML Problema!
Forum Updated to NodeBB v4.3 + New Features

Integração C++/QML Problema!

Scheduled Pinned Locked Moved Unsolved Portuguese
2 Posts 2 Posters 1.2k Views
  • 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.
  • M Offline
    M Offline
    Mhaylson
    wrote on last edited by
    #1

    Eu tenho um projeto GUI com varios sub-projetos, ou seja uma arvore de diretorios bem extensa. Muitos sub-projetos são plugins GUI. Estou querendo fazer um sub-projeto com QML, ou seja, quero migrar do GUI para o QML. Quando eu chamo o QML, a minha tela QML aparece:

     component = new QQmlComponent(&engine,QUrl("qrc:/cashierqml/imports/CashierQml/CashierNfce.qml"));
            if (component->isLoading())
                QObject::connect(component, SIGNAL(statusChanged(QQmlComponent::Status)),
                                 this, SLOT(continueLoading()));
            else
                continueLoading();
    
       void PAFCashierQMLPlugin::continueLoading()
      {
            if (component->isError()) {
            qWarning() << component->errors();
            } else {
            QObject *myObject = component->create();
    
            QObject::connect(myObject, SIGNAL(signalShowMessag(QString)), this, SLOT(showMessa(QString)));
            }
       }
    

    Porém, a minha tela QML fica "congelada", ou seja, clico em um botão ou tento fazer alguma interação ou ação e não acontece nada. Eu fiz o teste da tela QML em um novo projeto e funcionou corretamente.

    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
          engine.load(QUrl(QStringLiteral("qrc:/cashierqml/imports/CashierQml/CashierNfce.qml")));
    
        return app.exec();
        }
    

    Porque isso?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TioRoy
      wrote on last edited by
      #2

      Por acaso você cria o QQmlComponent/Engine em uma thread separada?

      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