Massimo Belgrano escreveu:
4. HbQt need PHP to generate .cpp files http://www.php.net
Done I have download 5.2.9.1
Wich web server setup with windows vista?
Only PHP. A web server is not a requisite. PHP is used as scripting
language.
See example below:
File: QAbstractButton.php
<?php
$widget='QAbstractButton';
$inherit='QWidget';
include("header.php");
?>
#include <QAbstractButton>
#include "hbapi.h"
<?php
$funcprot='bool autoExclusive () const';
$funcname='autoExclusive';
$funcpar='';
$funcret='bool';
include("function.php");
$funcprot='bool autoRepeat () const ';
$funcname='autoRepeat';
$funcpar='';
$funcret='bool';
include("function.php");
$funcprot='int autoRepeatDelay () const ';
$funcname='autoRepeatDelay';
$funcpar='';
$funcret='int';
include("function.php");
$funcprot='int autoRepeatInterval () const ';
$funcname='autoRepeatInterval';
$funcpar='';
$funcret='int';
include("function.php");
$funcprot='QButtonGroup * group () const ';
$funcname='group';
$funcpar='';
$funcret='QButtonGroup *';
include("function.php");
// $funcprot='QIcon icon () const ';
// $funcname='icon';
// $funcpar='';
// $funcret='QIcon';
// include("function.php");
// $funcprot='QSize iconSize () const ';
// $funcname='iconSize';
// $funcpar='';
// $funcret='QSize *';
// include("function.php");
$funcprot='bool isCheckable () const ';
$funcname='isCheckable';
$funcpar='';
$funcret='bool';
include("function.php");
$funcprot='bool isChecked () const ';
$funcname='isChecked';
$funcpar='';
$funcret='bool';
include("function.php");
$funcprot='bool isDown () const ';
$funcname='isDown';
$funcpar='';
$funcret='bool';
include("function.php");
$funcprot='void setAutoExclusive ( bool ) ';
$funcname='setAutoExclusive';
$funcpar='bool';
$funcret='void';
include("function.php");
$funcprot='void setAutoRepeat ( bool ) ';
$funcname='setAutoRepeat';
$funcpar='bool';
$funcret='void';
include("function.php");
$funcprot='void setAutoRepeatDelay ( int ) ';
$funcname='setAutoRepeatDelay';
$funcpar='int';
$funcret='void';
include("function.php");
$funcprot='void setAutoRepeatInterval ( int ) ';
$funcname='setAutoRepeatInterval';
$funcpar='int';
$funcret='void';
include("function.php");
$funcprot='void setCheckable ( bool ) ';
$funcname='setCheckable';
$funcpar='bool';
$funcret='void';
include("function.php");
$funcprot='void setDown ( bool ) ';
$funcname='setDown';
$funcpar='bool';
$funcret='void';
include("function.php");
$funcprot='void setIcon ( const QIcon & icon ) ';
$funcname='setIcon';
$funcpar='QIcon';
$funcret='void';
include("function.php");
// $funcprot='void setShortcut ( const QKeySequence & key ) ';
// $funcname='setShortcut';
// $funcpar='QKeySequence';
// $funcret='void';
// include("function.php");
$funcprot='void setText ( const QString & text ) ';
$funcname='setText';
$funcpar='QString';
$funcret='void';
include("function.php");
// $funcprot='QKeySequence shortcut () const ';
// $funcname='shortcut';
// $funcpar='';
// $funcret='QKeySequence *';
// include("function.php");
$funcprot='QString text () const ';
$funcname='text';
$funcpar='';
$funcret='QString';
include("function.php");
$funcprot='void animateClick ( int msec = 100 )';
$funcname='animateClick';
$funcpar='int';
$funcret='void';
include("function.php");
$funcprot='void click () ';
$funcname='click';
$funcpar='';
$funcret='void';
include("function.php");
$funcprot='void setChecked ( bool ) ';
$funcname='setChecked';
$funcpar='bool';
$funcret='void';
include("function.php");
// $funcprot='void setIconSize ( const QSize & size ) ';
// $funcname='setIconSize';
// $funcpar='QSize';
// $funcret='void';
// include("function.php");
$funcprot='void toggle () ';
$funcname='toggle';
$funcpar='';
$funcret='void';
include("function.php");
?>
To create the source, i do:
php QAbstractButton.php > QAbstractButton.cpp
And i get:
/*
$Id: QAbstractButton.cpp 0 0000-00-00 00:00:00Z marcosgambeta $
*/
/*
HbQt - Harbour/xHarbour Qt Library
This library is free software; you can redistribute it and/or modify
it under
the terms of the GNU Lesser General Public License as published by the
Free
Software Foundation; either version 2.1 of the License, or (at your
option)
any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more
details.
You should have received a copy of the GNU Lesser General Public
License along
with this library; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
*/
/*
Auto-generated source code. DO NOT EDIT.
*/
#include <QAbstractButton>
#include "hbapi.h"
/*
bool autoExclusive () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_AUTOEXCLUSIVE )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool b = par1->autoExclusive ( );
hb_retl( b );
}
/*
bool autoRepeat () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_AUTOREPEAT )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool b = par1->autoRepeat ( );
hb_retl( b );
}
/*
int autoRepeatDelay () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_AUTOREPEATDELAY )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
int i = par1->autoRepeatDelay ( );
hb_retni( i );
}
/*
int autoRepeatInterval () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_AUTOREPEATINTERVAL )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
int i = par1->autoRepeatInterval ( );
hb_retni( i );
}
/*
QButtonGroup * group () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_GROUP )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
QButtonGroup * ptr = par1->group ( );
hb_retptr( (QButtonGroup *) ptr );
}
/*
bool isCheckable () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_ISCHECKABLE )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool b = par1->isCheckable ( );
hb_retl( b );
}
/*
bool isChecked () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_ISCHECKED )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool b = par1->isChecked ( );
hb_retl( b );
}
/*
bool isDown () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_ISDOWN )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool b = par1->isDown ( );
hb_retl( b );
}
/*
void setAutoExclusive ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETAUTOEXCLUSIVE )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool par2 = hb_parl(2);
par1->setAutoExclusive ( par2 );
}
/*
void setAutoRepeat ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETAUTOREPEAT )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool par2 = hb_parl(2);
par1->setAutoRepeat ( par2 );
}
/*
void setAutoRepeatDelay ( int )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETAUTOREPEATDELAY )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
int par2 = hb_parni(2);
par1->setAutoRepeatDelay ( par2 );
}
/*
void setAutoRepeatInterval ( int )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETAUTOREPEATINTERVAL )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
int par2 = hb_parni(2);
par1->setAutoRepeatInterval ( par2 );
}
/*
void setCheckable ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETCHECKABLE )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool par2 = hb_parl(2);
par1->setCheckable ( par2 );
}
/*
void setDown ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETDOWN )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool par2 = hb_parl(2);
par1->setDown ( par2 );
}
/*
void setIcon ( const QIcon & icon )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETICON )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
QString par2 = hb_parc(2);
par1->setIcon ( QIcon( par2 ) );
}
/*
void setText ( const QString & text )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETTEXT )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
QString par2 = hb_parc(2);
par1->setText ( par2 );
}
/*
QString text () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_TEXT )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
QString str1 = par1->text ( );
QByteArray ba = str1.toLatin1();
const char *c_str2 = ba.data();
hb_retc( c_str2 );
}
/*
void animateClick ( int msec = 100 )
*/
HB_FUNC( QT_QABSTRACTBUTTON_ANIMATECLICK )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
int par2 = hb_parni(2);
par1->animateClick ( par2 );
}
/*
void click ()
*/
HB_FUNC( QT_QABSTRACTBUTTON_CLICK )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
par1->click ( );
}
/*
void setChecked ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETCHECKED )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
bool par2 = hb_parl(2);
par1->setChecked ( par2 );
}
/*
void toggle ()
*/
HB_FUNC( QT_QABSTRACTBUTTON_TOGGLE )
{
QAbstractButton * par1 = (QAbstractButton *) hb_parptr(1);
par1->toggle ( );
}
Is more easy and fast than manual creation. Only complex functions need
manual creation.
Regards,
Marcos Gambeta
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour