diff --git a/harbour/ChangeLog b/harbour/ChangeLog index dde29d2f0b..3a991df589 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,27 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-10 10:36 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbide/resources/ffn.png + * contrib/hbide/resources/panel_1.png + * contrib/hbide/resources/panel_4.png + * contrib/hbide/resources/panel_6.png + ! Some cosmatic changes. + + * contrib/hbqt/hbqt.ch + + Added more constants. + + * contrib/hbqt/hbqt_hbslots.cpp + * contrib/hbqt/hbqt_hbslots.h + + Added more slots for QCompleter. + ! Changed some exiting : (text) -> (QString) + + * contrib/hbide/ideactions.prg + * contrib/hbide/ideeditor.prg + * contrib/hbide/idefindreplace.prg + * contrib/hbide/idehome.prg + + Prepared for auto completion of functions. + 2010-03-10 17:55 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * config/beos/gcc.mk * config/bsd/gcc.mk diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index 7ebd2b4de9..4c27234588 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -384,7 +384,7 @@ METHOD IdeActions:buildToolBar() ::qViewsCombo:addItem( s ) NEXT ::qViewsCombo:setCurrentIndex( -1 ) - ::connect( ::qViewsCombo, "currentIndexChanged(text)", {|p| ::oDK:setView( p ) } ) + ::connect( ::qViewsCombo, "currentIndexChanged(QString)", {|p| ::oDK:setView( p ) } ) RETURN Self diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index fcb04b1f4b..70210b3f93 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -86,6 +86,8 @@ #define contentsChange 22 #define timerTimeout 23 +#define qcompleter_activated 101 + #define EDT_LINNO_WIDTH 50 /*----------------------------------------------------------------------*/ @@ -100,7 +102,7 @@ CLASS IdeEditsManager INHERIT IdeObject METHOD destroy() METHOD removeSourceInTree( cSourceFile ) METHOD addSourceInTree( cSourceFile ) - METHOD exeEvent( nMode, p ) + METHOD execEvent( nMode, p ) METHOD buildEditor( cSourceFile, nPos, nHPos, nVPos, cTheme, cView ) METHOD getTabBySource( cSource ) METHOD getTabCurrent() @@ -197,8 +199,11 @@ METHOD IdeEditsManager:create( oIde ) aadd( ::aActions, { "Close Split" , oSub:addAction( "Close Split Window" ) } ) ::oIde:qCompleter := QCompleter():new() - ::qCompleter:setCaseSensitivity( Qt_CaseInsensitive ) + ::qCompleter:setCaseSensitivity( Qt_CaseInsensitive ) + ::qCompleter:setCompletionMode( QCompleter_PopupCompletion ) + + ::connect( ::qCompleter, "activated(QString)", {|p| ::execEvent( qcompleter_activated, p ) } ) RETURN Self @@ -207,6 +212,9 @@ METHOD IdeEditsManager:create( oIde ) METHOD IdeEditsManager:destroy() LOCAL a_ + ::disconnect( ::qCompleter, "activated(QString)" ) + ::oIde:qCompleter := NIL + FOR EACH a_ IN ::aActions a_[ 2 ] := NIL NEXT @@ -256,20 +264,13 @@ METHOD IdeEditsManager:addSourceInTree( cSourceFile ) /*----------------------------------------------------------------------*/ -METHOD IdeEditsManager:exeEvent( nMode, p ) - //LOCAL qObj +METHOD IdeEditsManager:execEvent( nMode, p ) HB_SYMBOL_UNUSED( p ) DO CASE - CASE nMode == 1 // "customContextMenuRequested(QPoint)" - #if 0 - qObj := QWidget():configure( ::qTabWidget:childAt_1( QPoint():configure( p ) ) ) - IF !e - hbide_dbg( qObj:x(), qObj:y() ) - #endif - CASE nMode == 2 - CASE nMode == 3 + CASE nMode == qcompleter_activated + ENDCASE RETURN Nil diff --git a/harbour/contrib/hbide/idefindreplace.prg b/harbour/contrib/hbide/idefindreplace.prg index 9820fa033e..65bc5cc5ce 100644 --- a/harbour/contrib/hbide/idefindreplace.prg +++ b/harbour/contrib/hbide/idefindreplace.prg @@ -337,9 +337,9 @@ METHOD IdeFindReplace:create( oIde ) {|| ::oIde:aIni[ INI_HBIDE, FindDialogGeometry ] := hbide_posAndSize( ::oUI:oWidget ), ; ::oUI:hide() } ) - ::oUI:signal( "comboFindWhat", "editTextChanged(text)", {|| ::oUI:q_radioEntire:setChecked( .t. ) } ) + ::oUI:signal( "comboFindWhat", "editTextChanged(QString)", {|| ::oUI:q_radioEntire:setChecked( .t. ) } ) - ::oUI:signal( "comboFindWhat", "currentIndexChanged(text)", ; + ::oUI:signal( "comboFindWhat", "currentIndexChanged(QString)", ; {|p| ::oIde:oSBar:getItem( SB_PNL_SEARCH ):caption := "FIND: " + p } ) ::oUI:signal( "checkListOnly", "stateChanged(int)", {|p| ; @@ -705,7 +705,7 @@ METHOD IdeFindInFiles:buildUI() ::oUI:signal( "buttonRepl" , "clicked()" , {| | ::execEvent( "buttonRepl" ) } ) ::oUI:signal( "buttonStop" , "clicked()" , {| | ::execEvent( "buttonStop" ) } ) ::oUI:signal( "checkAll" , "stateChanged(int)" , {|p| ::execEvent( "checkAll", p ) } ) - ::oUI:signal( "comboFind" , "currentIndexChanged(text)", {|p| ::execEvent( "comboFind", p ) } ) + ::oUI:signal( "comboFind" , "currentIndexChanged(QString)", {|p| ::execEvent( "comboFind", p ) } ) ::oUI:signal( "checkListOnly", "stateChanged(int)" , {|p| ::execEvent( "checkListOnly", p ) } ) ::oUI:signal( "checkFolders" , "stateChanged(int)" , {|p| ::execEvent( "checkFolders", p ) } ) ::oUI:signal( "editResults" , "copyAvailable(bool)" , {|l| ::execEvent( "editResults", l ) } ) diff --git a/harbour/contrib/hbide/idehome.prg b/harbour/contrib/hbide/idehome.prg index c5e558ca33..c0f23472eb 100644 --- a/harbour/contrib/hbide/idehome.prg +++ b/harbour/contrib/hbide/idehome.prg @@ -252,7 +252,7 @@ METHOD IdeHome:paintRequested( pPrinter ) METHOD IdeHome:setStyleSheetTextBrowser( qBrw ) qBrw:setStyleSheet( 'QTextBrowser { background-image: url(resources/hbidesplashwatermark.png); ' + ; - 'background-attachment: scroll; background-repeat:no-repeat; background-position:center;' + ; + 'background-attachment: scroll; background-repeat:no-repeat; background-position:center; ' + ; 'background-color: rgb(255,255,255); }' ) RETURN Self diff --git a/harbour/contrib/hbide/resources/ffn.png b/harbour/contrib/hbide/resources/ffn.png index 365a5bf606..bd1d24496b 100644 Binary files a/harbour/contrib/hbide/resources/ffn.png and b/harbour/contrib/hbide/resources/ffn.png differ diff --git a/harbour/contrib/hbide/resources/panel_1.png b/harbour/contrib/hbide/resources/panel_1.png index a6f0ec4afb..2839e4bf06 100644 Binary files a/harbour/contrib/hbide/resources/panel_1.png and b/harbour/contrib/hbide/resources/panel_1.png differ diff --git a/harbour/contrib/hbide/resources/panel_4.png b/harbour/contrib/hbide/resources/panel_4.png index e28662f76e..067e81b371 100644 Binary files a/harbour/contrib/hbide/resources/panel_4.png and b/harbour/contrib/hbide/resources/panel_4.png differ diff --git a/harbour/contrib/hbide/resources/panel_6.png b/harbour/contrib/hbide/resources/panel_6.png index 067e81b371..a6f0ec4afb 100644 Binary files a/harbour/contrib/hbide/resources/panel_6.png and b/harbour/contrib/hbide/resources/panel_6.png differ diff --git a/harbour/contrib/hbqt/hbqt.ch b/harbour/contrib/hbqt/hbqt.ch index 39ce6b75e5..63d342e3fc 100644 --- a/harbour/contrib/hbqt/hbqt.ch +++ b/harbour/contrib/hbqt/hbqt.ch @@ -2212,6 +2212,14 @@ #define QLayout_SetMinAndMaxSize 5 // The main widget's minimum size is set to minimumSize() and its maximum size is set to maximumSize(). #define QLayout_SetNoConstraint 1 // The widget is not constrained. +#define QCompleter_PopupCompletion 0 // Current completions are displayed in a popup window. +#define QCompleter_InlineCompletion 2 // Completions appear inline (as selected text). +#define QCompleter_UnfilteredPopupCompletion 1 // All possible completions are displayed in a popup window with the most likely suggestion indicated as current. + +#define QCompleter_UnsortedModel 0 // The model is unsorted. +#define QCompleter_CaseSensitivelySortedModel 1 // The model is sorted case sensitively. +#define QCompleter_CaseInsensitivelySortedModel 2 // The model is sorted case insensitively. + /*----------------------------------------------------------------------*/ #define _HBQT_CH diff --git a/harbour/contrib/hbqt/hbqt_hbslots.cpp b/harbour/contrib/hbqt/hbqt_hbslots.cpp index 88dee0f6af..f663252c79 100644 --- a/harbour/contrib/hbqt/hbqt_hbslots.cpp +++ b/harbour/contrib/hbqt/hbqt_hbslots.cpp @@ -195,10 +195,10 @@ static bool connect_signal( QString signal, QObject * object, HBSlots * t_slots if( signal == ( QString ) "started()" ) return object->connect( object, SIGNAL( started() ), t_slots, SLOT( started() ), Qt::AutoConnection ); if( signal == ( QString ) "stateChanged(int)" ) return object->connect( object, SIGNAL( stateChanged( int ) ), t_slots, SLOT( stateChanged( int ) ), Qt::AutoConnection ); /* QComboBox */ - if( signal == ( QString ) "activated(text)" ) return object->connect( object, SIGNAL( activated( const QString & ) ), t_slots, SLOT( activated( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentIndexChanged(text)" ) return object->connect( object, SIGNAL( currentIndexChanged( const QString & ) ), t_slots, SLOT( currentIndexChanged( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "editTextChanged(text)" ) return object->connect( object, SIGNAL( editTextChanged( const QString & ) ), t_slots, SLOT( editTextChanged( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "highlighted(text)" ) return object->connect( object, SIGNAL( highlighted( const QString & ) ), t_slots, SLOT( highlighted( const QString & ) ), Qt::AutoConnection ); + if( signal == ( QString ) "activated(QString)" ) return object->connect( object, SIGNAL( activated( const QString & ) ), t_slots, SLOT( activated( const QString & ) ), Qt::AutoConnection ); + if( signal == ( QString ) "currentIndexChanged(QString)" ) return object->connect( object, SIGNAL( currentIndexChanged( const QString & ) ), t_slots, SLOT( currentIndexChanged( const QString & ) ), Qt::AutoConnection ); + if( signal == ( QString ) "editTextChanged(QString)" ) return object->connect( object, SIGNAL( editTextChanged( const QString & ) ), t_slots, SLOT( editTextChanged( const QString & ) ), Qt::AutoConnection ); + if( signal == ( QString ) "highlighted(QString)" ) return object->connect( object, SIGNAL( highlighted( const QString & ) ), t_slots, SLOT( highlighted( const QString & ) ), Qt::AutoConnection ); /* QTextDocument */ if( signal == ( QString ) "blockCountChanged(int)" ) return object->connect( object, SIGNAL( blockCountChanged( int ) ), t_slots, SLOT( blockCountChanged( int ) ), Qt::AutoConnection ); if( signal == ( QString ) "contentsChange(int,int,int)" ) return object->connect( object, SIGNAL( contentsChange( int, int, int ) ), t_slots, SLOT( contentsChange( int, int, int ) ), Qt::AutoConnection ); @@ -227,6 +227,9 @@ static bool connect_signal( QString signal, QObject * object, HBSlots * t_slots if( signal == ( QString ) "featuresChanged(int)" ) return object->connect( object, SIGNAL( featuresChanged( QDockWidget::DockWidgetFeatures ) ), t_slots, SLOT( featuresChanged( QDockWidget::DockWidgetFeatures ) ), Qt::AutoConnection ); if( signal == ( QString ) "topLevelChanged(bool)" ) return object->connect( object, SIGNAL( topLevelChanged( bool ) ), t_slots, SLOT( topLevelChanged( bool ) ), Qt::AutoConnection ); if( signal == ( QString ) "visibilityChanged(bool)" ) return object->connect( object, SIGNAL( visibilityChanged( bool ) ), t_slots, SLOT( visibilityChanged( bool ) ), Qt::AutoConnection ); + /* QCompleter */ + if( signal == ( QString ) "activated(QModelIndex)" ) return object->connect( object, SIGNAL( activated( const QModelIndex & ) ), t_slots, SLOT( activated( const QModelIndex & ) ), Qt::AutoConnection ); + if( signal == ( QString ) "highlighted(QModelIndex)" ) return object->connect( object, SIGNAL( highlighted( const QModelIndex & ) ), t_slots, SLOT( highlighted( const QModelIndex & ) ), Qt::AutoConnection ); /* New */ return false; @@ -351,10 +354,10 @@ static bool disconnect_signal( QObject * object, const char * signal ) if( signal == ( QString ) "started()" ) return object->disconnect( SIGNAL( started() ) ); if( signal == ( QString ) "stateChanged(int)" ) return object->disconnect( SIGNAL( stateChanged( int ) ) ); /* QComboBox */ - if( signal == ( QString ) "activated(text)" ) return object->disconnect( SIGNAL( activated( const QString & ) ) ); - if( signal == ( QString ) "currentIndexChanged(text)" ) return object->disconnect( SIGNAL( currentIndexChanged( const QString & ) ) ); - if( signal == ( QString ) "editTextChanged(text)" ) return object->disconnect( SIGNAL( editTextChanged( const QString & ) ) ); - if( signal == ( QString ) "highlighted(text)" ) return object->disconnect( SIGNAL( highlighted( const QString & ) ) ); + if( signal == ( QString ) "activated(QString)" ) return object->disconnect( SIGNAL( activated( const QString & ) ) ); + if( signal == ( QString ) "currentIndexChanged(QString)" ) return object->disconnect( SIGNAL( currentIndexChanged( const QString & ) ) ); + if( signal == ( QString ) "editTextChanged(QString)" ) return object->disconnect( SIGNAL( editTextChanged( const QString & ) ) ); + if( signal == ( QString ) "highlighted(QString)" ) return object->disconnect( SIGNAL( highlighted( const QString & ) ) ); /* QTextDocument */ if( signal == ( QString ) "blockCountChanged(int)" ) return object->disconnect( SIGNAL( blockCountChanged( int ) ) ); if( signal == ( QString ) "contentsChange(int,int,int)" ) return object->disconnect( SIGNAL( contentsChange( int, int, int ) ) ); @@ -392,6 +395,9 @@ static bool disconnect_signal( QObject * object, const char * signal ) if( signal == ( QString ) "featuresChanged(int)" ) return object->disconnect( SIGNAL( featuresChanged( QDockWidget::DockWidgetFeatures ) ) ); if( signal == ( QString ) "topLevelChanged(bool)" ) return object->disconnect( SIGNAL( topLevelChanged( bool ) ) ); if( signal == ( QString ) "visibilityChanged(bool)" ) return object->disconnect( SIGNAL( visibilityChanged( bool ) ) ); + /* QCompleter */ + if( signal == ( QString ) "activated(QModelIndex)" ) return object->disconnect( SIGNAL( activated( const QModelIndex & ) ) ); + if( signal == ( QString ) "highlighted(QModelIndex)" ) return object->disconnect( SIGNAL( highlighted( const QModelIndex & ) ) ); /* new */ return false; } @@ -958,10 +964,10 @@ void HBSlots::readyReadStandardOutput() void HBSlots::started() { hbqt_SlotsExec( this, qobject_cast( sender() ), "started()" ); } void HBSlots::stateChanged( QProcess::ProcessState newState ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "stateChanged(int)", newState ); } /* QComboBox */ -void HBSlots::activated( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "activated(text)", text ); } -void HBSlots::currentIndexChanged( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "currentIndexChanged(text)", text ); } -void HBSlots::editTextChanged( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "editTextChanged(text)", text ); } -void HBSlots::highlighted( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "highlighted(text)", text ); } +void HBSlots::activated( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "activated(QString)", text ); } +void HBSlots::currentIndexChanged( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "currentIndexChanged(QString)", text ); } +void HBSlots::editTextChanged( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "editTextChanged(QString)", text ); } +void HBSlots::highlighted( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "highlighted(QString)", text ); } /* QTextDocument */ void HBSlots::blockCountChanged( int newBlockCount ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "blockCountChanged(int)", newBlockCount ); } void HBSlots::contentsChange( int position, int charsRemoved, int charsAdded ) { hbqt_SlotsExecIntIntInt( this, qobject_cast( sender() ), "contentsChange(int,int,int)", position, charsRemoved, charsAdded ); } @@ -1008,6 +1014,9 @@ void HBSlots::dockLocationChanged( Qt::DockWidgetArea area ) void HBSlots::featuresChanged( QDockWidget::DockWidgetFeatures features ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "featuresChanged(int)", features ); } void HBSlots::topLevelChanged( bool topLevel ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "topLevelChanged(bool)", topLevel ); } void HBSlots::visibilityChanged( bool visible ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "visibilityChanged(bool)", visible ); } +/* QCompleter */ +void HBSlots::activated( const QModelIndex & index ) { hbqt_SlotsExecModel( this, qobject_cast( sender() ), "activated(QModelIndex)", index ); } +void HBSlots::highlighted( const QModelIndex & index ) { hbqt_SlotsExecModel( this, qobject_cast( sender() ), "highlighted(QModelIndex)", index ); } /* Latest */ diff --git a/harbour/contrib/hbqt/hbqt_hbslots.h b/harbour/contrib/hbqt/hbqt_hbslots.h index cc3ba70df3..b359589171 100644 --- a/harbour/contrib/hbqt/hbqt_hbslots.h +++ b/harbour/contrib/hbqt/hbqt_hbslots.h @@ -277,7 +277,10 @@ public slots: void featuresChanged( QDockWidget::DockWidgetFeatures features ); void topLevelChanged( bool topLevel ); void visibilityChanged( bool visible ); - /* */ + /* QCompleter */ + void activated( const QModelIndex & index ); + void highlighted( const QModelIndex & index ); + /* Latest */ }; /*----------------------------------------------------------------------*/