From e1c5c7a39e61ad51b2cb75cf39de5ddece756b3b Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Sun, 18 Apr 2010 05:34:09 +0000 Subject: [PATCH] 2010-04-17 22:18 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/THbQtUI.prg * contrib/hbide/resources/themesex.ui * contrib/hbide/resources/themesex.uic * contrib/hbqt/qth/QBoxLayout.qth * contrib/hbqt/qth/QGridLayout.qth * contrib/hbqt/qth/QLayout.qth * contrib/hbqt/qtgui/QBoxLayout.cpp * contrib/hbqt/qtgui/QGridLayout.cpp * contrib/hbqt/qtgui/QLayout.cpp * contrib/hbide/idethemes.prg + Mode methods populated with custome code to accomodate detatched parents. Now there is no GPF absolutely neither any RTE at exit (WinXP). It is 17Apr2010 today, exactly one year and one month since I took to this project, and we are through. Thanks to all who participated in this project in any way. --- harbour/ChangeLog | 25 ++++++ harbour/contrib/hbide/idethemes.prg | 3 +- harbour/contrib/hbide/resources/themesex.ui | 83 ++++++++------------ harbour/contrib/hbide/resources/themesex.uic | 55 ++++++------- harbour/contrib/hbqt/THbQtUI.prg | 59 ++------------ harbour/contrib/hbqt/qtgui/QBoxLayout.cpp | 47 +++++++---- harbour/contrib/hbqt/qtgui/QGridLayout.cpp | 73 +++++++++++------ harbour/contrib/hbqt/qtgui/QLayout.cpp | 18 ++--- harbour/contrib/hbqt/qth/QBoxLayout.qth | 36 ++++++++- harbour/contrib/hbqt/qth/QGridLayout.qth | 63 +++++++++++++-- harbour/contrib/hbqt/qth/QLayout.qth | 15 +++- 11 files changed, 277 insertions(+), 200 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f254a97db0..b20cc7bdf4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,31 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-04-17 22:18 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbqt/THbQtUI.prg + + * contrib/hbide/resources/themesex.ui + * contrib/hbide/resources/themesex.uic + + * contrib/hbqt/qth/QBoxLayout.qth + * contrib/hbqt/qth/QGridLayout.qth + * contrib/hbqt/qth/QLayout.qth + + * contrib/hbqt/qtgui/QBoxLayout.cpp + * contrib/hbqt/qtgui/QGridLayout.cpp + * contrib/hbqt/qtgui/QLayout.cpp + + * contrib/hbide/idethemes.prg + + + Mode methods populated with custome code to accomodate detatched + parents. + + Now there is no GPF absolutely neither any RTE at exit (WinXP). + It is 17Apr2010 today, exactly one year and one month since + I took to this project, and we are through. + + Thanks to all who participated in this project in any way. + 2010-04-17 18:40 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/qtgui/QMainWindow.cpp * contrib/hbqt/qtgui/QMenu.cpp diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index e3aa285e1f..cf203fc599 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -225,7 +225,6 @@ METHOD IdeThemes:create( oIde, cIniFile ) METHOD IdeThemes:destroy() - HB_TRACE( HB_TR_ALWAYS, "-------------------------------------- Theme Manager 0 ------------------------------------------" ) IF !empty( ::oSL ) ::disConnect( ::oSL:qObj[ "listOptions" ], "doubleClicked(QModelIndex)" ) ::disConnect( ::oSL:qObj[ "buttonOk" ], "clicked()" ) @@ -242,7 +241,7 @@ METHOD IdeThemes:destroy() ::oUI:destroy() ENDIF ENDIF - HB_TRACE( HB_TR_ALWAYS, "-------------------------------------- Theme Manager 1 ------------------------------------------" ) + RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/resources/themesex.ui b/harbour/contrib/hbide/resources/themesex.ui index 2d21429c27..b3da7893fe 100644 --- a/harbour/contrib/hbide/resources/themesex.ui +++ b/harbour/contrib/hbide/resources/themesex.ui @@ -7,7 +7,7 @@ 0 0 423 - 434 + 451 @@ -16,19 +16,31 @@ + + + 0 + 0 + + Themes - + + + + 0 + 0 + + Items - + @@ -44,7 +56,7 @@ - + @@ -82,19 +94,6 @@ - - - Qt::Vertical - - - - 72 - 45 - - - - - @@ -107,91 +106,71 @@ - + + + + 0 + 0 + + Preview - + - + Save - + Save As - + Copy - + SetAsDefault - + ApplyCurrent - + ApplyAll - + Close - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - diff --git a/harbour/contrib/hbide/resources/themesex.uic b/harbour/contrib/hbide/resources/themesex.uic index c10b53dabd..69dfdf3f4e 100644 --- a/harbour/contrib/hbide/resources/themesex.uic +++ b/harbour/contrib/hbide/resources/themesex.uic @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading ui file 'themesex.ui' ** -** Created: Tue Apr 6 18:18:36 2010 +** Created: Sat Apr 17 21:50:47 2010 ** by: Qt User Interface Compiler version 4.5.2 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! @@ -21,7 +21,6 @@ #include #include #include -#include #include QT_BEGIN_NAMESPACE @@ -37,7 +36,6 @@ public: QCheckBox *checkBold; QCheckBox *checkItalic; QCheckBox *checkUnderline; - QSpacerItem *verticalSpacer; QPushButton *buttonColor; QLabel *label; QPlainTextEdit *plainThemeText; @@ -48,39 +46,44 @@ public: QPushButton *buttonApply; QPushButton *buttonApplyAll; QPushButton *buttonClose; - QSpacerItem *verticalSpacer_2; - QSpacerItem *verticalSpacer_3; void setupUi(QWidget *FormThemes) { if (FormThemes->objectName().isEmpty()) FormThemes->setObjectName(QString::fromUtf8("FormThemes")); - FormThemes->resize(423, 434); + FormThemes->resize(423, 451); gridLayout = new QGridLayout(FormThemes); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); labelTheme = new QLabel(FormThemes); labelTheme->setObjectName(QString::fromUtf8("labelTheme")); + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(labelTheme->sizePolicy().hasHeightForWidth()); + labelTheme->setSizePolicy(sizePolicy); gridLayout->addWidget(labelTheme, 0, 0, 1, 1); labelItems = new QLabel(FormThemes); labelItems->setObjectName(QString::fromUtf8("labelItems")); + sizePolicy.setHeightForWidth(labelItems->sizePolicy().hasHeightForWidth()); + labelItems->setSizePolicy(sizePolicy); - gridLayout->addWidget(labelItems, 0, 1, 1, 2); + gridLayout->addWidget(labelItems, 0, 1, 1, 1); listThemes = new QListWidget(FormThemes); listThemes->setObjectName(QString::fromUtf8("listThemes")); listThemes->setMinimumSize(QSize(0, 0)); listThemes->setMaximumSize(QSize(16777215, 16777215)); - gridLayout->addWidget(listThemes, 1, 0, 5, 1); + gridLayout->addWidget(listThemes, 1, 0, 4, 1); listItems = new QListWidget(FormThemes); listItems->setObjectName(QString::fromUtf8("listItems")); listItems->setMinimumSize(QSize(0, 0)); listItems->setMaximumSize(QSize(16777215, 16777215)); - gridLayout->addWidget(listItems, 1, 1, 5, 1); + gridLayout->addWidget(listItems, 1, 1, 4, 1); checkBold = new QCheckBox(FormThemes); checkBold->setObjectName(QString::fromUtf8("checkBold")); @@ -97,68 +100,58 @@ public: gridLayout->addWidget(checkUnderline, 3, 2, 1, 1); - verticalSpacer = new QSpacerItem(72, 45, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout->addItem(verticalSpacer, 4, 2, 1, 1); - buttonColor = new QPushButton(FormThemes); buttonColor->setObjectName(QString::fromUtf8("buttonColor")); buttonColor->setMaximumSize(QSize(120, 16777215)); - gridLayout->addWidget(buttonColor, 5, 2, 1, 1); + gridLayout->addWidget(buttonColor, 4, 2, 1, 1); label = new QLabel(FormThemes); label->setObjectName(QString::fromUtf8("label")); + sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth()); + label->setSizePolicy(sizePolicy); - gridLayout->addWidget(label, 6, 0, 1, 3); + gridLayout->addWidget(label, 5, 0, 1, 1); plainThemeText = new QPlainTextEdit(FormThemes); plainThemeText->setObjectName(QString::fromUtf8("plainThemeText")); - gridLayout->addWidget(plainThemeText, 7, 0, 9, 2); + gridLayout->addWidget(plainThemeText, 6, 0, 7, 2); buttonSave = new QPushButton(FormThemes); buttonSave->setObjectName(QString::fromUtf8("buttonSave")); - gridLayout->addWidget(buttonSave, 7, 2, 1, 1); + gridLayout->addWidget(buttonSave, 6, 2, 1, 1); buttonSaveAs = new QPushButton(FormThemes); buttonSaveAs->setObjectName(QString::fromUtf8("buttonSaveAs")); - gridLayout->addWidget(buttonSaveAs, 8, 2, 1, 1); + gridLayout->addWidget(buttonSaveAs, 7, 2, 1, 1); buttonCopy = new QPushButton(FormThemes); buttonCopy->setObjectName(QString::fromUtf8("buttonCopy")); - gridLayout->addWidget(buttonCopy, 9, 2, 1, 1); + gridLayout->addWidget(buttonCopy, 8, 2, 1, 1); buttonDefault = new QPushButton(FormThemes); buttonDefault->setObjectName(QString::fromUtf8("buttonDefault")); - gridLayout->addWidget(buttonDefault, 11, 2, 1, 1); + gridLayout->addWidget(buttonDefault, 9, 2, 1, 1); buttonApply = new QPushButton(FormThemes); buttonApply->setObjectName(QString::fromUtf8("buttonApply")); - gridLayout->addWidget(buttonApply, 12, 2, 1, 1); + gridLayout->addWidget(buttonApply, 10, 2, 1, 1); buttonApplyAll = new QPushButton(FormThemes); buttonApplyAll->setObjectName(QString::fromUtf8("buttonApplyAll")); - gridLayout->addWidget(buttonApplyAll, 13, 2, 1, 1); + gridLayout->addWidget(buttonApplyAll, 11, 2, 1, 1); buttonClose = new QPushButton(FormThemes); buttonClose->setObjectName(QString::fromUtf8("buttonClose")); - gridLayout->addWidget(buttonClose, 15, 2, 1, 1); - - verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout->addItem(verticalSpacer_2, 10, 2, 1, 1); - - verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout->addItem(verticalSpacer_3, 14, 2, 1, 1); + gridLayout->addWidget(buttonClose, 12, 2, 1, 1); retranslateUi(FormThemes); diff --git a/harbour/contrib/hbqt/THbQtUI.prg b/harbour/contrib/hbqt/THbQtUI.prg index 4ccd9c3232..7c07e74101 100644 --- a/harbour/contrib/hbqt/THbQtUI.prg +++ b/harbour/contrib/hbqt/THbQtUI.prg @@ -144,13 +144,11 @@ METHOD HbQtUI:create( cFile, qParent ) METHOD HbQtUI:destroy() LOCAL a_, i - //LOCAL cNam, cCmd, cWdg, n ::oWidget:hide() FOR EACH a_ IN ::aSignals i := Qt_Slots_disConnect( ::pSlots, a_[ 1 ], a_[ 2 ] ) -//HB_TRACE( HB_TR_ALWAYS, 300, i, "Qt_Slots_disConnect", a_[ 2 ] ) a_:= NIL NEXT ::pSlots := NIL @@ -159,65 +157,24 @@ METHOD HbQtUI:destroy() NEXT ::pEvents := NIL -#if 0 - FOR EACH a_ IN ::aCommands - IF a_[ 1 ] $ ::qObj - IF ! "splitter" $ lower( a_[ 1 ] ) - cNam := a_[ 1 ] ; cCmd := a_[ 2 ] - IF ( "addWidget" $ cCmd ) .OR. ( "addWidget" $ cCmd ) - IF ( n := at( "(o[ ", cCmd ) ) > 0 - cWdg := substr( cCmd, n + 5 ) - IF ( n := at( '"', cWdg ) ) > 0 - cWdg := substr( cWdg, 1, n - 1 ) - IF "addWidget" $ cCmd - hbide_dbg( 200, cNam, cWdg ) - ::qObj[ cNam ]:removeWidget( ::qObj[ cWdg ] ) - ELSEIF "addLayout" $ cCmd - hbide_dbg( 205, cNam, cWdg ) - ::qObj[ cNam ]:removeLayout( ::qObj[ cWdg ] ) - ENDIF - ENDIF - ENDIF - ENDIF - ENDIF - ENDIF - NEXT -#endif - FOR EACH a_ IN ::widgets DESCEND - IF ( i := a_:__enumIndex() ) > 1 + i := a_:__enumIndex() + IF i > 0 IF type( a_[ 3 ] ) == "UI" - IF !( a_[ 1 ] $ "QHBoxLayout,QVBoxLayout,QGridLayout" ) //HB_TRACE( HB_TR_ALWAYS, 400, i, pad( a_[ 1 ], 20 ), pad( a_[ 2 ], 20 ), iif( i > 1, pad( ::widgets[ i - 1, 1 ],20 ), NIL ), i, len( ::widgets ) ) - ::qObj[ a_[ 2 ] ] := NIL - ENDIF - ELSEIF type( a_[ 3 ] ) != "UI" -//HB_TRACE( HB_TR_ALWAYS, 500, 0, pad( a_[ 1 ], 20 ), pad( a_[ 2 ], 20 ), iif( i > 1, pad( ::widgets[ i - 1, 1 ],20 ), NIL ), i, len( ::widgets ) ) + ::qObj[ a_[ 2 ] ] := NIL ENDIF ENDIF NEXT - - #if 1 - FOR EACH a_ IN ::widgets DESCEND - IF ( i := a_:__enumIndex() ) > 1 - IF type( a_[ 3 ] ) == "UI" .AND. ( a_[ 1 ] $ "QHBoxLayout,QVBoxLayout,QGridLayout" ) - IF i > 2 -//HB_TRACE( HB_TR_ALWAYS, 600, i, pad( a_[ 1 ], 20 ), pad( a_[ 2 ], 20 ), iif( i > 1, pad( ::widgets[ i - 1, 1 ],20 ), NIL ), i, len( ::widgets ) ) - ::qObj[ a_[ 2 ] ] := NIL - ENDIF - ENDIF - ENDIF - NEXT - #endif - + #if 0 ::qObj[ ::cMainWidgetName ] := NIL ::widgets[ 1, 2 ] := NIL ::aEvents := NIL - ::qObj := NIL - ::widgets := {} - + ::qObj := NIL + ::widgets := {} + #endif ::oWidget:close() - ::oWidget := NIL /* Variable Destruction GPFs */ + ::oWidget := NIL RETURN i diff --git a/harbour/contrib/hbqt/qtgui/QBoxLayout.cpp b/harbour/contrib/hbqt/qtgui/QBoxLayout.cpp index 55a7daa8b7..8cf225ab43 100644 --- a/harbour/contrib/hbqt/qtgui/QBoxLayout.cpp +++ b/harbour/contrib/hbqt/qtgui/QBoxLayout.cpp @@ -69,6 +69,17 @@ * enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop } */ +/* + * Constructed[ 20/23 [ 86.96% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * } + * } + * } + */ + #include #include @@ -156,12 +167,14 @@ HB_FUNC( QT_QBOXLAYOUT ) */ HB_FUNC( QT_QBOXLAYOUT_ADDLAYOUT ) { - QBoxLayout * p = hbqt_par_QBoxLayout( 1 ); - if( p ) - ( p )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QBOXLAYOUT_ADDLAYOUT()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QBOXLAYOUT_ADDLAYOUT FP=( p )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QBOXLAYOUT_ADDLAYOUT() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QBoxLayout( 1 )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ) ); } } @@ -170,12 +183,14 @@ HB_FUNC( QT_QBOXLAYOUT_ADDLAYOUT ) */ HB_FUNC( QT_QBOXLAYOUT_ADDSPACERITEM ) { - QBoxLayout * p = hbqt_par_QBoxLayout( 1 ); - if( p ) - ( p )->addSpacerItem( hbqt_par_QSpacerItem( 2 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QBOXLAYOUT_ADDSPACERITEM()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QBOXLAYOUT_ADDSPACERITEM FP=( p )->addSpacerItem( hbqt_par_QSpacerItem( 2 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QBOXLAYOUT_ADDSPACERITEM() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QBoxLayout( 1 )->addSpacerItem( hbqt_par_QSpacerItem( 2 ) ); } } @@ -226,12 +241,14 @@ HB_FUNC( QT_QBOXLAYOUT_ADDSTRUT ) */ HB_FUNC( QT_QBOXLAYOUT_ADDWIDGET ) { - QBoxLayout * p = hbqt_par_QBoxLayout( 1 ); - if( p ) - ( p )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), ( Qt::Alignment ) hb_parni( 4 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QBOXLAYOUT_ADDWIDGET()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QBOXLAYOUT_ADDWIDGET FP=( p )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), ( Qt::Alignment ) hb_parni( 4 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QBOXLAYOUT_ADDWIDGET() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QBoxLayout( 1 )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), ( Qt::Alignment ) hb_parni( 4 ) ); } } diff --git a/harbour/contrib/hbqt/qtgui/QGridLayout.cpp b/harbour/contrib/hbqt/qtgui/QGridLayout.cpp index 40bb5e02bd..aaf3aa9080 100644 --- a/harbour/contrib/hbqt/qtgui/QGridLayout.cpp +++ b/harbour/contrib/hbqt/qtgui/QGridLayout.cpp @@ -65,6 +65,19 @@ #if QT_VERSION >= 0x040500 /*----------------------------------------------------------------------*/ +/* + * Constructed[ 26/31 [ 83.87% ] ] + * + * *** Unconvered Prototypes *** + * ----------------------------- + * + * } + * } + * } + * } + * } + */ + #include #include @@ -153,12 +166,14 @@ HB_FUNC( QT_QGRIDLAYOUT ) */ HB_FUNC( QT_QGRIDLAYOUT_ADDITEM ) { - QGridLayout * p = hbqt_par_QGridLayout( 1 ); - if( p ) - ( p )->addItem( hbqt_par_QLayoutItem( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( HB_ISNUM( 5 ) ? hb_parni( 5 ) : 1 ), ( HB_ISNUM( 6 ) ? hb_parni( 6 ) : 1 ), ( Qt::Alignment ) hb_parni( 7 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QGRIDLAYOUT_ADDITEM()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QGRIDLAYOUT_ADDITEM FP=( p )->addItem( hbqt_par_QLayoutItem( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( HB_ISNUM( 5 ) ? hb_parni( 5 ) : 1 ), ( HB_ISNUM( 6 ) ? hb_parni( 6 ) : 1 ), ( Qt::Alignment ) hb_parni( 7 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDITEM() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addItem( hbqt_par_QLayoutItem( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( HB_ISNUM( 5 ) ? hb_parni( 5 ) : 1 ), ( HB_ISNUM( 6 ) ? hb_parni( 6 ) : 1 ), ( Qt::Alignment ) hb_parni( 7 ) ); } } @@ -167,12 +182,14 @@ HB_FUNC( QT_QGRIDLAYOUT_ADDITEM ) */ HB_FUNC( QT_QGRIDLAYOUT_ADDLAYOUT ) { - QGridLayout * p = hbqt_par_QGridLayout( 1 ); - if( p ) - ( p )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( Qt::Alignment ) hb_parni( 5 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QGRIDLAYOUT_ADDLAYOUT()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QGRIDLAYOUT_ADDLAYOUT FP=( p )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( Qt::Alignment ) hb_parni( 5 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDLAYOUT() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( Qt::Alignment ) hb_parni( 5 ) ); } } @@ -181,12 +198,14 @@ HB_FUNC( QT_QGRIDLAYOUT_ADDLAYOUT ) */ HB_FUNC( QT_QGRIDLAYOUT_ADDLAYOUT_1 ) { - QGridLayout * p = hbqt_par_QGridLayout( 1 ); - if( p ) - ( p )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( Qt::Alignment ) hb_parni( 7 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QGRIDLAYOUT_ADDLAYOUT_1()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QGRIDLAYOUT_ADDLAYOUT_1 FP=( p )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( Qt::Alignment ) hb_parni( 7 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDLAYOUT_1() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( Qt::Alignment ) hb_parni( 7 ) ); } } @@ -195,12 +214,14 @@ HB_FUNC( QT_QGRIDLAYOUT_ADDLAYOUT_1 ) */ HB_FUNC( QT_QGRIDLAYOUT_ADDWIDGET ) { - QGridLayout * p = hbqt_par_QGridLayout( 1 ); - if( p ) - ( p )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( Qt::Alignment ) hb_parni( 5 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_GRIDQLAYOUT_ADDWIDGET()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QGRIDLAYOUT_ADDWIDGET FP=( p )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( Qt::Alignment ) hb_parni( 5 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDWIDGET() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( Qt::Alignment ) hb_parni( 5 ) ); } } @@ -209,12 +230,14 @@ HB_FUNC( QT_QGRIDLAYOUT_ADDWIDGET ) */ HB_FUNC( QT_QGRIDLAYOUT_ADDWIDGET_1 ) { - QGridLayout * p = hbqt_par_QGridLayout( 1 ); - if( p ) - ( p )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( Qt::Alignment ) hb_parni( 7 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_GRIDQLAYOUT_ADDWIDGET_1()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QGRIDLAYOUT_ADDWIDGET_1 FP=( p )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( Qt::Alignment ) hb_parni( 7 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDWIDGET_1() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( Qt::Alignment ) hb_parni( 7 ) ); } } diff --git a/harbour/contrib/hbqt/qtgui/QLayout.cpp b/harbour/contrib/hbqt/qtgui/QLayout.cpp index 0dfafea75d..1150077ce4 100644 --- a/harbour/contrib/hbqt/qtgui/QLayout.cpp +++ b/harbour/contrib/hbqt/qtgui/QLayout.cpp @@ -70,12 +70,13 @@ */ /* - * Constructed[ 29/30 [ 96.67% ] ] + * Constructed[ 29/31 [ 93.55% ] ] * * *** Unconvered Prototypes *** * ----------------------------- * * } + * } */ #include @@ -151,14 +152,11 @@ HB_FUNC( QT_QLAYOUT_ADDITEM ) { QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); - HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QLAYOUT_ADDITEM()" ) ); - if( p && p->ph && q && q->ph ) { HB_TRACE( HB_TR_DEBUG, ( "QT_QLAYOUT_ADDITEM() Qt object: %p is attached to: %p", p->ph, q->ph ) ); q->bNew = HB_FALSE; - hbqt_par_QLayout( 1 )->addItem( hbqt_par_QLayoutItem( 2 ) ); } } @@ -168,12 +166,14 @@ HB_FUNC( QT_QLAYOUT_ADDITEM ) */ HB_FUNC( QT_QLAYOUT_ADDWIDGET ) { - QLayout * p = hbqt_par_QLayout( 1 ); - if( p ) - ( p )->addWidget( hbqt_par_QWidget( 2 ) ); - else + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QLAYOUT_ADDWIDGET()" ) ); + if( p && p->ph && q && q->ph ) { - HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_QLAYOUT_ADDWIDGET FP=( p )->addWidget( hbqt_par_QWidget( 2 ) ); p is NULL" ) ); + HB_TRACE( HB_TR_DEBUG, ( "QT_QLAYOUT_ADDWIDGET() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QLayout( 1 )->addWidget( hbqt_par_QWidget( 2 ) ); } } diff --git a/harbour/contrib/hbqt/qth/QBoxLayout.qth b/harbour/contrib/hbqt/qth/QBoxLayout.qth index d753c98821..5bcdf47331 100644 --- a/harbour/contrib/hbqt/qth/QBoxLayout.qth +++ b/harbour/contrib/hbqt/qth/QBoxLayout.qth @@ -78,12 +78,42 @@ enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop } -void addLayout ( QLayout * layout, int stretch = 0 ) -void addSpacerItem ( QSpacerItem * spacerItem ) +void addLayout ( QLayout * layout, int stretch = 0 ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QBOXLAYOUT_ADDLAYOUT()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QBOXLAYOUT_ADDLAYOUT() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QBoxLayout( 1 )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ) ); + } +} +void addSpacerItem ( QSpacerItem * spacerItem ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QBOXLAYOUT_ADDSPACERITEM()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QBOXLAYOUT_ADDSPACERITEM() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QBoxLayout( 1 )->addSpacerItem( hbqt_par_QSpacerItem( 2 ) ); + } +} void addSpacing ( int size ) void addStretch ( int stretch = 0 ) void addStrut ( int size ) -void addWidget ( QWidget * widget, int stretch = 0, Qt::Alignment alignment = 0 ) +void addWidget ( QWidget * widget, int stretch = 0, Qt::Alignment alignment = 0 ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QBOXLAYOUT_ADDWIDGET()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QBOXLAYOUT_ADDWIDGET() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QBoxLayout( 1 )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), ( Qt::Alignment ) hb_parni( 4 ) ); + } +} Direction direction () const void insertLayout ( int index, QLayout * layout, int stretch = 0 ) void insertSpacerItem ( int index, QSpacerItem * spacerItem ) diff --git a/harbour/contrib/hbqt/qth/QGridLayout.qth b/harbour/contrib/hbqt/qth/QGridLayout.qth index 5414aebc54..910385a5a6 100644 --- a/harbour/contrib/hbqt/qth/QGridLayout.qth +++ b/harbour/contrib/hbqt/qth/QGridLayout.qth @@ -75,11 +75,61 @@ HB_FUNC( QT_QGRIDLAYOUT ) -void addItem ( QLayoutItem * item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment alignment = 0 ) -void addLayout ( QLayout * layout, int row, int column, Qt::Alignment alignment = 0 ) -void addLayout ( QLayout * layout, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = 0 ) -void addWidget ( QWidget * widget, int row, int column, Qt::Alignment alignment = 0 ) -void addWidget ( QWidget * widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment alignment = 0 ) +void addItem ( QLayoutItem * item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment alignment = 0 ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QGRIDLAYOUT_ADDITEM()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDITEM() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addItem( hbqt_par_QLayoutItem( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( HB_ISNUM( 5 ) ? hb_parni( 5 ) : 1 ), ( HB_ISNUM( 6 ) ? hb_parni( 6 ) : 1 ), ( Qt::Alignment ) hb_parni( 7 ) ); + } +} +void addLayout ( QLayout * layout, int row, int column, Qt::Alignment alignment = 0 ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QGRIDLAYOUT_ADDLAYOUT()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDLAYOUT() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( Qt::Alignment ) hb_parni( 5 ) ); + } +} +void addLayout ( QLayout * layout, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = 0 ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QGRIDLAYOUT_ADDLAYOUT_1()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDLAYOUT_1() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addLayout( hbqt_par_QLayout( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( Qt::Alignment ) hb_parni( 7 ) ); + } +} +void addWidget ( QWidget * widget, int row, int column, Qt::Alignment alignment = 0 ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_GRIDQLAYOUT_ADDWIDGET()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDWIDGET() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), ( Qt::Alignment ) hb_parni( 5 ) ); + } +} +void addWidget ( QWidget * widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment alignment = 0 ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_GRIDQLAYOUT_ADDWIDGET_1()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QGRIDLAYOUT_ADDWIDGET_1() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QGridLayout( 1 )->addWidget( hbqt_par_QWidget( 2 ), hb_parni( 3 ), hb_parni( 4 ), hb_parni( 5 ), hb_parni( 6 ), ( Qt::Alignment ) hb_parni( 7 ) ); + } +} QRect cellRect ( int row, int column ) const int columnCount () const int columnMinimumWidth ( int column ) const @@ -102,6 +152,3 @@ void setVerticalSpacing ( int spacing ) int spacing () const int verticalSpacing () const - - - diff --git a/harbour/contrib/hbqt/qth/QLayout.qth b/harbour/contrib/hbqt/qth/QLayout.qth index cc6dfecab7..5d14d8d525 100644 --- a/harbour/contrib/hbqt/qth/QLayout.qth +++ b/harbour/contrib/hbqt/qth/QLayout.qth @@ -82,18 +82,25 @@ bool activate () virtual void addItem ( QLayoutItem * item ){ QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); - HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QLAYOUT_ADDITEM()" ) ); - if( p && p->ph && q && q->ph ) { HB_TRACE( HB_TR_DEBUG, ( "QT_QLAYOUT_ADDITEM() Qt object: %p is attached to: %p", p->ph, q->ph ) ); q->bNew = HB_FALSE; - hbqt_par_QLayout( 1 )->addItem( hbqt_par_QLayoutItem( 2 ) ); } } -void addWidget ( QWidget * w ) +void addWidget ( QWidget * w ){ + QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 ); + QGC_POINTER * q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 ); + HB_TRACE( HB_TR_DEBUG, ( "Entering function QT_QLAYOUT_ADDWIDGET()" ) ); + if( p && p->ph && q && q->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "QT_QLAYOUT_ADDWIDGET() Qt object: %p is attached to: %p", p->ph, q->ph ) ); + q->bNew = HB_FALSE; + hbqt_par_QLayout( 1 )->addWidget( hbqt_par_QWidget( 2 ) ); + } +} QRect contentsRect () const virtual int count () const = 0 virtual Qt::Orientations expandingDirections () const