Pharo and QT

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Pharo and QT

kilon.alios
Is there an interest for working with QT from Pharo ? I make no promises just something I was interested in trying. 
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

HilaireFernandes
A must for any serious dekstop application with Pharo, but it is a hudge
task


Le 29/05/2017 à 14:35, Dimitris Chloupis a écrit :
> Is there an interest for working with QT from Pharo ? I make no
> promises just something I was interested in trying.

--
Dr. Geo
http://drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

Stephane Ducasse-3
Hi dimitris

We would love to have that. We could have a Spec binding and build automatically applications in QT for people willing. 
Esteban always wanted to have a Cocoa binding used the same way. 
But this is large task

Stef

On Thu, Jun 1, 2017 at 2:44 PM, Hilaire <[hidden email]> wrote:
A must for any serious dekstop application with Pharo, but it is a hudge
task


Le 29/05/2017 à 14:35, Dimitris Chloupis a écrit :
> Is there an interest for working with QT from Pharo ? I make no
> promises just something I was interested in trying.

--
Dr. Geo
http://drgeo.eu




Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

kilon.alios
There is a way to make this into a small task

One of my experiments of testing my Pharo to Python bridge (What I have named project "Atlas") was to  build a QT hello world example. It created a problem because I was using python threads that QT does not like (it offers its own kind of threads) but after changing the code to use no threads, it worked. 

My bridge is not like UFFI where anything has to be wrapped because unlike C , Python is a dynamic language so there is no need for wrappers because Atlas allows dynamic execution of code. But of course there is the issues of data types and how they can be mapped to Pharo and the fact that PyQT free version is GPL and commercial is 500 dollars which sits of course on top of the commercial version of QT. So at the time I decided to not pursue it. 

I will give it a try and see how far it can goes, at worst I may offer a partial solution to using QT with Pharo. Then someone else can take it from there if there is genuine interest and expand it to more features.  

On Fri, Jun 2, 2017 at 12:01 AM Stephane Ducasse <[hidden email]> wrote:
Hi dimitris

We would love to have that. We could have a Spec binding and build automatically applications in QT for people willing. 
Esteban always wanted to have a Cocoa binding used the same way. 
But this is large task

Stef

On Thu, Jun 1, 2017 at 2:44 PM, Hilaire <[hidden email]> wrote:
A must for any serious dekstop application with Pharo, but it is a hudge
task


Le 29/05/2017 à 14:35, Dimitris Chloupis a écrit :
> Is there an interest for working with QT from Pharo ? I make no
> promises just something I was interested in trying.

--
Dr. Geo
http://drgeo.eu




Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

Ben Coman
As long as your having fun yourself, sounds like a good idea.  If you manage a minimum viable product like example code, wider interest may arise. Good luck.
cheers -ben 

On Sat, Jun 3, 2017 at 4:00 AM, Dimitris Chloupis <[hidden email]> wrote:
There is a way to make this into a small task

One of my experiments of testing my Pharo to Python bridge (What I have named project "Atlas") was to  build a QT hello world example. It created a problem because I was using python threads that QT does not like (it offers its own kind of threads) but after changing the code to use no threads, it worked. 

My bridge is not like UFFI where anything has to be wrapped because unlike C , Python is a dynamic language so there is no need for wrappers because Atlas allows dynamic execution of code. But of course there is the issues of data types and how they can be mapped to Pharo and the fact that PyQT free version is GPL and commercial is 500 dollars which sits of course on top of the commercial version of QT. So at the time I decided to not pursue it. 

I will give it a try and see how far it can goes, at worst I may offer a partial solution to using QT with Pharo. Then someone else can take it from there if there is genuine interest and expand it to more features.  

On Fri, Jun 2, 2017 at 12:01 AM Stephane Ducasse <[hidden email]> wrote:
Hi dimitris

We would love to have that. We could have a Spec binding and build automatically applications in QT for people willing. 
Esteban always wanted to have a Cocoa binding used the same way. 
But this is large task

Stef

On Thu, Jun 1, 2017 at 2:44 PM, Hilaire <[hidden email]> wrote:
A must for any serious dekstop application with Pharo, but it is a hudge
task


Le 29/05/2017 à 14:35, Dimitris Chloupis a écrit :
> Is there an interest for working with QT from Pharo ? I make no
> promises just something I was interested in trying.

--
Dr. Geo
http://drgeo.eu





Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

Pharo Smalltalk Users mailing list
In reply to this post by kilon.alios
With regard to 

>> the fact that PyQT free version is GPL and commercial is 500 dollars which sits of course on top of the commercial version of QT
 
There is an alternative to PyQt, that the Qt company intends to make a first-class citizen of the Qt ecosystem, namely PySide(2). The project languished after Nokia sold Qt to what is know "The Qt Company", but development is ongoing again. For details, see https://wiki.qt.io/PySide2 and https://groups.google.com/d/msg/pyside-dev/pqwzngAGLWE/kXUpXBhILAAJ For the record, I do not use PySide (or PyQt for that matter) and I do not know what the current status is of this endeavor.

Kind regards, Pieter.


On Friday, June 2, 2017 10:02 PM, Dimitris Chloupis <[hidden email]> wrote:


There is a way to make this into a small task

One of my experiments of testing my Pharo to Python bridge (What I have named project "Atlas") was to  build a QT hello world example. It created a problem because I was using python threads that QT does not like (it offers its own kind of threads) but after changing the code to use no threads, it worked. 

My bridge is not like UFFI where anything has to be wrapped because unlike C , Python is a dynamic language so there is no need for wrappers because Atlas allows dynamic execution of code. But of course there is the issues of data types and how they can be mapped to Pharo and the fact that PyQT free version is GPL and commercial is 500 dollars which sits of course on top of the commercial version of QT. So at the time I decided to not pursue it. 

I will give it a try and see how far it can goes, at worst I may offer a partial solution to using QT with Pharo. Then someone else can take it from there if there is genuine interest and expand it to more features.  

On Fri, Jun 2, 2017 at 12:01 AM Stephane Ducasse <[hidden email]> wrote:
Hi dimitris

We would love to have that. We could have a Spec binding and build automatically applications in QT for people willing. 
Esteban always wanted to have a Cocoa binding used the same way. 
But this is large task

Stef

On Thu, Jun 1, 2017 at 2:44 PM, Hilaire <[hidden email]> wrote:
A must for any serious dekstop application with Pharo, but it is a hudge
task


Le 29/05/2017 à 14:35, Dimitris Chloupis a écrit :
> Is there an interest for working with QT from Pharo ? I make no
> promises just something I was interested in trying.

--
Dr. Geo
http://drgeo.eu






Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

Pharo Smalltalk Users mailing list
In reply to this post by kilon.alios
One other thing, what part of Qt you would like to use, the widget world or the QML world?

I have been thinking about building a UI in QML and using Pharo to implement the model. This could be doable. However, the best idea I came up with (up till now) would require custom glue code in C++ (although I do like the idea of integrating with PyQt or PySide instead). But I have only been toying with the idea, nothing more.

I intended to post the message to the mailing list before, but by accident I sent it directly to another mailing list participant. My sincere apologies for that...

Kind regards, Pieter.

On Friday, June 2, 2017 10:02 PM, Dimitris Chloupis <[hidden email]> wrote:


There is a way to make this into a small task

One of my experiments of testing my Pharo to Python bridge (What I have named project "Atlas") was to  build a QT hello world example. It created a problem because I was using python threads that QT does not like (it offers its own kind of threads) but after changing the code to use no threads, it worked. 

My bridge is not like UFFI where anything has to be wrapped because unlike C , Python is a dynamic language so there is no need for wrappers because Atlas allows dynamic execution of code. But of course there is the issues of data types and how they can be mapped to Pharo and the fact that PyQT free version is GPL and commercial is 500 dollars which sits of course on top of the commercial version of QT. So at the time I decided to not pursue it. 

I will give it a try and see how far it can goes, at worst I may offer a partial solution to using QT with Pharo. Then someone else can take it from there if there is genuine interest and expand it to more features.  



Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

Julien Delplanque
In reply to this post by kilon.alios
Hello,

Some month ago I did a project that allows to generate python code from
Pharo, Python3Generator [1].
I used it to play with Matplotlib [2] and it works pretty well (I should
announce these projects one day... :-) ).

Seeing your mail, I took a look at it to see if it was possible to make
a PyQt windows
pop using it and it works (I'll put the source code to try by yourself
at the end of this mail).
Of course, once you start Qt events loop, the image is frozen (see the
screenshot attached to this mail).  :-)

Nevertheless, P3G is not complete and yet, you can not retrieve values
from Python side, it is just
used to generate and execute code without getting results back from an
execution. I guess this
will be problematic for buttons callbacks for example. But it could
probably be extended to retrieve
these values...

P3G can use your Atlas Python interpreter but, I could not get a window
to pop with it. I don't know
why since the interpreter returns no error.

Julien

Links:
[1]: https://github.com/juliendelplanque/Python3Generator
[2]: https://github.com/juliendelplanque/MatplotLibBridge

Load P3G:

Metacello new
     baseline: 'Python3Generator';
     repository: 'github://juliendelplanque/Python3Generator/repository';
     load

The source code (#<- message is used to build an assignation, #=> is
used to access the attribute of an object):

"Use and initialize the FFI interpreter."
P3GInterpreter useFFIInterpreter.
P3GInterpreter current pathToPython: '/usr/bin/python3'.

"instructions will hold the instructions of the program we are going to
build."
instructions := P3GInstructionsList new.

"Import sys and PyQt."
sys := 'sys' asP3GIdentifier.

pyqt := 'PyQt4' asP3GIdentifier => 'QtGui'.
instructions
     add: sys import;
     add: pyqt import.

"Instantiate Qt App."
app := 'app' asP3GIdentifier.
instructions
     add: app <- ((pyqt => 'QApplication') callWith: #(())).

"Create a simple window with a progress bar."
w  := 'w' asP3GIdentifier.
instructions
     add: w <- (pyqt => 'QMainWindow') call;
     add: (((w => 'statusBar') call => 'showMessage') callWith: #('Ready'));
     add: ((w => 'setGeometry') callWith: #(300 300 250 150));
     add: (( w => 'setWindowTitle') callWith: #(Statusbar));
     add: (w => 'show') call;
     add: ((sys => 'exit') callWith: { (app => 'exec_') call }).

"Execute the program built (you can inspect instructions to see the
source code)."
instructions execute.

On 02/06/17 22:00, Dimitris Chloupis wrote:

> There is a way to make this into a small task
>
> One of my experiments of testing my Pharo to Python bridge (What I have
> named project "Atlas") was to  build a QT hello world example. It created a
> problem because I was using python threads that QT does not like (it offers
> its own kind of threads) but after changing the code to use no threads, it
> worked.
>
> My bridge is not like UFFI where anything has to be wrapped because unlike
> C , Python is a dynamic language so there is no need for wrappers because
> Atlas allows dynamic execution of code. But of course there is the issues
> of data types and how they can be mapped to Pharo and the fact that PyQT
> free version is GPL and commercial is 500 dollars which sits of course on
> top of the commercial version of QT. So at the time I decided to not pursue
> it.
>
> I will give it a try and see how far it can goes, at worst I may offer a
> partial solution to using QT with Pharo. Then someone else can take it from
> there if there is genuine interest and expand it to more features.
>
> On Fri, Jun 2, 2017 at 12:01 AM Stephane Ducasse <[hidden email]>
> wrote:
>
>> Hi dimitris
>>
>> We would love to have that. We could have a Spec binding and build
>> automatically applications in QT for people willing.
>> Esteban always wanted to have a Cocoa binding used the same way.
>> But this is large task
>>
>> Stef
>>
>> On Thu, Jun 1, 2017 at 2:44 PM, Hilaire <[hidden email]> wrote:
>>
>>> A must for any serious dekstop application with Pharo, but it is a hudge
>>> task
>>>
>>>
>>> Le 29/05/2017 à 14:35, Dimitris Chloupis a écrit :
>>>> Is there an interest for working with QT from Pharo ? I make no
>>>> promises just something I was interested in trying.
>>> --
>>> Dr. Geo
>>> http://drgeo.eu
>>>
>>>
>>>
>>>


=?UTF-8?Q?Capture_d'=c3=a9cran_de_2017-06-03_15-16-26.png?= (603K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

Pharo Smalltalk Users mailing list
In reply to this post by kilon.alios
Yes, yes and one more yes ^-^

I love qt and i like to dive into the world of Pharo: To use both together
reads wonderful, thanks a lot for this proposal.
So i get the idea to integrate it via Python, which is also from my side a
fine approach.

For alternatives, see also: https://github.com/seanchas116/libqmlbind

And, while aimed for staticly typed languages;
https://github.com/filcuc/DOtherSide

And there is also a generic binding in the making for Rust, it might inspire
you as well:
https://cgit.kde.org/scratch/vandenoever/rust_qt_binding_generator.git/log/



--
View this message in context: http://forum.world.st/Pharo-and-QT-tp4948544p4962997.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

Shalok Shalom
In reply to this post by kilon.alios
Yes, yes and one more yes ^-^

I love qt and i like to dive into the world of Pharo: To use both together reads wonderful, thanks a lot for this proposal.
So i get the idea to integrate it via Python, which is also from my side a fine approach.

For alternatives, see also: https://github.com/seanchas116/libqmlbind

And, while aimed for staticly typed languages; https://github.com/filcuc/DOtherSide

And there is also a generic binding in the making for Rust, it might inspire you as well: https://cgit.kde.org/scratch/vandenoever/rust_qt_binding_generator.git/log/
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

kilon.alios
In reply to this post by Pharo Smalltalk Users mailing list
you can make pharo work with any library written by any other language.  many projects do this for web dev mixing htmls javascript and pharo. they can communucate via sockets or ither interfaces. i did this using sockets calling python code from Pharisees for the creation of a simple qt gui.i was thinking making a pharo binding for qt but idecided to focus on a commercial python app i am working on. 

Στις 21 Αυγ 2017 12:42 μ.μ., ο χρήστης "Shalok Shalom via Pharo-users" <[hidden email]> έγραψε:


---------- Forwarded message ----------
From: Shalok Shalom <[hidden email]>
To: [hidden email]
Cc: 
Bcc: 
Date: Mon, 21 Aug 2017 02:38:48 -0700 (PDT)
Subject: Re: Pharo and QT
Yes, yes and one more yes ^-^

I love qt and i like to dive into the world of Pharo: To use both together
reads wonderful, thanks a lot for this proposal.
So i get the idea to integrate it via Python, which is also from my side a
fine approach.

For alternatives, see also: https://github.com/seanchas116/libqmlbind

And, while aimed for staticly typed languages;
https://github.com/filcuc/DOtherSide

And there is also a generic binding in the making for Rust, it might inspire
you as well:
https://cgit.kde.org/scratch/vandenoever/rust_qt_binding_generator.git/log/



--
View this message in context: http://forum.world.st/Pharo-and-QT-tp4948544p4962997.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

Pharo Smalltalk Users mailing list
https://github.com/Papierkorb/bindgen



--
View this message in context: http://forum.world.st/Pharo-and-QT-tp4948544p4963906.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Pharo and QT

Shalok Shalom
In reply to this post by kilon.alios