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)
This commit is contained in:
Viktor Szakats
2010-10-23 14:31:00 +00:00
parent 1f7941eeeb
commit 304501e472
9 changed files with 62 additions and 1786 deletions

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -59,259 +59,13 @@
#include "hbqtcore.h"
/* TOFIX: QtGui components should not be accessed from this component */
#include <QtCore/QProcess>
#include <QtCore/QUrl>
#include <QtCore/QDate>
#include <QtCore/QDateTime>
#include <QtCore/QTime>
#include <QtGui/QTextCursor>
#include <QtGui/QTextCharFormat>
#include <QtGui/QTreeWidgetItem>
#include <QtGui/QListWidgetItem>
#include <QtGui/QTableWidgetItem>
#include <QtGui/QDockWidget>
#include <QtGui/QHeaderView>
#include <QtGui/QSystemTrayIcon>
#include <QtGui/QMdiSubWindow>
#include <QtGui/QSessionManager>
#include <QtCore/QObject>
#include <QtCore/QMetaObject>
#include <QtCore/QMetaMethod>
#include <QtCore/QList>
/*----------------------------------------------------------------------*/
#define __xPRITPAL__
#ifdef __PRITPAL__
class HBQSlots: public QObject
{
Q_OBJECT
public:
HBQSlots( QObject *parent = 0 );
~HBQSlots();
QList<PHB_ITEM> listBlock;
QList<QObject *> 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

View File

@@ -17,4 +17,3 @@ hbqt_hbqstring.cpp
hbqt_misc.prg
hbqt_hbqevents.h
hbqt_hbqslots.h

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -28,7 +28,7 @@
#command DYNAMIC <fncs,...> => EXTERNAL <fncs>
#endif
DYNAMIC HBQTUI
DYNAMIC HBQTUILOADER
DYNAMIC HB_QUILOADER
DYNAMIC QUILOADER
DYNAMIC QUILOADERFROMPOINTER