Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2011-08

Problem with Qt binding v2.4

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Trx TX

Greetings.

I am trying to switch to version 2.4, i have compiled it for ARM in scratchbox for Harmattan which has Qt libs version 4.7.2. Library was compiled with success, but when i try to compile a simple project in Lazarus that uses Qt widgetset i get the following error :

Free Pascal Compiler version 2.7.1 [2011/08/03] for arm Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for ARMEL
Compiling test.lpr
Assembling test
Compiling resource /home/trx/n950/test/lib/arm-linux/test.or Linking test
/home/trx/lazarus/fpc/libcross_meego/libQt4Pas.so: undefined reference to `QTextBlock::isValid() const' test.lpr(22) Error: Error while linking
/home/trx/lazarus/fpc/libcross_meego/libQt4Pas.so: undefined reference to `QTextBlock::isValid() const' test.lpr(22) Error: Error while linking
test.lpr(22) Fatal: There were 1 errors compiling module, stopping

Any idea what this error might be about?

Thanks,

Svetozar Belic.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20110817/70d9aed0/attachment.html>
Den Jean
to Trx TX
Trx TX wrote
Greetings. I am trying to switch to version 2.4, i have compiled it for ARM in scratchbox for Harmattan which has Qt libs version 4.7.2. Library was

Compiling the binding (c++ code) in scratchbox is fine.

compiled with success, but when i try to compile a simple project in Lazarus that uses Qt widgetset i get the following error :

I hope you do not do this in scratchbox, scratchbox tries to foul the compilers, it does not work with fpc.

Show quoted text 9 lines
Free Pascal Compiler version 2.7.1 [2011/08/03] for arm Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for ARMEL Compiling test.lpr Assembling test Compiling resource /home/trx/n950/test/lib/arm-linux/test.or Linking test /home/trx/lazarus/fpc/libcross_meego/libQt4Pas.so: undefined reference to `QTextBlock::isValid() const' test.lpr(22) Error: Error while linking

Strange, that function is inline, can you provide me the definition of it in the qt headers. In Desktop Qt 4.5 and 4.7 it is:

from header qt-all-opensource-src-4.5.3/src/gui/text/qtextobject.h:

class Q_GUI_EXPORT QTextBlock
{
...snip...
inline bool isValid() const { return p != 0 && n != 0; }

Therefore I do not expect this symbol to be present in any Qt lib.

Any idea what this error might be about?

Can you also detail your setup (I am curious)
I see meego but also harmattan, I have no harmattan experience, but I suppose it is like fremantle and therefore not binary compatible with hardfloat meego ?!

regards,

Den Jean

Trx TX
to Den Jean

Hi, thank you for your answer.

Here it's not inlined, its just :

    bool isValid() const;

I have in the meantime commented out that function in the library, and it works perfectly. I have compiled it in scratchbox (harmattan sdk is available now like fremantle..) which can be downloaded from nokia's site... I believe that Harmattan is hardfloat now, like MeeGo.

Also, since Harmattan is uses QML now, we are in kind of a problem, as QWidget is being deprecated.. There are no native styles, so everything is ugly :)
One more problem is that when you create an application and run it in N950 (i was one of the lucky few who received N950 from Nokia) there is a toolbar in the bottom of the screen which you cant hide unless you have QML code...

For the past few days, i have managed to create a QML window (i have translated some QtDeclarative headers into libQt4Pas) via QDeclarativeView. Then i created a dummy class in the library (QDeclarativeItem), and registered that type during runtime via qmlRegisterType function. Now, if i use eg. a QPushButton i can display it in that QMLWindow via QDeclarativeProxyWidget. But the trouble is, i can't embbed any LCL component because it needs a parent in order to be shown which is where i got stuck. I dont know how to make LCL component to be drawn(is this the right word?) without a parent (not possible i believe), or how to get a valid hwnd from that qml window.. Do you have any suggestions how to solve this?

It would be nice to mix QML and LCL :)

One more thing, i have translated the whole QtSensors, and they can now be used in fpc, i also created classes for them to simplify the use... I didn't translate hooks (there are a few) because i dont know C++ that well, but i will manage looking at the library as an example. So i hope i can contribute that to the library when i finish if you are interested..

Svetozar Belic.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Den Jean
to Trx TX
Trx TX wrote 8 lines
Hi, thank you for your answer. Here it's not inlined, its just : bool isValid() const; I have in the meantime commented out that function in the library, and it works perfectly.

Then that is actually a bug in your setup: your Qt headers do not match your Qt binary libraries. You should report this bug.

Show quoted text 6 lines
I have compiled it in scratchbox (harmattan sdk is available now like fremantle..) which can be downloaded from nokia's site... I believe that Harmattan is hardfloat now, like MeeGo. Also, since Harmattan is uses QML now, we are in kind of a problem, as QWidget is being deprecated.. There are no native styles, so everything is

Is qwidget not present anymore in the compiled libraries? In Fremantle the methods with the deprecated decorator where not present in the binary libraries. How did you manage to compile lcl?

Show quoted text 9 lines
ugly :) One more problem is that when you create an application and run it in N950 (i was one of the lucky few who received N950 from Nokia) there is a toolbar in the bottom of the screen which you cant hide unless you have QML code... For the past few days, i have managed to create a QML window (i have translated some QtDeclarative headers into libQt4Pas) via QDeclarativeView. Then i created a dummy class in the library (QDeclarativeItem), and

Tell me which classes you need and I may look into it (but w/o a N950 I am not sure if this easy)

Show quoted text 8 lines
registered that type during runtime via qmlRegisterType function. Now, if i use eg. a QPushButton i can display it in that QMLWindow via QDeclarativeProxyWidget. But the trouble is, i can't embbed any LCL component because it needs a parent in order to be shown which is where i got stuck. I dont know how to make LCL component to be drawn(is this the right word?) without a parent (not possible i believe), or how to get a valid hwnd from that qml window.. Do you have any suggestions how to solve this?

Given the screen size and the difference in widget layout http://users.telenet.be/Jan.Van.hijfte/qtforfpc/maemo_lcl_qt4.png I think using Qt directly in FPC seems better than using LCL/Qt. I did some programs in FPC/Qt and what is nice that I can easily compile and develop on the device. FPC is so fast, compiling the same program in C++ is impossible on the device. Meego on a tablet with a large screen size would make LCL interesting again.

It would be nice to mix QML and LCL :)

I did not look into Qt Quick yet.

One more thing, i have translated the whole QtSensors, and they can now be

I may look into it, but w/o an N950 ... and Meego on the N900 is just too slow. The emulator in Qt Sdk is probably also very slow, I tried Debian on qemu and it is just too slow.

regards,

Den Jean

Trx TX
to Den Jean

Hi,

Is qwidget not present anymore in the compiled libraries? In Fremantle the methods with the deprecated decorator where not present in the binary libraries. How did you manage to compile lcl?

It is still there and functional, but its use is now discouraged. On harmattan it doesn't have a native style, like QML apps have. (Like it has in fremantle)

Tell me which classes you need and I may look into it (but w/o a N950 I am not sure if this easy)

Well i basicaly need TSynEdit inside a window created by QML (QDeclarativeView), that means that i need a TWinControl (is this the only way?) that i can use as a parent for LCL controls in order to create/show them. Or some kind of handle that i can use as a HWND... I dont understand very well how LCL works regarding this...

Show quoted text 8 lines
Given the screen size and the difference in widget layout http://users.telenet.be/Jan.Van.hijfte/qtforfpc/maemo_lcl_qt4.png I think using Qt directly in FPC seems better than using LCL/Qt. I did some programs in FPC/Qt and what is nice that I can easily compile and develop on the device. FPC is so fast, compiling the same program in C++ is impossible on the device. Meego on a tablet with a large screen size would make LCL interesting again.

Well, yes but sometimes LCL is needed anyway, for porting apps, etc.. There is no diffrence in wigdet layout as they have no styles, so they look identical on the designer and during runtime. You can force one using eg. -style cleanlooks when running the executable and it will use this style, but it wont change any layout, just the looks of it.

I did not look into Qt Quick yet.

I personally dont like it, but in order to do some things in Harmattan you must use it. For example, to hide the annoying status bar at the bottom that every application gets even tho you havent't used any status bars in code...

I may look into it, but w/o an N950 ... and Meego on the N900 is just too slow. The emulator in Qt Sdk is probably also very slow, I tried Debian on qemu and it is just too slow.

Yeah, but things will improve hopefuly, they already did, with MeeGo CE.. People tested and it works pretty fast on N900 if you have class 6+ microSD card.. (I dont so i didnt test)

Svetozar Belic.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Den Jean
to Trx TX
Trx TX wrote
People tested and it works pretty fast on N900 if you have class 6+ microSD

I tested it on a class 10 card and it was unbearably and ridiculously slow. So slow that the phone was complete unusable for normal usage (phone,sms, take picture, browse ... ). It is a joke how Maemo was so good years before other smartphones (real and usable multi-tasking,copy past, great task switcher, great battery life,...)and now Meego seems to have started from scratch trying to solve all optimizations already present in Maemo all over again (power optimization, startup speed of phone, startup speed of apps, ..). I hope the next release will be usable, because I really like to have a small, almost standard linux in a phone (Android is not comparable)

regards,

Den Jean

Felipe Monteiro de Carvalho
to Den Jean
Den Jean wrote
I hope the next release will be usable

Will there be a next release? Who will manufacture devices based on it?

Nokia was working on MeeGo, but from what I read now I don't think they will continue with it. The new CEO from Nokia is so sold out to Microsoft that he even refused to sell N9 in the USA and UK (which I can only interpret as an attempt to sabotage the product).

Felipe Monteiro de Carvalho