Recent

Author Topic: where qt4pas sources are?  (Read 19479 times)

mm7

  • Full Member
  • ***
  • Posts: 119
where qt4pas sources are?
« on: January 04, 2016, 04:59:09 pm »
I've added some improvements in lib qt4pas5.
Added support of sidebar URLs of QFileDialog, that allows to add/remove them programmatically.
(Also I've added support for this in LCL WS for QT.)

How to include these changes to qt4pas "trunk"?
I've got sources from http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html
But there is no SVN or GIT repo.
Also I've found SVN https://sourceforge.net/projects/qt4pas/?source=navbar
and GIT https://github.com/herecura/qt4pas

Which is correct one? I mean from which it will be fast go to linux distros?

zeljko

  • Hero Member
  • *****
  • Posts: 1081
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: where qt4pas sources are?
« Reply #1 on: January 04, 2016, 06:21:32 pm »
 qt4pas sources ? you mean qt45.pas in lcl/interfaces/qt ?

mm7

  • Full Member
  • ***
  • Posts: 119
Re: where qt4pas sources are?
« Reply #2 on: January 04, 2016, 07:42:22 pm »
this qt45.pas is just declaration for binding to libqt4pas5.so dynamic library. Actual code, that is C++ "flattened" to C calls, I took from here http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html
I've added 2 more functions into qfiledialog_c.cpp
Code: Javascript  [Select]
  1. C_EXPORT void QFileDialog_sidebarUrls(QFileDialogH handle, PPtrIntArray retval)
  2. {
  3.   qDebug() << "QFileDialog_sidebarUrls";
  4.  
  5.         QList<QUrl> t_retval;
  6.         t_retval = ((QFileDialog *)handle)->sidebarUrls();
  7.         copyQListTemplateToPtrIntArrayWithNew(t_retval, retval);
  8. }
  9.  
  10. C_EXPORT void QFileDialog_setSidebarUrls(QFileDialogH handle, PPtrIntArray urls)
  11. {
  12.         QList<QUrl> t_urls;
  13.         //copyPtrIntArrayToQListTemplate(urls, t_urls); //this gives compilation error because QUrl should be dereferenced.
  14.         //Replacing it with following inline code
  15.  
  16.         int len = getPtrIntArrayLength(urls);
  17.         t_urls.clear();
  18.         if (len>0) {
  19.                 PTRINT *array = (PTRINT*)getPtrIntArrayAddr(urls);
  20.                 for (int i = 0; i < len; i++){
  21.                         QUrl* url = (QUrl*)array[i];
  22.                         t_urls.append(*url);
  23.                 }
  24.         }
  25.  
  26.         ((QFileDialog *)handle)->setSidebarUrls(t_urls);
  27.  
  28. }
  29.  
And, of course, I've added their declarations into the qt45.pas.

zeljko

  • Hero Member
  • *****
  • Posts: 1081
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: where qt4pas sources are?
« Reply #3 on: January 04, 2016, 08:08:16 pm »
You must ask Den Jean (author of C bindings) about it.

mm7

  • Full Member
  • ***
  • Posts: 119
Re: where qt4pas sources are?
« Reply #4 on: January 04, 2016, 09:05:47 pm »

zeljko

  • Hero Member
  • *****
  • Posts: 1081
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: where qt4pas sources are?
« Reply #5 on: January 05, 2016, 12:48:11 pm »
I've also sent to him an e-mail a month ago, about Qt5 bindings but he did not answer, so if he is not active anymore I don't know what do to....we must find the way how to create new bindings for Qt5 somehow.

mm7

  • Full Member
  • ***
  • Posts: 119
Re: where qt4pas sources are?
« Reply #6 on: January 05, 2016, 07:59:30 pm »
Yes, it does not seem active. That is why I've originated this thread.

As soon as it is GPL, may it be it would be better to add it (qt4pas, qt5pas) to FPC/Lazarus trunk? Or cpp code is "Big NO-NO" there?
Anyway, I think, both qt4pas and qt5pas  should be loaded into some SVN/GIT repo.

https://github.com/herecura/qt4pas looks like just Deb packaging project. It takes sources from original web site.

https://sourceforge.net/projects/qt4pas/files/ also does not have sources, just dll for windows.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7507
Re: where qt4pas sources are?
« Reply #7 on: January 05, 2016, 08:02:28 pm »
Or cpp code is "Big NO-NO" there?

Yes, and unrelated anyway since not needed for the core of FPC. We also have mysql headers, but dont have the source for mysqlclient in FPC svn.


zeljko

  • Hero Member
  • *****
  • Posts: 1081
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: where qt4pas sources are?
« Reply #8 on: January 05, 2016, 08:06:16 pm »
Yes, it does not seem active. That is why I've originated this thread.

As soon as it is GPL, may it be it would be better to add it (qt4pas, qt5pas) to FPC/Lazarus trunk? Or cpp code is "Big NO-NO" there?
Anyway, I think, both qt4pas and qt5pas  should be loaded into some SVN/GIT repo.

https://github.com/herecura/qt4pas looks like just Deb packaging project. It takes sources from original web site.

https://sourceforge.net/projects/qt4pas/files/ also does not have sources, just dll for windows.

1.It can be setted up from current sources (as fork) somewhere on the net.
2.It's not trivial task since Den provided binary libs also for win32,linux32/64 and darwin .
3.Any change must be Qt-4.5 compatibile as we guarantee that, so if your addon does not exist in Qt-4.5 then
  it should not be there.
4.Biggest problem is that C bindings (sources) are generated by Den's scripts which aren't available, so everything without
  it is real PITA.

mm7

  • Full Member
  • ***
  • Posts: 119
Re: where qt4pas sources are?
« Reply #9 on: January 05, 2016, 08:48:34 pm »
1.It can be setted up from current sources (as fork) somewhere on the net.
2.It's not trivial task since Den provided binary libs also for win32,linux32/64 and darwin .
3.Any change must be Qt-4.5 compatibile as we guarantee that, so if your addon does not exist in Qt-4.5 then
  it should not be there.
4.Biggest problem is that C bindings (sources) are generated by Den's scripts which aren't available, so everything without
  it is real PITA.

1. that would be nice

2. that we should think how to cross compile. may be a problem.

3. I've checked. QFileDialog::sidebarUrls QFileDialog::setSidebarUrls were introduced in Qt 4.3. I am not sure why they were not included.
This also makes me doubt that all Qt sources were generated by scripts. Scripts would get all members of QFileDialog class.
Or, probably, Den just manually removed whatever did not generated correctly.
For example, I had to replace copyPtrIntArrayToQListTemplate call with inline code.

4. Yes, it would be nice Den share these scripts, if he is not interested to maintain these qt*pas bindings.
May be some tools/scripts can be found on Web...

zeljko

  • Hero Member
  • *****
  • Posts: 1081
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: where qt4pas sources are?
« Reply #10 on: January 05, 2016, 09:36:51 pm »
I've asked him about scripts few years ago and got negative answer from him.

mm7

  • Full Member
  • ***
  • Posts: 119
Re: where qt4pas sources are?
« Reply #11 on: January 05, 2016, 10:04:30 pm »
Well, too bad. :(

currently I'm looking into SWIG and CABLE that probably can do (semi)automatic wrapping to C, and, probably, may be with some development, even produce Pascal headers...

mm7

  • Full Member
  • ***
  • Posts: 119
Re: where qt4pas sources are?
« Reply #12 on: January 05, 2016, 10:13:52 pm »
Or cpp code is "Big NO-NO" there?

Yes, and unrelated anyway since not needed for the core of FPC. We also have mysql headers, but dont have the source for mysqlclient in FPC svn.

BTW, I've found some cpp in FPC ;)
/usr/share/fpcsrc/2.6.4/rtl/beos/i386/dllprt.cpp
/usr/share/fpcsrc/2.6.4/rtl/haiku/i386/dllprt.cpp
/usr/share/fpcsrc/2.6.4/rtl/symbian/bindings/pbeexe.cpp


Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: where qt4pas sources are?
« Reply #13 on: January 06, 2016, 01:44:39 pm »
3.Any change must be Qt-4.5 compatibile as we guarantee that...

There is not much left running with Qt4 (similar for Gtk2). I would implement any changes for Qt5.
Lazarus 1.7 (SVN) FPC 3.0.0

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7507
Re: where qt4pas sources are?
« Reply #14 on: January 06, 2016, 02:31:09 pm »
Or cpp code is "Big NO-NO" there?

Yes, and unrelated anyway since not needed for the core of FPC. We also have mysql headers, but dont have the source for mysqlclient in FPC svn.

BTW, I've found some cpp in FPC ;)
/usr/share/fpcsrc/2.6.4/rtl/beos/i386/dllprt.cpp
/usr/share/fpcsrc/2.6.4/rtl/haiku/i386/dllprt.cpp
/usr/share/fpcsrc/2.6.4/rtl/symbian/bindings/pbeexe.cpp

Executable startup code IS required for the core of FPC, hence the exception.