April 8, 2012

Mapple Mapple
Lab Rat
6 posts

[Closed double post] How to deploy qml application on machine (Windows XP) without QtSDK

 

I created small test qml project. I have small main.qml file:

  1. import QtQuick 1.0
  2. import com.nokia.symbian 1.0
  3.  
  4. Rectangle {
  5.     id: main
  6.     width: 320
  7.     height: 480
  8.     color: "orange"
  9.  
  10.     Button
  11.     {
  12.         text: "click"
  13.     }
  14. }

I add next line in my QMLTest.pro file:

  1. QML_IMPORT_PATH = C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\imports

main.cpp file looks like this:

  1. #include <QtGui/QApplication>
  2. #include "qmlapplicationviewer.h"
  3.  
  4. Q_DECL_EXPORT int main(int argc, char *argv[])
  5. {
  6.     QScopedPointer<QApplication> app(createApplication(argc, argv));
  7.  
  8.     QmlApplicationViewer viewer;
  9.  
  10.     viewer.addImportPath("C:\\QtSDK\\Desktop\\Qt\\4.7.4\\msvc2008\\imports");
  11.     viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
  12.     viewer.setMainQmlFile(QLatin1String("qml/QMLTest/main.qml"));
  13.     viewer.showExpanded();
  14.  
  15.     return app->exec();
  16. }

The structure of catalog looks like:

  1. QMLTest
  2. |
  3. ----QMLTest.exe
  4. |
  5. ----qml
  6.     |
  7.     ----QMLTest
  8.           |
  9.           ----main.qml

When I launched the QMLTest.exe on my developing machine, I saw a button on an orange background.
Then I made next actions:

  1. comment next line in main.cpp: // viewer.addImportPath(“C:\\QtSDK\\Desktop\\Qt\\4.7.4\\msvc2008\\imports”);
  2. comment next line in QMLTest.pro file: #QML_IMPORT_PATH = C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\imports
  3. copy folder “com” from C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\imports to “QMLTest/qml/QMLTest” folder

The structure of catalog looks like:

  1. QMLTest
  2. |
  3. ----QMLTest.exe
  4. |
  5. ----qml
  6.     |
  7.     ----QMLTest
  8.           |
  9.           ----main.qml
  10.           |
  11.           ----com
  12.                |
  13.                ----nokia
  14.                     |
  15.                     ----symbian
  16.                          |
  17.                          ----Button.qml and others

When I launched the QMLTest.exe on my developing machine, I saw a button on an orange background.

I add QtCore4.dll, QtDeclarative4.dll, QtGui4.dll, QtNetwork4.dll, QtScript4.dll, QtSql4.dll, QtXmlPatterns4.dll
The structure of catalog on virtual machine looks like:

  1. QMLTest
  2. |
  3. ----QMLTest.exe
  4. |
  5. ----QtCore4.dll, QtDeclarative4.dll, QtGui4.dll, QtNetwork4.dll, QtScript4.dll, QtSql4.dll, QtXmlPatterns4.dll
  6. |
  7. ----qml
  8.     |
  9.     ----QMLTest
  10.           |
  11.           ----main.qml
  12.           |
  13.           ----com
  14.                |
  15.                ----nokia
  16.                     |
  17.                     ----symbian
  18.                          |
  19.                          ----Button.qml and others

When I launched the QMLTest.exe on virtual machine (windows XP), I saw white window without button.
I copy qmlviewer.exe and QtOpenGL4.dll from C:\QtSDK\Desktop\Qt\4.8.0\msvc2010\bin (developing machine) to QMLTest folder

on virtual machine. Then I add QML_IMPORT_TRACE enviroment variable with value 1 and run qmlviewer:


QDeclarativeImports(file:///C:/QMLTest/qml/QMLTest/main.qml)::addImport: “.” -1.-1 File as “”
QDeclarativeImports(file:///C:/QMLTest/qml/QMLTest/main.qml)::addImport: “QtQuick” 1.0 Library as “”
QDeclarativeImports(file:///C:/QMLTest/qml/QMLTest/main.qml)::addImport: “com/nokia/symbian” -1.-1 File as “”
QDeclarativeImportDatabase::importPlugin: “qml.QMLTest.com.nokia.symbian” from

“C:/QMLTest/qml/QMLTest/com/nokia/symbian/symbianplugin_1_0.dll”
file:///C:/QMLTest/qml/QMLTest/main.qml:3:1: plugin cannot be loaded for module “qml.QMLTest.com.nokia.symbian”: Cannot load

library C:/QMLTest/qml/QMLTest/com/nokia/symbian/symbianplugin_1_0.dll: ?? ?????? ????????? ??????. import “com/nokia/symbian”

Any ideas?

1 reply

April 8, 2012

koahnig koahnig
Area 51 Engineer
2879 posts

welcome to devnet

There is no need to publish the same thread twice. When you have published in a wrong forum, it may be moved by one of the moderators.

So please do not double post.

Closing this thread.

 
  ‹‹ Deploying for Windows and Mac      无法编译QT4.8.1 ››

You must log in to post a reply. Not a member yet? Register here!