2009-06-13 14:19 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* harbour/contrib/hbqt/generator/hbqtgen.prg
  * harbour/contrib/hbqt/generator/qt45.qtp

  * harbour/contrib/hbqt/Makefile_gen
  * harbour/contrib/hbqt/hbqt.ch
  * harbour/contrib/hbqt/hbqt.h
  * harbour/contrib/hbqt/hbqt_slots.h

  * harbour/contrib/hbqt/hbqt_qcolor.cpp
  + harbour/contrib/hbqt/hbqt_qkeysequence.cpp
  * harbour/contrib/hbqt/hbqt_qpalette.cpp
  * harbour/contrib/hbqt/hbqt_slots.cpp
  * harbour/contrib/hbqt/moc_slots.cpp

  * harbour/contrib/hbqt/TQColor.prg
  + harbour/contrib/hbqt/TQKeySequence.prg
  * harbour/contrib/hbqt/TQPalette.prg

  * harbour/contrib/hbqt/qth/QColor.qth
  + harbour/contrib/hbqt/qth/QKeySequence.qth
  * harbour/contrib/hbqt/qth/QPalette.qth
    + Added one more class and implemented constructors for others.
    + Added more event handellers used in xbp* classes.
This commit is contained in:
Pritpal Bedi
2009-06-13 21:27:13 +00:00
parent dd6e92c7d8
commit 122ceae207
18 changed files with 886 additions and 274 deletions

View File

@@ -17,6 +17,31 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-06-13 14:19 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/hbqt/generator/hbqtgen.prg
* harbour/contrib/hbqt/generator/qt45.qtp
* harbour/contrib/hbqt/Makefile_gen
* harbour/contrib/hbqt/hbqt.ch
* harbour/contrib/hbqt/hbqt.h
* harbour/contrib/hbqt/hbqt_slots.h
* harbour/contrib/hbqt/hbqt_qcolor.cpp
+ harbour/contrib/hbqt/hbqt_qkeysequence.cpp
* harbour/contrib/hbqt/hbqt_qpalette.cpp
* harbour/contrib/hbqt/hbqt_slots.cpp
* harbour/contrib/hbqt/moc_slots.cpp
* harbour/contrib/hbqt/TQColor.prg
+ harbour/contrib/hbqt/TQKeySequence.prg
* harbour/contrib/hbqt/TQPalette.prg
* harbour/contrib/hbqt/qth/QColor.qth
+ harbour/contrib/hbqt/qth/QKeySequence.qth
* harbour/contrib/hbqt/qth/QPalette.qth
+ Added one more class and implemented constructors for others.
+ Added more event handellers used in xbp* classes.
2009-06-13 20:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
- contrib/hbblat/syntax.txt
+ contrib/hbblat/readme.txt

View File

@@ -63,6 +63,7 @@ CPP_SOURCES=\
hbqt_qinputdialog.cpp \
hbqt_qinputevent.cpp \
hbqt_qkeyevent.cpp \
hbqt_qkeysequence.cpp \
hbqt_qlabel.cpp \
hbqt_qlayout.cpp \
hbqt_qlayoutitem.cpp \
@@ -267,6 +268,7 @@ PRG_SOURCES=\
TQInputDialog.prg \
TQInputEvent.prg \
TQKeyEvent.prg \
TQKeySequence.prg \
TQLabel.prg \
TQLayout.prg \
TQLayoutItem.prg \

View File

@@ -107,10 +107,10 @@ CREATE CLASS QColor
METHOD setNamedColor( cName ) INLINE Qt_QColor_setNamedColor( ::pPtr, cName )
METHOD setRed( nRed ) INLINE Qt_QColor_setRed( ::pPtr, nRed )
METHOD setRedF( nRed ) INLINE Qt_QColor_setRedF( ::pPtr, nRed )
METHOD setRgb( nR, nG, nB, nA ) INLINE Qt_QColor_setRgb( ::pPtr, nR, nG, nB, nA )
METHOD setRgb_1( nRgb ) INLINE Qt_QColor_setRgb_1( ::pPtr, nRgb )
METHOD setRgbF( nR, nG, nB, nA ) INLINE Qt_QColor_setRgbF( ::pPtr, nR, nG, nB, nA )
METHOD setRgb( nRgb ) INLINE Qt_QColor_setRgb( ::pPtr, nRgb )
METHOD setRgb_1( nR, nG, nB, nA ) INLINE Qt_QColor_setRgb_1( ::pPtr, nR, nG, nB, nA )
METHOD setRgba( nRgba ) INLINE Qt_QColor_setRgba( ::pPtr, nRgba )
METHOD setRgbF( nR, nG, nB, nA ) INLINE Qt_QColor_setRgbF( ::pPtr, nR, nG, nB, nA )
METHOD spec() INLINE Qt_QColor_spec( ::pPtr )
METHOD toCmyk() INLINE Qt_QColor_toCmyk( ::pPtr )
METHOD toHsv() INLINE Qt_QColor_toHsv( ::pPtr )

View File

@@ -0,0 +1,84 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* QT wrapper main header
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/*----------------------------------------------------------------------*/
#include "hbclass.ch"
CREATE CLASS QKeySequence
VAR pParent
VAR pPtr
METHOD New()
METHOD count() INLINE Qt_QKeySequence_count( ::pPtr )
METHOD isEmpty() INLINE Qt_QKeySequence_isEmpty( ::pPtr )
METHOD matches( pSeq ) INLINE Qt_QKeySequence_matches( ::pPtr, pSeq )
METHOD toString( nFormat ) INLINE Qt_QKeySequence_toString( ::pPtr, nFormat )
ENDCLASS
/*----------------------------------------------------------------------*/
METHOD New( pParent ) CLASS QKeySequence
::pParent := pParent
::pPtr := Qt_QKeySequence( pParent )
RETURN Self
/*----------------------------------------------------------------------*/

View File

@@ -88,8 +88,8 @@ CREATE CLASS QPalette
METHOD resolve( pOther ) INLINE Qt_QPalette_resolve( ::pPtr, pOther )
METHOD setBrush( nRole, pBrush ) INLINE Qt_QPalette_setBrush( ::pPtr, nRole, pBrush )
METHOD setBrush_1( nGroup, nRole, pBrush ) INLINE Qt_QPalette_setBrush_1( ::pPtr, nGroup, nRole, pBrush )
METHOD setColor( nGroup, nRole, pColor ) INLINE Qt_QPalette_setColor( ::pPtr, nGroup, nRole, pColor )
METHOD setColor_1( nRole, pColor ) INLINE Qt_QPalette_setColor_1( ::pPtr, nRole, pColor )
METHOD setColor( nRole, pColor ) INLINE Qt_QPalette_setColor( ::pPtr, nRole, pColor )
METHOD setColor_1( nGroup, nRole, pColor ) INLINE Qt_QPalette_setColor_1( ::pPtr, nGroup, nRole, pColor )
METHOD setColorGroup( nCg, pWindowText, pButton, pLight, pDark, pMid, pText, pBright_text, pBase, pWindow ) INLINE Qt_QPalette_setColorGroup( ::pPtr, nCg, pWindowText, pButton, pLight, pDark, pMid, pText, pBright_text, pBase, pWindow )
METHOD setCurrentColorGroup( nCg ) INLINE Qt_QPalette_setCurrentColorGroup( ::pPtr, nCg )
METHOD shadow() INLINE Qt_QPalette_shadow( ::pPtr )

View File

@@ -1571,6 +1571,7 @@ STATIC FUNCTION Build_HBQT_H( cPathOut )
aadd( txt_, "#define hbqt_par_QFileSystemModel( n ) ( ( QFileSystemModel* ) hb_parptr( n ) ) " )
aadd( txt_, "#define hbqt_par_QKeyEvent( n ) ( ( QKeyEvent* ) hb_parptr( n ) ) " )
aadd( txt_, "#define hbqt_par_QMouseEvent( n ) ( ( QMouseEvent* ) hb_parptr( n ) ) " )
aadd( txt_, "#define hbqt_par_QKeySequence( n ) ( ( QKeySequence* ) hb_parptr( n ) ) " )
aadd( txt_, " " )
aadd( txt_, "#define hbqt_par_QString( n ) ( ( QString ) hb_parc( n ) ) " )
aadd( txt_, "#define hbqt_par_QRgb( n ) ( hb_parnint( n ) ) " )
@@ -1843,6 +1844,7 @@ STATIC FUNCTION Build_HBQT_SLOTS_H( cPathOut )
aadd( txt_, ' Slots( QObject *parent = 0 ); ' )
aadd( txt_, ' ~Slots(); ' )
aadd( txt_, ' QList<QWidget*> list1; ' )
aadd( txt_, ' QList<QAction*> list5; ' )
aadd( txt_, ' QList<QString> list2; ' )
aadd( txt_, ' QList<PHB_ITEM> list3; ' )
aadd( txt_, ' QList<bool> list4; ' )
@@ -1861,9 +1863,10 @@ STATIC FUNCTION Build_HBQT_SLOTS_H( cPathOut )
aadd( txt_, ' void returnPressed(); ' )
aadd( txt_, ' void clicked_model( const QModelIndex & index ); ' )
aadd( txt_, ' void viewportEntered(); ' )
aadd( txt_, ' bool event( QEvent *event ); ' )
aadd( txt_, ' bool event( QEvent * event ); ' )
aadd( txt_, ' void keyPressEvent( QKeyEvent * event ); ' )
aadd( txt_, ' void mouseMoveEvent( QMouseEvent * event ); ' )
aadd( txt_, ' void hovered( QAction * action ); ' )
aadd( txt_, ' ' )
aadd( txt_, '#if 0 ' )
aadd( txt_, ' void accessibleEvent(); ' )
@@ -1945,7 +1948,6 @@ STATIC FUNCTION Build_HBQT_SLOTS_H( cPathOut )
aadd( txt_, '#endif ' )
aadd( txt_, ' ' )
RETURN CreateTarget( cFile, txt_ )
/*----------------------------------------------------------------------*/
@@ -1956,6 +1958,7 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
BuildHeader( @txt_, 2 )
aadd( txt_, ' ' )
aadd( txt_, '#include "hbapi.h" ' )
aadd( txt_, '#include "hbvm.h" ' )
aadd( txt_, '#include "hbapiitm.h" ' )
@@ -1970,6 +1973,7 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, '#include <QString> ' )
aadd( txt_, '#include <QList> ' )
aadd( txt_, '#include <QKeyEvent> ' )
aadd( txt_, '#include <QAction> ' )
aadd( txt_, ' ' )
aadd( txt_, '#define HBQT_EVT_CLICKED 1 ' )
aadd( txt_, '#define HBQT_EVT_TRIGGERED 2 ' )
@@ -1979,6 +1983,7 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, '#define HBQT_EVT_PRESSED 6 ' )
aadd( txt_, '#define HBQT_EVT_RELEASED 7 ' )
aadd( txt_, ' ' )
aadd( txt_, '#include <windows.h> ' )
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
aadd( txt_, ' ' )
aadd( txt_, 'static Slots *s = NULL; ' )
@@ -1994,7 +1999,26 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' if( ( ( QString ) s->list2.at( i ) == event ) && ( ( bool ) s->list4.at( i ) == true ) ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget ); ' )
aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 1, pWidget ); ' )
aadd( txt_, ' hb_itemRelease( pWidget ); ' )
aadd( txt_, ' } ' )
aadd( txt_, ' } ' )
aadd( txt_, ' } ' )
aadd( txt_, ' if( pItem != NULL ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' hb_itemRelease( pItem ); ' )
aadd( txt_, ' } ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'static void SlotsExecAction( QAction* widget, QString event, PHB_ITEM pItem ) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' for( int i = 0; i < s->list1.size(); ++i ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' if( ( QAction* ) s->list5.at( i ) == widget ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' if( ( ( QString ) s->list2.at( i ) == event ) && ( ( bool ) s->list4.at( i ) == true ) ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QAction* ) widget ); ' )
aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 1, pWidget ); ' )
aadd( txt_, ' hb_itemRelease( pWidget ); ' )
aadd( txt_, ' } ' )
@@ -2016,7 +2040,6 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' { ' )
aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget ); ' )
aadd( txt_, ' PHB_ITEM pState = hb_itemPutNI( NULL, iValue ); ' )
aadd( txt_, ' ' )
aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 2, pWidget, pState ); ' )
aadd( txt_, ' hb_itemRelease( pWidget ); ' )
aadd( txt_, ' hb_itemRelease( pState ); ' )
@@ -2096,6 +2119,25 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' } ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'void Slots::hovered( QAction * action ) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' QObject *widget = qobject_cast<QObject *>( sender() ); ' )
aadd( txt_, ' for( int i = 0; i < list1.size(); ++i ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' if( ( QObject* ) list1.at( i ) == ( QObject* ) widget ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' if( ( ( QString ) list2.at( i ) == ( QString ) "hovered(action)" ) && ( ( bool ) list4.at( i ) == true ) ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget ); ' )
aadd( txt_, ' PHB_ITEM pEvent = hb_itemPutPtr( NULL, action ); ' )
aadd( txt_, ' hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pEvent ); ' )
aadd( txt_, ' hb_itemRelease( pWidget ); ' )
aadd( txt_, ' hb_itemRelease( pEvent ); ' )
aadd( txt_, ' } ' )
aadd( txt_, ' } ' )
aadd( txt_, ' } ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'void Slots::clicked() ' )
aadd( txt_, '{ ' )
aadd( txt_, ' QWidget *widget = qobject_cast<QWidget *>( sender() ); ' )
@@ -2128,8 +2170,12 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' ' )
aadd( txt_, 'void Slots::hovered() ' )
aadd( txt_, '{ ' )
aadd( txt_, ' QWidget *widget = qobject_cast<QWidget *>( sender() ); ' )
aadd( txt_, ' SlotsExec( widget, ( QString ) "hovered()", NULL ); ' )
aadd( txt_, ' //QWidget *widget = qobject_cast<QWidget *>( sender() ); ' )
aadd( txt_, ' QAction *widget = qobject_cast<QAction *>( sender() ); ' )
aadd( txt_, ' if( widget ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' SlotsExecAction( widget, ( QString ) "hovered()", NULL ); ' )
aadd( txt_, ' } ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'void Slots::triggered() ' )
@@ -2202,6 +2248,8 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' } ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, ' ' )
aadd( txt_, ' ' )
aadd( txt_, '/* ' )
aadd( txt_, ' * harbour function to connect signals with slots ' )
aadd( txt_, ' */ ' )
@@ -2211,6 +2259,7 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' QString signal = hb_parc( 2 ); /* get signal */ ' )
aadd( txt_, ' PHB_ITEM codeblock = hb_itemNew( hb_param( 3, HB_IT_BLOCK | HB_IT_BYREF ) ); /* get codeblock */ ' )
aadd( txt_, ' bool ret = false; /* return value */ ' )
aadd( txt_, ' bool bAct = false; ' )
aadd( txt_, ' ' )
aadd( txt_, ' /* create object s, if not created yet */ ' )
aadd( txt_, ' if( s == NULL ) ' )
@@ -2239,6 +2288,7 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' if( signal == ( QString ) "hovered()" ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' ret = widget->connect( widget, SIGNAL( hovered() ) , s, SLOT( hovered() ) , Qt::AutoConnection ); ' )
aadd( txt_, ' bAct = true; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' if( signal == ( QString ) "viewportEntered()" ) ' )
aadd( txt_, ' { ' )
@@ -2301,6 +2351,11 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' ret = widget->connect( widget, SIGNAL( sg_mouseMoveEvent( QMouseEvent * ) ), ' )
aadd( txt_, ' s, SLOT( mouseMoveEvent( QMouseEvent * ) ), Qt::AutoConnection ); ' )
aadd( txt_, ' } ' )
aadd( txt_, ' if( signal == ( QString ) "hovered(action)" ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' ret = widget->connect( widget, SIGNAL( hovered( QAction * ) ), ' )
aadd( txt_, ' s, SLOT( hovered( QAction * ) ), Qt::AutoConnection ); ' )
aadd( txt_, ' } ' )
aadd( txt_, ' ' )
aadd( txt_, ' /* return connect result */ ' )
aadd( txt_, ' hb_retl( ret ); ' )
@@ -2310,7 +2365,16 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' */ ' )
aadd( txt_, ' if( ret == true ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' s->list1 << widget; ' )
aadd( txt_, ' if( bAct ) ' )
aadd( txt_, ' { ' )
aadd( txt_, ' s->list5 << ( QAction* ) hb_parptr( 1 ); ' )
aadd( txt_, ' s->list1 << NULL; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' else ' )
aadd( txt_, ' { ' )
aadd( txt_, ' s->list5 << NULL; ' )
aadd( txt_, ' s->list1 << widget; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' s->list2 << signal; ' )
aadd( txt_, ' s->list3 << codeblock; ' )
aadd( txt_, ' s->list4 << true; ' )
@@ -2394,6 +2458,7 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, ' setAttribute( Qt::WA_StaticContents ); ' )
aadd( txt_, ' setAttribute( Qt::WA_PaintOnScreen ); ' )
aadd( txt_, ' setAttribute( Qt::WA_DeleteOnClose ); ' )
aadd( txt_, ' setAttribute( Qt::WA_WindowPropagation ); ' )
aadd( txt_, ' ' )
aadd( txt_, ' setFocusPolicy( Qt::StrongFocus ); ' )
aadd( txt_, ' setMouseTracking( true ); ' )
@@ -2426,8 +2491,6 @@ STATIC FUNCTION Build_HBQT_SLOTS_CPP( cPathOut )
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
aadd( txt_, '#endif ' )
aadd( txt_, ' ' )
aadd( txt_, ' ' )
aadd( txt_, ' ' )
RETURN CreateTarget( cFile, txt_ )
@@ -2439,233 +2502,236 @@ STATIC FUNCTION Build_MOC_SLOTS_CPP( cPathOut )
/* .......................................................................................................' */
aadd( txt_, '/**************************************************************************** ' )
aadd( txt_, '** Meta object code from reading C++ file hbqt_slots.h ' )
aadd( txt_, '** ' )
aadd( txt_, '** Created: Thu Jun 11 00:20:48 2009 ' )
aadd( txt_, '** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0) ' )
aadd( txt_, '** ' )
aadd( txt_, '** WARNING! All changes made in this file will be lost! ' )
aadd( txt_, '*****************************************************************************/ ' )
aadd( txt_, ' ' )
aadd( txt_, '#include "hbqt_slots.h" ' )
aadd( txt_, '#if !defined(Q_MOC_OUTPUT_REVISION) ' )
aadd( txt_, '#error "The header file hbqt_slots.h doesnt include <QObject>." ' )
aadd( txt_, '#elif Q_MOC_OUTPUT_REVISION != 61 ' )
aadd( txt_, '#error "This file was generated using the moc from 4.5.0. It" ' )
aadd( txt_, '#error "cannot be used with the include files from this version of Qt." ' )
aadd( txt_, '#error "(The moc has changed too much.)" ' )
aadd( txt_, '#endif ' )
aadd( txt_, ' ' )
aadd( txt_, 'QT_BEGIN_MOC_NAMESPACE ' )
aadd( txt_, 'static const uint qt_meta_data_Slots[] = { ' )
aadd( txt_, ' ' )
aadd( txt_, ' // content: ' )
aadd( txt_, ' 2, // revision ' )
aadd( txt_, ' 0, // classname ' )
aadd( txt_, ' 0, 0, // classinfo ' )
aadd( txt_, ' 16, 12, // methods ' )
aadd( txt_, ' 0, 0, // properties ' )
aadd( txt_, ' 0, 0, // enums/sets ' )
aadd( txt_, ' 0, 0, // constructors ' )
aadd( txt_, ' ' )
aadd( txt_, ' // slots: signature, parameters, type, tag, flags ' )
aadd( txt_, ' 7, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 17, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 37, 29, 6, 6, 0x0a, ' )
aadd( txt_, ' 53, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 69, 63, 6, 6, 0x0a, ' )
aadd( txt_, ' 87, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 97, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 114, 108, 6, 6, 0x0a, ' )
aadd( txt_, ' 129, 108, 6, 6, 0x0a, ' )
aadd( txt_, ' 154, 108, 6, 6, 0x0a, ' )
aadd( txt_, ' 171, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 187, 108, 6, 6, 0x0a, ' )
aadd( txt_, ' 214, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 243, 237, 232, 6, 0x0a, ' )
aadd( txt_, ' 258, 237, 6, 6, 0x0a, ' )
aadd( txt_, ' 284, 237, 6, 6, 0x0a, ' )
aadd( txt_, ' ' )
aadd( txt_, ' 0 // eod ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'static const char qt_meta_stringdata_Slots[] = { ' )
aadd( txt_, ' "Slots\0\0clicked()\0triggered()\0checked\0" ' )
aadd( txt_, ' "triggered(bool)\0hovered()\0state\0" ' )
aadd( txt_, ' "stateChanged(int)\0pressed()\0released()\0" ' )
aadd( txt_, ' "index\0activated(int)\0currentIndexChanged(int)\0" ' )
aadd( txt_, ' "highlighted(int)\0returnPressed()\0" ' )
aadd( txt_, ' "clicked_model(QModelIndex)\0viewportEntered()\0" ' )
aadd( txt_, ' "bool\0event\0event(QEvent*)\0" ' )
aadd( txt_, ' "keyPressEvent(QKeyEvent*)\0" ' )
aadd( txt_, ' "mouseMoveEvent(QMouseEvent*)\0" ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject Slots::staticMetaObject = { ' )
aadd( txt_, ' { &QObject::staticMetaObject, qt_meta_stringdata_Slots, ' )
aadd( txt_, ' qt_meta_data_Slots, 0 } ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject *Slots::metaObject() const ' )
aadd( txt_, '{ ' )
aadd( txt_, ' return &staticMetaObject; ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'void *Slots::qt_metacast(const char *_clname) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' if (!_clname) return 0; ' )
aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_Slots)) ' )
aadd( txt_, ' return static_cast<void*>(const_cast< Slots*>(this)); ' )
aadd( txt_, ' return QObject::qt_metacast(_clname); ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'int Slots::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' _id = QObject::qt_metacall(_c, _id, _a); ' )
aadd( txt_, ' if (_id < 0) ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, ' if (_c == QMetaObject::InvokeMetaMethod) { ' )
aadd( txt_, ' switch (_id) { ' )
aadd( txt_, ' case 0: clicked(); break; ' )
aadd( txt_, ' case 1: triggered(); break; ' )
aadd( txt_, ' case 2: triggered((*reinterpret_cast< bool(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 3: hovered(); break; ' )
aadd( txt_, ' case 4: stateChanged((*reinterpret_cast< int(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 5: pressed(); break; ' )
aadd( txt_, ' case 6: released(); break; ' )
aadd( txt_, ' case 7: activated((*reinterpret_cast< int(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 8: currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 9: highlighted((*reinterpret_cast< int(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 10: returnPressed(); break; ' )
aadd( txt_, ' case 11: clicked_model((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 12: viewportEntered(); break; ' )
aadd( txt_, ' case 13: { bool _r = event((*reinterpret_cast< QEvent*(*)>(_a[1]))); ' )
aadd( txt_, ' if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; ' )
aadd( txt_, ' case 14: keyPressEvent((*reinterpret_cast< QKeyEvent*(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 15: mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break; ' )
aadd( txt_, ' default: ; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' _id -= 16; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, '} ' )
aadd( txt_, 'static const uint qt_meta_data_MyDrawingArea[] = { ' )
aadd( txt_, ' ' )
aadd( txt_, ' // content: ' )
aadd( txt_, ' 2, // revision ' )
aadd( txt_, ' 0, // classname ' )
aadd( txt_, ' 0, 0, // classinfo ' )
aadd( txt_, ' 2, 12, // methods ' )
aadd( txt_, ' 0, 0, // properties ' )
aadd( txt_, ' 0, 0, // enums/sets ' )
aadd( txt_, ' 0, 0, // constructors ' )
aadd( txt_, ' ' )
aadd( txt_, ' // signals: signature, parameters, type, tag, flags ' )
aadd( txt_, ' 21, 15, 14, 14, 0x05, ' )
aadd( txt_, ' 53, 15, 14, 14, 0x05, ' )
aadd( txt_, ' ' )
aadd( txt_, ' 0 // eod ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'static const char qt_meta_stringdata_MyDrawingArea[] = { ' )
aadd( txt_, ' "MyDrawingArea\0\0event\0" ' )
aadd( txt_, ' "sg_mouseMoveEvent(QMouseEvent*)\0" ' )
aadd( txt_, ' "sg_keyPressEvent(QKeyEvent*)\0" ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject MyDrawingArea::staticMetaObject = { ' )
aadd( txt_, ' { &QWidget::staticMetaObject, qt_meta_stringdata_MyDrawingArea, ' )
aadd( txt_, ' qt_meta_data_MyDrawingArea, 0 } ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject *MyDrawingArea::metaObject() const ' )
aadd( txt_, '{ ' )
aadd( txt_, ' return &staticMetaObject; ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'void *MyDrawingArea::qt_metacast(const char *_clname) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' if (!_clname) return 0; ' )
aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_MyDrawingArea)) ' )
aadd( txt_, ' return static_cast<void*>(const_cast< MyDrawingArea*>(this)); ' )
aadd( txt_, ' return QWidget::qt_metacast(_clname); ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'int MyDrawingArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' _id = QWidget::qt_metacall(_c, _id, _a); ' )
aadd( txt_, ' if (_id < 0) ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, ' if (_c == QMetaObject::InvokeMetaMethod) { ' )
aadd( txt_, ' switch (_id) { ' )
aadd( txt_, ' case 0: sg_mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 1: sg_keyPressEvent((*reinterpret_cast< QKeyEvent*(*)>(_a[1]))); break; ' )
aadd( txt_, ' default: ; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' _id -= 2; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, '// SIGNAL 0 ' )
aadd( txt_, 'void MyDrawingArea::sg_mouseMoveEvent(QMouseEvent * _t1) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; ' )
aadd( txt_, ' QMetaObject::activate(this, &staticMetaObject, 0, _a); ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, '// SIGNAL 1 ' )
aadd( txt_, 'void MyDrawingArea::sg_keyPressEvent(QKeyEvent * _t1) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; ' )
aadd( txt_, ' QMetaObject::activate(this, &staticMetaObject, 1, _a); ' )
aadd( txt_, '} ' )
aadd( txt_, 'static const uint qt_meta_data_MyMainWindow[] = { ' )
aadd( txt_, ' ' )
aadd( txt_, ' // content: ' )
aadd( txt_, ' 2, // revision ' )
aadd( txt_, ' 0, // classname ' )
aadd( txt_, ' 0, 0, // classinfo ' )
aadd( txt_, ' 0, 0, // methods ' )
aadd( txt_, ' 0, 0, // properties ' )
aadd( txt_, ' 0, 0, // enums/sets ' )
aadd( txt_, ' 0, 0, // constructors ' )
aadd( txt_, ' ' )
aadd( txt_, ' 0 // eod ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'static const char qt_meta_stringdata_MyMainWindow[] = { ' )
aadd( txt_, ' "MyMainWindow\0" ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject MyMainWindow::staticMetaObject = { ' )
aadd( txt_, ' { &QMainWindow::staticMetaObject, qt_meta_stringdata_MyMainWindow, ' )
aadd( txt_, ' qt_meta_data_MyMainWindow, 0 } ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject *MyMainWindow::metaObject() const ' )
aadd( txt_, '{ ' )
aadd( txt_, ' return &staticMetaObject; ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'void *MyMainWindow::qt_metacast(const char *_clname) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' if (!_clname) return 0; ' )
aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_MyMainWindow)) ' )
aadd( txt_, ' return static_cast<void*>(const_cast< MyMainWindow*>(this)); ' )
aadd( txt_, ' return QMainWindow::qt_metacast(_clname); ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'int MyMainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' _id = QMainWindow::qt_metacall(_c, _id, _a); ' )
aadd( txt_, ' if (_id < 0) ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, '} ' )
aadd( txt_, 'QT_END_MOC_NAMESPACE ' )
aadd( txt_, ' ' )
aadd( txt_, '/**************************************************************************** ' )
aadd( txt_, '** Meta object code from reading C++ file hbqt_slots.h ' )
aadd( txt_, '** ' )
aadd( txt_, '** Created: Sat Jun 13 14:02:48 2009 ' )
aadd( txt_, '** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0) ' )
aadd( txt_, '** ' )
aadd( txt_, '** WARNING! All changes made in this file will be lost! ' )
aadd( txt_, '*****************************************************************************/ ' )
aadd( txt_, ' ' )
aadd( txt_, '#include "hbqt_slots.h" ' )
aadd( txt_, '#if !defined(Q_MOC_OUTPUT_REVISION) ' )
aadd( txt_, '#error "The header file hbqt_slots.h doesnt include <QObject>." ' )
aadd( txt_, '#elif Q_MOC_OUTPUT_REVISION != 61 ' )
aadd( txt_, '#error "This file was generated using the moc from 4.5.0. It" ' )
aadd( txt_, '#error "cannot be used with the include files from this version of Qt." ' )
aadd( txt_, '#error "(The moc has changed too much.)" ' )
aadd( txt_, '#endif ' )
aadd( txt_, ' ' )
aadd( txt_, 'QT_BEGIN_MOC_NAMESPACE ' )
aadd( txt_, 'static const uint qt_meta_data_Slots[] = { ' )
aadd( txt_, ' ' )
aadd( txt_, ' // content: ' )
aadd( txt_, ' 2, // revision ' )
aadd( txt_, ' 0, // classname ' )
aadd( txt_, ' 0, 0, // classinfo ' )
aadd( txt_, ' 17, 12, // methods ' )
aadd( txt_, ' 0, 0, // properties ' )
aadd( txt_, ' 0, 0, // enums/sets ' )
aadd( txt_, ' 0, 0, // constructors ' )
aadd( txt_, ' ' )
aadd( txt_, ' // slots: signature, parameters, type, tag, flags ' )
aadd( txt_, ' 7, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 17, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 37, 29, 6, 6, 0x0a, ' )
aadd( txt_, ' 53, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 69, 63, 6, 6, 0x0a, ' )
aadd( txt_, ' 87, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 97, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 114, 108, 6, 6, 0x0a, ' )
aadd( txt_, ' 129, 108, 6, 6, 0x0a, ' )
aadd( txt_, ' 154, 108, 6, 6, 0x0a, ' )
aadd( txt_, ' 171, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 187, 108, 6, 6, 0x0a, ' )
aadd( txt_, ' 214, 6, 6, 6, 0x0a, ' )
aadd( txt_, ' 243, 237, 232, 6, 0x0a, ' )
aadd( txt_, ' 258, 237, 6, 6, 0x0a, ' )
aadd( txt_, ' 284, 237, 6, 6, 0x0a, ' )
aadd( txt_, ' 320, 313, 6, 6, 0x0a, ' )
aadd( txt_, ' ' )
aadd( txt_, ' 0 // eod ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'static const char qt_meta_stringdata_Slots[] = { ' )
aadd( txt_, ' "Slots\0\0clicked()\0triggered()\0checked\0" ' )
aadd( txt_, ' "triggered(bool)\0hovered()\0state\0" ' )
aadd( txt_, ' "stateChanged(int)\0pressed()\0released()\0" ' )
aadd( txt_, ' "index\0activated(int)\0currentIndexChanged(int)\0" ' )
aadd( txt_, ' "highlighted(int)\0returnPressed()\0" ' )
aadd( txt_, ' "clicked_model(QModelIndex)\0viewportEntered()\0" ' )
aadd( txt_, ' "bool\0event\0event(QEvent*)\0" ' )
aadd( txt_, ' "keyPressEvent(QKeyEvent*)\0" ' )
aadd( txt_, ' "mouseMoveEvent(QMouseEvent*)\0action\0" ' )
aadd( txt_, ' "hovered(QAction*)\0" ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject Slots::staticMetaObject = { ' )
aadd( txt_, ' { &QObject::staticMetaObject, qt_meta_stringdata_Slots, ' )
aadd( txt_, ' qt_meta_data_Slots, 0 } ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject *Slots::metaObject() const ' )
aadd( txt_, '{ ' )
aadd( txt_, ' return &staticMetaObject; ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'void *Slots::qt_metacast(const char *_clname) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' if (!_clname) return 0; ' )
aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_Slots)) ' )
aadd( txt_, ' return static_cast<void*>(const_cast< Slots*>(this)); ' )
aadd( txt_, ' return QObject::qt_metacast(_clname); ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'int Slots::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' _id = QObject::qt_metacall(_c, _id, _a); ' )
aadd( txt_, ' if (_id < 0) ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, ' if (_c == QMetaObject::InvokeMetaMethod) { ' )
aadd( txt_, ' switch (_id) { ' )
aadd( txt_, ' case 0: clicked(); break; ' )
aadd( txt_, ' case 1: triggered(); break; ' )
aadd( txt_, ' case 2: triggered((*reinterpret_cast< bool(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 3: hovered(); break; ' )
aadd( txt_, ' case 4: stateChanged((*reinterpret_cast< int(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 5: pressed(); break; ' )
aadd( txt_, ' case 6: released(); break; ' )
aadd( txt_, ' case 7: activated((*reinterpret_cast< int(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 8: currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 9: highlighted((*reinterpret_cast< int(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 10: returnPressed(); break; ' )
aadd( txt_, ' case 11: clicked_model((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 12: viewportEntered(); break; ' )
aadd( txt_, ' case 13: { bool _r = event((*reinterpret_cast< QEvent*(*)>(_a[1]))); ' )
aadd( txt_, ' if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; ' )
aadd( txt_, ' case 14: keyPressEvent((*reinterpret_cast< QKeyEvent*(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 15: mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 16: hovered((*reinterpret_cast< QAction*(*)>(_a[1]))); break; ' )
aadd( txt_, ' default: ; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' _id -= 17; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, '} ' )
aadd( txt_, 'static const uint qt_meta_data_MyDrawingArea[] = { ' )
aadd( txt_, ' ' )
aadd( txt_, ' // content: ' )
aadd( txt_, ' 2, // revision ' )
aadd( txt_, ' 0, // classname ' )
aadd( txt_, ' 0, 0, // classinfo ' )
aadd( txt_, ' 2, 12, // methods ' )
aadd( txt_, ' 0, 0, // properties ' )
aadd( txt_, ' 0, 0, // enums/sets ' )
aadd( txt_, ' 0, 0, // constructors ' )
aadd( txt_, ' ' )
aadd( txt_, ' // signals: signature, parameters, type, tag, flags ' )
aadd( txt_, ' 21, 15, 14, 14, 0x05, ' )
aadd( txt_, ' 53, 15, 14, 14, 0x05, ' )
aadd( txt_, ' ' )
aadd( txt_, ' 0 // eod ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'static const char qt_meta_stringdata_MyDrawingArea[] = { ' )
aadd( txt_, ' "MyDrawingArea\0\0event\0" ' )
aadd( txt_, ' "sg_mouseMoveEvent(QMouseEvent*)\0" ' )
aadd( txt_, ' "sg_keyPressEvent(QKeyEvent*)\0" ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject MyDrawingArea::staticMetaObject = { ' )
aadd( txt_, ' { &QWidget::staticMetaObject, qt_meta_stringdata_MyDrawingArea, ' )
aadd( txt_, ' qt_meta_data_MyDrawingArea, 0 } ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject *MyDrawingArea::metaObject() const ' )
aadd( txt_, '{ ' )
aadd( txt_, ' return &staticMetaObject; ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'void *MyDrawingArea::qt_metacast(const char *_clname) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' if (!_clname) return 0; ' )
aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_MyDrawingArea)) ' )
aadd( txt_, ' return static_cast<void*>(const_cast< MyDrawingArea*>(this)); ' )
aadd( txt_, ' return QWidget::qt_metacast(_clname); ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'int MyDrawingArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' _id = QWidget::qt_metacall(_c, _id, _a); ' )
aadd( txt_, ' if (_id < 0) ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, ' if (_c == QMetaObject::InvokeMetaMethod) { ' )
aadd( txt_, ' switch (_id) { ' )
aadd( txt_, ' case 0: sg_mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break; ' )
aadd( txt_, ' case 1: sg_keyPressEvent((*reinterpret_cast< QKeyEvent*(*)>(_a[1]))); break; ' )
aadd( txt_, ' default: ; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' _id -= 2; ' )
aadd( txt_, ' } ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, '// SIGNAL 0 ' )
aadd( txt_, 'void MyDrawingArea::sg_mouseMoveEvent(QMouseEvent * _t1) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; ' )
aadd( txt_, ' QMetaObject::activate(this, &staticMetaObject, 0, _a); ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, '// SIGNAL 1 ' )
aadd( txt_, 'void MyDrawingArea::sg_keyPressEvent(QKeyEvent * _t1) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; ' )
aadd( txt_, ' QMetaObject::activate(this, &staticMetaObject, 1, _a); ' )
aadd( txt_, '} ' )
aadd( txt_, 'static const uint qt_meta_data_MyMainWindow[] = { ' )
aadd( txt_, ' ' )
aadd( txt_, ' // content: ' )
aadd( txt_, ' 2, // revision ' )
aadd( txt_, ' 0, // classname ' )
aadd( txt_, ' 0, 0, // classinfo ' )
aadd( txt_, ' 0, 0, // methods ' )
aadd( txt_, ' 0, 0, // properties ' )
aadd( txt_, ' 0, 0, // enums/sets ' )
aadd( txt_, ' 0, 0, // constructors ' )
aadd( txt_, ' ' )
aadd( txt_, ' 0 // eod ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'static const char qt_meta_stringdata_MyMainWindow[] = { ' )
aadd( txt_, ' "MyMainWindow\0" ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject MyMainWindow::staticMetaObject = { ' )
aadd( txt_, ' { &QMainWindow::staticMetaObject, qt_meta_stringdata_MyMainWindow, ' )
aadd( txt_, ' qt_meta_data_MyMainWindow, 0 } ' )
aadd( txt_, '}; ' )
aadd( txt_, ' ' )
aadd( txt_, 'const QMetaObject *MyMainWindow::metaObject() const ' )
aadd( txt_, '{ ' )
aadd( txt_, ' return &staticMetaObject; ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'void *MyMainWindow::qt_metacast(const char *_clname) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' if (!_clname) return 0; ' )
aadd( txt_, ' if (!strcmp(_clname, qt_meta_stringdata_MyMainWindow)) ' )
aadd( txt_, ' return static_cast<void*>(const_cast< MyMainWindow*>(this)); ' )
aadd( txt_, ' return QMainWindow::qt_metacast(_clname); ' )
aadd( txt_, '} ' )
aadd( txt_, ' ' )
aadd( txt_, 'int MyMainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) ' )
aadd( txt_, '{ ' )
aadd( txt_, ' _id = QMainWindow::qt_metacall(_c, _id, _a); ' )
aadd( txt_, ' if (_id < 0) ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, ' return _id; ' )
aadd( txt_, '} ' )
aadd( txt_, 'QT_END_MOC_NAMESPACE ' )
aadd( txt_, ' ' )
RETURN CreateTarget( cFile, txt_ )

View File

@@ -70,6 +70,7 @@ QImageWriter.qth
QInputDialog.qth
QInputEvent.qth
QKeyEvent.qth
QKeySequence.qth
QLabel.qth
QLayout.qth
QLayoutItem.qth

View File

@@ -194,4 +194,33 @@
#define QEvent_KeyboardLayoutChange 169 // The keyboard layout has changed.
#define QEvent_DynamicPropertyChange 170 // A dynamic property was added, changed or removed from the object. User events should have values b
#define QPalette_Window 10 // A general background color.
#define QPalette_Background 10 // This value is obsolete. Use Window instead.
#define QPalette_WindowText 0 // A general foreground color.
#define QPalette_Foreground 0 // This value is obsolete. Use WindowText instead.
#define QPalette_Base 9 // Used mostly as the background color for text entry widgets, but can also be used for other painting - such as the background of combobox drop down lists and toolbar handles. It is usually white or another light color.
#define QPalette_AlternateBase 16 // Used as the alternate background color in views with alternating row colors (see QAbstractItemView_setAlternatingRowColors()).
#define QPalette_ToolTipBase 18 // Used as the background color for QToolTip and QWhatsThis. Tool tips use the Inactive color group of QPalette, because tool tips are not active windows.
#define QPalette_ToolTipText 19 // Used as the foreground color for QToolTip and QWhatsThis. Tool tips use the Inactive color group of QPalette, because tool tips are not active windows.
#define QPalette_Text 6 // The foreground color used with Base. This is usually the same as the WindowText, in which case it must provide good contrast with Window and Base.
#define QPalette_Button 1 // The general button background color. This background can be different from Window as some styles require a different background color for buttons.
#define QPalette_ButtonText 8 // A foreground color used with the Button color.
#define QPalette_BrightText 7 // A text color that is very different from WindowText, and contrasts well with e.g. Dark. Typically used for text that needs to be drawn where Text or WindowText would give poor contrast, such as on pressed push buttons. Note that text colors can be used for things other than just words; text colors are usually used for text, but it's quite common to use the text color roles for lines, icons, etc.
/*
* There are some color roles used mostly for 3D bevel and shadow effects.
* All of these are normally derived from Window, and used in ways that depend on that
* relationship. For example, buttons depend on it to make the bevels look attractive,
* and Motif scroll bars depend on Mid to be slightly different from Window.
*/
#define QPalette_Light 2 // Lighter than Button color.
#define QPalette_Midlight 3 // Between Button and Light.
#define QPalette_Dark 4 // Darker than Button.
#define QPalette_Mid 5 // Between Button and Dark.
#define QPalette_Shadow 11 // A very dark color. By default, the shadow color is Qt_black.
#define QPalette_Highlight 12 // A color to indicate a selected item or the current item. By default, the highlight color is Qt_darkBlue.
#define QPalette_HighlightedText 13 // A text color that contrasts with Highlight. By default, the highlighted text color is Qt_white.
#define QPalette_Link 14 // A text color used for unvisited hyperlinks. By default, the link color is Qt_blue.
#define QPalette_LinkVisited 15 // A text color used for already visited hyperlinks. By default, the linkvisited color is Qt_magenta.
#define QPalette_NoRole 17 // No role; this special role is often used to indicate that a role has not been assigned.
/*----------------------------------------------------------------------*/

View File

@@ -314,6 +314,7 @@
#define hbqt_par_QFileSystemModel( n ) ( ( QFileSystemModel* ) hb_parptr( n ) )
#define hbqt_par_QKeyEvent( n ) ( ( QKeyEvent* ) hb_parptr( n ) )
#define hbqt_par_QMouseEvent( n ) ( ( QMouseEvent* ) hb_parptr( n ) )
#define hbqt_par_QKeySequence( n ) ( ( QKeySequence* ) hb_parptr( n ) )
#define hbqt_par_QString( n ) ( ( QString ) hb_parc( n ) )
#define hbqt_par_QRgb( n ) ( hb_parnint( n ) )

View File

@@ -73,7 +73,33 @@ QColor ( Qt::GlobalColor color )
*/
HB_FUNC( QT_QCOLOR )
{
hb_retptr( ( QColor* ) new QColor() );
if( hb_pcount() == 1 )
{
if( HB_ISNUM( 1 ) && hb_parni( 1 ) < 25 )
{
hb_retptr( ( QColor* ) new QColor( ( Qt::GlobalColor ) hb_parni( 1 ) ) );
}
else if( HB_ISNUM( 1 ) )
{
hb_retptr( ( QColor* ) new QColor( ( QRgb ) hb_parni( 1 ) ) );
}
else if( HB_ISPOINTER( 1 ) )
{
hb_retptr( ( QColor* ) new QColor( *hbqt_par_QColor( 1 ) ) );
}
else if( HB_ISCHAR( 1 ) )
{
hb_retptr( ( QColor* ) new QColor( hbqt_par_QString( 1 ) ) );
}
else
{
hb_retptr( ( QColor* ) new QColor() );
}
}
else
{
hb_retptr( ( QColor* ) new QColor() );
}
}
/*
@@ -492,28 +518,20 @@ HB_FUNC( QT_QCOLOR_SETREDF )
hbqt_par_QColor( 1 )->setRedF( hb_parnd( 2 ) );
}
/*
* void setRgb ( int r, int g, int b, int a = 255 )
*/
HB_FUNC( QT_QCOLOR_SETRGB )
{
hbqt_par_QColor( 1 )->setRgb( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( HB_ISNUM( 5 ) ? hb_parni( 5 ) : 255 ) );
}
/*
* void setRgb ( QRgb rgb )
*/
HB_FUNC( QT_QCOLOR_SETRGB_1 )
HB_FUNC( QT_QCOLOR_SETRGB )
{
hbqt_par_QColor( 1 )->setRgb( hb_parni( 2 ) );
}
/*
* void setRgbF ( qreal r, qreal g, qreal b, qreal a = 1.0 )
* void setRgb ( int r, int g, int b, int a = 255 )
*/
HB_FUNC( QT_QCOLOR_SETRGBF )
HB_FUNC( QT_QCOLOR_SETRGB_1 )
{
hbqt_par_QColor( 1 )->setRgbF( hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ) );
hbqt_par_QColor( 1 )->setRgb( hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( HB_ISNUM( 5 ) ? hb_parni( 5 ) : 255 ) );
}
/*
@@ -524,6 +542,14 @@ HB_FUNC( QT_QCOLOR_SETRGBA )
hbqt_par_QColor( 1 )->setRgba( hb_parni( 2 ) );
}
/*
* void setRgbF ( qreal r, qreal g, qreal b, qreal a = 1.0 )
*/
HB_FUNC( QT_QCOLOR_SETRGBF )
{
hbqt_par_QColor( 1 )->setRgbF( hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ) );
}
/*
* Spec spec () const
*/

View File

@@ -0,0 +1,122 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* QT wrapper main header
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/*----------------------------------------------------------------------*/
#include "hbapi.h"
#include "hbqt.h"
/*----------------------------------------------------------------------*/
#if QT_VERSION >= 0x040500
/*----------------------------------------------------------------------*/
#include <QtGui/QKeySequence>
/*
* QKeySequence ()
* QKeySequence ( const QString & key )
* QKeySequence ( int k1, int k2 = 0, int k3 = 0, int k4 = 0 )
* QKeySequence ( const QKeySequence & keysequence )
* QKeySequence ( StandardKey key )
* ~QKeySequence ()
*/
HB_FUNC( QT_QKEYSEQUENCE )
{
if( HB_ISPOINTER( 1 ) )
hb_retptr( ( QKeySequence * ) new QKeySequence( *hbqt_par_QKeySequence( 1 ) ) );
else if( HB_ISCHAR( 1 ) )
hb_retptr( ( QKeySequence * ) new QKeySequence( hbqt_par_QString( 1 ) ) );
else if( HB_ISNUM( 1 ) )
hb_retptr( ( QKeySequence * ) new QKeySequence( hb_parni( 1 ) ) );
else
hb_retptr( ( QKeySequence * ) new QKeySequence() );
}
/*
* uint count () const
*/
HB_FUNC( QT_QKEYSEQUENCE_COUNT )
{
hb_retni( hbqt_par_QKeySequence( 1 )->count() );
}
/*
* bool isEmpty () const
*/
HB_FUNC( QT_QKEYSEQUENCE_ISEMPTY )
{
hb_retl( hbqt_par_QKeySequence( 1 )->isEmpty() );
}
/*
* SequenceMatch matches ( const QKeySequence & seq ) const
*/
HB_FUNC( QT_QKEYSEQUENCE_MATCHES )
{
hb_retni( ( QKeySequence::SequenceMatch ) hbqt_par_QKeySequence( 1 )->matches( *hbqt_par_QKeySequence( 2 ) ) );
}
/*
* QString toString ( SequenceFormat format = PortableText ) const
*/
HB_FUNC( QT_QKEYSEQUENCE_TOSTRING )
{
hb_retc( hbqt_par_QKeySequence( 1 )->toString( ( HB_ISNUM( 2 ) ? ( QKeySequence::SequenceFormat ) hb_parni( 2 ) : ( QKeySequence::SequenceFormat ) QKeySequence::PortableText ) ).toLatin1().data() );
}
/*----------------------------------------------------------------------*/
#endif /* #if QT_VERSION >= 0x040500 */
/*----------------------------------------------------------------------*/

View File

@@ -74,7 +74,29 @@
*/
HB_FUNC( QT_QPALETTE )
{
hb_retptr( ( QPalette* ) new QPalette() );
if( hb_pcount() >= 2 )
{
hb_retptr( ( QPalette* ) new QPalette() );
}
else if( hb_pcount() == 1 )
{
if( HB_ISPOINTER( 1 ) )
{
hb_retptr( ( QPalette* ) new QPalette( *hbqt_par_QColor( 1 ) ) );
}
else if( HB_ISNUM( 1 ) )
{
hb_retptr( ( QPalette* ) new QPalette( ( Qt::GlobalColor ) hb_parni( 1 ) ) );
}
else
{
hb_retptr( ( QPalette* ) new QPalette() );
}
}
else
{
hb_retptr( ( QPalette* ) new QPalette() );
}
}
/*
@@ -278,19 +300,19 @@ HB_FUNC( QT_QPALETTE_SETBRUSH_1 )
}
/*
* void setColor ( ColorGroup group, ColorRole role, const QColor & color )
* void setColor ( ColorRole role, const QColor & color )
*/
HB_FUNC( QT_QPALETTE_SETCOLOR )
{
hbqt_par_QPalette( 1 )->setColor( ( QPalette::ColorGroup ) hb_parni( 2 ), ( QPalette::ColorRole ) hb_parni( 3 ), *hbqt_par_QColor( 4 ) );
hbqt_par_QPalette( 1 )->setColor( ( QPalette::ColorRole ) hb_parni( 2 ), *hbqt_par_QColor( 3 ) );
}
/*
* void setColor ( ColorRole role, const QColor & color )
* void setColor ( ColorGroup group, ColorRole role, const QColor & color )
*/
HB_FUNC( QT_QPALETTE_SETCOLOR_1 )
{
hbqt_par_QPalette( 1 )->setColor( ( QPalette::ColorRole ) hb_parni( 2 ), *hbqt_par_QColor( 3 ) );
hbqt_par_QPalette( 1 )->setColor( ( QPalette::ColorGroup ) hb_parni( 2 ), ( QPalette::ColorRole ) hb_parni( 3 ), *hbqt_par_QColor( 4 ) );
}
/*

View File

@@ -52,6 +52,7 @@
*/
/*----------------------------------------------------------------------*/
#include "hbapi.h"
#include "hbvm.h"
#include "hbapiitm.h"
@@ -66,6 +67,7 @@
#include <QString>
#include <QList>
#include <QKeyEvent>
#include <QAction>
#define HBQT_EVT_CLICKED 1
#define HBQT_EVT_TRIGGERED 2
@@ -75,6 +77,7 @@
#define HBQT_EVT_PRESSED 6
#define HBQT_EVT_RELEASED 7
#include <windows.h>
/*----------------------------------------------------------------------*/
static Slots *s = NULL;
@@ -90,7 +93,26 @@ static void SlotsExec( QWidget* widget, QString event, PHB_ITEM pItem )
if( ( ( QString ) s->list2.at( i ) == event ) && ( ( bool ) s->list4.at( i ) == true ) )
{
PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget );
hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 1, pWidget );
hb_itemRelease( pWidget );
}
}
}
if( pItem != NULL )
{
hb_itemRelease( pItem );
}
}
static void SlotsExecAction( QAction* widget, QString event, PHB_ITEM pItem )
{
for( int i = 0; i < s->list1.size(); ++i )
{
if( ( QAction* ) s->list5.at( i ) == widget )
{
if( ( ( QString ) s->list2.at( i ) == event ) && ( ( bool ) s->list4.at( i ) == true ) )
{
PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QAction* ) widget );
hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 1, pWidget );
hb_itemRelease( pWidget );
}
@@ -112,7 +134,6 @@ static void SlotsExecInt( QWidget* widget, QString event, PHB_ITEM pItem, int iV
{
PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget* ) widget );
PHB_ITEM pState = hb_itemPutNI( NULL, iValue );
hb_vmEvalBlockV( ( PHB_ITEM ) s->list3.at( i ), 2, pWidget, pState );
hb_itemRelease( pWidget );
hb_itemRelease( pState );
@@ -192,6 +213,25 @@ void Slots::mouseMoveEvent( QMouseEvent * event )
}
}
void Slots::hovered( QAction * action )
{
QObject *widget = qobject_cast<QObject *>( sender() );
for( int i = 0; i < list1.size(); ++i )
{
if( ( QObject* ) list1.at( i ) == ( QObject* ) widget )
{
if( ( ( QString ) list2.at( i ) == ( QString ) "hovered(action)" ) && ( ( bool ) list4.at( i ) == true ) )
{
PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QWidget * ) widget );
PHB_ITEM pEvent = hb_itemPutPtr( NULL, action );
hb_vmEvalBlockV( ( PHB_ITEM ) list3.at( i ), 2, pWidget, pEvent );
hb_itemRelease( pWidget );
hb_itemRelease( pEvent );
}
}
}
}
void Slots::clicked()
{
QWidget *widget = qobject_cast<QWidget *>( sender() );
@@ -224,8 +264,12 @@ void Slots::released()
void Slots::hovered()
{
QWidget *widget = qobject_cast<QWidget *>( sender() );
SlotsExec( widget, ( QString ) "hovered()", NULL );
//QWidget *widget = qobject_cast<QWidget *>( sender() );
QAction *widget = qobject_cast<QAction *>( sender() );
if( widget )
{
SlotsExecAction( widget, ( QString ) "hovered()", NULL );
}
}
void Slots::triggered()
@@ -298,6 +342,8 @@ void Slots::clicked_model( const QModelIndex & index )
}
}
/*
* harbour function to connect signals with slots
*/
@@ -307,6 +353,7 @@ HB_FUNC( QT_CONNECT_SIGNAL )
QString signal = hb_parc( 2 ); /* get signal */
PHB_ITEM codeblock = hb_itemNew( hb_param( 3, HB_IT_BLOCK | HB_IT_BYREF ) ); /* get codeblock */
bool ret = false; /* return value */
bool bAct = false;
/* create object s, if not created yet */
if( s == NULL )
@@ -335,6 +382,7 @@ HB_FUNC( QT_CONNECT_SIGNAL )
if( signal == ( QString ) "hovered()" )
{
ret = widget->connect( widget, SIGNAL( hovered() ) , s, SLOT( hovered() ) , Qt::AutoConnection );
bAct = true;
}
if( signal == ( QString ) "viewportEntered()" )
{
@@ -397,6 +445,11 @@ HB_FUNC( QT_CONNECT_SIGNAL )
ret = widget->connect( widget, SIGNAL( sg_mouseMoveEvent( QMouseEvent * ) ),
s, SLOT( mouseMoveEvent( QMouseEvent * ) ), Qt::AutoConnection );
}
if( signal == ( QString ) "hovered(action)" )
{
ret = widget->connect( widget, SIGNAL( hovered( QAction * ) ),
s, SLOT( hovered( QAction * ) ), Qt::AutoConnection );
}
/* return connect result */
hb_retl( ret );
@@ -406,7 +459,16 @@ HB_FUNC( QT_CONNECT_SIGNAL )
*/
if( ret == true )
{
s->list1 << widget;
if( bAct )
{
s->list5 << ( QAction* ) hb_parptr( 1 );
s->list1 << NULL;
}
else
{
s->list5 << NULL;
s->list1 << widget;
}
s->list2 << signal;
s->list3 << codeblock;
s->list4 << true;
@@ -490,6 +552,7 @@ MyDrawingArea::MyDrawingArea(QWidget *parent)
setAttribute( Qt::WA_StaticContents );
setAttribute( Qt::WA_PaintOnScreen );
setAttribute( Qt::WA_DeleteOnClose );
setAttribute( Qt::WA_WindowPropagation );
setFocusPolicy( Qt::StrongFocus );
setMouseTracking( true );
@@ -522,5 +585,3 @@ HB_FUNC( QT_MYDRAWINGAREA )
/*----------------------------------------------------------------------*/
#endif

View File

@@ -77,6 +77,7 @@ public:
Slots( QObject *parent = 0 );
~Slots();
QList<QWidget*> list1;
QList<QAction*> list5;
QList<QString> list2;
QList<PHB_ITEM> list3;
QList<bool> list4;
@@ -95,9 +96,10 @@ public slots:
void returnPressed();
void clicked_model( const QModelIndex & index );
void viewportEntered();
bool event( QEvent *event );
bool event( QEvent * event );
void keyPressEvent( QKeyEvent * event );
void mouseMoveEvent( QMouseEvent * event );
void hovered( QAction * action );
#if 0
void accessibleEvent();

View File

@@ -1,7 +1,7 @@
/****************************************************************************
** Meta object code from reading C++ file hbqt_slots.h
**
** Created: Thu Jun 11 00:20:48 2009
** Created: Sat Jun 13 14:02:48 2009
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0)
**
** WARNING! All changes made in this file will be lost!
@@ -23,7 +23,7 @@ static const uint qt_meta_data_Slots[] = {
2, // revision
0, // classname
0, 0, // classinfo
16, 12, // methods
17, 12, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
@@ -45,6 +45,7 @@ static const uint qt_meta_data_Slots[] = {
243, 237, 232, 6, 0x0a,
258, 237, 6, 6, 0x0a,
284, 237, 6, 6, 0x0a,
320, 313, 6, 6, 0x0a,
0 // eod
};
@@ -58,7 +59,8 @@ static const char qt_meta_stringdata_Slots[] = {
"clicked_model(QModelIndex)\0viewportEntered()\0"
"bool\0event\0event(QEvent*)\0"
"keyPressEvent(QKeyEvent*)\0"
"mouseMoveEvent(QMouseEvent*)\0"
"mouseMoveEvent(QMouseEvent*)\0action\0"
"hovered(QAction*)\0"
};
const QMetaObject Slots::staticMetaObject = {
@@ -103,9 +105,10 @@ int Slots::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break;
case 14: keyPressEvent((*reinterpret_cast< QKeyEvent*(*)>(_a[1]))); break;
case 15: mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 16: hovered((*reinterpret_cast< QAction*(*)>(_a[1]))); break;
default: ;
}
_id -= 16;
_id -= 17;
}
return _id;
}

View File

@@ -74,7 +74,33 @@ QColor ( Qt::GlobalColor color )
*/
HB_FUNC( QT_QCOLOR )
{
hb_retptr( ( QColor* ) new QColor() );
if( hb_pcount() == 1 )
{
if( HB_ISNUM( 1 ) && hb_parni( 1 ) < 25 )
{
hb_retptr( ( QColor* ) new QColor( ( Qt::GlobalColor ) hb_parni( 1 ) ) );
}
else if( HB_ISNUM( 1 ) )
{
hb_retptr( ( QColor* ) new QColor( ( QRgb ) hb_parni( 1 ) ) );
}
else if( HB_ISPOINTER( 1 ) )
{
hb_retptr( ( QColor* ) new QColor( *hbqt_par_QColor( 1 ) ) );
}
else if( HB_ISCHAR( 1 ) )
{
hb_retptr( ( QColor* ) new QColor( hbqt_par_QString( 1 ) ) );
}
else
{
hb_retptr( ( QColor* ) new QColor() );
}
}
else
{
hb_retptr( ( QColor* ) new QColor() );
}
}
</CODE>
@@ -127,10 +153,15 @@ void setHsvF ( qreal h, qreal s, qreal v, qreal a = 1.0 )
void setNamedColor ( const QString & name )
void setRed ( int red )
void setRedF ( qreal red )
void setRgb ( int r, int g, int b, int a = 255 )
# functions below are swapped as we are used to pass RGB() as composite color
#
void setRgb ( QRgb rgb )
void setRgbF ( qreal r, qreal g, qreal b, qreal a = 1.0 )
void setRgb ( int r, int g, int b, int a = 255 )
void setRgba ( QRgb rgba )
void setRgbF ( qreal r, qreal g, qreal b, qreal a = 1.0 )
#
Spec spec () const
QColor toCmyk () const
QColor toHsv () const

View File

@@ -0,0 +1,111 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* QT Source Generator for Harbour
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/*----------------------------------------------------------------------*/
;
; Header File to Generate QT Wrapper Sources
;
<CLASS>
Inherits =
Type = Core
New =
</CLASS>
<CODE>
#include <QtGui/QKeySequence>
/*
* QKeySequence ()
* QKeySequence ( const QString & key )
* QKeySequence ( int k1, int k2 = 0, int k3 = 0, int k4 = 0 )
* QKeySequence ( const QKeySequence & keysequence )
* QKeySequence ( StandardKey key )
* ~QKeySequence ()
*/
HB_FUNC( QT_QKEYSEQUENCE )
{
if( HB_ISPOINTER( 1 ) )
hb_retptr( ( QKeySequence * ) new QKeySequence( *hbqt_par_QKeySequence( 1 ) ) );
else if( HB_ISCHAR( 1 ) )
hb_retptr( ( QKeySequence * ) new QKeySequence( hbqt_par_QString( 1 ) ) );
else if( HB_ISNUM( 1 ) )
hb_retptr( ( QKeySequence * ) new QKeySequence( hb_parni( 1 ) ) );
else
hb_retptr( ( QKeySequence * ) new QKeySequence() );
}
</CODE>
<ENUMS>
enum SequenceFormat { NativeText, PortableText }
enum SequenceMatch { NoMatch, PartialMatch, ExactMatch }
enum StandardKey { AddTab, Back, Bold, Close, ..., ZoomOut }
</ENUMS>
<PROTOS>
uint count () const
bool isEmpty () const
SequenceMatch matches ( const QKeySequence & seq ) const
QString toString ( SequenceFormat format = PortableText ) const
</PROTOS>
<SLOTS>
</SLOTS>
<SIGNALS>
</SIGNALS>
<VARIABLES>
</VARIABLES>

View File

@@ -75,7 +75,29 @@ New =
*/
HB_FUNC( QT_QPALETTE )
{
hb_retptr( ( QPalette* ) new QPalette() );
if( hb_pcount() >= 2 )
{
hb_retptr( ( QPalette* ) new QPalette() );
}
else if( hb_pcount() == 1 )
{
if( HB_ISPOINTER( 1 ) )
{
hb_retptr( ( QPalette* ) new QPalette( *hbqt_par_QColor( 1 ) ) );
}
else if( HB_ISNUM( 1 ) )
{
hb_retptr( ( QPalette* ) new QPalette( ( Qt::GlobalColor ) hb_parni( 1 ) ) );
}
else
{
hb_retptr( ( QPalette* ) new QPalette() );
}
}
else
{
hb_retptr( ( QPalette* ) new QPalette() );
}
}
</CODE>
@@ -107,13 +129,17 @@ const QBrush & link () const
const QBrush & linkVisited () const
const QBrush & mid () const
const QBrush & midlight () const
QPalette resolve ( const QPalette & other ) const
void setBrush ( ColorRole role, const QBrush & brush )
void setBrush ( ColorGroup group, ColorRole role, const QBrush & brush )
void setColor ( ColorGroup group, ColorRole role, const QColor & color )
void setColor ( ColorRole role, const QColor & color )
void setColor ( ColorGroup group, ColorRole role, const QColor & color )
void setColorGroup ( ColorGroup cg, const QBrush & windowText, const QBrush & button, const QBrush & light, const QBrush & dark, const QBrush & mid, const QBrush & text, const QBrush & bright_text, const QBrush & base, const QBrush & window )
void setCurrentColorGroup ( ColorGroup cg )
const QBrush & shadow () const
const QBrush & text () const
const QBrush & toolTipBase () const