By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,887 Members | 1,150 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,887 IT Pros & Developers. It's quick & easy.

extension PHP Qt

P: n/a
Hello,

Three weeks ago, I have started to develop a binding extension for Qt and
PHP 5.

Now, I can display a dialog box containing some widgets like label, buttons
and edit line. I have just implemented some Qt classes (not completly) like
QApplication, QObject, QWidget, Qlabel, QLineEdit and QGrid just to test
some very simple application. The mecanisme of the SLOT and SIGNAL is
working but only for the existing slot and signal.

Now, I would like to implement custom slot and signal but I have some
problems to find the solution for this implementation.

Does somebody has an idee on how it could be possible to implement this
part?
See the following code display an hello world:

<?
if(!extension_loaded('php_qt')) {
dl('php_qt.' . PHP_SHLIB_SUFFIX);
}
class MyApp extends QApplication
{
private $grid;
private $label_version;
private $label_hello;
private $quit_button;
private $about_button;
function __construct()
{
QApplication::QApplication();
$this->init_app();
}

private function init_app()
{
$this->grid = new QGrid(2);
$this->grid->setSpacing(10);
$this->grid->setName("Bonjour MyApp");
$this->label_hello = new QLabel("<center><h1>hello</h1>",$this->grid,
"label_hello");
$this->label_version = new QLabel("<i>PHP Qt</i></center>",$this->grid,
"label_version");
$this->about_button = new QPushButton("About Qt",$this->grid,
"about_button");
$this->quit_button = new QPushButton("Quit",$this->grid, "quit_button");
$this->grid->show();
$this->connect($this->quit_button, SIGNAL("clicked()"), SLOT("quit()"));
$this->connect($this->about_button, SIGNAL"clicked()"),
SLOT("aboutQt()"));
$this->setMainWidget($this->grid);
}
}

$myapp = new MyApp();
$myapp->exec();
?>

Sincerely

Jean-Luc
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hello,

On 11/13/2004 10:44 AM, Gyger wrote:
Three weeks ago, I have started to develop a binding extension for Qt and
PHP 5.


Thne idea is interesting but there are a couple of details that may make
your extension uninteresting for the current PHP community:

1. Very few people will be using PHP 5 soon.

2. Qt Open Source license is GPL. This means that your extension has to
be GPL to be publicly distributed and only GPL programs can use your
extension unless they pay the commercial Qt license.

If you agree that this may be a problem, you may want to consider using
wxWindows instead of Qt, and also benefit of cross-platform with native
bindings without a cost or licence limitations:

http://www.wxwindows.org/

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #2

P: n/a
Manuel Lemos wrote:
Hello,

On 11/13/2004 10:44 AM, Gyger wrote:
Three weeks ago, I have started to develop a binding extension for Qt and
PHP 5.


Thne idea is interesting but there are a couple of details that may make
your extension uninteresting for the current PHP community:

1. Very few people will be using PHP 5 soon.

2. Qt Open Source license is GPL. This means that your extension has to
be GPL to be publicly distributed and only GPL programs can use your
extension unless they pay the commercial Qt license.

If you agree that this may be a problem, you may want to consider using
wxWindows instead of Qt, and also benefit of cross-platform with native
bindings without a cost or licence limitations:

http://www.wxwindows.org/


I see your point of view and thank you for this.

Of course, I would like to distribute this extension with the GPL licence.
If I want to use Qt is because this library is a very power toolkit and I
use it everyday as PHP. I'm checked on Internet and I do not see if
somebody try to implement this binding, like PyQt or PerlQt etc...
Of course, it exist PHP-GTK, but I prefer Qt than GTK. But I don't want to
begin a discussion between this two toolkits, this is not the goal,
everybody prefer what he want.

In a first step, my intention is to have this extension on Linux system and
after also for windows and other, but first on Linux.

I thing that we can build very porwer tool with PHP and Qt.

Jul 17 '05 #3

P: n/a
Hello,

On 11/13/2004 03:04 PM, Gyger Jean-Luc wrote:
Three weeks ago, I have started to develop a binding extension for Qt and
PHP 5.
Thne idea is interesting but there are a couple of details that may make
your extension uninteresting for the current PHP community:

1. Very few people will be using PHP 5 soon.

2. Qt Open Source license is GPL. This means that your extension has to
be GPL to be publicly distributed and only GPL programs can use your
extension unless they pay the commercial Qt license.

If you agree that this may be a problem, you may want to consider using
wxWindows instead of Qt, and also benefit of cross-platform with native
bindings without a cost or licence limitations:

http://www.wxwindows.org/

I see your point of view and thank you for this.

Of course, I would like to distribute this extension with the GPL licence.
If I want to use Qt is because this library is a very power toolkit and I
use it everyday as PHP. I'm checked on Internet and I do not see if
somebody try to implement this binding, like PyQt or PerlQt etc...


AFAIK, nobody is developing Qt bindings extension. The problem is that
if you can't use Qt to develop and distribute non-GPL application
without paying a commercial Qt license fee.

When you posted your message to the public I assumed that you were
interested in attracting other people to help or use your extension.

What I am trying to tell you is that because of the license fee payment
requirement, Qt is not interesting to many people.

Of course, it exist PHP-GTK, but I prefer Qt than GTK. But I don't want to
begin a discussion between this two toolkits, this is not the goal,
everybody prefer what he want.

In a first step, my intention is to have this extension on Linux system and
after also for windows and other, but first on Linux.
Either GTK, Qt and wxWindows can work either on Linux and Windows, so
that is not a problem.

I thing that we can build very porwer tool with PHP and Qt.


I suggested the wxWindows library as an alternative because it is
practically as powerful as Qt and is LGPL, so everybody can use it
without paying commercial license fees. Therefore, a wxWindows extension
would be more interesting than a Qt extension. See what I mean?

Because of the license problems, unlike a Qt extension, a wxWindows
extension would be acceptable for in PECL. If you get your extension
accepted in PECL, you can get much more exposure to your work and
eventually more users and other people helping in the development.

http://pecl.php.net/


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #4

P: n/a
Hello

First, I am completely agree with you concerning the licence problem.

But for me, the goal is not necessary to obtain an extension used by
everybody. If I want to develop this extension is more fore my pleasure and
for my proper using. After, if people like it, use it and help me, ok it is
cool.

I do not develop too much on Window for my pleasure and I thing that to have
a binding php-qt on linux could be very interesting. I am sure that a lot
of people could be interested to see this extension and why not to use it
on linux. On Linux only, why not, that not a problem for me. I thing that
the php community is very open for new porject and is a very big community.
And if somebody are very interested to develop GUI on windows and do not
want to pay something, ok, he can take GTK-PHP.

To resume, the first goal for me, is to have this one on Linux for free and
to have pleasure in this project.

We have discuss a lot concerning the licence problem, but do you have a
response for my question :-).

See you

Jean-Luc

Manuel Lemos wrote:
Hello,

On 11/13/2004 03:04 PM, Gyger Jean-Luc wrote:
Three weeks ago, I have started to develop a binding extension for Qt
and PHP 5.

Thne idea is interesting but there are a couple of details that may make
your extension uninteresting for the current PHP community:

1. Very few people will be using PHP 5 soon.

2. Qt Open Source license is GPL. This means that your extension has to
be GPL to be publicly distributed and only GPL programs can use your
extension unless they pay the commercial Qt license.

If you agree that this may be a problem, you may want to consider using
wxWindows instead of Qt, and also benefit of cross-platform with native
bindings without a cost or licence limitations:

http://www.wxwindows.org/

I see your point of view and thank you for this.

Of course, I would like to distribute this extension with the GPL
licence. If I want to use Qt is because this library is a very power
toolkit and I use it everyday as PHP. I'm checked on Internet and I do
not see if somebody try to implement this binding, like PyQt or PerlQt
etc...


AFAIK, nobody is developing Qt bindings extension. The problem is that
if you can't use Qt to develop and distribute non-GPL application
without paying a commercial Qt license fee.

When you posted your message to the public I assumed that you were
interested in attracting other people to help or use your extension.

What I am trying to tell you is that because of the license fee payment
requirement, Qt is not interesting to many people.

Of course, it exist PHP-GTK, but I prefer Qt than GTK. But I don't want
to begin a discussion between this two toolkits, this is not the goal,
everybody prefer what he want.

In a first step, my intention is to have this extension on Linux system
and after also for windows and other, but first on Linux.


Either GTK, Qt and wxWindows can work either on Linux and Windows, so
that is not a problem.

I thing that we can build very porwer tool with PHP and Qt.


I suggested the wxWindows library as an alternative because it is
practically as powerful as Qt and is LGPL, so everybody can use it
without paying commercial license fees. Therefore, a wxWindows extension
would be more interesting than a Qt extension. See what I mean?

Because of the license problems, unlike a Qt extension, a wxWindows
extension would be acceptable for in PECL. If you get your extension
accepted in PECL, you can get much more exposure to your work and
eventually more users and other people helping in the development.

http://pecl.php.net/


Jul 17 '05 #5

P: n/a
Hello,

On 11/14/2004 01:10 AM, Gyger Jean-Luc wrote:
First, I am completely agree with you concerning the licence problem.

But for me, the goal is not necessary to obtain an extension used by
everybody. If I want to develop this extension is more fore my pleasure and
for my proper using. After, if people like it, use it and help me, ok it is
cool.
Right, but my point is that if you develop an extension that is
interesting to more people, chances are that you get more help to solve
the problems like the one you presented.

I do not develop too much on Window for my pleasure and I thing that to have
a binding php-qt on linux could be very interesting. I am sure that a lot
of people could be interested to see this extension and why not to use it
on linux. On Linux only, why not, that not a problem for me. I thing that
the php community is very open for new porject and is a very big community.
And if somebody are very interested to develop GUI on windows and do not
want to pay something, ok, he can take GTK-PHP.

To resume, the first goal for me, is to have this one on Linux for free and
to have pleasure in this project.
I suspect that you are making a confusion of Linux and GPL. If you want
to distribute a closed source application using your extension that
links to Qt library under Linux, you still have to buy the Qt commercial
license. Everybody that uses your extension under Linux to distribute
the closed source applications has to pay its own QT commercial license.

This means that if you develop and distribute an application with your
extension, either you open the source of your application (not just the
extension) with GPL license or you have to pay for a Qt commercial license.

GPL software is not free as in free beer.

We have discuss a lot concerning the licence problem, but do you have a
response for my question :-).


Sorry, no. I was just suggesting that you use a different toolkit with
non-GPL license so you could improve your chances of getting more help.
In that case you could have your project accepted in PECL and it would
boost your extension exposure in the PHP community and eventually get
the you need.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #6

P: n/a
Hello,

Manuel Lemos wrote:
Hello,

On 11/14/2004 01:10 AM, Gyger Jean-Luc wrote:
First, I am completely agree with you concerning the licence problem.

But for me, the goal is not necessary to obtain an extension used by
everybody. If I want to develop this extension is more fore my pleasure
and for my proper using. After, if people like it, use it and help me, ok
it is cool.
Right, but my point is that if you develop an extension that is
interesting to more people, chances are that you get more help to solve
the problems like the one you presented.


This is true...
I do not develop too much on Window for my pleasure and I thing that to
have a binding php-qt on linux could be very interesting. I am sure that
a lot of people could be interested to see this extension and why not to
use it on linux. On Linux only, why not, that not a problem for me. I
thing that the php community is very open for new porject and is a very
big community. And if somebody are very interested to develop GUI on
windows and do not want to pay something, ok, he can take GTK-PHP.

To resume, the first goal for me, is to have this one on Linux for free
and to have pleasure in this project.
I suspect that you are making a confusion of Linux and GPL. If you want
to distribute a closed source application using your extension that
links to Qt library under Linux, you still have to buy the Qt commercial
license. Everybody that uses your extension under Linux to distribute
the closed source applications has to pay its own QT commercial license.


No no, I am not confuse. it is just that I am not interesting of closed
source application. This is not my problem if people working with close
source must buy a Qt licence. This is a good point for trolltech :-)
This means that if you develop and distribute an application with your
extension, either you open the source of your application (not just the
extension) with GPL license or you have to pay for a Qt commercial
license.

GPL software is not free as in free beer.

We have discuss a lot concerning the licence problem, but do you have a
response for my question :-).


Sorry, no. I was just suggesting that you use a different toolkit with
non-GPL license so you could improve your chances of getting more help.
In that case you could have your project accepted in PECL and it would
boost your extension exposure in the PHP community and eventually get
the you need.


Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.