diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1b52b982ea..3b8dfebd6e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,53 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-07 16:14 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/hbqt/generator/hbqtgen.prg + * harbour/contrib/hbqt/generator/qt45.qtp + + * harbour/contrib/hbqt/hbqt.h + + * harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp + + harbour/contrib/hbqt/hbqt_qabstractlistmodel.cpp + * harbour/contrib/hbqt/hbqt_qcombobox.cpp + * harbour/contrib/hbqt/hbqt_qdirmodel.cpp + * harbour/contrib/hbqt/hbqt_qftp.cpp + * harbour/contrib/hbqt/hbqt_qhttp.cpp + * harbour/contrib/hbqt/hbqt_qicon.cpp + * harbour/contrib/hbqt/hbqt_qimage.cpp + + harbour/contrib/hbqt/hbqt_qlist.cpp + * harbour/contrib/hbqt/hbqt_qpainter.cpp + * harbour/contrib/hbqt/hbqt_qpixmap.cpp + * harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp + + harbour/contrib/hbqt/hbqt_qstringlist.cpp + + harbour/contrib/hbqt/hbqt_qstringlistmodel.cpp + * harbour/contrib/hbqt/hbqt_qtextdocument.cpp + * harbour/contrib/hbqt/hbqt_qwebview.cpp + * harbour/contrib/hbqt/hbqt_qwidget.cpp + + * harbour/contrib/hbqt/Makefile_gen + + + harbour/contrib/hbqt/qth/QAbstractListModel.qth + + harbour/contrib/hbqt/qth/QList.qth + + harbour/contrib/hbqt/qth/QStringList.qth + + harbour/contrib/hbqt/qth/QStringListModel.qth + * harbour/contrib/hbqt/qth/QWidget.qth + + + harbour/contrib/hbqt/TQAbstractListModel.prg + * harbour/contrib/hbqt/TQFtp.prg + * harbour/contrib/hbqt/TQHttp.prg + * harbour/contrib/hbqt/TQIcon.prg + + harbour/contrib/hbqt/TQList.prg + + harbour/contrib/hbqt/TQStringList.prg + + harbour/contrib/hbqt/TQStringListModel.prg + * harbour/contrib/hbqt/TQWebView.prg + * harbour/contrib/hbqt/TQWidget.prg + + * harbour/contrib/hbqt/tests/demoqt.prg + + + Added new classes, fixed some default parameter issues. + + Added QListView() and managed how to use QStringList() class. + 2009-06-07 19:26 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Added support to redefine .prg level __ARCH*__ and __*_ENDIAN__ diff --git a/harbour/contrib/hbqt/Makefile_gen b/harbour/contrib/hbqt/Makefile_gen index f38e968573..2d250470c4 100644 --- a/harbour/contrib/hbqt/Makefile_gen +++ b/harbour/contrib/hbqt/Makefile_gen @@ -7,6 +7,7 @@ CPP_SOURCES=\ hbqt_qabstractbutton.cpp \ hbqt_qabstractitemmodel.cpp \ hbqt_qabstractitemview.cpp \ + hbqt_qabstractlistmodel.cpp \ hbqt_qabstractprintdialog.cpp \ hbqt_qabstractscrollarea.cpp \ hbqt_qabstractslider.cpp \ @@ -66,6 +67,7 @@ CPP_SOURCES=\ hbqt_qline.cpp \ hbqt_qlineargradient.cpp \ hbqt_qlineedit.cpp \ + hbqt_qlist.cpp \ hbqt_qlistview.cpp \ hbqt_qlistwidget.cpp \ hbqt_qlistwidgetitem.cpp \ @@ -110,6 +112,8 @@ CPP_SOURCES=\ hbqt_qstandarditem.cpp \ hbqt_qstandarditemmodel.cpp \ hbqt_qstatusbar.cpp \ + hbqt_qstringlist.cpp \ + hbqt_qstringlistmodel.cpp \ hbqt_qstyle.cpp \ hbqt_qstyleditemdelegate.cpp \ hbqt_qstylehintreturn.cpp \ @@ -204,6 +208,7 @@ PRG_SOURCES=\ TQAbstractButton.prg \ TQAbstractItemModel.prg \ TQAbstractItemView.prg \ + TQAbstractListModel.prg \ TQAbstractPrintDialog.prg \ TQAbstractScrollArea.prg \ TQAbstractSlider.prg \ @@ -261,6 +266,7 @@ PRG_SOURCES=\ TQLine.prg \ TQLinearGradient.prg \ TQLineEdit.prg \ + TQList.prg \ TQListView.prg \ TQListWidget.prg \ TQListWidgetItem.prg \ @@ -305,6 +311,8 @@ PRG_SOURCES=\ TQStandardItem.prg \ TQStandardItemModel.prg \ TQStatusBar.prg \ + TQStringList.prg \ + TQStringListModel.prg \ TQStyle.prg \ TQStyledItemDelegate.prg \ TQStyleHintReturn.prg \ diff --git a/harbour/contrib/hbqt/TQAbstractListModel.prg b/harbour/contrib/hbqt/TQAbstractListModel.prg new file mode 100644 index 0000000000..5c45f9cb24 --- /dev/null +++ b/harbour/contrib/hbqt/TQAbstractListModel.prg @@ -0,0 +1,81 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * 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 QAbstractListModel INHERIT QAbstractItemModel + + VAR pParent + VAR pPtr + + METHOD New() + + METHOD index( nRow, nColumn, pParent ) INLINE Qt_QAbstractListModel_index( ::pPtr, nRow, nColumn, pParent ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QAbstractListModel + + ::pParent := pParent + + ::pPtr := Qt_QAbstractListModel( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/TQFtp.prg b/harbour/contrib/hbqt/TQFtp.prg index 8d6e9b936e..192913332a 100644 --- a/harbour/contrib/hbqt/TQFtp.prg +++ b/harbour/contrib/hbqt/TQFtp.prg @@ -76,7 +76,7 @@ CREATE CLASS QFtp INHERIT QObject METHOD get( cFile, pDev, nType ) INLINE Qt_QFtp_get( ::pPtr, cFile, pDev, nType ) METHOD hasPendingCommands() INLINE Qt_QFtp_hasPendingCommands( ::pPtr ) METHOD list( cDir ) INLINE Qt_QFtp_list( ::pPtr, cDir ) - METHOD login( cUser ) INLINE Qt_QFtp_login( ::pPtr, cUser ) + METHOD login( cUser, cPassword ) INLINE Qt_QFtp_login( ::pPtr, cUser, cPassword ) METHOD mkdir( cDir ) INLINE Qt_QFtp_mkdir( ::pPtr, cDir ) METHOD put( pDev, cFile, nType ) INLINE Qt_QFtp_put( ::pPtr, pDev, cFile, nType ) METHOD put_1( pData, cFile, nType ) INLINE Qt_QFtp_put_1( ::pPtr, pData, cFile, nType ) diff --git a/harbour/contrib/hbqt/TQHttp.prg b/harbour/contrib/hbqt/TQHttp.prg index ad928e6b13..450b0b05e8 100644 --- a/harbour/contrib/hbqt/TQHttp.prg +++ b/harbour/contrib/hbqt/TQHttp.prg @@ -84,7 +84,7 @@ CREATE CLASS QHttp INHERIT QObject METHOD request_1( pHeader, pData, pTo ) INLINE Qt_QHttp_request_1( ::pPtr, pHeader, pData, pTo ) METHOD setHost( cHostName, nPort ) INLINE Qt_QHttp_setHost( ::pPtr, cHostName, nPort ) METHOD setHost_1( cHostName, nMode, nPort ) INLINE Qt_QHttp_setHost_1( ::pPtr, cHostName, nMode, nPort ) - METHOD setProxy( cHost, nPort, cUsername ) INLINE Qt_QHttp_setProxy( ::pPtr, cHost, nPort, cUsername ) + METHOD setProxy( cHost, nPort, cUsername, cPassword ) INLINE Qt_QHttp_setProxy( ::pPtr, cHost, nPort, cUsername, cPassword ) METHOD setProxy_1( pProxy ) INLINE Qt_QHttp_setProxy_1( ::pPtr, pProxy ) METHOD setSocket( pSocket ) INLINE Qt_QHttp_setSocket( ::pPtr, pSocket ) METHOD setUser( cUserName, cPassword ) INLINE Qt_QHttp_setUser( ::pPtr, cUserName, cPassword ) diff --git a/harbour/contrib/hbqt/TQIcon.prg b/harbour/contrib/hbqt/TQIcon.prg index 559c13c0e7..9b151bc57a 100644 --- a/harbour/contrib/hbqt/TQIcon.prg +++ b/harbour/contrib/hbqt/TQIcon.prg @@ -64,7 +64,7 @@ CREATE CLASS QIcon METHOD New() METHOD actualSize( pSize, nMode, nState ) INLINE Qt_QIcon_actualSize( ::pPtr, pSize, nMode, nState ) - METHOD addFile( cFileName, pSize ) INLINE Qt_QIcon_addFile( ::pPtr, cFileName, pSize ) + METHOD addFile( cFileName, pSize, nMode, nState ) INLINE Qt_QIcon_addFile( ::pPtr, cFileName, pSize, nMode, nState ) METHOD addPixmap( pPixmap, nMode, nState ) INLINE Qt_QIcon_addPixmap( ::pPtr, pPixmap, nMode, nState ) METHOD cacheKey() INLINE Qt_QIcon_cacheKey( ::pPtr ) METHOD isNull() INLINE Qt_QIcon_isNull( ::pPtr ) diff --git a/harbour/contrib/hbqt/TQList.prg b/harbour/contrib/hbqt/TQList.prg new file mode 100644 index 0000000000..b1a9f3d0ad --- /dev/null +++ b/harbour/contrib/hbqt/TQList.prg @@ -0,0 +1,120 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * 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 QList + + VAR pParent + VAR pPtr + + METHOD New() + + METHOD append( xValue ) INLINE Qt_QList_append( ::pPtr, xValue ) + METHOD at( nI ) INLINE Qt_QList_at( ::pPtr, nI ) + METHOD back() INLINE Qt_QList_back( ::pPtr ) + METHOD back_1() INLINE Qt_QList_back_1( ::pPtr ) + METHOD clear() INLINE Qt_QList_clear( ::pPtr ) + METHOD count( xValue ) INLINE Qt_QList_count( ::pPtr, xValue ) + METHOD count_1() INLINE Qt_QList_count_1( ::pPtr ) + METHOD empty() INLINE Qt_QList_empty( ::pPtr ) + METHOD endsWith( xValue ) INLINE Qt_QList_endsWith( ::pPtr, xValue ) + METHOD first() INLINE Qt_QList_first( ::pPtr ) + METHOD first_1() INLINE Qt_QList_first_1( ::pPtr ) + METHOD front() INLINE Qt_QList_front( ::pPtr ) + METHOD front_1() INLINE Qt_QList_front_1( ::pPtr ) + METHOD indexOf( xValue, nFrom ) INLINE Qt_QList_indexOf( ::pPtr, xValue, nFrom ) + METHOD insert( nI, xValue ) INLINE Qt_QList_insert( ::pPtr, nI, xValue ) + METHOD isEmpty() INLINE Qt_QList_isEmpty( ::pPtr ) + METHOD last() INLINE Qt_QList_last( ::pPtr ) + METHOD last_1() INLINE Qt_QList_last_1( ::pPtr ) + METHOD lastIndexOf( xValue, nFrom ) INLINE Qt_QList_lastIndexOf( ::pPtr, xValue, nFrom ) + METHOD length() INLINE Qt_QList_length( ::pPtr ) + METHOD move( nFrom, nTo ) INLINE Qt_QList_move( ::pPtr, nFrom, nTo ) + METHOD pop_back() INLINE Qt_QList_pop_back( ::pPtr ) + METHOD pop_front() INLINE Qt_QList_pop_front( ::pPtr ) + METHOD prepend( xValue ) INLINE Qt_QList_prepend( ::pPtr, xValue ) + METHOD push_back( xValue ) INLINE Qt_QList_push_back( ::pPtr, xValue ) + METHOD push_front( xValue ) INLINE Qt_QList_push_front( ::pPtr, xValue ) + METHOD removeAll( xValue ) INLINE Qt_QList_removeAll( ::pPtr, xValue ) + METHOD removeAt( nI ) INLINE Qt_QList_removeAt( ::pPtr, nI ) + METHOD removeFirst() INLINE Qt_QList_removeFirst( ::pPtr ) + METHOD removeLast() INLINE Qt_QList_removeLast( ::pPtr ) + METHOD removeOne( xValue ) INLINE Qt_QList_removeOne( ::pPtr, xValue ) + METHOD replace( nI, xValue ) INLINE Qt_QList_replace( ::pPtr, nI, xValue ) + METHOD size() INLINE Qt_QList_size( ::pPtr ) + METHOD startsWith( xValue ) INLINE Qt_QList_startsWith( ::pPtr, xValue ) + METHOD swap( nI, nJ ) INLINE Qt_QList_swap( ::pPtr, nI, nJ ) + METHOD takeAt( nI ) INLINE Qt_QList_takeAt( ::pPtr, nI ) + METHOD takeFirst() INLINE Qt_QList_takeFirst( ::pPtr ) + METHOD takeLast() INLINE Qt_QList_takeLast( ::pPtr ) + METHOD value( nI ) INLINE Qt_QList_value( ::pPtr, nI ) + METHOD value_1( nI, xDefaultValue ) INLINE Qt_QList_value_1( ::pPtr, nI, xDefaultValue ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QList + + ::pParent := pParent + + ::pPtr := Qt_QList( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/TQStringList.prg b/harbour/contrib/hbqt/TQStringList.prg new file mode 100644 index 0000000000..0be0804d87 --- /dev/null +++ b/harbour/contrib/hbqt/TQStringList.prg @@ -0,0 +1,115 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * 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 QStringList INHERIT QList + + VAR pParent + VAR pPtr + + METHOD New() + + METHOD append( cValue ) INLINE Qt_QStringList_append( ::pPtr, cValue ) + METHOD filter( cStr, nCs ) INLINE Qt_QStringList_filter( ::pPtr, cStr, nCs ) + METHOD filter_1( pRx ) INLINE Qt_QStringList_filter_1( ::pPtr, pRx ) + METHOD indexOf( cValue, nFrom ) INLINE Qt_QStringList_indexOf( ::pPtr, cValue, nFrom ) + METHOD indexOf_1( pRx, nFrom ) INLINE Qt_QStringList_indexOf_1( ::pPtr, pRx, nFrom ) + METHOD indexOf_2( pRx, nFrom ) INLINE Qt_QStringList_indexOf_2( ::pPtr, pRx, nFrom ) + METHOD join( cSeparator ) INLINE Qt_QStringList_join( ::pPtr, cSeparator ) + METHOD lastIndexOf( pRx, nFrom ) INLINE Qt_QStringList_lastIndexOf( ::pPtr, pRx, nFrom ) + METHOD lastIndexOf_1( cValue, nFrom ) INLINE Qt_QStringList_lastIndexOf_1( ::pPtr, cValue, nFrom ) + METHOD lastIndexOf_2( pRx, nFrom ) INLINE Qt_QStringList_lastIndexOf_2( ::pPtr, pRx, nFrom ) + METHOD removeDuplicates() INLINE Qt_QStringList_removeDuplicates( ::pPtr ) + METHOD sort() INLINE Qt_QStringList_sort( ::pPtr ) + METHOD at( nI ) INLINE Qt_QStringList_at( ::pPtr, nI ) + METHOD back() INLINE Qt_QStringList_back( ::pPtr ) + METHOD count( cValue ) INLINE Qt_QStringList_count( ::pPtr, cValue ) + METHOD endsWith( cValue ) INLINE Qt_QStringList_endsWith( ::pPtr, cValue ) + METHOD first() INLINE Qt_QStringList_first( ::pPtr ) + METHOD first_1() INLINE Qt_QStringList_first_1( ::pPtr ) + METHOD front() INLINE Qt_QStringList_front( ::pPtr ) + METHOD front_1() INLINE Qt_QStringList_front_1( ::pPtr ) + METHOD insert( nI, cValue ) INLINE Qt_QStringList_insert( ::pPtr, nI, cValue ) + METHOD last() INLINE Qt_QStringList_last( ::pPtr ) + METHOD last_1() INLINE Qt_QStringList_last_1( ::pPtr ) + METHOD prepend( cValue ) INLINE Qt_QStringList_prepend( ::pPtr, cValue ) + METHOD push_back( cValue ) INLINE Qt_QStringList_push_back( ::pPtr, cValue ) + METHOD push_front( cValue ) INLINE Qt_QStringList_push_front( ::pPtr, cValue ) + METHOD removeAll( cValue ) INLINE Qt_QStringList_removeAll( ::pPtr, cValue ) + METHOD removeOne( cValue ) INLINE Qt_QStringList_removeOne( ::pPtr, cValue ) + METHOD replace( nI, cValue ) INLINE Qt_QStringList_replace( ::pPtr, nI, cValue ) + METHOD startsWith( cValue ) INLINE Qt_QStringList_startsWith( ::pPtr, cValue ) + METHOD takeAt( nI ) INLINE Qt_QStringList_takeAt( ::pPtr, nI ) + METHOD takeFirst() INLINE Qt_QStringList_takeFirst( ::pPtr ) + METHOD takeLast() INLINE Qt_QStringList_takeLast( ::pPtr ) + METHOD value( nI ) INLINE Qt_QStringList_value( ::pPtr, nI ) + METHOD value_1( nI, cDefaultValue ) INLINE Qt_QStringList_value_1( ::pPtr, nI, cDefaultValue ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QStringList + + ::pParent := pParent + + ::pPtr := Qt_QStringList( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/TQStringListModel.prg b/harbour/contrib/hbqt/TQStringListModel.prg new file mode 100644 index 0000000000..03864ea0be --- /dev/null +++ b/harbour/contrib/hbqt/TQStringListModel.prg @@ -0,0 +1,88 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * 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 QStringListModel INHERIT QAbstractListModel + + VAR pParent + VAR pPtr + + METHOD New() + + METHOD data( pIndex, nRole ) INLINE Qt_QStringListModel_data( ::pPtr, pIndex, nRole ) + METHOD flags( pIndex ) INLINE Qt_QStringListModel_flags( ::pPtr, pIndex ) + METHOD insertRows( nRow, nCount, pParent ) INLINE Qt_QStringListModel_insertRows( ::pPtr, nRow, nCount, pParent ) + METHOD removeRows( nRow, nCount, pParent ) INLINE Qt_QStringListModel_removeRows( ::pPtr, nRow, nCount, pParent ) + METHOD rowCount( pParent ) INLINE Qt_QStringListModel_rowCount( ::pPtr, pParent ) + METHOD setData( pIndex, pValue, nRole ) INLINE Qt_QStringListModel_setData( ::pPtr, pIndex, pValue, nRole ) + METHOD setStringList( pStrings ) INLINE Qt_QStringListModel_setStringList( ::pPtr, pStrings ) + METHOD stringList() INLINE Qt_QStringListModel_stringList( ::pPtr ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD New( pParent ) CLASS QStringListModel + + ::pParent := pParent + + ::pPtr := Qt_QStringListModel( pParent ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/TQWebView.prg b/harbour/contrib/hbqt/TQWebView.prg index d3256f5f4c..64ccf62a77 100644 --- a/harbour/contrib/hbqt/TQWebView.prg +++ b/harbour/contrib/hbqt/TQWebView.prg @@ -72,7 +72,7 @@ CREATE CLASS QWebView INHERIT QWidget METHOD page() INLINE Qt_QWebView_page( ::pPtr ) METHOD pageAction( nAction ) INLINE Qt_QWebView_pageAction( ::pPtr, nAction ) METHOD selectedText() INLINE Qt_QWebView_selectedText( ::pPtr ) - METHOD setContent( pData, cMimeType ) INLINE Qt_QWebView_setContent( ::pPtr, pData, cMimeType ) + METHOD setContent( pData, cMimeType, pBaseUrl ) INLINE Qt_QWebView_setContent( ::pPtr, pData, cMimeType, pBaseUrl ) METHOD setHtml( cHtml, pBaseUrl ) INLINE Qt_QWebView_setHtml( ::pPtr, cHtml, pBaseUrl ) METHOD setPage( pPage ) INLINE Qt_QWebView_setPage( ::pPtr, pPage ) METHOD setTextSizeMultiplier( nFactor ) INLINE Qt_QWebView_setTextSizeMultiplier( ::pPtr, nFactor ) diff --git a/harbour/contrib/hbqt/TQWidget.prg b/harbour/contrib/hbqt/TQWidget.prg index d5c6b1a945..8bd0ac314d 100644 --- a/harbour/contrib/hbqt/TQWidget.prg +++ b/harbour/contrib/hbqt/TQWidget.prg @@ -150,8 +150,6 @@ CREATE CLASS QWidget INHERIT QObject, QPaintDevice METHOD releaseMouse() INLINE Qt_QWidget_releaseMouse( ::pPtr ) METHOD releaseShortcut( nId ) INLINE Qt_QWidget_releaseShortcut( ::pPtr, nId ) METHOD removeAction( pAction ) INLINE Qt_QWidget_removeAction( ::pPtr, pAction ) - METHOD render( pTarget, pTargetOffset ) INLINE Qt_QWidget_render( ::pPtr, pTarget, pTargetOffset ) - METHOD render_1( pPainter, pTargetOffset ) INLINE Qt_QWidget_render_1( ::pPtr, pPainter, pTargetOffset ) METHOD repaint( nX, nY, nW, nH ) INLINE Qt_QWidget_repaint( ::pPtr, nX, nY, nW, nH ) METHOD repaint_1( pRect ) INLINE Qt_QWidget_repaint_1( ::pPtr, pRect ) METHOD repaint_2( pRgn ) INLINE Qt_QWidget_repaint_2( ::pPtr, pRgn ) diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index ff17068628..40d0d8d429 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -524,7 +524,7 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) aRet := {}; aArgus := {} n := at( '(', cProto ) IF n > 0 - nn := at( ')', cProto ) + nn := rat( ')', cProto ) IF nn > 0 /* Pull out pre-mid-post components */ cPre := alltrim( substr( cProto, 1, n-1 ) ) @@ -541,26 +541,6 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) cRet := '' ENDIF - /* Parse Parameters - * - const QTransform & - * - bool - * - void - * - int - * - quint32 - * - quint64 - * - QString - * - QIcon - * - const QPen & - * - Qt::BGMode - * - one of the enum values without :: - * - * - * Return values of known types - * - int(32,64), bool, QString, enums (int) - * - QPoint, QSize, QRect [ should we manupulate as QT class ? ] - * - * Rest all as pointers to classes - */ aRet := array( PRT_ATTRB_MAX ) aRet[ PRT_L_CONST ] := 'const' $ cRet .or. 'const' $ cPas @@ -728,8 +708,17 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) aA[ PRT_DOC ] := 'p'+ cDocNM CASE aA[ PRT_L_AND ] .and. aA[ PRT_L_CONST ] + s := '*hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )' + IF !empty( aA[ PRT_DEFAULT ] ) .and. ( '(' $ aA[ PRT_DEFAULT ] ) + aA[ PRT_BODY ] := '( HB_ISNIL( '+cHBIdx+' ) ? ' + aA[ PRT_DEFAULT ] +' : '+ s +' )' + ELSE + aA[ PRT_BODY ] := s + ENDIF + aA[ PRT_DOC ] := 'p'+ cDocNM + #if 0 aA[ PRT_BODY ] := '*hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )' aA[ PRT_DOC ] := 'p'+ cDocNM + #endif CASE aA[ PRT_L_AND ] #if 0 @@ -738,47 +727,7 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) aA[ PRT_BODY ] := '*hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )' #endif aA[ PRT_DOC ] := 'p'+ cDocNM -#if 0 - CASE aA[ PRT_CAST ] == 'HFONT' - aA[ PRT_BODY ] := IF( aA[ PRT_L_CONST ], '*','' ) +'hbqt_par_HFONT( '+ cHBIdx +' )' - aA[ PRT_DOC ] := 'h'+ cDocNM - CASE aA[ PRT_CAST ] == 'HDC' - aA[ PRT_BODY ] := '*hbqt_par_HDC( '+ cHBIdx +' )' - aA[ PRT_DOC ] := 'h'+ cDocNM - - CASE aA[ PRT_CAST ] == 'WId' - aA[ PRT_BODY ] := 'hbqt_par_WId( '+ cHBIdx +' )' - aA[ PRT_DOC ] := 'h'+ cDocNM - - CASE aA[ PRT_CAST ] == 'HRGN' - aA[ PRT_BODY ] := 'hbqt_par_HRGN( '+ cHBIdx +' )' - aA[ PRT_DOC ] := 'h'+ cDocNM - - CASE aA[ PRT_CAST ] == 'QRect' - aA[ PRT_BODY ] := 'hbqt_const_QRect( ' + cHBIdx + ' )' - aA[ PRT_DOC ] := 'a'+ cDocNM - - CASE aA[ PRT_CAST ] == 'QSize' - aA[ PRT_BODY ] := 'hbqt_const_QSize( ' + cHBIdx + ' )' - aA[ PRT_DOC ] := 'a'+ cDocNM - - CASE aA[ PRT_CAST ] == 'QPoint' - aA[ PRT_BODY ] := 'hbqt_const_QPoint( ' + cHBIdx + ' )' - aA[ PRT_DOC ] := 'a'+ cDocNM - - CASE aA[ PRT_CAST ] == 'QRectF' - aA[ PRT_BODY ] := 'hbqt_const_QRectF( ' + cHBIdx + ' )' - aA[ PRT_DOC ] := 'a'+ cDocNM - - CASE aA[ PRT_CAST ] == 'QSizeF' - aA[ PRT_BODY ] := 'hbqt_const_QSizeF( ' + cHBIdx + ' )' - aA[ PRT_DOC ] := 'a'+ cDocNM - - CASE aA[ PRT_CAST ] == 'QPointF' - aA[ PRT_BODY ] := 'hbqt_const_QPointF( ' + cHBIdx + ' )' - aA[ PRT_DOC ] := 'a'+ cDocNM -#endif OTHERWISE aA[ PRT_BODY ] := '' aA[ PRT_DOC ] := '' @@ -804,8 +753,12 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) DO CASE CASE aA[ PRT_CAST ] == 'T' + #if 0 cCmd := 'hb_ret( '+ cCmn +' )' cPrgRet := 'x'+cDocNM + #endif + cCmd := 'hb_retptr( '+ cCmn +' )' + cPrgRet := 'p'+cDocNM CASE aA[ PRT_CAST ] == 'void' cCmd := cCmn @@ -1674,6 +1627,9 @@ STATIC FUNCTION Build_HBQT_H( cPathOut ) aadd( txt_, "#define hbqt_par_QTextObject( n ) ( ( QTextObject* ) hb_parptr( n ) ) " ) aadd( txt_, "#define hbqt_par_QModelIndexList( n ) ( ( QModelIndexList* ) hb_parptr( n ) ) " ) aadd( txt_, "#define hbqt_par_QDirModel( n ) ( ( QDirModel* ) hb_parptr( n ) ) " ) + aadd( txt_, "#define hbqt_par_QList( n ) ( ( QList* ) hb_parptr( n ) ) " ) + aadd( txt_, "#define hbqt_par_QStringListModel( n ) ( ( QStringListModel* ) hb_parptr( n ) ) " ) + aadd( txt_, "#define hbqt_par_QAbstractListModel( n ) ( ( QAbstractListModel* ) 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 ) ) " ) @@ -2506,9 +2462,10 @@ STATIC FUNCTION Build_Demo() aadd( txt_, ' ' ) aadd( txt_, ' Build_Label( oDA, { 30,190 }, { 300, 30 } ) ' ) aadd( txt_, ' Build_PushButton( oDA, { 30,240 }, { 100,50 } ) ' ) - aadd( txt_, ' Build_Grid( oDA ) ' ) - aadd( txt_, ' Build_Tabs( oDA ) ' ) + aadd( txt_, ' Build_Grid( oDA, { 30, 30 }, { 450,150 } ) ' ) + aadd( txt_, ' Build_Tabs( oDA, { 510, 5 }, { 360, 400 } ) ' ) aadd( txt_, ' Build_ProgressBar( oDA, { 30,300 }, { 200,30 } ) ' ) + aadd( txt_, ' Build_ListBox( oDA, { 310,240 }, { 150, 100 } ) ' ) aadd( txt_, ' ' ) aadd( txt_, ' oWnd:Show() ' ) aadd( txt_, ' ' ) @@ -2644,6 +2601,7 @@ STATIC FUNCTION Build_Demo() aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) aadd( txt_, ' ' ) aadd( txt_, 'STATIC FUNCTION Build_PushButton( oWnd, aPos, aSize ) ' ) + aadd( txt_, ' LOCAL oBtn ' ) aadd( txt_, ' ' ) aadd( txt_, ' oBtn := QPushButton():new( QT_PTROF( oWnd ) ) ' ) aadd( txt_, ' oBtn:setText( "Push Button" ) ' ) @@ -2656,7 +2614,7 @@ STATIC FUNCTION Build_Demo() aadd( txt_, ' ' ) aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_Grid( oWnd ) ' ) + aadd( txt_, 'STATIC FUNCTION Build_Grid( oWnd, aPos, aSize ) ' ) aadd( txt_, ' LOCAL oGrid, oBrushBackItem0x0, oBrushForeItem0x0, oGridItem0x0 ' ) aadd( txt_, ' ' ) aadd( txt_, ' oGrid := QTableWidget():new( QT_PTROF( oWnd ) ) ' ) @@ -2677,8 +2635,8 @@ STATIC FUNCTION Build_Demo() aadd( txt_, ' // ' ) aadd( txt_, ' oGrid:setItem( 0, 0, QT_PTROF( oGridItem0x0 ) ) ' ) aadd( txt_, ' // ' ) - aadd( txt_, ' oGrid:Move( 30, 30 ) ' ) - aadd( txt_, ' oGrid:ReSize( 450, 150 ) ' ) + aadd( txt_, ' oGrid:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) + aadd( txt_, ' oGrid:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) aadd( txt_, ' // ' ) aadd( txt_, ' oGrid:Show() ' ) aadd( txt_, ' ' ) @@ -2686,7 +2644,7 @@ STATIC FUNCTION Build_Demo() aadd( txt_, ' ' ) aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) aadd( txt_, ' ' ) - aadd( txt_, 'STATIC FUNCTION Build_Tabs( oWnd ) ' ) + aadd( txt_, 'STATIC FUNCTION Build_Tabs( oWnd, aPos, aSize ) ' ) aadd( txt_, ' LOCAL oTabWidget, oTab1, oTab2, oTab3 ' ) aadd( txt_, ' ' ) aadd( txt_, ' oTabWidget := QTabWidget():new( QT_PTROF( oWnd ) ) ' ) @@ -2699,8 +2657,8 @@ STATIC FUNCTION Build_Demo() aadd( txt_, ' oTabWidget:addTab( QT_PTROF( oTab2 ), "Controls" ) ' ) aadd( txt_, ' oTabWidget:addTab( QT_PTROF( oTab3 ), "TextBox" ) ' ) aadd( txt_, ' ' ) - aadd( txt_, ' oTabWidget:move( 510, 5 ) ' ) - aadd( txt_, ' oTabWidget:resize( 360, 400 ) ' ) + aadd( txt_, ' oTabWidget:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) + aadd( txt_, ' oTabWidget:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) aadd( txt_, ' oTabWidget:show() ' ) aadd( txt_, ' ' ) aadd( txt_, ' Build_Treeview( oTab1 ) ' ) @@ -2712,7 +2670,7 @@ STATIC FUNCTION Build_Demo() aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) aadd( txt_, ' ' ) aadd( txt_, 'STATIC FUNCTION Build_TreeView( oWnd ) ' ) - aadd( txt_, ' LOCAL oTV, oDModel ' ) + aadd( txt_, ' LOCAL oTV, oDirModel ' ) aadd( txt_, ' ' ) aadd( txt_, ' oTV := QTreeView():new( QT_PTROF( oWnd ) ) ' ) aadd( txt_, ' ' ) @@ -2726,6 +2684,34 @@ STATIC FUNCTION Build_Demo() aadd( txt_, ' ' ) aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) aadd( txt_, ' ' ) + aadd( txt_, 'STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize ) ' ) + aadd( txt_, ' LOCAL oListBox, oStrList, oStrModel ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oListBox := QListView():New( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oStrList := QStringList():new( QT_PTROF( oListBox ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oStrList:append( "India" ) ' ) + aadd( txt_, ' oStrList:append( "United States" ) ' ) + aadd( txt_, ' oStrList:append( "England" ) ' ) + aadd( txt_, ' oStrList:append( "Japan" ) ' ) + aadd( txt_, ' oStrList:append( "Hungary" ) ' ) + aadd( txt_, ' oStrList:append( "Argentina" ) ' ) + aadd( txt_, ' oStrList:append( "China" ) ' ) + aadd( txt_, ' oStrList:sort() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oStrModel := QStringListModel():new( QT_PTROF( oListBox ) ) ' ) + aadd( txt_, ' oStrModel:setStringList( QT_PTROF( oStrList ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oListBox:setModel( QT_PTROF( oStrModel ) ) ' ) + aadd( txt_, ' oListBox:Move( aPos[ 1 ], aPos[ 2 ] ) ' ) + aadd( txt_, ' oListBox:ReSize( aSize[ 1 ], aSize[ 2 ] ) ' ) + aadd( txt_, ' oListBox:Show() ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' RETURN nil ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) aadd( txt_, 'STATIC FUNCTION Build_TextBox( oWnd ) ' ) aadd( txt_, ' LOCAL oTextBox ' ) aadd( txt_, ' ' ) @@ -2741,7 +2727,7 @@ STATIC FUNCTION Build_Demo() aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) aadd( txt_, ' ' ) aadd( txt_, 'STATIC FUNCTION Build_Controls( oWnd ) ' ) - aadd( txt_, ' LOCAL oEdit, oCheckBox, oComboBox, oSpinBox, oRadioButton ' ) + aadd( txt_, ' LOCAL oEdit, oCheckBox, oComboBox, oSpinBox, oRadioButton, oVariant ' ) aadd( txt_, ' ' ) aadd( txt_, ' oEdit := QLineEdit():new( QT_PTROF( oWnd ) ) ' ) aadd( txt_, ' oEdit:move( 5, 10 ) ' ) @@ -2752,6 +2738,10 @@ STATIC FUNCTION Build_Demo() aadd( txt_, ' oEdit:show() ' ) aadd( txt_, ' ' ) aadd( txt_, ' oComboBox := QComboBox():New( QT_PTROF( oWnd ) ) ' ) + aadd( txt_, ' ' ) + aadd( txt_, ' oComboBox:addItem( "First" ) ' ) + aadd( txt_, ' oComboBox:addItem( "Second" ) ' ) + aadd( txt_, ' oComboBox:addItem( "Third" ) ' ) aadd( txt_, ' oComboBox:move( 5, 60 ) ' ) aadd( txt_, ' oComboBox:resize( 345, 30 ) ' ) aadd( txt_, ' oComboBox:show() ' ) @@ -3061,6 +3051,20 @@ STATIC FUNCTION Build_Demo() aadd( txt_, ' ' ) aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) aadd( txt_, ' ' ) + aadd( txt_, '#PRAGMA BEGINDUMP ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#include ' ) + aadd( txt_, '#include "hbapi.h" ' ) + aadd( txt_, ' ' ) + aadd( txt_, 'HB_FUNC( UIDEBUG ) ' ) + aadd( txt_, '{ ' ) + aadd( txt_, ' OutputDebugString( hb_parc( 1 ) ); ' ) + aadd( txt_, '} ' ) + aadd( txt_, ' ' ) + aadd( txt_, '#PRAGMA ENDDUMP ' ) + aadd( txt_, ' ' ) + aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) + aadd( txt_, ' ' ) RETURN CreateTarget( cFile, txt_ ) diff --git a/harbour/contrib/hbqt/generator/qt45.qtp b/harbour/contrib/hbqt/generator/qt45.qtp index ce96d1e874..20dc3a5dc7 100644 --- a/harbour/contrib/hbqt/generator/qt45.qtp +++ b/harbour/contrib/hbqt/generator/qt45.qtp @@ -14,6 +14,7 @@ QAbstractButton.qth QAbstractItemModel.qth QAbstractItemView.qth +QAbstractListModel.qth QAbstractPrintDialog.qth QAbstractScrollArea.qth QAbstractSlider.qth @@ -73,6 +74,7 @@ QLCDNumber.qth QLine.qth QLinearGradient.qth QLineEdit.qth +QList.qth QListView.qth QListWidget.qth QListWidgetItem.qth @@ -118,6 +120,9 @@ QStandardItem.qth QStandardItemModel.qth QStatusBar.qth +QStringList.qth +QStringListModel.qth + QStyle.qth QStyledItemDelegate.qth diff --git a/harbour/contrib/hbqt/hbqt.h b/harbour/contrib/hbqt/hbqt.h index 1b9afe0080..7ba39b1c68 100644 --- a/harbour/contrib/hbqt/hbqt.h +++ b/harbour/contrib/hbqt/hbqt.h @@ -307,6 +307,9 @@ #define hbqt_par_QTextObject( n ) ( ( QTextObject* ) hb_parptr( n ) ) #define hbqt_par_QModelIndexList( n ) ( ( QModelIndexList* ) hb_parptr( n ) ) #define hbqt_par_QDirModel( n ) ( ( QDirModel* ) hb_parptr( n ) ) +#define hbqt_par_QList( n ) ( ( QList* ) hb_parptr( n ) ) +#define hbqt_par_QStringListModel( n ) ( ( QStringListModel* ) hb_parptr( n ) ) +#define hbqt_par_QAbstractListModel( n ) ( ( QAbstractListModel* ) hb_parptr( n ) ) #define hbqt_par_QString( n ) ( ( QString ) hb_parc( n ) ) #define hbqt_par_QRgb( n ) ( hb_parnint( n ) ) diff --git a/harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp b/harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp index 1023010007..6b17b1b6ea 100644 --- a/harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_qabstractitemmodel.cpp @@ -103,7 +103,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_CANFETCHMORE ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_COLUMNCOUNT ) { - hb_retni( hbqt_par_QAbstractItemModel( 1 )->columnCount( *hbqt_par_QModelIndex( 2 ) ) ); + hb_retni( hbqt_par_QAbstractItemModel( 1 )->columnCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); } /* @@ -143,7 +143,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_FLAGS ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_HASCHILDREN ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->hasChildren( *hbqt_par_QModelIndex( 2 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->hasChildren( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); } /* @@ -151,7 +151,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_HASCHILDREN ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_HASINDEX ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->hasIndex( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QModelIndex( 4 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->hasIndex( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); } /* @@ -167,7 +167,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_HEADERDATA ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INDEX ) { - hb_retptr( new QModelIndex( hbqt_par_QAbstractItemModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QModelIndex( 4 ) ) ) ); + hb_retptr( new QModelIndex( hbqt_par_QAbstractItemModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ) ); } /* @@ -175,7 +175,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_INDEX ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTCOLUMN ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertColumn( hb_parni( 2 ), *hbqt_par_QModelIndex( 3 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertColumn( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); } /* @@ -183,7 +183,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTCOLUMN ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTCOLUMNS ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertColumns( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QModelIndex( 4 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertColumns( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); } /* @@ -191,7 +191,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTCOLUMNS ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTROW ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertRow( hb_parni( 2 ), *hbqt_par_QModelIndex( 3 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertRow( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); } /* @@ -199,7 +199,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTROW ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_INSERTROWS ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertRows( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QModelIndex( 4 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->insertRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); } /* @@ -231,7 +231,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_PARENT ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVECOLUMN ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeColumn( hb_parni( 2 ), *hbqt_par_QModelIndex( 3 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeColumn( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); } /* @@ -239,7 +239,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVECOLUMN ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVECOLUMNS ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeColumns( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QModelIndex( 4 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeColumns( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); } /* @@ -247,7 +247,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVECOLUMNS ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVEROW ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeRow( hb_parni( 2 ), *hbqt_par_QModelIndex( 3 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeRow( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); } /* @@ -255,7 +255,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVEROW ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVEROWS ) { - hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeRows( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QModelIndex( 4 ) ) ); + hb_retl( hbqt_par_QAbstractItemModel( 1 )->removeRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); } /* @@ -263,7 +263,7 @@ HB_FUNC( QT_QABSTRACTITEMMODEL_REMOVEROWS ) */ HB_FUNC( QT_QABSTRACTITEMMODEL_ROWCOUNT ) { - hb_retni( hbqt_par_QAbstractItemModel( 1 )->rowCount( *hbqt_par_QModelIndex( 2 ) ) ); + hb_retni( hbqt_par_QAbstractItemModel( 1 )->rowCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qabstractlistmodel.cpp b/harbour/contrib/hbqt/hbqt_qabstractlistmodel.cpp new file mode 100644 index 0000000000..6bed078578 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_qabstractlistmodel.cpp @@ -0,0 +1,87 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * 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 + + +/* + * QAbstractListModel ( QObject * parent = 0 ) + * ~QAbstractListModel () + */ +HB_FUNC( QT_QABSTRACTLISTMODEL ) +{ + //hb_retptr( ( QAbstractListModel* ) new QAbstractListModel() ); +} + +/* + * virtual QModelIndex index ( int row, int column = 0, const QModelIndex & parent = QModelIndex() ) const + */ +HB_FUNC( QT_QABSTRACTLISTMODEL_INDEX ) +{ + hb_retptr( new QModelIndex( hbqt_par_QAbstractListModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ) ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/hbqt_qcombobox.cpp b/harbour/contrib/hbqt/hbqt_qcombobox.cpp index b3261e6de6..5fb78ae48c 100644 --- a/harbour/contrib/hbqt/hbqt_qcombobox.cpp +++ b/harbour/contrib/hbqt/hbqt_qcombobox.cpp @@ -77,7 +77,7 @@ HB_FUNC( QT_QCOMBOBOX ) */ HB_FUNC( QT_QCOMBOBOX_ADDITEM ) { - hbqt_par_QComboBox( 1 )->addItem( hbqt_par_QString( 2 ), *hbqt_par_QVariant( 3 ) ); + hbqt_par_QComboBox( 1 )->addItem( hbqt_par_QString( 2 ), ( HB_ISNIL( 3 ) ? QVariant() : *hbqt_par_QVariant( 3 ) ) ); } /* @@ -85,7 +85,7 @@ HB_FUNC( QT_QCOMBOBOX_ADDITEM ) */ HB_FUNC( QT_QCOMBOBOX_ADDITEM_1 ) { - hbqt_par_QComboBox( 1 )->addItem( QIcon( hbqt_par_QString( 2 ) ), hbqt_par_QString( 3 ), *hbqt_par_QVariant( 4 ) ); + hbqt_par_QComboBox( 1 )->addItem( QIcon( hbqt_par_QString( 2 ) ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QVariant() : *hbqt_par_QVariant( 4 ) ) ); } /* @@ -181,7 +181,7 @@ HB_FUNC( QT_QCOMBOBOX_ICONSIZE ) */ HB_FUNC( QT_QCOMBOBOX_INSERTITEM ) { - hbqt_par_QComboBox( 1 )->insertItem( hb_parni( 2 ), hbqt_par_QString( 3 ), *hbqt_par_QVariant( 4 ) ); + hbqt_par_QComboBox( 1 )->insertItem( hb_parni( 2 ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QVariant() : *hbqt_par_QVariant( 4 ) ) ); } /* @@ -189,7 +189,7 @@ HB_FUNC( QT_QCOMBOBOX_INSERTITEM ) */ HB_FUNC( QT_QCOMBOBOX_INSERTITEM_1 ) { - hbqt_par_QComboBox( 1 )->insertItem( hb_parni( 2 ), QIcon( hbqt_par_QString( 3 ) ), hbqt_par_QString( 4 ), *hbqt_par_QVariant( 5 ) ); + hbqt_par_QComboBox( 1 )->insertItem( hb_parni( 2 ), QIcon( hbqt_par_QString( 3 ) ), hbqt_par_QString( 4 ), ( HB_ISNIL( 5 ) ? QVariant() : *hbqt_par_QVariant( 5 ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qdirmodel.cpp b/harbour/contrib/hbqt/hbqt_qdirmodel.cpp index f05dedbb1a..c950c689f4 100644 --- a/harbour/contrib/hbqt/hbqt_qdirmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_qdirmodel.cpp @@ -78,7 +78,7 @@ HB_FUNC( QT_QDIRMODEL ) */ HB_FUNC( QT_QDIRMODEL_COLUMNCOUNT ) { - hb_retni( hbqt_par_QDirModel( 1 )->columnCount( *hbqt_par_QModelIndex( 2 ) ) ); + hb_retni( hbqt_par_QDirModel( 1 )->columnCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); } /* @@ -150,7 +150,7 @@ HB_FUNC( QT_QDIRMODEL_FLAGS ) */ HB_FUNC( QT_QDIRMODEL_HASCHILDREN ) { - hb_retl( hbqt_par_QDirModel( 1 )->hasChildren( *hbqt_par_QModelIndex( 2 ) ) ); + hb_retl( hbqt_par_QDirModel( 1 )->hasChildren( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); } /* @@ -174,7 +174,7 @@ HB_FUNC( QT_QDIRMODEL_ICONPROVIDER ) */ HB_FUNC( QT_QDIRMODEL_INDEX ) { - hb_retptr( new QModelIndex( hbqt_par_QDirModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), *hbqt_par_QModelIndex( 4 ) ) ) ); + hb_retptr( new QModelIndex( hbqt_par_QDirModel( 1 )->index( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ) ); } /* @@ -278,7 +278,7 @@ HB_FUNC( QT_QDIRMODEL_RMDIR ) */ HB_FUNC( QT_QDIRMODEL_ROWCOUNT ) { - hb_retni( hbqt_par_QDirModel( 1 )->rowCount( *hbqt_par_QModelIndex( 2 ) ) ); + hb_retni( hbqt_par_QDirModel( 1 )->rowCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); } /* @@ -374,7 +374,7 @@ HB_FUNC( QT_QDIRMODEL_SUPPORTEDDROPACTIONS ) */ HB_FUNC( QT_QDIRMODEL_REFRESH ) { - hbqt_par_QDirModel( 1 )->refresh( *hbqt_par_QModelIndex( 2 ) ); + hbqt_par_QDirModel( 1 )->refresh( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ); } diff --git a/harbour/contrib/hbqt/hbqt_qftp.cpp b/harbour/contrib/hbqt/hbqt_qftp.cpp index abd755328a..8ca283afaf 100644 --- a/harbour/contrib/hbqt/hbqt_qftp.cpp +++ b/harbour/contrib/hbqt/hbqt_qftp.cpp @@ -181,7 +181,7 @@ HB_FUNC( QT_QFTP_LIST ) */ HB_FUNC( QT_QFTP_LOGIN ) { - hb_retni( hbqt_par_QFtp( 1 )->login( hbqt_par_QString( 2 ) ) ); + hb_retni( hbqt_par_QFtp( 1 )->login( hbqt_par_QString( 2 ), hbqt_par_QString( 3 ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qhttp.cpp b/harbour/contrib/hbqt/hbqt_qhttp.cpp index d9daa7b7c7..816ff84a07 100644 --- a/harbour/contrib/hbqt/hbqt_qhttp.cpp +++ b/harbour/contrib/hbqt/hbqt_qhttp.cpp @@ -247,7 +247,7 @@ HB_FUNC( QT_QHTTP_SETHOST_1 ) */ HB_FUNC( QT_QHTTP_SETPROXY ) { - hb_retni( hbqt_par_QHttp( 1 )->setProxy( hbqt_par_QString( 2 ), hb_parni( 3 ), hbqt_par_QString( 4 ) ) ); + hb_retni( hbqt_par_QHttp( 1 )->setProxy( hbqt_par_QString( 2 ), hb_parni( 3 ), hbqt_par_QString( 4 ), hbqt_par_QString( 5 ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qicon.cpp b/harbour/contrib/hbqt/hbqt_qicon.cpp index 4492a5bf75..3cbd8bd102 100644 --- a/harbour/contrib/hbqt/hbqt_qicon.cpp +++ b/harbour/contrib/hbqt/hbqt_qicon.cpp @@ -99,7 +99,7 @@ HB_FUNC( QT_QICON_ACTUALSIZE ) */ HB_FUNC( QT_QICON_ADDFILE ) { - hbqt_par_QIcon( 1 )->addFile( hbqt_par_QString( 2 ), *hbqt_par_QSize( 3 ) ); + hbqt_par_QIcon( 1 )->addFile( hbqt_par_QString( 2 ), ( HB_ISNIL( 3 ) ? QSize() : *hbqt_par_QSize( 3 ) ), ( HB_ISNUM( 4 ) ? ( QIcon::Mode ) hb_parni( 4 ) : ( QIcon::Mode ) QIcon::Normal ), ( HB_ISNUM( 5 ) ? ( QIcon::State ) hb_parni( 5 ) : ( QIcon::State ) QIcon::Off ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qimage.cpp b/harbour/contrib/hbqt/hbqt_qimage.cpp index 5fe1282951..27770fbc19 100644 --- a/harbour/contrib/hbqt/hbqt_qimage.cpp +++ b/harbour/contrib/hbqt/hbqt_qimage.cpp @@ -162,7 +162,7 @@ HB_FUNC( QT_QIMAGE_CONVERTTOFORMAT ) */ HB_FUNC( QT_QIMAGE_COPY ) { - hb_retptr( new QImage( hbqt_par_QImage( 1 )->copy( *hbqt_par_QRect( 2 ) ) ) ); + hb_retptr( new QImage( hbqt_par_QImage( 1 )->copy( ( HB_ISNIL( 2 ) ? QRect() : *hbqt_par_QRect( 2 ) ) ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qlist.cpp b/harbour/contrib/hbqt/hbqt_qlist.cpp new file mode 100644 index 0000000000..39418f9bd9 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_qlist.cpp @@ -0,0 +1,418 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * 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 +/*----------------------------------------------------------------------*/ + +/* + * Constructed[ 40/49 [ 81.63% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * void append ( const QList & value ) + * iterator begin () + * iterator erase ( iterator pos ) + * iterator erase ( iterator begin, iterator end ) + * iterator insert ( iterator before, const T & value ) + * QList mid ( int pos, int length = -1 ) const + * QSet toSet () const + * std::list toStdList () const + * QVector toVector () const + */ + + +#include + + +/* + * QList () + * QList ( const QList & other ) + * ~QList () + */ +HB_FUNC( QT_QLIST ) +{ + QList* list = NULL; + hb_retptr( ( QList* ) list ); +} + +/* + * void append ( const T & value ) + */ +HB_FUNC( QT_QLIST_APPEND ) +{ + hbqt_par_QList( 1 )->append( hb_param( 2, HB_IT_ANY ) ); +} + +/* + * const T & at ( int i ) const + */ +HB_FUNC( QT_QLIST_AT ) +{ + hb_retptr( hbqt_par_QList( 1 )->at( hb_parni( 2 ) ) ); +} + +/* + * T & back () + */ +HB_FUNC( QT_QLIST_BACK ) +{ + hb_retptr( hbqt_par_QList( 1 )->back() ); +} + +/* + * const T & back () const + */ +HB_FUNC( QT_QLIST_BACK_1 ) +{ + hb_retptr( hbqt_par_QList( 1 )->back() ); +} + +/* + * void clear () + */ +HB_FUNC( QT_QLIST_CLEAR ) +{ + hbqt_par_QList( 1 )->clear(); +} + +/* + * int count ( const T & value ) const + */ +HB_FUNC( QT_QLIST_COUNT ) +{ + hb_retni( hbqt_par_QList( 1 )->count( hb_param( 2, HB_IT_ANY ) ) ); +} + +/* + * int count () const + */ +HB_FUNC( QT_QLIST_COUNT_1 ) +{ + hb_retni( hbqt_par_QList( 1 )->count() ); +} + +/* + * bool empty () const + */ +HB_FUNC( QT_QLIST_EMPTY ) +{ + hb_retl( hbqt_par_QList( 1 )->empty() ); +} + +/* + * bool endsWith ( const T & value ) const + */ +HB_FUNC( QT_QLIST_ENDSWITH ) +{ + hb_retl( hbqt_par_QList( 1 )->endsWith( hb_param( 2, HB_IT_ANY ) ) ); +} + +/* + * T & first () + */ +HB_FUNC( QT_QLIST_FIRST ) +{ + hb_retptr( hbqt_par_QList( 1 )->first() ); +} + +/* + * const T & first () const + */ +HB_FUNC( QT_QLIST_FIRST_1 ) +{ + hb_retptr( hbqt_par_QList( 1 )->first() ); +} + +/* + * T & front () + */ +HB_FUNC( QT_QLIST_FRONT ) +{ + hb_retptr( hbqt_par_QList( 1 )->front() ); +} + +/* + * const T & front () const + */ +HB_FUNC( QT_QLIST_FRONT_1 ) +{ + hb_retptr( hbqt_par_QList( 1 )->front() ); +} + +/* + * int indexOf ( const T & value, int from = 0 ) const + */ +HB_FUNC( QT_QLIST_INDEXOF ) +{ + hb_retni( hbqt_par_QList( 1 )->indexOf( hb_param( 2, HB_IT_ANY ), hb_parni( 3 ) ) ); +} + +/* + * void insert ( int i, const T & value ) + */ +HB_FUNC( QT_QLIST_INSERT ) +{ + hbqt_par_QList( 1 )->insert( hb_parni( 2 ), hb_param( 3, HB_IT_ANY ) ); +} + +/* + * bool isEmpty () const + */ +HB_FUNC( QT_QLIST_ISEMPTY ) +{ + hb_retl( hbqt_par_QList( 1 )->isEmpty() ); +} + +/* + * T & last () + */ +HB_FUNC( QT_QLIST_LAST ) +{ + hb_retptr( hbqt_par_QList( 1 )->last() ); +} + +/* + * const T & last () const + */ +HB_FUNC( QT_QLIST_LAST_1 ) +{ + hb_retptr( hbqt_par_QList( 1 )->last() ); +} + +/* + * int lastIndexOf ( const T & value, int from = -1 ) const + */ +HB_FUNC( QT_QLIST_LASTINDEXOF ) +{ + hb_retni( hbqt_par_QList( 1 )->lastIndexOf( hb_param( 2, HB_IT_ANY ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : -1 ) ) ); +} + +/* + * int length () const + */ +HB_FUNC( QT_QLIST_LENGTH ) +{ + hb_retni( hbqt_par_QList( 1 )->length() ); +} + +/* + * void move ( int from, int to ) + */ +HB_FUNC( QT_QLIST_MOVE ) +{ + hbqt_par_QList( 1 )->move( hb_parni( 2 ), hb_parni( 3 ) ); +} + +/* + * void pop_back () + */ +HB_FUNC( QT_QLIST_POP_BACK ) +{ + hbqt_par_QList( 1 )->pop_back(); +} + +/* + * void pop_front () + */ +HB_FUNC( QT_QLIST_POP_FRONT ) +{ + hbqt_par_QList( 1 )->pop_front(); +} + +/* + * void prepend ( const T & value ) + */ +HB_FUNC( QT_QLIST_PREPEND ) +{ + hbqt_par_QList( 1 )->prepend( hb_param( 2, HB_IT_ANY ) ); +} + +/* + * void push_back ( const T & value ) + */ +HB_FUNC( QT_QLIST_PUSH_BACK ) +{ + hbqt_par_QList( 1 )->push_back( hb_param( 2, HB_IT_ANY ) ); +} + +/* + * void push_front ( const T & value ) + */ +HB_FUNC( QT_QLIST_PUSH_FRONT ) +{ + hbqt_par_QList( 1 )->push_front( hb_param( 2, HB_IT_ANY ) ); +} + +/* + * int removeAll ( const T & value ) + */ +HB_FUNC( QT_QLIST_REMOVEALL ) +{ + hb_retni( hbqt_par_QList( 1 )->removeAll( hb_param( 2, HB_IT_ANY ) ) ); +} + +/* + * void removeAt ( int i ) + */ +HB_FUNC( QT_QLIST_REMOVEAT ) +{ + hbqt_par_QList( 1 )->removeAt( hb_parni( 2 ) ); +} + +/* + * void removeFirst () + */ +HB_FUNC( QT_QLIST_REMOVEFIRST ) +{ + hbqt_par_QList( 1 )->removeFirst(); +} + +/* + * void removeLast () + */ +HB_FUNC( QT_QLIST_REMOVELAST ) +{ + hbqt_par_QList( 1 )->removeLast(); +} + +/* + * bool removeOne ( const T & value ) + */ +HB_FUNC( QT_QLIST_REMOVEONE ) +{ + hb_retl( hbqt_par_QList( 1 )->removeOne( hb_param( 2, HB_IT_ANY ) ) ); +} + +/* + * void replace ( int i, const T & value ) + */ +HB_FUNC( QT_QLIST_REPLACE ) +{ + hbqt_par_QList( 1 )->replace( hb_parni( 2 ), hb_param( 3, HB_IT_ANY ) ); +} + +/* + * int size () const + */ +HB_FUNC( QT_QLIST_SIZE ) +{ + hb_retni( hbqt_par_QList( 1 )->size() ); +} + +/* + * bool startsWith ( const T & value ) const + */ +HB_FUNC( QT_QLIST_STARTSWITH ) +{ + hb_retl( hbqt_par_QList( 1 )->startsWith( hb_param( 2, HB_IT_ANY ) ) ); +} + +/* + * void swap ( int i, int j ) + */ +HB_FUNC( QT_QLIST_SWAP ) +{ + hbqt_par_QList( 1 )->swap( hb_parni( 2 ), hb_parni( 3 ) ); +} + +/* + * T takeAt ( int i ) + */ +HB_FUNC( QT_QLIST_TAKEAT ) +{ + hb_retptr( hbqt_par_QList( 1 )->takeAt( hb_parni( 2 ) ) ); +} + +/* + * T takeFirst () + */ +HB_FUNC( QT_QLIST_TAKEFIRST ) +{ + hb_retptr( hbqt_par_QList( 1 )->takeFirst() ); +} + +/* + * T takeLast () + */ +HB_FUNC( QT_QLIST_TAKELAST ) +{ + hb_retptr( hbqt_par_QList( 1 )->takeLast() ); +} + +/* + * T value ( int i ) const + */ +HB_FUNC( QT_QLIST_VALUE ) +{ + hb_retptr( hbqt_par_QList( 1 )->value( hb_parni( 2 ) ) ); +} + +/* + * T value ( int i, const T & defaultValue ) const + */ +HB_FUNC( QT_QLIST_VALUE_1 ) +{ + hb_retptr( hbqt_par_QList( 1 )->value( hb_parni( 2 ), hb_param( 3, HB_IT_ANY ) ) ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/hbqt_qpainter.cpp b/harbour/contrib/hbqt/hbqt_qpainter.cpp index f45df5ca14..a8c99f0ef5 100644 --- a/harbour/contrib/hbqt/hbqt_qpainter.cpp +++ b/harbour/contrib/hbqt/hbqt_qpainter.cpp @@ -146,7 +146,7 @@ HB_FUNC( QT_QPAINTER_BOUNDINGRECT_2 ) */ HB_FUNC( QT_QPAINTER_BOUNDINGRECT_3 ) { - hb_retptr( new QRectF( hbqt_par_QPainter( 1 )->boundingRect( *hbqt_par_QRectF( 2 ), hbqt_par_QString( 3 ), *hbqt_par_QTextOption( 4 ) ) ) ); + hb_retptr( new QRectF( hbqt_par_QPainter( 1 )->boundingRect( *hbqt_par_QRectF( 2 ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QTextOption() : *hbqt_par_QTextOption( 4 ) ) ) ) ); } /* @@ -874,7 +874,7 @@ HB_FUNC( QT_QPAINTER_DRAWTEXT_5 ) */ HB_FUNC( QT_QPAINTER_DRAWTEXT_6 ) { - hbqt_par_QPainter( 1 )->drawText( *hbqt_par_QRectF( 2 ), hbqt_par_QString( 3 ), *hbqt_par_QTextOption( 4 ) ); + hbqt_par_QPainter( 1 )->drawText( *hbqt_par_QRectF( 2 ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QTextOption() : *hbqt_par_QTextOption( 4 ) ) ); } /* @@ -882,7 +882,7 @@ HB_FUNC( QT_QPAINTER_DRAWTEXT_6 ) */ HB_FUNC( QT_QPAINTER_DRAWTILEDPIXMAP ) { - hbqt_par_QPainter( 1 )->drawTiledPixmap( *hbqt_par_QRectF( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QPointF( 4 ) ); + hbqt_par_QPainter( 1 )->drawTiledPixmap( *hbqt_par_QRectF( 2 ), *hbqt_par_QPixmap( 3 ), ( HB_ISNIL( 4 ) ? QPointF() : *hbqt_par_QPointF( 4 ) ) ); } /* @@ -890,7 +890,7 @@ HB_FUNC( QT_QPAINTER_DRAWTILEDPIXMAP ) */ HB_FUNC( QT_QPAINTER_DRAWTILEDPIXMAP_1 ) { - hbqt_par_QPainter( 1 )->drawTiledPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ), *hbqt_par_QPoint( 4 ) ); + hbqt_par_QPainter( 1 )->drawTiledPixmap( *hbqt_par_QRect( 2 ), *hbqt_par_QPixmap( 3 ), ( HB_ISNIL( 4 ) ? QPoint() : *hbqt_par_QPoint( 4 ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qpixmap.cpp b/harbour/contrib/hbqt/hbqt_qpixmap.cpp index d768ffb34b..6478788c6e 100644 --- a/harbour/contrib/hbqt/hbqt_qpixmap.cpp +++ b/harbour/contrib/hbqt/hbqt_qpixmap.cpp @@ -98,7 +98,7 @@ HB_FUNC( QT_QPIXMAP_CACHEKEY ) */ HB_FUNC( QT_QPIXMAP_COPY ) { - hb_retptr( new QPixmap( hbqt_par_QPixmap( 1 )->copy( *hbqt_par_QRect( 2 ) ) ) ); + hb_retptr( new QPixmap( hbqt_par_QPixmap( 1 )->copy( ( HB_ISNIL( 2 ) ? QRect() : *hbqt_par_QRect( 2 ) ) ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp b/harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp index 73ca26606c..787a21b25f 100644 --- a/harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_qstandarditemmodel.cpp @@ -125,7 +125,7 @@ HB_FUNC( QT_QSTANDARDITEMMODEL_INDEXFROMITEM ) */ HB_FUNC( QT_QSTANDARDITEMMODEL_INSERTCOLUMN ) { - hb_retl( hbqt_par_QStandardItemModel( 1 )->insertColumn( hb_parni( 2 ), *hbqt_par_QModelIndex( 3 ) ) ); + hb_retl( hbqt_par_QStandardItemModel( 1 )->insertColumn( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); } /* @@ -133,7 +133,7 @@ HB_FUNC( QT_QSTANDARDITEMMODEL_INSERTCOLUMN ) */ HB_FUNC( QT_QSTANDARDITEMMODEL_INSERTROW ) { - hb_retl( hbqt_par_QStandardItemModel( 1 )->insertRow( hb_parni( 2 ), *hbqt_par_QModelIndex( 3 ) ) ); + hb_retl( hbqt_par_QStandardItemModel( 1 )->insertRow( hb_parni( 2 ), ( HB_ISNIL( 3 ) ? QModelIndex() : *hbqt_par_QModelIndex( 3 ) ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qstringlist.cpp b/harbour/contrib/hbqt/hbqt_qstringlist.cpp new file mode 100644 index 0000000000..9f8659ac31 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_qstringlist.cpp @@ -0,0 +1,373 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * 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 +/*----------------------------------------------------------------------*/ + +/* + * Constructed[ 35/39 [ 89.74% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * QList mid ( int pos, int length = -1 ) const + * QSet toSet () const + * std::list toStdList () const + * QVector toVector () const + */ + + +#include + + +/* + * QStringList () + * QStringList ( const QString & str ) + * QStringList ( const QStringList & other ) + * QStringList ( const QList & other ) + */ +HB_FUNC( QT_QSTRINGLIST ) +{ + hb_retptr( ( QStringList* ) new QStringList() ); +} + +/* + * void append ( const QString & value ) + */ +HB_FUNC( QT_QSTRINGLIST_APPEND ) +{ + hbqt_par_QStringList( 1 )->append( hbqt_par_QString( 2 ) ); +} + +/* + * QStringList filter ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const + */ +HB_FUNC( QT_QSTRINGLIST_FILTER ) +{ + hb_retptr( new QStringList( hbqt_par_QStringList( 1 )->filter( hbqt_par_QString( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::CaseSensitivity ) hb_parni( 3 ) : ( Qt::CaseSensitivity ) Qt::CaseSensitive ) ) ) ); +} + +/* + * QStringList filter ( const QRegExp & rx ) const + */ +HB_FUNC( QT_QSTRINGLIST_FILTER_1 ) +{ + hb_retptr( new QStringList( hbqt_par_QStringList( 1 )->filter( *hbqt_par_QRegExp( 2 ) ) ) ); +} + +/* + * int indexOf ( const QString & value, int from = 0 ) const + */ +HB_FUNC( QT_QSTRINGLIST_INDEXOF ) +{ + hb_retni( hbqt_par_QStringList( 1 )->indexOf( hbqt_par_QString( 2 ), hb_parni( 3 ) ) ); +} + +/* + * int indexOf ( const QRegExp & rx, int from = 0 ) const + */ +HB_FUNC( QT_QSTRINGLIST_INDEXOF_1 ) +{ + hb_retni( hbqt_par_QStringList( 1 )->indexOf( *hbqt_par_QRegExp( 2 ), hb_parni( 3 ) ) ); +} + +/* + * int indexOf ( QRegExp & rx, int from = 0 ) const + */ +HB_FUNC( QT_QSTRINGLIST_INDEXOF_2 ) +{ + hb_retni( hbqt_par_QStringList( 1 )->indexOf( *hbqt_par_QRegExp( 2 ), hb_parni( 3 ) ) ); +} + +/* + * QString join ( const QString & separator ) const + */ +HB_FUNC( QT_QSTRINGLIST_JOIN ) +{ + hb_retc( hbqt_par_QStringList( 1 )->join( hbqt_par_QString( 2 ) ).toLatin1().data() ); +} + +/* + * int lastIndexOf ( const QRegExp & rx, int from = -1 ) const + */ +HB_FUNC( QT_QSTRINGLIST_LASTINDEXOF ) +{ + hb_retni( hbqt_par_QStringList( 1 )->lastIndexOf( *hbqt_par_QRegExp( 2 ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : -1 ) ) ); +} + +/* + * int lastIndexOf ( const QString & value, int from = -1 ) const + */ +HB_FUNC( QT_QSTRINGLIST_LASTINDEXOF_1 ) +{ + hb_retni( hbqt_par_QStringList( 1 )->lastIndexOf( hbqt_par_QString( 2 ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : -1 ) ) ); +} + +/* + * int lastIndexOf ( QRegExp & rx, int from = -1 ) const + */ +HB_FUNC( QT_QSTRINGLIST_LASTINDEXOF_2 ) +{ + hb_retni( hbqt_par_QStringList( 1 )->lastIndexOf( *hbqt_par_QRegExp( 2 ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : -1 ) ) ); +} + +/* + * int removeDuplicates () + */ +HB_FUNC( QT_QSTRINGLIST_REMOVEDUPLICATES ) +{ + hb_retni( hbqt_par_QStringList( 1 )->removeDuplicates() ); +} + +/* + * void sort () + */ +HB_FUNC( QT_QSTRINGLIST_SORT ) +{ + hbqt_par_QStringList( 1 )->sort(); +} + +/* + * QString & at ( int i ) const + */ +HB_FUNC( QT_QSTRINGLIST_AT ) +{ + hb_retc( hbqt_par_QStringList( 1 )->at( hb_parni( 2 ) ).toLatin1().data() ); +} + +/* + * QString & back () + */ +HB_FUNC( QT_QSTRINGLIST_BACK ) +{ + hb_retc( hbqt_par_QStringList( 1 )->back().toLatin1().data() ); +} + +/* + * int count ( const QString & value ) const + */ +HB_FUNC( QT_QSTRINGLIST_COUNT ) +{ + hb_retni( hbqt_par_QStringList( 1 )->count( hbqt_par_QString( 2 ) ) ); +} + +/* + * bool endsWith ( const QString & value ) const + */ +HB_FUNC( QT_QSTRINGLIST_ENDSWITH ) +{ + hb_retl( hbqt_par_QStringList( 1 )->endsWith( hbqt_par_QString( 2 ) ) ); +} + +/* + * QString & first () + */ +HB_FUNC( QT_QSTRINGLIST_FIRST ) +{ + hb_retc( hbqt_par_QStringList( 1 )->first().toLatin1().data() ); +} + +/* + * const QString & first () const + */ +HB_FUNC( QT_QSTRINGLIST_FIRST_1 ) +{ + hb_retc( hbqt_par_QStringList( 1 )->first().toLatin1().data() ); +} + +/* + * QString & front () + */ +HB_FUNC( QT_QSTRINGLIST_FRONT ) +{ + hb_retc( hbqt_par_QStringList( 1 )->front().toLatin1().data() ); +} + +/* + * const QString & front () const + */ +HB_FUNC( QT_QSTRINGLIST_FRONT_1 ) +{ + hb_retc( hbqt_par_QStringList( 1 )->front().toLatin1().data() ); +} + +/* + * void insert ( int i, const QString & value ) + */ +HB_FUNC( QT_QSTRINGLIST_INSERT ) +{ + hbqt_par_QStringList( 1 )->insert( hb_parni( 2 ), hbqt_par_QString( 3 ) ); +} + +/* + * QString & last () + */ +HB_FUNC( QT_QSTRINGLIST_LAST ) +{ + hb_retc( hbqt_par_QStringList( 1 )->last().toLatin1().data() ); +} + +/* + * const QString & last () const + */ +HB_FUNC( QT_QSTRINGLIST_LAST_1 ) +{ + hb_retc( hbqt_par_QStringList( 1 )->last().toLatin1().data() ); +} + +/* + * void prepend ( const QString & value ) + */ +HB_FUNC( QT_QSTRINGLIST_PREPEND ) +{ + hbqt_par_QStringList( 1 )->prepend( hbqt_par_QString( 2 ) ); +} + +/* + * void push_back ( const QString & value ) + */ +HB_FUNC( QT_QSTRINGLIST_PUSH_BACK ) +{ + hbqt_par_QStringList( 1 )->push_back( hbqt_par_QString( 2 ) ); +} + +/* + * void push_front ( const QString & value ) + */ +HB_FUNC( QT_QSTRINGLIST_PUSH_FRONT ) +{ + hbqt_par_QStringList( 1 )->push_front( hbqt_par_QString( 2 ) ); +} + +/* + * int removeAll ( const QString & value ) + */ +HB_FUNC( QT_QSTRINGLIST_REMOVEALL ) +{ + hb_retni( hbqt_par_QStringList( 1 )->removeAll( hbqt_par_QString( 2 ) ) ); +} + +/* + * bool removeOne ( const QString & value ) + */ +HB_FUNC( QT_QSTRINGLIST_REMOVEONE ) +{ + hb_retl( hbqt_par_QStringList( 1 )->removeOne( hbqt_par_QString( 2 ) ) ); +} + +/* + * void replace ( int i, const QString & value ) + */ +HB_FUNC( QT_QSTRINGLIST_REPLACE ) +{ + hbqt_par_QStringList( 1 )->replace( hb_parni( 2 ), hbqt_par_QString( 3 ) ); +} + +/* + * bool startsWith ( const QString & value ) const + */ +HB_FUNC( QT_QSTRINGLIST_STARTSWITH ) +{ + hb_retl( hbqt_par_QStringList( 1 )->startsWith( hbqt_par_QString( 2 ) ) ); +} + +/* + * QString takeAt ( int i ) + */ +HB_FUNC( QT_QSTRINGLIST_TAKEAT ) +{ + hb_retc( hbqt_par_QStringList( 1 )->takeAt( hb_parni( 2 ) ).toLatin1().data() ); +} + +/* + * QString takeFirst () + */ +HB_FUNC( QT_QSTRINGLIST_TAKEFIRST ) +{ + hb_retc( hbqt_par_QStringList( 1 )->takeFirst().toLatin1().data() ); +} + +/* + * QString takeLast () + */ +HB_FUNC( QT_QSTRINGLIST_TAKELAST ) +{ + hb_retc( hbqt_par_QStringList( 1 )->takeLast().toLatin1().data() ); +} + +/* + * QString value ( int i ) const + */ +HB_FUNC( QT_QSTRINGLIST_VALUE ) +{ + hb_retc( hbqt_par_QStringList( 1 )->value( hb_parni( 2 ) ).toLatin1().data() ); +} + +/* + * QString value ( int i, const QString & defaultValue ) const + */ +HB_FUNC( QT_QSTRINGLIST_VALUE_1 ) +{ + hb_retc( hbqt_par_QStringList( 1 )->value( hb_parni( 2 ), hbqt_par_QString( 3 ) ).toLatin1().data() ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/hbqt_qstringlistmodel.cpp b/harbour/contrib/hbqt/hbqt_qstringlistmodel.cpp new file mode 100644 index 0000000000..fc76963f38 --- /dev/null +++ b/harbour/contrib/hbqt/hbqt_qstringlistmodel.cpp @@ -0,0 +1,143 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009 Marcos Antonio Gambeta + * Copyright 2009 Pritpal Bedi + * 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 + + +/* + * QStringListModel ( QObject * parent = 0 ) + * QStringListModel ( const QStringList & strings, QObject * parent = 0 ) + */ +HB_FUNC( QT_QSTRINGLISTMODEL ) +{ + hb_retptr( ( QStringListModel* ) new QStringListModel() ); +} + +/* + * virtual QVariant data ( const QModelIndex & index, int role ) const + */ +HB_FUNC( QT_QSTRINGLISTMODEL_DATA ) +{ + hb_retptr( new QVariant( hbqt_par_QStringListModel( 1 )->data( *hbqt_par_QModelIndex( 2 ), hb_parni( 3 ) ) ) ); +} + +/* + * virtual Qt::ItemFlags flags ( const QModelIndex & index ) const + */ +HB_FUNC( QT_QSTRINGLISTMODEL_FLAGS ) +{ + hb_retni( ( Qt::ItemFlags ) hbqt_par_QStringListModel( 1 )->flags( *hbqt_par_QModelIndex( 2 ) ) ); +} + +/* + * virtual bool insertRows ( int row, int count, const QModelIndex & parent = QModelIndex() ) + */ +HB_FUNC( QT_QSTRINGLISTMODEL_INSERTROWS ) +{ + hb_retl( hbqt_par_QStringListModel( 1 )->insertRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); +} + +/* + * virtual bool removeRows ( int row, int count, const QModelIndex & parent = QModelIndex() ) + */ +HB_FUNC( QT_QSTRINGLISTMODEL_REMOVEROWS ) +{ + hb_retl( hbqt_par_QStringListModel( 1 )->removeRows( hb_parni( 2 ), hb_parni( 3 ), ( HB_ISNIL( 4 ) ? QModelIndex() : *hbqt_par_QModelIndex( 4 ) ) ) ); +} + +/* + * virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) const + */ +HB_FUNC( QT_QSTRINGLISTMODEL_ROWCOUNT ) +{ + hb_retni( hbqt_par_QStringListModel( 1 )->rowCount( ( HB_ISNIL( 2 ) ? QModelIndex() : *hbqt_par_QModelIndex( 2 ) ) ) ); +} + +/* + * virtual bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) + */ +HB_FUNC( QT_QSTRINGLISTMODEL_SETDATA ) +{ + hb_retl( hbqt_par_QStringListModel( 1 )->setData( *hbqt_par_QModelIndex( 2 ), *hbqt_par_QVariant( 3 ), ( HB_ISNUM( 4 ) ? hb_parni( 4 ) : Qt::EditRole ) ) ); +} + +/* + * void setStringList ( const QStringList & strings ) + */ +HB_FUNC( QT_QSTRINGLISTMODEL_SETSTRINGLIST ) +{ + hbqt_par_QStringListModel( 1 )->setStringList( *hbqt_par_QStringList( 2 ) ); +} + +/* + * QStringList stringList () const + */ +HB_FUNC( QT_QSTRINGLISTMODEL_STRINGLIST ) +{ + hb_retptr( new QStringList( hbqt_par_QStringListModel( 1 )->stringList() ) ); +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/hbqt_qtextdocument.cpp b/harbour/contrib/hbqt/hbqt_qtextdocument.cpp index 6212c50a24..423f5ffaba 100644 --- a/harbour/contrib/hbqt/hbqt_qtextdocument.cpp +++ b/harbour/contrib/hbqt/hbqt_qtextdocument.cpp @@ -183,7 +183,7 @@ HB_FUNC( QT_QTEXTDOCUMENT_DOCUMENTMARGIN ) */ HB_FUNC( QT_QTEXTDOCUMENT_DRAWCONTENTS ) { - hbqt_par_QTextDocument( 1 )->drawContents( hbqt_par_QPainter( 2 ), *hbqt_par_QRectF( 3 ) ); + hbqt_par_QTextDocument( 1 )->drawContents( hbqt_par_QPainter( 2 ), ( HB_ISNIL( 3 ) ? QRectF() : *hbqt_par_QRectF( 3 ) ) ); } /* @@ -559,7 +559,7 @@ HB_FUNC( QT_QTEXTDOCUMENT_TEXTWIDTH ) */ HB_FUNC( QT_QTEXTDOCUMENT_TOHTML ) { - hb_retc( hbqt_par_QTextDocument( 1 )->toHtml( *hbqt_par_QByteArray( 2 ) ).toLatin1().data() ); + hb_retc( hbqt_par_QTextDocument( 1 )->toHtml( ( HB_ISNIL( 2 ) ? QByteArray() : *hbqt_par_QByteArray( 2 ) ) ).toLatin1().data() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qwebview.cpp b/harbour/contrib/hbqt/hbqt_qwebview.cpp index a959811d3f..a22586eea9 100644 --- a/harbour/contrib/hbqt/hbqt_qwebview.cpp +++ b/harbour/contrib/hbqt/hbqt_qwebview.cpp @@ -118,7 +118,7 @@ HB_FUNC( QT_QWEBVIEW_LOAD ) */ HB_FUNC( QT_QWEBVIEW_LOAD_1 ) { - hbqt_par_QWebView( 1 )->load( *hbqt_par_QNetworkRequest( 2 ), ( HB_ISNUM( 3 ) ? ( QNetworkAccessManager::Operation ) hb_parni( 3 ) : ( QNetworkAccessManager::Operation ) QNetworkAccessManager::GetOperation ), *hbqt_par_QByteArray( 4 ) ); + hbqt_par_QWebView( 1 )->load( *hbqt_par_QNetworkRequest( 2 ), ( HB_ISNUM( 3 ) ? ( QNetworkAccessManager::Operation ) hb_parni( 3 ) : ( QNetworkAccessManager::Operation ) QNetworkAccessManager::GetOperation ), ( HB_ISNIL( 4 ) ? QByteArray() : *hbqt_par_QByteArray( 4 ) ) ); } /* @@ -150,7 +150,7 @@ HB_FUNC( QT_QWEBVIEW_SELECTEDTEXT ) */ HB_FUNC( QT_QWEBVIEW_SETCONTENT ) { - hbqt_par_QWebView( 1 )->setContent( *hbqt_par_QByteArray( 2 ), hbqt_par_QString( 3 ) ); + hbqt_par_QWebView( 1 )->setContent( *hbqt_par_QByteArray( 2 ), hbqt_par_QString( 3 ), ( HB_ISNIL( 4 ) ? QUrl() : *hbqt_par_QUrl( 4 ) ) ); } /* @@ -158,7 +158,7 @@ HB_FUNC( QT_QWEBVIEW_SETCONTENT ) */ HB_FUNC( QT_QWEBVIEW_SETHTML ) { - hbqt_par_QWebView( 1 )->setHtml( hbqt_par_QString( 2 ), *hbqt_par_QUrl( 3 ) ); + hbqt_par_QWebView( 1 )->setHtml( hbqt_par_QString( 2 ), ( HB_ISNIL( 3 ) ? QUrl() : *hbqt_par_QUrl( 3 ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qwidget.cpp b/harbour/contrib/hbqt/hbqt_qwidget.cpp index 0bfd7ff224..b92173f36e 100644 --- a/harbour/contrib/hbqt/hbqt_qwidget.cpp +++ b/harbour/contrib/hbqt/hbqt_qwidget.cpp @@ -60,7 +60,7 @@ /*----------------------------------------------------------------------*/ /* - * Constructed[ 213/216 [ 98.61% ] ] + * Constructed[ 211/214 [ 98.60% ] ] * * *** Unconvered Prototypes *** * ----------------------------- @@ -791,22 +791,6 @@ HB_FUNC( QT_QWIDGET_REMOVEACTION ) hbqt_par_QWidget( 1 )->removeAction( hbqt_par_QAction( 2 ) ); } -/* - * void render ( QPaintDevice * target, const QPoint & targetOffset = QPoint(), const QRegion & sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags( DrawWindowBackground | DrawChildren ) ) - */ -HB_FUNC( QT_QWIDGET_RENDER ) -{ - hbqt_par_QWidget( 1 )->render( hbqt_par_QPaintDevice( 2 ), *hbqt_par_QPoint( 3 ) ); -} - -/* - * void render ( QPainter * painter, const QPoint & targetOffset = QPoint(), const QRegion & sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags( DrawWindowBackground | DrawChildren ) ) - */ -HB_FUNC( QT_QWIDGET_RENDER_1 ) -{ - hbqt_par_QWidget( 1 )->render( hbqt_par_QPainter( 2 ), *hbqt_par_QPoint( 3 ) ); -} - /* * void repaint ( int x, int y, int w, int h ) */ @@ -1344,7 +1328,7 @@ HB_FUNC( QT_QWIDGET_SETWINDOWSTATE ) } /* - * void setWindowSurface ( QWindowSurface * surface ) (preliminary) + * void setWindowSurface ( QWindowSurface * surface ) */ HB_FUNC( QT_QWIDGET_SETWINDOWSURFACE ) { diff --git a/harbour/contrib/hbqt/qth/QAbstractListModel.qth b/harbour/contrib/hbqt/qth/QAbstractListModel.qth new file mode 100644 index 0000000000..e38d34611f --- /dev/null +++ b/harbour/contrib/hbqt/qth/QAbstractListModel.qth @@ -0,0 +1,94 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009 Pritpal Bedi + * 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 +; + + +Inherits = QAbstractItemModel +Type = Core +New = + + + +#include + + +/* + * QAbstractListModel ( QObject * parent = 0 ) + * ~QAbstractListModel () + */ +HB_FUNC( QT_QABSTRACTLISTMODEL ) +{ + //hb_retptr( ( QAbstractListModel* ) new QAbstractListModel() ); +} + + + + + + +virtual QModelIndex index ( int row, int column = 0, const QModelIndex & parent = QModelIndex() ) const + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qth/QList.qth b/harbour/contrib/hbqt/qth/QList.qth new file mode 100644 index 0000000000..587ffd0bc2 --- /dev/null +++ b/harbour/contrib/hbqt/qth/QList.qth @@ -0,0 +1,150 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009 Pritpal Bedi + * 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 +; + + +Inherits = +Type = Core +New = + + + +#include + + +/* + * QList () + * QList ( const QList & other ) + * ~QList () + */ +HB_FUNC( QT_QLIST ) +{ + QList* list = NULL; + hb_retptr( ( QList* ) list ); +} + + + + + + +void append ( const T & value ) +void append ( const QList & value ) +const T & at ( int i ) const +T & back () +const T & back () const +iterator begin () +//const_iterator begin () const +void clear () +//const_iterator constBegin () const +//const_iterator constEnd () const +//bool contains ( const T & value ) const +int count ( const T & value ) const +int count () const +bool empty () const +//iterator end () +//const_iterator end () const +bool endsWith ( const T & value ) const +iterator erase ( iterator pos ) +iterator erase ( iterator begin, iterator end ) +T & first () +const T & first () const +T & front () +const T & front () const +int indexOf ( const T & value, int from = 0 ) const +void insert ( int i, const T & value ) +iterator insert ( iterator before, const T & value ) +bool isEmpty () const +T & last () +const T & last () const +int lastIndexOf ( const T & value, int from = -1 ) const +int length () const +QList mid ( int pos, int length = -1 ) const +void move ( int from, int to ) +void pop_back () +void pop_front () +void prepend ( const T & value ) +void push_back ( const T & value ) +void push_front ( const T & value ) +int removeAll ( const T & value ) +void removeAt ( int i ) +void removeFirst () +void removeLast () +bool removeOne ( const T & value ) +void replace ( int i, const T & value ) +int size () const +bool startsWith ( const T & value ) const +void swap ( int i, int j ) +T takeAt ( int i ) +T takeFirst () +T takeLast () +QSet toSet () const +std::list toStdList () const +QVector toVector () const +T value ( int i ) const +T value ( int i, const T & defaultValue ) const + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qth/QStringList.qth b/harbour/contrib/hbqt/qth/QStringList.qth new file mode 100644 index 0000000000..c805ec3681 --- /dev/null +++ b/harbour/contrib/hbqt/qth/QStringList.qth @@ -0,0 +1,151 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009 Pritpal Bedi + * 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 +; + + +Inherits = QList +Type = Core +New = + + + +#include + + +/* + * QStringList () + * QStringList ( const QString & str ) + * QStringList ( const QStringList & other ) + * QStringList ( const QList & other ) + */ +HB_FUNC( QT_QSTRINGLIST ) +{ + hb_retptr( ( QStringList* ) new QStringList() ); +} + + + + + + +void append ( const QString & value ) +// bool contains ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const +QStringList filter ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const +QStringList filter ( const QRegExp & rx ) const +int indexOf ( const QString & value, int from = 0 ) const +int indexOf ( const QRegExp & rx, int from = 0 ) const +int indexOf ( QRegExp & rx, int from = 0 ) const +QString join ( const QString & separator ) const +int lastIndexOf ( const QRegExp & rx, int from = -1 ) const +int lastIndexOf ( const QString & value, int from = -1 ) const +int lastIndexOf ( QRegExp & rx, int from = -1 ) const +int removeDuplicates () +// QStringList & replaceInStrings ( const QString & before, const QString & after, Qt::CaseSensitivity cs = Qt::CaseSensitive ) +// QStringList & replaceInStrings ( const QRegExp & rx, const QString & after ) +void sort () + + + +QString & at ( int i ) const +QString & back () + +int count ( const QString & value ) const + +bool endsWith ( const QString & value ) const + +QString & first () +const QString & first () const + +QString & front () +const QString & front () const + +void insert ( int i, const QString & value ) + +QString & last () +const QString & last () const + +QList mid ( int pos, int length = -1 ) const + +void prepend ( const QString & value ) +void push_back ( const QString & value ) +void push_front ( const QString & value ) +int removeAll ( const QString & value ) +bool removeOne ( const QString & value ) +void replace ( int i, const QString & value ) + +bool startsWith ( const QString & value ) const +QString takeAt ( int i ) +QString takeFirst () +QString takeLast () + +QSet toSet () const +std::list toStdList () const +QVector toVector () const +QString value ( int i ) const +QString value ( int i, const QString & defaultValue ) const + + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qth/QStringListModel.qth b/harbour/contrib/hbqt/qth/QStringListModel.qth new file mode 100644 index 0000000000..2985f8a0fd --- /dev/null +++ b/harbour/contrib/hbqt/qth/QStringListModel.qth @@ -0,0 +1,101 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009 Pritpal Bedi + * 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 +; + + +Inherits = QAbstractListModel +Type = Core +New = + + + +#include + + +/* + * QStringListModel ( QObject * parent = 0 ) + * QStringListModel ( const QStringList & strings, QObject * parent = 0 ) + */ +HB_FUNC( QT_QSTRINGLISTMODEL ) +{ + hb_retptr( ( QStringListModel* ) new QStringListModel() ); +} + + + + + + +virtual QVariant data ( const QModelIndex & index, int role ) const +virtual Qt::ItemFlags flags ( const QModelIndex & index ) const +virtual bool insertRows ( int row, int count, const QModelIndex & parent = QModelIndex() ) +virtual bool removeRows ( int row, int count, const QModelIndex & parent = QModelIndex() ) +virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) const +virtual bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) +void setStringList ( const QStringList & strings ) +QStringList stringList () const + + + + + + + + + + + + + diff --git a/harbour/contrib/hbqt/qth/QWidget.qth b/harbour/contrib/hbqt/qth/QWidget.qth index faa6e9e40c..d99a616e0f 100644 --- a/harbour/contrib/hbqt/qth/QWidget.qth +++ b/harbour/contrib/hbqt/qth/QWidget.qth @@ -188,8 +188,8 @@ void releaseKeyboard () void releaseMouse () void releaseShortcut ( int id ) void removeAction ( QAction * action ) -void render ( QPaintDevice * target, const QPoint & targetOffset = QPoint(), const QRegion & sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags( DrawWindowBackground | DrawChildren ) ) -void render ( QPainter * painter, const QPoint & targetOffset = QPoint(), const QRegion & sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags( DrawWindowBackground | DrawChildren ) ) +//void render ( QPaintDevice * target, const QPoint & targetOffset = QPoint(), const QRegion & sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags( DrawWindowBackground | DrawChildren ) ) +//void render ( QPainter * painter, const QPoint & targetOffset = QPoint(), const QRegion & sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags( DrawWindowBackground | DrawChildren ) ) # # As a normalized behavior, int types are the best. # @@ -273,7 +273,7 @@ void setWindowModality ( Qt::WindowModality windowModality ) void setWindowOpacity ( qreal level ) void setWindowRole ( const QString & role ) void setWindowState ( Qt::WindowStates windowState ) -void setWindowSurface ( QWindowSurface * surface ) (preliminary) +void setWindowSurface ( QWindowSurface * surface ) QSize size () const virtual QSize sizeHint () const QSize sizeIncrement () const diff --git a/harbour/contrib/hbqt/tests/demoqt.prg b/harbour/contrib/hbqt/tests/demoqt.prg index 78b69cca9a..e5e885550f 100644 --- a/harbour/contrib/hbqt/tests/demoqt.prg +++ b/harbour/contrib/hbqt/tests/demoqt.prg @@ -116,9 +116,10 @@ PROCEDURE Main() Build_Label( oDA, { 30,190 }, { 300, 30 } ) Build_PushButton( oDA, { 30,240 }, { 100,50 } ) - Build_Grid( oDA ) - Build_Tabs( oDA ) + Build_Grid( oDA, { 30, 30 }, { 450,150 } ) + Build_Tabs( oDA, { 510, 5 }, { 360, 400 } ) Build_ProgressBar( oDA, { 30,300 }, { 200,30 } ) + Build_ListBox( oDA, { 310,240 }, { 150, 100 } ) oWnd:Show() @@ -254,6 +255,7 @@ STATIC FUNCTION Build_ToolBar( oWnd ) /*----------------------------------------------------------------------*/ STATIC FUNCTION Build_PushButton( oWnd, aPos, aSize ) + LOCAL oBtn oBtn := QPushButton():new( QT_PTROF( oWnd ) ) oBtn:setText( "Push Button" ) @@ -266,7 +268,7 @@ STATIC FUNCTION Build_PushButton( oWnd, aPos, aSize ) /*----------------------------------------------------------------------*/ -STATIC FUNCTION Build_Grid( oWnd ) +STATIC FUNCTION Build_Grid( oWnd, aPos, aSize ) LOCAL oGrid, oBrushBackItem0x0, oBrushForeItem0x0, oGridItem0x0 oGrid := QTableWidget():new( QT_PTROF( oWnd ) ) @@ -287,8 +289,8 @@ STATIC FUNCTION Build_Grid( oWnd ) // oGrid:setItem( 0, 0, QT_PTROF( oGridItem0x0 ) ) // - oGrid:Move( 30, 30 ) - oGrid:ReSize( 450, 150 ) + oGrid:Move( aPos[ 1 ], aPos[ 2 ] ) + oGrid:ReSize( aSize[ 1 ], aSize[ 2 ] ) // oGrid:Show() @@ -296,7 +298,7 @@ STATIC FUNCTION Build_Grid( oWnd ) /*----------------------------------------------------------------------*/ -STATIC FUNCTION Build_Tabs( oWnd ) +STATIC FUNCTION Build_Tabs( oWnd, aPos, aSize ) LOCAL oTabWidget, oTab1, oTab2, oTab3 oTabWidget := QTabWidget():new( QT_PTROF( oWnd ) ) @@ -309,8 +311,8 @@ STATIC FUNCTION Build_Tabs( oWnd ) oTabWidget:addTab( QT_PTROF( oTab2 ), "Controls" ) oTabWidget:addTab( QT_PTROF( oTab3 ), "TextBox" ) - oTabWidget:move( 510, 5 ) - oTabWidget:resize( 360, 400 ) + oTabWidget:Move( aPos[ 1 ], aPos[ 2 ] ) + oTabWidget:ReSize( aSize[ 1 ], aSize[ 2 ] ) oTabWidget:show() Build_Treeview( oTab1 ) @@ -322,7 +324,7 @@ STATIC FUNCTION Build_Tabs( oWnd ) /*----------------------------------------------------------------------*/ STATIC FUNCTION Build_TreeView( oWnd ) - LOCAL oTV, oDModel + LOCAL oTV, oDirModel oTV := QTreeView():new( QT_PTROF( oWnd ) ) @@ -336,6 +338,34 @@ STATIC FUNCTION Build_TreeView( oWnd ) /*----------------------------------------------------------------------*/ +STATIC FUNCTION Build_ListBox( oWnd, aPos, aSize ) + LOCAL oListBox, oStrList, oStrModel + + oListBox := QListView():New( QT_PTROF( oWnd ) ) + + oStrList := QStringList():new( QT_PTROF( oListBox ) ) + + oStrList:append( "India" ) + oStrList:append( "United States" ) + oStrList:append( "England" ) + oStrList:append( "Japan" ) + oStrList:append( "Hungary" ) + oStrList:append( "Argentina" ) + oStrList:append( "China" ) + oStrList:sort() + + oStrModel := QStringListModel():new( QT_PTROF( oListBox ) ) + oStrModel:setStringList( QT_PTROF( oStrList ) ) + + oListBox:setModel( QT_PTROF( oStrModel ) ) + oListBox:Move( aPos[ 1 ], aPos[ 2 ] ) + oListBox:ReSize( aSize[ 1 ], aSize[ 2 ] ) + oListBox:Show() + + RETURN nil + +/*----------------------------------------------------------------------*/ + STATIC FUNCTION Build_TextBox( oWnd ) LOCAL oTextBox @@ -351,7 +381,7 @@ STATIC FUNCTION Build_TextBox( oWnd ) /*----------------------------------------------------------------------*/ STATIC FUNCTION Build_Controls( oWnd ) - LOCAL oEdit, oCheckBox, oComboBox, oSpinBox, oRadioButton + LOCAL oEdit, oCheckBox, oComboBox, oSpinBox, oRadioButton, oVariant oEdit := QLineEdit():new( QT_PTROF( oWnd ) ) oEdit:move( 5, 10 ) @@ -362,6 +392,10 @@ STATIC FUNCTION Build_Controls( oWnd ) oEdit:show() oComboBox := QComboBox():New( QT_PTROF( oWnd ) ) + + oComboBox:addItem( "First" ) + oComboBox:addItem( "Second" ) + oComboBox:addItem( "Third" ) oComboBox:move( 5, 60 ) oComboBox:resize( 345, 30 ) oComboBox:show() @@ -671,3 +705,16 @@ STATIC FUNCTION Dummies() /*----------------------------------------------------------------------*/ +#PRAGMA BEGINDUMP + +#include +#include "hbapi.h" + +HB_FUNC( UIDEBUG ) +{ + OutputDebugString( hb_parc( 1 ) ); +} + +#PRAGMA ENDDUMP + +/*----------------------------------------------------------------------*/