diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9428162cbd..de8cb82365 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,37 @@ The license applies to all entries newer than 2009-04-28. */ +2010-10-23 16:27 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/qtgui/hbqtgui.hbx + * contrib/hbqt/qtgui/THbQtUI.prg + * Renamed HbQtUI2 class to HbQtUI. + + * contrib/hbqt/hbqt_hbmk2_plugin.hbs + * Changed code generared for .ui embedding to use + new, cleaned HbQtUI object. + ; TODO: Fix user code to not access HbQtUI internal + variables. + + * contrib/hbqt/qtcore/hbqt_hbqslots.cpp + * contrib/hbqt/qtcore/hbqt_hbqslots.h + - Deleted old monolithic code. + - Deleted eval callback variation (it was disabled). + % Cleaned headers. + ; TODO: Dynamically register the callbacks, so we can finally + delete QtGui references from this code. + + * contrib/hbqt/qtcore/hbqtcore.hbm + % Do not include hbqt_hbqslots.h anymore. + + * contrib/hbqt/qtuitools/hbqtuitools.hbx + * contrib/hbqt/qtuitools/THbQtUILoader.prg + * Renamed HbQtUI class to HbQtUILoader. + + Added TOFIX to change this class to inherit from HbQtUI. + ; INCOMPATIBLE: If you use HbQtUI class to load on-disk .ui or .uic + files, update your code to use HbQtUILoader(). + ; NOTE: hbide must be clean built. (and all other apps that + are embedding .ui files) + 2010-10-23 14:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * external/libhpdf/libhpdf.dif * Patched up the diff file, fixing previous problem and applying diff --git a/harbour/contrib/hbqt/hbqt_hbmk2_plugin.hbs b/harbour/contrib/hbqt/hbqt_hbmk2_plugin.hbs index 6ac92a0842..00cafea4ac 100644 --- a/harbour/contrib/hbqt/hbqt_hbmk2_plugin.hbs +++ b/harbour/contrib/hbqt/hbqt_hbmk2_plugin.hbs @@ -594,7 +594,6 @@ STATIC FUNCTION hbq_gen_ui_prg( cFile, cFuncName ) AAdd( aLinesPRG, "" ) AAdd( aLinesPRG, "FUNCTION " + cFuncName + "( qParent )" ) - AAdd( aLinesPRG, " LOCAL oUI" ) AAdd( aLinesPRG, " LOCAL oRootWidget" ) AAdd( aLinesPRG, " LOCAL hWidget := { => }" ) AAdd( aLinesPRG, "" ) @@ -679,16 +678,7 @@ STATIC FUNCTION hbq_gen_ui_prg( cFile, cFuncName ) ENDIF NEXT AAdd( aLinesPRG, "" ) - #if 0 - AAdd( aLinesPRG, " oUI := HbQtUI2():new( oRootWidget, hWidget )" ) - #else - AAdd( aLinesPRG, " oUI := HbQtUI():new()" ) - AAdd( aLinesPRG, " oUI:qObj := hWidget" ) - AAdd( aLinesPRG, " oUI:oWidget := oRootWidget" ) - AAdd( aLinesPRG, " oUI:pPtr := oRootWidget:pPtr" ) - #endif - AAdd( aLinesPRG, "" ) - AAdd( aLinesPRG, " RETURN oUI" ) + AAdd( aLinesPRG, " RETURN HbQtUI():new( oRootWidget, hWidget )" ) AAdd( aLinesPRG, "" ) RETURN aLinesPRG diff --git a/harbour/contrib/hbqt/qtcore/hbqt_hbqslots.cpp b/harbour/contrib/hbqt/qtcore/hbqt_hbqslots.cpp index 44c74012d7..a241646f6b 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_hbqslots.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_hbqslots.cpp @@ -68,1467 +68,83 @@ #include /*----------------------------------------------------------------------*/ -#ifdef __PRITPAL__ -static bool connect_signal( QString signal, QObject * object, HBQSlots * t_slots ) -{ - #if 0 - void stateChanged( QProcess::ProcessState newState ); - #endif - if( signal == ( QString ) "customContextMenuRequested(QPoint)" ) return object->connect( object, SIGNAL( customContextMenuRequested( const QPoint & ) ), t_slots, SLOT( customContextMenuRequested( const QPoint & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "clicked()" ) return object->connect( object, SIGNAL( clicked() ), t_slots, SLOT( clicked() ), Qt::AutoConnection ); - if( signal == ( QString ) "returnPressed()" ) return object->connect( object, SIGNAL( returnPressed() ), t_slots, SLOT( returnPressed() ), Qt::AutoConnection ); - if( signal == ( QString ) "triggered()" ) return object->connect( object, SIGNAL( triggered() ), t_slots, SLOT( triggered() ), Qt::AutoConnection ); - if( signal == ( QString ) "hovered()" ) return object->connect( object, SIGNAL( hovered() ), t_slots, SLOT( hovered() ), Qt::AutoConnection ); - if( signal == ( QString ) "viewportEntered()" ) return object->connect( object, SIGNAL( viewportEntered() ), t_slots, SLOT( viewportEntered() ), Qt::AutoConnection ); - if( signal == ( QString ) "pressed()" ) return object->connect( object, SIGNAL( pressed() ), t_slots, SLOT( pressed() ), Qt::AutoConnection ); - if( signal == ( QString ) "released()" ) return object->connect( object, SIGNAL( released() ), t_slots, SLOT( released() ), Qt::AutoConnection ); - if( signal == ( QString ) "stateChanged(int)" ) return object->connect( object, SIGNAL( stateChanged( int ) ), t_slots, SLOT( stateChanged( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "activated(int)" ) return object->connect( object, SIGNAL( activated( int ) ), t_slots, SLOT( activated( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentIndexChanged(int)" ) return object->connect( object, SIGNAL( currentIndexChanged( int ) ), t_slots, SLOT( currentIndexChanged( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "highlighted(int)" ) return object->connect( object, SIGNAL( highlighted( int ) ), t_slots, SLOT( highlighted( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "triggered(bool)" ) return object->connect( object, SIGNAL( triggered( bool ) ), t_slots, SLOT( triggered( bool ) ), Qt::AutoConnection ); - if( signal == ( QString ) "clicked(QModelIndex)" ) return object->connect( object, SIGNAL( clicked( const QModelIndex & ) ), t_slots, SLOT( clicked( const QModelIndex & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "doubleClicked(QModelIndex)" ) return object->connect( object, SIGNAL( doubleClicked( const QModelIndex & ) ), t_slots, SLOT( doubleClicked( const QModelIndex & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "entered(QModelIndex)" ) return object->connect( object, SIGNAL( entered( const QModelIndex & ) ), t_slots, SLOT( entered( const QModelIndex & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "hovered(action)" ) return object->connect( object, SIGNAL( hovered( QAction * ) ), t_slots, SLOT( hovered( QAction * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentChanged(int)" ) return object->connect( object, SIGNAL( currentChanged( int ) ), t_slots, SLOT( currentChanged( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "actionTriggered(int)" ) return object->connect( object, SIGNAL( actionTriggered(int) ), t_slots, SLOT( actionTriggered(int) ), Qt::AutoConnection ); - if( signal == ( QString ) "rangeChanged(int,int)" ) return object->connect( object, SIGNAL( rangeChanged(int,int) ), t_slots, SLOT( rangeChanged(int,int) ), Qt::AutoConnection ); - if( signal == ( QString ) "sliderMoved(int)" ) return object->connect( object, SIGNAL( sliderMoved(int) ), t_slots, SLOT( sliderMoved(int) ), Qt::AutoConnection ); - if( signal == ( QString ) "sliderPressed()" ) return object->connect( object, SIGNAL( sliderPressed() ), t_slots, SLOT( sliderPressed() ), Qt::AutoConnection ); - if( signal == ( QString ) "sliderReleased()" ) return object->connect( object, SIGNAL( sliderReleased() ), t_slots, SLOT( sliderReleased() ), Qt::AutoConnection ); - if( signal == ( QString ) "valueChanged(int)" ) return object->connect( object, SIGNAL( valueChanged(int) ), t_slots, SLOT( valueChanged(int) ), Qt::AutoConnection ); - if( signal == ( QString ) "cursorPositionChanged(int,int)" ) return object->connect( object, SIGNAL( cursorPositionChanged(int,int) ), t_slots, SLOT( cursorPositionChanged(int,int) ), Qt::AutoConnection ); - if( signal == ( QString ) "editingFinished()" ) return object->connect( object, SIGNAL( editingFinished() ), t_slots, SLOT( editingFinished() ), Qt::AutoConnection ); - if( signal == ( QString ) "returnPressed()" ) return object->connect( object, SIGNAL( returnPressed() ), t_slots, SLOT( returnPressed() ), Qt::AutoConnection ); - if( signal == ( QString ) "selectionChanged()" ) return object->connect( object, SIGNAL( selectionChanged() ), t_slots, SLOT( selectionChanged() ), Qt::AutoConnection ); - if( signal == ( QString ) "textChanged(QString)" ) return object->connect( object, SIGNAL( textChanged( const QString & ) ), t_slots, SLOT( textChanged( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "textEdited(QString)" ) return object->connect( object, SIGNAL( textEdited( const QString & ) ), t_slots, SLOT( textEdited( const QString & ) ), Qt::AutoConnection ); - /* QTreeWidget */ - if( signal == ( QString ) "itemCollapsed(QTWItem)" ) return object->connect( object, SIGNAL( itemCollapsed( QTreeWidgetItem * ) ), t_slots, SLOT( itemCollapsed( QTreeWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemExpanded(QTWItem)" ) return object->connect( object, SIGNAL( itemExpanded( QTreeWidgetItem * ) ), t_slots, SLOT( itemExpanded( QTreeWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentItemChanged(QTWItem,QTWItem)" ) return object->connect( object, SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ), t_slots, SLOT( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemActivated(QTWItem,int)" ) return object->connect( object, SIGNAL( itemActivated( QTreeWidgetItem *, int ) ), t_slots, SLOT( itemActivated( QTreeWidgetItem *, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemChanged(QTWItem,int)" ) return object->connect( object, SIGNAL( itemChanged( QTreeWidgetItem *, int ) ), t_slots, SLOT( itemChanged( QTreeWidgetItem *, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemClicked(QTWItem,int)" ) return object->connect( object, SIGNAL( itemClicked( QTreeWidgetItem *, int ) ), t_slots, SLOT( itemClicked( QTreeWidgetItem *, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemDoubleClicked(QTWItem,int)" ) return object->connect( object, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ), t_slots, SLOT( itemDoubleClicked( QTreeWidgetItem *, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemEntered(QTWItem,int)" ) return object->connect( object, SIGNAL( itemEntered( QTreeWidgetItem *, int ) ), t_slots, SLOT( itemEntered( QTreeWidgetItem *, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemPressed(QTWItem,int)" ) return object->connect( object, SIGNAL( itemPressed( QTreeWidgetItem *, int ) ), t_slots, SLOT( itemPressed( QTreeWidgetItem *, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemSelectionChanged()" ) return object->connect( object, SIGNAL( itemSelectionChanged() ), t_slots, SLOT( itemSelectionChanged() ), Qt::AutoConnection ); - /* QListWidget */ - if( signal == ( QString ) "currentRowChanged(int)" ) return object->connect( object, SIGNAL( currentRowChanged( int ) ), t_slots, SLOT( currentRowChanged( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentTextChanged(QString)" ) return object->connect( object, SIGNAL( currentTextChanged( const QString & ) ), t_slots, SLOT( currentTextChanged( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentItemChanged(QLWItem,QLWItem)" ) return object->connect( object, SIGNAL( currentItemChanged( QListWidgetItem *, QListWidgetItem * ) ), t_slots, SLOT( currentItemChanged( QListWidgetItem *, QListWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemActivated(QLWItem)" ) return object->connect( object, SIGNAL( itemActivated( QListWidgetItem * ) ), t_slots, SLOT( itemActivated( QListWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemChanged(QLWItem)" ) return object->connect( object, SIGNAL( itemChanged( QListWidgetItem * ) ), t_slots, SLOT( itemChanged( QListWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemClicked(QLWItem)" ) return object->connect( object, SIGNAL( itemClicked( QListWidgetItem * ) ), t_slots, SLOT( itemClicked( QListWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemDoubleClicked(QLWItem)" ) return object->connect( object, SIGNAL( itemDoubleClicked( QListWidgetItem * ) ), t_slots, SLOT( itemDoubleClicked( QListWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemEntered(QLWItem)" ) return object->connect( object, SIGNAL( itemEntered( QListWidgetItem * ) ), t_slots, SLOT( itemEntered( QListWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemPressed(QLWItem)" ) return object->connect( object, SIGNAL( itemPressed( QListWidgetItem * ) ), t_slots, SLOT( itemPressed( QListWidgetItem * ) ), Qt::AutoConnection ); - /* QTableWidget */ - if( signal == ( QString ) "cellActivated(int,in)" ) return object->connect( object, SIGNAL( cellActivated( int, int ) ), t_slots, SLOT( cellActivated( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellChanged(int,int)" ) return object->connect( object, SIGNAL( cellChanged( int, int ) ), t_slots, SLOT( cellChanged( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellClicked(int,int)" ) return object->connect( object, SIGNAL( cellClicked( int, int ) ), t_slots, SLOT( cellClicked( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellDoubleClicked(int,int)" ) return object->connect( object, SIGNAL( cellDoubleClicked( int, int ) ), t_slots, SLOT( cellDoubleClicked( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellEntered(int,int)" ) return object->connect( object, SIGNAL( cellEntered( int, int ) ), t_slots, SLOT( cellEntered( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cellPressed(int,int)" ) return object->connect( object, SIGNAL( cellPressed( int, int ) ), t_slots, SLOT( cellPressed( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentCellChanged(int,int,int,int)" ) return object->connect( object, SIGNAL( currentCellChanged( int, int, int, int ) ), t_slots, SLOT( currentCellChanged( int, int, int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentItemChanged(QTblWItem,QLWItem)" ) return object->connect( object, SIGNAL( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ), t_slots, SLOT( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemActivated(QTblWItem)" ) return object->connect( object, SIGNAL( itemActivated( QTableWidgetItem * ) ), t_slots, SLOT( itemActivated( QTableWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemChanged(QTblWItem)" ) return object->connect( object, SIGNAL( itemChanged( QTableWidgetItem * ) ), t_slots, SLOT( itemChanged( QTableWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemClicked(QTblWItem)" ) return object->connect( object, SIGNAL( itemClicked( QTableWidgetItem * ) ), t_slots, SLOT( itemClicked( QTableWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemDoubleClicked(QTblWItem)" ) return object->connect( object, SIGNAL( itemDoubleClicked( QTableWidgetItem * ) ), t_slots, SLOT( itemDoubleClicked( QTableWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemEntered(QTblWItem)" ) return object->connect( object, SIGNAL( itemEntered( QTableWidgetItem * ) ), t_slots, SLOT( itemEntered( QTableWidgetItem * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "itemPressed(QTblWItem)" ) return object->connect( object, SIGNAL( itemPressed( QTableWidgetItem * ) ), t_slots, SLOT( itemPressed( QTableWidgetItem * ) ), Qt::AutoConnection ); - /* QDialog (s) QFontDialog, QFileDialog */ - if( signal == ( QString ) "currentFontChanged(QFont)" ) return object->connect( object, SIGNAL( currentFontChanged( const QFont & ) ), t_slots, SLOT( currentFontChanged( const QFont & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "fontSelected(QFont)" ) return object->connect( object, SIGNAL( fontSelected( const QFont & ) ), t_slots, SLOT( fontSelected( const QFont & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "accepted()" ) return object->connect( object, SIGNAL( accepted() ), t_slots, SLOT( accepted() ), Qt::AutoConnection ); - if( signal == ( QString ) "finished(int)" ) return object->connect( object, SIGNAL( finished( int ) ), t_slots, SLOT( finished( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "rejected()" ) return object->connect( object, SIGNAL( rejected() ), t_slots, SLOT( rejected() ), Qt::AutoConnection ); - if( signal == ( QString ) "currentChanged(QString)" ) return object->connect( object, SIGNAL( currentChanged( const QString & ) ), t_slots, SLOT( currentChanged( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "directoryEntered(QString)" ) return object->connect( object, SIGNAL( directoryEntered( const QString & ) ), t_slots, SLOT( directoryEntered( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "fileSelected(QString)" ) return object->connect( object, SIGNAL( fileSelected( const QString & ) ), t_slots, SLOT( fileSelected( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "filesSelected(QStringList)" ) return object->connect( object, SIGNAL( filesSelected( const QStringList & ) ), t_slots, SLOT( filesSelected( const QStringList & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "filterSelected(QString)" ) return object->connect( object, SIGNAL( filterSelected( const QString & ) ), t_slots, SLOT( filterSelected( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "accepted(QPrinter)" ) return object->connect( object, SIGNAL( accepted( QPrinter * ) ), t_slots, SLOT( accepted( QPrinter * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "copyAvailable(bool)" ) return object->connect( object, SIGNAL( copyAvailable( bool ) ), t_slots, SLOT( copyAvailable( bool ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentCharFormatChanged(QTextCharFormat)" ) return object->connect( object, SIGNAL( currentCharFormatChanged( const QTextCharFormat & ) ), t_slots, SLOT( currentCharFormatChanged( const QTextCharFormat & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "cursorPositionChanged()" ) return object->connect( object, SIGNAL( cursorPositionChanged() ), t_slots, SLOT( cursorPositionChanged() ), Qt::AutoConnection ); - if( signal == ( QString ) "redoAvailable(bool)" ) return object->connect( object, SIGNAL( redoAvailable( bool ) ), t_slots, SLOT( redoAvailable( bool ) ), Qt::AutoConnection ); - if( signal == ( QString ) "textChanged()" ) return object->connect( object, SIGNAL( textChanged() ), t_slots, SLOT( textChanged() ), Qt::AutoConnection ); - if( signal == ( QString ) "undoAvailable(bool)" ) return object->connect( object, SIGNAL( undoAvailable( bool ) ), t_slots, SLOT( undoAvailable( bool ) ), Qt::AutoConnection ); - if( signal == ( QString ) "timeout()" ) return object->connect( object, SIGNAL( timeout() ), t_slots, SLOT( timeout() ), Qt::AutoConnection ); - /* Generic purpose mechanism to receive key and mouse events off subclasses */ - if( signal == ( QString ) "geometriesChanged()" ) return object->connect( object, SIGNAL( geometriesChanged() ), t_slots, SLOT( geometriesChanged() ), Qt::AutoConnection ); - if( signal == ( QString ) "sectionAutoResize(int,QHeaderView::ResizeMode)" ) return object->connect( object, SIGNAL( sectionAutoResize( int, QHeaderView::ResizeMode ) ), t_slots, SLOT( sectionAutoResize( int, QHeaderView::ResizeMode ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sectionClicked(int)" ) return object->connect( object, SIGNAL( sectionClicked( int ) ), t_slots, SLOT( sectionClicked( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sectionCountChanged(int,int)" ) return object->connect( object, SIGNAL( sectionCountChanged( int, int ) ), t_slots, SLOT( sectionCountChanged( int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sectionDoubleClicked(int)" ) return object->connect( object, SIGNAL( sectionDoubleClicked( int ) ), t_slots, SLOT( sectionDoubleClicked( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sectionEntered(int)" ) return object->connect( object, SIGNAL( sectionEntered( int ) ), t_slots, SLOT( sectionEntered( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sectionHandleDoubleClicked(int)" ) return object->connect( object, SIGNAL( sectionHandleDoubleClicked( int ) ), t_slots, SLOT( sectionHandleDoubleClicked( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sectionMoved(int,int,int)" ) return object->connect( object, SIGNAL( sectionMoved( int, int, int ) ), t_slots, SLOT( sectionMoved( int, int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sectionPressed(int)" ) return object->connect( object, SIGNAL( sectionPressed( int ) ), t_slots, SLOT( sectionPressed( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sectionResized(int,int,int)" ) return object->connect( object, SIGNAL( sectionResized( int, int, int ) ), t_slots, SLOT( sectionResized( int, int, int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sortIndicatorChanged(int,Qt::SortOrder)" ) return object->connect( object, SIGNAL( sortIndicatorChanged( int, Qt::SortOrder ) ), t_slots, SLOT( sortIndicatorChanged( int, Qt::SortOrder ) ), Qt::AutoConnection ); - if( signal == ( QString ) "buttonClicked(int)" ) return object->connect( object, SIGNAL( buttonClicked( int ) ), t_slots, SLOT( buttonClicked( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "buttonPressed(int)" ) return object->connect( object, SIGNAL( buttonPressed( int ) ), t_slots, SLOT( buttonPressed( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "buttonReleased(int)" ) return object->connect( object, SIGNAL( buttonReleased( int ) ), t_slots, SLOT( buttonReleased( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "linkActivated(QString)" ) return object->connect( object, SIGNAL( linkActivated( const QString & ) ), t_slots, SLOT( linkActivated( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "linkHovered(QString)" ) return object->connect( object, SIGNAL( linkHovered( const QString & ) ), t_slots, SLOT( linkHovered( const QString & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "tabCloseRequested(int)" ) return object->connect( object, SIGNAL( tabCloseRequested( int ) ), t_slots, SLOT( tabCloseRequested( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "paintRequested(QPrinter)" ) return object->connect( object, SIGNAL( paintRequested( QPrinter * ) ), t_slots, SLOT( paintRequested( QPrinter * ) ), Qt::AutoConnection ); - /* QIODevice & QProcess */ - if( signal == ( QString ) "aboutToClose()" ) return object->connect( object, SIGNAL( aboutToClose() ), t_slots, SLOT( aboutToClose() ), Qt::AutoConnection ); - if( signal == ( QString ) "bytesWritten(qint64)" ) return object->connect( object, SIGNAL( bytesWritten( qint64 ) ), t_slots, SLOT( bytesWritten( qint64 ) ), Qt::AutoConnection ); - if( signal == ( QString ) "readChannelFinished()" ) return object->connect( object, SIGNAL( readChannelFinished() ), t_slots, SLOT( readChannelFinished() ), Qt::AutoConnection ); - if( signal == ( QString ) "readyRead()" ) return object->connect( object, SIGNAL( readyRead() ), t_slots, SLOT( readyRead() ), Qt::AutoConnection ); - if( signal == ( QString ) "error(int)" ) return object->connect( object, SIGNAL( error( int ) ), t_slots, SLOT( error( int ) ), Qt::AutoConnection ); - if( signal == ( QString ) "finished(int,QProcess::ExitStatus)" ) return object->connect( object, SIGNAL( finished( int, QProcess::ExitStatus ) ), t_slots, SLOT( finished( int, QProcess::ExitStatus ) ), Qt::AutoConnection ); - if( signal == ( QString ) "readyReadStandardError()" ) return object->connect( object, SIGNAL( readyReadStandardError() ), t_slots, SLOT( readyReadStandardError() ), Qt::AutoConnection ); - if( signal == ( QString ) "readyReadStandardOutput()" ) return object->connect( object, SIGNAL( readyReadStandardOutput() ), t_slots, SLOT( readyReadStandardOutput() ), Qt::AutoConnection ); - 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(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 ); - if( signal == ( QString ) "contentsChanged()" ) return object->connect( object, SIGNAL( contentsChanged() ), t_slots, SLOT( contentsChanged() ), Qt::AutoConnection ); - if( signal == ( QString ) "cursorPositionChanged(QTextCursor)" ) return object->connect( object, SIGNAL( cursorPositionChanged( const QTextCursor & ) ), t_slots, SLOT( cursorPositionChanged( const QTextCursor & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "documentLayoutChanged()" ) return object->connect( object, SIGNAL( documentLayoutChanged() ), t_slots, SLOT( documentLayoutChanged() ), Qt::AutoConnection ); - if( signal == ( QString ) "modificationChanged(bool)" ) return object->connect( object, SIGNAL( modificationChanged( bool ) ), t_slots, SLOT( modificationChanged( bool ) ), Qt::AutoConnection ); - if( signal == ( QString ) "undoCommandAdded()" ) return object->connect( object, SIGNAL( undoCommandAdded() ), t_slots, SLOT( undoCommandAdded() ), Qt::AutoConnection ); - /* QPlainTextEdit */ - if( signal == ( QString ) "updateRequest(QRect,int)" ) return object->connect( object, SIGNAL( updateRequest( const QRect &, int ) ), t_slots, SLOT( updateRequest( const QRect &, int ) ), Qt::AutoConnection ); - /* QItemSelectionModel */ - if( signal == ( QString ) "currentChanged(QModelIndex,QModelIndex)" ) return object->connect( object, SIGNAL( currentChanged( const QModelIndex &,const QModelIndex & ) ), t_slots, SLOT( currentChanged( const QModelIndex &, const QModelIndex & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentColumnChanged(QModelIndex,QModelIndex)" ) return object->connect( object, SIGNAL( currentColumnChanged( const QModelIndex &,const QModelIndex & ) ), t_slots, SLOT( currentColumnChanged( const QModelIndex &, const QModelIndex & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "currentRowChanged(QModelIndex,QModelIndex)" ) return object->connect( object, SIGNAL( currentRowChanged( const QModelIndex &,const QModelIndex & ) ), t_slots, SLOT( currentRowChanged( const QModelIndex &, const QModelIndex & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "selectionChanged(QItemSelection,QItemSelection)") return object->connect( object, SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection & )), t_slots, SLOT( selectionChanged( const QItemSelection &, const QItemSelection &) ), Qt::AutoConnection ); - /* QTextBrowser */ - if( signal == ( QString ) "anchorClicked(QUrl)" ) return object->connect( object, SIGNAL( anchorClicked( const QUrl & ) ), t_slots, SLOT( anchorClicked( const QUrl & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "backwardAvailable(bool)" ) return object->connect( object, SIGNAL( backwardAvailable( bool ) ), t_slots, SLOT( backwardAvailable( bool ) ), Qt::AutoConnection ); - if( signal == ( QString ) "forwardAvailable(bool)" ) return object->connect( object, SIGNAL( forwardAvailable( bool ) ), t_slots, SLOT( forwardAvailable( bool ) ), Qt::AutoConnection ); - if( signal == ( QString ) "highlighted(QUrl)" ) return object->connect( object, SIGNAL( highlighted( const QUrl & ) ), t_slots, SLOT( highlighted( const QUrl & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "historyChanged()" ) return object->connect( object, SIGNAL( historyChanged() ), t_slots, SLOT( historyChanged() ), Qt::AutoConnection ); - if( signal == ( QString ) "sourceChanged(QUrl)" ) return object->connect( object, SIGNAL( sourceChanged( const QUrl & ) ), t_slots, SLOT( sourceChanged( const QUrl & ) ), Qt::AutoConnection ); - /* QDockWidget */ - if( signal == ( QString ) "allowedAreasChanged(Qt::DockWidgetAreas)" ) return object->connect( object, SIGNAL( allowedAreasChanged( Qt::DockWidgetAreas ) ), t_slots, SLOT( allowedAreasChanged( Qt::DockWidgetAreas ) ), Qt::AutoConnection ); - if( signal == ( QString ) "dockLocationChanged(Qt::DockWidgetArea)" ) return object->connect( object, SIGNAL( dockLocationChanged( Qt::DockWidgetArea ) ), t_slots, SLOT( dockLocationChanged( Qt::DockWidgetArea ) ), Qt::AutoConnection ); - if( signal == ( QString ) "featuresChanged(QDockWidget::DockWidgetFeatures)" ) 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 ); - /* QAbstractButton */ - if( signal == ( QString ) "toggled(bool)" ) return object->connect( object, SIGNAL( toggled( bool ) ), t_slots, SLOT( toggled( bool ) ), Qt::AutoConnection ); - /* QSystemTrayIcon */ - if( signal == ( QString ) "activated(QSystemTrayIcon::ActivationReason)" ) return object->connect( object, SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ), t_slots, SLOT( activated( QSystemTrayIcon::ActivationReason ) ), Qt::AutoConnection ); - /* QMdiArea */ - if( signal == ( QString ) "subWindowActivated(QMdiSubWindow)" ) return object->connect( object, SIGNAL( subWindowActivated( QMdiSubWindow * ) ), t_slots, SLOT( subWindowActivated( QMdiSubWindow * ) ), Qt::AutoConnection ); - /* QMdiSubWindow */ - if( signal == ( QString ) "aboutToActivate()" ) return object->connect( object, SIGNAL( aboutToActivate() ), t_slots, SLOT( aboutToActivate() ), Qt::AutoConnection ); - if( signal == ( QString ) "windowStateChanged(Qt::WindowStates,Qt::WindowStates)" ) return object->connect( object, SIGNAL( windowStateChanged( Qt::WindowStates, Qt::WindowStates ) ), t_slots, SLOT( windowStateChanged( Qt::WindowStates, Qt::WindowStates ) ), Qt::AutoConnection ); - /* QAbstractItemDelegate */ - if( signal == ( QString ) "closeEditor(QWidget,QAbstractItemDelegate::EndEditHint)" ) return object->connect( object, SIGNAL( closeEditor( QWidget *, QAbstractItemDelegate::EndEditHint ) ), t_slots, SLOT( closeEditor( QWidget *, QAbstractItemDelegate::EndEditHint ) ), Qt::AutoConnection ); - if( signal == ( QString ) "commitData(QWidget)" ) return object->connect( object, SIGNAL( commitData( QWidget * ) ), t_slots, SLOT( commitData( QWidget * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "sizeHintChanged(QModelIndex)" ) return object->connect( object, SIGNAL( sizeHintChanged( const QModelIndex & ) ), t_slots, SLOT( sizeHintChanged( const QModelIndex & ) ), Qt::AutoConnection ); - /* QGraphicsScene */ - if( signal == ( QString ) "sceneRectChanged(QRectF)" ) return object->connect( object, SIGNAL( sceneRectChanged( const QRectF & ) ), t_slots, SLOT( sizeHintChanged( const QModelIndex & ) ), Qt::AutoConnection ); - /* QDateTimeEdit */ - if( signal == ( QString ) "dateChanged(QDate)" ) return object->connect( object, SIGNAL( dateChanged( const QDate & ) ), t_slots, SLOT( dateChanged( const QDate & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "dateTimeChanged(QDateTime)" ) return object->connect( object, SIGNAL( dateTimeChanged( const QDateTime & ) ), t_slots, SLOT( dateTimeChanged( const QDateTime & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "timeChanged(QTime)" ) return object->connect( object, SIGNAL( timeChanged( const QTime & ) ), t_slots, SLOT( timeChanged( const QTime & ) ), Qt::AutoConnection ); - /* QApplication */ -// if( signal == ( QString ) "commitDataRequest(QSessionManager)" ) return object->connect( object, SIGNAL( commitDataRequest( QSessionManager & ) ), t_slots, SLOT( commitDataRequest( QSessionManager & ) ), Qt::AutoConnection ); - if( signal == ( QString ) "focusChanged(QWidget,QWidget)" ) return object->connect( object, SIGNAL( focusChanged( QWidget *, QWidget * ) ), t_slots, SLOT( focusChanged( QWidget *, QWidget * ) ), Qt::AutoConnection ); - if( signal == ( QString ) "fontDatabaseChanged()" ) return object->connect( object, SIGNAL( fontDatabaseChanged() ), t_slots, SLOT( fontDatabaseChanged() ), Qt::AutoConnection ); - if( signal == ( QString ) "lastWindowClosed()" ) return object->connect( object, SIGNAL( lastWindowClosed() ), t_slots, SLOT( lastWindowClosed() ), Qt::AutoConnection ); -// if( signal == ( QString ) "saveStateRequest(QSessionManager)" ) return object->connect( object, SIGNAL( saveStateRequest( QSessionManager & ) ), t_slots, SLOT( saveStateRequest( QSessionManager & ) ), Qt::AutoConnection ); - /* New */ - return false; -} - -static bool disconnect_signal( QObject * object, const char * signal ) -{ - if( signal == ( QString ) "customContextMenuRequested(QPoint)" ) return object->disconnect( SIGNAL( customContextMenuRequested( const QPoint & ) ) ); - if( signal == ( QString ) "clicked()" ) return object->disconnect( SIGNAL( clicked() ) ); - if( signal == ( QString ) "returnPressed()" ) return object->disconnect( SIGNAL( returnPressed() ) ); - if( signal == ( QString ) "triggered()" ) return object->disconnect( SIGNAL( triggered() ) ); - if( signal == ( QString ) "hovered()" ) return object->disconnect( SIGNAL( hovered() ) ); - if( signal == ( QString ) "viewportEntered()" ) return object->disconnect( SIGNAL( viewportEntered() ) ); - if( signal == ( QString ) "pressed()" ) return object->disconnect( SIGNAL( pressed() ) ); - if( signal == ( QString ) "released()" ) return object->disconnect( SIGNAL( released() ) ); - if( signal == ( QString ) "stateChanged(int)" ) return object->disconnect( SIGNAL( stateChanged( int ) ) ); - if( signal == ( QString ) "activated(int)" ) return object->disconnect( SIGNAL( activated( int ) ) ); - if( signal == ( QString ) "currentIndexChanged(int)" ) return object->disconnect( SIGNAL( currentIndexChanged( int ) ) ); - if( signal == ( QString ) "highlighted(int)" ) return object->disconnect( SIGNAL( highlighted( int ) ) ); - if( signal == ( QString ) "triggered(bool)" ) return object->disconnect( SIGNAL( triggered( bool ) ) ); - if( signal == ( QString ) "clicked(QModelIndex)" ) return object->disconnect( SIGNAL( clicked( const QModelIndex & ) ) ); - if( signal == ( QString ) "doubleClicked(QModelIndex)" ) return object->disconnect( SIGNAL( doubleClicked( const QModelIndex & ) ) ); - if( signal == ( QString ) "entered(QModelIndex)" ) return object->disconnect( SIGNAL( entered( const QModelIndex & ) ) ); - if( signal == ( QString ) "hovered(action)" ) return object->disconnect( SIGNAL( hovered( QAction * ) ) ); - if( signal == ( QString ) "currentChanged(int)" ) return object->disconnect( SIGNAL( currentChanged( int ) ) ); - if( signal == ( QString ) "actionTriggered(int)" ) return object->disconnect( SIGNAL( actionTriggered(int) ) ); - if( signal == ( QString ) "rangeChanged(int,int)" ) return object->disconnect( SIGNAL( rangeChanged(int,int) ) ); - if( signal == ( QString ) "sliderMoved(int)" ) return object->disconnect( SIGNAL( sliderMoved(int) ) ); - if( signal == ( QString ) "sliderPressed()" ) return object->disconnect( SIGNAL( sliderPressed() ) ); - if( signal == ( QString ) "sliderReleased()" ) return object->disconnect( SIGNAL( sliderReleased() ) ); - if( signal == ( QString ) "valueChanged(int)" ) return object->disconnect( SIGNAL( valueChanged(int) ) ); - if( signal == ( QString ) "cursorPositionChanged(int,int)" ) return object->disconnect( SIGNAL( cursorPositionChanged(int,int) ) ); - if( signal == ( QString ) "editingFinished()" ) return object->disconnect( SIGNAL( editingFinished() ) ); - if( signal == ( QString ) "returnPressed()" ) return object->disconnect( SIGNAL( returnPressed() ) ); - if( signal == ( QString ) "selectionChanged()" ) return object->disconnect( SIGNAL( selectionChanged() ) ); - if( signal == ( QString ) "textChanged(QString)" ) return object->disconnect( SIGNAL( textChanged( const QString &) ) ); - if( signal == ( QString ) "textEdited(QString)" ) return object->disconnect( SIGNAL( textEdited( const QString &) ) ); - /* QTreeWidget */ - if( signal == ( QString ) "itemExpanded(QTWItem)" ) return object->disconnect( SIGNAL( itemExpanded( QTreeWidgetItem * ) ) ); - if( signal == ( QString ) "itemCollapsed(QTWItem)" ) return object->disconnect( SIGNAL( itemCollapsed( QTreeWidgetItem * ) ) ); - if( signal == ( QString ) "currentItemChanged(QTWItem,QTWItem)" ) return object->disconnect( SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ) ); - if( signal == ( QString ) "itemActivated(QTWItem,int)" ) return object->disconnect( SIGNAL( itemActivated( QTreeWidgetItem *, int ) ) ); - if( signal == ( QString ) "itemChanged(QTWItem,int)" ) return object->disconnect( SIGNAL( itemChanged( QTreeWidgetItem *, int ) ) ); - if( signal == ( QString ) "itemClicked(QTWItem,int)" ) return object->disconnect( SIGNAL( itemClicked( QTreeWidgetItem *, int ) ) ); - if( signal == ( QString ) "itemDoubleClicked(QTWItem,int)" ) return object->disconnect( SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ) ); - if( signal == ( QString ) "itemEntered(QTWItem,int)" ) return object->disconnect( SIGNAL( itemEntered( QTreeWidgetItem *, int ) ) ); - if( signal == ( QString ) "itemPressed(QTWItem,int)" ) return object->disconnect( SIGNAL( itemPressed( QTreeWidgetItem *, int ) ) ); - if( signal == ( QString ) "itemSelectionChanged()" ) return object->disconnect( SIGNAL( itemSelectionChanged() ) ); - /* QTableWidget */ - if( signal == ( QString ) "cellActivated(int,in)" ) return object->disconnect( SIGNAL( cellActivated( int, int ) ) ); - if( signal == ( QString ) "cellChanged(int,int)" ) return object->disconnect( SIGNAL( cellChanged( int, int ) ) ); - if( signal == ( QString ) "cellClicked(int,int)" ) return object->disconnect( SIGNAL( cellClicked( int, int ) ) ); - if( signal == ( QString ) "cellDoubleClicked(int,int)" ) return object->disconnect( SIGNAL( cellDoubleClicked( int, int ) ) ); - if( signal == ( QString ) "cellEntered(int,int)" ) return object->disconnect( SIGNAL( cellEntered( int, int ) ) ); - if( signal == ( QString ) "cellPressed(int,int)" ) return object->disconnect( SIGNAL( cellPressed( int, int ) ) ); - if( signal == ( QString ) "currentCellChanged(int,int,int,int)" ) return object->disconnect( SIGNAL( currentCellChanged( int, int, int, int ) ) ); - if( signal == ( QString ) "currentItemChanged(QTblWItem)" ) return object->disconnect( SIGNAL( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ) ); - if( signal == ( QString ) "itemActivated(QTblWItem)" ) return object->disconnect( SIGNAL( itemActivated( QTableWidgetItem * ) ) ); - if( signal == ( QString ) "itemChanged(QTblWItem)" ) return object->disconnect( SIGNAL( itemChanged( QTableWidgetItem * ) ) ); - if( signal == ( QString ) "itemClicked(QTblWItem)" ) return object->disconnect( SIGNAL( itemClicked( QTableWidgetItem * ) ) ); - if( signal == ( QString ) "itemDoubleClicked(QTblWItem)" ) return object->disconnect( SIGNAL( itemDoubleClicked( QTableWidgetItem * ) ) ); - if( signal == ( QString ) "itemEntered(QTblWItem)" ) return object->disconnect( SIGNAL( itemEntered( QTableWidgetItem * ) ) ); - if( signal == ( QString ) "itemPressed(QTblWItem)" ) return object->disconnect( SIGNAL( itemPressed( QTableWidgetItem * ) ) ); - /* */ - if( signal == ( QString ) "iconChanged()" ) return object->disconnect( SIGNAL( iconChanged() ) ); - if( signal == ( QString ) "titleChanged(QString)" ) return object->disconnect( SIGNAL( titleChanged( const QString & ) ) ); - if( signal == ( QString ) "urlChanged(QUrl)" ) return object->disconnect( SIGNAL( urlChanged( const QUrl & ) ) ); - if( signal == ( QString ) "currentFontChanged(QFont)" ) return object->disconnect( SIGNAL( currentFontChanged( const QFont & ) ) ); - if( signal == ( QString ) "fontSelected(QFont)" ) return object->disconnect( SIGNAL( fontSelected( const QFont & ) ) ); - if( signal == ( QString ) "accepted()" ) return object->disconnect( SIGNAL( accepted() ) ); - if( signal == ( QString ) "finished(int)" ) return object->disconnect( SIGNAL( finished( int ) ) ); - if( signal == ( QString ) "rejected()" ) return object->disconnect( SIGNAL( rejected() ) ); - if( signal == ( QString ) "currentChanged(QString)" ) return object->disconnect( SIGNAL( currentChanged( const QString & ) ) ); - if( signal == ( QString ) "directoryEntered(QString)" ) return object->disconnect( SIGNAL( directoryEntered( const QString & ) ) ); - if( signal == ( QString ) "fileSelected(QString)" ) return object->disconnect( SIGNAL( fileSelected( const QString & ) ) ); - if( signal == ( QString ) "filesSelected(QStringList)" ) return object->disconnect( SIGNAL( filesSelected( const QStringList & ) ) ); - if( signal == ( QString ) "filterSelected(QString)" ) return object->disconnect( SIGNAL( filterSelected( const QString & ) ) ); - if( signal == ( QString ) "accepted(QPrinter)" ) return object->disconnect( SIGNAL( accepted( QPrinter * ) ) ); - if( signal == ( QString ) "copyAvailable(bool)" ) return object->disconnect( SIGNAL( copyAvailable( bool ) ) ); - if( signal == ( QString ) "currentCharFormatChanged(QTextCharFormat)" ) return object->disconnect( SIGNAL( currentCharFormatChanged( const QTextCharFormat & ) ) ); - if( signal == ( QString ) "cursorPositionChanged()" ) return object->disconnect( SIGNAL( cursorPositionChanged() ) ); - if( signal == ( QString ) "redoAvailable(bool)" ) return object->disconnect( SIGNAL( redoAvailable( bool ) ) ); - if( signal == ( QString ) "textChanged()" ) return object->disconnect( SIGNAL( textChanged() ) ); - if( signal == ( QString ) "undoAvailable(bool)" ) return object->disconnect( SIGNAL( undoAvailable( bool ) ) ); - if( signal == ( QString ) "timeout()" ) return object->disconnect( SIGNAL( timeout() ) ); - if( signal == ( QString ) "geometriesChanged()" ) return object->disconnect( SIGNAL( geometriesChanged() ) ); - if( signal == ( QString ) "sectionAutoResize(int,QHeaderView::ResizeMode)" ) return object->disconnect( SIGNAL( sectionAutoResize( int, QHeaderView::ResizeMode ) ) ); - if( signal == ( QString ) "sectionClicked(int)" ) return object->disconnect( SIGNAL( sectionClicked( int ) ) ); - if( signal == ( QString ) "sectionCountChanged(int,int)" ) return object->disconnect( SIGNAL( sectionCountChanged( int, int ) ) ); - if( signal == ( QString ) "sectionDoubleClicked(int)" ) return object->disconnect( SIGNAL( sectionDoubleClicked( int ) ) ); - if( signal == ( QString ) "sectionEntered(int)" ) return object->disconnect( SIGNAL( sectionEntered( int ) ) ); - if( signal == ( QString ) "sectionHandleDoubleClicked(int)" ) return object->disconnect( SIGNAL( sectionHandleDoubleClicked( int ) ) ); - if( signal == ( QString ) "sectionMoved(int,int,int)" ) return object->disconnect( SIGNAL( sectionMoved( int, int, int ) ) ); - if( signal == ( QString ) "sectionPressed(int)" ) return object->disconnect( SIGNAL( sectionPressed( int ) ) ); - if( signal == ( QString ) "sectionResized(int,int,int)" ) return object->disconnect( SIGNAL( sectionResized( int, int, int ) ) ); - if( signal == ( QString ) "sortIndicatorChanged(int,Qt::SortOrder)" ) return object->disconnect( SIGNAL( sortIndicatorChanged( int, Qt::SortOrder ) ) ); - if( signal == ( QString ) "buttonClicked(int)" ) return object->disconnect( SIGNAL( buttonClicked( int ) ) ); - if( signal == ( QString ) "buttonPressed(int)" ) return object->disconnect( SIGNAL( buttonPressed( int ) ) ); - if( signal == ( QString ) "buttonReleased(int)" ) return object->disconnect( SIGNAL( buttonReleased( int ) ) ); - if( signal == ( QString ) "linkActivated(QString)" ) return object->disconnect( SIGNAL( linkActivated( const QString & ) ) ); - if( signal == ( QString ) "linkHovered(QString)" ) return object->disconnect( SIGNAL( linkHovered( const QString & ) ) ); - if( signal == ( QString ) "tabCloseRequested(int)" ) return object->disconnect( SIGNAL( tabCloseRequested( int ) ) ); - if( signal == ( QString ) "paintRequested(QPrinter)" ) return object->disconnect( SIGNAL( paintRequested( QPrinter * ) ) ); - /* QIODevice & QProcess */ - if( signal == ( QString ) "aboutToClose()" ) return object->disconnect( SIGNAL( aboutToClose() ) ); - if( signal == ( QString ) "bytesWritten(qint64)" ) return object->disconnect( SIGNAL( bytesWritten( qint64 ) ) ); - if( signal == ( QString ) "readChannelFinished()" ) return object->disconnect( SIGNAL( readChannelFinished() ) ); - if( signal == ( QString ) "readyRead()" ) return object->disconnect( SIGNAL( readyRead() ) ); - if( signal == ( QString ) "error(int)" ) return object->disconnect( SIGNAL( error( int ) ) ); - if( signal == ( QString ) "finished(int,QProcess::ExitStatus)" ) return object->disconnect( SIGNAL( finished( int, QProcess::ExitStatus ) ) ); - if( signal == ( QString ) "readyReadStandardError()" ) return object->disconnect( SIGNAL( readyReadStandardError() ) ); - if( signal == ( QString ) "readyReadStandardOutput()" ) return object->disconnect( SIGNAL( readyReadStandardOutput() ) ); - 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(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 ) ) ); - if( signal == ( QString ) "contentsChanged()" ) return object->disconnect( SIGNAL( contentsChanged() ) ); - if( signal == ( QString ) "cursorPositionChanged(QTextCursor)" ) return object->disconnect( SIGNAL( cursorPositionChanged( const QTextCursor & ) ) ); - if( signal == ( QString ) "documentLayoutChanged()" ) return object->disconnect( SIGNAL( documentLayoutChanged() ) ); - if( signal == ( QString ) "modificationChanged(bool)" ) return object->disconnect( SIGNAL( modificationChanged( bool ) ) ); - if( signal == ( QString ) "undoCommandAdded()" ) return object->disconnect( SIGNAL( undoCommandAdded() ) ); - if( signal == ( QString ) "updateRequest(QRect,int)" ) return object->disconnect( SIGNAL( updateRequest( const QRect &, int ) ) ); - /* QItemSelectionModel */ - if( signal == ( QString ) "currentChanged(QModelIndex,QModelIndex)" ) return object->disconnect( SIGNAL( currentChanged( const QModelIndex &,const QModelIndex & ) ) ); - if( signal == ( QString ) "currentColumnChanged(QModelIndex,QModelIndex)" ) return object->disconnect( SIGNAL( currentColumnChanged( const QModelIndex &,const QModelIndex & ) ) ); - if( signal == ( QString ) "currentRowChanged(QModelIndex,QModelIndex)" ) return object->disconnect( SIGNAL( currentRowChanged( const QModelIndex &,const QModelIndex & ) ) ); - if( signal == ( QString ) "selectionChanged(QItemSelection,QItemSelection)") return object->disconnect( SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection & )) ); - /* QListWidget */ - if( signal == ( QString ) "currentItemChanged(QLWItem,QLWItem)" ) return object->disconnect( SIGNAL( currentItemChanged( QListWidgetItem *, QListWidgetItem * ) ) ); - if( signal == ( QString ) "currentRowChanged(int)" ) return object->disconnect( SIGNAL( currentRowChanged( int ) ) ); - if( signal == ( QString ) "currentTextChanged(QString)" ) return object->disconnect( SIGNAL( currentTextChanged( const QString & ) ) ); - if( signal == ( QString ) "itemActivated(QLWItem)" ) return object->disconnect( SIGNAL( itemActivated( QListWidgetItem * ) ) ); - if( signal == ( QString ) "itemChanged(QLWItem)" ) return object->disconnect( SIGNAL( itemChanged( QListWidgetItem * ) ) ); - if( signal == ( QString ) "itemClicked(QLWItem)" ) return object->disconnect( SIGNAL( itemClicked( QListWidgetItem * ) ) ); - if( signal == ( QString ) "itemDoubleClicked(QLWItem)" ) return object->disconnect( SIGNAL( itemDoubleClicked( QListWidgetItem * ) ) ); - if( signal == ( QString ) "itemEntered(QLWItem)" ) return object->disconnect( SIGNAL( itemEntered( QListWidgetItem * ) ) ); - if( signal == ( QString ) "itemPressed(QLWItem)" ) return object->disconnect( SIGNAL( itemPressed( QListWidgetItem * ) ) ); - /* QTextBrowser */ - if( signal == ( QString ) "anchorClicked(QUrl)" ) return object->disconnect( SIGNAL( anchorClicked( const QUrl & ) ) ); - if( signal == ( QString ) "backwardAvailable(bool)" ) return object->disconnect( SIGNAL( backwardAvailable( bool ) ) ); - if( signal == ( QString ) "forwardAvailable(bool)" ) return object->disconnect( SIGNAL( forwardAvailable( bool ) ) ); - if( signal == ( QString ) "highlighted(QUrl)" ) return object->disconnect( SIGNAL( highlighted( const QUrl & ) ) ); - if( signal == ( QString ) "historyChanged()" ) return object->disconnect( SIGNAL( historyChanged() ) ); - if( signal == ( QString ) "sourceChanged(QUrl)" ) return object->disconnect( SIGNAL( sourceChanged( const QUrl & ) ) ); - /* QDockWidget */ - if( signal == ( QString ) "allowedAreasChanged(Qt::DockWidgetAreas)" ) return object->disconnect( SIGNAL( allowedAreasChanged( Qt::DockWidgetAreas ) ) ); - if( signal == ( QString ) "dockLocationChanged(Qt::DockWidgetArea)" ) return object->disconnect( SIGNAL( dockLocationChanged( Qt::DockWidgetArea ) ) ); - if( signal == ( QString ) "featuresChanged(QDockWidget::DockWidgetFeatures)" ) 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 & ) ) ); - /* QAbstractButton */ - if( signal == ( QString ) "toggled(bool)" ) return object->disconnect( SIGNAL( toggled( bool ) ) ); - /* QSystemTrayIcon */ - if( signal == ( QString ) "activated(QSystemTrayIcon::ActivationReason)" ) return object->disconnect( SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ) ); - /* QMdiArea */ - if( signal == ( QString ) "subWindowActivated(QMdiSubWindow)" ) return object->disconnect( SIGNAL( subWindowActivated( QMdiSubWindow * ) ) ); - /* QMdiSubWindow */ - if( signal == ( QString ) "aboutToActivate()" ) return object->disconnect( SIGNAL( aboutToActivate() ) ); - if( signal == ( QString ) "windowStateChanged(Qt::WindowStates,Qt::WindowStates)" ) return object->disconnect( SIGNAL( windowStateChanged( Qt::WindowStates, Qt::WindowStates ) ) ); - /* QAbstractItemDelegate */ - if( signal == ( QString ) "closeEditor(QWidget,QAbstractItemDelegate::EndEditHint)" ) return object->disconnect( SIGNAL( closeEditor( QWidget *, QAbstractItemDelegate::EndEditHint ) ) ); - if( signal == ( QString ) "commitData(QWidget)" ) return object->disconnect( SIGNAL( commitData( QWidget * ) ) ); - if( signal == ( QString ) "sizeHintChanged(QModelIndex)" ) return object->disconnect( SIGNAL( sizeHintChanged( const QModelIndex & ) ) ); - /* QGraphicsScene */ - if( signal == ( QString ) "sceneRectChanged(QRectF)" ) return object->disconnect( SIGNAL( sceneRectChanged( const QRectF & ) ) ); - /* QDateTimeEdit */ - if( signal == ( QString ) "dateChanged(QDate)" ) return object->disconnect( SIGNAL( dateChanged( const QDate & ) ) ); - if( signal == ( QString ) "dateTimeChanged(QDateTime)" ) return object->disconnect( SIGNAL( dateTimeChanged( const QDateTime & ) ) ); - if( signal == ( QString ) "timeChanged(QTime)" ) return object->disconnect( SIGNAL( timeChanged( const QTime & ) ) ); - /* QApplication */ -// if( signal == ( QString ) "commitDataRequest(QSessionManager)" ) return object->disconnect( SIGNAL( commitDataRequest( QSessionManager & ) ) ); - if( signal == ( QString ) "focusChanged(QWidget,QWidget)" ) return object->disconnect( SIGNAL( focusChanged( QWidget *, QWidget * ) ) ); - if( signal == ( QString ) "fontDatabaseChanged()" ) return object->disconnect( SIGNAL( fontDatabaseChanged() ) ); - if( signal == ( QString ) "lastWindowClosed()" ) return object->disconnect( SIGNAL( lastWindowClosed() ) ); -// if( signal == ( QString ) "saveStateRequest(QSessionManager)" ) return object->disconnect( SIGNAL( saveStateRequest( QSessionManager & ) ) ); - /* new */ - - return false; -} - -/*----------------------------------------------------------------------*/ - -static void hbqt_SlotsExec( HBQSlots * t_slots, QObject * object, const char * pszEvent ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 0 ); - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecBool( HBQSlots * t_slots, QObject * object, const char * pszEvent, bool bBool ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM pBool = hb_itemPutL( NULL, bBool ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, pBool ); - hb_itemRelease( pBool ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushLogical( bBool ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecInt( HBQSlots * t_slots, QObject * object, const char * pszEvent, int iValue ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutNI( NULL, iValue ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushInteger( iValue ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecIntInt( HBQSlots * t_slots, QObject * object, const char * pszEvent, int iValue1, int iValue2 ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM pValue1 = hb_itemPutNI( NULL, iValue1 ); - PHB_ITEM pValue2 = hb_itemPutNI( NULL, iValue2 ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 2, pValue1, pValue2 ); - hb_itemRelease( pValue1 ); - hb_itemRelease( pValue2 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushInteger( iValue1 ); - hb_vmPushInteger( iValue2 ); - hb_vmSend( 2 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecIntIntInt( HBQSlots * t_slots, QObject * object, const char * pszEvent, int iValue1, int iValue2, int iValue3 ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM pValue1 = hb_itemPutNI( NULL, iValue1 ); - PHB_ITEM pValue2 = hb_itemPutNI( NULL, iValue2 ); - PHB_ITEM pValue3 = hb_itemPutNI( NULL, iValue3 ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 3, pValue1, pValue2, pValue3 ); - hb_itemRelease( pValue1 ); - hb_itemRelease( pValue2 ); - hb_itemRelease( pValue3 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushInteger( iValue1 ); - hb_vmPushInteger( iValue2 ); - hb_vmPushInteger( iValue3 ); - hb_vmSend( 3 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecIntIntIntInt( HBQSlots * t_slots, QObject * object, const char * pszEvent, int iValue1, int iValue2, int iValue3, int iValue4 ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM pValue1 = hb_itemPutNI( NULL, iValue1 ); - PHB_ITEM pValue2 = hb_itemPutNI( NULL, iValue2 ); - PHB_ITEM pValue3 = hb_itemPutNI( NULL, iValue3 ); - PHB_ITEM pValue4 = hb_itemPutNI( NULL, iValue4 ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 4, pValue1, pValue2, pValue3, pValue4 ); - hb_itemRelease( pValue1 ); - hb_itemRelease( pValue2 ); - hb_itemRelease( pValue3 ); - hb_itemRelease( pValue4 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushInteger( iValue1 ); - hb_vmPushInteger( iValue2 ); - hb_vmPushInteger( iValue3 ); - hb_vmPushInteger( iValue4 ); - hb_vmSend( 4 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecString( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QString & string ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 1 - PHB_ITEM pString = hb_itemPutC( NULL, string.toAscii().data() ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, pString ); - hb_itemRelease( pString ); - #else /* What to do with HB_SIZE */ - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushString( string.toAscii().data() ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecModel( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QModelIndex & index ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM pState = hb_itemPutPtr( NULL, ( QModelIndex * ) new QModelIndex( index ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, pState ); - delete ( ( QModelIndex * ) hb_itemGetPtr( pState ) ); - hb_itemRelease( pState ); - #else - #if 0 - QModelIndex * pArg = new QModelIndex( index ); - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( pArg ); //new QModelIndex( index ) ); - hb_vmSend( 1 ); - delete pArg; - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QModelIndex( index ) ); - hb_vmSend( 1 ); - #endif - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecModelModel( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QModelIndex & index1, const QModelIndex & index2 ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM pState1 = hb_itemPutPtr( NULL, ( QModelIndex * ) new QModelIndex( index1 ) ); - PHB_ITEM pState2 = hb_itemPutPtr( NULL, ( QModelIndex * ) new QModelIndex( index2 ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 2, pState1, pState2 ); - delete ( ( QModelIndex * ) hb_itemGetPtr( pState1 ) ); - delete ( ( QModelIndex * ) hb_itemGetPtr( pState2 ) ); - hb_itemRelease( pState1 ); - hb_itemRelease( pState2 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QModelIndex( index1 ) ); - hb_vmPushPointer( new QModelIndex( index2 ) ); - hb_vmSend( 2 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecItemSelItemSel( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QItemSelection & index1, const QItemSelection & index2 ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM pState1 = hb_itemPutPtr( NULL, ( QItemSelection * ) new QItemSelection( index1 ) ); - PHB_ITEM pState2 = hb_itemPutPtr( NULL, ( QItemSelection * ) new QItemSelection( index2 ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 2, pState1, pState2 ); - delete ( ( QItemSelection * ) hb_itemGetPtr( pState1 ) ); - delete ( ( QItemSelection * ) hb_itemGetPtr( pState2 ) ); - hb_itemRelease( pState1 ); - hb_itemRelease( pState2 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QItemSelection( index1 ) ); - hb_vmPushPointer( new QItemSelection( index2 ) ); - hb_vmSend( 2 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecTextCharFormat( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QTextCharFormat & f ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QTextCharFormat( f ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QTextCharFormat * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QTextCharFormat( f ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecFont( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QFont & font ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QFont( font ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QFont * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QFont( font ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecQTextCursor( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QTextCursor & cursor ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QTextCursor( cursor ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QTextCursor * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QTextCursor( cursor ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecStringList( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QStringList & stringList ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QStringList( stringList ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QStringList * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QStringList( stringList ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecPointer( HBQSlots * t_slots, QObject * object, const char * pszEvent, void * p1 ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( p1 ); - hb_vmSend( 1 ); - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecPointerPointer( HBQSlots * t_slots, QObject * object, const char * pszEvent, void * pP1, void * pP2 ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, pP1 ); - PHB_ITEM p2 = hb_itemPutPtr( NULL, pP2 ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 2, p1, p2 ); - hb_itemRelease( p1 ); - hb_itemRelease( p2 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( pP1 ); - hb_vmPushPointer( pP2 ); - hb_vmSend( 2 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecPointerInt( HBQSlots * t_slots, QObject * object, const char * pszEvent, void * pP1, int iInt ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, pP1 ); - PHB_ITEM p2 = hb_itemPutNI( NULL, iInt ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 2, p1, p2 ); - hb_itemRelease( p1 ); - hb_itemRelease( p2 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( pP1 ); - hb_vmPushInteger( iInt ); - hb_vmSend( 2 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecQRectInt( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QRect & r, int dy ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QRect( r ) ); - PHB_ITEM p2 = hb_itemPutNI( NULL, dy ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 2, p1, p2 ); - delete ( ( QRect * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - hb_itemRelease( p2 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QRect( r ) ); - hb_vmPushInteger( dy ); - hb_vmSend( 2 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecQPoint( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QPoint & pos ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QPoint( pos ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QPoint * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QPoint( pos ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecQRectF( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QRectF & rect ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QRectF( rect ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QRectF * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QRectF( rect ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecQUrl( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QUrl & link ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, ( QUrl * ) new QUrl( link ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QUrl * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QUrl( link ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecQDate( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QDate & date ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, ( QDate * ) new QDate( date ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QDate * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QDate( date ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecQDateTime( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QDateTime & datetime ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, ( QDateTime * ) new QDateTime( datetime ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QDateTime * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QDateTime( datetime ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - -static void hbqt_SlotsExecQTime( HBQSlots * t_slots, QObject * object, const char * pszEvent, const QTime & time ) -{ - if( object ) - { - int i = object->property( pszEvent ).toInt(); - if( i > 0 && i <= t_slots->listBlock.size() && hb_vmRequestReenter() ) - { - #if 0 - PHB_ITEM p1 = hb_itemPutPtr( NULL, ( QTime * ) new QTime( time ) ); - hb_vmEvalBlockV( t_slots->listBlock.at( i - 1 ), 1, p1 ); - delete ( ( QTime * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else - hb_vmPushEvalSym(); - hb_vmPush( t_slots->listBlock.at( i - 1 ) ); - hb_vmPushPointer( new QTime( time ) ); - hb_vmSend( 1 ); - #endif - hb_vmRequestRestore(); - } - } -} - - -HBQSlots::HBQSlots( QObject* parent ) : QObject( parent ) -{ -} - -HBQSlots::~HBQSlots() -{ - int i; - - for( i = 0; i < listBlock.size(); i++ ) - { - if( listBlock[ i ] != NULL ) - { -//HB_TRACE( HB_TR_DEBUG, ( "......HBQSlots::~HBQSlots()...... [ Un-disConnected Slot ]" ) ); - hb_itemRelease( listBlock.at( i ) ); - listBlock[ i ] = NULL; - } - } - /* QUESTION: Should there be all remaining active slots disconnected at this point? */ - - /* Should be disconnected, but this is a responsibility of programmer as object is only known to the application */ - listBlock.clear(); -} - -bool HBQSlots::hbIsConnected( PHB_ITEM pObj, const char * slot ) -{ - HB_SYMBOL_UNUSED( pObj ); - - QObject * object = ( QObject * ) hbqt_pPtrFromObj( 1 ); - return isConnected( object, slot ); -} - -bool HBQSlots::isConnected( QObject * object, const char * slot ) -{ - int i; - - for( i = 0; i < listBlock.size(); i++ ) - { - if( listBlock[ i ] != NULL && listObj[ i ] == object ) - { - if( object->property( slot ).toInt() == i + 1 ) - { - return true; - } - } - } - return false; -} - -bool HBQSlots::hbConnect( PHB_ITEM pObj, const char * slot, PHB_ITEM bBlock ) -{ - HB_SYMBOL_UNUSED( pObj ); - HB_SYMBOL_UNUSED( bBlock ); - - QObject * object = ( QObject * ) hbqt_pPtrFromObj( 1 ); /* get sender */ - - if( object ) - { - if( !isConnected( object, slot ) ) - { -HB_TRACE( HB_TR_DEBUG, ( "AAA 3 %s %p", slot, object ) ); - bool bConnected = connect_signal( ( QString ) slot, object, this ); -HB_TRACE( HB_TR_DEBUG, ( "AAA 4" ) ); - if( bConnected ) - { - PHB_ITEM pBlock = hb_itemNew( bBlock ); /* get codeblock */ -HB_TRACE( HB_TR_DEBUG, ( "AAA 5" ) ); - listBlock << pBlock; - listObj << object; - - object->setProperty( slot, ( int ) listBlock.size() ); - - return true; - } - } - } - return false; -} - -bool HBQSlots::hbDisconnect( PHB_ITEM pObj, const char * signal ) -{ - HB_SYMBOL_UNUSED( pObj ); - - QObject * object = ( QObject* ) hbqt_pPtrFromObj( 1 ); - - if( object ) - { - int i = object->property( signal ).toInt(); - - if( i > 0 && i <= listBlock.size() ) - { - hb_itemRelease( listBlock.at( i - 1 ) ); - listBlock[ i - 1 ] = NULL; - listObj[ i - 1 ] = NULL; - - bool bRet = disconnect_signal( object, signal ); - - HB_TRACE( HB_TR_DEBUG, ( " QT_SLOTS_DISCONNECT: %s %s", bRet ? "YES" : "NO", signal ) ); - - return bRet; - } - } - return false; -} - -bool HBQSlots::hbClear() -{ - int i; - - for( i = 0; i < listBlock.size(); i++ ) - { - if( listBlock[ i ] != NULL ) - { - hb_itemRelease( listBlock.at( i ) ); - listBlock[ i ] = NULL; - } - } - listBlock.clear(); - return true; -} -/* Generic Key and Mouse Events emitted by subclass objects */ -void HBQSlots::customContextMenuRequested( const QPoint & pos ) { hbqt_SlotsExecQPoint( this, qobject_cast( sender() ), "customContextMenuRequested(QPoint)", pos ); } -void HBQSlots::triggered( bool checked ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "triggered(bool)", checked ); } -void HBQSlots::hovered( QAction * action ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "hovered(action)", action ); } -void HBQSlots::clicked() { hbqt_SlotsExec( this, qobject_cast( sender() ), "clicked()" ); } -void HBQSlots::returnPressed() { hbqt_SlotsExec( this, qobject_cast( sender() ), "returnPressed()" ); } -void HBQSlots::viewportEntered() { hbqt_SlotsExec( this, qobject_cast( sender() ), "viewportEntered()" ); } -void HBQSlots::pressed() { hbqt_SlotsExec( this, qobject_cast( sender() ), "pressed()" ); } -void HBQSlots::released() { hbqt_SlotsExec( this, qobject_cast( sender() ), "released()" ); } -void HBQSlots::triggered() { hbqt_SlotsExec( this, qobject_cast( sender() ), "triggered()" ); } -void HBQSlots::hovered() { hbqt_SlotsExec( this, qobject_cast( sender() ), "hovered()" ); } -void HBQSlots::stateChanged( int state ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "stateChanged(int)", state ); } -void HBQSlots::activated( int index ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "activated(int)", index ); } -void HBQSlots::currentIndexChanged( int index ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "currentIndexChanged(int)", index ); } -void HBQSlots::currentChanged( int index ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "currentChanged(int)", index ); } -void HBQSlots::highlighted( int index ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "highlighted(int)", index ); } -void HBQSlots::clicked( const QModelIndex & index ) { hbqt_SlotsExecModel( this, qobject_cast( sender() ), "clicked(QModelIndex)", index ); } -void HBQSlots::doubleClicked( const QModelIndex & index ) { hbqt_SlotsExecModel( this, qobject_cast( sender() ), "doubleClicked(QModelIndex)", index ); } -void HBQSlots::entered( const QModelIndex & index ) { hbqt_SlotsExecModel( this, qobject_cast( sender() ), "entered(QModelIndex)", index ); } -void HBQSlots::actionTriggered( int action ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "actionTriggered(int)", action ); } -void HBQSlots::rangeChanged( int min, int max ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "rangeChanged(int)", min, max ); } -void HBQSlots::sliderMoved( int value ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "sliderMoved(int)", value ); } -void HBQSlots::sliderPressed() { hbqt_SlotsExec( this, qobject_cast( sender() ), "sliderPressed()" ); } -void HBQSlots::sliderReleased() { hbqt_SlotsExec( this, qobject_cast( sender() ), "sliderReleased()" ); } -void HBQSlots::valueChanged( int value ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "valueChanged(int)", value ); } -void HBQSlots::cursorPositionChanged( int iOld, int iNew ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cursorPositionChanged(int,int)", iOld, iNew ); } -void HBQSlots::editingFinished() { hbqt_SlotsExec( this, qobject_cast( sender() ), "editingFinished()" ); } -void HBQSlots::selectionChanged() { hbqt_SlotsExec( this, qobject_cast( sender() ), "selectionChanged()" ); } -void HBQSlots::textChanged( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "textChanged(QString)", text ); } -void HBQSlots::textEdited( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "textEdited(QString)", text ); } -/* QTreeWidget */ -void HBQSlots::itemExpanded( QTreeWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemExpanded(QTWItem)", item ); } -void HBQSlots::itemCollapsed( QTreeWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemCollapsed(QTWItem)", item ); } -void HBQSlots::currentItemChanged( QTreeWidgetItem * current, QTreeWidgetItem * previous ) { hbqt_SlotsExecPointerPointer( this, qobject_cast( sender() ), "currentItemChanged(QTWItem,QTWItem)", current, previous ); } -void HBQSlots::itemActivated( QTreeWidgetItem * item, int column ) { hbqt_SlotsExecPointerInt( this, qobject_cast( sender() ), "itemActivated(QTWItem,int)", item, column ); } -void HBQSlots::itemChanged( QTreeWidgetItem * item, int column ) { hbqt_SlotsExecPointerInt( this, qobject_cast( sender() ), "itemChanged(QTWItem,int)", item, column ); } -void HBQSlots::itemClicked( QTreeWidgetItem * item, int column ) { hbqt_SlotsExecPointerInt( this, qobject_cast( sender() ), "itemClicked(QTWItem,int)", item, column ); } -void HBQSlots::itemDoubleClicked( QTreeWidgetItem * item, int column ) { hbqt_SlotsExecPointerInt( this, qobject_cast( sender() ), "itemDoubleClicked(QTWItem,int)", item, column ); } -void HBQSlots::itemEntered( QTreeWidgetItem * item, int column ) { hbqt_SlotsExecPointerInt( this, qobject_cast( sender() ), "itemEntered(QTWItem,int)", item, column ); } -void HBQSlots::itemPressed( QTreeWidgetItem * item, int column ) { hbqt_SlotsExecPointerInt( this, qobject_cast( sender() ), "itemPressed(QTWItem,int)", item, column ); } -void HBQSlots::itemSelectionChanged() { hbqt_SlotsExec( this, qobject_cast( sender() ), "itemSelectionChanged()" ); } -/* QDialog (s)*/ -void HBQSlots::currentFontChanged( const QFont & font ) { hbqt_SlotsExecFont( this, qobject_cast( sender() ), "currentFontChanged(QFont)", font ); } -void HBQSlots::fontSelected( const QFont & font ) { hbqt_SlotsExecFont( this, qobject_cast( sender() ), "fontSelected(QFont)", font ); } -void HBQSlots::accepted() { hbqt_SlotsExec( this, qobject_cast( sender() ), "accepted()" ); } -void HBQSlots::finished( int result ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "finished(int)", result ); } -void HBQSlots::rejected() { hbqt_SlotsExec( this, qobject_cast( sender() ), "rejected()" ); } -void HBQSlots::currentChanged( const QString & path ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "currentChanged(QString)", path ); } -void HBQSlots::directoryEntered( const QString & directory ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "directoryEntered(QString)", directory ); } -void HBQSlots::fileSelected( const QString & file ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "fileSelected(QString)", file ); } -void HBQSlots::filesSelected( const QStringList & selected ) { hbqt_SlotsExecStringList( this, qobject_cast( sender() ), "filesSelected(QStringList)", selected ); } -void HBQSlots::filterSelected( const QString & filter ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "filterSelected(QString)", filter ); } -/* QPrintDialog */ -void HBQSlots::accepted( QPrinter * printer ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "accepted(QPrinter)", printer ); } -/* QTextEdit */ -void HBQSlots::copyAvailable( bool yes ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "copyAvailable(bool)", yes ); } -void HBQSlots::currentCharFormatChanged( const QTextCharFormat & f ) { hbqt_SlotsExecTextCharFormat( this, qobject_cast( sender() ), "currentCharFormatChanged(QTextCharFormat)", f ); } -void HBQSlots::cursorPositionChanged() { hbqt_SlotsExec( this, qobject_cast( sender() ), "cursorPositionChanged()" ); } -void HBQSlots::redoAvailable( bool available ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "redoAvailable(bool)", available ); } -void HBQSlots::textChanged() { hbqt_SlotsExec( this, qobject_cast( sender() ), "textChanged()" ); } -void HBQSlots::undoAvailable( bool available ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "undoAvailable(bool)", available ); } -void HBQSlots::timeout() { hbqt_SlotsExec( this, qobject_cast( sender() ), "timeout()" ); } -void HBQSlots::geometriesChanged() { hbqt_SlotsExec( this, qobject_cast( sender() ), "geometriesChanged()" ); } -void HBQSlots::sectionAutoResize( int logicalIndex, QHeaderView::ResizeMode mode ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "sectionAutoResize(int,QHeaderView::ResizeMode)", logicalIndex, mode ); } -void HBQSlots::sectionClicked( int logicalIndex ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "sectionClicked(int)", logicalIndex ); } -void HBQSlots::sectionCountChanged( int oldCount, int newCount ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "sectionCountChanged(int,int)", oldCount, newCount ); } -void HBQSlots::sectionDoubleClicked( int logicalIndex ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "sectionDoubleClicked(int)", logicalIndex ); } -void HBQSlots::sectionEntered( int logicalIndex ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "sectionEntered(int)", logicalIndex ); } -void HBQSlots::sectionHandleDoubleClicked( int logicalIndex ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "sectionHandleDoubleClicked(int)", logicalIndex ); } -void HBQSlots::sectionMoved( int logicalIndex, int oldVisualIndex, int newVisualIndex ) { hbqt_SlotsExecIntIntInt( this, qobject_cast( sender() ), "sectionMoved(int,int,int)", logicalIndex, oldVisualIndex, newVisualIndex ); } -void HBQSlots::sectionPressed( int logicalIndex ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "sectionPressed(int)", logicalIndex ); } -void HBQSlots::sectionResized( int logicalIndex, int oldSize, int newSize ) { hbqt_SlotsExecIntIntInt( this, qobject_cast( sender() ), "sectionResized(int,int,int)", logicalIndex, oldSize, newSize ); } -void HBQSlots::sortIndicatorChanged( int logicalIndex, Qt::SortOrder order ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "sortIndicatorChanged(int,Qt::SortOrder)", logicalIndex, order ); } -void HBQSlots::buttonClicked( int id ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "buttonClicked(int)", id ); } -void HBQSlots::buttonPressed( int id ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "buttonPressed(int)", id ); } -void HBQSlots::buttonReleased( int id ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "buttonReleased(int)", id ); } -void HBQSlots::linkActivated( const QString & link ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "linkActivated(QString)", link ); } -void HBQSlots::linkHovered( const QString & link ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "linkHovered(QString)", link ); } -void HBQSlots::tabCloseRequested( int index ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "tabCloseRequested(int)", index ); } -void HBQSlots::paintRequested( QPrinter * printer ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "paintRequested(QPrinter)", printer ); } -/* QIODevice */ -void HBQSlots::aboutToClose() { hbqt_SlotsExec( this, qobject_cast( sender() ), "aboutToClose()" ); } -void HBQSlots::bytesWritten( qint64 bytes ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "bytesWritten(qint64)", bytes ); } -void HBQSlots::readChannelFinished() { hbqt_SlotsExec( this, qobject_cast( sender() ), "readChannelFinished()" ); } -void HBQSlots::readyRead() { hbqt_SlotsExec( this, qobject_cast( sender() ), "readyRead()" ); } -/* QProcess */ -void HBQSlots::error( QProcess::ProcessError error ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "error(error)", error ); } -void HBQSlots::finished( int exitCode, QProcess::ExitStatus exitStatus ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "finished(int,QProcess::ExitStatus)", exitCode, exitStatus ); } -void HBQSlots::readyReadStandardError() { hbqt_SlotsExec( this, qobject_cast( sender() ), "readyReadStandardError()" ); } -void HBQSlots::readyReadStandardOutput() { hbqt_SlotsExec( this, qobject_cast( sender() ), "readyReadStandardOutput()" ); } -void HBQSlots::started() { hbqt_SlotsExec( this, qobject_cast( sender() ), "started()" ); } -void HBQSlots::stateChanged( QProcess::ProcessState newState ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "stateChanged(int)", newState ); } -/* QComboBox */ -void HBQSlots::activated( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "activated(QString)", text ); } -void HBQSlots::currentIndexChanged( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "currentIndexChanged(QString)", text ); } -void HBQSlots::editTextChanged( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "editTextChanged(QString)", text ); } -void HBQSlots::highlighted( const QString & text ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "highlighted(QString)", text ); } -/* QTextDocument */ -void HBQSlots::blockCountChanged( int newBlockCount ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "blockCountChanged(int)", newBlockCount ); } -void HBQSlots::contentsChange( int position, int charsRemoved, int charsAdded ) { hbqt_SlotsExecIntIntInt( this, qobject_cast( sender() ), "contentsChange(int,int,int)", position, charsRemoved, charsAdded ); } -void HBQSlots::contentsChanged() { hbqt_SlotsExec( this, qobject_cast( sender() ), "contentsChanged()" ); } -void HBQSlots::cursorPositionChanged( const QTextCursor & cursor ) { hbqt_SlotsExecQTextCursor( this, qobject_cast( sender() ), "cursorPositionChanged(QTextCursor)", cursor ); } -void HBQSlots::documentLayoutChanged() { hbqt_SlotsExec( this, qobject_cast( sender() ), "documentLayoutChanged()" ); } -void HBQSlots::modificationChanged( bool changed ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "modificationChanged(bool)", changed ); } -void HBQSlots::undoCommandAdded() { hbqt_SlotsExec( this, qobject_cast( sender() ), "undoCommandAdded()" ); } -/* QPlainTextEdit */ -void HBQSlots::updateRequest( const QRect & rect, int dy ) { hbqt_SlotsExecQRectInt( this, qobject_cast( sender() ), "updateRequest(QRect,int)", rect, dy ); } -/* QItemSelectionModel */ -void HBQSlots::currentChanged( const QModelIndex & currentIndex, const QModelIndex & previousIndex ) { hbqt_SlotsExecModelModel( this, qobject_cast( sender() ), "currentChanged(QModelIndex,QModelIndex)", currentIndex, previousIndex ); } -void HBQSlots::currentColumnChanged( const QModelIndex & currentIndex, const QModelIndex & previousIndex ) { hbqt_SlotsExecModelModel( this, qobject_cast( sender() ), "currentColumnChanged(QModelIndex,QModelIndex)", currentIndex, previousIndex ); } -void HBQSlots::currentRowChanged( const QModelIndex & currentIndex, const QModelIndex & previousIndex ) { hbqt_SlotsExecModelModel( this, qobject_cast( sender() ), "currentRowChanged(QModelIndex,QModelIndex)", currentIndex, previousIndex ); } -void HBQSlots::selectionChanged( const QItemSelection & selected, const QItemSelection & deselected ) { hbqt_SlotsExecItemSelItemSel( this, qobject_cast( sender() ), "selectionChanged(QItemSelection,QItemSelection)", selected, deselected ); } -/* QListWidget */ -void HBQSlots::currentRowChanged( int currentRow ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "currentRowChanged(int)", currentRow ); } -void HBQSlots::currentTextChanged( const QString & currentText ) { hbqt_SlotsExecString( this, qobject_cast( sender() ), "currentTextChanged(QString)", currentText ); } -void HBQSlots::currentItemChanged( QListWidgetItem * current, QListWidgetItem * previous ) { hbqt_SlotsExecPointerPointer( this, qobject_cast( sender() ), "currentItemChanged(QLWItem,QLWItem)", current, previous ); } -void HBQSlots::itemActivated( QListWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemActivated(QLWItem)", item ); } -void HBQSlots::itemChanged( QListWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemChanged(QLWItem)", item ); } -void HBQSlots::itemClicked( QListWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemClicked(QLWItem)", item ); } -void HBQSlots::itemDoubleClicked( QListWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemDoubleClicked(QLWItem)", item ); } -void HBQSlots::itemEntered( QListWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemEntered(QLWItem)", item ); } -void HBQSlots::itemPressed( QListWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemPressed(QLWItem)", item ); } -/* QTableWidget */ -void HBQSlots::cellActivated( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellActivated(int,int)", row, column ); } -void HBQSlots::cellChanged( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellChanged(int,int)", row, column ); } -void HBQSlots::cellClicked( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellClicked(int,int)", row, column ); } -void HBQSlots::cellDoubleClicked( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellDoubleClicked(int,int)", row, column ); } -void HBQSlots::cellEntered( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellEntered(int,int)", row, column ); } -void HBQSlots::cellPressed( int row, int column ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "cellEntered(int,int)", row, column ); } -void HBQSlots::currentCellChanged( int currentRow, int currentColumn, int previousRow, int previousColumn ) { hbqt_SlotsExecIntIntIntInt( this, qobject_cast( sender() ), "currentCellChanged(int,int,int,int)", currentRow, currentColumn, previousRow, previousColumn ); } -void HBQSlots::currentItemChanged( QTableWidgetItem * current, QTableWidgetItem * previous ) { hbqt_SlotsExecPointerPointer( this, qobject_cast( sender() ), "currentItemChanged(QTblWItem,QLWItem)", current, previous ); } -void HBQSlots::itemActivated( QTableWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemActivated(QTblWItem)", item ); } -void HBQSlots::itemChanged( QTableWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemChanged(QTblWItem)", item ); } -void HBQSlots::itemClicked( QTableWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemClicked(QTblWItem)", item ); } -void HBQSlots::itemDoubleClicked( QTableWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemDoubleClicked(QTblWItem)", item ); } -void HBQSlots::itemEntered( QTableWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemEntered(QTblWItem)", item ); } -void HBQSlots::itemPressed( QTableWidgetItem * item ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "itemPressed(QTblWItem)", item ); } -/* QTextBrowser */ -void HBQSlots::anchorClicked( const QUrl & link ) { hbqt_SlotsExecQUrl( this, qobject_cast( sender() ), "anchorClicked(QUrl)", link ); } -void HBQSlots::backwardAvailable( bool available ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "backwardAvailable(bool)", available ); } -void HBQSlots::forwardAvailable( bool available ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "forwardAvailable(bool)", available ); } -void HBQSlots::highlighted( const QUrl & link ) { hbqt_SlotsExecQUrl( this, qobject_cast( sender() ), "highlighted(QUrl)", link ); } -void HBQSlots::historyChanged() { hbqt_SlotsExec( this, qobject_cast( sender() ), "historyChanged()" ); } -void HBQSlots::sourceChanged( const QUrl & src ) { hbqt_SlotsExecQUrl( this, qobject_cast( sender() ), "sourceChanged(QUrl)", src ); } -/* QDockWidget */ -void HBQSlots::allowedAreasChanged( Qt::DockWidgetAreas allowedAreas ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "allowedAreasChanged(Qt::DockWidgetAreas)", allowedAreas ); } -void HBQSlots::dockLocationChanged( Qt::DockWidgetArea area ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "dockLocationChanged(Qt::DockWidgetArea)", area ); } -void HBQSlots::featuresChanged( QDockWidget::DockWidgetFeatures features ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "featuresChanged(QDockWidget::DockWidgetFeatures)", features ); } -void HBQSlots::topLevelChanged( bool topLevel ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "topLevelChanged(bool)", topLevel ); } -void HBQSlots::visibilityChanged( bool visible ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "visibilityChanged(bool)", visible ); } -/* QCompleter */ -void HBQSlots::activated( const QModelIndex & index ) { hbqt_SlotsExecModel( this, qobject_cast( sender() ), "activated(QModelIndex)", index ); } -void HBQSlots::highlighted( const QModelIndex & index ) { hbqt_SlotsExecModel( this, qobject_cast( sender() ), "highlighted(QModelIndex)", index ); } -/* QAbstractButton */ -void HBQSlots::toggled( bool checked ) { hbqt_SlotsExecBool( this, qobject_cast( sender() ), "toggled(bool)", checked ); } -/* QSystemTrayIcon */ -void HBQSlots::activated( QSystemTrayIcon::ActivationReason reason ) { hbqt_SlotsExecInt( this, qobject_cast( sender() ), "activated(QSystemTrayIcon::ActivationReason)", reason ); } -/* QMdiArea */ -void HBQSlots::subWindowActivated( QMdiSubWindow * window ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "subWindowActivated(QMdiSubWindow)", window ); } -/* QMdiSubWindow */ -void HBQSlots::aboutToActivate() { hbqt_SlotsExec( this, qobject_cast( sender() ), "aboutToActivate()" ); } -void HBQSlots::windowStateChanged( Qt::WindowStates oldState, Qt::WindowStates newState ) { hbqt_SlotsExecIntInt( this, qobject_cast( sender() ), "windowStateChanged(Qt::WindowStates,Qt::WindowStates)", oldState, newState ); } -/* QAbstractItemDelegate */ -void HBQSlots::closeEditor( QWidget * editor, QAbstractItemDelegate::EndEditHint hint ) { hbqt_SlotsExecPointerInt( this, qobject_cast( sender() ), "closeEditor(QWidget,QAbstractItemDelegate::EndEditHint)", editor, hint ); } -void HBQSlots::commitData( QWidget * editor ) { hbqt_SlotsExecPointer( this, qobject_cast( sender() ), "commitData(QWidget)", editor ); } -void HBQSlots::sizeHintChanged( const QModelIndex & index ) { hbqt_SlotsExecModel( this, qobject_cast( sender() ), "sizeHintChanged(QModelIndex)", index ); } -/* QGraphicsScene */ -void HBQSlots::sceneRectChanged( const QRectF & rect ) { hbqt_SlotsExecQRectF( this, qobject_cast( sender() ), "sceneRectChanged(QRectF)", rect ); } -/* QDateTimeEdit */ -void HBQSlots::dateChanged( const QDate & date ) { hbqt_SlotsExecQDate( this, qobject_cast( sender() ), "dateChanged(QDate)", date ); } -void HBQSlots::dateTimeChanged( const QDateTime & datetime ) { hbqt_SlotsExecQDateTime( this, qobject_cast( sender() ), "dateTimeChanged(QDate)", datetime ); } -void HBQSlots::timeChanged( const QTime & time ) { hbqt_SlotsExecQTime( this, qobject_cast( sender() ), "timeChanged(QTime)", time ); } -/* QApplication */ -//void HBQSlots::commitDataRequest( QSessionManager & manager ) { hbqt_SlotsExecQSessionManager(this, qobject_cast( sender() ), "commitDataRequest(QSessionManager)", manager ); } -void HBQSlots::focusChanged( QWidget * old, QWidget * now ) { hbqt_SlotsExecPointerPointer( this, qobject_cast( sender() ), "focusChanged(QWidget,QWidget)" , old, now ); } -void HBQSlots::fontDatabaseChanged() { hbqt_SlotsExec( this, qobject_cast( sender() ), "fontDatabaseChanged()" ); } -void HBQSlots::lastWindowClosed() { hbqt_SlotsExec( this, qobject_cast( sender() ), "lastWindowClosed()" ); } -//void HBQSlots::saveStateRequest( QSessionManager & manager ) { hbqt_SlotsExecQSessionManager(this, qobject_cast( sender() ), "saveStateRequest(QSessionManager)" , manager ); } -/* Latest */ - -/*----------------------------------------------------------------------*/ -/* - * Harbour function to connect signals with slots - */ -HB_FUNC( __HBQT_SLOTS_CONNECT ) -{ - HB_BOOL bRet = HB_FALSE; - HBQSlots * t_slots = hbqt_par_HBQSlots( 1 ); - - if( t_slots ) - { -HB_TRACE( HB_TR_DEBUG, ( "__HBQT_SLOTS_CONNECT( %s )", hb_parcx( 3 ) ) ); - QObject * object = ( QObject * ) hbqt_pPtrFromObj( 2 ); /* get sender */ - if( object ) - { - int i = object->property( hb_parcx( 3 ) ).toInt(); - if ( i == 0 ) - { - QString signal = hb_parcx( 3 ); /* get signal */ - if( connect_signal( signal, object, t_slots ) ) - { - PHB_ITEM pBlock = hb_itemNew( hb_param( 4, HB_IT_BLOCK ) ); /* get codeblock */ - t_slots->listBlock << pBlock; - - object->setProperty( hb_parcx( 3 ), ( int ) t_slots->listBlock.size() ); - bRet = HB_TRUE; - } - } -HB_TRACE( HB_TR_DEBUG, ( "__HBQT_SLOTS_CONNECT( %s ) %s", hb_parcx( 3 ), bRet ? "Connected" : "not-connected" ) ); - } - } - hb_retl( bRet ); -} - -/* - * Harbour function to disconnect signals - */ -HB_FUNC( __HBQT_SLOTS_DISCONNECT ) -{ - HB_BOOL bRet = HB_FALSE; - HBQSlots * t_slots = hbqt_par_HBQSlots( 1 ); - - if( t_slots ) - { -HB_TRACE( HB_TR_DEBUG, ( "__HBQT_SLOTS_DISCONNECT( %s )", hb_parcx( 3 ) ) ); - QObject * object = ( QObject* ) hbqt_pPtrFromObj( 2 ); - if( object ) - { - const char * slot = hb_parcx( 3 ); - - int i = object->property( slot ).toInt(); - - if( i > 0 && i <= t_slots->listBlock.size() ) - { - object->setProperty( slot, QVariant() ); - - bRet = ( disconnect_signal( object, slot ) == true ); - - hb_itemRelease( t_slots->listBlock.at( i - 1 ) ); - t_slots->listBlock[ i - 1 ] = NULL; - - HB_TRACE( HB_TR_DEBUG, ( " __HBQT_SLOTS_DISCONNECT: %s %s", bRet ? "YES" : "NO", slot ) ); - } -HB_TRACE( HB_TR_DEBUG, ( "__HBQT_SLOTS_DISCONNECT( %s ) %s", hb_parcx( 3 ), bRet ? "disConnected" : "not-disConnected" ) ); - } - } - hb_retl( bRet ); -} - -HB_FUNC( __HBQT_SLOTS_NEW ) -{ - void * pObj = NULL; - - pObj = ( HBQSlots * ) new HBQSlots(); - - hb_retptrGC( hbqt_gcAllocate_HBQSlots( pObj, true ) ); -} - -/*----------------------------------------------------------------------*/ -#else //__PRITPAL__ -/*----------------------------------------------------------------------*/ - -#include -#include +#include +#include +#include +#include +#include #include #include -#include #include +/* TOFIX: QtGui components should not be accessed from this component */ #include +#include #include static void hbqt_SlotsExecPointer( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, ( *reinterpret_cast< void*( * )>( arguments[ 1 ] ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( *reinterpret_cast< void*( * )>( arguments[ 1 ] ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecPointerPointer( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, ( *reinterpret_cast< void*( * )>( arguments[ 1 ] ) ) ); - PHB_ITEM p2 = hb_itemPutPtr( NULL, ( *reinterpret_cast< void*( * )>( arguments[ 2 ] ) ) ); - hb_vmEvalBlockV( codeBlock, 2, p1, p2 ); - hb_itemRelease( p1 ); - hb_itemRelease( p2 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( *reinterpret_cast< void*( * )>( arguments[ 1 ] ) ); hb_vmPushPointer( *reinterpret_cast< void*( * )>( arguments[ 2 ] ) ); hb_vmSend( 2 ); - #endif } static void hbqt_SlotsExecPointerInt( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, ( *reinterpret_cast< void*( * ) >( arguments[ 1 ] ) ) ); - PHB_ITEM p2 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 2 ] ) ) ); - hb_vmEvalBlockV( codeBlock, 2, p1, p2 ); - hb_itemRelease( p1 ); - hb_itemRelease( p2 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( *reinterpret_cast< void*( * )>( arguments[ 1 ] ) ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 2 ] ) ); hb_vmSend( 2 ); - #endif } static void hbqt_SlotsExecBool( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutL( NULL, ( *reinterpret_cast< bool( * ) >( arguments[ 1 ] ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushLogical( *reinterpret_cast< bool( * ) >( arguments[ 1 ] ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecInt( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 1 ] ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 1 ] ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecIntInt( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 1 ] ) ) ); - PHB_ITEM p2 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 2 ] ) ) ); - hb_vmEvalBlockV( codeBlock, 2, p1, p2 ); - hb_itemRelease( p1 ); - hb_itemRelease( p2 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 1 ] ) ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 2 ] ) ); hb_vmSend( 2 ); - #endif } static void hbqt_SlotsExecIntIntInt( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 1 ] ) ) ); - PHB_ITEM p2 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 2 ] ) ) ); - PHB_ITEM p3 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 3 ] ) ) ); - hb_vmEvalBlockV( codeBlock, 3, p1, p2, p3 ); - hb_itemRelease( p1 ); - hb_itemRelease( p2 ); - hb_itemRelease( p3 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 1 ] ) ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 2 ] ) ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 3 ] ) ); hb_vmSend( 3 ); - #endif } static void hbqt_SlotsExecIntIntIntInt( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 1 ] ) ) ); - PHB_ITEM p2 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 2 ] ) ) ); - PHB_ITEM p3 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 3 ] ) ) ); - PHB_ITEM p4 = hb_itemPutNI( NULL, ( *reinterpret_cast< int( * ) >( arguments[ 4 ] ) ) ); - hb_vmEvalBlockV( codeBlock, 4, p1, p2, p3, p4 ); - hb_itemRelease( p1 ); - hb_itemRelease( p2 ); - hb_itemRelease( p3 ); - hb_itemRelease( p4 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 1 ] ) ); @@ -1536,243 +152,131 @@ static void hbqt_SlotsExecIntIntIntInt( PHB_ITEM * codeBlock, void ** arguments hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 3 ] ) ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 4 ] ) ); hb_vmSend( 4 ); - #endif } static void hbqt_SlotsExecQRectInt( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QRect( (*reinterpret_cast< QRect(*)>(arguments[1])) ) ); - PHB_ITEM p2 = hb_itemPutNI( NULL, (*reinterpret_cast< int(*)>(arguments[2])) ); - hb_vmEvalBlockV( codeBlock, 2, p1, p2 ); - delete ( ( QRect * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - hb_itemRelease( p2 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QRect( *reinterpret_cast< QRect( * ) >( arguments[ 1 ] ) ) ); hb_vmPushInteger( *reinterpret_cast< int( * ) >( arguments[ 2 ] ) ); hb_vmSend( 2 ); - #endif } static void hbqt_SlotsExecString( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ // TODO: how to convert to this type with size - PHB_ITEM pString = hb_itemPutC( NULL, ( *reinterpret_cast< QString( * ) >( arguments[ 1 ] ) ).toAscii().data() ); - hb_vmEvalBlockV( codeBlock, 1, pString ); - hb_itemRelease( pString ); - #else + /* TODO: how to convert to this type with size */ QString text = *reinterpret_cast< QString( * ) >( arguments[ 1 ] ); hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushString( text.toAscii().data(), text.toAscii().length() ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecModel( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM pState = hb_itemPutPtr( NULL, new QModelIndex( ( *reinterpret_cast< QModelIndex( * ) >( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, pState ); - delete ( ( QModelIndex * ) hb_itemGetPtr( pState ) ); - hb_itemRelease( pState ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QModelIndex( ( *reinterpret_cast< QModelIndex( * ) >( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecModelModel( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM pState1 = hb_itemPutPtr( NULL, new QModelIndex( ( *reinterpret_cast< QModelIndex( * ) >( arguments[ 1 ] ) ) ) ); - PHB_ITEM pState2 = hb_itemPutPtr( NULL, new QModelIndex( ( *reinterpret_cast< QModelIndex( * ) >( arguments[ 2 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 2, pState1, pState2 ); - delete ( ( QModelIndex * ) hb_itemGetPtr( pState1 ) ); - delete ( ( QModelIndex * ) hb_itemGetPtr( pState2 ) ); - hb_itemRelease( pState1 ); - hb_itemRelease( pState2 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QModelIndex( ( *reinterpret_cast< QModelIndex( * ) >( arguments[ 1 ] ) ) ) ); hb_vmPushPointer( new QModelIndex( ( *reinterpret_cast< QModelIndex( * ) >( arguments[ 2 ] ) ) ) ); hb_vmSend( 2 ); - #endif } static void hbqt_SlotsExecItemSelItemSel( PHB_ITEM * codeBlock, void ** arguments) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM pState1 = hb_itemPutPtr( NULL, new QItemSelection( ( *reinterpret_cast< QItemSelection( * )>( arguments[ 1 ] ) ) ) ); - PHB_ITEM pState2 = hb_itemPutPtr( NULL, new QItemSelection( ( *reinterpret_cast< QItemSelection( * )>( arguments[ 2 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 2, pState1, pState2 ); - delete ( ( QItemSelection * ) hb_itemGetPtr( pState1 ) ); - delete ( ( QItemSelection * ) hb_itemGetPtr( pState2 ) ); - hb_itemRelease( pState1 ); - hb_itemRelease( pState2 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QItemSelection( ( *reinterpret_cast< QItemSelection( * )>( arguments[ 1 ] ) ) ) ); hb_vmPushPointer( new QItemSelection( ( *reinterpret_cast< QItemSelection( * )>( arguments[ 2 ] ) ) ) ); hb_vmSend( 2 ); - #endif } static void hbqt_SlotsExecTextCharFormat( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QTextCharFormat( ( *reinterpret_cast( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QTextCharFormat * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QTextCharFormat( ( *reinterpret_cast( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecFont( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QFont( ( *reinterpret_cast< QFont( * )>( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QFont * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QFont( ( *reinterpret_cast< QFont( * )>( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecQTextCursor( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QTextCursor( ( *reinterpret_cast< QTextCursor( * )>( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QTextCursor * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QTextCursor( ( *reinterpret_cast< QTextCursor( * )>( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecStringList( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QStringList( ( *reinterpret_cast( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QStringList * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QStringList( ( *reinterpret_cast( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecQPoint( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QPoint( ( * reinterpret_cast< QPoint( * )>( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QPoint * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QPoint( ( * reinterpret_cast< QPoint( * )>( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecQRectF( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QRectF( ( *reinterpret_cast< QRectF( * )>( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QRectF * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QRectF( ( *reinterpret_cast< QRectF( * )>( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecQUrl( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QUrl( ( *reinterpret_cast< QUrl( * )>( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QUrl * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QUrl( ( *reinterpret_cast< QUrl( * )>( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecQDate( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QDate( ( *reinterpret_cast< QDate( * ) >( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QDate * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QDate( ( *reinterpret_cast< QDate( * ) >( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecQDateTime( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QDateTime( ( *reinterpret_cast< QDateTime( * ) >( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QDateTime * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QDateTime( ( *reinterpret_cast< QDateTime( * ) >( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } static void hbqt_SlotsExecQTime( PHB_ITEM * codeBlock, void ** arguments ) { - #ifdef __hb_vmEvalBlockV__ - PHB_ITEM p1 = hb_itemPutPtr( NULL, new QTime( ( *reinterpret_cast< QTime( * ) >( arguments[ 1 ] ) ) ) ); - hb_vmEvalBlockV( codeBlock, 1, p1 ); - delete ( ( QTime * ) hb_itemGetPtr( p1 ) ); - hb_itemRelease( p1 ); - #else hb_vmPushEvalSym(); hb_vmPush( codeBlock ); hb_vmPushPointer( new QTime( ( *reinterpret_cast< QTime( * ) >( arguments[ 1 ] ) ) ) ); hb_vmSend( 1 ); - #endif } @@ -2255,4 +759,3 @@ HB_FUNC( __HBQT_SLOTS_NEW ) } #endif -#endif diff --git a/harbour/contrib/hbqt/qtcore/hbqt_hbqslots.h b/harbour/contrib/hbqt/qtcore/hbqt_hbqslots.h index 63e5abea72..f1e0eda4c6 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_hbqslots.h +++ b/harbour/contrib/hbqt/qtcore/hbqt_hbqslots.h @@ -59,259 +59,13 @@ #include "hbqtcore.h" -/* TOFIX: QtGui components should not be accessed from this component */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include /*----------------------------------------------------------------------*/ -#define __xPRITPAL__ - -#ifdef __PRITPAL__ - -class HBQSlots: public QObject -{ - Q_OBJECT - -public: - HBQSlots( QObject *parent = 0 ); - ~HBQSlots(); - QList listBlock; - QList listObj; - - bool hbConnect( PHB_ITEM pObj, const char * slot, PHB_ITEM bBlock ); - bool hbDisconnect( PHB_ITEM pObj, const char * slot ); - bool hbIsConnected( PHB_ITEM pObj, const char * slot ); - bool isConnected( QObject * object, const char * slot ); - bool hbClear(); - -public slots: - /* QWidget */ - void customContextMenuRequested( const QPoint & pos ); - void clicked(); - void triggered(); - void triggered( bool checked ); - void hovered(); - void stateChanged( int state ); - void pressed(); - void released(); - void activated( int index ); - void currentIndexChanged( int index ); - void highlighted( int index ); - void clicked( const QModelIndex & index ); - void doubleClicked( const QModelIndex & index ); - void entered( const QModelIndex & index ); - void viewportEntered(); - //bool event( QEvent * event, QWidget * w ); - void hovered( QAction * action ); - void currentChanged( int index ); - /* QAbstractSlider() */ - void actionTriggered( int action ); - void rangeChanged( int min, int max ); - void sliderMoved( int value ); - void sliderPressed(); - void sliderReleased(); - void valueChanged( int value ); - /* QLineEdit() */ - void cursorPositionChanged( int iOld, int iNew ); - void editingFinished(); - void returnPressed(); - void selectionChanged(); - void textChanged( const QString & text ); - void textEdited( const QString & text ); - /* QTreeWidget */ - void currentItemChanged( QTreeWidgetItem * current, QTreeWidgetItem * previous ); - void itemActivated( QTreeWidgetItem * item, int column ); - void itemChanged( QTreeWidgetItem * item, int column ); - void itemClicked( QTreeWidgetItem * item, int column ); - void itemCollapsed( QTreeWidgetItem * item ); - void itemDoubleClicked( QTreeWidgetItem * item, int column ); - void itemEntered( QTreeWidgetItem * item, int column ); - void itemExpanded( QTreeWidgetItem * item ); - void itemPressed( QTreeWidgetItem * item, int column ); - void itemSelectionChanged(); - /* QWebPage */ -#if 0 - void contentsChanged(); - void databaseQuotaExceeded( QWebFrame * frame, QString databaseName ); - void downloadRequested( const QNetworkRequest & request ); - void frameCreated( QWebFrame * frame ); - void geometryChangeRequested( const QRect & geom ); - void linkClicked( const QUrl & url ); - void linkHovered( const QString & link, const QString & title, const QString & textContent ); - void loadFinished( bool ok ); - void loadProgress( int progress ); - void loadStarted(); - void menuBarVisibilityChangeRequested( bool visible ); - void microFocusChanged(); - void printRequested( QWebFrame * frame ); - void repaintRequested( const QRect & dirtyRect ); - void restoreFrameStateRequested( QWebFrame * frame ); - void saveFrameStateRequested( QWebFrame * frame, QWebHistoryItem * item ); - void scrollRequested( int dx, int dy, const QRect & rectToScroll ); - void statusBarMessage( const QString & text ); - void statusBarVisibilityChangeRequested( bool visible ); - void toolBarVisibilityChangeRequested( bool visible ); - void unsupportedContent( QNetworkReply * reply ); - void windowCloseRequested(); - /* QWebView */ - void iconChanged(); - void titleChanged( const QString & title ); - void urlChanged( const QUrl & url ); -#endif - /* QDialog - QFontDialog QFileDialog */ - void currentFontChanged( const QFont & font ); - void fontSelected( const QFont & font ); - void accepted(); - void finished( int result ); - void rejected(); - void currentChanged( const QString & path ); - void directoryEntered( const QString & directory ); - void fileSelected( const QString & file ); - void filesSelected( const QStringList & selected ); - void filterSelected( const QString & filter ); - void accepted( QPrinter * printer ); - void copyAvailable( bool yes ); - void currentCharFormatChanged( const QTextCharFormat & f ); - void cursorPositionChanged(); - void redoAvailable( bool available ); - void textChanged(); - void undoAvailable( bool available ); - void timeout(); - void geometriesChanged(); - void sectionAutoResize( int logicalIndex, QHeaderView::ResizeMode mode ); - void sectionClicked( int logicalIndex ); - void sectionCountChanged( int oldCount, int newCount ); - void sectionDoubleClicked( int logicalIndex ); - void sectionEntered( int logicalIndex ); - void sectionHandleDoubleClicked( int logicalIndex ); - void sectionMoved( int logicalIndex, int oldVisualIndex, int newVisualIndex ); - void sectionPressed( int logicalIndex ); - void sectionResized( int logicalIndex, int oldSize, int newSize ); - void sortIndicatorChanged( int logicalIndex, Qt::SortOrder order ); - void buttonClicked( int id ); - void buttonPressed( int id ); - void buttonReleased( int id ); - void linkActivated( const QString & link ); - void linkHovered( const QString & link ); - void tabCloseRequested( int index ); - void paintRequested( QPrinter * printer ); - /* QIODevice */ - void aboutToClose(); - void bytesWritten( qint64 bytes ); - void readChannelFinished(); - void readyRead(); - /* QProcess */ - void error( QProcess::ProcessError error ); - void finished( int exitCode, QProcess::ExitStatus exitStatus ); - void readyReadStandardError(); - void readyReadStandardOutput(); - void started(); - void stateChanged( QProcess::ProcessState newState ); - /* QComboBox */ - void activated( const QString & text ); - void currentIndexChanged( const QString & text ); - void editTextChanged( const QString & text ); - void highlighted( const QString & text ); - /* QTextDocument */ - void blockCountChanged( int newBlockCount ); - void contentsChange( int position, int charsRemoved, int charsAdded ); - void contentsChanged(); - void cursorPositionChanged( const QTextCursor & cursor ); - void documentLayoutChanged(); - void modificationChanged( bool changed ); - void undoCommandAdded(); - /* QPlainTextEdit */ - void updateRequest( const QRect & rect, int dy ); - /* QItemSelectionModel */ - void currentChanged( const QModelIndex & currentIndex, const QModelIndex & previousIndex ); - void currentColumnChanged( const QModelIndex & currentIndex, const QModelIndex & previousIndex ); - void currentRowChanged( const QModelIndex & currentIndex, const QModelIndex & previousIndex ); - void selectionChanged( const QItemSelection & selected, const QItemSelection & deselected ); - /* QListWidget */ - void currentRowChanged( int currentRow ); - void currentTextChanged( const QString & currentText ); - void currentItemChanged( QListWidgetItem * current, QListWidgetItem * previous ); - void itemActivated( QListWidgetItem * item ); - void itemChanged( QListWidgetItem * item ); - void itemClicked( QListWidgetItem * item ); - void itemDoubleClicked( QListWidgetItem * item ); - void itemEntered( QListWidgetItem * item ); - void itemPressed( QListWidgetItem * item ); - /* QTableWidget */ - void cellActivated( int row, int column ); - void cellChanged( int row, int column ); - void cellClicked( int row, int column ); - void cellDoubleClicked( int row, int column ); - void cellEntered( int row, int column ); - void cellPressed( int row, int column ); - void currentCellChanged( int currentRow, int currentColumn, int previousRow, int previousColumn ); - void currentItemChanged( QTableWidgetItem * current, QTableWidgetItem * previous ); - void itemActivated( QTableWidgetItem * item ); - void itemChanged( QTableWidgetItem * item ); - void itemClicked( QTableWidgetItem * item ); - void itemDoubleClicked( QTableWidgetItem * item ); - void itemEntered( QTableWidgetItem * item ); - void itemPressed( QTableWidgetItem * item ); - /* QTextBrowser */ - void anchorClicked( const QUrl & link ); - void backwardAvailable( bool available ); - void forwardAvailable( bool available ); - void highlighted( const QUrl & link ); - void historyChanged(); - void sourceChanged( const QUrl & src ); - /* QDockWidget */ - void allowedAreasChanged( Qt::DockWidgetAreas allowedAreas ); - void dockLocationChanged( Qt::DockWidgetArea area ); - void featuresChanged( QDockWidget::DockWidgetFeatures features ); - void topLevelChanged( bool topLevel ); - void visibilityChanged( bool visible ); - /* QCompleter */ - void activated( const QModelIndex & index ); - void highlighted( const QModelIndex & index ); - /* QAbstractButton */ - void toggled( bool checked ); - /* QSystemTrayIcon */ - void activated( QSystemTrayIcon::ActivationReason reason ); - /* QMdiArea */ - void subWindowActivated( QMdiSubWindow * window ); - /* QMdiSubWindow */ - void aboutToActivate(); - void windowStateChanged( Qt::WindowStates oldState, Qt::WindowStates newState ); - /* QAbstractItemDelegate */ - void closeEditor( QWidget * editor, QAbstractItemDelegate::EndEditHint hint ); - void commitData( QWidget * editor ); - void sizeHintChanged( const QModelIndex & index ); - /* QGraphicsScene */ - void sceneRectChanged( const QRectF & rect ); - /* QDateTimeEdit */ - void dateChanged( const QDate & date ); - void dateTimeChanged( const QDateTime & datetime ); - void timeChanged( const QTime & time ); - /* QApplication */ -// void commitDataRequest( QSessionManager & manager ); - void focusChanged( QWidget * old, QWidget * now ); - void fontDatabaseChanged(); - void lastWindowClosed(); -// void saveStateRequest( QSessionManager & manager ); - /* Latest */ -}; - -#else - class HBQSlots: public QObject { @@ -330,7 +84,6 @@ public: bool hbClear(); }; -#endif /*----------------------------------------------------------------------*/ #endif diff --git a/harbour/contrib/hbqt/qtcore/hbqtcore.hbm b/harbour/contrib/hbqt/qtcore/hbqtcore.hbm index b11cec08b0..b92ceef723 100644 --- a/harbour/contrib/hbqt/qtcore/hbqtcore.hbm +++ b/harbour/contrib/hbqt/qtcore/hbqtcore.hbm @@ -17,4 +17,3 @@ hbqt_hbqstring.cpp hbqt_misc.prg hbqt_hbqevents.h -hbqt_hbqslots.h diff --git a/harbour/contrib/hbqt/qtgui/THbQtUI.prg b/harbour/contrib/hbqt/qtgui/THbQtUI.prg index a5311b68b1..acfecad7f6 100644 --- a/harbour/contrib/hbqt/qtgui/THbQtUI.prg +++ b/harbour/contrib/hbqt/qtgui/THbQtUI.prg @@ -70,9 +70,7 @@ /*----------------------------------------------------------------------*/ -/* TODO: Rename HbQtUI2 to final name after finalizing the code. [vszakats] */ - -CREATE CLASS HbQtUI2 INHERIT HbQtObjectHandler +CREATE CLASS HbQtUI INHERIT HbQtObjectHandler VAR oWidget /* TOFIX: User code uses this directly. Then rename this to __oRootWidget and make it PROTECTED. */ VAR qObj INIT { => } /* TOFIX: User code uses this directly. Then rename this to __hWidget and make it PROTECTED. */ @@ -86,7 +84,7 @@ CREATE CLASS HbQtUI2 INHERIT HbQtObjectHandler /*----------------------------------------------------------------------*/ -METHOD HbQtUI2:new( oRootWidget, hWidget ) +METHOD HbQtUI:new( oRootWidget, hWidget ) ::oWidget := oRootWidget ::qObj := hWidget @@ -99,7 +97,7 @@ METHOD HbQtUI2:new( oRootWidget, hWidget ) /*----------------------------------------------------------------------*/ /* QUESTION: Is this needed? */ -METHOD HbQtUI2:destroy() +METHOD HbQtUI:destroy() ::oWidget:close() ::oWidget := NIL @@ -108,7 +106,7 @@ METHOD HbQtUI2:destroy() /*----------------------------------------------------------------------*/ -METHOD HbQtUI2:__OnError( ... ) +METHOD HbQtUI:__OnError( ... ) LOCAL cMsg := __GetMessage() LOCAL oError diff --git a/harbour/contrib/hbqt/qtgui/hbqtgui.hbx b/harbour/contrib/hbqt/qtgui/hbqtgui.hbx index 6d2f2f2fd7..8826f8014c 100644 --- a/harbour/contrib/hbqt/qtgui/hbqtgui.hbx +++ b/harbour/contrib/hbqt/qtgui/hbqtgui.hbx @@ -42,7 +42,7 @@ DYNAMIC HBQTABLEVIEW DYNAMIC HBQTABLEVIEWFROMPOINTER DYNAMIC HBQTEXTBLOCKUSERDATA DYNAMIC HBQTEXTBLOCKUSERDATAFROMPOINTER -DYNAMIC HBQTUI2 +DYNAMIC HBQTUI DYNAMIC HBQT_ERRORSYS DYNAMIC HBQT_QMAINWINDOW_RESTSETTINGS DYNAMIC HBQT_QMAINWINDOW_SAVESETTINGS diff --git a/harbour/contrib/hbqt/qtuitools/THbQtUILoader.prg b/harbour/contrib/hbqt/qtuitools/THbQtUILoader.prg index 6240b7b297..ab5969daa3 100644 --- a/harbour/contrib/hbqt/qtuitools/THbQtUILoader.prg +++ b/harbour/contrib/hbqt/qtuitools/THbQtUILoader.prg @@ -74,7 +74,9 @@ /*----------------------------------------------------------------------*/ -CLASS HbQtUI +/* TOFIX: Change this to inherit from HbQtUI class */ + +CLASS HbQtUILoader DATA pPtr DATA cFile @@ -110,7 +112,7 @@ CLASS HbQtUI /*----------------------------------------------------------------------*/ -METHOD HbQtUI:new( cFile, qParent ) +METHOD HbQtUILoader:new( cFile, qParent ) ::cFile := cFile ::qParent := qParent @@ -119,7 +121,7 @@ METHOD HbQtUI:new( cFile, qParent ) /*----------------------------------------------------------------------*/ -METHOD HbQtUI:create( cFile, qParent ) +METHOD HbQtUILoader:create( cFile, qParent ) LOCAL cExt DEFAULT cFile TO ::cFile @@ -154,7 +156,7 @@ METHOD HbQtUI:create( cFile, qParent ) /*----------------------------------------------------------------------*/ -METHOD HbQtUI:destroy() +METHOD HbQtUILoader:destroy() LOCAL a_, i ::pSlots := NIL @@ -176,7 +178,7 @@ METHOD HbQtUI:destroy() /*----------------------------------------------------------------------*/ -METHOD HbQtUI:loadWidgets() +METHOD HbQtUILoader:loadWidgets() LOCAL a_, pPtr, bBlock, x, cBlock FOR EACH a_ IN ::widgets @@ -200,7 +202,7 @@ METHOD HbQtUI:loadWidgets() /*----------------------------------------------------------------------*/ -METHOD HbQtUI:loadContents( cUiFull ) +METHOD HbQtUILoader:loadContents( cUiFull ) LOCAL cBuffer := memoread( cUiFull ) LOCAL n, cClass, cWidget @@ -225,7 +227,7 @@ METHOD HbQtUI:loadContents( cUiFull ) /*----------------------------------------------------------------------*/ -METHOD HbQtUI:loadUI( cUiFull, qParent ) +METHOD HbQtUILoader:loadUI( cUiFull, qParent ) LOCAL oWidget, qUiLoader, qFile //, pWidget #if 1 LOCAL cBuffer @@ -267,7 +269,7 @@ METHOD HbQtUI:loadUI( cUiFull, qParent ) /*----------------------------------------------------------------------*/ -METHOD HbQtUI:OnError( ... ) +METHOD HbQtUILoader:OnError( ... ) LOCAL cMsg, xReturn LOCAL oError @@ -304,7 +306,7 @@ METHOD HbQtUI:OnError( ... ) /*----------------------------------------------------------------------*/ -METHOD HbQtUI:build( cFileOrBuffer, qParent ) +METHOD HbQtUILoader:build( cFileOrBuffer, qParent ) LOCAL s, n, n1, cCls, cNam, lCreateFinished, cMCls, cMNam, cText LOCAL cCmd, aReg, aCommands, aConst, cBlock, bBlock, x, a_ LOCAL regEx := hb_regexComp( "\bQ[A-Za-z_]+ \b" ) @@ -572,7 +574,7 @@ STATIC FUNCTION hbq_pullColumn( cCmd, nCol ) /*----------------------------------------------------------------------*/ -METHOD HbQtUI:formatCommand( cCmd, lText ) +METHOD HbQtUILoader:formatCommand( cCmd, lText ) LOCAL regDefine, aDefine, n, n1, cNam, cCmd1 STATIC nn := 100 diff --git a/harbour/contrib/hbqt/qtuitools/hbqtuitools.hbx b/harbour/contrib/hbqt/qtuitools/hbqtuitools.hbx index cd047a463d..d9fa38ca66 100644 --- a/harbour/contrib/hbqt/qtuitools/hbqtuitools.hbx +++ b/harbour/contrib/hbqt/qtuitools/hbqtuitools.hbx @@ -28,7 +28,7 @@ #command DYNAMIC => EXTERNAL #endif -DYNAMIC HBQTUI +DYNAMIC HBQTUILOADER DYNAMIC HB_QUILOADER DYNAMIC QUILOADER DYNAMIC QUILOADERFROMPOINTER