2009-12-10 20:35 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/Makefile
+ Added generic support to MOC compile headers.
; If this works out well, it makes it possible to use granular
(non-monolythic) headers for 'Q_OBJECT' classes.
It's also possible to move this logic into sub-libs.
This may also mean that some hacks which were currently
employed can be solved cleanly.
Please test/review.
* contrib/hbqt/hbqt_slots.h
+ contrib/hbqt/hbqt_hbqtableview.h
* contrib/hbqt/hbqt_hbqtableview.cpp
* contrib/hbqt/qth/QTableView.qth
* contrib/hbqt/hbqt_hbdbfmodel.cpp
* contrib/hbqt/qth/QAbstractItemModel.qth
+ contrib/hbqt/hbqt_hbdrawingarea.h
* contrib/hbqt/hbqt_hbdrawingarea.cpp
+ contrib/hbqt/hbqt_hbqmainwindow.h
* contrib/hbqt/hbqt_hbqmainwindow.cpp
+ contrib/hbqt/hbqt_hbqsyntaxhighlighter.h
* contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp
* contrib/hbqt/qth/QSyntaxHighlighter.qth
+ contrib/hbqt/hbqt_events.h
* contrib/hbqt/hbqt_events.cpp
* Split monolithic hbqt_slots.h header to distinct
class headers.
* contrib/hbqt/generator/hbqtgen.prg
- contrib/hbqt/filelist.mk
* contrib/hbqt/Makefile
* Changed to not generate central filelist.mk.
(no dynamic files in central lib)
* config/rules.mk
- Deleted .l reference.
* contrib/hbqt/qtgui/QSyntaxHighlighter.cpp
* contrib/hbqt/qtgui/QTableView.cpp
* contrib/hbqt/qtcore/QAbstractItemModel.cpp
* Regenerated.
This commit is contained in:
@@ -17,6 +17,48 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-12-10 20:35 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbqt/Makefile
|
||||
+ Added generic support to MOC compile headers.
|
||||
; If this works out well, it makes it possible to use granular
|
||||
(non-monolythic) headers for 'Q_OBJECT' classes.
|
||||
It's also possible to move this logic into sub-libs.
|
||||
This may also mean that some hacks which were currently
|
||||
employed can be solved cleanly.
|
||||
Please test/review.
|
||||
|
||||
* contrib/hbqt/hbqt_slots.h
|
||||
+ contrib/hbqt/hbqt_hbqtableview.h
|
||||
* contrib/hbqt/hbqt_hbqtableview.cpp
|
||||
* contrib/hbqt/qth/QTableView.qth
|
||||
* contrib/hbqt/hbqt_hbdbfmodel.cpp
|
||||
* contrib/hbqt/qth/QAbstractItemModel.qth
|
||||
+ contrib/hbqt/hbqt_hbdrawingarea.h
|
||||
* contrib/hbqt/hbqt_hbdrawingarea.cpp
|
||||
+ contrib/hbqt/hbqt_hbqmainwindow.h
|
||||
* contrib/hbqt/hbqt_hbqmainwindow.cpp
|
||||
+ contrib/hbqt/hbqt_hbqsyntaxhighlighter.h
|
||||
* contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp
|
||||
* contrib/hbqt/qth/QSyntaxHighlighter.qth
|
||||
+ contrib/hbqt/hbqt_events.h
|
||||
* contrib/hbqt/hbqt_events.cpp
|
||||
* Split monolithic hbqt_slots.h header to distinct
|
||||
class headers.
|
||||
|
||||
* contrib/hbqt/generator/hbqtgen.prg
|
||||
- contrib/hbqt/filelist.mk
|
||||
* contrib/hbqt/Makefile
|
||||
* Changed to not generate central filelist.mk.
|
||||
(no dynamic files in central lib)
|
||||
|
||||
* config/rules.mk
|
||||
- Deleted .l reference.
|
||||
|
||||
* contrib/hbqt/qtgui/QSyntaxHighlighter.cpp
|
||||
* contrib/hbqt/qtgui/QTableView.cpp
|
||||
* contrib/hbqt/qtcore/QAbstractItemModel.cpp
|
||||
* Regenerated.
|
||||
|
||||
2009-12-10 16:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbqt/Makefile
|
||||
* contrib/hbqt/generator/hbqtgen.prg
|
||||
|
||||
@@ -65,8 +65,6 @@ endif
|
||||
# Eliminate these rules.
|
||||
%.c : %.y
|
||||
|
||||
%.c : %.l
|
||||
|
||||
# Rule to generate an object file from a C source file in the parent.
|
||||
%$(OBJ_EXT) : $(GRANDP)%.c
|
||||
$(CC_RULE)
|
||||
|
||||
@@ -15,13 +15,16 @@ include $(TOP)$(ROOT)contrib/hbqt/detect.mk
|
||||
|
||||
ifneq ($(HB_HAS_QT),)
|
||||
|
||||
moc_slots.cpp : $(TOP)$(ROOT)contrib/hbqt/hbqt_slots.h
|
||||
$(MOC_BIN) $(TOP)$(ROOT)contrib/hbqt/hbqt_slots.h > moc_slots.cpp
|
||||
|
||||
include $(TOP)$(ROOT)contrib/hbqt/filelist.mk
|
||||
|
||||
CPP_SOURCES += \
|
||||
moc_slots.cpp \
|
||||
MOC_HEADERS := \
|
||||
hbqt_events.h \
|
||||
hbqt_hbdbfmodel.h \
|
||||
hbqt_hbdrawingarea.h \
|
||||
hbqt_hbqmainwindow.h \
|
||||
hbqt_hbqsyntaxhighlighter.h \
|
||||
hbqt_hbqtableview.h \
|
||||
hbqt_slots.h \
|
||||
|
||||
CPP_SOURCES := \
|
||||
hbqt_base.cpp \
|
||||
hbqt_utils.cpp \
|
||||
hbqt_slots.cpp \
|
||||
@@ -33,6 +36,15 @@ moc_slots.cpp : $(TOP)$(ROOT)contrib/hbqt/hbqt_slots.h
|
||||
hbqt_hbqsyntaxhighlighter.cpp \
|
||||
hbqt_hbqtableview.cpp \
|
||||
|
||||
MOC_CPP_SOURCES := $(foreach dir,$(MOC_HEADERS),moc_$(dir:.h=.cpp))
|
||||
|
||||
$(MOC_CPP_SOURCES) : moc_%.cpp : $(GRANDP)%.h
|
||||
|
||||
moc_%.cpp : $(GRANDP)%.h
|
||||
$(MOC_BIN) $? -o $@
|
||||
|
||||
CPP_SOURCES += $(MOC_CPP_SOURCES)
|
||||
|
||||
include $(TOP)$(ROOT)config/header.mk
|
||||
include $(TOP)$(ROOT)config/lib.mk
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# WARNING: Automatically generated source file. DO NOT EDIT!
|
||||
# Instead, edit corresponding .qth file,
|
||||
# or the generator tool itself, and run regenarate.
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
CPP_SOURCES := \
|
||||
moc_slots.cpp \
|
||||
hbqt_base.cpp \
|
||||
hbqt_utils.cpp \
|
||||
hbqt_slots.cpp \
|
||||
hbqt_destruct.cpp \
|
||||
|
||||
# Don't delete this comment, it's here to ensure empty
|
||||
# line above is kept intact.
|
||||
@@ -1656,35 +1656,6 @@ STATIC FUNCTION Build_MakeFile( cpp_, prg_, cPathOut )
|
||||
aadd( hdr_, "# --------------------------------------------------------------------" )
|
||||
aadd( hdr_, "" )
|
||||
|
||||
/* Insert .cpp sources */
|
||||
txt_:= {}
|
||||
aeval( hdr_, {|e| aadd( txt_, e ) } )
|
||||
aadd( txt_, "CPP_SOURCES := \" )
|
||||
//
|
||||
// We will strip lines below once subs proto is running
|
||||
#if 0
|
||||
FOR EACH s IN cpp_
|
||||
aadd( txt_, " " + s + ".cpp \" )
|
||||
NEXT
|
||||
aadd( txt_, "" )
|
||||
aadd( txt_, "" )
|
||||
aadd( txt_, "" )
|
||||
IF !empty( prg_ )
|
||||
aadd( txt_, "PRG_SOURCES := \" )
|
||||
FOR EACH s IN prg_
|
||||
aadd( txt_, " " + "T" + s + ".prg \" )
|
||||
NEXT
|
||||
ENDIF
|
||||
#endif
|
||||
// ------------------------------------------------------
|
||||
aadd( txt_, "" )
|
||||
aadd( txt_, "# Don't delete this comment, it's here to ensure empty" )
|
||||
aadd( txt_, "# line above is kept intact." )
|
||||
//
|
||||
cFile := cPathOut + s_PathSep + "filelist.mk"
|
||||
CreateTarget( cFile, txt_ )
|
||||
|
||||
|
||||
/* Sub Libraries */
|
||||
aadd( aSubs, { "qtwebkit" , aWebkit } )
|
||||
aadd( aSubs, { "qtnetwork", aNetwork } )
|
||||
|
||||
@@ -62,7 +62,9 @@
|
||||
|
||||
#if QT_VERSION >= 0x040500
|
||||
|
||||
#include "hbqt_slots.h"
|
||||
#include "hbqt_events.h"
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
84
harbour/contrib/hbqt/hbqt_events.h
Normal file
84
harbour/contrib/hbqt/hbqt_events.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* QT wrapper main header
|
||||
*
|
||||
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
|
||||
*
|
||||
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HBQT_EVENTS_H
|
||||
#define HBQT_EVENTS_H
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QEvent>
|
||||
#include <QList>
|
||||
|
||||
class Events: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Events( QObject *parent = 0 );
|
||||
~Events();
|
||||
QList<PHB_ITEM> listBlock;
|
||||
QList<bool> listActv;
|
||||
QList<QObject*> listObj;
|
||||
|
||||
protected:
|
||||
bool eventFilter( QObject * obj, QEvent * event );
|
||||
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -54,13 +54,17 @@
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
#include "hbvm.h"
|
||||
|
||||
#include "hbqt.h"
|
||||
|
||||
#if QT_VERSION >= 0x040500
|
||||
|
||||
#include "hbqt_slots.h"
|
||||
#include "hbqt_hbdbfmodel.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QWidget>
|
||||
|
||||
#define HBQT_BRW_CELLVALUE 1001
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
#if QT_VERSION >= 0x040500
|
||||
|
||||
#include "hbqt_slots.h"
|
||||
#include "hbqt_hbdrawingarea.h"
|
||||
|
||||
HBDrawingArea::HBDrawingArea(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
|
||||
80
harbour/contrib/hbqt/hbqt_hbdrawingarea.h
Normal file
80
harbour/contrib/hbqt/hbqt_hbdrawingarea.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* QT wrapper main header
|
||||
*
|
||||
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
|
||||
*
|
||||
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HBQT_HBDRAWINGAREA_H
|
||||
#define HBQT_HBDRAWINGAREA_H
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class HBDrawingArea : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HBDrawingArea( QWidget *parent = 0 );
|
||||
virtual ~HBDrawingArea( void );
|
||||
|
||||
void keyPressEvent( QKeyEvent * event );
|
||||
void mouseMoveEvent( QMouseEvent * event );
|
||||
|
||||
signals:
|
||||
void sg_mouseMoveEvent( QMouseEvent * event );
|
||||
void sg_keyPressEvent( QKeyEvent * event );
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
#if QT_VERSION >= 0x040500
|
||||
|
||||
#include "hbqt_slots.h"
|
||||
#include "hbqt_hbqmainwindow.h"
|
||||
|
||||
static PHB_ITEM s_mutex = NULL;
|
||||
|
||||
|
||||
92
harbour/contrib/hbqt/hbqt_hbqmainwindow.h
Normal file
92
harbour/contrib/hbqt/hbqt_hbqmainwindow.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* QT wrapper main header
|
||||
*
|
||||
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
|
||||
*
|
||||
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HBQT_HBQMAINWINDOW_H
|
||||
#define HBQT_HBQMAINWINDOW_H
|
||||
|
||||
#include "hbapiitm.h"
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QMouseEvent>
|
||||
|
||||
class HBQMainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HBQMainWindow( PHB_ITEM pBlock, int iThreadID );
|
||||
virtual ~HBQMainWindow();
|
||||
|
||||
bool event( QEvent * event );
|
||||
void keyPressEvent( QKeyEvent * event );
|
||||
void mouseDoubleClickEvent( QMouseEvent * event );
|
||||
void mouseMoveEvent( QMouseEvent * event );
|
||||
void mousePressEvent( QMouseEvent * event );
|
||||
void mouseReleaseEvent( QMouseEvent * event );
|
||||
void wheelEvent( QWheelEvent * event );
|
||||
void resizeEvent( QResizeEvent * event );
|
||||
void paintEvent( QPaintEvent * event );
|
||||
void focusInEvent( QFocusEvent * event );
|
||||
void focusOutEvent( QFocusEvent * event );
|
||||
void closeEvent( QCloseEvent * event );
|
||||
|
||||
PHB_ITEM block;
|
||||
int threadID;
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -59,7 +59,10 @@
|
||||
|
||||
#if QT_VERSION >= 0x040500
|
||||
|
||||
#include "hbqt_slots.h"
|
||||
#include "hbqt_hbqsyntaxhighlighter.h"
|
||||
|
||||
#include <QHash>
|
||||
#include <QTextCharFormat>
|
||||
|
||||
HBQSyntaxHighlighter::HBQSyntaxHighlighter( QTextDocument *parent )
|
||||
: QSyntaxHighlighter( parent )
|
||||
|
||||
95
harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.h
Normal file
95
harbour/contrib/hbqt/hbqt_hbqsyntaxhighlighter.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* QT wrapper main header
|
||||
*
|
||||
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
|
||||
*
|
||||
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HBQSYNTAXHIGHLIGHTER_H
|
||||
#define HBQSYNTAXHIGHLIGHTER_H
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include <QSyntaxHighlighter>
|
||||
|
||||
class QTextDocument;
|
||||
|
||||
class HBQSyntaxHighlighter : public QSyntaxHighlighter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HBQSyntaxHighlighter( QTextDocument *parent = 0 );
|
||||
|
||||
protected:
|
||||
void highlightBlock( const QString &text );
|
||||
|
||||
private:
|
||||
struct HighlightingRule
|
||||
{
|
||||
QRegExp pattern;
|
||||
QTextCharFormat format;
|
||||
};
|
||||
QVector<HighlightingRule> highlightingRules;
|
||||
|
||||
QRegExp commentStartExpression;
|
||||
QRegExp commentEndExpression;
|
||||
|
||||
QTextCharFormat keywordFormat;
|
||||
QTextCharFormat classFormat;
|
||||
QTextCharFormat singleLineCommentFormat;
|
||||
QTextCharFormat multiLineCommentFormat;
|
||||
QTextCharFormat quotationFormat;
|
||||
QTextCharFormat functionFormat;
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
#if QT_VERSION >= 0x040500
|
||||
|
||||
#include "hbqt_slots.h"
|
||||
#include "hbqt_hbqtableview.h"
|
||||
|
||||
HBQTableView::HBQTableView( QWidget * parent ) : QTableView( parent )
|
||||
{
|
||||
|
||||
97
harbour/contrib/hbqt/hbqt_hbqtableview.h
Normal file
97
harbour/contrib/hbqt/hbqt_hbqtableview.h
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* QT wrapper main header
|
||||
*
|
||||
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
|
||||
*
|
||||
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HBQT_HBQTABLEVIEW_H
|
||||
#define HBQT_HBQTABLEVIEW_H
|
||||
|
||||
#include <QTableView>
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
class HBQTableView : public QTableView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HBQTableView( QWidget * parent = 0 );
|
||||
virtual ~HBQTableView();
|
||||
|
||||
void keyPressEvent( QKeyEvent * event );
|
||||
void mouseDoubleClickEvent( QMouseEvent * event );
|
||||
void mouseMoveEvent( QMouseEvent * event );
|
||||
void mousePressEvent( QMouseEvent * event );
|
||||
void mouseReleaseEvent( QMouseEvent * event );
|
||||
void wheelEvent( QWheelEvent * event );
|
||||
void resizeEvent( QResizeEvent * event );
|
||||
void scrollContentsBy( int x, int y );
|
||||
void scrollTo( const QModelIndex & index, QAbstractItemView::ScrollHint hint = QAbstractItemView::EnsureVisible );
|
||||
|
||||
QModelIndex navigate( int cursorAction );
|
||||
|
||||
QModelIndex moveCursor( HBQTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers );
|
||||
|
||||
signals:
|
||||
void sg_keyPressEvent( QKeyEvent * event );
|
||||
void sg_mouseMoveEvent( QMouseEvent * event );
|
||||
void sg_mouseDoubleClickEvent( QMouseEvent * event );
|
||||
void sg_mousePressEvent( QMouseEvent * event );
|
||||
void sg_mouseReleaseEvent( QMouseEvent * event );
|
||||
void sg_wheelEvent( QWheelEvent * event );
|
||||
void sg_resizeEvent( QResizeEvent * event );
|
||||
void sg_moveCursor( HBQTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers );
|
||||
void sg_scrollContentsBy( int x, int y );
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -51,12 +51,14 @@
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#ifndef HBQT_SLOTS_H
|
||||
#define HBQT_SLOTS_H
|
||||
|
||||
#ifndef SLOTS_H
|
||||
#include "hbapiitm.h"
|
||||
|
||||
#define SLOTS_H
|
||||
#include "hbqt_hbdrawingarea.h"
|
||||
#include "hbqt_hbqtableview.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QMainWindow>
|
||||
@@ -77,116 +79,6 @@
|
||||
#include <QPainter>
|
||||
#include <QProcess>
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
class HBQMainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HBQMainWindow( PHB_ITEM pBlock, int iThreadID );
|
||||
virtual ~HBQMainWindow();
|
||||
|
||||
bool event( QEvent * event );
|
||||
void keyPressEvent( QKeyEvent * event );
|
||||
void mouseDoubleClickEvent( QMouseEvent * event );
|
||||
void mouseMoveEvent( QMouseEvent * event );
|
||||
void mousePressEvent( QMouseEvent * event );
|
||||
void mouseReleaseEvent( QMouseEvent * event );
|
||||
void wheelEvent( QWheelEvent * event );
|
||||
void resizeEvent( QResizeEvent * event );
|
||||
void paintEvent( QPaintEvent * event );
|
||||
void focusInEvent( QFocusEvent * event );
|
||||
void focusOutEvent( QFocusEvent * event );
|
||||
void closeEvent( QCloseEvent * event );
|
||||
|
||||
PHB_ITEM block;
|
||||
int threadID;
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
class HBDrawingArea : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HBDrawingArea( QWidget *parent = 0 );
|
||||
virtual ~HBDrawingArea( void );
|
||||
|
||||
void keyPressEvent( QKeyEvent * event );
|
||||
void mouseMoveEvent( QMouseEvent * event );
|
||||
|
||||
signals:
|
||||
void sg_mouseMoveEvent( QMouseEvent * event );
|
||||
void sg_keyPressEvent( QKeyEvent * event );
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
class HBDbfModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HBDbfModel( PHB_ITEM pBlock );
|
||||
virtual ~HBDbfModel( void );
|
||||
|
||||
PHB_ITEM block;
|
||||
int iRows;
|
||||
int iCols;
|
||||
|
||||
void hbSetRowColumns( int rows, int cols );
|
||||
|
||||
Qt::ItemFlags flags( const QModelIndex & index ) const;
|
||||
QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
|
||||
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
|
||||
int rowCount( const QModelIndex & parent = QModelIndex() ) const;
|
||||
int columnCount( const QModelIndex & parent = QModelIndex() ) const;
|
||||
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex &child) const;
|
||||
void reset();
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
class HBQTableView : public QTableView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HBQTableView( QWidget * parent = 0 );
|
||||
virtual ~HBQTableView();
|
||||
|
||||
void keyPressEvent( QKeyEvent * event );
|
||||
void mouseDoubleClickEvent( QMouseEvent * event );
|
||||
void mouseMoveEvent( QMouseEvent * event );
|
||||
void mousePressEvent( QMouseEvent * event );
|
||||
void mouseReleaseEvent( QMouseEvent * event );
|
||||
void wheelEvent( QWheelEvent * event );
|
||||
void resizeEvent( QResizeEvent * event );
|
||||
void scrollContentsBy( int x, int y );
|
||||
void scrollTo( const QModelIndex & index, QAbstractItemView::ScrollHint hint = QAbstractItemView::EnsureVisible );
|
||||
|
||||
QModelIndex navigate( int cursorAction );
|
||||
|
||||
QModelIndex moveCursor( HBQTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers );
|
||||
|
||||
signals:
|
||||
void sg_keyPressEvent( QKeyEvent * event );
|
||||
void sg_mouseMoveEvent( QMouseEvent * event );
|
||||
void sg_mouseDoubleClickEvent( QMouseEvent * event );
|
||||
void sg_mousePressEvent( QMouseEvent * event );
|
||||
void sg_mouseReleaseEvent( QMouseEvent * event );
|
||||
void sg_wheelEvent( QWheelEvent * event );
|
||||
void sg_resizeEvent( QResizeEvent * event );
|
||||
void sg_moveCursor( HBQTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers );
|
||||
void sg_scrollContentsBy( int x, int y );
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
class Slots: public QObject
|
||||
@@ -340,58 +232,6 @@ public slots:
|
||||
/* */
|
||||
};
|
||||
|
||||
class Events: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Events( QObject *parent = 0 );
|
||||
~Events();
|
||||
QList<PHB_ITEM> listBlock;
|
||||
QList<QObject*> listObj;
|
||||
|
||||
protected:
|
||||
bool eventFilter( QObject * obj, QEvent * event );
|
||||
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include <QSyntaxHighlighter>
|
||||
#include <QHash>
|
||||
#include <QTextCharFormat>
|
||||
|
||||
class QTextDocument;
|
||||
|
||||
class HBQSyntaxHighlighter : public QSyntaxHighlighter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HBQSyntaxHighlighter( QTextDocument *parent = 0 );
|
||||
|
||||
protected:
|
||||
void highlightBlock( const QString &text );
|
||||
|
||||
private:
|
||||
struct HighlightingRule
|
||||
{
|
||||
QRegExp pattern;
|
||||
QTextCharFormat format;
|
||||
};
|
||||
QVector<HighlightingRule> highlightingRules;
|
||||
|
||||
QRegExp commentStartExpression;
|
||||
QRegExp commentEndExpression;
|
||||
|
||||
QTextCharFormat keywordFormat;
|
||||
QTextCharFormat classFormat;
|
||||
QTextCharFormat singleLineCommentFormat;
|
||||
QTextCharFormat multiLineCommentFormat;
|
||||
QTextCharFormat quotationFormat;
|
||||
QTextCharFormat functionFormat;
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
#include <QStringList>
|
||||
#include <QtCore/QAbstractItemModel>
|
||||
|
||||
#include "../hbqt_slots.h"
|
||||
#include "../hbqt_hbdbfmodel.h"
|
||||
|
||||
/*
|
||||
* QAbstractItemModel ( QObject * parent = 0 )
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
#include <QtGui/QSyntaxHighlighter>
|
||||
#include "../hbqt_slots.h"
|
||||
#include "../hbqt_hbqsyntaxhighlighter.h"
|
||||
|
||||
/*
|
||||
* QSyntaxHighlighter ( QObject * parent )
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
#include <QtGui/QTableView>
|
||||
|
||||
#include "../hbqt_slots.h"
|
||||
#include "../hbqt_hbqtableview.h"
|
||||
|
||||
/*
|
||||
* QTableView ( QWidget * parent = 0 )
|
||||
|
||||
@@ -94,7 +94,7 @@ METHOD HBDbfModel:destroy()
|
||||
#include <QStringList>
|
||||
#include <QtCore/QAbstractItemModel>
|
||||
|
||||
#include "../hbqt_slots.h"
|
||||
#include "../hbqt_hbdbfmodel.h"
|
||||
|
||||
/*
|
||||
* QAbstractItemModel ( QObject * parent = 0 )
|
||||
|
||||
@@ -72,7 +72,7 @@ oSynHiliter := QSyntaxHighlighter():new( "QTextEdit", pQTextEdit )
|
||||
|
||||
<CODE>
|
||||
#include <QtGui/QSyntaxHighlighter>
|
||||
#include "../hbqt_slots.h"
|
||||
#include "../hbqt_hbqsyntaxhighlighter.h"
|
||||
|
||||
/*
|
||||
* QSyntaxHighlighter ( QObject * parent )
|
||||
|
||||
@@ -83,7 +83,7 @@ METHOD HBQTableView:destroy()
|
||||
<CODE>
|
||||
#include <QtGui/QTableView>
|
||||
|
||||
#include "../hbqt_slots.h"
|
||||
#include "../hbqt_hbqtableview.h"
|
||||
|
||||
/*
|
||||
* QTableView ( QWidget * parent = 0 )
|
||||
|
||||
Reference in New Issue
Block a user