That's strange; I tested the above today in both Linux and OSX, and it
works just fine (as I need it in example 9).
Does the new example 9 (EQL 10.12.6) work for you?
If not, what exact OS (type and version) are you using?
Paul
...and sorry for that, but I really saw the need to move QKeySequence
from primitives to objects (I hope this kind of changes will not be
needed in future).
Anyway, please remember: I only change the EQL version number if
something changed to the library itself, which means:
On every change of the version number, you need to rebuild the whole
EQL library, including all modules.
(Windows note: this can even be tricky: on my Windows 7, with my
personal configuration, I always need to manually delete all compiled
*.obj files from a previous build, simply by manually deleting the
"C:\eql\src\tmp" directory, because a "nmake clean" simply does not(!)
clean-up a previous build!)
Paul
OK, I could reproduce it; the reason is simple: eql/src/first_metatype_id.pro
After changing the Qt version, you always need to build & run the
resulting exe (in fact, your first_metatype_id.h will change).
So, please do the above, then:
- delete file tmp/ecl_fun.o
- qmake eql_lib.pro
- make
and it will work (most probably).
> Great thx ! I'm on Linux, but only removal "src/tmp" before the
> rebuild has helped. Probably it is necessary to mention it in README?
Yes, thanks for the suggestion, I just added a new README-REBUILD.
Paul
I understand; what is the contents of your "first_metatype_id.h"?
On my Linux, with Qt 4.7.0, it is:
257,
Now, I tried to change it to both "256," and "258," and after
rebuilding like so:
- delete file tmp/ecl_fun.o
- qmake eql_lib.pro
- make
I got the exact same error message as you (trying to run the editor.lisp):
"Broken at SET-FORMAT (Position #11759)"
Could you please try to manually edit your number in
"first_metatype_id.h" one higher (and rebuild), and then one lower of
the current value, and report the exact error message?
Paul
Yes, this is certainly causing the trouble.
Could you please run the C debugger and send the backtrace (obviously
with the standard first_metatype_id.h):
First, in eql_lib.pro change:
CONFIG += dll no_keywords uitools release
to:
CONFIG += dll no_keywords uitools debug
and rebuild the lib.
Then run the debugger (in example 9):
gdb eql
r editor.lisp
then, after error (for the backtrace):
bt
Thanks.
> 2. In setFormat(int,int,QTextCharFormat) - QTextCharFormat declared as
> value, NOT a pointer,
> but in editor.lisp for example "*eql-keyword-format*" is a pointer.
Yes, but this is always handled correctly, don't worry. Internally EQL
*always* uses pointers (and QTextCharFormat never caused any trouble
on my 32 bit computer, and I tested quite a lot).
Paul
and sorry, but your:
(defparameter *CFU* (x:do-with (qnew "QTextCharFormat")
("setFontItalic" 1)))
can't work correctly. In fact, expanding
(macroexpand-1 '(x:do-with (qnew "QTextCharFormat")
("setFontItalic" 1)))
gives:
(PROGN (QNEW "QTextCharFormat" "setFontItalic" 1))
which doesn't do what you expected (that is, the "setFontItalic" is ignored).
So use something like:
(defparameter *CFU* (let ((cfu (qnew "QTextCharFormat")))
(qfun cfu ("setFontItalic" 1))
cfu))
The x:do-with macro is intended only for e.g. qfun, qset etc., but not for qnew.
Paul
Thanks, but currently I'm stuck.
After googling a bit, I found this, but maybe it doesn't mean anything...:
http://bugreports.qt.nokia.com/secure/attachment/18279/valgrindoutput.txt
It mentions "QTextFormat::operator==", and QTextCharFormat is
inherited from QTextFormat.
If someone familiar with valgrind and reading this could give some
explanation please?
Paul
just to be sure, could you please create a simple "test.lisp"
containing this line:
(print (eql:qnew "QTextCharFormat"))
and run it:
eql test.lisp
- does it print correctly?
- if not, could you please send another backtrace?
Paul
great!
> Is there any place in source code of "libeql.so" where i can check why
> "QTextCharFormat" is NULL instead of:
> #<QTextCharFormat 0x3A591D0> ?
Every function call starts from:
ecl_fun.cpp: 1641:
caller->qt_metacall(QMetaObject::InvokeMetaMethod, n, args);
Here, it then calls:
_main_q_methods.h: 1581:
Q_INVOKABLE void MsetFormat(QSyntaxHighlighter* o, int x1, int x2,
const QTextCharFormat& x3) { ((LSyntaxHighlighter*)o)->setFormat(x1,
x2, x3); }
which calls a MOC generated file. In my moc file, the line is:
moc__main_q_methods.cpp: 9480:
case 12: MsetFormat((*reinterpret_cast<
QSyntaxHighlighter*(*)>(_a[1])),(*reinterpret_cast<
int(*)>(_a[2])),(*reinterpret_cast<
int(*)>(_a[3])),(*reinterpret_cast< const
QTextCharFormat(*)>(_a[4]))); break;
I think the problem could be the "const" in "reinterpret_cast<const
...>", since I pass a normal, non-const pointer.
(see the function "static MetaArg toMetaArg(const QByteArray& sType,
cl_object l_arg)" in ecl_fun.cpp).
Since the QTextCharFormat argument is a reference (not a pointer), I
simply take the address from the heap created object, and pass it to
the qt_metacall in ecl_fun.cpp. This is probably not "good enough" for
the MOC generated file, as it expects a constant pointer for
dereferencing...
This needs probably some investigation on my side...
Paul
Currently I'm trying to change the handling of all reference types...
Paul
There's now a new version on gitorious (10.12.7), fixing some little
things in clearMetaArg (which in theory could indirectly cause some
trouble).
Since I want to be very careful before changing anything (as for me it
runs all well in OSX, Windows and Linux, on 2 different machines),
I'll not make other experiments for now.
Paul
OK, let's catch that bug!
Attached you find the simplest initial test case I could think of (as
this is basically what I do internally).
When you run it, both output lines should give the same values/pointers.
Does this work for you?
Paul
OK, next step: please insert the attached code snip in ecl_fun.cpp and
run the editor example.
Are the pointers and numbers equal?
Paul
Thanks, exactly what I suspected...
I will make an internal change.
Paul
Please try the new version 10.12.8, I removed the need for
first_metatype_id, changing some internals.
Paul