From d7791d7926f7e04cf3b827d3dd4155405bb146d6 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Mon, 23 Aug 2010 07:29:26 +0000 Subject: [PATCH] 2010-08-23 00:16 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/hbqt.ch * contrib/hbqt/qtgui/doc/en/class_hbqgraphicsitem.txt * contrib/hbqt/qtgui/doc/en/class_hbqgraphicsscene.txt * contrib/hbqt/qtgui/g/filelist.hbm * contrib/hbqt/qtgui/g/HBQGraphicsItem.cpp + contrib/hbqt/qtgui/g/HBQGraphicsScene.cpp * contrib/hbqt/qtgui/g/hbqtgui.h * contrib/hbqt/qtgui/g/THBQGraphicsItem.prg + contrib/hbqt/qtgui/g/THBQGraphicsScene.prg * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.h * contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.cpp * contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.h + contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp + contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.h * contrib/hbqt/qtgui/hbqtgui.hbm * contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth + contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth * contrib/hbqt/utils/qtgui.qtp * contrib/hbide/hbide.qrc * contrib/hbide/resources/designer.png * contrib/hbide/resources/grid.png * contrib/hbide/idereportsmanager.prg + Added: more classes forming the building blocks of Report Designer. + Implemented: in Report Designer: Reworked: GraphicsScene mechanism. Added: Objects - Images, Gradients, Ellipses, etc. Refined: other objects. Added: Sources and Fields with drag support. Obejct Resizing. And many other aspects. Please play. --- harbour/ChangeLog | 35 + harbour/contrib/hbide/hbide.qrc | 1 + harbour/contrib/hbide/idereportsmanager.prg | 283 +++--- harbour/contrib/hbide/resources/designer.png | Bin 788 -> 668 bytes harbour/contrib/hbide/resources/grid.png | Bin 0 -> 96 bytes harbour/contrib/hbqt/hbqt.ch | 41 + .../qtgui/doc/en/class_hbqgraphicsitem.txt | 46 + .../qtgui/doc/en/class_hbqgraphicsscene.txt | 74 ++ .../contrib/hbqt/qtgui/g/HBQGraphicsItem.cpp | 679 ++++++++++++- .../contrib/hbqt/qtgui/g/HBQGraphicsScene.cpp | 490 ++++++++++ .../contrib/hbqt/qtgui/g/THBQGraphicsItem.prg | 230 +++++ .../hbqt/qtgui/g/THBQGraphicsScene.prg | 196 ++++ harbour/contrib/hbqt/qtgui/g/filelist.hbm | 2 + harbour/contrib/hbqt/qtgui/g/hbqtgui.h | 512 +++++----- .../hbqt/qtgui/hbqt_hbqgraphicsitem.cpp | 895 +++++++++++++++++- .../contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.h | 168 +++- .../hbqt/qtgui/hbqt_hbqgraphicsrectitem.cpp | 10 +- .../hbqt/qtgui/hbqt_hbqgraphicsrectitem.h | 2 + .../hbqt/qtgui/hbqt_hbqgraphicsscene.cpp | 733 ++++++++++++++ .../hbqt/qtgui/hbqt_hbqgraphicsscene.h | 163 ++++ harbour/contrib/hbqt/qtgui/hbqtgui.hbm | 2 + .../hbqt/qtgui/qth/HBQGraphicsItem.qth | 67 +- .../hbqt/qtgui/qth/HBQGraphicsScene.qth | 128 +++ harbour/contrib/hbqt/utils/qtgui.qtp | 1 + 24 files changed, 4324 insertions(+), 434 deletions(-) create mode 100644 harbour/contrib/hbide/resources/grid.png create mode 100644 harbour/contrib/hbqt/qtgui/doc/en/class_hbqgraphicsscene.txt create mode 100644 harbour/contrib/hbqt/qtgui/g/HBQGraphicsScene.cpp create mode 100644 harbour/contrib/hbqt/qtgui/g/THBQGraphicsScene.prg create mode 100644 harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp create mode 100644 harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.h create mode 100644 harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 558505e3b3..6b41fb2a43 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,41 @@ The license applies to all entries newer than 2009-04-28. */ +2010-08-23 00:16 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/hbqt.ch + * contrib/hbqt/qtgui/doc/en/class_hbqgraphicsitem.txt + * contrib/hbqt/qtgui/doc/en/class_hbqgraphicsscene.txt + * contrib/hbqt/qtgui/g/filelist.hbm + * contrib/hbqt/qtgui/g/HBQGraphicsItem.cpp + + contrib/hbqt/qtgui/g/HBQGraphicsScene.cpp + * contrib/hbqt/qtgui/g/hbqtgui.h + * contrib/hbqt/qtgui/g/THBQGraphicsItem.prg + + contrib/hbqt/qtgui/g/THBQGraphicsScene.prg + * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp + * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.h + * contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.cpp + * contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.h + + contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp + + contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.h + * contrib/hbqt/qtgui/hbqtgui.hbm + * contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth + + contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth + * contrib/hbqt/utils/qtgui.qtp + + * contrib/hbide/hbide.qrc + * contrib/hbide/resources/designer.png + * contrib/hbide/resources/grid.png + + * contrib/hbide/idereportsmanager.prg + + Added: more classes forming the building blocks of Report Designer. + + Implemented: in Report Designer: + Reworked: GraphicsScene mechanism. + Added: Objects - Images, Gradients, Ellipses, etc. + Refined: other objects. + Added: Sources and Fields with drag support. + Obejct Resizing. + And many other aspects. Please play. + 2010-08-22 12:29 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * external/sqlite3/sqlite3.c * external/sqlite3/sqlite3.dif diff --git a/harbour/contrib/hbide/hbide.qrc b/harbour/contrib/hbide/hbide.qrc index a2406630bc..e1ee643cf0 100644 --- a/harbour/contrib/hbide/hbide.qrc +++ b/harbour/contrib/hbide/hbide.qrc @@ -109,6 +109,7 @@ resources/gotoline.png resources/gotoline3.png resources/gotomark.png +resources/grid.png resources/harbour.png resources/harbourhelp.png resources/hb-16x16.png diff --git a/harbour/contrib/hbide/idereportsmanager.prg b/harbour/contrib/hbide/idereportsmanager.prg index 84b139ebee..8c804bf72c 100644 --- a/harbour/contrib/hbide/idereportsmanager.prg +++ b/harbour/contrib/hbide/idereportsmanager.prg @@ -153,11 +153,11 @@ CLASS IdeReportsManager INHERIT IdeObject METHOD buildStatusBar() METHOD buildTabBar() METHOD buildDesignReport() - METHOD setPageSize() - METHOD setPaper() - METHOD addRect( qPos, cType ) METHOD addField( qPos, cAlias, cField ) METHOD addObject( qPos, cType ) + METHOD loadReport( cName ) + METHOD saveReport() + METHOD prepareReport() ENDCLASS @@ -234,7 +234,6 @@ METHOD IdeReportsManager:show() /*----------------------------------------------------------------------*/ METHOD IdeReportsManager:buildDesignReport() - STATIC qItem, qItmC ::qLayoutD := QHBoxLayout():new() ::qLayoutD:setContentsMargins( 0,0,0,0 ) @@ -249,13 +248,14 @@ METHOD IdeReportsManager:buildDesignReport() ::qFrameL := QFrame():new() ::qSpliter:addWidget( ::qFrameL ) - ::qScroll := QScrollArea():new() - ::qScroll:setVerticalScrollBarPolicy( Qt_ScrollBarAsNeeded ) - ::qScroll:setHorizontalScrollBarPolicy( Qt_ScrollBarAsNeeded ) - ::qScroll:setWidgetResizable( .f. ) - ::qScroll:setMinimumWidth( 400 ) - ::qScroll:setBackgroundRole( QPalette_Dark ) - ::qSpliter:addWidget( ::qScroll ) + ::qScene := HBQGraphicsScene():new() + ::qScene:hbSetBlock( {|p,p1,p2| ::execEvent( "graphicsScene_block", p, p1, p2 ) } ) + + ::qView := QGraphicsView():new( ::qDesign ) + ::qView:setMouseTracking( .t. ) + ::qView:setScene( ::qScene ) + // + ::qSpliter:addWidget( ::qView ) ::qFrameR := QFrame():new() ::qSpliter:addWidget( ::qFrameR ) @@ -335,45 +335,12 @@ METHOD IdeReportsManager:buildDesignReport() ::qTreeData := QTreeWidget():new() ::qPageR11Lay:addWidget( ::qTreeData ) ::qTreeData:setHeaderHidden( .t. ) - ::qTreeData:setObjectName( "TreeData" ) - // - qItem := QTreeWidgetItem():new() - qItem:setText( 0, "Rect" ) - ::qTreeData:addTopLevelItem( qItem ) - qItmC := QTreeWidgetItem():new() - qItmC:setText( 0, "Rounded Rect" ) - qItem:addChild( qItmC ) - qItem:setExpanded( .t. ) - // - qItem := QTreeWidgetItem():new() - qItem:setText( 0, "Circle" ) - // - ::qTreeData:addTopLevelItem( qItem ) - // + ::qTreeData:setObjectName( "DataTree" ) ::qTreeData:setDragEnabled( .t. ) - ::setPageSize() + ::loadReport() - ::qDesign := QFrame():new() - ::qScroll:setWidget( ::qDesign ) - ::qDesign:setBackgroundRole( QPalette_Dark ) - ::qDesign:setGeometry( QRect():new( 0, 0, ::nPgWidth + 60, ::nPgHeight + 60 ) ) - - ::qHRuler := QFrame():new( ::qDesign ) - ::qHRuler:setGeometry( QRect():new( 30, 0, ::qDesign:width(), 15 ) ) - ::qHRuler:setStyleSheet( "background-color: rgb(240,240,240);" ) - ::qVRuler := QFrame():new( ::qDesign ) - ::qVRuler:setStyleSheet( "background-color: rgb(240,240,240);" ) - ::qVRuler:setGeometry( QRect():new( 0, 30, 15, ::qDesign:height() ) ) - - ::qView := QGraphicsView():new( ::qDesign ) - ::qView:setGeometry( QRect():new( 30, 30, ::nPgWidth+5, ::nPgHeight+5 ) ) - - ::qScene := QGraphicsScene():new( ::qView ) - - ::qView:setScene( ::qScene ) - ::qScene:setSceneRect_1( 0, 0, ::nPgWidth, ::nPgHeight ) - ::setPaper() + ::qScene:zoomWYSIWYG() ::qWidget1:show() ::qWidget2:show() @@ -383,30 +350,43 @@ METHOD IdeReportsManager:buildDesignReport() /*----------------------------------------------------------------------*/ -METHOD IdeReportsManager:setPageSize() - LOCAL p, r, o +METHOD IdeReportsManager:loadReport( cName ) + LOCAL aSource, qItem, qItmC, aFld, a_, i, b_ - o := HBQGraphicsRectItem():new() - o:hbSetBlock( {|p,p1,p2| ::execEvent( "graphicsPaper_block", p, p1, p2 ) } ) - o := NIL + HB_SYMBOL_UNUSED( cName ) - p := QPrinter():new() + /* All data must be requested from Application based on report definition */ + aSource := {} + aadd( aSource, { "Customer", { { "Title" ,"C",35,0 }, { "Street","C",20,0 }, { "Revenue","N",12,2 } }, {} } ) + aadd( aSource, { "Invoice" , { { "Number","C",10,0 }, { "Date" ,"D",08,0 }, { "Amount" ,"N",12,2 } }, {} } ) - p:setPaperSize( QPrinter_A4 ) - p:setOutputFormat( QPrinter_PdfFormat ) - p:setOrientation( QPrinter_Portrait ) + FOR i := 1 TO len( aSource ) + a_:= aSource[ i ] - p:setFullPage( .t. ) - r := QRectF():from( p:paperRect_1( QPrinter_Millimeter ) ) + qItem := QTreeWidgetItem():new() + qItem:setText( 0, a_[ 1 ] ) // Source Name + ::qTreeData:addTopLevelItem( qItem ) - ::nPgWidth := r:width() * ::nHPxMM - ::nPgHeight := r:height() * ::nVPxMM + aFld := a_[ 2 ] + FOR EACH b_ IN aFld + qItmC := QTreeWidgetItem():new() + qItmC:setText( 0, b_[ 1 ] ) + qItem:addChild( qItmC ) + qItem:setExpanded( .t. ) + NEXT + NEXT - p:setFullPage( .f. ) - r := QRectF():from( p:paperRect_1( QPrinter_Millimeter ) ) + RETURN Self - ::nPgWidthP := r:width() * ::nHPxMM - ::nPgHeightP := r:height() * ::nVPxMM +/*----------------------------------------------------------------------*/ + +METHOD IdeReportsManager:saveReport() + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeReportsManager:prepareReport() RETURN Self @@ -416,13 +396,7 @@ METHOD IdeReportsManager:execEvent( cEvent, p, p1, p2 ) LOCAL qEvent, qMime SWITCH cEvent - CASE "graphicsPaper_block" - IF p == 21001 - ::nHPxMM := p1 / 25.4 - ::nVPxMM := p2 / 25.4 - RETURN Self - ENDIF - + CASE "graphicsScene_block" qEvent := QGraphicsSceneDragDropEvent():from( p1 ) DO CASE @@ -437,14 +411,13 @@ METHOD IdeReportsManager:execEvent( cEvent, p, p1, p2 ) CASE p == QEvent_GraphicsSceneDrop qMime := QMimeData():from( qEvent:mimeData() ) IF qMime:hasFormat( "application/x-qabstractitemmodeldatalist" ) -HB_TRACE( HB_TR_ALWAYS, "application/x-toolbaricon", p2[ 1 ], p2[ 2 ], p2[ 3 ] ) - p2[ 2 ] := lower( p2[ 2 ] ) - IF p2[ 2 ] == "rect" - ::addRect( QPoint():from( qEvent:scenePos() ), "Band" ) + IF p2[ 1 ] == "DataTree" + IF p2[ 2 ] != p2[ 3 ] + ::addField( QPoint():from( qEvent:scenePos() ), p2[ 2 ], p2[ 3 ] ) + ENDIF ENDIF ELSEIF qMime:hasFormat( "application/x-toolbaricon" ) -HB_TRACE( HB_TR_ALWAYS, "application/x-toolbaricon", qMime:data(), qMime:html() ) SWITCH qMime:html() CASE "Image" ::addObject( QPoint():from( qEvent:scenePos() ), "Image" ) @@ -458,12 +431,16 @@ HB_TRACE( HB_TR_ALWAYS, "application/x-toolbaricon", qMime:data(), qMime:html() CASE "Barcode" ::addObject( QPoint():from( qEvent:scenePos() ), "Barcode" ) EXIT + CASE "Text" + ::addObject( QPoint():from( qEvent:scenePos() ), "Text" ) + EXIT ENDSWITCH ELSE ENDIF ENDCASE EXIT + CASE "tabBar_currentChanged" IF !empty( ::qStack ) .AND. p < ::qStack:count() ::qStack:setCurrentIndex( p ) @@ -479,105 +456,72 @@ HB_TRACE( HB_TR_ALWAYS, "application/x-toolbaricon", qMime:data(), qMime:html() EXIT CASE "buttonPrint_clicked" EXIT - + CASE "buttonGrid_clicked" + ::qScene:setShowGrid( ::qToolbarAlign:setItemChecked( "Grid" ) ) + EXIT + CASE "buttonZoom_clicked" + DO CASE + CASE p == 1 + ::qScene:zoomIn() + CASE p == 2 + ::qScene:zoomOut() + CASE p == 3 + ::qScene:zoomWYSIWYG() + CASE p == 4 + ::qScene:zoomOriginal() + ENDCASE + EXIT ENDSWITCH RETURN Self /*----------------------------------------------------------------------*/ -METHOD IdeReportsManager:setPaper() - LOCAL qPen := QPen():new( "QColor", QColor():new( 0,240,255 ) ) - LOCAL qBrush := QBrush():new( "QColor", QColor():new( 245,245,245 ) ) - LOCAL nOffW, nOffH - - ::qPaper := HBQGraphicsRectItem():new() - ::qPaper:hbSetBlock( {|p,p1,p2| ::execEvent( "graphicsPaper_block", p, p1, p2 ) } ) - ::qPaper:setFlag( QGraphicsItem_ItemIsMovable , .f. ) - ::qPaper:setFlag( QGraphicsItem_ItemIsSelectable, .f. ) - ::qPaper:setAcceptDrops( .t. ) - - ::qPaper:setPen( qPen ) - ::qPaper:setBrush( qBrush ) - - nOffW := ::nHPxMM * 10 // 10 mm - nOffH := ::nVPxMM * 10 // 10 MM - - ::qPaper:setRect_1( nOffW, nOffH, ::nPgWidth - nOffW * 2, ::nPgHeight - nOffH * 2 ) - - ::qScene:addItem( ::qPaper ) - - RETURN Self - -/*----------------------------------------------------------------------*/ - -METHOD IdeReportsManager:addRect( qPos, cType ) - LOCAL oWidget, cName - - STATIC nW := 400 - STATIC nH := 300 - - nW -= 30 - nH -= 30 - - cName := cType + "_" + hb_ntos( hbide_getNextID( cType ) ) - - oWidget := HBQGraphicsRectItem():new() - oWidget:hbSetBlock( {|p,p1,p2| ::execEvent( "graphicsPaper_block", p, p1, p2 ) } ) - oWidget:setFlag( QGraphicsItem_ItemIsMovable , .t. ) - oWidget:setFlag( QGraphicsItem_ItemIsSelectable, .t. ) - * oWidget:setFlag( QGraphicsItem_ItemClipsChildrenToShape, .t. ) - * oWidget:setAcceptDrops( .t. ) - * oWidget:setAcceptHoverEvents( .t. ) - * oWidget:setPen( ::qPen ) - * oWidget:setBrush( ::qBrush ) - - ::qScene:addItem( oWidget ) - - oWidget:setRect_1( 0, 0, nW, nH ) - IF !empty( qPos ) - oWidget:setPos( qPos ) - ENDIF - - ::hItems[ cName ] := oWidget - RETURN Self - -/*----------------------------------------------------------------------*/ - METHOD IdeReportsManager:addObject( qPos, cType ) - LOCAL oWidget, cName - LOCAL nW := 50 - LOCAL nH := 30 + LOCAL oWidget, cName, nW, nH, qGrad cName := cType + "_" + hb_ntos( hbide_getNextID( cType ) ) - oWidget := HBQGraphicsRectItem():new() - oWidget:hbSetBlock( {|p,p1,p2| ::execEvent( "graphicsPaper_block", p, p1, p2 ) } ) - oWidget:setFlag( QGraphicsItem_ItemIsMovable , .t. ) - oWidget:setFlag( QGraphicsItem_ItemIsSelectable, .t. ) - oWidget:setPen( QPen():new( Qt_NoPen ) ) - SWITCH cType - CASE "Barcode" - oWidget:setBrush( QBrush():new( "QColor", QColor():new( 120,200,245 ) ) ) + CASE "Image" + oWidget := HBQGraphicsItem():new( HBQT_GRAPHICSITEM_PICTURE ) + nW := 300 ; nH := 300 + oWidget:setBrush( QBrush():new( "QColor", QColor():new( 255,180,112 ) ) ) + oWidget:setPixmap( QPixmap():new( hbide_image( "hbide" ) ) ) EXIT CASE "Chart" - nW := 100 ; nH := 40 - oWidget:setBrush( QBrush():new( "QColor", QColor():new( 200,14,127 ) ) ) - EXIT - CASE "Image" - nW := 120 ; nH := 100 - oWidget:setBrush( QBrush():new( "QColor", QColor():new( 255,180,112 ) ) ) + oWidget := HBQGraphicsItem():new( HBQT_GRAPHICSITEM_ELLIPSE ) + nW := 300 ; nH := 200 + oWidget:setBrush( QBrush():new( "QColor", QColor():new( 200,114,127 ) ) ) EXIT CASE "Gradient" - nW := 90 ; nH := 70 - oWidget:setBrush( QBrush():new( "QColor", QColor():new( 120,255,145 ) ) ) + qGrad := QLinearGradient():new( 0, 0, 100, 100 ) + qGrad:setColorAt( 0, QColor():new( 195,225,255 ) ) + qGrad:setColorAt( 1, QColor():new( Qt_black ) ) + + oWidget := HBQGraphicsItem():new( HBQT_GRAPHICSITEM_RECT ) + nW := 300 ; nH := 50 + oWidget:setBrush( QBrush():new( "QGradient", qGrad ) ) + oWidget:setPen( QPen():new( Qt_NoPen ) ) + EXIT + CASE "Barcode" + oWidget := HBQGraphicsItem():new( HBQT_GRAPHICSITEM_RECT ) + nW := 300 ; nH := 200 + oWidget:setBrush( QBrush():new( "QColor", QColor():new( 120,200,245 ) ) ) + EXIT + CASE "Text" + oWidget := HBQGraphicsItem():new( HBQT_GRAPHICSITEM_SIMPLETEXT ) + nW := 300 ; nH := 50 + oWidget:setBrush( QBrush():new( "QColor", QColor():new( 200,200,245 ) ) ) + oWidget:setText( "Harbour" ) EXIT ENDSWITCH + oWidget:hbSetBlock( {|p,p1,p2| ::execEvent( "graphicsPaper_block", p, p1, p2 ) } ) + ::qScene:addItem( oWidget ) - oWidget:setRect_1( 0, 0, nW, nH ) + oWidget:setGeometry( QRectF():new( 0, 0, nW, nH ) ) IF !empty( qPos ) oWidget:setPos( qPos ) ENDIF @@ -587,9 +531,21 @@ METHOD IdeReportsManager:addObject( qPos, cType ) /*----------------------------------------------------------------------*/ METHOD IdeReportsManager:addField( qPos, cAlias, cField ) - HB_SYMBOL_UNUSED( qPos ) - HB_SYMBOL_UNUSED( cAlias ) - HB_SYMBOL_UNUSED( cField ) + LOCAL oWidget, nW := 300, nH := 50 + LOCAL cName := cAlias + "..." + cField + + oWidget := HBQGraphicsItem():new( HBQT_GRAPHICSITEM_SIMPLETEXT ) + oWidget:setText( cName ) + oWidget:hbSetBlock( {|p,p1,p2| ::execEvent( "graphicsPaper_block", p, p1, p2 ) } ) + oWidget:setGeometry( QRectF():new( 0, 0, nW, nH ) ) + + ::qScene:addItem( oWidget ) + + IF !empty( qPos ) + oWidget:setPos( qPos ) + ENDIF + ::hItems[ cName ] := oWidget + RETURN Self /*----------------------------------------------------------------------*/ @@ -675,6 +631,15 @@ METHOD IdeReportsManager:buildToolbarAlign() ::qToolbarAlign:addToolButton( "BoxP" , "No box-frame" , hbide_image( "f_box_plain" ), {|| ::execEvent( "button_clicked" ) } ) ::qToolbarAlign:addToolButton( "BoxS" , "Box shadowed" , hbide_image( "f_box_shadow" ), {|| ::execEvent( "button_clicked" ) } ) ::qToolbarAlign:addSeparator() + ::qToolbarAlign:addToolButton( "ZoomIn" , "Zoom In" , hbide_image( "zoomin3" ), {|| ::execEvent( "buttonZoom_clicked", 1 ) } ) + ::qToolbarAlign:addToolButton( "ZoomOut", "Zoom Out" , hbide_image( "zoomout3" ), {|| ::execEvent( "buttonZoom_clicked", 2 ) } ) + ::qToolbarAlign:addToolButton( "ZoomWYS", "Zoom WYSIWYG" , hbide_image( "zoomin" ), {|| ::execEvent( "buttonZoom_clicked", 3 ) } ) + ::qToolbarAlign:addToolButton( "ZoomOrg", "Zoom Original" , hbide_image( "zoomout" ), {|| ::execEvent( "buttonZoom_clicked", 4 ) } ) + ::qToolbarAlign:addSeparator() + ::qToolbarAlign:addToolButton( "Grid" , "Show Grid" , hbide_image( "grid" ), {|| ::execEvent( "buttonGrid_clicked", 4 ) }, .t., .f. ) + ::qToolbarAlign:addSeparator() + + ::qToolbarAlign:setItemChecked( "Grid", .t. ) RETURN Self @@ -690,6 +655,7 @@ METHOD IdeReportsManager:buildToolbarLeft() ::qToolbarL:addToolButton( "Chart" , "Chart" , hbide_image( "f_chart" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) ::qToolbarL:addToolButton( "Gradient", "Gradient", hbide_image( "f_gradient" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) ::qToolbarL:addToolButton( "Barcode" , "Barcode" , hbide_image( "f_barcode" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) + ::qToolbarL:addToolButton( "Text" , "Text" , hbide_image( "text" ), {|| ::execEvent( "buttonNew_clicked" ) }, .t., .t. ) RETURN Self @@ -722,3 +688,4 @@ METHOD IdeReportsManager:buildStatusBar() /*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbide/resources/designer.png b/harbour/contrib/hbide/resources/designer.png index c3cf8a767d3438b22782f459f609afa3ef14a767..1cf6b30170cc4df7b9b996499827fd642f3b88e8 100644 GIT binary patch delta 643 zcmV-}0(||H2Alu_U(?pr*4l0DXsx5}k8H@o>_H3m z?m=WQyo=zeVA*BfiiaJ&D2#!E2!(+Mk9yl-$Q)Q2iqhe%W0bXqu34p9x;9M{f6eAx z)b7Dc;N_PO@ArNQgX558`5D77x6mVWT}LvRe34G47f;ujQ-6R+ZvxJUR4QfAb&2KW z<;8!1YPBk&v?4IO>pg+j9~nq>7&hLKSXfwCv;dV#MN~6Sh1Ta+XEg!)wfnGLpDXzN z{!t4cNs`#9eG@eKD;TW>gV_HI5Z^dB?`RN zV9*K_i$xRQ<$q7;`|=2?e+Juw46p;M`&X=u0GaIrdk z4)$aQQ&Uq`Ad|_6HI)_KZ|uYEp1=iNq zM9%IMct;;JgN0Lmi$(qu(Y(~ak*S!x7+=gBjjeQV-Q+*@KEUt z0E6LRP>|;cy>^;lIE_ZOUavn<6s5?}-*be%(A`*orkkegxU=&#e@{)PxlgluJ_j`G d-LIeK`Y(*X?*130R3ZQX002ovPDHLkV1mK&J+S}) delta 764 zcmVpfFE2iY38IJ$j=co=R8T!shJs+34vE)P%+yqJyo{scIA@=^oc5gY zLRh`D;pboL!2b4H>+H?oKNn-MShQ=$PJ47h2z0y_sta0#^M64PC2VUaelxUyc*c(Y{{Cj8(O9q#;7Q0J8Tu)BQ_e%A z8v+Vtu^Ug=HW1-=VSaudR;%?+VPT+iF^oR|FCIk9u3`zDk_42#>Pf2 zH7lDqt;I-BTmh@mfPsRckwqN2KCrKy_OYL^zI-ZHR)1Co0Syfe+^LH!6#t+$BQKviHKQtu0~s;Vjop#PT3%r=tmo%d9LeKQG>@p)L9 zs6mv$4u@j}qvH}%^2d?J0iULp(b;C+1JH?bS90>n==-}!PqM@ANS5?(uF^U9pwWcD zHroz?orD-NfvK5IIHWXr-8mOqQ1)#_1(-}G?nZGnv46ggwRIj7?28{EiXm`sN#F$yBsT%av5+JW z1o|!{$xFX$=>Z<%auK(lmx~#eWy2r88*zqlT7>c%s802-{Lle5s%jg5`iWTbs0000Ygr+Ar-fhQx*sqIKBKIV7Aia t4#TRQ4JqFYN)Be|@UV&V#OO@mW!NL5Dfq~Z>km*1gQu&X%Q~loCIE2C8tVW6 literal 0 HcmV?d00001 diff --git a/harbour/contrib/hbqt/hbqt.ch b/harbour/contrib/hbqt/hbqt.ch index 5ecf6bcf66..777913f0b5 100644 --- a/harbour/contrib/hbqt/hbqt.ch +++ b/harbour/contrib/hbqt/hbqt.ch @@ -2290,6 +2290,47 @@ /*----------------------------------------------------------------------*/ +#define HBQT_GRAPHICSITEM_NONE 0 +#define HBQT_GRAPHICSITEM_RECT 1 +#define HBQT_GRAPHICSITEM_LINE 2 +#define HBQT_GRAPHICSITEM_ELLIPSE 3 +#define HBQT_GRAPHICSITEM_ARC 4 +#define HBQT_GRAPHICSITEM_CHORD 5 +#define HBQT_GRAPHICSITEM_POLYGON 6 +#define HBQT_GRAPHICSITEM_PIE 7 +#define HBQT_GRAPHICSITEM_PATH 8 +#define HBQT_GRAPHICSITEM_CHART 9 +#define HBQT_GRAPHICSITEM_GRADIENT 10 +#define HBQT_GRAPHICSITEM_PICTURE 11 +#define HBQT_GRAPHICSITEM_BARCODE 12 +#define HBQT_GRAPHICSITEM_TEXT 13 +#define HBQT_GRAPHICSITEM_SIMPLETEXT 14 + +#define HBQT_GRAPHICSITEM_LINE_HORIZONTAL 0 +#define HBQT_GRAPHICSITEM_LINE_VERTICAL 1 +#define HBQT_GRAPHICSITEM_LINE_BACKWARDDIAGONAL 2 +#define HBQT_GRAPHICSITEM_LINE_FORWARDDIAGONAL 3 + +#define HBQT_GRAPHICSITEM_TEXT_DRAW_NONE 0 +#define HBQT_GRAPHICSITEM_TEXT_DRAW_TOP 1 +#define HBQT_GRAPHICSITEM_TEXT_DRAW_BOTTOM 2 +#define HBQT_GRAPHICSITEM_TEXT_DRAW_ABOVE 3 +#define HBQT_GRAPHICSITEM_TEXT_DRAW_BELOW 4 + +#define HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_NONE 0 +#define HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_AUTO 1 +#define HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_STRETCH 2 + +#define HBQT_GRAPHICSITEM_IMAGE_NO_FRAME 0 +#define HBQT_GRAPHICSITEM_IMAGE_PICTURE_BIND 1 +#define HBQT_GRAPHICSITEM_IMAGE_PICTURE_BOX 2 + +#define HBQT_GRAPHICSITEM_RESIZE_ITEM_TO_PICTURE 1 +#define HBQT_GRAPHICSITEM_CENTER_PICTURE_TO_ITEM 2 +#define HBQT_GRAPHICSITEM_RESIZE_PICTURE_TO_ITEM_KEEP_ASPECT_RATIO 3 +#define HBQT_GRAPHICSITEM_RESIZE_PICTURE_TO_ITEM_IGNORE_ASPECT_RATIO 4 + + #define QGraphicsScene_BspTreeIndex 0 #define QGraphicsScene_NoIndex -1 diff --git a/harbour/contrib/hbqt/qtgui/doc/en/class_hbqgraphicsitem.txt b/harbour/contrib/hbqt/qtgui/doc/en/class_hbqgraphicsitem.txt index 07b9dc83f7..09664ce207 100644 --- a/harbour/contrib/hbqt/qtgui/doc/en/class_hbqgraphicsitem.txt +++ b/harbour/contrib/hbqt/qtgui/doc/en/class_hbqgraphicsitem.txt @@ -27,6 +27,52 @@ * An instance of the object of type HBQGraphicsItem * $METHODS$ * :hbSetBlock( xBlock ) -> NIL + * :pen() -> pQPen + * :setPen( pPen ) -> NIL + * :brush() -> pQBrush + * :setBrush( pBrush ) -> NIL + * :backgroundBrush() -> pQBrush + * :setBackgroundBrush( pBrush ) -> NIL + * :font() -> pQFont + * :setFont( pFont ) -> NIL + * :lineStyle() -> nInt + * :setLineStyle( nLineStyle ) -> NIL + * :startAngle() -> nInt + * :setStartAngle( nStartAngle ) -> NIL + * :spanAngle() -> nInt + * :setSpanAngle( nSpanAngle ) -> NIL + * :width() -> nQreal + * :setWidth( nWidth ) -> NIL + * :height() -> nQreal + * :setHeight( nHeight ) -> NIL + * :opacity() -> nInt + * :setOpacity( nOpacity ) -> NIL + * :geometry() -> pQRectF + * :setGeometry( pRect ) -> NIL + * :objectType() -> cQString + * :setObjectType( cType ) -> NIL + * :text() -> cQString + * :setText( cType ) -> NIL + * :paintType() -> nInt + * :setPaintType( nPaintType ) -> NIL + * :frameType() -> nInt + * :setFrameType( nFrameType ) -> NIL + * :drawTextType() -> nInt + * :setDrawTextType( nDrawTextType ) -> NIL + * :pixmap() -> pQPixmap + * :setPixmap( pPixmap ) -> NIL + * :textColor() -> pQColor + * :setTextColor( pColor ) -> NIL + * :borderWidth() -> nInt + * :setBorderWidth( nBWidth ) -> NIL + * :borderColor() -> pQColor + * :setBorderColor( pColor ) -> NIL + * :sizePolicy() -> nInt + * :setSizePolicy( nSizePolicy ) -> NIL + * :textFlags() -> nInt + * :setTextFlags( nTextFlags ) -> NIL + * :resizeFlags() -> nInt + * :setResizeFlags( nResizeFlags ) -> NIL * * $DESCRIPTION$ * diff --git a/harbour/contrib/hbqt/qtgui/doc/en/class_hbqgraphicsscene.txt b/harbour/contrib/hbqt/qtgui/doc/en/class_hbqgraphicsscene.txt new file mode 100644 index 0000000000..85528ff1c4 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/doc/en/class_hbqgraphicsscene.txt @@ -0,0 +1,74 @@ +/* + * $Id$ + */ + +/* $DOC$ + * $TEMPLATE$ + * Class + * $NAME$ + * HBQGraphicsScene() + * $CATEGORY$ + * Harbour Bindings for Qt + * $SUBCATEGORY$ + * GUI + * $EXTERNALLINK$ + * http://doc.trolltech.com/4.5/hbqgraphicsscene.html + * $ONELINER$ + * Creates a new HBQGraphicsScene object. + * $INHERITS$ + * QGraphicsScene + * $SYNTAX$ + * HBQGraphicsScene():new( ... ) + * HBQGraphicsScene():from( pPtr_OR_oObj_of_type_HBQGraphicsScene ) + * HBQGraphicsScene():configure( pPtr_OR_oObj_of_type_HBQGraphicsScene ) + * $ARGUMENTS$ + * + * $RETURNS$ + * An instance of the object of type HBQGraphicsScene + * $METHODS$ + * :hbSetBlock( xBlock ) -> NIL + * :pageSize() -> nInt + * :setPageSize( nPageSize ) -> NIL + * :paperRect() -> pQRectF + * :setPaperRect( pPaperRect ) -> NIL + * :orientation() -> nInt + * :setOrientation( nOrientation ) -> NIL + * :geometry() -> pQRectF + * :setGeometry( pRect ) -> NIL + * :magnetArea() -> nInt + * :setMagnetArea( nMagnetArea ) -> NIL + * :showGrid() -> lBool + * :setShowGrid( lShowGrid ) -> NIL + * :zoomWYSIWYG() -> NIL + * :zoomIn() -> NIL + * :zoomOut() -> NIL + * :zoomOriginal() -> NIL + * :setLeftMagnet( lMagneted ) -> NIL + * :setRightMagnet( lMagneted ) -> NIL + * :setTopMagnet( lMagneted ) -> NIL + * :setBottomMagnet( lMagneted ) -> NIL + * :setHorizontalMagnet( lMagneted ) -> NIL + * :setVerticalMagnet( lMagneted ) -> NIL + * + * $DESCRIPTION$ + * + * $EXAMPLES$ + * + * $TESTS$ + * + * $STATUS$ + * R + * $COMPLIANCE$ + * Not Clipper compatible + * $PLATFORMS$ + * Windows, Linux, Mac OS X, OS/2 + * $VERSION$ + * 4.5 or upper + * $FILES$ + * Harbour source: contrib/hbqt/qtgui/THBQGraphicsScene.prg + * C++ wrappers : contrib/hbqt/qtgui/HBQGraphicsScene.cpp + * Library : hbqtgui + * $SEEALSO$ + * QGraphicsScene + * $END$ + */ diff --git a/harbour/contrib/hbqt/qtgui/g/HBQGraphicsItem.cpp b/harbour/contrib/hbqt/qtgui/g/HBQGraphicsItem.cpp index b89148d053..a578fceae4 100644 --- a/harbour/contrib/hbqt/qtgui/g/HBQGraphicsItem.cpp +++ b/harbour/contrib/hbqt/qtgui/g/HBQGraphicsItem.cpp @@ -87,11 +87,26 @@ typedef struct HBQT_GC_FUNC( hbqt_gcRelease_HBQGraphicsItem ) { - HB_SYMBOL_UNUSED( Cargo ); HBQT_GC_T * p = ( HBQT_GC_T * ) Cargo; if( p && p->bNew ) { + if( p->ph ) + { + HB_TRACE( HB_TR_DEBUG, ( "ph=%p _rel_HBQGraphicsItem /.\\", p->ph ) ); + delete ( ( HBQGraphicsItem * ) p->ph ); + HB_TRACE( HB_TR_DEBUG, ( "ph=%p YES_rel_HBQGraphicsItem \\./", p->ph ) ); + p->ph = NULL; + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "ph=%p DEL_rel_HBQGraphicsItem : Object already deleted!", p->ph ) ); + p->ph = NULL; + } + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "ph=%p PTR_rel_HBQGraphicsItem : Object not created with new=true", p->ph ) ); p->ph = NULL; } } @@ -118,11 +133,25 @@ void * hbqt_gcAllocate_HBQGraphicsItem( void * pObj, bool bNew ) HB_FUNC( QT_HBQGRAPHICSITEM ) { - // hb_retptr( new HBQGraphicsItem() ); + HBQGraphicsItem * pObj = NULL; + + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + pObj = new HBQGraphicsItem( hb_parni( 1 ) ) ; + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) ) + { + pObj = new HBQGraphicsItem( hb_parni( 1 ), hbqt_par_QGraphicsItem( 2 ) ) ; + } + else { + pObj = new HBQGraphicsItem() ; + } + + hb_retptrGC( hbqt_gcAllocate_HBQGraphicsItem( ( void * ) pObj, true ) ); } /* - * void hbSetBlock( PHB_ITEM block ) + * void hbSetBlock( PHB_ITEM block ) */ HB_FUNC( QT_HBQGRAPHICSITEM_HBSETBLOCK ) { @@ -135,6 +164,650 @@ HB_FUNC( QT_HBQGRAPHICSITEM_HBSETBLOCK ) } } +/* + * QPen pen() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_PEN ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QPen( new QPen( ( p )->pen() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_PEN FP=hb_retptrGC( hbqt_gcAllocate_QPen( new QPen( ( p )->pen() ), true ) ); p is NULL" ) ); + } +} + +/* + * void setPen( const QPen & pen ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETPEN ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setPen( *hbqt_par_QPen( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETPEN FP=( p )->setPen( *hbqt_par_QPen( 2 ) ); p is NULL" ) ); + } +} + +/* + * QBrush brush() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_BRUSH ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QBrush( new QBrush( ( p )->brush() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_BRUSH FP=hb_retptrGC( hbqt_gcAllocate_QBrush( new QBrush( ( p )->brush() ), true ) ); p is NULL" ) ); + } +} + +/* + * void setBrush( const QBrush & brush ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETBRUSH ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setBrush( *hbqt_par_QBrush( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETBRUSH FP=( p )->setBrush( *hbqt_par_QBrush( 2 ) ); p is NULL" ) ); + } +} + +/* + * QBrush backgroundBrush() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_BACKGROUNDBRUSH ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QBrush( new QBrush( ( p )->backgroundBrush() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_BACKGROUNDBRUSH FP=hb_retptrGC( hbqt_gcAllocate_QBrush( new QBrush( ( p )->backgroundBrush() ), true ) ); p is NULL" ) ); + } +} + +/* + * void setBackgroundBrush( const QBrush & brush ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETBACKGROUNDBRUSH ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setBackgroundBrush( *hbqt_par_QBrush( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETBACKGROUNDBRUSH FP=( p )->setBackgroundBrush( *hbqt_par_QBrush( 2 ) ); p is NULL" ) ); + } +} + +/* + * QFont font() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_FONT ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QFont( new QFont( ( p )->font() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_FONT FP=hb_retptrGC( hbqt_gcAllocate_QFont( new QFont( ( p )->font() ), true ) ); p is NULL" ) ); + } +} + +/* + * void setFont( const QFont & font ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETFONT ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setFont( *hbqt_par_QFont( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETFONT FP=( p )->setFont( *hbqt_par_QFont( 2 ) ); p is NULL" ) ); + } +} + +/* + * int lineStyle() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_LINESTYLE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->lineStyle() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_LINESTYLE FP=hb_retni( ( p )->lineStyle() ); p is NULL" ) ); + } +} + +/* + * void setLineStyle( int lineStyle ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETLINESTYLE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setLineStyle( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETLINESTYLE FP=( p )->setLineStyle( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * int startAngle() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_STARTANGLE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->startAngle() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_STARTANGLE FP=hb_retni( ( p )->startAngle() ); p is NULL" ) ); + } +} + +/* + * void setStartAngle( int startAngle ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETSTARTANGLE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setStartAngle( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETSTARTANGLE FP=( p )->setStartAngle( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * int spanAngle() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SPANANGLE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->spanAngle() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SPANANGLE FP=hb_retni( ( p )->spanAngle() ); p is NULL" ) ); + } +} + +/* + * void setSpanAngle( int spanAngle ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETSPANANGLE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setSpanAngle( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETSPANANGLE FP=( p )->setSpanAngle( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * qreal width() const + */ +HB_FUNC( QT_HBQGRAPHICSITEM_WIDTH ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retnd( ( p )->width() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_WIDTH FP=hb_retnd( ( p )->width() ); p is NULL" ) ); + } +} + +/* + * void setWidth( qreal width ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETWIDTH ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setWidth( hb_parnd( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETWIDTH FP=( p )->setWidth( hb_parnd( 2 ) ); p is NULL" ) ); + } +} + +/* + * qreal height() const + */ +HB_FUNC( QT_HBQGRAPHICSITEM_HEIGHT ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retnd( ( p )->height() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_HEIGHT FP=hb_retnd( ( p )->height() ); p is NULL" ) ); + } +} + +/* + * void setHeight( qreal height ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETHEIGHT ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setHeight( hb_parnd( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETHEIGHT FP=( p )->setHeight( hb_parnd( 2 ) ); p is NULL" ) ); + } +} + +/* + * int opacity() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_OPACITY ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->opacity() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_OPACITY FP=hb_retni( ( p )->opacity() ); p is NULL" ) ); + } +} + +/* + * void setOpacity( const int opacity ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETOPACITY ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setOpacity( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETOPACITY FP=( p )->setOpacity( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * QRectF geometry() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_GEOMETRY ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QRectF( new QRectF( ( p )->geometry() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_GEOMETRY FP=hb_retptrGC( hbqt_gcAllocate_QRectF( new QRectF( ( p )->geometry() ), true ) ); p is NULL" ) ); + } +} + +/* + * void setGeometry( const QRectF & rect ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETGEOMETRY ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setGeometry( *hbqt_par_QRectF( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETGEOMETRY FP=( p )->setGeometry( *hbqt_par_QRectF( 2 ) ); p is NULL" ) ); + } +} + +/* + * QString objectType() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_OBJECTTYPE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retc( ( p )->objectType().toAscii().data() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_OBJECTTYPE FP=hb_retc( ( p )->objectType().toAscii().data() ); p is NULL" ) ); + } +} + +/* + * void setObjectType( const QString & type ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETOBJECTTYPE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setObjectType( hbqt_par_QString( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETOBJECTTYPE FP=( p )->setObjectType( hbqt_par_QString( 2 ) ); p is NULL" ) ); + } +} + +/* + * QString text() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_TEXT ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retc( ( p )->text().toAscii().data() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_TEXT FP=hb_retc( ( p )->text().toAscii().data() ); p is NULL" ) ); + } +} + +/* + * void setText( const QString & type ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETTEXT ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setText( hbqt_par_QString( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETTEXT FP=( p )->setText( hbqt_par_QString( 2 ) ); p is NULL" ) ); + } +} + +/* + * int paintType() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_PAINTTYPE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->paintType() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_PAINTTYPE FP=hb_retni( ( p )->paintType() ); p is NULL" ) ); + } +} + +/* + * void setPaintType( int paintType ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETPAINTTYPE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setPaintType( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETPAINTTYPE FP=( p )->setPaintType( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * int frameType() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_FRAMETYPE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->frameType() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_FRAMETYPE FP=hb_retni( ( p )->frameType() ); p is NULL" ) ); + } +} + +/* + * void setFrameType( int frameType ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETFRAMETYPE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setFrameType( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETFRAMETYPE FP=( p )->setFrameType( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * int drawTextType() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_DRAWTEXTTYPE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->drawTextType() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_DRAWTEXTTYPE FP=hb_retni( ( p )->drawTextType() ); p is NULL" ) ); + } +} + +/* + * void setDrawTextType( int drawTextType ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETDRAWTEXTTYPE ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setDrawTextType( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETDRAWTEXTTYPE FP=( p )->setDrawTextType( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * QPixmap pixmap() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_PIXMAP ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->pixmap() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_PIXMAP FP=hb_retptrGC( hbqt_gcAllocate_QPixmap( new QPixmap( ( p )->pixmap() ), true ) ); p is NULL" ) ); + } +} + +/* + * void setPixmap( const QPixmap & pixmap ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETPIXMAP ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setPixmap( *hbqt_par_QPixmap( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETPIXMAP FP=( p )->setPixmap( *hbqt_par_QPixmap( 2 ) ); p is NULL" ) ); + } +} + +/* + * QColor textColor() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_TEXTCOLOR ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->textColor() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_TEXTCOLOR FP=hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->textColor() ), true ) ); p is NULL" ) ); + } +} + +/* + * void setTextColor( const QColor & color ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETTEXTCOLOR ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setTextColor( *hbqt_par_QColor( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETTEXTCOLOR FP=( p )->setTextColor( *hbqt_par_QColor( 2 ) ); p is NULL" ) ); + } +} + +/* + * int borderWidth() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_BORDERWIDTH ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->borderWidth() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_BORDERWIDTH FP=hb_retni( ( p )->borderWidth() ); p is NULL" ) ); + } +} + +/* + * void setBorderWidth( int bWidth ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETBORDERWIDTH ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setBorderWidth( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETBORDERWIDTH FP=( p )->setBorderWidth( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * QColor borderColor() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_BORDERCOLOR ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->borderColor() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_BORDERCOLOR FP=hb_retptrGC( hbqt_gcAllocate_QColor( new QColor( ( p )->borderColor() ), true ) ); p is NULL" ) ); + } +} + +/* + * void setBorderColor( const QColor & color ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETBORDERCOLOR ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setBorderColor( *hbqt_par_QColor( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETBORDERCOLOR FP=( p )->setBorderColor( *hbqt_par_QColor( 2 ) ); p is NULL" ) ); + } +} + +/* + * int sizePolicy() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SIZEPOLICY ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->sizePolicy() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SIZEPOLICY FP=hb_retni( ( p )->sizePolicy() ); p is NULL" ) ); + } +} + +/* + * void setSizePolicy( int sizePolicy ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETSIZEPOLICY ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setSizePolicy( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETSIZEPOLICY FP=( p )->setSizePolicy( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * int textFlags() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_TEXTFLAGS ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->textFlags() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_TEXTFLAGS FP=hb_retni( ( p )->textFlags() ); p is NULL" ) ); + } +} + +/* + * void setTextFlags( int textFlags ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETTEXTFLAGS ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setTextFlags( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETTEXTFLAGS FP=( p )->setTextFlags( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * int resizeFlags() + */ +HB_FUNC( QT_HBQGRAPHICSITEM_RESIZEFLAGS ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + hb_retni( ( p )->resizeFlags() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_RESIZEFLAGS FP=hb_retni( ( p )->resizeFlags() ); p is NULL" ) ); + } +} + +/* + * void setResizeFlags( int resizeFlags ) + */ +HB_FUNC( QT_HBQGRAPHICSITEM_SETRESIZEFLAGS ) +{ + HBQGraphicsItem * p = hbqt_par_HBQGraphicsItem( 1 ); + if( p ) + ( p )->setResizeFlags( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSITEM_SETRESIZEFLAGS FP=( p )->setResizeFlags( hb_parni( 2 ) ); p is NULL" ) ); + } +} + /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ diff --git a/harbour/contrib/hbqt/qtgui/g/HBQGraphicsScene.cpp b/harbour/contrib/hbqt/qtgui/g/HBQGraphicsScene.cpp new file mode 100644 index 0000000000..69e88bf5b8 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/g/HBQGraphicsScene.cpp @@ -0,0 +1,490 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009-2010 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://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 "hbqtcore.h" +#include "hbqtgui.h" + +/*----------------------------------------------------------------------*/ +#if QT_VERSION >= 0x040500 +/*----------------------------------------------------------------------*/ + +/* + * enum Magnet { Left, Right, Top, Bottom, Vertical, Horizontal } + */ + +#include + +#include +#include "hbqt_hbqgraphicsscene.h" + +/* + * HBQGraphicsScene() + * HBQGraphicsScene( QObject * parent ) + * ~HBQGraphicsScene() + */ + +typedef struct +{ + QPointer< HBQGraphicsScene > ph; + bool bNew; + PHBQT_GC_FUNC func; + int type; +} HBQT_GC_T_HBQGraphicsScene; + +HBQT_GC_FUNC( hbqt_gcRelease_HBQGraphicsScene ) +{ + HBQGraphicsScene * ph = NULL ; + HBQT_GC_T_HBQGraphicsScene * p = ( HBQT_GC_T_HBQGraphicsScene * ) Cargo; + + if( p && p->bNew && p->ph ) + { + ph = p->ph; + if( ph ) + { + const QMetaObject * m = ( ph )->metaObject(); + if( ( QString ) m->className() != ( QString ) "QObject" ) + { + HB_TRACE( HB_TR_DEBUG, ( "ph=%p %p YES_rel_HBQGraphicsScene /.\\ ", (void*) ph, (void*) p->ph ) ); + delete ( p->ph ); + HB_TRACE( HB_TR_DEBUG, ( "ph=%p %p YES_rel_HBQGraphicsScene \\./ ", (void*) ph, (void*) p->ph ) ); + p->ph = NULL; + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "ph=%p NO__rel_HBQGraphicsScene ", ph ) ); + p->ph = NULL; + } + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "ph=%p DEL_rel_HBQGraphicsScene : Object already deleted!", ph ) ); + p->ph = NULL; + } + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "ph=%p PTR_rel_HBQGraphicsScene : Object not created with new=true", ph ) ); + p->ph = NULL; + } +} + +void * hbqt_gcAllocate_HBQGraphicsScene( void * pObj, bool bNew ) +{ + HBQT_GC_T_HBQGraphicsScene * p = ( HBQT_GC_T_HBQGraphicsScene * ) hb_gcAllocate( sizeof( HBQT_GC_T_HBQGraphicsScene ), hbqt_gcFuncs() ); + + new( & p->ph ) QPointer< HBQGraphicsScene >( ( HBQGraphicsScene * ) pObj ); + p->bNew = bNew; + p->func = hbqt_gcRelease_HBQGraphicsScene; + p->type = HBQT_TYPE_HBQGraphicsScene; + + if( bNew ) + { + HB_TRACE( HB_TR_DEBUG, ( "ph=%p _new_HBQGraphicsScene under p->pq", pObj ) ); + } + else + { + HB_TRACE( HB_TR_DEBUG, ( "ph=%p NOT_new_HBQGraphicsScene", pObj ) ); + } + return p; +} + +HB_FUNC( QT_HBQGRAPHICSSCENE ) +{ + HBQGraphicsScene * pObj = NULL; + + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + pObj = new HBQGraphicsScene( hbqt_par_QObject( 1 ) ) ; + } + else + { + pObj = new HBQGraphicsScene() ; + } + + hb_retptrGC( hbqt_gcAllocate_HBQGraphicsScene( ( void * ) pObj, true ) ); +} + +/* + * void hbSetBlock( PHB_ITEM block ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_HBSETBLOCK ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->hbSetBlock( hb_param( 2, HB_IT_ANY ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_HBSETBLOCK FP=( p )->hbSetBlock( hb_param( 2, HB_IT_ANY ) ); p is NULL" ) ); + } +} + +/* + * virtual int pageSize() + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_PAGESIZE ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + hb_retni( ( p )->pageSize() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_PAGESIZE FP=hb_retni( ( p )->pageSize() ); p is NULL" ) ); + } +} + +/* + * virtual void setPageSize( int pageSize ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETPAGESIZE ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setPageSize( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETPAGESIZE FP=( p )->setPageSize( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * QRectF paperRect() + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_PAPERRECT ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QRectF( new QRectF( ( p )->paperRect() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_PAPERRECT FP=hb_retptrGC( hbqt_gcAllocate_QRectF( new QRectF( ( p )->paperRect() ), true ) ); p is NULL" ) ); + } +} + +/* + * void setPaperRect( const QRectF & paperRect ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETPAPERRECT ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setPaperRect( *hbqt_par_QRectF( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETPAPERRECT FP=( p )->setPaperRect( *hbqt_par_QRectF( 2 ) ); p is NULL" ) ); + } +} + +/* + * virtual int orientation() + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_ORIENTATION ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + hb_retni( ( p )->orientation() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_ORIENTATION FP=hb_retni( ( p )->orientation() ); p is NULL" ) ); + } +} + +/* + * virtual void setOrientation( int orientation ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETORIENTATION ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setOrientation( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETORIENTATION FP=( p )->setOrientation( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * virtual QRectF geometry() + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_GEOMETRY ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + hb_retptrGC( hbqt_gcAllocate_QRectF( new QRectF( ( p )->geometry() ), true ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_GEOMETRY FP=hb_retptrGC( hbqt_gcAllocate_QRectF( new QRectF( ( p )->geometry() ), true ) ); p is NULL" ) ); + } +} + +/* + * virtual void setGeometry( const QRectF & rect ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETGEOMETRY ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setGeometry( *hbqt_par_QRectF( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETGEOMETRY FP=( p )->setGeometry( *hbqt_par_QRectF( 2 ) ); p is NULL" ) ); + } +} + +/* + * int magnetArea() + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_MAGNETAREA ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + hb_retni( ( p )->magnetArea() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_MAGNETAREA FP=hb_retni( ( p )->magnetArea() ); p is NULL" ) ); + } +} + +/* + * void setMagnetArea( int magnetArea ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETMAGNETAREA ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setMagnetArea( hb_parni( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETMAGNETAREA FP=( p )->setMagnetArea( hb_parni( 2 ) ); p is NULL" ) ); + } +} + +/* + * virtual bool showGrid() + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SHOWGRID ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + hb_retl( ( p )->showGrid() ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SHOWGRID FP=hb_retl( ( p )->showGrid() ); p is NULL" ) ); + } +} + +/* + * virtual void setShowGrid( bool showGrid ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETSHOWGRID ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setShowGrid( hb_parl( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETSHOWGRID FP=( p )->setShowGrid( hb_parl( 2 ) ); p is NULL" ) ); + } +} + +/* + * virtual void zoomWYSIWYG(); + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_ZOOMWYSIWYG ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->zoomWYSIWYG(); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_ZOOMWYSIWYG FP=( p )->zoomWYSIWYG(); p is NULL" ) ); + } +} + +/* + * virtual void zoomIn(); + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_ZOOMIN ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->zoomIn(); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_ZOOMIN FP=( p )->zoomIn(); p is NULL" ) ); + } +} + +/* + * virtual void zoomOut(); + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_ZOOMOUT ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->zoomOut(); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_ZOOMOUT FP=( p )->zoomOut(); p is NULL" ) ); + } +} + +/* + * virtual void zoomOriginal(); + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_ZOOMORIGINAL ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->zoomOriginal(); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_ZOOMORIGINAL FP=( p )->zoomOriginal(); p is NULL" ) ); + } +} + +/* + * virtual void setLeftMagnet( bool magneted ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETLEFTMAGNET ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setLeftMagnet( hb_parl( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETLEFTMAGNET FP=( p )->setLeftMagnet( hb_parl( 2 ) ); p is NULL" ) ); + } +} + +/* + * virtual void setRightMagnet( bool magneted ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETRIGHTMAGNET ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setRightMagnet( hb_parl( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETRIGHTMAGNET FP=( p )->setRightMagnet( hb_parl( 2 ) ); p is NULL" ) ); + } +} + +/* + * virtual void setTopMagnet( bool magneted ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETTOPMAGNET ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setTopMagnet( hb_parl( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETTOPMAGNET FP=( p )->setTopMagnet( hb_parl( 2 ) ); p is NULL" ) ); + } +} + +/* + * virtual void setBottomMagnet( bool magneted ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETBOTTOMMAGNET ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setBottomMagnet( hb_parl( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETBOTTOMMAGNET FP=( p )->setBottomMagnet( hb_parl( 2 ) ); p is NULL" ) ); + } +} + +/* + * virtual void setHorizontalMagnet( bool magneted ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETHORIZONTALMAGNET ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setHorizontalMagnet( hb_parl( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETHORIZONTALMAGNET FP=( p )->setHorizontalMagnet( hb_parl( 2 ) ); p is NULL" ) ); + } +} + +/* + * virtual void setVerticalMagnet( bool magneted ) + */ +HB_FUNC( QT_HBQGRAPHICSSCENE_SETVERTICALMAGNET ) +{ + HBQGraphicsScene * p = hbqt_par_HBQGraphicsScene( 1 ); + if( p ) + ( p )->setVerticalMagnet( hb_parl( 2 ) ); + else + { + HB_TRACE( HB_TR_DEBUG, ( "............................... F=QT_HBQGRAPHICSSCENE_SETVERTICALMAGNET FP=( p )->setVerticalMagnet( hb_parl( 2 ) ); p is NULL" ) ); + } +} + + +/*----------------------------------------------------------------------*/ +#endif /* #if QT_VERSION >= 0x040500 */ +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/qtgui/g/THBQGraphicsItem.prg b/harbour/contrib/hbqt/qtgui/g/THBQGraphicsItem.prg index b5bee3b7fe..0ad03df980 100644 --- a/harbour/contrib/hbqt/qtgui/g/THBQGraphicsItem.prg +++ b/harbour/contrib/hbqt/qtgui/g/THBQGraphicsItem.prg @@ -68,6 +68,52 @@ CREATE CLASS HBQGraphicsItem INHERIT HbQtObjectHandler, QGraphicsItem METHOD new( ... ) METHOD hbSetBlock( xBlock ) + METHOD pen() + METHOD setPen( pPen ) + METHOD brush() + METHOD setBrush( pBrush ) + METHOD backgroundBrush() + METHOD setBackgroundBrush( pBrush ) + METHOD font() + METHOD setFont( pFont ) + METHOD lineStyle() + METHOD setLineStyle( nLineStyle ) + METHOD startAngle() + METHOD setStartAngle( nStartAngle ) + METHOD spanAngle() + METHOD setSpanAngle( nSpanAngle ) + METHOD width() + METHOD setWidth( nWidth ) + METHOD height() + METHOD setHeight( nHeight ) + METHOD opacity() + METHOD setOpacity( nOpacity ) + METHOD geometry() + METHOD setGeometry( pRect ) + METHOD objectType() + METHOD setObjectType( cType ) + METHOD text() + METHOD setText( cType ) + METHOD paintType() + METHOD setPaintType( nPaintType ) + METHOD frameType() + METHOD setFrameType( nFrameType ) + METHOD drawTextType() + METHOD setDrawTextType( nDrawTextType ) + METHOD pixmap() + METHOD setPixmap( pPixmap ) + METHOD textColor() + METHOD setTextColor( pColor ) + METHOD borderWidth() + METHOD setBorderWidth( nBWidth ) + METHOD borderColor() + METHOD setBorderColor( pColor ) + METHOD sizePolicy() + METHOD setSizePolicy( nSizePolicy ) + METHOD textFlags() + METHOD setTextFlags( nTextFlags ) + METHOD resizeFlags() + METHOD setResizeFlags( nResizeFlags ) ENDCLASS @@ -84,3 +130,187 @@ METHOD HBQGraphicsItem:new( ... ) METHOD HBQGraphicsItem:hbSetBlock( xBlock ) RETURN Qt_HBQGraphicsItem_hbSetBlock( ::pPtr, xBlock ) + +METHOD HBQGraphicsItem:pen() + RETURN Qt_HBQGraphicsItem_pen( ::pPtr ) + + +METHOD HBQGraphicsItem:setPen( pPen ) + RETURN Qt_HBQGraphicsItem_setPen( ::pPtr, hbqt_ptr( pPen ) ) + + +METHOD HBQGraphicsItem:brush() + RETURN Qt_HBQGraphicsItem_brush( ::pPtr ) + + +METHOD HBQGraphicsItem:setBrush( pBrush ) + RETURN Qt_HBQGraphicsItem_setBrush( ::pPtr, hbqt_ptr( pBrush ) ) + + +METHOD HBQGraphicsItem:backgroundBrush() + RETURN Qt_HBQGraphicsItem_backgroundBrush( ::pPtr ) + + +METHOD HBQGraphicsItem:setBackgroundBrush( pBrush ) + RETURN Qt_HBQGraphicsItem_setBackgroundBrush( ::pPtr, hbqt_ptr( pBrush ) ) + + +METHOD HBQGraphicsItem:font() + RETURN Qt_HBQGraphicsItem_font( ::pPtr ) + + +METHOD HBQGraphicsItem:setFont( pFont ) + RETURN Qt_HBQGraphicsItem_setFont( ::pPtr, hbqt_ptr( pFont ) ) + + +METHOD HBQGraphicsItem:lineStyle() + RETURN Qt_HBQGraphicsItem_lineStyle( ::pPtr ) + + +METHOD HBQGraphicsItem:setLineStyle( nLineStyle ) + RETURN Qt_HBQGraphicsItem_setLineStyle( ::pPtr, nLineStyle ) + + +METHOD HBQGraphicsItem:startAngle() + RETURN Qt_HBQGraphicsItem_startAngle( ::pPtr ) + + +METHOD HBQGraphicsItem:setStartAngle( nStartAngle ) + RETURN Qt_HBQGraphicsItem_setStartAngle( ::pPtr, nStartAngle ) + + +METHOD HBQGraphicsItem:spanAngle() + RETURN Qt_HBQGraphicsItem_spanAngle( ::pPtr ) + + +METHOD HBQGraphicsItem:setSpanAngle( nSpanAngle ) + RETURN Qt_HBQGraphicsItem_setSpanAngle( ::pPtr, nSpanAngle ) + + +METHOD HBQGraphicsItem:width() + RETURN Qt_HBQGraphicsItem_width( ::pPtr ) + + +METHOD HBQGraphicsItem:setWidth( nWidth ) + RETURN Qt_HBQGraphicsItem_setWidth( ::pPtr, nWidth ) + + +METHOD HBQGraphicsItem:height() + RETURN Qt_HBQGraphicsItem_height( ::pPtr ) + + +METHOD HBQGraphicsItem:setHeight( nHeight ) + RETURN Qt_HBQGraphicsItem_setHeight( ::pPtr, nHeight ) + + +METHOD HBQGraphicsItem:opacity() + RETURN Qt_HBQGraphicsItem_opacity( ::pPtr ) + + +METHOD HBQGraphicsItem:setOpacity( nOpacity ) + RETURN Qt_HBQGraphicsItem_setOpacity( ::pPtr, nOpacity ) + + +METHOD HBQGraphicsItem:geometry() + RETURN Qt_HBQGraphicsItem_geometry( ::pPtr ) + + +METHOD HBQGraphicsItem:setGeometry( pRect ) + RETURN Qt_HBQGraphicsItem_setGeometry( ::pPtr, hbqt_ptr( pRect ) ) + + +METHOD HBQGraphicsItem:objectType() + RETURN Qt_HBQGraphicsItem_objectType( ::pPtr ) + + +METHOD HBQGraphicsItem:setObjectType( cType ) + RETURN Qt_HBQGraphicsItem_setObjectType( ::pPtr, cType ) + + +METHOD HBQGraphicsItem:text() + RETURN Qt_HBQGraphicsItem_text( ::pPtr ) + + +METHOD HBQGraphicsItem:setText( cType ) + RETURN Qt_HBQGraphicsItem_setText( ::pPtr, cType ) + + +METHOD HBQGraphicsItem:paintType() + RETURN Qt_HBQGraphicsItem_paintType( ::pPtr ) + + +METHOD HBQGraphicsItem:setPaintType( nPaintType ) + RETURN Qt_HBQGraphicsItem_setPaintType( ::pPtr, nPaintType ) + + +METHOD HBQGraphicsItem:frameType() + RETURN Qt_HBQGraphicsItem_frameType( ::pPtr ) + + +METHOD HBQGraphicsItem:setFrameType( nFrameType ) + RETURN Qt_HBQGraphicsItem_setFrameType( ::pPtr, nFrameType ) + + +METHOD HBQGraphicsItem:drawTextType() + RETURN Qt_HBQGraphicsItem_drawTextType( ::pPtr ) + + +METHOD HBQGraphicsItem:setDrawTextType( nDrawTextType ) + RETURN Qt_HBQGraphicsItem_setDrawTextType( ::pPtr, nDrawTextType ) + + +METHOD HBQGraphicsItem:pixmap() + RETURN Qt_HBQGraphicsItem_pixmap( ::pPtr ) + + +METHOD HBQGraphicsItem:setPixmap( pPixmap ) + RETURN Qt_HBQGraphicsItem_setPixmap( ::pPtr, hbqt_ptr( pPixmap ) ) + + +METHOD HBQGraphicsItem:textColor() + RETURN Qt_HBQGraphicsItem_textColor( ::pPtr ) + + +METHOD HBQGraphicsItem:setTextColor( pColor ) + RETURN Qt_HBQGraphicsItem_setTextColor( ::pPtr, hbqt_ptr( pColor ) ) + + +METHOD HBQGraphicsItem:borderWidth() + RETURN Qt_HBQGraphicsItem_borderWidth( ::pPtr ) + + +METHOD HBQGraphicsItem:setBorderWidth( nBWidth ) + RETURN Qt_HBQGraphicsItem_setBorderWidth( ::pPtr, nBWidth ) + + +METHOD HBQGraphicsItem:borderColor() + RETURN Qt_HBQGraphicsItem_borderColor( ::pPtr ) + + +METHOD HBQGraphicsItem:setBorderColor( pColor ) + RETURN Qt_HBQGraphicsItem_setBorderColor( ::pPtr, hbqt_ptr( pColor ) ) + + +METHOD HBQGraphicsItem:sizePolicy() + RETURN Qt_HBQGraphicsItem_sizePolicy( ::pPtr ) + + +METHOD HBQGraphicsItem:setSizePolicy( nSizePolicy ) + RETURN Qt_HBQGraphicsItem_setSizePolicy( ::pPtr, nSizePolicy ) + + +METHOD HBQGraphicsItem:textFlags() + RETURN Qt_HBQGraphicsItem_textFlags( ::pPtr ) + + +METHOD HBQGraphicsItem:setTextFlags( nTextFlags ) + RETURN Qt_HBQGraphicsItem_setTextFlags( ::pPtr, nTextFlags ) + + +METHOD HBQGraphicsItem:resizeFlags() + RETURN Qt_HBQGraphicsItem_resizeFlags( ::pPtr ) + + +METHOD HBQGraphicsItem:setResizeFlags( nResizeFlags ) + RETURN Qt_HBQGraphicsItem_setResizeFlags( ::pPtr, nResizeFlags ) + diff --git a/harbour/contrib/hbqt/qtgui/g/THBQGraphicsScene.prg b/harbour/contrib/hbqt/qtgui/g/THBQGraphicsScene.prg new file mode 100644 index 0000000000..aadb083575 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/g/THBQGraphicsScene.prg @@ -0,0 +1,196 @@ +/* + * $Id$ + */ + +/* -------------------------------------------------------------------- */ +/* WARNING: Automatically generated source file. DO NOT EDIT! */ +/* Instead, edit corresponding .qth file, */ +/* or the generator tool itself, and run regenarate. */ +/* -------------------------------------------------------------------- */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2009-2010 Pritpal Bedi + * + * Copyright 2009 Marcos Antonio Gambeta + * www - http://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 HBQGraphicsScene INHERIT HbQtObjectHandler, QGraphicsScene + + METHOD new( ... ) + + METHOD hbSetBlock( xBlock ) + METHOD pageSize() + METHOD setPageSize( nPageSize ) + METHOD paperRect() + METHOD setPaperRect( pPaperRect ) + METHOD orientation() + METHOD setOrientation( nOrientation ) + METHOD geometry() + METHOD setGeometry( pRect ) + METHOD magnetArea() + METHOD setMagnetArea( nMagnetArea ) + METHOD showGrid() + METHOD setShowGrid( lShowGrid ) + METHOD zoomWYSIWYG() + METHOD zoomIn() + METHOD zoomOut() + METHOD zoomOriginal() + METHOD setLeftMagnet( lMagneted ) + METHOD setRightMagnet( lMagneted ) + METHOD setTopMagnet( lMagneted ) + METHOD setBottomMagnet( lMagneted ) + METHOD setHorizontalMagnet( lMagneted ) + METHOD setVerticalMagnet( lMagneted ) + + ENDCLASS + + +METHOD HBQGraphicsScene:new( ... ) + LOCAL p + FOR EACH p IN { ... } + hb_pvalue( p:__enumIndex(), hbqt_ptr( p ) ) + NEXT + ::pPtr := Qt_HBQGraphicsScene( ... ) + RETURN Self + + +METHOD HBQGraphicsScene:hbSetBlock( xBlock ) + RETURN Qt_HBQGraphicsScene_hbSetBlock( ::pPtr, xBlock ) + + +METHOD HBQGraphicsScene:pageSize() + RETURN Qt_HBQGraphicsScene_pageSize( ::pPtr ) + + +METHOD HBQGraphicsScene:setPageSize( nPageSize ) + RETURN Qt_HBQGraphicsScene_setPageSize( ::pPtr, nPageSize ) + + +METHOD HBQGraphicsScene:paperRect() + RETURN Qt_HBQGraphicsScene_paperRect( ::pPtr ) + + +METHOD HBQGraphicsScene:setPaperRect( pPaperRect ) + RETURN Qt_HBQGraphicsScene_setPaperRect( ::pPtr, hbqt_ptr( pPaperRect ) ) + + +METHOD HBQGraphicsScene:orientation() + RETURN Qt_HBQGraphicsScene_orientation( ::pPtr ) + + +METHOD HBQGraphicsScene:setOrientation( nOrientation ) + RETURN Qt_HBQGraphicsScene_setOrientation( ::pPtr, nOrientation ) + + +METHOD HBQGraphicsScene:geometry() + RETURN Qt_HBQGraphicsScene_geometry( ::pPtr ) + + +METHOD HBQGraphicsScene:setGeometry( pRect ) + RETURN Qt_HBQGraphicsScene_setGeometry( ::pPtr, hbqt_ptr( pRect ) ) + + +METHOD HBQGraphicsScene:magnetArea() + RETURN Qt_HBQGraphicsScene_magnetArea( ::pPtr ) + + +METHOD HBQGraphicsScene:setMagnetArea( nMagnetArea ) + RETURN Qt_HBQGraphicsScene_setMagnetArea( ::pPtr, nMagnetArea ) + + +METHOD HBQGraphicsScene:showGrid() + RETURN Qt_HBQGraphicsScene_showGrid( ::pPtr ) + + +METHOD HBQGraphicsScene:setShowGrid( lShowGrid ) + RETURN Qt_HBQGraphicsScene_setShowGrid( ::pPtr, lShowGrid ) + + +METHOD HBQGraphicsScene:zoomWYSIWYG() + RETURN Qt_HBQGraphicsScene_zoomWYSIWYG( ::pPtr ) + + +METHOD HBQGraphicsScene:zoomIn() + RETURN Qt_HBQGraphicsScene_zoomIn( ::pPtr ) + + +METHOD HBQGraphicsScene:zoomOut() + RETURN Qt_HBQGraphicsScene_zoomOut( ::pPtr ) + + +METHOD HBQGraphicsScene:zoomOriginal() + RETURN Qt_HBQGraphicsScene_zoomOriginal( ::pPtr ) + + +METHOD HBQGraphicsScene:setLeftMagnet( lMagneted ) + RETURN Qt_HBQGraphicsScene_setLeftMagnet( ::pPtr, lMagneted ) + + +METHOD HBQGraphicsScene:setRightMagnet( lMagneted ) + RETURN Qt_HBQGraphicsScene_setRightMagnet( ::pPtr, lMagneted ) + + +METHOD HBQGraphicsScene:setTopMagnet( lMagneted ) + RETURN Qt_HBQGraphicsScene_setTopMagnet( ::pPtr, lMagneted ) + + +METHOD HBQGraphicsScene:setBottomMagnet( lMagneted ) + RETURN Qt_HBQGraphicsScene_setBottomMagnet( ::pPtr, lMagneted ) + + +METHOD HBQGraphicsScene:setHorizontalMagnet( lMagneted ) + RETURN Qt_HBQGraphicsScene_setHorizontalMagnet( ::pPtr, lMagneted ) + + +METHOD HBQGraphicsScene:setVerticalMagnet( lMagneted ) + RETURN Qt_HBQGraphicsScene_setVerticalMagnet( ::pPtr, lMagneted ) + diff --git a/harbour/contrib/hbqt/qtgui/g/filelist.hbm b/harbour/contrib/hbqt/qtgui/g/filelist.hbm index 2333d37002..45e55ccfb7 100644 --- a/harbour/contrib/hbqt/qtgui/g/filelist.hbm +++ b/harbour/contrib/hbqt/qtgui/g/filelist.hbm @@ -12,6 +12,7 @@ hbqtgui_extern.prg HBQAbstractItemModel.cpp HBQGraphicsItem.cpp HBQGraphicsRectItem.cpp +HBQGraphicsScene.cpp HBQMainWindow.cpp HBQPlainTextEdit.cpp HBQSyntaxHighlighter.cpp @@ -270,6 +271,7 @@ QUiLoader.cpp THBQAbstractItemModel.prg THBQGraphicsItem.prg THBQGraphicsRectItem.prg +THBQGraphicsScene.prg THBQMainWindow.prg THBQPlainTextEdit.prg THBQSyntaxHighlighter.prg diff --git a/harbour/contrib/hbqt/qtgui/g/hbqtgui.h b/harbour/contrib/hbqt/qtgui/g/hbqtgui.h index 0f6dcbf6a0..b0c85a6501 100644 --- a/harbour/contrib/hbqt/qtgui/g/hbqtgui.h +++ b/harbour/contrib/hbqt/qtgui/g/hbqtgui.h @@ -18,6 +18,7 @@ HB_EXTERN_BEGIN extern HB_EXPORT HBQT_GC_FUNC( hbqt_gcRelease_HBQAbstractItemModel ); extern HB_EXPORT HBQT_GC_FUNC( hbqt_gcRelease_HBQGraphicsItem ); extern HB_EXPORT HBQT_GC_FUNC( hbqt_gcRelease_HBQGraphicsRectItem ); +extern HB_EXPORT HBQT_GC_FUNC( hbqt_gcRelease_HBQGraphicsScene ); extern HB_EXPORT HBQT_GC_FUNC( hbqt_gcRelease_HBQMainWindow ); extern HB_EXPORT HBQT_GC_FUNC( hbqt_gcRelease_HBQPlainTextEdit ); extern HB_EXPORT HBQT_GC_FUNC( hbqt_gcRelease_HBQSyntaxHighlighter ); @@ -276,6 +277,7 @@ extern HB_EXPORT HBQT_GC_FUNC( hbqt_gcRelease_QUiLoader ); extern HB_EXPORT void * hbqt_gcAllocate_HBQAbstractItemModel( void * pObj, bool bNew ); extern HB_EXPORT void * hbqt_gcAllocate_HBQGraphicsItem( void * pObj, bool bNew ); extern HB_EXPORT void * hbqt_gcAllocate_HBQGraphicsRectItem( void * pObj, bool bNew ); +extern HB_EXPORT void * hbqt_gcAllocate_HBQGraphicsScene( void * pObj, bool bNew ); extern HB_EXPORT void * hbqt_gcAllocate_HBQMainWindow( void * pObj, bool bNew ); extern HB_EXPORT void * hbqt_gcAllocate_HBQPlainTextEdit( void * pObj, bool bNew ); extern HB_EXPORT void * hbqt_gcAllocate_HBQSyntaxHighlighter( void * pObj, bool bNew ); @@ -536,6 +538,7 @@ HB_EXTERN_END #define hbqt_par_HBQAbstractItemModel( n ) ( ( HBQAbstractItemModel * ) hbqt_gcpointer( n ) ) #define hbqt_par_HBQGraphicsItem( n ) ( ( HBQGraphicsItem * ) hbqt_gcpointer( n ) ) #define hbqt_par_HBQGraphicsRectItem( n ) ( ( HBQGraphicsRectItem * ) hbqt_gcpointer( n ) ) +#define hbqt_par_HBQGraphicsScene( n ) ( ( HBQGraphicsScene * ) hbqt_gcpointer( n ) ) #define hbqt_par_HBQMainWindow( n ) ( ( HBQMainWindow * ) hbqt_gcpointer( n ) ) #define hbqt_par_HBQPlainTextEdit( n ) ( ( HBQPlainTextEdit * ) hbqt_gcpointer( n ) ) #define hbqt_par_HBQSyntaxHighlighter( n ) ( ( HBQSyntaxHighlighter * ) hbqt_gcpointer( n ) ) @@ -796,259 +799,260 @@ HB_EXTERN_END #define HBQT_TYPE_HBQAbstractItemModel ( HBQT_TYPE_QTGUI_BASE + 1 ) #define HBQT_TYPE_HBQGraphicsItem ( HBQT_TYPE_QTGUI_BASE + 2 ) #define HBQT_TYPE_HBQGraphicsRectItem ( HBQT_TYPE_QTGUI_BASE + 3 ) -#define HBQT_TYPE_HBQMainWindow ( HBQT_TYPE_QTGUI_BASE + 4 ) -#define HBQT_TYPE_HBQPlainTextEdit ( HBQT_TYPE_QTGUI_BASE + 5 ) -#define HBQT_TYPE_HBQSyntaxHighlighter ( HBQT_TYPE_QTGUI_BASE + 6 ) -#define HBQT_TYPE_HBQTableView ( HBQT_TYPE_QTGUI_BASE + 7 ) -#define HBQT_TYPE_HBQTextBlockUserData ( HBQT_TYPE_QTGUI_BASE + 8 ) -#define HBQT_TYPE_QAbstractButton ( HBQT_TYPE_QTGUI_BASE + 9 ) -#define HBQT_TYPE_QAbstractGraphicsShapeItem ( HBQT_TYPE_QTGUI_BASE + 10 ) -#define HBQT_TYPE_QAbstractItemDelegate ( HBQT_TYPE_QTGUI_BASE + 11 ) -#define HBQT_TYPE_QAbstractItemView ( HBQT_TYPE_QTGUI_BASE + 12 ) -#define HBQT_TYPE_QAbstractPrintDialog ( HBQT_TYPE_QTGUI_BASE + 13 ) -#define HBQT_TYPE_QAbstractProxyModel ( HBQT_TYPE_QTGUI_BASE + 14 ) -#define HBQT_TYPE_QAbstractScrollArea ( HBQT_TYPE_QTGUI_BASE + 15 ) -#define HBQT_TYPE_QAbstractSlider ( HBQT_TYPE_QTGUI_BASE + 16 ) -#define HBQT_TYPE_QAbstractSpinBox ( HBQT_TYPE_QTGUI_BASE + 17 ) -#define HBQT_TYPE_QAbstractTextDocumentLayout ( HBQT_TYPE_QTGUI_BASE + 18 ) -#define HBQT_TYPE_QAction ( HBQT_TYPE_QTGUI_BASE + 19 ) -#define HBQT_TYPE_QActionGroup ( HBQT_TYPE_QTGUI_BASE + 20 ) -#define HBQT_TYPE_QApplication ( HBQT_TYPE_QTGUI_BASE + 21 ) -#define HBQT_TYPE_QBitmap ( HBQT_TYPE_QTGUI_BASE + 22 ) -#define HBQT_TYPE_QBoxLayout ( HBQT_TYPE_QTGUI_BASE + 23 ) -#define HBQT_TYPE_QBrush ( HBQT_TYPE_QTGUI_BASE + 24 ) -#define HBQT_TYPE_QButtonGroup ( HBQT_TYPE_QTGUI_BASE + 25 ) -#define HBQT_TYPE_QCalendarWidget ( HBQT_TYPE_QTGUI_BASE + 26 ) -#define HBQT_TYPE_QCheckBox ( HBQT_TYPE_QTGUI_BASE + 27 ) -#define HBQT_TYPE_QClipboard ( HBQT_TYPE_QTGUI_BASE + 28 ) -#define HBQT_TYPE_QColor ( HBQT_TYPE_QTGUI_BASE + 29 ) -#define HBQT_TYPE_QColorDialog ( HBQT_TYPE_QTGUI_BASE + 30 ) -#define HBQT_TYPE_QComboBox ( HBQT_TYPE_QTGUI_BASE + 31 ) -#define HBQT_TYPE_QCommandLinkButton ( HBQT_TYPE_QTGUI_BASE + 32 ) -#define HBQT_TYPE_QCommonStyle ( HBQT_TYPE_QTGUI_BASE + 33 ) -#define HBQT_TYPE_QCompleter ( HBQT_TYPE_QTGUI_BASE + 34 ) -#define HBQT_TYPE_QConicalGradient ( HBQT_TYPE_QTGUI_BASE + 35 ) -#define HBQT_TYPE_QContextMenuEvent ( HBQT_TYPE_QTGUI_BASE + 36 ) -#define HBQT_TYPE_QCursor ( HBQT_TYPE_QTGUI_BASE + 37 ) -#define HBQT_TYPE_QDateEdit ( HBQT_TYPE_QTGUI_BASE + 38 ) -#define HBQT_TYPE_QDateTimeEdit ( HBQT_TYPE_QTGUI_BASE + 39 ) -#define HBQT_TYPE_QDesktopWidget ( HBQT_TYPE_QTGUI_BASE + 40 ) -#define HBQT_TYPE_QDial ( HBQT_TYPE_QTGUI_BASE + 41 ) -#define HBQT_TYPE_QDialog ( HBQT_TYPE_QTGUI_BASE + 42 ) -#define HBQT_TYPE_QDirModel ( HBQT_TYPE_QTGUI_BASE + 43 ) -#define HBQT_TYPE_QDockWidget ( HBQT_TYPE_QTGUI_BASE + 44 ) -#define HBQT_TYPE_QDoubleSpinBox ( HBQT_TYPE_QTGUI_BASE + 45 ) -#define HBQT_TYPE_QDrag ( HBQT_TYPE_QTGUI_BASE + 46 ) -#define HBQT_TYPE_QDragEnterEvent ( HBQT_TYPE_QTGUI_BASE + 47 ) -#define HBQT_TYPE_QDragLeaveEvent ( HBQT_TYPE_QTGUI_BASE + 48 ) -#define HBQT_TYPE_QDragMoveEvent ( HBQT_TYPE_QTGUI_BASE + 49 ) -#define HBQT_TYPE_QDropEvent ( HBQT_TYPE_QTGUI_BASE + 50 ) -#define HBQT_TYPE_QErrorMessage ( HBQT_TYPE_QTGUI_BASE + 51 ) -#define HBQT_TYPE_QFileDialog ( HBQT_TYPE_QTGUI_BASE + 52 ) -#define HBQT_TYPE_QFileIconProvider ( HBQT_TYPE_QTGUI_BASE + 53 ) -#define HBQT_TYPE_QFileSystemModel ( HBQT_TYPE_QTGUI_BASE + 54 ) -#define HBQT_TYPE_QFocusEvent ( HBQT_TYPE_QTGUI_BASE + 55 ) -#define HBQT_TYPE_QFocusFrame ( HBQT_TYPE_QTGUI_BASE + 56 ) -#define HBQT_TYPE_QFont ( HBQT_TYPE_QTGUI_BASE + 57 ) -#define HBQT_TYPE_QFontComboBox ( HBQT_TYPE_QTGUI_BASE + 58 ) -#define HBQT_TYPE_QFontDatabase ( HBQT_TYPE_QTGUI_BASE + 59 ) -#define HBQT_TYPE_QFontDialog ( HBQT_TYPE_QTGUI_BASE + 60 ) -#define HBQT_TYPE_QFontInfo ( HBQT_TYPE_QTGUI_BASE + 61 ) -#define HBQT_TYPE_QFontMetrics ( HBQT_TYPE_QTGUI_BASE + 62 ) -#define HBQT_TYPE_QFontMetricsF ( HBQT_TYPE_QTGUI_BASE + 63 ) -#define HBQT_TYPE_QFormLayout ( HBQT_TYPE_QTGUI_BASE + 64 ) -#define HBQT_TYPE_QFrame ( HBQT_TYPE_QTGUI_BASE + 65 ) -#define HBQT_TYPE_QGradient ( HBQT_TYPE_QTGUI_BASE + 66 ) -#define HBQT_TYPE_QGraphicsEllipseItem ( HBQT_TYPE_QTGUI_BASE + 67 ) -#define HBQT_TYPE_QGraphicsGridLayout ( HBQT_TYPE_QTGUI_BASE + 68 ) -#define HBQT_TYPE_QGraphicsItem ( HBQT_TYPE_QTGUI_BASE + 69 ) -#define HBQT_TYPE_QGraphicsItemAnimation ( HBQT_TYPE_QTGUI_BASE + 70 ) -#define HBQT_TYPE_QGraphicsItemGroup ( HBQT_TYPE_QTGUI_BASE + 71 ) -#define HBQT_TYPE_QGraphicsLayout ( HBQT_TYPE_QTGUI_BASE + 72 ) -#define HBQT_TYPE_QGraphicsLayoutItem ( HBQT_TYPE_QTGUI_BASE + 73 ) -#define HBQT_TYPE_QGraphicsLinearLayout ( HBQT_TYPE_QTGUI_BASE + 74 ) -#define HBQT_TYPE_QGraphicsLineItem ( HBQT_TYPE_QTGUI_BASE + 75 ) -#define HBQT_TYPE_QGraphicsPathItem ( HBQT_TYPE_QTGUI_BASE + 76 ) -#define HBQT_TYPE_QGraphicsPixmapItem ( HBQT_TYPE_QTGUI_BASE + 77 ) -#define HBQT_TYPE_QGraphicsPolygonItem ( HBQT_TYPE_QTGUI_BASE + 78 ) -#define HBQT_TYPE_QGraphicsProxyWidget ( HBQT_TYPE_QTGUI_BASE + 79 ) -#define HBQT_TYPE_QGraphicsRectItem ( HBQT_TYPE_QTGUI_BASE + 80 ) -#define HBQT_TYPE_QGraphicsScene ( HBQT_TYPE_QTGUI_BASE + 81 ) -#define HBQT_TYPE_QGraphicsSceneContextMenuEvent ( HBQT_TYPE_QTGUI_BASE + 82 ) -#define HBQT_TYPE_QGraphicsSceneDragDropEvent ( HBQT_TYPE_QTGUI_BASE + 83 ) -#define HBQT_TYPE_QGraphicsSceneEvent ( HBQT_TYPE_QTGUI_BASE + 84 ) -#define HBQT_TYPE_QGraphicsSceneHelpEvent ( HBQT_TYPE_QTGUI_BASE + 85 ) -#define HBQT_TYPE_QGraphicsSceneHoverEvent ( HBQT_TYPE_QTGUI_BASE + 86 ) -#define HBQT_TYPE_QGraphicsSceneMouseEvent ( HBQT_TYPE_QTGUI_BASE + 87 ) -#define HBQT_TYPE_QGraphicsSceneMoveEvent ( HBQT_TYPE_QTGUI_BASE + 88 ) -#define HBQT_TYPE_QGraphicsSceneResizeEvent ( HBQT_TYPE_QTGUI_BASE + 89 ) -#define HBQT_TYPE_QGraphicsSceneWheelEvent ( HBQT_TYPE_QTGUI_BASE + 90 ) -#define HBQT_TYPE_QGraphicsSimpleTextItem ( HBQT_TYPE_QTGUI_BASE + 91 ) -#define HBQT_TYPE_QGraphicsTextItem ( HBQT_TYPE_QTGUI_BASE + 92 ) -#define HBQT_TYPE_QGraphicsView ( HBQT_TYPE_QTGUI_BASE + 93 ) -#define HBQT_TYPE_QGraphicsWidget ( HBQT_TYPE_QTGUI_BASE + 94 ) -#define HBQT_TYPE_QGridLayout ( HBQT_TYPE_QTGUI_BASE + 95 ) -#define HBQT_TYPE_QGroupBox ( HBQT_TYPE_QTGUI_BASE + 96 ) -#define HBQT_TYPE_QHBoxLayout ( HBQT_TYPE_QTGUI_BASE + 97 ) -#define HBQT_TYPE_QHeaderView ( HBQT_TYPE_QTGUI_BASE + 98 ) -#define HBQT_TYPE_QHelpEvent ( HBQT_TYPE_QTGUI_BASE + 99 ) -#define HBQT_TYPE_QHideEvent ( HBQT_TYPE_QTGUI_BASE + 100 ) -#define HBQT_TYPE_QIcon ( HBQT_TYPE_QTGUI_BASE + 101 ) -#define HBQT_TYPE_QImage ( HBQT_TYPE_QTGUI_BASE + 102 ) -#define HBQT_TYPE_QImageReader ( HBQT_TYPE_QTGUI_BASE + 103 ) -#define HBQT_TYPE_QImageWriter ( HBQT_TYPE_QTGUI_BASE + 104 ) -#define HBQT_TYPE_QInputDialog ( HBQT_TYPE_QTGUI_BASE + 105 ) -#define HBQT_TYPE_QInputEvent ( HBQT_TYPE_QTGUI_BASE + 106 ) -#define HBQT_TYPE_QInputMethodEvent ( HBQT_TYPE_QTGUI_BASE + 107 ) -#define HBQT_TYPE_QItemDelegate ( HBQT_TYPE_QTGUI_BASE + 108 ) -#define HBQT_TYPE_QItemEditorCreatorBase ( HBQT_TYPE_QTGUI_BASE + 109 ) -#define HBQT_TYPE_QItemEditorFactory ( HBQT_TYPE_QTGUI_BASE + 110 ) -#define HBQT_TYPE_QItemSelection ( HBQT_TYPE_QTGUI_BASE + 111 ) -#define HBQT_TYPE_QItemSelectionModel ( HBQT_TYPE_QTGUI_BASE + 112 ) -#define HBQT_TYPE_QKeyEvent ( HBQT_TYPE_QTGUI_BASE + 113 ) -#define HBQT_TYPE_QKeySequence ( HBQT_TYPE_QTGUI_BASE + 114 ) -#define HBQT_TYPE_QLabel ( HBQT_TYPE_QTGUI_BASE + 115 ) -#define HBQT_TYPE_QLayout ( HBQT_TYPE_QTGUI_BASE + 116 ) -#define HBQT_TYPE_QLayoutItem ( HBQT_TYPE_QTGUI_BASE + 117 ) -#define HBQT_TYPE_QLCDNumber ( HBQT_TYPE_QTGUI_BASE + 118 ) -#define HBQT_TYPE_QLinearGradient ( HBQT_TYPE_QTGUI_BASE + 119 ) -#define HBQT_TYPE_QLineEdit ( HBQT_TYPE_QTGUI_BASE + 120 ) -#define HBQT_TYPE_QListView ( HBQT_TYPE_QTGUI_BASE + 121 ) -#define HBQT_TYPE_QListWidget ( HBQT_TYPE_QTGUI_BASE + 122 ) -#define HBQT_TYPE_QListWidgetItem ( HBQT_TYPE_QTGUI_BASE + 123 ) -#define HBQT_TYPE_QMainWindow ( HBQT_TYPE_QTGUI_BASE + 124 ) -#define HBQT_TYPE_QMatrix ( HBQT_TYPE_QTGUI_BASE + 125 ) -#define HBQT_TYPE_QMdiArea ( HBQT_TYPE_QTGUI_BASE + 126 ) -#define HBQT_TYPE_QMdiSubWindow ( HBQT_TYPE_QTGUI_BASE + 127 ) -#define HBQT_TYPE_QMenu ( HBQT_TYPE_QTGUI_BASE + 128 ) -#define HBQT_TYPE_QMenuBar ( HBQT_TYPE_QTGUI_BASE + 129 ) -#define HBQT_TYPE_QMessageBox ( HBQT_TYPE_QTGUI_BASE + 130 ) -#define HBQT_TYPE_QMouseEvent ( HBQT_TYPE_QTGUI_BASE + 131 ) -#define HBQT_TYPE_QMoveEvent ( HBQT_TYPE_QTGUI_BASE + 132 ) -#define HBQT_TYPE_QMovie ( HBQT_TYPE_QTGUI_BASE + 133 ) -#define HBQT_TYPE_QPageSetupDialog ( HBQT_TYPE_QTGUI_BASE + 134 ) -#define HBQT_TYPE_QPaintDevice ( HBQT_TYPE_QTGUI_BASE + 135 ) -#define HBQT_TYPE_QPaintEngine ( HBQT_TYPE_QTGUI_BASE + 136 ) -#define HBQT_TYPE_QPainter ( HBQT_TYPE_QTGUI_BASE + 137 ) -#define HBQT_TYPE_QPainterPath ( HBQT_TYPE_QTGUI_BASE + 138 ) -#define HBQT_TYPE_QPaintEvent ( HBQT_TYPE_QTGUI_BASE + 139 ) -#define HBQT_TYPE_QPalette ( HBQT_TYPE_QTGUI_BASE + 140 ) -#define HBQT_TYPE_QPen ( HBQT_TYPE_QTGUI_BASE + 141 ) -#define HBQT_TYPE_QPicture ( HBQT_TYPE_QTGUI_BASE + 142 ) -#define HBQT_TYPE_QPixmap ( HBQT_TYPE_QTGUI_BASE + 143 ) -#define HBQT_TYPE_QPlainTextDocumentLayout ( HBQT_TYPE_QTGUI_BASE + 144 ) -#define HBQT_TYPE_QPlainTextEdit ( HBQT_TYPE_QTGUI_BASE + 145 ) -#define HBQT_TYPE_QPolygon ( HBQT_TYPE_QTGUI_BASE + 146 ) -#define HBQT_TYPE_QPolygonF ( HBQT_TYPE_QTGUI_BASE + 147 ) -#define HBQT_TYPE_QPrintDialog ( HBQT_TYPE_QTGUI_BASE + 148 ) -#define HBQT_TYPE_QPrintEngine ( HBQT_TYPE_QTGUI_BASE + 149 ) -#define HBQT_TYPE_QPrinter ( HBQT_TYPE_QTGUI_BASE + 150 ) -#define HBQT_TYPE_QPrintPreviewDialog ( HBQT_TYPE_QTGUI_BASE + 151 ) -#define HBQT_TYPE_QProgressBar ( HBQT_TYPE_QTGUI_BASE + 152 ) -#define HBQT_TYPE_QProgressDialog ( HBQT_TYPE_QTGUI_BASE + 153 ) -#define HBQT_TYPE_QPushButton ( HBQT_TYPE_QTGUI_BASE + 154 ) -#define HBQT_TYPE_QRadialGradient ( HBQT_TYPE_QTGUI_BASE + 155 ) -#define HBQT_TYPE_QRadioButton ( HBQT_TYPE_QTGUI_BASE + 156 ) -#define HBQT_TYPE_QRegion ( HBQT_TYPE_QTGUI_BASE + 157 ) -#define HBQT_TYPE_QResizeEvent ( HBQT_TYPE_QTGUI_BASE + 158 ) -#define HBQT_TYPE_QScrollArea ( HBQT_TYPE_QTGUI_BASE + 159 ) -#define HBQT_TYPE_QScrollBar ( HBQT_TYPE_QTGUI_BASE + 160 ) -#define HBQT_TYPE_QSessionManager ( HBQT_TYPE_QTGUI_BASE + 161 ) -#define HBQT_TYPE_QShowEvent ( HBQT_TYPE_QTGUI_BASE + 162 ) -#define HBQT_TYPE_QSizeGrip ( HBQT_TYPE_QTGUI_BASE + 163 ) -#define HBQT_TYPE_QSizePolicy ( HBQT_TYPE_QTGUI_BASE + 164 ) -#define HBQT_TYPE_QSlider ( HBQT_TYPE_QTGUI_BASE + 165 ) -#define HBQT_TYPE_QSound ( HBQT_TYPE_QTGUI_BASE + 166 ) -#define HBQT_TYPE_QSpacerItem ( HBQT_TYPE_QTGUI_BASE + 167 ) -#define HBQT_TYPE_QSpinBox ( HBQT_TYPE_QTGUI_BASE + 168 ) -#define HBQT_TYPE_QSplashScreen ( HBQT_TYPE_QTGUI_BASE + 169 ) -#define HBQT_TYPE_QSplitter ( HBQT_TYPE_QTGUI_BASE + 170 ) -#define HBQT_TYPE_QStackedWidget ( HBQT_TYPE_QTGUI_BASE + 171 ) -#define HBQT_TYPE_QStandardItem ( HBQT_TYPE_QTGUI_BASE + 172 ) -#define HBQT_TYPE_QStandardItemModel ( HBQT_TYPE_QTGUI_BASE + 173 ) -#define HBQT_TYPE_QStatusBar ( HBQT_TYPE_QTGUI_BASE + 174 ) -#define HBQT_TYPE_QStringListModel ( HBQT_TYPE_QTGUI_BASE + 175 ) -#define HBQT_TYPE_QStyle ( HBQT_TYPE_QTGUI_BASE + 176 ) -#define HBQT_TYPE_QStyledItemDelegate ( HBQT_TYPE_QTGUI_BASE + 177 ) -#define HBQT_TYPE_QStyleFactory ( HBQT_TYPE_QTGUI_BASE + 178 ) -#define HBQT_TYPE_QStyleHintReturn ( HBQT_TYPE_QTGUI_BASE + 179 ) -#define HBQT_TYPE_QStyleHintReturnMask ( HBQT_TYPE_QTGUI_BASE + 180 ) -#define HBQT_TYPE_QStyleHintReturnVariant ( HBQT_TYPE_QTGUI_BASE + 181 ) -#define HBQT_TYPE_QStyleOption ( HBQT_TYPE_QTGUI_BASE + 182 ) -#define HBQT_TYPE_QStyleOptionButton ( HBQT_TYPE_QTGUI_BASE + 183 ) -#define HBQT_TYPE_QStyleOptionComboBox ( HBQT_TYPE_QTGUI_BASE + 184 ) -#define HBQT_TYPE_QStyleOptionComplex ( HBQT_TYPE_QTGUI_BASE + 185 ) -#define HBQT_TYPE_QStyleOptionDockWidget ( HBQT_TYPE_QTGUI_BASE + 186 ) -#define HBQT_TYPE_QStyleOptionFocusRect ( HBQT_TYPE_QTGUI_BASE + 187 ) -#define HBQT_TYPE_QStyleOptionFrame ( HBQT_TYPE_QTGUI_BASE + 188 ) -#define HBQT_TYPE_QStyleOptionGraphicsItem ( HBQT_TYPE_QTGUI_BASE + 189 ) -#define HBQT_TYPE_QStyleOptionGroupBox ( HBQT_TYPE_QTGUI_BASE + 190 ) -#define HBQT_TYPE_QStyleOptionHeader ( HBQT_TYPE_QTGUI_BASE + 191 ) -#define HBQT_TYPE_QStyleOptionMenuItem ( HBQT_TYPE_QTGUI_BASE + 192 ) -#define HBQT_TYPE_QStyleOptionProgressBar ( HBQT_TYPE_QTGUI_BASE + 193 ) -#define HBQT_TYPE_QStyleOptionSizeGrip ( HBQT_TYPE_QTGUI_BASE + 194 ) -#define HBQT_TYPE_QStyleOptionSlider ( HBQT_TYPE_QTGUI_BASE + 195 ) -#define HBQT_TYPE_QStyleOptionSpinBox ( HBQT_TYPE_QTGUI_BASE + 196 ) -#define HBQT_TYPE_QStyleOptionTab ( HBQT_TYPE_QTGUI_BASE + 197 ) -#define HBQT_TYPE_QStyleOptionTabBarBase ( HBQT_TYPE_QTGUI_BASE + 198 ) -#define HBQT_TYPE_QStyleOptionTabWidgetFrame ( HBQT_TYPE_QTGUI_BASE + 199 ) -#define HBQT_TYPE_QStyleOptionTitleBar ( HBQT_TYPE_QTGUI_BASE + 200 ) -#define HBQT_TYPE_QStyleOptionToolBar ( HBQT_TYPE_QTGUI_BASE + 201 ) -#define HBQT_TYPE_QStyleOptionToolBox ( HBQT_TYPE_QTGUI_BASE + 202 ) -#define HBQT_TYPE_QStyleOptionToolButton ( HBQT_TYPE_QTGUI_BASE + 203 ) -#define HBQT_TYPE_QStyleOptionViewItem ( HBQT_TYPE_QTGUI_BASE + 204 ) -#define HBQT_TYPE_QStylePainter ( HBQT_TYPE_QTGUI_BASE + 205 ) -#define HBQT_TYPE_QSyntaxHighlighter ( HBQT_TYPE_QTGUI_BASE + 206 ) -#define HBQT_TYPE_QSystemTrayIcon ( HBQT_TYPE_QTGUI_BASE + 207 ) -#define HBQT_TYPE_QTabBar ( HBQT_TYPE_QTGUI_BASE + 208 ) -#define HBQT_TYPE_QTableView ( HBQT_TYPE_QTGUI_BASE + 209 ) -#define HBQT_TYPE_QTableWidget ( HBQT_TYPE_QTGUI_BASE + 210 ) -#define HBQT_TYPE_QTableWidgetItem ( HBQT_TYPE_QTGUI_BASE + 211 ) -#define HBQT_TYPE_QTableWidgetSelectionRange ( HBQT_TYPE_QTGUI_BASE + 212 ) -#define HBQT_TYPE_QTabWidget ( HBQT_TYPE_QTGUI_BASE + 213 ) -#define HBQT_TYPE_QTextBlock ( HBQT_TYPE_QTGUI_BASE + 214 ) -#define HBQT_TYPE_QTextBlockFormat ( HBQT_TYPE_QTGUI_BASE + 215 ) -#define HBQT_TYPE_QTextBlockGroup ( HBQT_TYPE_QTGUI_BASE + 216 ) -#define HBQT_TYPE_QTextBrowser ( HBQT_TYPE_QTGUI_BASE + 217 ) -#define HBQT_TYPE_QTextCharFormat ( HBQT_TYPE_QTGUI_BASE + 218 ) -#define HBQT_TYPE_QTextCursor ( HBQT_TYPE_QTGUI_BASE + 219 ) -#define HBQT_TYPE_QTextDocument ( HBQT_TYPE_QTGUI_BASE + 220 ) -#define HBQT_TYPE_QTextDocumentFragment ( HBQT_TYPE_QTGUI_BASE + 221 ) -#define HBQT_TYPE_QTextDocumentWriter ( HBQT_TYPE_QTGUI_BASE + 222 ) -#define HBQT_TYPE_QTextEdit ( HBQT_TYPE_QTGUI_BASE + 223 ) -#define HBQT_TYPE_QTextFormat ( HBQT_TYPE_QTGUI_BASE + 224 ) -#define HBQT_TYPE_QTextFragment ( HBQT_TYPE_QTGUI_BASE + 225 ) -#define HBQT_TYPE_QTextFrame ( HBQT_TYPE_QTGUI_BASE + 226 ) -#define HBQT_TYPE_QTextFrameFormat ( HBQT_TYPE_QTGUI_BASE + 227 ) -#define HBQT_TYPE_QTextImageFormat ( HBQT_TYPE_QTGUI_BASE + 228 ) -#define HBQT_TYPE_QTextInlineObject ( HBQT_TYPE_QTGUI_BASE + 229 ) -#define HBQT_TYPE_QTextItem ( HBQT_TYPE_QTGUI_BASE + 230 ) -#define HBQT_TYPE_QTextLayout ( HBQT_TYPE_QTGUI_BASE + 231 ) -#define HBQT_TYPE_QTextLength ( HBQT_TYPE_QTGUI_BASE + 232 ) -#define HBQT_TYPE_QTextLine ( HBQT_TYPE_QTGUI_BASE + 233 ) -#define HBQT_TYPE_QTextList ( HBQT_TYPE_QTGUI_BASE + 234 ) -#define HBQT_TYPE_QTextListFormat ( HBQT_TYPE_QTGUI_BASE + 235 ) -#define HBQT_TYPE_QTextObject ( HBQT_TYPE_QTGUI_BASE + 236 ) -#define HBQT_TYPE_QTextOption ( HBQT_TYPE_QTGUI_BASE + 237 ) -#define HBQT_TYPE_QTextTableFormat ( HBQT_TYPE_QTGUI_BASE + 238 ) -#define HBQT_TYPE_QTimeEdit ( HBQT_TYPE_QTGUI_BASE + 239 ) -#define HBQT_TYPE_QToolBar ( HBQT_TYPE_QTGUI_BASE + 240 ) -#define HBQT_TYPE_QToolBox ( HBQT_TYPE_QTGUI_BASE + 241 ) -#define HBQT_TYPE_QToolButton ( HBQT_TYPE_QTGUI_BASE + 242 ) -#define HBQT_TYPE_QTransform ( HBQT_TYPE_QTGUI_BASE + 243 ) -#define HBQT_TYPE_QTreeView ( HBQT_TYPE_QTGUI_BASE + 244 ) -#define HBQT_TYPE_QTreeWidget ( HBQT_TYPE_QTGUI_BASE + 245 ) -#define HBQT_TYPE_QTreeWidgetItem ( HBQT_TYPE_QTGUI_BASE + 246 ) -#define HBQT_TYPE_QValidator ( HBQT_TYPE_QTGUI_BASE + 247 ) -#define HBQT_TYPE_QVBoxLayout ( HBQT_TYPE_QTGUI_BASE + 248 ) -#define HBQT_TYPE_QWheelEvent ( HBQT_TYPE_QTGUI_BASE + 249 ) -#define HBQT_TYPE_QWidget ( HBQT_TYPE_QTGUI_BASE + 250 ) -#define HBQT_TYPE_QWidgetAction ( HBQT_TYPE_QTGUI_BASE + 251 ) -#define HBQT_TYPE_QWidgetItem ( HBQT_TYPE_QTGUI_BASE + 252 ) -#define HBQT_TYPE_QWindowsStyle ( HBQT_TYPE_QTGUI_BASE + 253 ) -#define HBQT_TYPE_QWindowStateChangeEvent ( HBQT_TYPE_QTGUI_BASE + 254 ) -#define HBQT_TYPE_QWizard ( HBQT_TYPE_QTGUI_BASE + 255 ) -#define HBQT_TYPE_QWizardPage ( HBQT_TYPE_QTGUI_BASE + 256 ) -#define HBQT_TYPE_QUiLoader ( HBQT_TYPE_QTGUI_BASE + 257 ) +#define HBQT_TYPE_HBQGraphicsScene ( HBQT_TYPE_QTGUI_BASE + 4 ) +#define HBQT_TYPE_HBQMainWindow ( HBQT_TYPE_QTGUI_BASE + 5 ) +#define HBQT_TYPE_HBQPlainTextEdit ( HBQT_TYPE_QTGUI_BASE + 6 ) +#define HBQT_TYPE_HBQSyntaxHighlighter ( HBQT_TYPE_QTGUI_BASE + 7 ) +#define HBQT_TYPE_HBQTableView ( HBQT_TYPE_QTGUI_BASE + 8 ) +#define HBQT_TYPE_HBQTextBlockUserData ( HBQT_TYPE_QTGUI_BASE + 9 ) +#define HBQT_TYPE_QAbstractButton ( HBQT_TYPE_QTGUI_BASE + 10 ) +#define HBQT_TYPE_QAbstractGraphicsShapeItem ( HBQT_TYPE_QTGUI_BASE + 11 ) +#define HBQT_TYPE_QAbstractItemDelegate ( HBQT_TYPE_QTGUI_BASE + 12 ) +#define HBQT_TYPE_QAbstractItemView ( HBQT_TYPE_QTGUI_BASE + 13 ) +#define HBQT_TYPE_QAbstractPrintDialog ( HBQT_TYPE_QTGUI_BASE + 14 ) +#define HBQT_TYPE_QAbstractProxyModel ( HBQT_TYPE_QTGUI_BASE + 15 ) +#define HBQT_TYPE_QAbstractScrollArea ( HBQT_TYPE_QTGUI_BASE + 16 ) +#define HBQT_TYPE_QAbstractSlider ( HBQT_TYPE_QTGUI_BASE + 17 ) +#define HBQT_TYPE_QAbstractSpinBox ( HBQT_TYPE_QTGUI_BASE + 18 ) +#define HBQT_TYPE_QAbstractTextDocumentLayout ( HBQT_TYPE_QTGUI_BASE + 19 ) +#define HBQT_TYPE_QAction ( HBQT_TYPE_QTGUI_BASE + 20 ) +#define HBQT_TYPE_QActionGroup ( HBQT_TYPE_QTGUI_BASE + 21 ) +#define HBQT_TYPE_QApplication ( HBQT_TYPE_QTGUI_BASE + 22 ) +#define HBQT_TYPE_QBitmap ( HBQT_TYPE_QTGUI_BASE + 23 ) +#define HBQT_TYPE_QBoxLayout ( HBQT_TYPE_QTGUI_BASE + 24 ) +#define HBQT_TYPE_QBrush ( HBQT_TYPE_QTGUI_BASE + 25 ) +#define HBQT_TYPE_QButtonGroup ( HBQT_TYPE_QTGUI_BASE + 26 ) +#define HBQT_TYPE_QCalendarWidget ( HBQT_TYPE_QTGUI_BASE + 27 ) +#define HBQT_TYPE_QCheckBox ( HBQT_TYPE_QTGUI_BASE + 28 ) +#define HBQT_TYPE_QClipboard ( HBQT_TYPE_QTGUI_BASE + 29 ) +#define HBQT_TYPE_QColor ( HBQT_TYPE_QTGUI_BASE + 30 ) +#define HBQT_TYPE_QColorDialog ( HBQT_TYPE_QTGUI_BASE + 31 ) +#define HBQT_TYPE_QComboBox ( HBQT_TYPE_QTGUI_BASE + 32 ) +#define HBQT_TYPE_QCommandLinkButton ( HBQT_TYPE_QTGUI_BASE + 33 ) +#define HBQT_TYPE_QCommonStyle ( HBQT_TYPE_QTGUI_BASE + 34 ) +#define HBQT_TYPE_QCompleter ( HBQT_TYPE_QTGUI_BASE + 35 ) +#define HBQT_TYPE_QConicalGradient ( HBQT_TYPE_QTGUI_BASE + 36 ) +#define HBQT_TYPE_QContextMenuEvent ( HBQT_TYPE_QTGUI_BASE + 37 ) +#define HBQT_TYPE_QCursor ( HBQT_TYPE_QTGUI_BASE + 38 ) +#define HBQT_TYPE_QDateEdit ( HBQT_TYPE_QTGUI_BASE + 39 ) +#define HBQT_TYPE_QDateTimeEdit ( HBQT_TYPE_QTGUI_BASE + 40 ) +#define HBQT_TYPE_QDesktopWidget ( HBQT_TYPE_QTGUI_BASE + 41 ) +#define HBQT_TYPE_QDial ( HBQT_TYPE_QTGUI_BASE + 42 ) +#define HBQT_TYPE_QDialog ( HBQT_TYPE_QTGUI_BASE + 43 ) +#define HBQT_TYPE_QDirModel ( HBQT_TYPE_QTGUI_BASE + 44 ) +#define HBQT_TYPE_QDockWidget ( HBQT_TYPE_QTGUI_BASE + 45 ) +#define HBQT_TYPE_QDoubleSpinBox ( HBQT_TYPE_QTGUI_BASE + 46 ) +#define HBQT_TYPE_QDrag ( HBQT_TYPE_QTGUI_BASE + 47 ) +#define HBQT_TYPE_QDragEnterEvent ( HBQT_TYPE_QTGUI_BASE + 48 ) +#define HBQT_TYPE_QDragLeaveEvent ( HBQT_TYPE_QTGUI_BASE + 49 ) +#define HBQT_TYPE_QDragMoveEvent ( HBQT_TYPE_QTGUI_BASE + 50 ) +#define HBQT_TYPE_QDropEvent ( HBQT_TYPE_QTGUI_BASE + 51 ) +#define HBQT_TYPE_QErrorMessage ( HBQT_TYPE_QTGUI_BASE + 52 ) +#define HBQT_TYPE_QFileDialog ( HBQT_TYPE_QTGUI_BASE + 53 ) +#define HBQT_TYPE_QFileIconProvider ( HBQT_TYPE_QTGUI_BASE + 54 ) +#define HBQT_TYPE_QFileSystemModel ( HBQT_TYPE_QTGUI_BASE + 55 ) +#define HBQT_TYPE_QFocusEvent ( HBQT_TYPE_QTGUI_BASE + 56 ) +#define HBQT_TYPE_QFocusFrame ( HBQT_TYPE_QTGUI_BASE + 57 ) +#define HBQT_TYPE_QFont ( HBQT_TYPE_QTGUI_BASE + 58 ) +#define HBQT_TYPE_QFontComboBox ( HBQT_TYPE_QTGUI_BASE + 59 ) +#define HBQT_TYPE_QFontDatabase ( HBQT_TYPE_QTGUI_BASE + 60 ) +#define HBQT_TYPE_QFontDialog ( HBQT_TYPE_QTGUI_BASE + 61 ) +#define HBQT_TYPE_QFontInfo ( HBQT_TYPE_QTGUI_BASE + 62 ) +#define HBQT_TYPE_QFontMetrics ( HBQT_TYPE_QTGUI_BASE + 63 ) +#define HBQT_TYPE_QFontMetricsF ( HBQT_TYPE_QTGUI_BASE + 64 ) +#define HBQT_TYPE_QFormLayout ( HBQT_TYPE_QTGUI_BASE + 65 ) +#define HBQT_TYPE_QFrame ( HBQT_TYPE_QTGUI_BASE + 66 ) +#define HBQT_TYPE_QGradient ( HBQT_TYPE_QTGUI_BASE + 67 ) +#define HBQT_TYPE_QGraphicsEllipseItem ( HBQT_TYPE_QTGUI_BASE + 68 ) +#define HBQT_TYPE_QGraphicsGridLayout ( HBQT_TYPE_QTGUI_BASE + 69 ) +#define HBQT_TYPE_QGraphicsItem ( HBQT_TYPE_QTGUI_BASE + 70 ) +#define HBQT_TYPE_QGraphicsItemAnimation ( HBQT_TYPE_QTGUI_BASE + 71 ) +#define HBQT_TYPE_QGraphicsItemGroup ( HBQT_TYPE_QTGUI_BASE + 72 ) +#define HBQT_TYPE_QGraphicsLayout ( HBQT_TYPE_QTGUI_BASE + 73 ) +#define HBQT_TYPE_QGraphicsLayoutItem ( HBQT_TYPE_QTGUI_BASE + 74 ) +#define HBQT_TYPE_QGraphicsLinearLayout ( HBQT_TYPE_QTGUI_BASE + 75 ) +#define HBQT_TYPE_QGraphicsLineItem ( HBQT_TYPE_QTGUI_BASE + 76 ) +#define HBQT_TYPE_QGraphicsPathItem ( HBQT_TYPE_QTGUI_BASE + 77 ) +#define HBQT_TYPE_QGraphicsPixmapItem ( HBQT_TYPE_QTGUI_BASE + 78 ) +#define HBQT_TYPE_QGraphicsPolygonItem ( HBQT_TYPE_QTGUI_BASE + 79 ) +#define HBQT_TYPE_QGraphicsProxyWidget ( HBQT_TYPE_QTGUI_BASE + 80 ) +#define HBQT_TYPE_QGraphicsRectItem ( HBQT_TYPE_QTGUI_BASE + 81 ) +#define HBQT_TYPE_QGraphicsScene ( HBQT_TYPE_QTGUI_BASE + 82 ) +#define HBQT_TYPE_QGraphicsSceneContextMenuEvent ( HBQT_TYPE_QTGUI_BASE + 83 ) +#define HBQT_TYPE_QGraphicsSceneDragDropEvent ( HBQT_TYPE_QTGUI_BASE + 84 ) +#define HBQT_TYPE_QGraphicsSceneEvent ( HBQT_TYPE_QTGUI_BASE + 85 ) +#define HBQT_TYPE_QGraphicsSceneHelpEvent ( HBQT_TYPE_QTGUI_BASE + 86 ) +#define HBQT_TYPE_QGraphicsSceneHoverEvent ( HBQT_TYPE_QTGUI_BASE + 87 ) +#define HBQT_TYPE_QGraphicsSceneMouseEvent ( HBQT_TYPE_QTGUI_BASE + 88 ) +#define HBQT_TYPE_QGraphicsSceneMoveEvent ( HBQT_TYPE_QTGUI_BASE + 89 ) +#define HBQT_TYPE_QGraphicsSceneResizeEvent ( HBQT_TYPE_QTGUI_BASE + 90 ) +#define HBQT_TYPE_QGraphicsSceneWheelEvent ( HBQT_TYPE_QTGUI_BASE + 91 ) +#define HBQT_TYPE_QGraphicsSimpleTextItem ( HBQT_TYPE_QTGUI_BASE + 92 ) +#define HBQT_TYPE_QGraphicsTextItem ( HBQT_TYPE_QTGUI_BASE + 93 ) +#define HBQT_TYPE_QGraphicsView ( HBQT_TYPE_QTGUI_BASE + 94 ) +#define HBQT_TYPE_QGraphicsWidget ( HBQT_TYPE_QTGUI_BASE + 95 ) +#define HBQT_TYPE_QGridLayout ( HBQT_TYPE_QTGUI_BASE + 96 ) +#define HBQT_TYPE_QGroupBox ( HBQT_TYPE_QTGUI_BASE + 97 ) +#define HBQT_TYPE_QHBoxLayout ( HBQT_TYPE_QTGUI_BASE + 98 ) +#define HBQT_TYPE_QHeaderView ( HBQT_TYPE_QTGUI_BASE + 99 ) +#define HBQT_TYPE_QHelpEvent ( HBQT_TYPE_QTGUI_BASE + 100 ) +#define HBQT_TYPE_QHideEvent ( HBQT_TYPE_QTGUI_BASE + 101 ) +#define HBQT_TYPE_QIcon ( HBQT_TYPE_QTGUI_BASE + 102 ) +#define HBQT_TYPE_QImage ( HBQT_TYPE_QTGUI_BASE + 103 ) +#define HBQT_TYPE_QImageReader ( HBQT_TYPE_QTGUI_BASE + 104 ) +#define HBQT_TYPE_QImageWriter ( HBQT_TYPE_QTGUI_BASE + 105 ) +#define HBQT_TYPE_QInputDialog ( HBQT_TYPE_QTGUI_BASE + 106 ) +#define HBQT_TYPE_QInputEvent ( HBQT_TYPE_QTGUI_BASE + 107 ) +#define HBQT_TYPE_QInputMethodEvent ( HBQT_TYPE_QTGUI_BASE + 108 ) +#define HBQT_TYPE_QItemDelegate ( HBQT_TYPE_QTGUI_BASE + 109 ) +#define HBQT_TYPE_QItemEditorCreatorBase ( HBQT_TYPE_QTGUI_BASE + 110 ) +#define HBQT_TYPE_QItemEditorFactory ( HBQT_TYPE_QTGUI_BASE + 111 ) +#define HBQT_TYPE_QItemSelection ( HBQT_TYPE_QTGUI_BASE + 112 ) +#define HBQT_TYPE_QItemSelectionModel ( HBQT_TYPE_QTGUI_BASE + 113 ) +#define HBQT_TYPE_QKeyEvent ( HBQT_TYPE_QTGUI_BASE + 114 ) +#define HBQT_TYPE_QKeySequence ( HBQT_TYPE_QTGUI_BASE + 115 ) +#define HBQT_TYPE_QLabel ( HBQT_TYPE_QTGUI_BASE + 116 ) +#define HBQT_TYPE_QLayout ( HBQT_TYPE_QTGUI_BASE + 117 ) +#define HBQT_TYPE_QLayoutItem ( HBQT_TYPE_QTGUI_BASE + 118 ) +#define HBQT_TYPE_QLCDNumber ( HBQT_TYPE_QTGUI_BASE + 119 ) +#define HBQT_TYPE_QLinearGradient ( HBQT_TYPE_QTGUI_BASE + 120 ) +#define HBQT_TYPE_QLineEdit ( HBQT_TYPE_QTGUI_BASE + 121 ) +#define HBQT_TYPE_QListView ( HBQT_TYPE_QTGUI_BASE + 122 ) +#define HBQT_TYPE_QListWidget ( HBQT_TYPE_QTGUI_BASE + 123 ) +#define HBQT_TYPE_QListWidgetItem ( HBQT_TYPE_QTGUI_BASE + 124 ) +#define HBQT_TYPE_QMainWindow ( HBQT_TYPE_QTGUI_BASE + 125 ) +#define HBQT_TYPE_QMatrix ( HBQT_TYPE_QTGUI_BASE + 126 ) +#define HBQT_TYPE_QMdiArea ( HBQT_TYPE_QTGUI_BASE + 127 ) +#define HBQT_TYPE_QMdiSubWindow ( HBQT_TYPE_QTGUI_BASE + 128 ) +#define HBQT_TYPE_QMenu ( HBQT_TYPE_QTGUI_BASE + 129 ) +#define HBQT_TYPE_QMenuBar ( HBQT_TYPE_QTGUI_BASE + 130 ) +#define HBQT_TYPE_QMessageBox ( HBQT_TYPE_QTGUI_BASE + 131 ) +#define HBQT_TYPE_QMouseEvent ( HBQT_TYPE_QTGUI_BASE + 132 ) +#define HBQT_TYPE_QMoveEvent ( HBQT_TYPE_QTGUI_BASE + 133 ) +#define HBQT_TYPE_QMovie ( HBQT_TYPE_QTGUI_BASE + 134 ) +#define HBQT_TYPE_QPageSetupDialog ( HBQT_TYPE_QTGUI_BASE + 135 ) +#define HBQT_TYPE_QPaintDevice ( HBQT_TYPE_QTGUI_BASE + 136 ) +#define HBQT_TYPE_QPaintEngine ( HBQT_TYPE_QTGUI_BASE + 137 ) +#define HBQT_TYPE_QPainter ( HBQT_TYPE_QTGUI_BASE + 138 ) +#define HBQT_TYPE_QPainterPath ( HBQT_TYPE_QTGUI_BASE + 139 ) +#define HBQT_TYPE_QPaintEvent ( HBQT_TYPE_QTGUI_BASE + 140 ) +#define HBQT_TYPE_QPalette ( HBQT_TYPE_QTGUI_BASE + 141 ) +#define HBQT_TYPE_QPen ( HBQT_TYPE_QTGUI_BASE + 142 ) +#define HBQT_TYPE_QPicture ( HBQT_TYPE_QTGUI_BASE + 143 ) +#define HBQT_TYPE_QPixmap ( HBQT_TYPE_QTGUI_BASE + 144 ) +#define HBQT_TYPE_QPlainTextDocumentLayout ( HBQT_TYPE_QTGUI_BASE + 145 ) +#define HBQT_TYPE_QPlainTextEdit ( HBQT_TYPE_QTGUI_BASE + 146 ) +#define HBQT_TYPE_QPolygon ( HBQT_TYPE_QTGUI_BASE + 147 ) +#define HBQT_TYPE_QPolygonF ( HBQT_TYPE_QTGUI_BASE + 148 ) +#define HBQT_TYPE_QPrintDialog ( HBQT_TYPE_QTGUI_BASE + 149 ) +#define HBQT_TYPE_QPrintEngine ( HBQT_TYPE_QTGUI_BASE + 150 ) +#define HBQT_TYPE_QPrinter ( HBQT_TYPE_QTGUI_BASE + 151 ) +#define HBQT_TYPE_QPrintPreviewDialog ( HBQT_TYPE_QTGUI_BASE + 152 ) +#define HBQT_TYPE_QProgressBar ( HBQT_TYPE_QTGUI_BASE + 153 ) +#define HBQT_TYPE_QProgressDialog ( HBQT_TYPE_QTGUI_BASE + 154 ) +#define HBQT_TYPE_QPushButton ( HBQT_TYPE_QTGUI_BASE + 155 ) +#define HBQT_TYPE_QRadialGradient ( HBQT_TYPE_QTGUI_BASE + 156 ) +#define HBQT_TYPE_QRadioButton ( HBQT_TYPE_QTGUI_BASE + 157 ) +#define HBQT_TYPE_QRegion ( HBQT_TYPE_QTGUI_BASE + 158 ) +#define HBQT_TYPE_QResizeEvent ( HBQT_TYPE_QTGUI_BASE + 159 ) +#define HBQT_TYPE_QScrollArea ( HBQT_TYPE_QTGUI_BASE + 160 ) +#define HBQT_TYPE_QScrollBar ( HBQT_TYPE_QTGUI_BASE + 161 ) +#define HBQT_TYPE_QSessionManager ( HBQT_TYPE_QTGUI_BASE + 162 ) +#define HBQT_TYPE_QShowEvent ( HBQT_TYPE_QTGUI_BASE + 163 ) +#define HBQT_TYPE_QSizeGrip ( HBQT_TYPE_QTGUI_BASE + 164 ) +#define HBQT_TYPE_QSizePolicy ( HBQT_TYPE_QTGUI_BASE + 165 ) +#define HBQT_TYPE_QSlider ( HBQT_TYPE_QTGUI_BASE + 166 ) +#define HBQT_TYPE_QSound ( HBQT_TYPE_QTGUI_BASE + 167 ) +#define HBQT_TYPE_QSpacerItem ( HBQT_TYPE_QTGUI_BASE + 168 ) +#define HBQT_TYPE_QSpinBox ( HBQT_TYPE_QTGUI_BASE + 169 ) +#define HBQT_TYPE_QSplashScreen ( HBQT_TYPE_QTGUI_BASE + 170 ) +#define HBQT_TYPE_QSplitter ( HBQT_TYPE_QTGUI_BASE + 171 ) +#define HBQT_TYPE_QStackedWidget ( HBQT_TYPE_QTGUI_BASE + 172 ) +#define HBQT_TYPE_QStandardItem ( HBQT_TYPE_QTGUI_BASE + 173 ) +#define HBQT_TYPE_QStandardItemModel ( HBQT_TYPE_QTGUI_BASE + 174 ) +#define HBQT_TYPE_QStatusBar ( HBQT_TYPE_QTGUI_BASE + 175 ) +#define HBQT_TYPE_QStringListModel ( HBQT_TYPE_QTGUI_BASE + 176 ) +#define HBQT_TYPE_QStyle ( HBQT_TYPE_QTGUI_BASE + 177 ) +#define HBQT_TYPE_QStyledItemDelegate ( HBQT_TYPE_QTGUI_BASE + 178 ) +#define HBQT_TYPE_QStyleFactory ( HBQT_TYPE_QTGUI_BASE + 179 ) +#define HBQT_TYPE_QStyleHintReturn ( HBQT_TYPE_QTGUI_BASE + 180 ) +#define HBQT_TYPE_QStyleHintReturnMask ( HBQT_TYPE_QTGUI_BASE + 181 ) +#define HBQT_TYPE_QStyleHintReturnVariant ( HBQT_TYPE_QTGUI_BASE + 182 ) +#define HBQT_TYPE_QStyleOption ( HBQT_TYPE_QTGUI_BASE + 183 ) +#define HBQT_TYPE_QStyleOptionButton ( HBQT_TYPE_QTGUI_BASE + 184 ) +#define HBQT_TYPE_QStyleOptionComboBox ( HBQT_TYPE_QTGUI_BASE + 185 ) +#define HBQT_TYPE_QStyleOptionComplex ( HBQT_TYPE_QTGUI_BASE + 186 ) +#define HBQT_TYPE_QStyleOptionDockWidget ( HBQT_TYPE_QTGUI_BASE + 187 ) +#define HBQT_TYPE_QStyleOptionFocusRect ( HBQT_TYPE_QTGUI_BASE + 188 ) +#define HBQT_TYPE_QStyleOptionFrame ( HBQT_TYPE_QTGUI_BASE + 189 ) +#define HBQT_TYPE_QStyleOptionGraphicsItem ( HBQT_TYPE_QTGUI_BASE + 190 ) +#define HBQT_TYPE_QStyleOptionGroupBox ( HBQT_TYPE_QTGUI_BASE + 191 ) +#define HBQT_TYPE_QStyleOptionHeader ( HBQT_TYPE_QTGUI_BASE + 192 ) +#define HBQT_TYPE_QStyleOptionMenuItem ( HBQT_TYPE_QTGUI_BASE + 193 ) +#define HBQT_TYPE_QStyleOptionProgressBar ( HBQT_TYPE_QTGUI_BASE + 194 ) +#define HBQT_TYPE_QStyleOptionSizeGrip ( HBQT_TYPE_QTGUI_BASE + 195 ) +#define HBQT_TYPE_QStyleOptionSlider ( HBQT_TYPE_QTGUI_BASE + 196 ) +#define HBQT_TYPE_QStyleOptionSpinBox ( HBQT_TYPE_QTGUI_BASE + 197 ) +#define HBQT_TYPE_QStyleOptionTab ( HBQT_TYPE_QTGUI_BASE + 198 ) +#define HBQT_TYPE_QStyleOptionTabBarBase ( HBQT_TYPE_QTGUI_BASE + 199 ) +#define HBQT_TYPE_QStyleOptionTabWidgetFrame ( HBQT_TYPE_QTGUI_BASE + 200 ) +#define HBQT_TYPE_QStyleOptionTitleBar ( HBQT_TYPE_QTGUI_BASE + 201 ) +#define HBQT_TYPE_QStyleOptionToolBar ( HBQT_TYPE_QTGUI_BASE + 202 ) +#define HBQT_TYPE_QStyleOptionToolBox ( HBQT_TYPE_QTGUI_BASE + 203 ) +#define HBQT_TYPE_QStyleOptionToolButton ( HBQT_TYPE_QTGUI_BASE + 204 ) +#define HBQT_TYPE_QStyleOptionViewItem ( HBQT_TYPE_QTGUI_BASE + 205 ) +#define HBQT_TYPE_QStylePainter ( HBQT_TYPE_QTGUI_BASE + 206 ) +#define HBQT_TYPE_QSyntaxHighlighter ( HBQT_TYPE_QTGUI_BASE + 207 ) +#define HBQT_TYPE_QSystemTrayIcon ( HBQT_TYPE_QTGUI_BASE + 208 ) +#define HBQT_TYPE_QTabBar ( HBQT_TYPE_QTGUI_BASE + 209 ) +#define HBQT_TYPE_QTableView ( HBQT_TYPE_QTGUI_BASE + 210 ) +#define HBQT_TYPE_QTableWidget ( HBQT_TYPE_QTGUI_BASE + 211 ) +#define HBQT_TYPE_QTableWidgetItem ( HBQT_TYPE_QTGUI_BASE + 212 ) +#define HBQT_TYPE_QTableWidgetSelectionRange ( HBQT_TYPE_QTGUI_BASE + 213 ) +#define HBQT_TYPE_QTabWidget ( HBQT_TYPE_QTGUI_BASE + 214 ) +#define HBQT_TYPE_QTextBlock ( HBQT_TYPE_QTGUI_BASE + 215 ) +#define HBQT_TYPE_QTextBlockFormat ( HBQT_TYPE_QTGUI_BASE + 216 ) +#define HBQT_TYPE_QTextBlockGroup ( HBQT_TYPE_QTGUI_BASE + 217 ) +#define HBQT_TYPE_QTextBrowser ( HBQT_TYPE_QTGUI_BASE + 218 ) +#define HBQT_TYPE_QTextCharFormat ( HBQT_TYPE_QTGUI_BASE + 219 ) +#define HBQT_TYPE_QTextCursor ( HBQT_TYPE_QTGUI_BASE + 220 ) +#define HBQT_TYPE_QTextDocument ( HBQT_TYPE_QTGUI_BASE + 221 ) +#define HBQT_TYPE_QTextDocumentFragment ( HBQT_TYPE_QTGUI_BASE + 222 ) +#define HBQT_TYPE_QTextDocumentWriter ( HBQT_TYPE_QTGUI_BASE + 223 ) +#define HBQT_TYPE_QTextEdit ( HBQT_TYPE_QTGUI_BASE + 224 ) +#define HBQT_TYPE_QTextFormat ( HBQT_TYPE_QTGUI_BASE + 225 ) +#define HBQT_TYPE_QTextFragment ( HBQT_TYPE_QTGUI_BASE + 226 ) +#define HBQT_TYPE_QTextFrame ( HBQT_TYPE_QTGUI_BASE + 227 ) +#define HBQT_TYPE_QTextFrameFormat ( HBQT_TYPE_QTGUI_BASE + 228 ) +#define HBQT_TYPE_QTextImageFormat ( HBQT_TYPE_QTGUI_BASE + 229 ) +#define HBQT_TYPE_QTextInlineObject ( HBQT_TYPE_QTGUI_BASE + 230 ) +#define HBQT_TYPE_QTextItem ( HBQT_TYPE_QTGUI_BASE + 231 ) +#define HBQT_TYPE_QTextLayout ( HBQT_TYPE_QTGUI_BASE + 232 ) +#define HBQT_TYPE_QTextLength ( HBQT_TYPE_QTGUI_BASE + 233 ) +#define HBQT_TYPE_QTextLine ( HBQT_TYPE_QTGUI_BASE + 234 ) +#define HBQT_TYPE_QTextList ( HBQT_TYPE_QTGUI_BASE + 235 ) +#define HBQT_TYPE_QTextListFormat ( HBQT_TYPE_QTGUI_BASE + 236 ) +#define HBQT_TYPE_QTextObject ( HBQT_TYPE_QTGUI_BASE + 237 ) +#define HBQT_TYPE_QTextOption ( HBQT_TYPE_QTGUI_BASE + 238 ) +#define HBQT_TYPE_QTextTableFormat ( HBQT_TYPE_QTGUI_BASE + 239 ) +#define HBQT_TYPE_QTimeEdit ( HBQT_TYPE_QTGUI_BASE + 240 ) +#define HBQT_TYPE_QToolBar ( HBQT_TYPE_QTGUI_BASE + 241 ) +#define HBQT_TYPE_QToolBox ( HBQT_TYPE_QTGUI_BASE + 242 ) +#define HBQT_TYPE_QToolButton ( HBQT_TYPE_QTGUI_BASE + 243 ) +#define HBQT_TYPE_QTransform ( HBQT_TYPE_QTGUI_BASE + 244 ) +#define HBQT_TYPE_QTreeView ( HBQT_TYPE_QTGUI_BASE + 245 ) +#define HBQT_TYPE_QTreeWidget ( HBQT_TYPE_QTGUI_BASE + 246 ) +#define HBQT_TYPE_QTreeWidgetItem ( HBQT_TYPE_QTGUI_BASE + 247 ) +#define HBQT_TYPE_QValidator ( HBQT_TYPE_QTGUI_BASE + 248 ) +#define HBQT_TYPE_QVBoxLayout ( HBQT_TYPE_QTGUI_BASE + 249 ) +#define HBQT_TYPE_QWheelEvent ( HBQT_TYPE_QTGUI_BASE + 250 ) +#define HBQT_TYPE_QWidget ( HBQT_TYPE_QTGUI_BASE + 251 ) +#define HBQT_TYPE_QWidgetAction ( HBQT_TYPE_QTGUI_BASE + 252 ) +#define HBQT_TYPE_QWidgetItem ( HBQT_TYPE_QTGUI_BASE + 253 ) +#define HBQT_TYPE_QWindowsStyle ( HBQT_TYPE_QTGUI_BASE + 254 ) +#define HBQT_TYPE_QWindowStateChangeEvent ( HBQT_TYPE_QTGUI_BASE + 255 ) +#define HBQT_TYPE_QWizard ( HBQT_TYPE_QTGUI_BASE + 256 ) +#define HBQT_TYPE_QWizardPage ( HBQT_TYPE_QTGUI_BASE + 257 ) +#define HBQT_TYPE_QUiLoader ( HBQT_TYPE_QTGUI_BASE + 258 ) #endif /* __HBQTGUI_H */ diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp index 40be3d09ef..efee470d71 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp @@ -58,16 +58,51 @@ #include "hbqt_hbqgraphicsitem.h" -HBQGraphicsItem::HBQGraphicsItem( QGraphicsItem * parent ) : QGraphicsItem( parent ) +HBQGraphicsItem::HBQGraphicsItem( int type, QGraphicsItem * parent ) : QGraphicsItem( parent ) { - setAcceptDrops( true ); + iType = type; + block = NULL; + + iResizeMode = RESIZE_MODE_FIXED; + iResizeFlags = RESIZE_MODE_LEFT | RESIZE_MODE_TOP | RESIZE_MODE_RIGHT | RESIZE_MODE_BOTTOM; + dWidth = 20 / UNIT; // 20 mm + dHeight = 20 / UNIT; // 20 mm + iOpacity = 100; + iResizeHandle = 2 / UNIT; + iBGMode = Qt::TransparentMode; + iLineStyle = HBQT_GRAPHICSITEM_LINE_HORIZONTAL; + iStartAngle = 30; + iSpanAngle = 120; + QString_objectType = ""; + QString_text = iType == HBQT_GRAPHICSITEM_PICTURE ? "picture" : ""; + + bDrawSelectionBorder = true; + + QBrush_brush = iType == HBQT_GRAPHICSITEM_PICTURE ? QBrush( QPixmap( ":/empty.png" ) ) : QBrush(); + QBrush_bgBrush = QBrush(); + QPen_pen = QPen( Qt::SolidLine ); + + QFont_font = QFont( "Serif" ); + QFont_font.setPointSizeF( 3.5 ); + QFont_font.setStyleStrategy( QFont::PreferMatch ); + QFont_font.setStyleStrategy( QFont::ForceOutline ); + setFont( QFont_font ); + + setFlags( QGraphicsItem::ItemIsSelectable ); + + /* Picture */ + m_paintType = HBQT_GRAPHICSITEM_RESIZE_PICTURE_TO_ITEM_KEEP_ASPECT_RATIO; + m_frameType = HBQT_GRAPHICSITEM_IMAGE_NO_FRAME; + m_textColor = Qt::black; + m_borderColor = Qt::black; + m_borderWidth = 0; + m_drawTextType = HBQT_GRAPHICSITEM_TEXT_DRAW_NONE; } HBQGraphicsItem::~HBQGraphicsItem() { - if( block ) - { + if( block ){ hb_itemRelease( block ); block = NULL; } @@ -75,36 +110,870 @@ HBQGraphicsItem::~HBQGraphicsItem() void HBQGraphicsItem::hbSetBlock( PHB_ITEM b ) { - if( b ) - { + if( b ){ block = hb_itemNew( b ); + + QDesktopWidget * qWid = new QDesktopWidget(); + + PHB_ITEM p1 = hb_itemPutNI( NULL, 21001 ); + PHB_ITEM p2 = hb_itemPutNI( NULL, qWid->screen()->physicalDpiX() ); + PHB_ITEM p3 = hb_itemPutNI( NULL, qWid->screen()->physicalDpiY() ); + hb_vmEvalBlockV( block, 3, p1, p2, p3 ); + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + hb_itemRelease( p3 ); } } +QString HBQGraphicsItem::objectType() +{ + return QString_objectType; +} +void HBQGraphicsItem::setObjectType( const QString & type ) +{ + QString_objectType = type; +} + +QBrush HBQGraphicsItem::brush() +{ + return QBrush_brush; +} +void HBQGraphicsItem::setBrush( const QBrush & brush ) +{ + QBrush_brush = brush; + update(); +} + +QBrush HBQGraphicsItem::backgroundBrush() +{ + return QBrush_bgBrush; +} +void HBQGraphicsItem::setBackgroundBrush( const QBrush & brush ) +{ + QBrush_bgBrush = brush; + update(); +} + +QPen HBQGraphicsItem::pen() +{ + return QPen_pen; +} +void HBQGraphicsItem::setPen( const QPen & pen ) +{ + QPen_pen = pen; + update(); +} + +QFont HBQGraphicsItem::font() +{ + return QFont_font; +} +void HBQGraphicsItem::setFont( const QFont & font ) +{ + QFont_font = font; + update(); +} + +/* TEXT */ +QString HBQGraphicsItem::text() +{ + return QString_text; +} +void HBQGraphicsItem::setText( const QString & text ) +{ + QString_text = text; + update(); +} +int HBQGraphicsItem::sizePolicy() +{ + return m_sizePolicy; +} +void HBQGraphicsItem::setSizePolicy( int sizePolicy ) +{ + m_sizePolicy = sizePolicy; +} +int HBQGraphicsItem::textFlags() +{ + return m_textFlags; +} +void HBQGraphicsItem::setTextFlags( int textFlags ) +{ + m_textFlags = textFlags; + update(); +} + +/* LINE */ +int HBQGraphicsItem::lineStyle() +{ + return iLineStyle; +} +void HBQGraphicsItem::setLineStyle( int lineStyle ) +{ + iLineStyle = lineStyle; + update(); +} + +/* PIE */ +int HBQGraphicsItem::startAngle() +{ + return iStartAngle; +} +void HBQGraphicsItem::setStartAngle( int startAngle ) +{ + iStartAngle = startAngle; + update(); +} +int HBQGraphicsItem::spanAngle() +{ + return iSpanAngle; +} +void HBQGraphicsItem::setSpanAngle( int spanAngle ) +{ + iSpanAngle = spanAngle; + update(); +} + +/* GEOMETRY */ +qreal HBQGraphicsItem::width() const +{ + return dWidth; +} +void HBQGraphicsItem::setWidth( qreal width ) +{ + dWidth = width; + update(); +} +qreal HBQGraphicsItem::height() const +{ + return dHeight; +} +void HBQGraphicsItem::setHeight( qreal height ) +{ + dHeight = height; + update(); +} +QRectF HBQGraphicsItem::geometry() +{ + return QRectF( pos().x(), pos().y(), width(), height() ); +} +void HBQGraphicsItem::setGeometry( const QRectF & rect ) +{ + setPos( rect.x(), rect.y() ); + setWidth( rect.width() ); + setHeight( rect.height() ); +} + +/* OPACITY */ +int HBQGraphicsItem::opacity() +{ + return iOpacity; +} +void HBQGraphicsItem::setOpacity( const int opacity ) +{ + if( opacity < 0 ){ + iOpacity = 0; + } + else { + if( opacity > 100 ){ + iOpacity = 100; + } + else { + iOpacity = opacity; + } + } + update(); +} + +int HBQGraphicsItem::paintType() +{ + return m_paintType; +} +void HBQGraphicsItem::setPaintType( int paintType ) +{ + m_paintType = paintType; + update(); +} +int HBQGraphicsItem::frameType() +{ + return m_frameType; +} +void HBQGraphicsItem::setFrameType( int frameType ) +{ + m_frameType = frameType; + update(); +} +int HBQGraphicsItem::drawTextType() +{ + return m_drawTextType; +} +void HBQGraphicsItem::setDrawTextType( int drawTextType ) +{ + m_drawTextType = drawTextType; + update(); +} +QPixmap HBQGraphicsItem::pixmap() +{ + QPixmap pixmap; + return pixmap.fromImage( m_image ) ; +} +void HBQGraphicsItem::setPixmap( const QPixmap & pixmap ) +{ + m_image = QImage( pixmap.toImage() ); + update(); +} +QColor HBQGraphicsItem::textColor() +{ + return m_textColor; +} +void HBQGraphicsItem::setTextColor( const QColor & textColor ) +{ + m_textColor = textColor; + update(); +} +int HBQGraphicsItem::borderWidth() +{ + return m_borderWidth; +} +void HBQGraphicsItem::setBorderWidth( int borderWidth ) +{ + if( borderWidth < 0 ){ + m_borderWidth = 0; + } + else { + if( borderWidth > 5 ){ + m_borderWidth = 5; + } + else { + m_borderWidth = borderWidth; + } + } + update(); +} +QColor HBQGraphicsItem::borderColor() +{ + return m_borderColor; +} +void HBQGraphicsItem::setBorderColor( const QColor & borderColor ) +{ + m_borderColor = borderColor; + update(); +} + +int HBQGraphicsItem::resizeFlags() +{ + return iResizeFlags; +} +void HBQGraphicsItem::setResizeFlags( int resizeFlags ) +{ + iResizeFlags = resizeFlags; +} + +/*----------------------------------------------------------------------*/ +// Mouse Events +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::mousePressEvent( QGraphicsSceneMouseEvent * event ) +{ + QRectF_geometry = geometry(); + + foreach( QGraphicsItem * item, scene()->items() ) + { + if( item->zValue() == 1 ){ + item->setZValue( 0 ); + } + } + setZValue( 1 ); + if( objectType() == ( QString ) "Page" ){ + setZValue( 0 ); + } + + if( event->buttons() == Qt::LeftButton ){ + iResizeMode = determineResizeMode( event->pos() ); + } + else { + iResizeMode = RESIZE_MODE_FIXED; + } + + if( iResizeMode == RESIZE_MODE_FIXED ){ + setCursor( QCursor( Qt::ClosedHandCursor ) ); + } + if( objectType() == ( QString ) "Page" ){ + setCursor( QCursor( Qt::ArrowCursor ) ); + } + + QGraphicsItem::mousePressEvent( event ); + + if( event->buttons() == Qt::LeftButton ){ + if( block ){ + // Inform if selection is made etc. Try to keep it simple. + } + } +} + +void HBQGraphicsItem::mouseReleaseEvent( QGraphicsSceneMouseEvent * event ) +{ + QGraphicsItem::mouseReleaseEvent( event ); + iResizeMode = RESIZE_MODE_FIXED; + + QRectF nGeometry = geometry(); + if( nGeometry != QRectF_geometry ){ + // emit( geometryChanged( this, nGeometry, oGeometry ) ); + } +} + +void HBQGraphicsItem::mouseMoveEvent( QGraphicsSceneMouseEvent * event ) +{ + if( event->buttons() == Qt::LeftButton ) + { + if( iResizeMode == RESIZE_MODE_FIXED ){ + setPos( pos() + QPoint( ( int ) ( event->scenePos().x() - event->lastScenePos().x() ), + ( int ) ( event->scenePos().y() - event->lastScenePos().y() ) ) ); + } + else + { + if( iResizeMode & RESIZE_MODE_LEFT ){ + setPos( pos().x() + event->scenePos().x() - event->lastScenePos().x(), pos().y() ); + setWidth( width() + event->lastScenePos().x() - event->scenePos().x() ); + } + if( iResizeMode & RESIZE_MODE_TOP ){ + setPos( pos().x(), pos().y() + event->scenePos().y() - event->lastScenePos().y() ); + setHeight( height() + event->lastScenePos().y() - event->scenePos().y() ); + } + if( iResizeMode & RESIZE_MODE_RIGHT ){ + setWidth( ( int ) ( width() + event->scenePos().x() - event->lastScenePos().x() ) ); + } + if( iResizeMode & RESIZE_MODE_BOTTOM ){ + setHeight( ( int ) ( height() + event->scenePos().y() - event->lastScenePos().y() ) ); + } + if( width() < 5 ){ + setWidth( 5 ); + } + if( height() < 5 ){ + setHeight( 5 ); + } + } + } + else + { + QGraphicsItem::mouseMoveEvent( event ); + } +} + +void HBQGraphicsItem::hoverEnterEvent( QGraphicsSceneHoverEvent * event ) +{ + QGraphicsItem::hoverEnterEvent( event ); +} + +int HBQGraphicsItem::determineResizeMode( const QPointF & pos ) +{ + int resizeModes = resizeFlags(); + int mode = RESIZE_MODE_FIXED; + + QRectF topRect( 0, 0, width(), 2 ); + QRectF leftRect( 0, 0, 2, height() ); + QRectF bottomRect( 0, height() - 2, width(), 2 ); + QRectF rightRect( width() - 2, 0, width(), height() ); + + if( resizeModes & RESIZE_MODE_LEFT && leftRect.contains( pos ) ){ + mode |= RESIZE_MODE_LEFT; + } + if( resizeModes & RESIZE_MODE_TOP && topRect.contains( pos ) ){ + mode |= RESIZE_MODE_TOP; + } + if( resizeModes & RESIZE_MODE_RIGHT && rightRect.contains( pos ) ){ + mode |= RESIZE_MODE_RIGHT; + } + if( resizeModes & RESIZE_MODE_BOTTOM && bottomRect.contains( pos ) ){ + mode |= RESIZE_MODE_BOTTOM; + } + if( resizeModes & RESIZE_MODE_FIXEDPOS ){ + mode |= RESIZE_MODE_FIXEDPOS; + } + + return mode; +} +/*----------------------------------------------------------------------*/ +// Drag Events +/*----------------------------------------------------------------------*/ + void HBQGraphicsItem::dragEnterEvent( QGraphicsSceneDragDropEvent * event ) { HB_TRACE( HB_TR_ALWAYS, ( "dragEnterEvent( QGraphicsSceneDragDropEvent * event )" ) ); if( block ) { - PHB_ITEM p1 = hb_itemPutNI( NULL, 11001 ); - PHB_ITEM p2 = hb_itemPutNI( NULL, 301 ); - hb_vmEvalBlockV( block, 1, p1, p2 ); + #if 0 + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDragEnter ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( block, 2, p1, p2 ); hb_itemRelease( p1 ); hb_itemRelease( p2 ); + #endif } - //QGraphicsItem::dragEnterEvent( event ); + QGraphicsItem::dragEnterEvent( event ); } void HBQGraphicsItem::dragLeaveEvent( QGraphicsSceneDragDropEvent * event ) { - //QGraphicsItem::dragLeaveEvent( event ); + if( block ) + { + #if 0 + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDragLeave ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( block, 2, p1, p2 ); + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + #endif + } + QGraphicsItem::dragLeaveEvent( event ); } void HBQGraphicsItem::dragMoveEvent( QGraphicsSceneDragDropEvent * event ) { - //QGraphicsItem::dragMoveEvent( event ); + if( block ) + { + #if 0 + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDragMove ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( block, 2, p1, p2 ); + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + #endif + } + QGraphicsItem::dragMoveEvent( event ); } void HBQGraphicsItem::dropEvent( QGraphicsSceneDragDropEvent * event ) { - //QGraphicsItem::dropEvent( event ); + if( block ) + { + #if 0 + const QMimeData * mime = event->mimeData(); + + if( mime->hasFormat( ( QString ) "application/x-qabstractitemmodeldatalist" ) ) + { + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDrop ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + PHB_ITEM p3 = hb_itemNew( NULL ); + + QTreeWidget * tree = dynamic_cast< QTreeWidget * >( event->source() ); + + QByteArray encoded = mime->data( "application/x-qabstractitemmodeldatalist" ); + QDataStream stream( &encoded, QIODevice::ReadOnly ); + + int row, col; + QMap< int, QVariant > roleDataMap; + stream >> row >> col >> roleDataMap; + + QTreeWidgetItem * item = tree->topLevelItem( row ); + + hb_arrayNew( p3, 3 ); + // + hb_arraySetC( p3, 1, tree->objectName().toLatin1().data() ); + hb_arraySetC( p3, 2, roleDataMap.value( Qt::DisplayRole ).toString().toLatin1().data() ); + hb_arraySetC( p3, 3, item->text( 0 ).toLatin1().data() ); + // + hb_vmEvalBlockV( block, 3, p1, p2, p3 ); + // + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + hb_itemRelease( p3 ); + } + else + { + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDrop ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( block, 2, p1, p2 ); + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + } + #endif + } + QGraphicsItem::dropEvent( event ); } +/*----------------------------------------------------------------------*/ +// Painting +/*----------------------------------------------------------------------*/ + +QRectF HBQGraphicsItem::boundingRect() const +{ + return QRectF( 0, 0, width(), height() ); +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::prepare( QPainter * painter ) +{ + setupPainter( painter ); + + switch( iType ) + { + case HBQT_GRAPHICSITEM_SIMPLETEXT : + { + if( m_sizePolicy == HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_NONE ){ + return; + } + QRectF rect = boundingRect(); + adjustRect( rect ); + QFontMetricsF fm( painter->font() ); + if( m_sizePolicy == HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_AUTO ){ + qreal wd = fm.width( QString_text ); + if( wd > width() ){ + setWidth( wd ); + } + } + else { + QRectF rc = fm.boundingRect( rect, textFlags(), QString_text ); + if( rc.height() > rect.height() ){ + //setStretch( rc.height() - rect.height() ); + } + } + } + break; + } +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::setupPainter( QPainter * painter ) +{ + if( ! painter ){ + return; + } + painter->setPen( pen() ); + painter->setBackgroundMode( ( Qt::BGMode ) iBGMode ); + painter->setBackground( backgroundBrush() ); + + QFont f=font(); + f.setPixelSize( font().pointSizeF() / UNIT ); + painter->setFont( f ); + + painter->setOpacity( ( qreal ) iOpacity / 100.0 ); + painter->setBrush( brush() ); +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * /* widget */ ) +{ + switch( iType ) + { + case HBQT_GRAPHICSITEM_NONE : + break; + case HBQT_GRAPHICSITEM_RECT : + drawRect( painter, option ); + break; + case HBQT_GRAPHICSITEM_LINE : + drawLine( painter, option ); + break; + case HBQT_GRAPHICSITEM_ELLIPSE : + drawEllipse( painter, option ); + break; + case HBQT_GRAPHICSITEM_ARC : + drawArc( painter, option ); + break; + case HBQT_GRAPHICSITEM_CHORD : + drawChord( painter, option ); + break; + case HBQT_GRAPHICSITEM_PIE : + drawPie( painter, option ); + break; + case HBQT_GRAPHICSITEM_POLYGON : + break; + case HBQT_GRAPHICSITEM_PATH : + break; + case HBQT_GRAPHICSITEM_CHART : + break; + case HBQT_GRAPHICSITEM_GRADIENT : + break; + case HBQT_GRAPHICSITEM_PICTURE : + drawPicture( painter, option ); + break; + case HBQT_GRAPHICSITEM_BARCODE : + break; + case HBQT_GRAPHICSITEM_TEXT : + break; + case HBQT_GRAPHICSITEM_SIMPLETEXT : + drawText( painter, option ); + break; + } + + if( block ){ + PHB_ITEM p1 = hb_itemPutNI( NULL, 11017 ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, painter ); + PHB_ITEM p3 = hb_itemPutPtr( NULL, &option ); + hb_vmEvalBlockV( block, 3, p1, p2, p3 ); + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + hb_itemRelease( p3 ); + } +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::drawSelection( QPainter * painter, QRectF rect ) +{ + painter->save(); + + if( isSelected() ) + { + QBrush a; + a.setColor( QColor( 200,0,0,150 ) ); + a.setStyle( Qt::SolidPattern ); + if( bDrawSelectionBorder ) + { + QPen p( Qt::DashDotDotLine ); + p.setBrush( a ); + painter->setPen( p ); + painter->drawRect( rect ); + } + QPainterPath lt; + lt.moveTo( 0,0 ); + lt.lineTo( 0,iResizeHandle ); + lt.lineTo( iResizeHandle, 0 ); + painter->fillPath( lt,a ); + + QPainterPath rt; + rt.moveTo( rect.width(),0 ); + rt.lineTo( rect.width(),iResizeHandle ); + rt.lineTo( rect.width()-iResizeHandle,0 ); + painter->fillPath( rt,a ); + + QPainterPath lb; + lb.moveTo( 0,rect.height() ); + lb.lineTo( 0,rect.height()-iResizeHandle ); + lb.lineTo( iResizeHandle,rect.height() ); + painter->fillPath( lb,a ); + + QPainterPath rb; + rb.moveTo( rect.width(),rect.height() ); + rb.lineTo( rect.width(),rect.height()-iResizeHandle ); + rb.lineTo( rect.width()-iResizeHandle,rect.height() ); + painter->fillPath( rb,a ); + } + else + { + if( bDrawSelectionBorder ) + { + QBrush a; + a.setColor( QColor( 100,100,100,200 ) ); + a.setStyle( Qt::SolidPattern ); + + QPen p( Qt::DashDotDotLine ); + p.setBrush( a ); + painter->setPen( p ); + painter->drawRect( rect ); + } + else + { + painter->setPen( QColor( 0,0,0,100 ) ); + painter->drawLine( 0,0,0,2*iResizeHandle ); + painter->drawLine( 0,0,2*iResizeHandle,0 ); + painter->drawLine( rect.width(),0,rect.width()-2*iResizeHandle,0 ); + painter->drawLine( rect.width(),0,rect.width(),2*iResizeHandle ); + painter->drawLine( rect.width(),rect.height(),rect.width()-2*iResizeHandle, rect.height() ); + painter->drawLine( rect.width(),rect.height(),rect.width(), rect.height()-2*iResizeHandle ); + painter->drawLine( 0,rect.height(), 2*iResizeHandle, rect.height() ); + painter->drawLine( 0,rect.height(), 0, rect.height()-2*iResizeHandle ); + } + } + painter->restore(); +} +/*----------------------------------------------------------------------*/ + +QRectF HBQGraphicsItem::adjustRect( QRectF & rect ) +{ + qreal penwidth = pen().widthF(); + rect = rect.adjusted( penwidth, penwidth, -penwidth, -penwidth ); + return rect; +} +/*----------------------------------------------------------------------*/ + +QRectF HBQGraphicsItem::adjustOption( QPainter * painter, const QStyleOptionGraphicsItem * option ) +{ + QRectF rect = ( option->type == QStyleOption::SO_GraphicsItem ) ? boundingRect() : option->exposedRect; + + if( option->type == QStyleOption::SO_GraphicsItem ){ + drawSelection( painter, rect ); + } + setupPainter( painter ); + adjustRect( rect ); + + return rect; +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::drawRect( QPainter * painter, const QStyleOptionGraphicsItem * option ) +{ + QRectF rect = adjustOption( painter, option ); + + //painter->drawRoundRect( rect, xRadius(), yRadius() ); + painter->drawRect( rect ); +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::drawEllipse( QPainter * painter, const QStyleOptionGraphicsItem * option ) +{ + QRectF rect = adjustOption( painter, option ); + + painter->drawEllipse( rect ); +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::drawLine( QPainter * painter, const QStyleOptionGraphicsItem * option ) +{ + QRectF rect = adjustOption( painter, option ); + + switch( lineStyle() ) + { + case HBQT_GRAPHICSITEM_LINE_VERTICAL: + painter->drawLine( rect.x() + rect.width() / 2, rect.y(), rect.x() + rect.width() / 2, rect.y() + rect.height() ); + break; + case HBQT_GRAPHICSITEM_LINE_HORIZONTAL: + painter->drawLine( rect.x(), rect.y() + rect.height() / 2, rect.x() + rect.width(), rect.y() + rect.height() / 2 ); + break; + case HBQT_GRAPHICSITEM_LINE_BACKWARDDIAGONAL: + painter->drawLine( rect.right(), rect.y(), rect.x(), rect.bottom() ); + break; + case HBQT_GRAPHICSITEM_LINE_FORWARDDIAGONAL: + painter->drawLine( rect.x(), rect.y(), rect.right(), rect.bottom() ); + break; + } +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::drawPie( QPainter * painter, const QStyleOptionGraphicsItem * option ) +{ + QRectF rect = adjustOption( painter, option ); + + painter->drawPie( rect, iStartAngle * 16, iSpanAngle * 16 ); +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::drawArc( QPainter * painter, const QStyleOptionGraphicsItem * option ) +{ + QRectF rect = adjustOption( painter, option ); + + painter->drawArc( rect, iStartAngle * 16, iSpanAngle * 16 ); +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::drawChord( QPainter * painter, const QStyleOptionGraphicsItem * option ) +{ + QRectF rect = adjustOption( painter, option ); + + painter->drawChord( rect, iStartAngle * 16, iSpanAngle * 16 ); +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::drawPicture( QPainter * painter, const QStyleOptionGraphicsItem * option ) +{ + QRectF rect = adjustOption( painter, option ); + + QString m_text = QString_text; + qreal textH = 0; + qreal sw = 0; + qreal sh = 0; + + if( m_drawTextType == HBQT_GRAPHICSITEM_TEXT_DRAW_ABOVE || m_drawTextType == HBQT_GRAPHICSITEM_TEXT_DRAW_BELOW ){ + textH = QFontMetricsF( painter->font() ).height(); + } + if( m_image.isNull() ) + { + ( option->type == QStyleOption::SO_GraphicsItem ) ? + painter->drawRect( rect ) : painter->drawText( rect, Qt::AlignCenter, "No Picture" ); + } + else + { + QImage img( 0, 0 /*,QImage::Format_ARGB32_Premultiplied*/ ); + + QPointF point = rect.topLeft(); + int cx = 0, cy = 0, cw = m_image.width(), ch = m_image.height(); + + switch( m_paintType ) + { + case HBQT_GRAPHICSITEM_RESIZE_PICTURE_TO_ITEM_KEEP_ASPECT_RATIO: + img = m_image.scaled( rect.width(), rect.height() - textH, Qt::KeepAspectRatio, Qt::SmoothTransformation ); + break; + + case HBQT_GRAPHICSITEM_RESIZE_PICTURE_TO_ITEM_IGNORE_ASPECT_RATIO: + img = m_image.scaled( rect.width(), rect.height() - textH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ); + break; + + case HBQT_GRAPHICSITEM_CENTER_PICTURE_TO_ITEM: + point.setX( point.x() + ( rect.width() - m_image.width() ) / 2 ); + point.setY( point.y() + ( rect.height() - m_image.height() - textH ) / 2 ); + if( point.x() < 0 ) + { + cx = abs( point.x() ); + cw -= 2 * cx; + point.setX( 0 ); + } + if( point.y() < 0 ) + { + cy = abs( point.y() ); + ch -= 2 * cy; + point.setY( 0 ); + } + img = m_image.copy( cx, cy, cw, ch ); + break; + + case HBQT_GRAPHICSITEM_RESIZE_ITEM_TO_PICTURE: + img = m_image; + sw = img.width()-width(); + sh = img.height() - ( height() - textH ); + break; + } + + if( m_drawTextType == HBQT_GRAPHICSITEM_TEXT_DRAW_ABOVE ){ + point.setY( point.y() + textH ); + } + + painter->drawImage( point, img ); + } + + painter->setPen( m_textColor ); + + switch( m_drawTextType ) + { + case HBQT_GRAPHICSITEM_TEXT_DRAW_TOP: + painter->drawText( rect, Qt::AlignTop | Qt::AlignHCenter, m_text ); + break; + + case HBQT_GRAPHICSITEM_TEXT_DRAW_BOTTOM: + painter->drawText( rect, Qt::AlignBottom | Qt::AlignHCenter, m_text ); + break; + + case HBQT_GRAPHICSITEM_TEXT_DRAW_ABOVE: + painter->drawText( rect, Qt::AlignTop | Qt::AlignHCenter, m_text ); + break; + + case HBQT_GRAPHICSITEM_TEXT_DRAW_BELOW: + painter->drawText( rect, Qt::AlignBottom | Qt::AlignHCenter, m_text ); + break; + + default: + break; + } + + if( sw || sh ){ + setWidth( width() + sw ); + setHeight( height() + sh ); + } + + if( m_borderWidth > 0 ) + { + QPen pen; + pen.setWidth( m_borderWidth ); + pen.setColor( m_borderColor ); + pen.setJoinStyle( Qt::MiterJoin ); + painter->setPen( pen ); + painter->setBrush( Qt::NoBrush ); + painter->drawRect( rect.x() + m_borderWidth / 2, rect.y() + m_borderWidth / 2, + rect.width() - m_borderWidth, rect.height() - m_borderWidth ); + } +} +/*----------------------------------------------------------------------*/ + +void HBQGraphicsItem::drawText( QPainter * painter, const QStyleOptionGraphicsItem * option ) +{ + QRectF rect = adjustOption( painter, option ); + + painter->setRenderHint( QPainter::TextAntialiasing ); + painter->drawText( rect, textFlags(), QString_text ); +} +/*----------------------------------------------------------------------*/ #endif diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.h b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.h index 179ee3ca5e..4626d77f19 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.h +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.h @@ -56,29 +56,195 @@ #include "hbqtgui.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define UNIT 0.1 + +#define RESIZE_MODE_FIXED 0 +#define RESIZE_MODE_LEFT 1 +#define RESIZE_MODE_TOP 2 +#define RESIZE_MODE_RIGHT 4 +#define RESIZE_MODE_BOTTOM 8 +#define RESIZE_MODE_FIXEDPOS 16 + +#define HBQT_GRAPHICSITEM_NONE 0 +#define HBQT_GRAPHICSITEM_RECT 1 +#define HBQT_GRAPHICSITEM_LINE 2 +#define HBQT_GRAPHICSITEM_ELLIPSE 3 +#define HBQT_GRAPHICSITEM_ARC 4 +#define HBQT_GRAPHICSITEM_CHORD 5 +#define HBQT_GRAPHICSITEM_POLYGON 6 +#define HBQT_GRAPHICSITEM_PIE 7 +#define HBQT_GRAPHICSITEM_PATH 8 +#define HBQT_GRAPHICSITEM_CHART 9 +#define HBQT_GRAPHICSITEM_GRADIENT 10 +#define HBQT_GRAPHICSITEM_PICTURE 11 +#define HBQT_GRAPHICSITEM_BARCODE 12 +#define HBQT_GRAPHICSITEM_TEXT 13 +#define HBQT_GRAPHICSITEM_SIMPLETEXT 14 + +#define HBQT_GRAPHICSITEM_LINE_HORIZONTAL 0 +#define HBQT_GRAPHICSITEM_LINE_VERTICAL 1 +#define HBQT_GRAPHICSITEM_LINE_BACKWARDDIAGONAL 2 +#define HBQT_GRAPHICSITEM_LINE_FORWARDDIAGONAL 3 + +#define HBQT_GRAPHICSITEM_TEXT_DRAW_NONE 0 +#define HBQT_GRAPHICSITEM_TEXT_DRAW_TOP 1 +#define HBQT_GRAPHICSITEM_TEXT_DRAW_BOTTOM 2 +#define HBQT_GRAPHICSITEM_TEXT_DRAW_ABOVE 3 +#define HBQT_GRAPHICSITEM_TEXT_DRAW_BELOW 4 + +#define HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_NONE 0 +#define HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_AUTO 1 +#define HBQT_GRAPHICSITEM_TEXT_SIZEPOLICY_STRETCH 2 + +#define HBQT_GRAPHICSITEM_IMAGE_NO_FRAME 0 +#define HBQT_GRAPHICSITEM_IMAGE_PICTURE_BIND 1 +#define HBQT_GRAPHICSITEM_IMAGE_PICTURE_BOX 2 + +#define HBQT_GRAPHICSITEM_RESIZE_ITEM_TO_PICTURE 1 +#define HBQT_GRAPHICSITEM_CENTER_PICTURE_TO_ITEM 2 +#define HBQT_GRAPHICSITEM_RESIZE_PICTURE_TO_ITEM_KEEP_ASPECT_RATIO 3 +#define HBQT_GRAPHICSITEM_RESIZE_PICTURE_TO_ITEM_IGNORE_ASPECT_RATIO 4 + +#define hbqt_screen_heightMM (((double)QDesktopWidget().screen()->height() / (double)QDesktopWidget().screen()->physicalDpiY() )*25.4) +#define hbqt_screen_widthMM (((double)QDesktopWidget().screen()->width() / (double)QDesktopWidget().screen()->physicalDpiX() )*25.4) class HBQGraphicsItem : public QGraphicsItem { public: - HBQGraphicsItem( QGraphicsItem * parent = 0 ); + HBQGraphicsItem( int type = 0, QGraphicsItem * parent = 0 ); ~HBQGraphicsItem(); + QRectF boundingRect() const; + virtual void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); + PHB_ITEM block; + int determineResizeMode( const QPointF & pos ); + QRectF adjustRect( QRectF & rect ); + virtual void prepare( QPainter * painter ); + void drawSelection( QPainter * painter, QRectF rect ); + void setupPainter( QPainter * painter ); + private: + int iType; bool bYes; + QBrush QBrush_brush, QBrush_bgBrush; + QPen QPen_pen; + QFont QFont_font; + qreal dWidth, dHeight; + QRectF QRectF_geometry; + int iOpacity; + int iResizeMode; + int iResizeFlags; + bool bDrawSelectionBorder; + int iResizeHandle; + int iBGMode; + int iLineStyle; + int iStartAngle; + int iSpanAngle; + QString QString_objectType; + QString QString_text; + + /* Image */ + int m_paintType; + int m_frameType; + int m_drawTextType; + QImage m_image; + QColor m_textColor; + QColor m_borderColor; + int m_borderWidth; + int m_sizePolicy; + int m_textFlags; + + QRectF adjustOption( QPainter * painter, const QStyleOptionGraphicsItem * option ); + // + void drawRect( QPainter * painter, const QStyleOptionGraphicsItem * option ); + void drawEllipse( QPainter * painter, const QStyleOptionGraphicsItem * option ); + void drawLine( QPainter * painter, const QStyleOptionGraphicsItem * option ); + void drawPie( QPainter * painter, const QStyleOptionGraphicsItem * option ); + void drawArc( QPainter * painter, const QStyleOptionGraphicsItem * option ); + void drawChord( QPainter * painter, const QStyleOptionGraphicsItem * option ); + void drawPicture( QPainter * painter, const QStyleOptionGraphicsItem * option ); + void drawText( QPainter * painter, const QStyleOptionGraphicsItem * option ); + protected: void dragEnterEvent( QGraphicsSceneDragDropEvent * event ); void dragLeaveEvent( QGraphicsSceneDragDropEvent * event ); void dragMoveEvent( QGraphicsSceneDragDropEvent * event ); void dropEvent( QGraphicsSceneDragDropEvent * event ); + void hoverEnterEvent( QGraphicsSceneHoverEvent * event ); + + void mousePressEvent( QGraphicsSceneMouseEvent * event ); + void mouseReleaseEvent( QGraphicsSceneMouseEvent * event ); + void mouseMoveEvent( QGraphicsSceneMouseEvent * event ); + + public slots: void hbSetBlock( PHB_ITEM block ); + QPen pen(); + void setPen( const QPen & pen ); + QBrush brush(); + void setBrush( const QBrush & brush ); + QBrush backgroundBrush(); + void setBackgroundBrush( const QBrush & brush ); + QFont font(); + void setFont( const QFont & font ); + int lineStyle(); + void setLineStyle( int lineStyle ); + int startAngle(); + void setStartAngle( int startAngle ); + int spanAngle(); + void setSpanAngle( int spanAngle ); + qreal width() const; + void setWidth( qreal width ); + qreal height() const; + void setHeight( qreal height ); + int opacity(); + void setOpacity( const int opacity ); + QRectF geometry(); + void setGeometry( const QRectF & rect ); + QString objectType(); + void setObjectType( const QString & type ); + QString text(); + void setText( const QString & text ); + + int paintType(); + void setPaintType( int paintType ); + int frameType(); + void setFrameType( int frameType ); + int drawTextType(); + void setDrawTextType( int drawTextType ); + QPixmap pixmap(); + void setPixmap( const QPixmap & pixmap ); + QColor textColor(); + void setTextColor( const QColor & color ); + int borderWidth(); + void setBorderWidth( int bWidth ); + QColor borderColor(); + void setBorderColor( const QColor & color ); + int sizePolicy(); + void setSizePolicy( int sizePolicy ); + int textFlags(); + void setTextFlags( int textFlags ); + int resizeFlags(); + void setResizeFlags( int resizeFlags ); + }; #endif diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.cpp b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.cpp index 35d1b75947..9cfaace523 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.cpp @@ -233,7 +233,7 @@ void HBQGraphicsRectItem::mouseMoveEvent( QGraphicsSceneMouseEvent * event ) { if( resizeMode == RESIZE_MODE_NONE ){ setPos( pos() + QPoint( ( int ) ( event->scenePos().x() - event->lastScenePos().x() ), - ( int ) ( event->scenePos().y() - event->lastScenePos().y() ) ) ); + ( int ) ( event->scenePos().y() - event->lastScenePos().y() ) ) ); } else { @@ -262,6 +262,13 @@ void HBQGraphicsRectItem::mouseMoveEvent( QGraphicsSceneMouseEvent * event ) QGraphicsItem::mouseMoveEvent( event ); } +void HBQGraphicsRectItem::hoverEnterEvent( QGraphicsSceneHoverEvent * event ) +{ +HB_TRACE( HB_TR_ALWAYS, ( "hoverEnter" ) ); + determineResizeMode( event->pos() ); + QGraphicsItem::hoverEnterEvent( event ); +} + int HBQGraphicsRectItem::determineResizeMode( const QPointF & pos ) { int resizeModes = RESIZE_MODE_LEFT | RESIZE_MODE_TOP | RESIZE_MODE_RIGHT | RESIZE_MODE_BOTTOM ; @@ -274,6 +281,7 @@ int HBQGraphicsRectItem::determineResizeMode( const QPointF & pos ) if( resizeModes & RESIZE_MODE_LEFT && leftRect.contains( pos ) ){ mode |= RESIZE_MODE_LEFT; + setCursor( QCursor( Qt::SizeHorCursor ) ); } if( resizeModes & RESIZE_MODE_TOP && topRect.contains( pos ) ){ mode |= RESIZE_MODE_TOP; diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.h b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.h index a60d9e521c..e7815b48ad 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.h +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsrectitem.h @@ -99,6 +99,8 @@ protected: void mouseReleaseEvent( QGraphicsSceneMouseEvent * event ); void mouseMoveEvent( QGraphicsSceneMouseEvent * event ); + void hoverEnterEvent( QGraphicsSceneHoverEvent * event ); + public slots: void hbSetBlock( PHB_ITEM block ); QRectF geometry(); diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp new file mode 100644 index 0000000000..d2f49eab06 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp @@ -0,0 +1,733 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2010 Pritpal Bedi + * www - http://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 "hbqt.h" +#include "hbapiitm.h" +#include "hbvm.h" + +#if QT_VERSION >= 0x040500 + +#include "hbqt_hbqgraphicsscene.h" + + +HBQGraphicsScene::HBQGraphicsScene( QObject * parent ) : QGraphicsScene( parent ) +{ + block = 0; + + m_magnets = 0; + m_magnetArea = 1; + m_paperBorder = 0; + m_pageBorder = 0; + m_showGrid = true; + m_pageSize = QPrinter::A4; + m_orientation = QPrinter::Portrait; + + setPageSize( QPrinter::A4 ); + setOrientation( QPrinter::Portrait ); + + QFont m_font = QFont( "Serif" ); + m_font.setPointSizeF( 3.5 ); + m_font.setStyleStrategy( QFont::PreferMatch ); + m_font.setStyleStrategy( QFont::ForceOutline ); + setFont( m_font ); +} + +HBQGraphicsScene::~HBQGraphicsScene() +{ + if( block ){ + hb_itemRelease( block ); + block = NULL; + } +} + +void HBQGraphicsScene::hbSetBlock( PHB_ITEM b ) +{ + if( b ){ + block = hb_itemNew( b ); + } +} + +QRectF HBQGraphicsScene::geometry() +{ + return m_geometry; +} +void HBQGraphicsScene::setGeometry( QRectF rect ) +{ + m_geometry = rect & sceneRect(); + drawBorder(); + emit geometryChanged( m_geometry ); +} + +int HBQGraphicsScene::pageSize() +{ + return m_pageSize; +} +void HBQGraphicsScene::setPageSize( int pageSize ) +{ + m_pageSize = pageSize; + updatePageRect(); + m_paperRect = sceneRect(); + setGeometry( QRect( 10 / UNIT, 10 / UNIT, sceneRect().width() - 10 / UNIT * 2, sceneRect().height()- 10 / UNIT * 2 ) ); +} + +QRectF HBQGraphicsScene::paperRect() +{ + return m_paperRect; +} +void HBQGraphicsScene::setPaperRect( QRectF paperRect ) +{ + m_paperRect = paperRect; +} + +int HBQGraphicsScene::orientation() +{ + return m_orientation; +} +void HBQGraphicsScene::setOrientation( int orientation ) +{ + m_orientation = orientation; + updatePageRect(); + m_paperRect = sceneRect(); + setGeometry( QRect( 10 / UNIT, 10 / UNIT, sceneRect().width() - 10 / UNIT * 2, sceneRect().height() - 10 / UNIT * 2 ) ); +} + +int HBQGraphicsScene::magnetArea() +{ + return m_magnetArea; +} +void HBQGraphicsScene::setMagnetArea( int magnetArea ) +{ + m_magnetArea = magnetArea; +} + +void HBQGraphicsScene::updatePageRect() +{ + QPrinter p; + p.setOutputFormat( QPrinter::PdfFormat ); + p.setOrientation( ( QPrinter::Orientation ) orientation() ); + p.setPageSize( ( QPrinter::PageSize ) pageSize() ); + p.setFullPage( true ); + setSceneRect( 0, 0, p.paperRect( QPrinter::Millimeter ).width() / UNIT, p.paperRect( QPrinter::Millimeter ).height() / UNIT ); +} + + +void HBQGraphicsScene::mouseMoveEvent( QGraphicsSceneMouseEvent * mouseEvent ) +{ + HBQGraphicsItem * item = NULL; + + if( itemAt( mouseEvent->scenePos() ) ){ + item = dynamic_cast< HBQGraphicsItem * >( itemAt( mouseEvent->scenePos() ) ); + } + if( item && mouseEvent->buttons() == Qt::NoButton ) + { + if( item->objectType() == ( QString ) "Page" ){ + item->setCursor( QCursor( Qt::ArrowCursor ) ); + } + else + { + int pc = item->determineResizeMode( item->mapFromScene( mouseEvent->scenePos() ) ); + + if( RESIZE_MODE_FIXED != pc ) + { + if( ( pc & RESIZE_MODE_TOP && pc & RESIZE_MODE_LEFT ) || ( pc & RESIZE_MODE_BOTTOM && pc & RESIZE_MODE_RIGHT ) ) + item->setCursor( QCursor( Qt::SizeFDiagCursor ) ); + else + if( ( pc & RESIZE_MODE_TOP && pc & RESIZE_MODE_RIGHT ) || ( pc & RESIZE_MODE_BOTTOM && pc & RESIZE_MODE_LEFT ) ) + item->setCursor( QCursor( Qt::SizeBDiagCursor ) ); + else + if( ( pc & RESIZE_MODE_TOP ) || ( pc & RESIZE_MODE_BOTTOM ) ) + item->setCursor( QCursor( Qt::SizeVerCursor ) ); + else + if( ( pc & RESIZE_MODE_RIGHT ) || ( pc & RESIZE_MODE_LEFT ) ) + item->setCursor( QCursor( Qt::SizeHorCursor ) ); + else + if( pc & RESIZE_MODE_FIXEDPOS ) + item->setCursor( QCursor( Qt::ArrowCursor ) ); + } + else + { + if( RESIZE_MODE_FIXED == pc ){ + item->setCursor( QCursor( Qt::OpenHandCursor ) ); + } + } + } + } + + QGraphicsScene::mouseMoveEvent( mouseEvent ); + + if( mouseEvent->buttons() != Qt::LeftButton ) + return; + + item = 0; + + if( selectedItems().size() ){ + item = dynamic_cast< HBQGraphicsItem * >( selectedItems()[ 0 ] ); + } + if( item && ! ( mouseEvent->modifiers() & Qt::ControlModifier ) ){ + drawMagnets( item ); + } +} + +void HBQGraphicsScene::mousePressEvent( QGraphicsSceneMouseEvent * event ) +{ + QPointF mousePos( event->buttonDownScenePos( Qt::LeftButton ).x(), event->buttonDownScenePos( Qt::LeftButton ).y() ); + movingItem = itemAt( mousePos.x(), mousePos.y() ); + + if( movingItem != 0 && event->button() == Qt::LeftButton ) + mouseOldPos = movingItem->pos(); + + QGraphicsScene::mousePressEvent( event ); + if( event->buttons() == Qt::LeftButton ) + { + if( ! itemAt( event->scenePos() ) ){ + emit itemSelected( parent(), event->scenePos() ); + } + else { + if( itemAt( event->scenePos()) == m_paperBorder || itemAt( event->scenePos() ) == m_pageBorder ){ + emit itemSelected( this, event->scenePos() ); + } + } + } +} + +void HBQGraphicsScene::mouseReleaseEvent( QGraphicsSceneMouseEvent * event ) +{ + foreach( QGraphicsItem * item, m_gideLines ) + removeItem( item ); + + m_gideLines.clear(); + + if( movingItem != 0 && event->button() == Qt::LeftButton ) + { + if( mouseOldPos != movingItem->pos() ){ + emit itemMoved( dynamic_cast< QObject * >( movingItem ), mouseOldPos ); + } + movingItem = 0; + } + QGraphicsScene::mouseReleaseEvent( event ); +} + +void HBQGraphicsScene::keyReleaseEvent( QKeyEvent * keyEvent ) +{ + foreach( QGraphicsItem * item, m_gideLines ) + removeItem( item ); + m_gideLines.clear(); + QGraphicsScene::keyReleaseEvent( keyEvent ); +} + +void HBQGraphicsScene::keyPressEvent( QKeyEvent * keyEvent ) +{ + if( keyEvent->modifiers() == Qt::NoModifier || ( keyEvent->key() != Qt::Key_Left && keyEvent->key() != Qt::Key_Right && + keyEvent->key() != Qt::Key_Up && keyEvent->key() != Qt::Key_Down ) ) + { + QGraphicsScene::keyPressEvent( keyEvent ); + return; + } + + HBQGraphicsItem * itm = 0; + + if( keyEvent->modifiers() & Qt::AltModifier ) + { + foreach( QGraphicsItem * item, selectedItems() ) + { + itm = dynamic_cast< HBQGraphicsItem* >( item ); + if( itm ) + { + QRectF curRect = itm->geometry(); + QRectF rect; + switch( keyEvent->key() ) + { + case Qt::Key_Left: + rect = QRectF( curRect.x() - 5, curRect.y(), curRect.width(), curRect.height() ); + break; + case Qt::Key_Right: + rect = QRectF( curRect.x() + 5, curRect.y(), curRect.width(), curRect.height() ); + break; + case Qt::Key_Up: + rect = QRectF( curRect.x(), curRect.y() - 5, curRect.width(), curRect.height() ); + break; + case Qt::Key_Down: + rect = QRectF( curRect.x(), curRect.y() + 5, curRect.width(), curRect.height() ); + break; + } + itm->setGeometry( rect ); + drawMagnets( itm ); + } + } + } + + if( keyEvent->modifiers() & Qt::ControlModifier ) + { + foreach( QGraphicsItem * item, selectedItems() ) + { + HBQGraphicsItem * itm = dynamic_cast< HBQGraphicsItem* >( item ); + if( itm ) + { + QRectF curRect = itm->geometry(); + QRectF rect; + switch( keyEvent->key() ) + { + case Qt::Key_Left: + rect = QRectF( curRect.x() - 1, curRect.y(), curRect.width(), curRect.height() ); + break; + case Qt::Key_Right: + rect = QRectF( curRect.x() + 1, curRect.y(), curRect.width(), curRect.height() ); + break; + case Qt::Key_Up: + rect = QRectF( curRect.x(), curRect.y() - 1, curRect.width(), curRect.height() ); + break; + case Qt::Key_Down: + rect = QRectF( curRect.x(), curRect.y() + 1, curRect.width(), curRect.height() ); + break; + } + itm->setGeometry( rect ); + drawMagnets( itm ); + } + } + } + + if( keyEvent->modifiers() & Qt::ShiftModifier ) + { + foreach( QGraphicsItem * item, selectedItems() ) + { + HBQGraphicsItem * itm = dynamic_cast< HBQGraphicsItem* >( item ); + if( itm ) + { + QRectF curRect = itm->geometry(); + QRectF rect; + switch( keyEvent->key() ) + { + case Qt::Key_Left: + rect = QRectF( curRect.x(), curRect.y(), curRect.width() - 1, curRect.height() ); + break; + case Qt::Key_Right: + rect = QRectF( curRect.x(), curRect.y(), curRect.width() + 1, curRect.height() ); + break; + case Qt::Key_Up: + rect = QRectF( curRect.x(), curRect.y(), curRect.width(), curRect.height() - 1 ); + break; + case Qt::Key_Down: + rect = QRectF( curRect.x(), curRect.y(), curRect.width(), curRect.height() + 1 ); + break; + } + itm->setGeometry( rect ); + drawMagnets( itm ); + } + } + } +} +/*----------------------------------------------------------------------*/ +// Drag & Drop +/*----------------------------------------------------------------------*/ + +void HBQGraphicsScene::dragEnterEvent( QGraphicsSceneDragDropEvent * event ) +{ + if( block ) + { + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDragEnter ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( block, 2, p1, p2 ); + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + } + else + { + QGraphicsScene::dragEnterEvent( event ); + } +} +void HBQGraphicsScene::dragLeaveEvent( QGraphicsSceneDragDropEvent * event ) +{ + if( block ) + { + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDragLeave ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( block, 2, p1, p2 ); + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + } + else + { + QGraphicsScene::dragLeaveEvent( event ); + } +} +void HBQGraphicsScene::dragMoveEvent( QGraphicsSceneDragDropEvent * event ) +{ + if( block ) + { + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDragMove ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( block, 2, p1, p2 ); + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + } + else + { + QGraphicsScene::dragMoveEvent( event ); + } +} +void HBQGraphicsScene::dropEvent( QGraphicsSceneDragDropEvent * event ) +{ + if( block ) + { + const QMimeData * mime = event->mimeData(); + + if( mime->hasFormat( ( QString ) "application/x-qabstractitemmodeldatalist" ) ) + { + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDrop ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + PHB_ITEM p3 = hb_itemNew( NULL ); + + QTreeWidget * tree = dynamic_cast< QTreeWidget * >( event->source() ); + QTreeWidgetItem * curItem = dynamic_cast< QTreeWidgetItem * >( tree->currentItem() ); + if( tree->indexOfTopLevelItem( curItem ) == -1 ) + { + QTreeWidgetItem * parent = dynamic_cast< QTreeWidgetItem * >( curItem->parent() ); + + if( curItem ) + { + hb_arrayNew( p3, 3 ); + // + hb_arraySetC( p3, 1, tree->objectName().toLatin1().data() ); + hb_arraySetC( p3, 2, parent->text( 0 ).toLatin1().data() ); + hb_arraySetC( p3, 3, curItem->text( 0 ).toLatin1().data() ); + // + hb_vmEvalBlockV( block, 3, p1, p2, p3 ); + // + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + hb_itemRelease( p3 ); + } + } + } + else + { + PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDrop ); + PHB_ITEM p2 = hb_itemPutPtr( NULL, event ); + hb_vmEvalBlockV( block, 2, p1, p2 ); + hb_itemRelease( p1 ); + hb_itemRelease( p2 ); + } + } + QGraphicsScene::dropEvent( event ); +} +/*----------------------------------------------------------------------*/ +// General +/*----------------------------------------------------------------------*/ + +bool HBQGraphicsScene::showGrid() +{ + return m_showGrid; +} +void HBQGraphicsScene::setShowGrid( bool showGrid ) +{ + m_showGrid = showGrid; + drawBorder(); +} +void HBQGraphicsScene::drawBorder() +{ + QPen p; + p.setStyle( Qt::DashDotDotLine ); + + delete m_paperBorder; + delete m_pageBorder; + + m_paperBorder = addRect( m_paperRect ); + p.setStyle( Qt::SolidLine ); + p.setColor( QColor( 0,0,255 ) ); + p.setWidth( 4 ); + m_pageBorder = addRect( geometry() ); + m_pageBorder->setPen( p ); + + if( m_showGrid ) + { + QPen p; + p.setColor( QColor( 225,225,225 ) ); + p.setWidth( 1 ); + p.setStyle( Qt::DotLine ); + if( views().size() ) + { + p.setWidth( 1 + 1 / views()[ 0 ]->transform().m11() ); + } + for( int i = 0; i < width(); i += ( 5.0 / UNIT ) ) + { + QGraphicsLineItem * line= new QGraphicsLineItem( m_paperBorder ); + line->setPen( p ); + line->setLine( i, 0, i, height() ); + } + for( int i = 0; i < height(); i += ( 5.0 / UNIT ) ) + { + QGraphicsLineItem * line= new QGraphicsLineItem( m_paperBorder ); + line->setPen( p ); + line->setLine( 0, i, width(), i ); + } + } + m_pageBorder->setZValue( -1 ) ; + m_paperBorder->setZValue( -2 ) ; +} + +/*----------------------------------------------------------------------*/ +// Magnets +/*----------------------------------------------------------------------*/ + +void HBQGraphicsScene::setLeftMagnet( bool magneted ) +{ + if( magneted ) + m_magnets |= Left; + else + { + int a = 0xffff; + a ^= Left; + m_magnets &= a; + } +} +void HBQGraphicsScene::setRightMagnet( bool magneted ) +{ + if( magneted ) + m_magnets |= Right; + else + { + int a = 0xffff; + a ^= Right; + m_magnets &= a; + } +} +void HBQGraphicsScene::setTopMagnet( bool magneted ) +{ + if( magneted ) + m_magnets |= Top; + else + { + int a = 0xffff; + a ^= Top; + m_magnets &= a; + } +} +void HBQGraphicsScene::setBottomMagnet( bool magneted ) +{ + if( magneted ) + m_magnets |= Bottom; + else + { + int a = 0xffff; + a ^= Bottom; + m_magnets &= a; + } +} +void HBQGraphicsScene::setHorizontalMagnet( bool magneted ) +{ + if( magneted ) + m_magnets |= Horizontal; + else + { + int a = 0xffff; + a ^= Horizontal; + m_magnets &= a; + } +} +void HBQGraphicsScene::setVerticalMagnet( bool magneted ) +{ + if( magneted ) + m_magnets |= Vertical; + else + { + int a = 0xffff; + a ^= Vertical; + m_magnets &= a; + } +} + +void HBQGraphicsScene::drawMagnets( HBQGraphicsItem * item ) +{ + foreach( QGraphicsItem * it, m_gideLines ) + removeItem( it ); + + m_gideLines.clear(); + + if ( ! m_magnets ) + return; + + item->setToolTip( tr( "Press Ctrl key to ignore magnets when dragging the object" ) ); + + QPen p; + p.setWidth( 3 ); + p.setColor( Qt::red ); + p.setStyle( Qt::DotLine ); + + foreach( QGraphicsItem * it, items() ) + { + HBQGraphicsItem * ite = dynamic_cast< HBQGraphicsItem * >( it ); + + if( ! ite || ! item->parentItem() || ite == item ) + continue; + + if( ( m_magnets & Left ) && abs( item->mapToScene( QPointF( 0, 0 ) ).x() - ite->mapToScene( QPointF( 0, 0 ) ).x() ) <= m_magnetArea ) + { + item->setGeometry(QRectF(ite->mapToItem(item->parentItem(), QPointF(0, 0)).x(), item->geometry().y(), item->geometry().width(), item->geometry().height())); + + if (item->mapToScene(0, 0).y() < ite->mapToScene(0, ite->geometry().height()).y()) + m_gideLines.push_back(addLine(item->mapToScene(0, 0).x(), item->mapToScene(0, 0).y(), item->mapToScene(0, 0).x(), ite->mapToScene(0, ite->geometry().height()).y(), p)); + else + m_gideLines.push_back(addLine(item->mapToScene(0, 0).x(), ite->mapToScene(0, 0).y(), item->mapToScene(0, 0).x(), item->mapToScene(0, item->geometry().height()).y(), p)); + } + + if ((m_magnets&Left) && abs(item->mapToScene(QPointF(0, 0)).x() - ite->mapToScene(QPointF(ite->geometry().width(), 0)).x()) <= m_magnetArea) + { + item->setGeometry(QRectF(ite->mapToItem(item->parentItem(), QPointF(ite->geometry().width(), 0)).x(), item->geometry().y(), item->geometry().width(), item->geometry().height())); + + if (item->mapToScene(0, 0).y() < ite->mapToScene(0, ite->geometry().height()).y()) + m_gideLines.push_back(addLine(item->mapToScene(0, 0).x(), item->mapToScene(0, 0).y(), item->mapToScene(0, 0).x(), ite->mapToScene(0, ite->geometry().height()).y(), p)); + else + m_gideLines.push_back(addLine(item->mapToScene(0, 0).x(), ite->mapToScene(0, 0).y(), item->mapToScene(0, 0).x(), item->mapToScene(0, item->geometry().height()).y(), p)); + } + + if ((m_magnets&Right) && abs(item->mapToScene(item->geometry().width(), 0).x() - ite->mapToScene(0, 0).x()) <= m_magnetArea) + { + item->setGeometry(QRectF(ite->mapToItem(item->parentItem(), 0, 0).x() - item->geometry().width(), item->geometry().y(), item->geometry().width(), item->geometry().height())); + + if (item->mapToScene(item->geometry().width(), 0).y() < ite->mapToScene(ite->geometry().width(), ite->geometry().height()).y()) + m_gideLines.push_back(addLine(item->mapToScene(item->geometry().width(), 0).x(), item->mapToScene(item->geometry().width(), 0).y(), item->mapToScene(item->geometry().width(), 0).x(), ite->mapToScene(ite->geometry().width(), ite->geometry().height()).y(), p)); + else + m_gideLines.push_back(addLine(item->mapToScene(item->geometry().width(), 0).x(), ite->mapToScene(ite->geometry().width(), 0).y(), item->mapToScene(item->geometry().width(), 0).x(), item->mapToScene(item->geometry().width(), item->geometry().height()).y(), p)); + } + + if ((m_magnets&Right) && abs(item->mapToScene(item->geometry().width(), 0).x() - ite->mapToScene(ite->geometry().width(), 0).x()) <= m_magnetArea) + { + item->setGeometry(QRectF(ite->mapToItem(item->parentItem(), ite->geometry().width(), 0).x() - item->geometry().width(), item->geometry().y(), item->geometry().width(), item->geometry().height())); + + if (item->mapToScene(item->geometry().width(), 0).y() < ite->mapToScene(ite->geometry().width(), ite->geometry().height()).y()) + m_gideLines.push_back(addLine(item->mapToScene(item->geometry().width(), 0).x(), item->mapToScene(item->geometry().width(), 0).y(), ite->mapToScene(ite->geometry().width(), 0).x(), ite->mapToScene(ite->geometry().width(), ite->geometry().height()).y(), p)); + else + m_gideLines.push_back(addLine(ite->mapToScene(ite->geometry().width(), 0).x(), ite->mapToScene(ite->geometry().width(), 0).y(), item->mapToScene(item->geometry().width(), 0).x(), item->mapToScene(item->geometry().width(), item->geometry().height()).y(), p)); + } + + if ((m_magnets&Top) && abs(item->mapToScene(QPointF(0, 0)).y() - ite->mapToScene(QPointF(0, 0)).y()) <= m_magnetArea) + { + item->setGeometry(QRectF(item->geometry().x(), ite->mapToItem(item->parentItem(), QPointF(0, 0)).y(), item->geometry().width(), item->geometry().height())); + m_gideLines.push_back(addLine(item->mapToScene(0, 0).x(), item->mapToScene(0, 0).y(), ite->mapToScene(0, 0).x(), item->mapToScene(0, 0).y(), p)); + } + + if ((m_magnets&Top) && abs(item->mapToScene(QPointF(0, 0)).y() - ite->mapToScene(QPointF(0, ite->geometry().height())).y()) <= m_magnetArea) + { + item->setGeometry(QRectF(item->geometry().x(), ite->mapToItem(item->parentItem(), QPointF(0, ite->geometry().height())).y(), item->geometry().width(), item->geometry().height())); + m_gideLines.push_back(addLine(item->mapToScene(0, 0).x(), item->mapToScene(0, 0).y(), ite->mapToScene(0, 0).x(), item->mapToScene(0, 0).y(), p)); + } + + if ((m_magnets&Bottom) && abs(item->mapToScene(QPointF(0, item->geometry().height())).y() - ite->mapToScene(QPointF(0, ite->geometry().height())).y()) <= m_magnetArea) + { + item->setGeometry(QRectF(item->geometry().x(), ite->mapToItem(item->parentItem(), QPointF(0, ite->geometry().height())).y() - item->geometry().height(), item->geometry().width(), item->geometry().height())); + m_gideLines.push_back(addLine(item->mapToScene(0, 0).x(), item->mapToScene(0, item->geometry().height()).y(), ite->mapToScene(0, 0).x(), item->mapToScene(0, item->geometry().height()).y(), p)); + } + + if ((m_magnets&Bottom) && abs(item->mapToScene(QPointF(0, item->geometry().height())).y() - ite->mapToScene(QPointF(0, 0)).y()) <= m_magnetArea) + { + item->setGeometry(QRectF(item->geometry().x(), ite->mapToItem(item->parentItem(), QPointF(0, 0)).y() - item->geometry().height(), item->geometry().width(), item->geometry().height())); + m_gideLines.push_back(addLine(item->mapToScene(0, 0).x(), item->mapToScene(0, item->geometry().height()).y(), ite->mapToScene(0, 0).x(), item->mapToScene(0, item->geometry().height()).y(), p)); + } + + if ((m_magnets&Horizontal) && abs(item->mapToScene(QPointF(0, item->geometry().height() / 2)).y() - ite->mapToScene(QPointF(0, ite->geometry().height() / 2)).y()) <= m_magnetArea) + { + item->setGeometry(QRectF(item->geometry().x(), ite->mapToItem(item->parentItem(), QPointF(0, ite->geometry().height() / 2)).y() - item->geometry().height() / 2, item->geometry().width(), item->geometry().height())); + m_gideLines.push_back(addLine(item->mapToScene(0, 0).x(), item->mapToScene(0, item->geometry().height() / 2).y(), ite->mapToScene(0, 0).x(), item->mapToScene(0, item->geometry().height() / 2).y(), p)); + } + + if ((m_magnets&Vertical) && abs(item->mapToScene(QPointF(item->geometry().width() / 2, 0)).x() - ite->mapToScene(QPointF(ite->geometry().width() / 2, 0)).x()) <= m_magnetArea) + { + item->setGeometry(QRectF(ite->mapToItem(item->parentItem(), QPointF(ite->geometry().width() / 2, 0)).x() - item->geometry().width() / 2, item->geometry().y(), item->geometry().width(), item->geometry().height())); + m_gideLines.push_back(addLine(item->mapToScene(item->geometry().width() / 2, 0).x(), item->mapToScene(0, 0).y(), item->mapToScene(item->geometry().width() / 2, 0).x(), ite->mapToScene(0, ite->geometry().height()).y(), p)); + } + } +} +/*----------------------------------------------------------------------*/ +// Zooming +/*----------------------------------------------------------------------*/ + +void HBQGraphicsScene::zoomIn() +{ + if( views().size() ) + { + views()[ 0 ]->scale( 1.1, 1.1 ); + } +} + +void HBQGraphicsScene::zoomOut() +{ + if( views().size() ) + { + views()[ 0 ]->scale( 0.9, 0.9 ); + } +} + +void HBQGraphicsScene::zoomWYSIWYG() +{ + if( views().size() ) + { + views()[ 0 ]->resetMatrix(); + views()[ 0 ]->scale( ( double ) QDesktopWidget().screen()->width() / ( hbqt_screen_widthMM * 10 ), + ( double ) QDesktopWidget().screen()->height() / ( hbqt_screen_heightMM * 10 ) ); + views()[ 0 ]->centerOn( 0, 0 ); + } +} + +void HBQGraphicsScene::zoomOriginal() +{ + if( views().size() ) + { + views()[ 0 ]->resetMatrix(); + views()[ 0 ]->centerOn( 0, 0 ); + } +} +/*----------------------------------------------------------------------*/ + +#endif + + + diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.h b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.h new file mode 100644 index 0000000000..2acd630a90 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.h @@ -0,0 +1,163 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT wrapper main header + * + * Copyright 2010 Pritpal Bedi + * www - http://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. + * + */ + +#ifndef HBQT_HBQGRAPHICSSCENE_H +#define HBQT_HBQGRAPHICSSCENE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hbqt_hbqgraphicsitem.h" + +#define RESIZE_MODE_FIXED 0 +#define RESIZE_MODE_LEFT 1 +#define RESIZE_MODE_TOP 2 +#define RESIZE_MODE_RIGHT 4 +#define RESIZE_MODE_BOTTOM 8 +#define RESIZE_MODE_FIXEDPOS 16 + +#define hbqt_screen_heightMM (((double)QDesktopWidget().screen()->height() / (double)QDesktopWidget().screen()->physicalDpiY() )*25.4) +#define hbqt_screen_widthMM (((double)QDesktopWidget().screen()->width() / (double)QDesktopWidget().screen()->physicalDpiX() )*25.4) + +class HBQGraphicsScene : public QGraphicsScene +{ + Q_OBJECT + +public: + enum Magnet + { + Left = 1, + Right = 2, + Top = 4, + Bottom = 8, + Vertical = 16, + Horizontal = 32 + }; + +public: + HBQGraphicsScene( QObject * parent = 0 ); + ~HBQGraphicsScene(); + + PHB_ITEM block; + + void hbSetBlock( PHB_ITEM b ); + + virtual int pageSize(); + virtual void setPageSize( int pageSize ); + QRectF paperRect(); + void setPaperRect( QRectF paperRect ); + virtual int orientation(); + virtual void setOrientation( int orientation ); + virtual QRectF geometry(); + virtual void setGeometry( QRectF rect ); + int magnetArea(); + void setMagnetArea( int magnetArea ); + virtual bool showGrid(); + virtual void setShowGrid( bool showGrid ); + virtual void zoomWYSIWYG(); + virtual void zoomIn(); + virtual void zoomOut(); + virtual void zoomOriginal(); + +public slots: + virtual void setLeftMagnet( bool magneted ); + virtual void setRightMagnet( bool magneted ); + virtual void setTopMagnet( bool magneted ); + virtual void setBottomMagnet( bool magneted ); + virtual void setHorizontalMagnet( bool magneted ); + virtual void setVerticalMagnet( bool magneted ); + +protected: + virtual void mouseMoveEvent( QGraphicsSceneMouseEvent * mouseEvent ); + virtual void mousePressEvent( QGraphicsSceneMouseEvent *event ); + virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * mouseEvent ); + virtual void keyPressEvent( QKeyEvent * keyEvent ); + virtual void keyReleaseEvent( QKeyEvent * keyEvent ); + + virtual void dragEnterEvent( QGraphicsSceneDragDropEvent * event ); + virtual void dragLeaveEvent( QGraphicsSceneDragDropEvent * event ); + virtual void dragMoveEvent( QGraphicsSceneDragDropEvent * event ); + virtual void dropEvent( QGraphicsSceneDragDropEvent * event ); + + virtual void updatePageRect(); + +signals: + void itemSelected( QObject * thisObject, QPointF cursorPos ); + void geometryChanged( QRectF newGeometry ); + void itemMoved( QObject*, QPointF ); + +private: + void drawMagnets( HBQGraphicsItem * item ); + void drawBorder(); + +private: + int m_pageSize; + int m_orientation; + QRectF m_geometry, m_paperRect; + int m_magnets, m_magnetArea; + QList< QGraphicsItem * > m_gideLines; + QGraphicsRectItem * m_paperBorder; + QGraphicsRectItem * m_pageBorder; + bool m_showGrid; + QGraphicsItem * movingItem; + QPointF mouseOldPos; +}; + +#endif + + diff --git a/harbour/contrib/hbqt/qtgui/hbqtgui.hbm b/harbour/contrib/hbqt/qtgui/hbqtgui.hbm index 292ded732d..12ac6a083f 100644 --- a/harbour/contrib/hbqt/qtgui/hbqtgui.hbm +++ b/harbour/contrib/hbqt/qtgui/hbqtgui.hbm @@ -10,6 +10,7 @@ g/filelist.hbm hbqt_hbqabstractitemmodel.cpp hbqt_hbqgraphicsitem.cpp hbqt_hbqgraphicsrectitem.cpp +hbqt_hbqgraphicsscene.cpp hbqt_hbqmainwindow.cpp hbqt_hbqplaintextedit.cpp hbqt_hbqsyntaxhighlighter.cpp @@ -17,6 +18,7 @@ hbqt_hbqtableview.cpp hbqt_utils.cpp hbqt_hbqabstractitemmodel.h +hbqt_hbqgraphicsscene.h hbqt_hbqmainwindow.h hbqt_hbqplaintextedit.h hbqt_hbqsyntaxhighlighter.h diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth index dcebd7c623..283562b85d 100644 --- a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth +++ b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth @@ -57,8 +57,8 @@ QObject = no Inherit = QGraphicsItem -Type = -New = +Type = +New = @@ -72,7 +72,17 @@ New = */ HB_FUNC( QT_HBQGRAPHICSITEM ) { - // hb_retptr( new HBQGraphicsItem() ); + if( hb_pcount() == 1 && HB_ISNUM( 1 ) ) + { + hb_retptr( new HBQGraphicsItem( hb_parni( 1 ) ) ); + } + else if( hb_pcount() == 2 && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) ) + { + hb_retptr( new HBQGraphicsItem( hb_parni( 1 ), hbqt_par_QGraphicsItem( 2 ) ) ); + } + else { + hb_retptr( new HBQGraphicsItem() ); + } } @@ -80,7 +90,56 @@ HB_FUNC( QT_HBQGRAPHICSITEM ) -void hbSetBlock( PHB_ITEM block ) + void hbSetBlock( PHB_ITEM block ) + + QPen pen() + void setPen( const QPen & pen ) + QBrush brush() + void setBrush( const QBrush & brush ) + QBrush backgroundBrush() + void setBackgroundBrush( const QBrush & brush ) + QFont font() + void setFont( const QFont & font ) + int lineStyle() + void setLineStyle( int lineStyle ) + int startAngle() + void setStartAngle( int startAngle ) + int spanAngle() + void setSpanAngle( int spanAngle ) + qreal width() const + void setWidth( qreal width ) + qreal height() const + void setHeight( qreal height ) + int opacity() + void setOpacity( const int opacity ) + QRectF geometry() + void setGeometry( const QRectF & rect ) + QString objectType() + void setObjectType( const QString & type ) + QString text() + void setText( const QString & type ) + + int paintType() + void setPaintType( int paintType ) + int frameType() + void setFrameType( int frameType ) + int drawTextType() + void setDrawTextType( int drawTextType ) + QPixmap pixmap() + void setPixmap( const QPixmap & pixmap ) + QColor textColor() + void setTextColor( const QColor & color ) + int borderWidth() + void setBorderWidth( int bWidth ) + QColor borderColor() + void setBorderColor( const QColor & color ) + int sizePolicy() + void setSizePolicy( int sizePolicy ) + int textFlags() + void setTextFlags( int textFlags ) + int resizeFlags() + void setResizeFlags( int resizeFlags ) + diff --git a/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth new file mode 100644 index 0000000000..60d29bcc80 --- /dev/null +++ b/harbour/contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth @@ -0,0 +1,128 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * QT Source Generator for Harbour + * + * Copyright 2009-2010 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 +; + + +QObject = +Inherit = QGraphicsScene +Type = +New = + + + +#include +#include "hbqt_hbqgraphicsscene.h" + +/* + * HBQGraphicsScene() + * HBQGraphicsScene( QObject * parent ) + * ~HBQGraphicsScene() + */ +HB_FUNC( QT_HBQGRAPHICSSCENE ) +{ + if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) + { + hb_retptr( new HBQGraphicsScene( hbqt_par_QObject( 1 ) ) ); + } + else + { + hb_retptr( new HBQGraphicsScene() ); + } +} + + + + enum Magnet { Left, Right, Top, Bottom, Vertical, Horizontal } + + + + void hbSetBlock( PHB_ITEM block ) + + virtual int pageSize() + virtual void setPageSize( int pageSize ) + QRectF paperRect() + void setPaperRect( const QRectF & paperRect ) + virtual int orientation() + virtual void setOrientation( int orientation ) + virtual QRectF geometry() + virtual void setGeometry( const QRectF & rect ) + int magnetArea() + void setMagnetArea( int magnetArea ) + virtual bool showGrid() + virtual void setShowGrid( bool showGrid ) + virtual void zoomWYSIWYG(); + virtual void zoomIn(); + virtual void zoomOut(); + virtual void zoomOriginal(); + + + + + virtual void setLeftMagnet( bool magneted ) + virtual void setRightMagnet( bool magneted ) + virtual void setTopMagnet( bool magneted ) + virtual void setBottomMagnet( bool magneted ) + virtual void setHorizontalMagnet( bool magneted ) + virtual void setVerticalMagnet( bool magneted ) + + + + + + + + + + diff --git a/harbour/contrib/hbqt/utils/qtgui.qtp b/harbour/contrib/hbqt/utils/qtgui.qtp index 1b4f459580..0e7516e81c 100644 --- a/harbour/contrib/hbqt/utils/qtgui.qtp +++ b/harbour/contrib/hbqt/utils/qtgui.qtp @@ -9,6 +9,7 @@ HBQAbstractItemModel.qth HBQGraphicsItem.qth HBQGraphicsRectItem.qth +HBQGraphicsScene.qth HBQMainWindow.qth HBQPlainTextEdit.qth HBQSyntaxHighlighter.qth