Results 1 to 17 of 17

Thread: Qt-like php

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Berlin, Germany
    Posts
    64
    Thanks
    1
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Cool Qt-like php

    Not sure if there are many people out there who program in both Qt and PHP but...

    This is not a formal announcement, (I just wanted to pre-announce this on here) but my company has been working on a framework for PHP that lets you create web applications with a qt-like syntax. Oh, also it uses ajax (if its available on the browser) to make the apps more desktop-like. (Everything (except certain signals) still works if the browser doesn't support ajax, it just has refreshes when you click something)

    this is a very simple code example:
    (I'm typing this on my Blackberry, so there may be a typo in the syntax lol)

    php Code:
    1. <?php
    2. require_once('QMainWindow.php');
    3. require_once('QApplication.php');
    4. require_once('QLabel.php');
    5. require_once('QPushButton.php');
    6.  
    7. class win extends QMainWindow {
    8.  
    9. protected $label;
    10. protected $button;
    11.  
    12. public function __construct(&$parent) {
    13. parent::__construct($parent);
    14.  
    15. $this->label = new QLabel('not clicked',$this);
    16. $this->button = new QPushButton('click me',$this);
    17.  
    18. connect($this->button,SIGNAL('clicked()'),$this,SLOT('changeLabel()'));
    19. connect($this,SIGNAL('updateText(QString)'),$this->label,SLOT('setText(QString)'));
    20.  
    21. }
    22.  
    23. public function changeLabel() {
    24. emit('updateText(clicked!)');
    25. }
    26.  
    27. }
    28.  
    29. $app = new QApplication;
    30. $w = new $win($app);
    31. $app->exec();
    32.  
    33. ?>
    To copy to clipboard, switch view to plain text mode 

    The above code does exactly what you would expect (and if your browser supports ajax, it does it without a browser refresh) (all of this outputs strict xhtml and standard javascript to the client browser)
    Our main goal is to follow the Qt 4.2 API as closely as possible (we already have a QCalendarWidget :-). ) considering that this is for a web browser. We already have reimplemented about 25% of the API and will likely have a beta release in about 6 months. Oh, and it also supports .ui designer files :-) and opperator overloading (if you have the PECL extension complied into php)
    One more thing to note, it REQUIRES php 5.2 (which isn't released yet either)(but this is the only server-side requirement) the only requirement on the client side is xhtml support, which even most cell phones have.

    :-)

    -Katrina
    Last edited by wysota; 19th July 2006 at 16:41. Reason: Added [highlight] tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.