Ernad Husremovic escreveu:
Great news !
Is it implemented similar to the qtRuby, qtPython ?
They are generating bindings automatically all the classes from the framework
with some tools (cpp2xml, kalyptus, qtsmoke ..) ?
Maybe you have wrote that on your blog, but I don't understand spanish language
:).
Great effort, thank you for sharing this.
The work is done manually. See the example:
-----------------
File: qdialog.cpp
-----------------
#include <QDialog>
#include "hbapi.h"
/*
QDialog ( QWidget * parent = 0, Qt::WindowFlags f = 0 )
*/
HB_FUNC( QT_QDIALOG )
{
QDialog* dialog = NULL;
QWidget* parent = ISNIL(1)? 0 : (QWidget*) hb_parptr(1);
int f = ISNIL(2)? 0 : hb_parni(2);
dialog = new QDialog( parent, (Qt::WindowFlags) f );
hb_retptr( (QDialog*) dialog );
}
/*
bool isModal () const
void setModal ( bool modal )
*/
HB_FUNC( QT_QDIALOG_ISMODAL )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
bool modal = dialog->isModal();
hb_retl( modal );
}
HB_FUNC( QT_QDIALOG_SETMODAL )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
bool modal = hb_parl(2);
dialog->setModal( modal );
}
/*
bool isSizeGripEnabled () const
void setSizeGripEnabled ( bool )
*/
HB_FUNC( QT_QDIALOG_ISSIZEGRIPENABLED )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
bool enabled = dialog->isSizeGripEnabled();
hb_retl( enabled );
}
HB_FUNC( QT_QDIALOG_SETSIZEGRIPENABLED )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
bool enabled = hb_parl(2);
dialog->setSizeGripEnabled( enabled );
}
/*
void QDialog::accept () [virtual slot]
*/
HB_FUNC( QT_QDIALOG_ACCEPT )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
dialog->accept();
}
/*
void QDialog::done ( int r ) [virtual slot]
*/
HB_FUNC( QT_QDIALOG_DONE )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
int r = hb_parni(2);
dialog->done( r );
}
/*
int QDialog::exec () [slot]
*/
HB_FUNC( QT_QDIALOG_EXEC )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
hb_retni( dialog->exec() );
}
/*
void QDialog::open () [slot]
*/
HB_FUNC( QT_QDIALOG_OPEN )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
dialog->open();
}
/*
void QDialog::reject () [virtual slot]
*/
HB_FUNC( QT_QDIALOG_REJECT )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
dialog->reject();
}
/*
int QDialog::result () const
void QDialog::setResult ( int i )
*/
HB_FUNC( QT_QDIALOG_RESULT )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
int i = dialog->result();
hb_retni( i );
}
HB_FUNC( QT_QDIALOG_SETRESULT )
{
QDialog* dialog = (QDialog*) hb_parptr(1);
int i = hb_parni(2);
dialog->setResult( i );
}
----------------------
File: qdialogclass.prg
----------------------
#include "hbclass.ch"
CLASS QDIALOG INHERIT QWIDGET
METHOD New (pParent, nFlags) CONSTRUCTOR
METHOD IsModal ()
METHOD SetModal (lModal)
METHOD IsSizeGripEnabled ()
METHOD SetSizeGripEnabled (lEnabled)
METHOD Accept ()
METHOD Done (nR)
METHOD Exec ()
METHOD Open ()
METHOD Reject ()
METHOD Result ()
METHOD SetResult (nR)
END CLASS
METHOD New (pParent, nFlags) CLASS QDIALOG
::pointer := qt_qdialog (pParent, nFlags)
Return self
METHOD IsModal () CLASS QDIALOG
Return qt_qdialog_ismodal(::pointer)
METHOD SetModal (lModal) CLASS QDIALOG
qt_qdialog_setmodal(::pointer, lModal)
Return nil
METHOD IsSizeGripEnabled () CLASS QDIALOG
Return qt_qdialog_issizegripenabled(::pointer)
METHOD SetSizeGripEnabled (lEnabled) CLASS QDIALOG
qt_qdialog_setsizegripenabled(::pointer, lEnabled)
Return nil
METHOD Accept () CLASS QDIALOG
qt_qdialog_accept(::pointer)
Return nil
METHOD Done (nR) CLASS QDIALOG
qt_qdialog_done(::pointer, nR)
Return nil
METHOD Exec () CLASS QDIALOG
Return qt_qdialog_exec(::pointer)
METHOD Open () CLASS QDIALOG
qt_qdialog_open(::pointer)
Return nil
METHOD Reject () CLASS QDIALOG
qt_qdialog_reject(::pointer)
Return nil
METHOD Result () CLASS QDIALOG
Return qt_qdialog_result(::pointer)
METHOD SetResult (nR) CLASS QDIALOG
qt_qdialog_setresult(::pointer, nR)
Return nil
I am following the same "Class Inheritance Hierarchy" of the Qt.
The project was started few days ago. If Harbour developers agree, i can
continue in the Harbour contrib dir. Vailton Renato is ready to help
me in the development.
Regards,
Marcos Gambeta
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour