Hi Marcos, All

Here is a bit refinement to the code posted on this list.
It compiles fine but I have not been able to create lib, by xMate.
To compile MinGW supplied with QT is used.

Marcos, can you tune up your wrapper engine to tune with 
following protocol.

/*----------------------------------------------------------------------*/

#include <QtGui\QDialog>
#include "hbapi.h"

/* hbqapi.h */

#define q_par_QWidget( n )          ( ( QWidget* ) hb_parptr( n ) )
#define q_par_QDialog( n )          ( ( QDialog* ) hb_parptr( n ) )
#define q_par_QAbstractButton( n )  ( ( QAbstractButton* ) hb_parptr( n ) )
#define q_par_QString( n )          ( ( QString ) hb_parc( n ) )
#define q_par_WindowFlags( n )      ( ( Qt::WindowFlags ) hb_parni( n ) )

/* /hbqapi.h */

/*----------------------------------------------------------------------*/

/*
QDialog ( QWidget * parent = 0, Qt::WindowFlags f = 0 )
*/
HB_FUNC( QT_QDIALOG )
{
   hb_retptr( new QDialog( q_par_QWidget( 1 ), q_par_WindowFlags( 2 ) ) );
}

/*
bool isModal () const
void setModal ( bool modal )
*/
HB_FUNC( QT_QDIALOG_ISMODAL )
{
   hb_retl( q_par_QDialog( 1 )->isModal() );
}

HB_FUNC( QT_QDIALOG_SETMODAL )
{
   q_par_QDialog( 1 )->setModal( hb_parl( 2 ) );
}

/*
bool isSizeGripEnabled () const
void setSizeGripEnabled ( bool )
*/
HB_FUNC( QT_QDIALOG_ISSIZEGRIPENABLED )
{
   hb_retl( q_par_QDialog( 1 )->isSizeGripEnabled() );
}

HB_FUNC( QT_QDIALOG_SETSIZEGRIPENABLED )
{
   q_par_QDialog( 1 )->setSizeGripEnabled( hb_parl( 2 ) );
}

/*
void QDialog::accept ()   [virtual slot]
*/
HB_FUNC( QT_QDIALOG_ACCEPT )
{
   q_par_QDialog( 1 )->accept();
}

/*
void QDialog::done ( int r )   [virtual slot]
*/
HB_FUNC( QT_QDIALOG_DONE )
{
   q_par_QDialog( 1 )->done( hb_parni( 2 ) );
}

/*
int QDialog::exec ()   [slot]
*/
HB_FUNC( QT_QDIALOG_EXEC )
{
   hb_retni( q_par_QDialog( 1 )->exec() );
}

/*
void QDialog::open ()   [slot]
*/
HB_FUNC( QT_QDIALOG_OPEN )
{
   q_par_QDialog( 1 )->open();
}

/*
void QDialog::reject ()   [virtual slot]
*/
HB_FUNC( QT_QDIALOG_REJECT )
{
   q_par_QDialog( 1 )->reject();
}

/*
int QDialog::result () const
void QDialog::setResult ( int i )
*/
HB_FUNC( QT_QDIALOG_RESULT )
{
   hb_retni( q_par_QDialog( 1 )->result() );
}

HB_FUNC( QT_QDIALOG_SETRESULT )
{
   q_par_QDialog( 1 )->setResult( hb_parni( 2 ) );
}


/*----------------------------------------------------------------------*/

#include <QtGui\QAbstractButton>


/*
bool autoExclusive () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_AUTOEXCLUSIVE )
{
   hb_retl( q_par_QAbstractButton( 1 )->autoExclusive() );
}

/*
bool autoRepeat () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_AUTOREPEAT )
{
   hb_retl( q_par_QAbstractButton( 1 )->autoRepeat() );
}

/*
int autoRepeatDelay () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_AUTOREPEATDELAY )
{
   hb_retni( q_par_QAbstractButton( 1 )->autoRepeatDelay() );
}

/*
int autoRepeatInterval () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_AUTOREPEATINTERVAL )
{
   hb_retni( q_par_QAbstractButton( 1 )->autoRepeatInterval() );
}

/*
QButtonGroup * group () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_GROUP )
{
   hb_retptr( ( QButtonGroup* ) q_par_QAbstractButton( 1 )->group() );
}

/*
bool isCheckable () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_ISCHECKABLE )
{
   hb_retl( q_par_QAbstractButton( 1 )->isCheckable() );
}

/*
bool isChecked () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_ISCHECKED )
{
   hb_retl( q_par_QAbstractButton( 1 )->isChecked() );
}

/*
bool isDown () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_ISDOWN )
{
   hb_retl( q_par_QAbstractButton( 1 )->isDown() );
}

/*
void setAutoExclusive ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETAUTOEXCLUSIVE )
{
   q_par_QAbstractButton( 1 )->setAutoExclusive( hb_parl( 2 ) );
}

/*
void setAutoRepeat ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETAUTOREPEAT )
{
   q_par_QAbstractButton( 1 )->setAutoRepeat( hb_parl( 2 ) );
}

/*
void setAutoRepeatDelay ( int )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETAUTOREPEATDELAY )
{
   q_par_QAbstractButton( 1 )->setAutoRepeatDelay( hb_parni( 2 ) );
}

/*
void setAutoRepeatInterval ( int )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETAUTOREPEATINTERVAL )
{
   q_par_QAbstractButton( 1 )->setAutoRepeatInterval( hb_parni( 2 ) );
}

/*
void setCheckable ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETCHECKABLE )
{
   q_par_QAbstractButton( 1 )->setCheckable( hb_parl( 2 ) );
}

/*
void setDown ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETDOWN )
{
   q_par_QAbstractButton( 1 )->setDown( hb_parl( 2 ) );
}

/*
void setIcon ( const QIcon & icon )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETICON )
{
   q_par_QAbstractButton( 1 )->setIcon( QIcon( q_par_QString( 2 ) ) );
}

/*
void setText ( const QString & text )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETTEXT )
{
   q_par_QAbstractButton( 1 )->setText( q_par_QString( 2 ) );
}

/*
QString text () const
*/
HB_FUNC( QT_QABSTRACTBUTTON_TEXT )
{
   QString      str1   = q_par_QAbstractButton( 1 )->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 )
{
   q_par_QAbstractButton( 1 )->animateClick( hb_parni( 2 ) );
}

/*
void click ()
*/
HB_FUNC( QT_QABSTRACTBUTTON_CLICK )
{
   q_par_QAbstractButton( 1 )->click();
}

/*
void setChecked ( bool )
*/
HB_FUNC( QT_QABSTRACTBUTTON_SETCHECKED )
{
   q_par_QAbstractButton( 1 )->setChecked( hb_parl( 2 ) );
}

/*
void toggle ()
*/
HB_FUNC( QT_QABSTRACTBUTTON_TOGGLE )
{
   q_par_QAbstractButton( 1 )->toggle();
}

/*----------------------------------------------------------------------*/

Regards
Pritpal Bedi

-- 
View this message in context: 
http://www.nabble.com/QT-and-some-...-tp22580862p22580862.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to