Re: [Qt-qml] Multiple qml files in one .cpp

2010-08-29 Thread aaron.kennedy
Hi,

We cannot reproduce this problem.  Please file a bug with the complete C++ and 
QML source you are using, the sha1 (or package name) of the Qt  you are using 
and the OS you are on.

Cheers,

Aaron


On 27/08/10 10:33 PM, "ext Sulamita Garcia"  wrote:



On Fri, Aug 27, 2010 at 12:39 PM, Kai Koehne  wrote:

Are you sure that you're running it really from within
'/home/sulamita/src/samegame' ?

I know, it's hard to believe, isn't?

[sulam...@atomina samegame]$ pwd
/home/sulamita/src/samegame
[sulam...@atomina samegame]$ ls *.qml
Block.qml  Button.qml  samegame.qml
[sulam...@atomina samegame]$ ./samegame
file:samegame.qml:29:3: Button is not a type
Button {
^

Maybe I should do a printscreen, everybody asks the the same question...

___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Multiple qml files in one .cpp

2010-08-27 Thread Artur Souza (MoRpHeUz)
On Fri, Aug 27, 2010 at 9:33 AM, Sulamita Garcia  wrote:
> I know, it's hard to believe, isn't?

I believe :P

> [sulam...@atomina samegame]$ pwd
> /home/sulamita/src/samegame
> [sulam...@atomina samegame]$ ls *.qml
> Block.qml  Button.qml  samegame.qml
> [sulam...@atomina samegame]$ ./samegame
> file:samegame.qml:29:3: Button is not a type
>     Button {
>     ^
>
> Maybe I should do a printscreen, everybody asks the the same question...

Try adding the import path with:

view.engine()->addImportPath( QCoreApplication::applicationFilePath() );

Maybe this should solve your issue?

Cheers,

-- 
---
Artur Duque de Souza
openBossa
INdT - Instituto Nokia de Tecnologia
---
Blog: http://blog.morpheuz.cc
PGP: 0xDBEEAAC3 @ wwwkeys.pgp.net
---

___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Multiple qml files in one .cpp

2010-08-27 Thread Sulamita Garcia
On Fri, Aug 27, 2010 at 12:39 PM, Kai Koehne  wrote:

>
> Are you sure that you're running it really from within
> '/home/sulamita/src/samegame' ?
>

I know, it's hard to believe, isn't?

[sulam...@atomina samegame]$ pwd
/home/sulamita/src/samegame
[sulam...@atomina samegame]$ ls *.qml
Block.qml  Button.qml  samegame.qml
[sulam...@atomina samegame]$ ./samegame
file:samegame.qml:29:3: Button is not a type
Button {
^

Maybe I should do a printscreen, everybody asks the the same question...

-- 
Brain: Prepare yourself for your 15 minutes of fame
Pinky: after that, can I have 15 minutes of Macarena?

  °v°  Sulamita Garcia
 /(_)\ http://sulamita.net/
  ^ ^
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Multiple qml files in one .cpp

2010-08-27 Thread Kai Koehne
On 8/27/2010 12:45 PM, ext Sulamita Garcia wrote:
> Thanks for the answers, but the only thing that worked was changing the
> setSource to the absolute path:
>
> view.setSource(QUrl::fromLocalFile("/home/sulamita/src/samegame/samegame.qml"));

Are you sure that you're running it really from within 
'/home/sulamita/src/samegame' ? E.g. Qt Creator by default does shadow 
building ...

Anyway, a safer way to write this should be

QString absolutePath = QCoreApplication::applicationDirPath () + 
"/samegame.qml";
QUrl::fromLocalFile(QUrl::fromLocalFile(absolutePath));

(given that your executable is indeed in the same directory as 
samegame.qml).

Kai

-- 
Kai Koehne
Software Engineer
Nokia, Qt Development Frameworks

Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Multiple qml files in one .cpp

2010-08-27 Thread Sulamita Garcia
Thanks for the answers, but the only thing that worked was changing the
setSource to the absolute path:

view.setSource(QUrl::fromLocalFile("/home/sulamita/src/samegame/samegame.qml"));

Can anyone explain to me why?

-- 
Brain: Prepare yourself for your 15 minutes of fame
Pinky: after that, can I have 15 minutes of Macarena?

  °v°  Sulamita Garcia
 /(_)\ http://sulamita.net/
  ^ ^
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Multiple qml files in one .cpp

2010-08-23 Thread bea.lam

On 21/08/2010, at 1:12 AM, ext Sulamita Garcia wrote:

> Hi
> 
> I'm following the SameGame example -  
> http://doc.qt.nokia.com/4.7-snapshot/qml-advtutorial.html. The example runs 
> fine with qmlviewer, but I'm trying to generate a release for it. I have a 
> main.cpp like this:
> 
> #include 
> #include 
> 
> int main(int argc, char *argv[])
> {
> 
> QApplication app(argc, argv);
> 
> QDeclarativeView view;
> view.setSource(QUrl::fromLocalFile("samegame.qml"));
> view.show();
> 
> return app.exec();
> 
> }
> 
> And although the example works fine with qmlviewer, when I try to run 
> samegame binary, it says: 
> file:samegame.qml:28:3: Button is not a type 
> Button { 
> ^ 
> 
> All the files are in the same directory. Do I need to create a resource file 
> or is there something else I should be doing?


This certainly should work, and runs without problems for me. There may have 
been issues in previous snapshots or beta releases that have now been fixed.

regards,

Bea
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Multiple qml files in one .cpp

2010-08-22 Thread henrik.hartz
Hi,

You should probably try running your release code with

   QML_IMPORT_TRACE

defined, which will print the import paths to the console;

   http://doc.trolltech.com/4.7-snapshot/qdeclarativedebugging.html

Cheers,
Henrik

On Aug 20, 2010, at 5:12 PM, ext Sulamita Garcia wrote:

Hi

I'm following the SameGame example -  
http://doc.qt.nokia.com/4.7-snapshot/qml-advtutorial.html. The example runs 
fine with qmlviewer, but I'm trying to generate a release for it. I have a 
main.cpp like this:

#include 
#include 

int main(int argc, char *argv[])
{

QApplication app(argc, argv);

QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("samegame.qml"));
view.show();

return app.exec();

}

And although the example works fine with qmlviewer, when I try to run samegame 
binary, it says:
file:samegame.qml:28:3: Button is not a type
Button {
^

All the files are in the same directory. Do I need to create a resource file or 
is there something else I should be doing?

regards,

--
Brain: Prepare yourself for your 15 minutes of fame
Pinky: after that, can I have 15 minutes of Macarena?

  °v°  Sulamita Garcia
 /(_)\ http://sulamita.net/
  ^ ^


___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


[Qt-qml] Multiple qml files in one .cpp

2010-08-20 Thread Sulamita Garcia
Hi

I'm following the SameGame example -
http://doc.qt.nokia.com/4.7-snapshot/qml-advtutorial.html. The example runs
fine with qmlviewer, but I'm trying to generate a release for it. I have a
main.cpp like this:

#include 
#include 

int main(int argc, char *argv[])
{

QApplication app(argc, argv);

QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("samegame.qml"));
view.show();

return app.exec();

}

And although the example works fine with qmlviewer, when I try to run
samegame binary, it says:
file:samegame.qml:28:3: Button is not a type
Button {
^

All the files are in the same directory. Do I need to create a resource file
or is there something else I should be doing?

regards,

-- 
Brain: Prepare yourself for your 15 minutes of fame
Pinky: after that, can I have 15 minutes of Macarena?

  °v°  Sulamita Garcia
 /(_)\ http://sulamita.net/
  ^ ^
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml