author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
104 files changed, 1617 insertions, 1358 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index 72c4e60..4172cd0 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp @@ -40,4 +40,4 @@ #if QT_VERSION >= 0x030000 -#include "qptrlist.h" -#include "qmemarray.h" +#include "q3ptrlist.h" +#include "q3memarray.h" #else @@ -45,12 +45,21 @@ #include <qarray.h> -#define QPtrList QList -#define QMemArray QArray +#define Q3PtrList QList +#define Q3MemArray QArray #endif #include "qlayoutengine_p.h" -#include "qobjectlist.h" +#include "qobject.h" #include "qstyle.h" #include "qapplication.h" //sendPostedEvents -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qcursor.h> -#include <qframe.h> +#include <q3frame.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3PointArray> +#include <QPixmap> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QChildEvent> +#include <QEvent> +#include <QPaintEvent> #ifndef KDGANTT_MASTER_CVS @@ -67,6 +76,6 @@ static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit ri -class KDRubberBand: public QFrame +class KDRubberBand: public Q3Frame { public: - KDRubberBand( QWidget *parent, const char * name, WFlags f ) :QFrame ( parent, name, f ) {;} + KDRubberBand( QWidget *parent, const char * name, Qt::WFlags f ) :Q3Frame ( parent, name, f ) {;} @@ -82,5 +91,6 @@ KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, KDGanttMinimizeSplitter *parent, const char * name ) - : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) + : _activeButton( 0 ), _collapsed( false ) { - + setObjectName(name); + setParent(parent); if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->width() < 650 ) { @@ -108,6 +118,6 @@ void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) #ifndef QT_NO_CURSOR - if ( o == KDGanttMinimizeSplitter::Horizontal ) - setCursor( splitHCursor ); + if ( o == Qt::Horizontal ) + setCursor( Qt::splitHCursor ); else - setCursor( splitVCursor ); + setCursor( Qt::splitVCursor ); #endif @@ -119,3 +129,3 @@ void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) updateCursor( e->pos() ); - if ( !(e->state()&LeftButton) ) + if ( !(e->state()&Qt::LeftButton) ) return; @@ -139,3 +149,3 @@ void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) { - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { _activeButton = onButton( e->pos() ); @@ -151,9 +161,9 @@ void KDGanttSplitterHandle::updateCursor( const QPoint& p) if ( onButton( p ) != 0 ) { - setCursor( arrowCursor ); + setCursor( Qt::arrowCursor ); } else { - if ( orient == KDGanttMinimizeSplitter::Horizontal ) - setCursor( splitHCursor ); + if ( orient == Qt::Horizontal ) + setCursor( Qt::splitHCursor ); else - setCursor( splitVCursor ); + setCursor( Qt::splitVCursor ); } @@ -197,3 +207,3 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) else { - if ( !opaque() && e->button() == LeftButton ) { + if ( !opaque() && e->button() == Qt::LeftButton ) { QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) @@ -213,6 +223,6 @@ int KDGanttSplitterHandle::onButton( const QPoint& p ) { - QValueList<QPointArray> list = buttonRegions(); + Q3ValueList<Q3PointArray> list = buttonRegions(); int index = 1; int add = 12; - for( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { + for( Q3ValueList<Q3PointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { QRect rect = (*it).boundingRect(); @@ -231,5 +241,5 @@ int KDGanttSplitterHandle::onButton( const QPoint& p ) -QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() +Q3ValueList<Q3PointArray> KDGanttSplitterHandle::buttonRegions() { - QValueList<QPointArray> list; + Q3ValueList<Q3PointArray> list; @@ -240,3 +250,3 @@ QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() for ( int i = 0; i < 2; i++ ) { - QPointArray arr; + Q3PointArray arr; if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right || @@ -313,3 +323,3 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) - QValueList<QPointArray> list = buttonRegions(); + Q3ValueList<Q3PointArray> list = buttonRegions(); int index = 1; @@ -317,3 +327,3 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) p.translate( 0, 1 ); - for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( Q3ValueList<Q3PointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { if ( index == _activeButton ) { @@ -379,3 +389,3 @@ public: - QPtrList<QSplitterLayoutStruct> list; + Q3PtrList<QSplitterLayoutStruct> list; bool opaque; @@ -384,3 +394,3 @@ public: -void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, +void kdganttGeomCalc( Q3MemArray<QLayoutStruct> &chain, int start, int count, int pos, int space, int spacer ); @@ -463,4 +473,5 @@ static QSize minSizeHint( const QWidget* w ) KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *name ) - :QFrame(parent,name,WPaintUnclipped) + :Q3Frame(parent,name) { + setAttribute(Qt::WA_PaintUnclipped); mRubberBand = 0; @@ -468,3 +479,3 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *n #if QT_VERSION >= 232 - orient = Horizontal; + orient = Qt::Horizontal; init(); @@ -477,6 +488,6 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *n */ -KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent, const char *name ) - :QFrame(parent,name,WPaintUnclipped) +KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Qt::Orientation o, QWidget *parent, const char *name ) + :Q3Frame(parent,name) { - + setAttribute(Qt::WA_PaintUnclipped); mRubberBand = 0; @@ -507,3 +518,3 @@ void KDGanttMinimizeSplitter::init() data = new QSplitterData; - if ( orient == Horizontal ) + if ( orient == Qt::Horizontal ) setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); @@ -536,3 +547,3 @@ void KDGanttMinimizeSplitter::toggle() */ -void KDGanttMinimizeSplitter::setOrientation( Orientation o ) +void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o ) { @@ -543,3 +554,3 @@ void KDGanttMinimizeSplitter::setOrientation( Orientation o ) - if ( orient == Horizontal ) + if ( orient == Qt::Horizontal ) setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); @@ -588,4 +599,4 @@ QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool firs newHandle = new KDGanttSplitterHandle( orientation(), this, tmp.latin1() ); - if ( ! mFirstHandle ) - mFirstHandle = newHandle; + if ( ! mFirstHandle ) + mFirstHandle = newHandle; s->wid = newHandle; @@ -602,3 +613,3 @@ QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool firs s->wid = w; - if ( !testWState( WState_Resized ) && w->sizeHint().isValid() ) + if ( !testAttribute( Qt::WA_Resized ) && w->sizeHint().isValid() ) s->sizer = pick( w->sizeHint() ); @@ -623,3 +634,3 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) { - if ( c->type() == QEvent::ChildInserted ) { + if ( c->type() == QEvent::ChildAdded ) { if ( !c->child()->isWidgetType() ) @@ -627,3 +638,9 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) - if ( ((QWidget*)c->child())->testWFlags( WType_TopLevel ) ) + QWidget *cw = (QWidget*)c->child(); + + if ( (cw->windowFlags())&Qt::Window ) + return; + + // avoid infinite recursion + if(cw->objectName().startsWith("qt_splithandle_")) return; @@ -632,3 +649,3 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) while ( s ) { - if ( s->wid == c->child() ) + if ( s->wid == cw ) return; @@ -636,3 +653,3 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) } - addWidget( (QWidget*)c->child() ); + addWidget( cw ); recalc( isVisible() ); @@ -672,5 +689,5 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) QPainter paint( this ); - paint.setPen( gray ); - paint.setBrush( gray ); - paint.setRasterOp( XorROP ); + paint.setPen( Qt::gray ); + paint.setBrush( Qt::gray ); + paint.setCompositionMode( QPainter::CompositionMode_Xor ); QRect r = contentsRect(); @@ -678,3 +695,3 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) #if QT_VERSION >= 0x030000 - int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); + int sw = style()->pixelMetric(QStyle::PM_SplitterWidth, 0, this); #else @@ -682,3 +699,3 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) #endif - if ( orient == Horizontal ) { + if ( orient == Qt::Horizontal ) { if ( opaqueOldPos >= 0 ) @@ -698,3 +715,3 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) if ( !mRubberBand ) { - mRubberBand = new KDRubberBand( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); + mRubberBand = new KDRubberBand( 0, "rubber", Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop); mRubberBand->setFrameStyle( Box | Raised ); @@ -712,3 +729,3 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) int sw = style().splitterWidth(); - if ( orient == Horizontal ) { + if ( orient == Qt::Horizontal ) { if ( p >= 0 ) { @@ -734,3 +751,3 @@ bool KDGanttMinimizeSplitter::event( QEvent *e ) { - if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { + if ( e->type() == QEvent::LayoutRequest || ( e->type() == QEvent::Show && data->firstShow ) ) { recalc( isVisible() ); @@ -757,3 +774,3 @@ void KDGanttMinimizeSplitter::drawSplitter( QPainter *p, (orientation() == Qt::Horizontal ? - QStyle::Style_Horizontal : 0)); + QStyle::State_Horizontal : 0)); #endif @@ -798,5 +815,5 @@ void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id ) QSplitterLayoutStruct *s = data->list.at(id); - int oldP = orient == Horizontal ? s->wid->x() : s->wid->y(); + int oldP = orient == Qt::Horizontal ? s->wid->x() : s->wid->y(); bool upLeft; - if ( false && orient == Horizontal ) { + if ( false && orient == Qt::Horizontal ) { p += s->wid->width(); @@ -815,4 +832,4 @@ void KDGanttMinimizeSplitter::setG( QWidget *w, int p, int s, bool isSplitter ) { - if ( orient == Horizontal ) { - if ( false && orient == Horizontal && !isSplitter ) + if ( orient == Qt::Horizontal ) { + if ( false && orient == Qt::Horizontal && !isSplitter ) p = contentsRect().width() - p - s; @@ -842,3 +859,3 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) int dd = s->sizer; - if( false && orient == Horizontal ) { + if( false && orient == Qt::Horizontal ) { pos1 = pos; @@ -858,3 +875,3 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) int dd, newLeft, nextPos; - if( false && orient == Horizontal ) { + if( false && orient == Qt::Horizontal ) { dd = w->geometry().right() - pos; @@ -895,3 +912,3 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) int pos1, pos2; - if( false && orient == Horizontal ) { + if( false && orient == Qt::Horizontal ) { pos2 = pos - dd; @@ -912,3 +929,3 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) int right, dd,/* newRight,*/ newLeft, nextPos; - if ( false && orient == Horizontal ) { + if ( false && orient == Qt::Horizontal ) { dd = pos - left + 1; @@ -990,5 +1007,5 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) QRect r = contentsRect(); - if ( orient == Horizontal && false ) { + if ( orient == Qt::Horizontal && false ) { #if QT_VERSION >= 0x030000 - int splitterWidth = style().pixelMetric(QStyle::PM_SplitterWidth, this); + int splitterWidth = style()->pixelMetric(QStyle::PM_SplitterWidth, 0,this); #else @@ -1032,3 +1049,3 @@ void KDGanttMinimizeSplitter::doResize() int n = data->list.count(); - QMemArray<QLayoutStruct> a( n ); + Q3MemArray<QLayoutStruct> a( n ); for ( i = 0; i< n; i++ ) { @@ -1134,3 +1151,3 @@ void KDGanttMinimizeSplitter::recalc( bool update ) - if ( orient == Horizontal ) { + if ( orient == Qt::Horizontal ) { setMaximumSize( maxl, maxt ); @@ -1269,9 +1286,6 @@ QSize KDGanttMinimizeSplitter::sizeHint() const int t = 0; - if ( children() ) { - const QObjectList * c = children(); - QObjectListIt it( *c ); - QObject * o; - - while( (o=it.current()) != 0 ) { - ++it; + if ( !children().empty() ) { + const QObjectList c = children(); + for(QObjectList::const_iterator i=c.begin();i!=c.end();++i) { + QObject * o = *i; if ( o->isWidgetType() && @@ -1286,3 +1300,3 @@ QSize KDGanttMinimizeSplitter::sizeHint() const } - return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); + return orientation() == Qt::Horizontal ? QSize( l, t ) : QSize( t, l ); } @@ -1299,9 +1313,6 @@ QSize KDGanttMinimizeSplitter::minimumSizeHint() const int t = 0; - if ( children() ) { - const QObjectList * c = children(); - QObjectListIt it( *c ); - QObject * o; - - while( (o=it.current()) != 0 ) { - ++it; + if ( !children().empty() ) { + const QObjectList c = children(); + for(QObjectList::const_iterator i=c.begin();i!=c.end();++i) { + QObject * o = *i; if ( o->isWidgetType() && @@ -1316,3 +1327,3 @@ QSize KDGanttMinimizeSplitter::minimumSizeHint() const } - return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); + return orientation() == Qt::Horizontal ? QSize( l, t ) : QSize( t, l ); } @@ -1404,4 +1415,5 @@ bool KDGanttMinimizeSplitter::isHidden( QWidget *w ) const -QValueList<int> KDGanttMinimizeSplitter::sizes() const +Q3ValueList<int> KDGanttMinimizeSplitter::sizes() const { + /* TODO: hacker if ( !testWState(WState_Polished) ) { @@ -1409,4 +1421,4 @@ QValueList<int> KDGanttMinimizeSplitter::sizes() const that->polish(); - } - QValueList<int> list; + } */ + Q3ValueList<int> list; QSplitterLayoutStruct *s = data->list.first(); @@ -1435,6 +1447,6 @@ QValueList<int> KDGanttMinimizeSplitter::sizes() const -void KDGanttMinimizeSplitter::setSizes( QValueList<int> list ) +void KDGanttMinimizeSplitter::setSizes( Q3ValueList<int> list ) { processChildEvents(); - QValueList<int>::Iterator it = list.begin(); + Q3ValueList<int>::Iterator it = list.begin(); QSplitterLayoutStruct *s = data->list.first(); @@ -1458,3 +1470,3 @@ void KDGanttMinimizeSplitter::processChildEvents() { - QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + QApplication::sendPostedEvents( this, QEvent::ChildAdded ); } @@ -1470,3 +1482,3 @@ void KDGanttMinimizeSplitter::styleChange( QStyle& old ) #if QT_VERSION >= 0x030000 - int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); + int sw = style()->pixelMetric(QStyle::PM_SplitterWidth, 0, this); #else @@ -1481,3 +1493,3 @@ void KDGanttMinimizeSplitter::styleChange( QStyle& old ) doResize(); - QFrame::styleChange( old ); + Q3Frame::styleChange( old ); } @@ -1514,3 +1526,3 @@ static inline int fRound( int i ) { } -void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, +void kdganttGeomCalc( Q3MemArray<QLayoutStruct> &chain, int start, int count, int pos, int space, int spacer ) diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h index 3042e0a..338d965 100644 --- a/microkde/KDGanttMinimizeSplitter.h +++ b/microkde/KDGanttMinimizeSplitter.h @@ -1 +1,8 @@ +//Added by qt3to4: +#include <Q3PointArray> +#include <QPaintEvent> +#include <QResizeEvent> +#include <QChildEvent> +#include <QMouseEvent> +#include <QEvent> /* -*- Mode: C++ -*- @@ -37,4 +44,4 @@ #ifndef QT_H -#include "qframe.h" -#include "qvaluelist.h" +#include "q3frame.h" +#include "q3valuelist.h" #endif // QT_H @@ -46,3 +53,3 @@ class KDGanttSplitterHandle; class KDRubberBand; -class KDGanttMinimizeSplitter : public QFrame +class KDGanttMinimizeSplitter : public Q3Frame { @@ -58,7 +65,7 @@ public: KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 ); - KDGanttMinimizeSplitter( Orientation, QWidget* parent=0, const char* name=0 ); + KDGanttMinimizeSplitter( Qt::Orientation, QWidget* parent=0, const char* name=0 ); ~KDGanttMinimizeSplitter(); - virtual void setOrientation( Orientation ); - Orientation orientation() const { return orient; } + virtual void setOrientation( Qt::Orientation ); + Qt::Orientation orientation() const { return orient; } @@ -79,4 +86,4 @@ public: - QValueList<int> sizes() const; - void setSizes( QValueList<int> ); + Q3ValueList<int> sizes() const; + void setSizes( Q3ValueList<int> ); KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} @@ -116,10 +123,10 @@ private: QCOORD pick( const QPoint &p ) const - { return orient == Horizontal ? p.x() : p.y(); } + { return orient == Qt::Horizontal ? p.x() : p.y(); } QCOORD pick( const QSize &s ) const - { return orient == Horizontal ? s.width() : s.height(); } + { return orient == Qt::Horizontal ? s.width() : s.height(); } QCOORD trans( const QPoint &p ) const - { return orient == Vertical ? p.x() : p.y(); } + { return orient == Qt::Vertical ? p.x() : p.y(); } QCOORD trans( const QSize &s ) const - { return orient == Vertical ? s.width() : s.height(); } + { return orient == Qt::Vertical ? s.width() : s.height(); } KDGanttSplitterHandle* mFirstHandle; @@ -129,3 +136,3 @@ private: private: - Orientation orient; + Qt::Orientation orient; Direction _direction; @@ -165,3 +172,3 @@ public: protected: - QValueList<QPointArray> buttonRegions(); + Q3ValueList<Q3PointArray> buttonRegions(); void paintEvent( QPaintEvent * ); diff --git a/microkde/fncolordialog.h b/microkde/fncolordialog.h index 615d2ed..52356be 100755 --- a/microkde/fncolordialog.h +++ b/microkde/fncolordialog.h @@ -37,3 +37,3 @@ //-----------------------------------------------------------------------------
-class Q_EXPORT FNPaletteBase : public QWidget
+class /* Q_EXPORT */ FNPaletteBase : public QWidget
{
@@ -42,3 +42,3 @@ public: - FNPaletteBase(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ FNPaletteBase(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
@@ -80,3 +80,3 @@ signals: //-----------------------------------------------------------------------------
-class Q_EXPORT FNColorPalette : public FNPaletteBase
+class /* Q_EXPORT */ FNColorPalette : public FNPaletteBase
{
@@ -84,3 +84,3 @@ class Q_EXPORT FNColorPalette : public FNPaletteBase public:
- FNColorPalette(QColor c, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ FNColorPalette(QColor c, QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
virtual ~FNColorPalette();
@@ -94,3 +94,3 @@ public: //-----------------------------------------------------------------------------
-class Q_EXPORT FNHSVPalette : public FNPaletteBase
+class /*Q_EXPORT */ FNHSVPalette : public FNPaletteBase
{
@@ -98,3 +98,3 @@ class Q_EXPORT FNHSVPalette : public FNPaletteBase public:
- FNHSVPalette(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ FNHSVPalette(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
virtual ~FNHSVPalette();
@@ -113,3 +113,3 @@ protected: //-----------------------------------------------------------------------------
-class Q_EXPORT FNColorDialog : public QDialog
+class /*Q_EXPORT */FNColorDialog : public QDialog
{
@@ -117,3 +117,3 @@ class Q_EXPORT FNColorDialog : public QDialog public:
- FNColorDialog(QWidget* parent=0, const char* name=0, WFlags f=0);
+ FNColorDialog(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
virtual ~FNColorDialog();
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index d7c12bb..b058d54 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp @@ -8,7 +8,10 @@ #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qdialog.h> #include <qlayout.h> -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qregexp.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3VBoxLayout> @@ -77,6 +80,6 @@ void KApplication::showFile(QString caption, QString fn) QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return ; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); text = ts.read(); @@ -91,3 +94,3 @@ bool KApplication::convert2latin1(QString fileName) QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; @@ -95,11 +98,11 @@ bool KApplication::convert2latin1(QString fileName) } - QTextStream ts( &file ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream ts( &file ); + ts.setEncoding( Q3TextStream::UnicodeUTF8 ); text = ts.read(); file.close(); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream tsIn( &file ); - tsIn.setEncoding( QTextStream::Latin1 ); + Q3TextStream tsIn( &file ); + tsIn.setEncoding( Q3TextStream::Latin1 ); tsIn << text.latin1(); @@ -114,3 +117,3 @@ void KApplication::showText(QString caption, QString text) dia.setCaption( caption ); - QVBoxLayout* lay = new QVBoxLayout( &dia ); + Q3VBoxLayout* lay = new Q3VBoxLayout( &dia ); lay->setSpacing( 3 ); @@ -118,3 +121,3 @@ void KApplication::showText(QString caption, QString text) KTextEdit tb ( &dia ); - tb.setWordWrap( QMultiLineEdit::WidgetWidth ); + tb.setWordWrap( Q3MultiLineEdit::WidgetWidth ); lay->addWidget( &tb ); @@ -135,3 +138,3 @@ void KApplication::showText(QString caption, QString text) #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include "kglobal.h" @@ -146,3 +149,3 @@ class KBackupPrefs : public QDialog setCaption( i18n("Backup Failed!") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); @@ -151,3 +154,3 @@ class KBackupPrefs : public QDialog lay->addWidget( lab ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Choose action"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Choose action"), this ); lay->addWidget( format ); diff --git a/microkde/kcolorbutton.cpp b/microkde/kcolorbutton.cpp index 197bea2..16618fc 100644 --- a/microkde/kcolorbutton.cpp +++ b/microkde/kcolorbutton.cpp @@ -3,2 +3,3 @@ #include "qapplication.h" +#include <QDesktopWidget> @@ -8,2 +9,4 @@ #include <qcolordialog.h> +//Added by qt3to4: +#include <QPixmap> #endif diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp index 940196e..12063ca 100644 --- a/microkde/kconfig.cpp +++ b/microkde/kconfig.cpp @@ -1,4 +1,6 @@ #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qwidget.h> +//Added by qt3to4: +#include <Q3ValueList> @@ -55,3 +57,3 @@ QString KConfig::group() const { //US added method -QValueList<int> KConfig::readIntListEntry( const QString & key) +Q3ValueList<int> KConfig::readIntListEntry( const QString & key) { @@ -59,3 +61,3 @@ QValueList<int> KConfig::readIntListEntry( const QString & key) - QValueList<int> result; + Q3ValueList<int> result; @@ -113,3 +115,3 @@ QSize KConfig::readSizeEntry( const QString &key, QSize* def ) { - QValueList<int> intlist = readIntListEntry(key); + Q3ValueList<int> intlist = readIntListEntry(key); @@ -196,3 +198,3 @@ QDateTime KConfig::readDateTimeEntry( const QString &key, const QDateTime *def ) //US added method -void KConfig::writeEntry( const QString &key, const QValueList<int> &value) +void KConfig::writeEntry( const QString &key, const Q3ValueList<int> &value) { @@ -200,3 +202,3 @@ void KConfig::writeEntry( const QString &key, const QValueList<int> &value) - QValueList<int>::ConstIterator it; + Q3ValueList<int>::ConstIterator it; @@ -248,3 +250,3 @@ void KConfig::writeEntry( const QString & e, const QSize & s ) { - QValueList<int> intlist; + Q3ValueList<int> intlist; intlist << s.width() << s.height(); @@ -273,3 +275,3 @@ void KConfig::load() QFile f( mFileName ); - if ( !f.open( IO_ReadOnly ) ) { + if ( !f.open( QIODevice::ReadOnly ) ) { //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); @@ -281,4 +283,4 @@ void KConfig::load() - QTextStream t( &f ); - t.setEncoding( QTextStream::Latin1 ); + Q3TextStream t( &f ); + t.setEncoding( Q3TextStream::Latin1 ); QString line = t.readLine(); @@ -286,3 +288,3 @@ void KConfig::load() while ( !line.isNull() ) { - QStringList tokens = QStringList::split( ",", line ); + QStringList tokens = line.split(','); if ( tokens[0] == "bool" ) { @@ -325,3 +327,3 @@ void KConfig::sync() QFile f( mFileName ); - if ( !f.open( IO_WriteOnly ) ) { + if ( !f.open( QIODevice::WriteOnly ) ) { @@ -332,4 +334,4 @@ void KConfig::sync() - QTextStream t( &f ); - t.setEncoding( QTextStream::Latin1 ); + Q3TextStream t( &f ); + t.setEncoding( Q3TextStream::Latin1 ); QMap<QString,bool>::ConstIterator itBool; diff --git a/microkde/kconfig.h b/microkde/kconfig.h index 1a1038f..7b91e44 100644 --- a/microkde/kconfig.h +++ b/microkde/kconfig.h @@ -5,3 +5,3 @@ #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qcolor.h> @@ -59,3 +59,3 @@ class KConfig //US added method readIntListEntry - QValueList<int> readIntListEntry( const QString &); + Q3ValueList<int> readIntListEntry( const QString &); @@ -71,3 +71,3 @@ class KConfig - void writeEntry( const QString &, const QValueList<int>& ); + void writeEntry( const QString &, const Q3ValueList<int>& ); void writeEntry( const QString &, int ); diff --git a/microkde/kdatepickernew.cpp b/microkde/kdatepickernew.cpp index f60a422..8f8001e 100644 --- a/microkde/kdatepickernew.cpp +++ b/microkde/kdatepickernew.cpp @@ -315,3 +315,3 @@ KDatePicker::selectMonthClicked() - QPopupMenu popup(selectMonth); + Q3PopupMenu popup(selectMonth); diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index 353f78d..10dc449 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp @@ -46,2 +46,10 @@ #include <qdialog.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QResizeEvent> +#include <QFocusEvent> +#include <Q3Frame> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QEvent> #include <assert.h> @@ -71,3 +79,3 @@ KDateValidator::date(const QString& text, QDate& d) const } else - return Valid; + return QValidator::Intermediate; } @@ -80,4 +88,4 @@ KDateValidator::fixup( QString& ) const -KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) - : QGridView(parent, name, f) +KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, Qt::WFlags f) + : Q3GridView(parent, name, f) { @@ -88,3 +96,3 @@ KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) } - setFocusPolicy( QWidget::StrongFocus ); + setFocusPolicy( Qt::StrongFocus ); setNumRows(7); // 6 weeks max + headline @@ -95,3 +103,3 @@ KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) #if 0 - viewport()->setEraseColor(lightGray); + viewport()->setEraseColor(Qt::lightGray); #endif @@ -110,3 +118,3 @@ KDateTable::paintCell(QPainter *painter, int row, int col) int pos; - QBrush brushBlue(blue); + QBrush brushBlue(Qt::blue); QBrush brushLightblue(QColor(220,245,255)); @@ -135,14 +143,13 @@ KDateTable::paintCell(QPainter *painter, int row, int col) painter->drawRect(0, 0, w, h); - painter->setPen(blue); + painter->setPen(Qt::blue); } else { - painter->setPen(blue); + painter->setPen(Qt::blue); painter->setBrush(brushBlue); painter->drawRect(0, 0, w, h); - painter->setPen(white); + painter->setPen(Qt::white); } - painter->drawText(0, 0, w, h-1, AlignCenter, + painter->drawText(0, 0, w, h-1, Qt::AlignCenter, daystr, -1, &rect); - painter->setPen(black); - painter->moveTo(0, h-1); - painter->lineTo(w-1, h-1); + painter->setPen(Qt::black); + painter->drawLine(0, h-1, w-1, h-1); // ----- draw the weekday: @@ -163,6 +170,6 @@ KDateTable::paintCell(QPainter *painter, int row, int col) } - painter->setPen(gray); + painter->setPen(Qt::gray); } else { // paint a day of the current month text.setNum(pos-firstday+1); - painter->setPen(black); + painter->setPen(Qt::black); } @@ -173,12 +180,12 @@ KDateTable::paintCell(QPainter *painter, int row, int col) if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) - painter->setPen(green); + painter->setPen(Qt::green); else - painter->setPen(red); + painter->setPen(Qt::red); if(hasFocus()) { - painter->setBrush(darkRed); - pen=white; + painter->setBrush(Qt::darkRed); + pen=QColor(Qt::white); } else { - painter->setBrush(darkGray); - pen=white; + painter->setBrush(Qt::darkGray); + pen=QColor(Qt::white); } @@ -187,5 +194,5 @@ KDateTable::paintCell(QPainter *painter, int row, int col) { - painter->setPen(green); - painter->setBrush(darkGreen); - pen=white; + painter->setPen(Qt::green); + painter->setBrush(Qt::darkGreen); + pen=QColor(Qt::white); } else { @@ -197,3 +204,3 @@ KDateTable::paintCell(QPainter *painter, int row, int col) painter->setPen(pen); - painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect); + painter->drawText(0, 0, w, h, Qt::AlignCenter, text, -1, &rect); } @@ -276,3 +283,3 @@ KDateTable::viewportResizeEvent(QResizeEvent * e) { - QGridView::viewportResizeEvent(e); + Q3GridView::viewportResizeEvent(e); @@ -411,3 +418,3 @@ void KDateTable::focusInEvent( QFocusEvent *e ) repaintContents(false); - QGridView::focusInEvent( e ); + Q3GridView::focusInEvent( e ); } @@ -417,3 +424,3 @@ void KDateTable::focusOutEvent( QFocusEvent *e ) repaintContents(false); - QGridView::focusOutEvent( e ); + Q3GridView::focusOutEvent( e ); } @@ -434,3 +441,3 @@ KDateInternalMonthPicker::KDateInternalMonthPicker (QWidget* parent, const char* name) - : QGridView(parent, name), + : Q3GridView(parent, name), result(0) // invalid @@ -453,3 +460,3 @@ KDateInternalMonthPicker::KDateInternalMonthPicker setVScrollBarMode(AlwaysOff); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); setNumRows(4); @@ -459,3 +466,3 @@ KDateInternalMonthPicker::KDateInternalMonthPicker #if 0 - viewport()->setEraseColor(lightGray); // for consistency with the datepicker + viewport()->setEraseColor(Qt::lightGray); // for consistency with the datepicker #endif @@ -489,3 +496,3 @@ KDateInternalMonthPicker::setupPainter(QPainter *p) { - p->setPen(black); + p->setPen(Qt::black); } @@ -507,3 +514,3 @@ KDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) text=KGlobal::locale()->monthName(index, false); - painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); + painter->drawText(0, 0, cellWidth(), cellHeight(), Qt::AlignCenter, text); if ( activeCol == col && activeRow == row ) @@ -515,3 +522,3 @@ KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) { - if(!isEnabled() || e->button() != LeftButton) + if(!isEnabled() || e->button() != Qt::LeftButton) { @@ -542,3 +549,3 @@ KDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) { - if (e->state() & LeftButton) + if (e->state() & Qt::LeftButton) { @@ -616,3 +623,3 @@ KDateInternalYearSelector::KDateInternalYearSelector #if 0 - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); #endif @@ -663,3 +670,3 @@ KDateInternalYearSelector::setYear(int year) KPopupFrame::KPopupFrame(QWidget* parent, const char* name) - : QFrame(parent, name, WType_Popup), + : Q3Frame(parent, name, Qt::WType_Popup), result(0), // rejected @@ -667,3 +674,3 @@ KPopupFrame::KPopupFrame(QWidget* parent, const char* name) { - setFrameStyle(QFrame::Box|QFrame::Raised); + setFrameStyle(Q3Frame::Box|Q3Frame::Raised); setMidLineWidth(2); @@ -674,3 +681,3 @@ KPopupFrame::keyPressEvent(QKeyEvent* e) { - if(e->key()==Key_Escape) + if(e->key()==Qt::Key_Escape) { @@ -758,3 +765,3 @@ KDateInternalWeekPicker::KDateInternalWeekPicker (QWidget* parent, const char* name) - : QGridView(parent, name), + : Q3GridView(parent, name), result(0) // invalid @@ -775,3 +782,3 @@ KDateInternalWeekPicker::KDateInternalWeekPicker setVScrollBarMode(AlwaysOff); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); if ( QApplication::desktop()->height() > 240 ) { @@ -786,3 +793,3 @@ KDateInternalWeekPicker::KDateInternalWeekPicker #if 0 - viewport()->setEraseColor(lightGray); // for consistency with the datepicker + viewport()->setEraseColor(Qt::lightGray); // for consistency with the datepicker #endif @@ -820,3 +827,3 @@ KDateInternalWeekPicker::setupPainter(QPainter *p) { - p->setPen(black); + p->setPen(Qt::black); } @@ -838,3 +845,3 @@ KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col) text=QString::number( index ); - painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); + painter->drawText(0, 0, cellWidth(), cellHeight(), Qt::AlignCenter, text); if ( activeCol == col && activeRow == row ) @@ -846,3 +853,3 @@ KDateInternalWeekPicker::contentsMousePressEvent(QMouseEvent *e) { - if(!isEnabled() || e->button() != LeftButton) + if(!isEnabled() || e->button() != Qt::LeftButton) { @@ -873,3 +880,3 @@ KDateInternalWeekPicker::contentsMouseMoveEvent(QMouseEvent *e) { - if (e->state() & LeftButton) + if (e->state() & Qt::LeftButton) { diff --git a/microkde/kdatetbl.h b/microkde/kdatetbl.h index 87808df..2d3d2cf 100644 --- a/microkde/kdatetbl.h +++ b/microkde/kdatetbl.h @@ -23,5 +23,11 @@ #include <qvalidator.h> -#include <qgridview.h> +#include <q3gridview.h> #include <qlineedit.h> #include <qdatetime.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QMouseEvent> +#include <Q3Frame> +#include <QKeyEvent> +#include <QFocusEvent> @@ -33,3 +39,3 @@ */ -class KDateInternalMonthPicker : public QGridView +class KDateInternalMonthPicker : public Q3GridView { @@ -129,3 +135,3 @@ private: */ -class KPopupFrame : public QFrame +class KPopupFrame : public Q3Frame { @@ -184,3 +190,3 @@ private: - virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); } + virtual bool close(bool alsoDelete) { return Q3Frame::close(alsoDelete); } protected: @@ -217,3 +223,3 @@ public: */ -class KDateTable : public QGridView +class KDateTable : public Q3GridView { @@ -226,3 +232,3 @@ public: QDate date=QDate::currentDate(), - const char* name=0, WFlags f=0); + const char* name=0, Qt::WFlags f=0); /** @@ -309,3 +315,3 @@ private: #endif // KDATETBL_H -class KDateInternalWeekPicker : public QGridView +class KDateInternalWeekPicker : public Q3GridView { diff --git a/microkde/kdebug.h b/microkde/kdebug.h index bb9cfe3..534943c 100644 --- a/microkde/kdebug.h +++ b/microkde/kdebug.h @@ -6,2 +6,4 @@ #include <qstring.h> +//Added by qt3to4: +#include <Q3CString> @@ -66,3 +68,3 @@ class kdbgstream { } - kdbgstream &operator<<(const QCString&) { + kdbgstream &operator<<(const Q3CString&) { return *this; diff --git a/microkde/kdecore/kcatalogue.cpp b/microkde/kdecore/kcatalogue.cpp index 97ac326..1600b08 100644 --- a/microkde/kdecore/kcatalogue.cpp +++ b/microkde/kdecore/kcatalogue.cpp @@ -22,2 +22,4 @@ #include <qfile.h> +//Added by qt3to4: +#include <Q3CString> @@ -90,3 +92,3 @@ void KCatalogue::setFileName( const QString & fileName ) - QCString newFileName = QFile::encodeName( fileName ); + Q3CString newFileName = QFile::encodeName( fileName ); diff --git a/microkde/kdecore/kconfigbase.h b/microkde/kdecore/kconfigbase.h index 7e56d11..1ef6a04 100644 --- a/microkde/kdecore/kconfigbase.h +++ b/microkde/kdecore/kconfigbase.h @@ -28,2 +28,4 @@ #include "kconfig.h" +//Added by qt3to4: +#include <Q3CString> @@ -84,3 +86,3 @@ public: - KConfigGroupSaver( KConfig* config, const QCString &group ) + KConfigGroupSaver( KConfig* config, const Q3CString &group ) : _config(config), _oldgroup(config->group()) diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp index 6d0475a..0b54eb6 100644 --- a/microkde/kdecore/klibloader.cpp +++ b/microkde/kdecore/klibloader.cpp @@ -22,5 +22,8 @@ #include <qtimer.h> -#include <qobjectdict.h> -#include <qwidgetlist.h> +#include <q3objectdict.h> #include <qwidget.h> +#include <qwidget.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3PtrList> @@ -47,3 +50,3 @@ -template class QAsciiDict<KLibrary>; +template class Q3AsciiDict<KLibrary>; @@ -122,3 +125,3 @@ KLibrary::~KLibrary() { - QPtrListIterator<QObject> it( m_objs ); + Q3PtrListIterator<QObject> it( m_objs ); for ( ; it.current() ; ++it ) @@ -154,3 +157,3 @@ KLibFactory* KLibrary::factory() - QCString symname; + Q3CString symname; symname.sprintf("init_%s", name().latin1() ); @@ -307,4 +310,4 @@ class KLibLoaderPrivate public: - QPtrList<KLibWrapPrivate> loaded_stack; - QPtrList<KLibWrapPrivate> pending_close; + Q3PtrList<KLibWrapPrivate> loaded_stack; + Q3PtrList<KLibWrapPrivate> pending_close; enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode; @@ -350,3 +353,3 @@ KLibLoader::~KLibLoader() - QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); + Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs ); for (; it.current(); ++it ) @@ -366,3 +369,3 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta { - QCString libname( name ); + Q3CString libname( name ); @@ -423,3 +426,3 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl; - self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname); + self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(QString(libname)); @@ -471,3 +474,3 @@ KLibrary* KLibLoader::library( const char *name ) unloaded meanwhile, whithout being dlclose()'ed. */ - QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack); + Q3PtrListIterator<KLibWrapPrivate> it(d->loaded_stack); for (; it.current(); ++it) { @@ -552,3 +555,3 @@ void KLibLoader::slotLibraryDestroyed() - QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); + Q3AsciiDictIterator<KLibWrapPrivate> it( m_libs ); for (; it.current(); ++it ) @@ -571,3 +574,3 @@ void KLibLoader::close_pending(KLibWrapPrivate *wrap) the DSO behind it. */ - QPtrListIterator<KLibWrapPrivate> it(d->pending_close); + Q3PtrListIterator<KLibWrapPrivate> it(d->pending_close); for (; it.current(); ++it) { diff --git a/microkde/kdecore/klibloader.h b/microkde/kdecore/klibloader.h index ed57109..53d146e 100644 --- a/microkde/kdecore/klibloader.h +++ b/microkde/kdecore/klibloader.h @@ -23,4 +23,4 @@ #include <qstringlist.h> -#include <qasciidict.h> -#include <qptrlist.h> +#include <q3asciidict.h> +#include <q3ptrlist.h> #include <kglobal.h> @@ -54,3 +54,3 @@ class KLibrary : public QObject friend class KLibLoader; - friend class QAsciiDict<KLibrary>; + friend class Q3AsciiDict<KLibrary>; @@ -129,3 +129,3 @@ private: QLibrary* m_handle; - QPtrList<QObject> m_objs; + Q3PtrList<QObject> m_objs; QTimer *m_timer; @@ -289,3 +289,3 @@ private: void close_pending( KLibWrapPrivate * ); - QAsciiDict<KLibWrapPrivate> m_libs; + Q3AsciiDict<KLibWrapPrivate> m_libs; diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp index 1d8ae9f..dd310fa 100644 --- a/microkde/kdecore/klocale.cpp +++ b/microkde/kdecore/klocale.cpp @@ -2,2 +2,3 @@ #include <qapplication.h> +#include <QDesktopWidget> @@ -13,4 +14,4 @@ -QDict<QString> *mLocaleDict = 0; -void setLocaleDict( QDict<QString> * dict ) +Q3Dict<QString> *mLocaleDict = 0; +void setLocaleDict( Q3Dict<QString> * dict ) { @@ -47,3 +48,3 @@ void addExist(const char *text,QString trans ) #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> @@ -55,6 +56,6 @@ void dumpMissing() QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return ; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); @@ -72,6 +73,6 @@ void dumpMissing() QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return ; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); @@ -469,3 +470,3 @@ QString KLocale::formatDateTime(const QDateTime &pDateTime, format = "%1 %2"; - else if ( intIntDateFormat == ISODate ) + else if ( intIntDateFormat == Qt::ISODate ) format = "%1T%2"; @@ -529,3 +530,3 @@ QDate KLocale::readDate(const QString &intstr, const QString &fmt, bool* ok) con c = fmt.at(fmtpos++); - switch (c) + switch (c.unicode()) { @@ -640,3 +641,3 @@ QTime KLocale::readTime(const QString &intstr, bool seconds, bool *ok) const c = Format.at(Formatpos++); - switch (c) + switch (c.unicode()) { @@ -736,3 +737,3 @@ QDateTime KLocale::readDateTime(const QString &intstr, QDate m_date = readDate(date, dformat, &ok1); - QTime m_time = readTime(time, tformat, &ok2); + QTime m_time = readTime(time, !tformat.isEmpty(), &ok2); diff --git a/microkde/kdecore/klocale.h b/microkde/kdecore/klocale.h index 58e0b39..840fc9d 100644 --- a/microkde/kdecore/klocale.h +++ b/microkde/kdecore/klocale.h @@ -6,3 +6,3 @@ #include <qdatetime.h> -#include <qdict.h> +#include <q3dict.h> @@ -13,3 +13,3 @@ class KCalendarSystem; -void setLocaleDict( QDict<QString> * dict ); +void setLocaleDict( Q3Dict<QString> * dict ); QString i18n(const char *text); diff --git a/microkde/kdecore/kmdcodec.cpp b/microkde/kdecore/kmdcodec.cpp index bc03569..db11e52 100644 --- a/microkde/kdecore/kmdcodec.cpp +++ b/microkde/kdecore/kmdcodec.cpp @@ -41,2 +41,4 @@ #include "kmdcodec.h" +//Added by qt3to4: +#include <Q3CString> @@ -149,3 +151,3 @@ static int rikFindChar(register const char * _s, const char c) -QCString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF) +Q3CString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF) { @@ -153,6 +155,6 @@ QCString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF) quotedPrintableEncode (in, out, useCRLF); - return QCString (out.data(), out.size()+1); + return Q3CString (out.data(), out.size()+1); } -QCString KCodecs::quotedPrintableEncode(const QCString& str, bool useCRLF) +Q3CString KCodecs::quotedPrintableEncode(const Q3CString& str, bool useCRLF) { @@ -282,3 +284,3 @@ void KCodecs::quotedPrintableEncode(const QByteArray& in, QByteArray& out, bool -QCString KCodecs::quotedPrintableDecode(const QByteArray & in) +Q3CString KCodecs::quotedPrintableDecode(const QByteArray & in) { @@ -286,6 +288,6 @@ QCString KCodecs::quotedPrintableDecode(const QByteArray & in) quotedPrintableDecode (in, out); - return QCString (out.data(), out.size()+1); + return Q3CString (out.data(), out.size()+1); } -QCString KCodecs::quotedPrintableDecode(const QCString & str) +Q3CString KCodecs::quotedPrintableDecode(const Q3CString & str) { @@ -357,3 +359,3 @@ void KCodecs::quotedPrintableDecode(const QByteArray& in, QByteArray& out) -QCString KCodecs::base64Encode( const QCString& str, bool insertLFs ) +Q3CString KCodecs::base64Encode( const Q3CString& str, bool insertLFs ) { @@ -367,3 +369,3 @@ QCString KCodecs::base64Encode( const QCString& str, bool insertLFs ) -QCString KCodecs::base64Encode( const QByteArray& in, bool insertLFs ) +Q3CString KCodecs::base64Encode( const QByteArray& in, bool insertLFs ) { @@ -371,3 +373,3 @@ QCString KCodecs::base64Encode( const QByteArray& in, bool insertLFs ) base64Encode( in, out, insertLFs ); - return QCString( out.data(), out.size()+1 ); + return Q3CString( out.data(), out.size()+1 ); } @@ -407,11 +409,11 @@ void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, if ( count && (count%76) == 0 ) - out.at(didx++) = '\n'; + out[didx++] = '\n'; count += 4; } - out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077]; + out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = Base64EncMap[(data[sidx+2] >> 6) & 003 | + out[didx++] = Base64EncMap[(data[sidx+2] >> 6) & 003 | (data[sidx+1] << 2) & 077]; - out.at(didx++) = Base64EncMap[data[sidx+2] & 077]; + out[didx++] = Base64EncMap[data[sidx+2] & 077]; sidx += 3; @@ -423,10 +425,10 @@ void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, if ( insertLFs && (count > 0) && (count%76) == 0 ) - out.at(didx++) = '\n'; + out[didx++] = '\n'; - out.at(didx++) = Base64EncMap[(data[sidx] >> 2) & 077]; + out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077]; if (sidx < len-1) { - out.at(didx++) = Base64EncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = Base64EncMap[(data[sidx+1] << 2) & 077]; + out[didx++] = Base64EncMap[(data[sidx+1] << 2) & 077]; } @@ -434,3 +436,3 @@ void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, { - out.at(didx++) = Base64EncMap[(data[sidx] << 4) & 077]; + out[didx++] = Base64EncMap[(data[sidx] << 4) & 077]; } @@ -440,9 +442,6 @@ void KCodecs::base64Encode( const QByteArray& in, QByteArray& out, while (didx < out.size()) - { - out.at(didx) = '='; - didx++; - } + out[didx++] = '='; } -QCString KCodecs::base64Decode( const QCString& str ) +Q3CString KCodecs::base64Decode( const Q3CString& str ) { @@ -456,3 +455,3 @@ QCString KCodecs::base64Decode( const QCString& str ) -QCString KCodecs::base64Decode( const QByteArray& in ) +Q3CString KCodecs::base64Decode( const QByteArray& in ) { @@ -460,3 +459,3 @@ QCString KCodecs::base64Decode( const QByteArray& in ) base64Decode( in, out ); - return QCString( out.data(), out.size()+1 ); + return Q3CString( out.data(), out.size()+1 ); } @@ -507,3 +506,3 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) { - out.at(outIdx++) = Base64DecMap[ch]; + out[outIdx++] = Base64DecMap[ch]; } @@ -525,5 +524,5 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) { - out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003)); - out.at(didx+1) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017)); - out.at(didx+2) = (((out.at(sidx+2) << 6) & 255) | (out.at(sidx+3) & 077)); + out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003)); + out[didx+1] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017)); + out[didx+2] = (((out[sidx+2] << 6) & 255) | (out[sidx+3] & 077)); sidx += 4; @@ -534,6 +533,6 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) if (didx < len) - out.at(didx) = (((out.at(sidx) << 2) & 255) | ((out.at(sidx+1) >> 4) & 003)); + out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003)); if (++didx < len ) - out.at(didx) = (((out.at(sidx+1) << 4) & 255) | ((out.at(sidx+2) >> 2) & 017)); + out[didx] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017)); @@ -544,3 +543,3 @@ void KCodecs::base64Decode( const QByteArray& in, QByteArray& out ) -QCString KCodecs::uuencode( const QCString& str ) +Q3CString KCodecs::uuencode( const Q3CString& str ) { @@ -555,3 +554,3 @@ QCString KCodecs::uuencode( const QCString& str ) -QCString KCodecs::uuencode( const QByteArray& in ) +Q3CString KCodecs::uuencode( const QByteArray& in ) { @@ -559,3 +558,3 @@ QCString KCodecs::uuencode( const QByteArray& in ) uuencode( in, out ); - return QCString( out.data(), out.size()+1 ); + return Q3CString( out.data(), out.size()+1 ); } @@ -582,3 +581,3 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) // line length - out.at(didx++) = UUEncMap[line_len]; + out[didx++] = UUEncMap[line_len]; @@ -587,8 +586,8 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) { - out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; + out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 | + out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 | (data[sidx+1] << 2) & 077]; - out.at(didx++) = UUEncMap[data[sidx+2] & 077]; + out[didx++] = UUEncMap[data[sidx+2] & 077]; } @@ -597,3 +596,3 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) //for (unsigned int idx=0; idx < nl_len; idx++) - //out.at(didx++) = nl[idx]; + //out[didx++] = nl[idx]; memcpy(out.data()+didx, nl, nl_len); @@ -603,3 +602,3 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) // line length - out.at(didx++) = UUEncMap[len-sidx]; + out[didx++] = UUEncMap[len-sidx]; // 3-byte to 4-byte conversion + 0-63 to ascii printable conversion @@ -607,8 +606,8 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) { - out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; + out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+2] >> 6) & 003 | + out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 | (data[sidx+1] << 2) & 077]; - out.at(didx++) = UUEncMap[data[sidx+2] & 077]; + out[didx++] = UUEncMap[data[sidx+2] & 077]; sidx += 3; @@ -618,7 +617,7 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) { - out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+1] >> 4) & 017 | + out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; + out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 | (data[sidx] << 4) & 077]; - out.at(didx++) = UUEncMap[(data[sidx+1] << 2) & 077]; - out.at(didx++) = UUEncMap[0]; + out[didx++] = UUEncMap[(data[sidx+1] << 2) & 077]; + out[didx++] = UUEncMap[0]; } @@ -626,6 +625,6 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) { - out.at(didx++) = UUEncMap[(data[sidx] >> 2) & 077]; - out.at(didx++) = UUEncMap[(data[sidx] << 4) & 077]; - out.at(didx++) = UUEncMap[0]; - out.at(didx++) = UUEncMap[0]; + out[didx++] = UUEncMap[(data[sidx] >> 2) & 077]; + out[didx++] = UUEncMap[(data[sidx] << 4) & 077]; + out[didx++] = UUEncMap[0]; + out[didx++] = UUEncMap[0]; } @@ -641,3 +640,3 @@ void KCodecs::uuencode( const QByteArray& in, QByteArray& out ) -QCString KCodecs::uudecode( const QCString& str ) +Q3CString KCodecs::uudecode( const Q3CString& str ) { @@ -652,3 +651,3 @@ QCString KCodecs::uudecode( const QCString& str ) -QCString KCodecs::uudecode( const QByteArray& in ) +Q3CString KCodecs::uudecode( const QByteArray& in ) { @@ -656,3 +655,3 @@ QCString KCodecs::uudecode( const QByteArray& in ) uudecode( in, out ); - return QCString( out.data(), out.size()+1 ); + return Q3CString( out.data(), out.size()+1 ); } @@ -707,5 +706,5 @@ void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) D = UUDecMap[(unsigned char) data[sidx+3]]; - out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) ); - out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) ); - out.at(didx++) = ( ((C << 6) & 255) | (D & 077) ); + out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) ); + out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) ); + out[didx++] = ( ((C << 6) & 255) | (D & 077) ); sidx += 4; @@ -718,3 +717,3 @@ void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) B = UUDecMap[(unsigned char) data[sidx+1]]; - out.at(didx++) = ( ((A << 2) & 255) | ((B >> 4) & 003) ); + out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) ); } @@ -725,3 +724,3 @@ void KCodecs::uudecode( const QByteArray& in, QByteArray& out ) C = UUDecMap[(unsigned char) data[sidx+2]]; - out.at(didx++) = ( ((B << 4) & 255) | ((C >> 2) & 017) ); + out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) ); } @@ -763,3 +762,3 @@ KMD5::KMD5(const QByteArray& in) -KMD5::KMD5(const QCString& in) +KMD5::KMD5(const Q3CString& in) { @@ -774,3 +773,3 @@ void KMD5::update(const QByteArray& in) -void KMD5::update(const QCString& in) +void KMD5::update(const Q3CString& in) { @@ -875,3 +874,3 @@ bool KMD5::verify( const KMD5::Digest& digest) -bool KMD5::verify( const QCString& hexdigest) +bool KMD5::verify( const Q3CString& hexdigest) { @@ -894,5 +893,5 @@ void KMD5::rawDigest( KMD5::Digest& bin ) -QCString KMD5::hexDigest() +Q3CString KMD5::hexDigest() { - QCString s(33); + Q3CString s(33); @@ -907,3 +906,3 @@ QCString KMD5::hexDigest() -void KMD5::hexDigest(QCString& s) +void KMD5::hexDigest(Q3CString& s) { @@ -917,3 +916,3 @@ void KMD5::hexDigest(QCString& s) -QCString KMD5::base64Digest() +Q3CString KMD5::base64Digest() { @@ -958,3 +957,3 @@ void KMD5::transform( const unsigned char block[64] ) //US Q_ASSERT(!m_finalized); // not just a user error, since the method is private - ASSERT(!m_finalized); // not just a user error, since the method is private + Q_ASSERT(!m_finalized); // not just a user error, since the method is private diff --git a/microkde/kdecore/kmdcodec.h b/microkde/kdecore/kmdcodec.h index 2c4d611..616b683 100644 --- a/microkde/kdecore/kmdcodec.h +++ b/microkde/kdecore/kmdcodec.h @@ -41,2 +41,4 @@ #include <qiodevice.h> +//Added by qt3to4: +#include <Q3CString> @@ -83,3 +85,3 @@ public: */ - static QCString quotedPrintableEncode(const QByteArray & in, + static Q3CString quotedPrintableEncode(const QByteArray & in, bool useCRLF = true); @@ -98,3 +100,3 @@ public: */ - static QCString quotedPrintableEncode(const QCString & str, + static Q3CString quotedPrintableEncode(const Q3CString & str, bool useCRLF = true); @@ -131,3 +133,3 @@ public: */ - static QCString quotedPrintableDecode(const QByteArray & in); + static Q3CString quotedPrintableDecode(const QByteArray & in); @@ -142,3 +144,3 @@ public: */ - static QCString quotedPrintableDecode(const QCString & str); + static Q3CString quotedPrintableDecode(const Q3CString & str); @@ -177,3 +179,3 @@ public: */ - static QCString uuencode( const QByteArray& in ); + static Q3CString uuencode( const QByteArray& in ); @@ -188,3 +190,3 @@ public: */ - static QCString uuencode( const QCString& str ); + static Q3CString uuencode( const Q3CString& str ); @@ -217,3 +219,3 @@ public: */ - static QCString uudecode( const QByteArray& in ); + static Q3CString uudecode( const QByteArray& in ); @@ -228,3 +230,3 @@ public: */ - static QCString uudecode( const QCString& str ); + static Q3CString uudecode( const Q3CString& str ); @@ -265,3 +267,3 @@ public: */ - static QCString base64Encode( const QByteArray& in, bool insertLFs = false); + static Q3CString base64Encode( const QByteArray& in, bool insertLFs = false); @@ -277,3 +279,3 @@ public: */ - static QCString base64Encode( const QCString& str, bool insertLFs = false ); + static Q3CString base64Encode( const Q3CString& str, bool insertLFs = false ); @@ -310,3 +312,3 @@ public: */ - static QCString base64Decode( const QByteArray& in ); + static Q3CString base64Decode( const QByteArray& in ); @@ -321,3 +323,3 @@ public: */ - static QCString base64Decode( const QCString& str ); + static Q3CString base64Decode( const Q3CString& str ); @@ -433,3 +435,3 @@ public: */ - KMD5(const QCString& a ); + KMD5(const Q3CString& a ); @@ -462,3 +464,3 @@ public: */ - void update(const QCString& in ); + void update(const Q3CString& in ); @@ -504,3 +506,3 @@ public: */ - QCString hexDigest (); + Q3CString hexDigest (); @@ -509,3 +511,3 @@ public: */ - void hexDigest(QCString&); + void hexDigest(Q3CString&); @@ -515,3 +517,3 @@ public: */ - QCString base64Digest (); + Q3CString base64Digest (); @@ -526,3 +528,3 @@ public: */ - bool verify(const QCString&); + bool verify(const Q3CString&); diff --git a/microkde/kdecore/kprefs.cpp b/microkde/kdecore/kprefs.cpp index 0220a34..d4010fa 100644 --- a/microkde/kdecore/kprefs.cpp +++ b/microkde/kdecore/kprefs.cpp @@ -23,2 +23,4 @@ #include <qcolor.h> +//Added by qt3to4: +#include <Q3ValueList> @@ -142,4 +144,4 @@ class KPrefsItemIntList : public KPrefsItem { public: - KPrefsItemIntList(const QString &group,const QString &name,QValueList<int> *, - const QValueList<int> &defaultValue=QValueList<int>()); + KPrefsItemIntList(const QString &group,const QString &name,Q3ValueList<int> *, + const Q3ValueList<int> &defaultValue=Q3ValueList<int>()); virtual ~KPrefsItemIntList() {} @@ -151,4 +153,4 @@ class KPrefsItemIntList : public KPrefsItem { private: - QValueList<int> *mReference; - QValueList<int> mDefault; + Q3ValueList<int> *mReference; + Q3ValueList<int> mDefault; }; @@ -366,3 +368,3 @@ void KPrefsItemStringList::readConfig(KConfig *config) KPrefsItemIntList::KPrefsItemIntList(const QString &group,const QString &name, - QValueList<int> *reference,const QValueList<int> &defaultValue) : + Q3ValueList<int> *reference,const Q3ValueList<int> &defaultValue) : KPrefsItem(group,name) @@ -507,4 +509,4 @@ void KPrefs::addItemStringList(const QString &key,QStringList *reference, -void KPrefs::addItemIntList(const QString &key,QValueList<int> *reference, - const QValueList<int> &defaultValue) +void KPrefs::addItemIntList(const QString &key,Q3ValueList<int> *reference, + const Q3ValueList<int> &defaultValue) { diff --git a/microkde/kdecore/kprefs.h b/microkde/kdecore/kprefs.h index 95d2724..d9d1572 100644 --- a/microkde/kdecore/kprefs.h +++ b/microkde/kdecore/kprefs.h @@ -23,3 +23,3 @@ -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qcolor.h> @@ -28,2 +28,4 @@ #include <qstringlist.h> +//Added by qt3to4: +#include <Q3ValueList> @@ -285,4 +287,4 @@ class KPrefs { */ - void addItemIntList(const QString &key,QValueList<int> *reference, - const QValueList<int> &defaultValue=QValueList<int>()); + void addItemIntList(const QString &key,Q3ValueList<int> *reference, + const Q3ValueList<int> &defaultValue=Q3ValueList<int>()); @@ -312,3 +314,3 @@ class KPrefs { - QPtrList<KPrefsItem> mItems; + Q3PtrList<KPrefsItem> mItems; }; diff --git a/microkde/kdecore/kshortcut.h b/microkde/kdecore/kshortcut.h index 4813734..244d590 100644 --- a/microkde/kdecore/kshortcut.h +++ b/microkde/kdecore/kshortcut.h @@ -565,3 +565,3 @@ class KShortcut */ - KShortcut( int keyQt ) {} + KShortcut( int /*keyQt */) {} @@ -601,3 +601,3 @@ class KShortcut */ - KShortcut( const char* shortcut ) {} + KShortcut( const char* /*shortcut */) {} @@ -610,3 +610,3 @@ class KShortcut */ - KShortcut( const QString& shortcut ) {} + KShortcut( const QString& /*shortcut */) {} ~KShortcut() {} @@ -818,3 +818,3 @@ class KShortcut */ - QString toStringInternal( const KShortcut* pcutDefault = 0 ) const + QString toStringInternal( const KShortcut* /*pcutDefault*/ = 0 ) const { diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index d5bfefd..f10934b 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp @@ -39,4 +39,4 @@ #include <qregexp.h> -#include <qasciidict.h> -#include <qdict.h> +#include <q3asciidict.h> +#include <q3dict.h> #include <qdir.h> @@ -48,2 +48,4 @@ #include <qstringlist.h> +//Added by qt3to4: +#include <Q3CString> @@ -61,11 +63,11 @@ QString KStandardDirs::mAppDir = QString::null; -template class QDict<QStringList>; +template class Q3Dict<QStringList>; #if 0 -#include <qtextedit.h> +#include <q3textedit.h> void ddd( QString op ) { - static QTextEdit * dot = 0; + static Q3TextEdit * dot = 0; if ( ! dot ) - dot = new QTextEdit(); + dot = new Q3TextEdit(); @@ -87,3 +89,3 @@ public: bool dataRestrictionActive; - QAsciiDict<bool> restrictions; + Q3AsciiDict<bool> restrictions; QStringList xdgdata_prefixes; @@ -447,3 +449,3 @@ static void lookupDirectory(const QString& path, const QString &relPart, //US this should do the same: - int pos = regexp.match(fn); + int pos = regexp.exactMatch(fn); if (!recursive && !pos == 0) @@ -484,3 +486,3 @@ static void lookupDirectory(const QString& path, const QString &relPart, //US this should do the same: - pos = regexp.match(fn); + pos = regexp.exactMatch(fn); if (!pos == 0) @@ -1110,3 +1112,3 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) base += target.mid(i - 1, pos - i + 1); - QCString baseEncoded = QFile::encodeName(base); + Q3CString baseEncoded = QFile::encodeName(base); // bail out if we encountered a problem @@ -1210,3 +1212,3 @@ QString readEnvPath(const char *env) //#else - QCString c_path; + Q3CString c_path; if ( getenv(env) != NULL ) diff --git a/microkde/kdecore/kstandarddirs.h b/microkde/kdecore/kstandarddirs.h index 901384e..f0e28fc 100644 --- a/microkde/kdecore/kstandarddirs.h +++ b/microkde/kdecore/kstandarddirs.h @@ -26,3 +26,3 @@ #include <qstring.h> -#include <qdict.h> +#include <q3dict.h> #include <qstringlist.h> @@ -576,7 +576,7 @@ public: // Directory dictionaries - QDict<QStringList> absolutes; - QDict<QStringList> relatives; + Q3Dict<QStringList> absolutes; + Q3Dict<QStringList> relatives; - mutable QDict<QStringList> dircache; - mutable QDict<QString> savelocations; + mutable Q3Dict<QStringList> dircache; + mutable Q3Dict<QString> savelocations; diff --git a/microkde/kdeui/kaction.cpp b/microkde/kdeui/kaction.cpp index d38a6d5..c2df381 100644 --- a/microkde/kdeui/kaction.cpp +++ b/microkde/kdeui/kaction.cpp @@ -30,2 +30,5 @@ #include <qtooltip.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3ValueList> //US#include <qwhatsthis.h> @@ -44,5 +47,5 @@ #include <qmenubar.h> -#include <qtoolbar.h> -#include <qpopupmenu.h> -#include <qiconset.h> +#include <q3toolbar.h> +#include <q3popupmenu.h> +#include <qicon.h> @@ -89,3 +92,3 @@ public: KAccel *m_kaccel; - QValueList<KAccel*> m_kaccelList; + Q3ValueList<KAccel*> m_kaccelList; @@ -109,3 +112,3 @@ public: - QValueList<Container> m_containers; + Q3ValueList<Container> m_containers; }; @@ -132,3 +135,3 @@ KAction::KAction( const QString& text, const QString& sIconName, const KShortcut -KAction::KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, +KAction::KAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, @@ -166,3 +169,3 @@ KAction::KAction( const QString& text, const KShortcut& cut, } -KAction::KAction( const QString& text, const QIconSet& pix, +KAction::KAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -184,3 +187,3 @@ KAction::KAction( const QString& text, const QString& pix, -KAction::KAction( const QString& text, const QIconSet& pix, +KAction::KAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -508,4 +511,4 @@ void KAction::updateShortcut( int i ) QWidget* w = container( i ); - if ( w->inherits( "QPopupMenu" ) ) { - QPopupMenu* menu = static_cast<QPopupMenu*>(w); + if ( w->inherits( "Q3PopupMenu" ) ) { + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>(w); updateShortcut( menu, id ); @@ -520,3 +523,3 @@ void KAction::updateShortcut( int i ) -void KAction::updateShortcut( QPopupMenu* menu, int id ) +void KAction::updateShortcut( Q3PopupMenu* menu, int id ) { @@ -623,3 +626,3 @@ void KAction::updateToolTip( int i ) QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); - else if ( w->inherits( "QToolBar" ) ) + else if ( w->inherits( "Q3ToolBar" ) ) QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); @@ -648,5 +651,5 @@ int KAction::plug( QWidget *w, int index ) - if ( w->inherits("QPopupMenu") ) + if ( w->inherits("Q3PopupMenu") ) { - QPopupMenu* menu = static_cast<QPopupMenu*>( w ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( w ); int id; @@ -723,3 +726,3 @@ int KAction::plug( QWidget *w, int index ) } - bar->getButton( id_ )->setName( QCString("toolbutton_")+name() ); + bar->getButton( id_ )->setName( Q3CString("toolbutton_")+name() ); @@ -751,5 +754,5 @@ void KAction::unplug( QWidget *w ) - if ( w->inherits( "QPopupMenu" ) ) + if ( w->inherits( "Q3PopupMenu" ) ) { - QPopupMenu *menu = static_cast<QPopupMenu *>( w ); + Q3PopupMenu *menu = static_cast<Q3PopupMenu *>( w ); menu->removeItem( id ); @@ -864,4 +867,4 @@ void KAction::updateEnabled( int i ) - if ( w->inherits("QPopupMenu") ) - static_cast<QPopupMenu*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); + if ( w->inherits("Q3PopupMenu") ) + static_cast<Q3PopupMenu*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); else if ( w->inherits("QMenuBar") ) @@ -908,6 +911,6 @@ void KAction::updateText( int i ) - if ( w->inherits( "QPopupMenu" ) ) { + if ( w->inherits( "Q3PopupMenu" ) ) { int id = itemId( i ); - static_cast<QPopupMenu*>(w)->changeItem( id, d->text() ); - updateShortcut( static_cast<QPopupMenu*>(w), id ); + static_cast<Q3PopupMenu*>(w)->changeItem( id, d->text() ); + updateShortcut( static_cast<Q3PopupMenu*>(w), id ); } @@ -949,6 +952,6 @@ void KAction::updateIcon( int id ) - if ( w->inherits( "QPopupMenu" ) ) { + if ( w->inherits( "Q3PopupMenu" ) ) { int itemId_ = itemId( id ); - static_cast<QPopupMenu*>(w)->changeItem( itemId_, d->iconSet( KIcon::Small ), d->text() ); - updateShortcut( static_cast<QPopupMenu*>(w), itemId_ ); + static_cast<Q3PopupMenu*>(w)->changeItem( itemId_, d->iconSet( KIcon::Small ), d->text() ); + updateShortcut( static_cast<Q3PopupMenu*>(w), itemId_ ); } @@ -958,3 +961,3 @@ void KAction::updateIcon( int id ) static_cast<KToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); - else if ( w->inherits( "QToolBar" ) ) + else if ( w->inherits( "Q3ToolBar" ) ) { @@ -970,3 +973,3 @@ QString KAction::icon() const -void KAction::setIconSet( const QIconSet &iconset ) +void KAction::setIconSet( const QIcon &iconset ) { @@ -984,7 +987,7 @@ void KAction::updateIconSet( int id ) - if ( w->inherits( "QPopupMenu" ) ) + if ( w->inherits( "Q3PopupMenu" ) ) { int itemId_ = itemId( id ); - static_cast<QPopupMenu*>(w)->changeItem( itemId_, d->iconSet(), d->text() ); - updateShortcut( static_cast<QPopupMenu*>(w), itemId_ ); + static_cast<Q3PopupMenu*>(w)->changeItem( itemId_, d->iconSet(), d->text() ); + updateShortcut( static_cast<Q3PopupMenu*>(w), itemId_ ); } @@ -1001,3 +1004,3 @@ void KAction::updateIconSet( int id ) -QIconSet KAction::iconSet( KIcon::Group group, int size ) const +QIcon KAction::iconSet( KIcon::Group group, int size ) const { @@ -1024,3 +1027,3 @@ void KAction::updateWhatsThis( int i ) qDebug("KAction::updateWhatsThis ...1 has top be fixed"); - QPopupMenu* pm = popupMenu( i ); + Q3PopupMenu* pm = popupMenu( i ); if ( pm ) @@ -1066,6 +1069,6 @@ KToolBar* KAction::toolBar( int index ) const -QPopupMenu* KAction::popupMenu( int index ) const +Q3PopupMenu* KAction::popupMenu( int index ) const { //US return dynamic_cast<QPopupMenu *>( d->m_containers[ index ].m_container ); - return (QPopupMenu *)( d->m_containers[ index ].m_container ); + return (Q3PopupMenu *)( d->m_containers[ index ].m_container ); } @@ -1157,3 +1160,3 @@ int KAction::findContainer( const QWidget* widget ) const int pos = 0; - QValueList<KActionPrivate::Container>::ConstIterator it = d->m_containers.begin(); + Q3ValueList<KActionPrivate::Container>::ConstIterator it = d->m_containers.begin(); while( it != d->m_containers.end() ) @@ -1172,3 +1175,3 @@ void KAction::removeContainer( int index ) int i = 0; - QValueList<KActionPrivate::Container>::Iterator it = d->m_containers.begin(); + Q3ValueList<KActionPrivate::Container>::Iterator it = d->m_containers.begin(); while( it != d->m_containers.end() ) diff --git a/microkde/kdeui/kaction.h b/microkde/kdeui/kaction.h index 13e2e1e..5c690ec 100644 --- a/microkde/kdeui/kaction.h +++ b/microkde/kdeui/kaction.h @@ -31,4 +31,6 @@ #include <qobject.h> -#include <qvaluelist.h> -#include <qguardedptr.h> +#include <q3valuelist.h> +#include <qpointer.h> +//Added by qt3to4: +#include <Q3PopupMenu> #include <kguiitem.h> @@ -42,6 +44,6 @@ class QMenuBar; -class QPopupMenu; +class Q3PopupMenu; //USclass QComboBox; //USclass QPoint; -class QIconSet; +class QIcon; class QString; @@ -261,3 +263,3 @@ public: - KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, @@ -310,3 +312,3 @@ public: */ - KAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); @@ -320,3 +322,3 @@ public: */ - KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); @@ -463,6 +465,6 @@ public: */ - virtual QIconSet iconSet( KIcon::Group group, int size=0 ) const; + virtual QIcon iconSet( KIcon::Group group, int size=0 ) const; #ifndef KDE_NO_COMPAT - QIconSet iconSet() const + QIcon iconSet() const { @@ -520,3 +522,3 @@ public slots: */ - virtual void setIconSet( const QIconSet &iconSet ); + virtual void setIconSet( const QIcon &iconSet ); @@ -548,3 +550,3 @@ protected: KToolBar* toolBar( int index ) const; - QPopupMenu* popupMenu( int index ) const; + Q3PopupMenu* popupMenu( int index ) const; void removeContainer( int index ); @@ -557,3 +559,3 @@ protected: virtual void updateShortcut( int i ); - virtual void updateShortcut( QPopupMenu* menu, int id ); + virtual void updateShortcut( Q3PopupMenu* menu, int id ); virtual void updateGroup( int id ); diff --git a/microkde/kdeui/kactionclasses.cpp b/microkde/kdeui/kactionclasses.cpp index 82e6c8b..c611865 100644 --- a/microkde/kdeui/kactionclasses.cpp +++ b/microkde/kdeui/kactionclasses.cpp @@ -30,5 +30,7 @@ #include <qfontdatabase.h> -#include <qobjectlist.h> +#include <qobject.h> //US#include <qwhatsthis.h> #include <qtimer.h> +//Added by qt3to4: +#include <Q3ValueList> @@ -50,9 +52,9 @@ #include <qwidget.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qmenubar.h> -#include <qmainwindow.h> -#include <qtoolbar.h> +#include <q3mainwindow.h> +#include <q3toolbar.h> #include <qcombobox.h> -#include <qmainwindow.h> - +#include <q3mainwindow.h> +#include <qcoreapplication.h> @@ -85,3 +87,3 @@ static void get_fonts( QStringList &lst ) -static QValueList<int> get_standard_font_sizes() +static Q3ValueList<int> get_standard_font_sizes() { @@ -122,3 +124,3 @@ KToggleAction::KToggleAction( const QString& text, const KShortcut& cut, -KToggleAction::KToggleAction( const QString& text, const QIconSet& pix, +KToggleAction::KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -138,3 +140,3 @@ KToggleAction::KToggleAction( const QString& text, const QString& pix, -KToggleAction::KToggleAction( const QString& text, const QIconSet& pix, +KToggleAction::KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -171,3 +173,3 @@ int KToggleAction::plug( QWidget* widget, int index ) { - if ( !widget->inherits("QPopupMenu") && !widget->inherits("KToolBar") ) + if ( !widget->inherits("Q3PopupMenu") && !widget->inherits("KToolBar") ) { @@ -186,3 +188,3 @@ int KToggleAction::plug( QWidget* widget, int index ) - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { @@ -190,3 +192,3 @@ int KToggleAction::plug( QWidget* widget, int index ) - static_cast<QPopupMenu*>(widget)->setItemChecked( id, d->m_checked ); + static_cast<Q3PopupMenu*>(widget)->setItemChecked( id, d->m_checked ); } else if ( widget->inherits( "KToolBar" ) ) { @@ -216,9 +218,8 @@ void KToggleAction::setChecked( bool c ) if ( c && parent() && !exclusiveGroup().isEmpty() ) { - const QObjectList *list = parent()->children(); - if ( list ) { - QObjectListIt it( *list ); - for( ; it.current(); ++it ) { - if ( it.current()->inherits( "KToggleAction" ) && it.current() != this && - static_cast<KToggleAction*>(it.current())->exclusiveGroup() == exclusiveGroup() ) { - KToggleAction *a = static_cast<KToggleAction*>(it.current()); + const QObjectList list = parent()->children(); + if ( !list.empty() ) { + for(QObjectList::const_iterator it=list.begin();it!=list.end();++it) { + if ( (*it)->inherits( "KToggleAction" ) && (*it) != this && + static_cast<KToggleAction*>((*it))->exclusiveGroup() == exclusiveGroup() ) { + KToggleAction *a = static_cast<KToggleAction*>(*it); if( a->isChecked() ) { @@ -237,4 +238,4 @@ void KToggleAction::updateChecked( int id ) - if ( w->inherits( "QPopupMenu" ) ) - static_cast<QPopupMenu*>(w)->setItemChecked( itemId( id ), d->m_checked ); + if ( w->inherits( "Q3PopupMenu" ) ) + static_cast<Q3PopupMenu*>(w)->setItemChecked( itemId( id ), d->m_checked ); else if ( w->inherits( "QMenuBar" ) ) @@ -285,3 +286,3 @@ KRadioAction::KRadioAction( const QString& text, const KShortcut& cut, -KRadioAction::KRadioAction( const QString& text, const QIconSet& pix, +KRadioAction::KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -299,3 +300,3 @@ KRadioAction::KRadioAction( const QString& text, const QString& pix, -KRadioAction::KRadioAction( const QString& text, const QIconSet& pix, +KRadioAction::KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -351,3 +352,3 @@ public: bool m_menuAccelsEnabled; - QPopupMenu *m_menu; + Q3PopupMenu *m_menu; int m_current; @@ -389,3 +390,3 @@ KSelectAction::KSelectAction( const QString& text, const KShortcut& cut, -KSelectAction::KSelectAction( const QString& text, const QIconSet& pix, +KSelectAction::KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -405,3 +406,3 @@ KSelectAction::KSelectAction( const QString& text, const QString& pix, -KSelectAction::KSelectAction( const QString& text, const QIconSet& pix, +KSelectAction::KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -441,3 +442,3 @@ void KSelectAction::setCurrentItem( int id ) if ( id >= (int)d->m_list.count() ) { - ASSERT(id < (int)d->m_list.count()); + Q_ASSERT(id < (int)d->m_list.count()); return; @@ -481,3 +482,3 @@ void KSelectAction::setComboWidth( int width ) } -QPopupMenu* KSelectAction::popupMenu() const +Q3PopupMenu* KSelectAction::popupMenu() const { @@ -487,3 +488,3 @@ QPopupMenu* KSelectAction::popupMenu() const //US d->m_menu = new KPopupMenu(0L, "KSelectAction::popupMenu()"); - d->m_menu = new QPopupMenu(0L, "QSelectAction::popupMenu()"); + d->m_menu = new Q3PopupMenu(0L, "QSelectAction::popupMenu()"); setupMenu(); @@ -645,3 +646,3 @@ int KSelectAction::plug( QWidget *widget, int index ) kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { @@ -650,3 +651,3 @@ int KSelectAction::plug( QWidget *widget, int index ) - QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); int id; @@ -684,3 +685,3 @@ int KSelectAction::plug( QWidget *widget, int index ) cb->setMaximumHeight( 34 ); - if (!isEditable()) cb->setFocusPolicy(QWidget::NoFocus); + if (!isEditable()) cb->setFocusPolicy(Qt::NoFocus); cb->setMinimumWidth( cb->sizeHint().width() ); @@ -854,3 +855,3 @@ KListAction::KListAction( const QString& text, const KShortcut& cut, -KListAction::KListAction( const QString& text, const QIconSet& pix, +KListAction::KListAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -870,3 +871,3 @@ KListAction::KListAction( const QString& text, const QString& pix, -KListAction::KListAction( const QString& text, const QIconSet& pix, +KListAction::KListAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, @@ -967,3 +968,3 @@ KRecentFilesAction::KRecentFilesAction( const QString& text, KRecentFilesAction::KRecentFilesAction( const QString& text, - const QIconSet& pix, + const QIcon& pix, const KShortcut& cut, @@ -993,3 +994,3 @@ KRecentFilesAction::KRecentFilesAction( const QString& text, KRecentFilesAction::KRecentFilesAction( const QString& text, - const QIconSet& pix, + const QIcon& pix, const KShortcut& cut, @@ -1203,3 +1204,3 @@ KFontAction::KFontAction( const QString& text, const KShortcut& cut, -KFontAction::KFontAction( const QString& text, const QIconSet& pix, +KFontAction::KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -1225,3 +1226,3 @@ KFontAction::KFontAction( const QString& text, const QString& pix, -KFontAction::KFontAction( const QString& text, const QIconSet& pix, +KFontAction::KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -1363,3 +1364,3 @@ KFontSizeAction::KFontSizeAction( const QString& text, -KFontSizeAction::KFontSizeAction( const QString& text, const QIconSet& pix, +KFontSizeAction::KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -1379,3 +1380,3 @@ KFontSizeAction::KFontSizeAction( const QString& text, const QString& pix, -KFontSizeAction::KFontSizeAction( const QString& text, const QIconSet& pix, +KFontSizeAction::KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut, @@ -1416,5 +1417,5 @@ void KFontSizeAction::init() setEditable( true ); - QValueList<int> sizes = get_standard_font_sizes(); + Q3ValueList<int> sizes = get_standard_font_sizes(); QStringList lst; - for ( QValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it ) + for ( Q3ValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it ) lst.append( QString::number( *it ) ); @@ -1439,3 +1440,3 @@ void KFontSizeAction::setFontSize( int size ) // Insert at the correct position in the list (to keep sorting) - QValueList<int> lst; + Q3ValueList<int> lst; // Convert to list of ints @@ -1452,3 +1453,3 @@ qDebug("KFontSizeAction::setFontSize heapsort not found."); QStringList strLst; - for (QValueList<int>::Iterator it = lst.begin() ; it != lst.end() ; ++it) + for (Q3ValueList<int>::Iterator it = lst.begin() ; it != lst.end() ; ++it) strLst.append( QString::number(*it) ); @@ -1494,3 +1495,3 @@ public: //US m_popup = new KPopupMenu(0L,"KActionMenu::KActionMenuPrivate"); - m_popup = new QPopupMenu(0L,"KActionMenu::KActionMenuPrivate"); + m_popup = new Q3PopupMenu(0L,"KActionMenu::KActionMenuPrivate"); m_delayed = true; @@ -1504,3 +1505,3 @@ public: //US KPopupMenu *m_popup; - QPopupMenu *m_popup; + Q3PopupMenu *m_popup; bool m_delayed; @@ -1524,3 +1525,3 @@ KActionMenu::KActionMenu( const QString& text, QObject* parent, -KActionMenu::KActionMenu( const QString& text, const QIconSet& icon, +KActionMenu::KActionMenu( const QString& text, const QIcon& icon, QObject* parent, const char* name ) @@ -1554,3 +1555,3 @@ void KActionMenu::popup( const QPoint& global ) //US KPopupMenu* KActionMenu::popupMenu() const -QPopupMenu* KActionMenu::popupMenu() const +Q3PopupMenu* KActionMenu::popupMenu() const { @@ -1594,5 +1595,5 @@ int KActionMenu::plug( QWidget* widget, int index ) kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { - QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); int id; @@ -1783,3 +1784,3 @@ int KToolBarPopupAction::plug( QWidget *widget, int index ) //US KPopupMenu *KToolBarPopupAction::popupMenu() const -QPopupMenu *KToolBarPopupAction::popupMenu() const +Q3PopupMenu *KToolBarPopupAction::popupMenu() const { @@ -1788,3 +1789,3 @@ QPopupMenu *KToolBarPopupAction::popupMenu() const //US that->m_popup = new KPopupMenu; - that->m_popup = new QPopupMenu; + that->m_popup = new Q3PopupMenu; } @@ -1955,3 +1956,3 @@ void KWidgetAction::slotToolbarDestroyed() - ASSERT( isPlugged() ); + Q_ASSERT( isPlugged() ); if( !m_widget || !isPlugged() ) @@ -1976,5 +1977,5 @@ int KActionSeparator::plug( QWidget *widget, int index ) { - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { - QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); diff --git a/microkde/kdeui/kactionclasses.h b/microkde/kdeui/kactionclasses.h index f6e7a0f..a9b9104 100644 --- a/microkde/kdeui/kactionclasses.h +++ b/microkde/kdeui/kactionclasses.h @@ -36,2 +36,5 @@ #include <kshortcut.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3PopupMenu> //US#include <kstdaction.h> @@ -40,3 +43,3 @@ class QMenuBar; -class QPopupMenu; +class Q3PopupMenu; //USclass QComboBox; @@ -56,3 +59,3 @@ class KURL; //US class KToolBar needs to be replaced -class KToolBar; +#include "ktoolbar.h" class KActionCollection; @@ -107,3 +110,3 @@ public: */ - KToggleAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); @@ -129,3 +132,3 @@ public: */ - KToggleAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); @@ -248,3 +251,3 @@ public: */ - KRadioAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); @@ -270,3 +273,3 @@ public: */ - KRadioAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); @@ -354,3 +357,3 @@ public: */ - KSelectAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); @@ -376,3 +379,3 @@ public: */ - KSelectAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); @@ -440,3 +443,3 @@ public: - QPopupMenu* popupMenu() const; + Q3PopupMenu* popupMenu() const; @@ -569,3 +572,3 @@ public: */ - KListAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KListAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); @@ -591,3 +594,3 @@ public: */ - KListAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KListAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, @@ -687,3 +690,3 @@ public: */ - KRecentFilesAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KRecentFilesAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name = 0, @@ -714,3 +717,3 @@ public: */ - KRecentFilesAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KRecentFilesAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, @@ -836,3 +839,3 @@ public: const char* name = 0 ); - KFontAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); @@ -840,3 +843,3 @@ public: QObject* parent = 0, const char* name = 0 ); - KFontAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, QObject* parent, @@ -875,3 +878,3 @@ public: const char* slot, QObject* parent, const char* name = 0 ); - KFontSizeAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), + KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); @@ -879,3 +882,3 @@ public: QObject* parent = 0, const char* name = 0 ); - KFontSizeAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut, const QObject* receiver, const char* slot, @@ -933,3 +936,3 @@ public: const char* name = 0 ); - KActionMenu( const QString& text, const QIconSet& icon, + KActionMenu( const QString& text, const QIcon& icon, QObject* parent = 0, const char* name = 0 ); @@ -944,3 +947,3 @@ public: //US KPopupMenu* popupMenu() const; - QPopupMenu* popupMenu() const; + Q3PopupMenu* popupMenu() const; void popup( const QPoint& global ); @@ -1069,3 +1072,3 @@ public: //US KPopupMenu *popupMenu() const; - QPopupMenu *popupMenu() const; + Q3PopupMenu *popupMenu() const; @@ -1100,3 +1103,3 @@ private: //US KPopupMenu *m_popup; - QPopupMenu *m_popup; + Q3PopupMenu *m_popup; bool m_delayed:1; @@ -1149,4 +1152,4 @@ public slots: private: - QCString m_toolBarName; - QGuardedPtr<KToolBar> m_toolBar; + Q3CString m_toolBarName; + QPointer<KToolBar> m_toolBar; protected: @@ -1197,3 +1200,3 @@ protected slots: private: - QGuardedPtr<QWidget> m_widget; + QPointer<QWidget> m_widget; bool m_autoSized; diff --git a/microkde/kdeui/kactioncollection.cpp b/microkde/kdeui/kactioncollection.cpp index 69e5d02..4d66c7f 100644 --- a/microkde/kdeui/kactioncollection.cpp +++ b/microkde/kdeui/kactioncollection.cpp @@ -28,3 +28,5 @@ -#include <qptrdict.h> +#include <q3ptrdict.h> +//Added by qt3to4: +#include <Q3ValueList> //US#include <qvariant.h> @@ -38,4 +40,4 @@ //US I included the following files -#include <qasciidict.h> -#include <qptrlist.h> +#include <q3asciidict.h> +#include <q3ptrlist.h> #include "kaction.h" @@ -69,3 +71,3 @@ public: //QValueList<KAccel*> m_kaccelList; - QValueList<KActionCollection*> m_docList; + Q3ValueList<KActionCollection*> m_docList; QWidget *m_widget; @@ -74,4 +76,4 @@ public: - QAsciiDict<KAction> m_actionDict; - QPtrDict< QPtrList<KAction> > m_dctHighlightContainers; + Q3AsciiDict<KAction> m_actionDict; + Q3PtrDict< Q3PtrList<KAction> > m_dctHighlightContainers; bool m_highlight; @@ -135,3 +137,3 @@ KActionCollection::~KActionCollection() kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl; - for ( QAsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { + for ( Q3AsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { KAction* pAction = it.current(); @@ -367,3 +369,3 @@ void KActionCollection::_clear() { - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); while ( it.current() ) @@ -388,3 +390,3 @@ KAction* KActionCollection::action( const char* name, const char* classname ) co else { - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) @@ -409,3 +411,3 @@ KAction* KActionCollection::action( int index ) const { - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); it += index; @@ -434,3 +436,3 @@ QStringList KActionCollection::groups() const - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) @@ -446,3 +448,3 @@ KActionPtrList KActionCollection::actions( const QString& group ) const - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) @@ -460,3 +462,3 @@ KActionPtrList KActionCollection::actions() const - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) @@ -510,3 +512,3 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action ) - QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; + Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; @@ -514,5 +516,5 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action ) { - actionList = new QPtrList<KAction>; + actionList = new Q3PtrList<KAction>; - if ( container->inherits( "QPopupMenu" ) ) + if ( container->inherits( "Q3PopupMenu" ) ) { @@ -524,3 +526,3 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action ) //US else if ( container->inherits( "KToolBar" ) ) - else if ( container->inherits( "QToolBar" ) ) + else if ( container->inherits( "Q3ToolBar" ) ) { @@ -544,3 +546,3 @@ void KActionCollection::disconnectHighlight( QWidget *container, KAction *action - QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; + Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; @@ -627,3 +629,3 @@ KAction *KActionCollection::findAction( QWidget *container, int id ) { - QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ]; + Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ]; @@ -632,3 +634,3 @@ KAction *KActionCollection::findAction( QWidget *container, int id ) - QPtrListIterator<KAction> it( *actionList ); + Q3PtrListIterator<KAction> it( *actionList ); for (; it.current(); ++it ) @@ -646,5 +648,5 @@ KActionCollection KActionCollection::operator+(const KActionCollection &c ) cons - QValueList<KAction *> actions = c.actions(); - QValueList<KAction *>::ConstIterator it = actions.begin(); - QValueList<KAction *>::ConstIterator end = actions.end(); + Q3ValueList<KAction *> actions = c.actions(); + Q3ValueList<KAction *>::ConstIterator it = actions.begin(); + Q3ValueList<KAction *>::ConstIterator end = actions.end(); for (; it != end; ++it ) @@ -672,3 +674,3 @@ KActionCollection &KActionCollection::operator+=( const KActionCollection &c ) kdWarning(129) << "KActionCollection::operator+=(): function is severely deprecated." << endl; - QAsciiDictIterator<KAction> it(c.d->m_actionDict); + Q3AsciiDictIterator<KAction> it(c.d->m_actionDict); for ( ; it.current(); ++it ) diff --git a/microkde/kdeui/kactioncollection.h b/microkde/kdeui/kactioncollection.h index b9466d0..50cb02a 100644 --- a/microkde/kdeui/kactioncollection.h +++ b/microkde/kdeui/kactioncollection.h @@ -32,2 +32,4 @@ #include <qobject.h> +//Added by qt3to4: +#include <Q3ValueList> //US#include <qvaluelist.h> @@ -62,3 +64,3 @@ class QWidget; -typedef QValueList<KAction *> KActionPtrList; +typedef Q3ValueList<KAction *> KActionPtrList; diff --git a/microkde/kdeui/kbuttonbox.cpp b/microkde/kdeui/kbuttonbox.cpp index 83d622a..3ea6703 100644 --- a/microkde/kdeui/kbuttonbox.cpp +++ b/microkde/kdeui/kbuttonbox.cpp @@ -51,3 +51,5 @@ #include <qpushbutton.h> -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <QResizeEvent> #include <assert.h> @@ -64,3 +66,3 @@ public: -template class QPtrList<KButtonBox::Item>; +template class Q3PtrList<KButtonBox::Item>; @@ -72,6 +74,6 @@ public: bool activated; - QPtrList<KButtonBox::Item> buttons; + Q3PtrList<KButtonBox::Item> buttons; }; -KButtonBox::KButtonBox(QWidget *parent, Orientation _orientation, +KButtonBox::KButtonBox(QWidget *parent, Qt::Orientation _orientation, int border, int autoborder) @@ -151,3 +153,3 @@ void KButtonBox::placeButtons() { - if(data->orientation == Horizontal) { + if(data->orientation == Qt::Horizontal) { // calculate free size and stretches @@ -253,3 +255,3 @@ QSize KButtonBox::sizeHint() const { - if(data->orientation == Horizontal) + if(data->orientation == Qt::Horizontal) dw += s.width(); @@ -263,3 +265,3 @@ QSize KButtonBox::sizeHint() const { - if(data->orientation == Horizontal) + if(data->orientation == Qt::Horizontal) return QSize(dw, bs.height() + 2 * data->border); @@ -272,3 +274,3 @@ QSizePolicy KButtonBox::sizePolicy() const { - return data->orientation == Horizontal? + return data->orientation == Qt::Horizontal? QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) : diff --git a/microkde/kdeui/kbuttonbox.h b/microkde/kdeui/kbuttonbox.h index 1104366..2e0f41d 100644 --- a/microkde/kdeui/kbuttonbox.h +++ b/microkde/kdeui/kbuttonbox.h @@ -23,2 +23,4 @@ #include <qwidget.h> +//Added by qt3to4: +#include <QResizeEvent> class QPushButton; @@ -50,3 +52,3 @@ public: */ - KButtonBox(QWidget *parent, Orientation _orientation = Horizontal, + KButtonBox(QWidget *parent, Qt::Orientation _orientation = Qt::Horizontal, int border = 0, int _autoborder = 6); diff --git a/microkde/kdeui/kguiitem.cpp b/microkde/kdeui/kguiitem.cpp index 828c5e6..c91ffb7 100644 --- a/microkde/kdeui/kguiitem.cpp +++ b/microkde/kdeui/kguiitem.cpp @@ -22,3 +22,3 @@ #include <qstring.h> -#include <qiconset.h> +#include <qicon.h> #include <qpixmap.h> @@ -64,3 +64,3 @@ public: QString m_iconName; - QIconSet m_iconSet; + QIcon m_iconSet; bool m_hasIcon : 1; @@ -84,3 +84,3 @@ KGuiItem::KGuiItem( const QString &text, const QString &iconName, -KGuiItem::KGuiItem( const QString &text, const QIconSet &iconSet, +KGuiItem::KGuiItem( const QString &text, const QIcon &iconSet, const QString &toolTip, const QString &whatsThis ) @@ -126,3 +126,3 @@ QString KGuiItem::plainText() const { -QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const +QIcon KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const { @@ -150,3 +150,3 @@ QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instan else - return QIconSet(); + return QIcon(); } @@ -179,3 +179,3 @@ void KGuiItem::setText( const QString &text ) { -void KGuiItem::setIconSet( const QIconSet &iconset ) +void KGuiItem::setIconSet( const QIcon &iconset ) { @@ -189,3 +189,3 @@ void KGuiItem::setIconName( const QString &iconName ) d->m_iconName = iconName; - d->m_iconSet = QIconSet(); + d->m_iconSet = QIcon(); d->m_hasIcon = !iconName.isEmpty(); diff --git a/microkde/kdeui/kguiitem.h b/microkde/kdeui/kguiitem.h index 0079bb4..6f92137 100644 --- a/microkde/kdeui/kguiitem.h +++ b/microkde/kdeui/kguiitem.h @@ -25,5 +25,5 @@ #include <qstring.h> -#include <qiconset.h> +#include <qicon.h> #include <qpixmap.h> -#include <qvaluelist.h> +#include <q3valuelist.h> //US#include <kicontheme.h> @@ -44,3 +44,3 @@ public: - KGuiItem( const QString &text, const QIconSet &iconSet, + KGuiItem( const QString &text, const QIcon &iconSet, const QString &toolTip = QString::null, @@ -55,6 +55,6 @@ public: QString plainText() const; - QIconSet iconSet( KIcon::Group, int size = 0/*US , KInstance* instance = KGlobal::instance()*/) const; + QIcon iconSet( KIcon::Group, int size = 0/*US , KInstance* instance = KGlobal::instance()*/) const; #ifndef KDE_NO_COMPAT - QIconSet iconSet() const { return iconSet( KIcon::Small); } + QIcon iconSet() const { return iconSet( KIcon::Small); } #endif @@ -71,3 +71,3 @@ public: void setText( const QString &text ); - void setIconSet( const QIconSet &iconset ); + void setIconSet( const QIcon &iconset ); void setIconName( const QString &iconName ); diff --git a/microkde/kdeui/kjanuswidget.cpp b/microkde/kdeui/kjanuswidget.cpp index 462c44f..3d9173d 100644 --- a/microkde/kdeui/kjanuswidget.cpp +++ b/microkde/kdeui/kjanuswidget.cpp @@ -24,11 +24,19 @@ #include <qlabel.h> -#include <qwidgetstack.h> +#include <q3widgetstack.h> #include <qtabwidget.h> -#include <qlistview.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qgrid.h> +#include <q3listview.h> +#include <q3hbox.h> +#include <q3vbox.h> +#include <q3grid.h> #include <qpainter.h> -#include <qobjectlist.h> +#include <qobject.h> #include <qstringlist.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3PtrList> +#include <Q3Frame> +#include <QEvent> +#include <Q3VBoxLayout> +#include <QShowEvent> /*US @@ -67,9 +75,9 @@ -class KJanusWidget::IconListItem : public QListBoxItem +class KJanusWidget::IconListItem : public Q3ListBoxItem { public: - IconListItem( QListBox *listbox, const QPixmap &pixmap, + IconListItem( Q3ListBox *listbox, const QPixmap &pixmap, const QString &text ); - virtual int height( const QListBox *lb ) const; - virtual int width( const QListBox *lb ) const; + virtual int height( const Q3ListBox *lb ) const; + virtual int width( const Q3ListBox *lb ) const; int expandMinimumWidth( int width ); @@ -100,3 +108,3 @@ public: -template class QPtrList<QListViewItem>; +template class Q3PtrList<Q3ListViewItem>; @@ -109,3 +117,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) { - QVBoxLayout *topLayout = new QVBoxLayout( this ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this ); if( mFace == TreeList || mFace == IconList ) @@ -114,3 +122,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) - QFrame *page = 0; + Q3Frame *page = 0; if( mFace == TreeList ) @@ -147,3 +155,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) { - QHBoxLayout *hbox = new QHBoxLayout( topLayout ); + Q3HBoxLayout *hbox = new Q3HBoxLayout( topLayout ); mIconList = new IconListBox( this ); @@ -158,3 +166,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) hbox->addSpacing( KDialog::marginHint() ); - page = new QFrame( this ); + page = new Q3Frame( this ); hbox->addWidget( page, 10 ); @@ -167,3 +175,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) - QVBoxLayout *vbox = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + Q3VBoxLayout *vbox = new Q3VBoxLayout( page, 0, KDialog::spacingHint() ); @@ -177,6 +185,6 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) mTitleSep = new KSeparator( page ); - mTitleSep->setFrameStyle( QFrame::HLine|QFrame::Plain ); + mTitleSep->setFrameStyle( Q3Frame::HLine|Q3Frame::Plain ); vbox->addWidget( mTitleSep ); - mPageStack = new QWidgetStack( page ); + mPageStack = new Q3WidgetStack( page ); connect(mPageStack, SIGNAL(aboutToShow(QWidget *)), @@ -201,3 +209,3 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) mFace = Plain; - mPlainPage = new QFrame( this ); + mPlainPage = new Q3Frame( this ); topLayout->addWidget( mPlainPage, 10 ); @@ -247,3 +255,3 @@ bool KJanusWidget::isValid() const -QFrame *KJanusWidget::plainPage() +Q3Frame *KJanusWidget::plainPage() { @@ -268,3 +276,3 @@ QWidget *KJanusWidget::FindParent() -QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header, +Q3Frame *KJanusWidget::addPage( const QStringList &items, const QString &header, const QPixmap &pixmap ) @@ -277,3 +285,3 @@ QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header, - QFrame *page = new QFrame( FindParent(), "page" ); + Q3Frame *page = new Q3Frame( FindParent(), "page" ); addPageWidget( page, items, header, pixmap ); @@ -289,3 +297,3 @@ void KJanusWidget::pageGone( QObject *obj ) -void KJanusWidget::slotReopen( QListViewItem * item ) +void KJanusWidget::slotReopen( Q3ListViewItem * item ) { @@ -295,3 +303,3 @@ void KJanusWidget::slotReopen( QListViewItem * item ) -QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header, +Q3Frame *KJanusWidget::addPage( const QString &itemName, const QString &header, const QPixmap &pixmap ) @@ -306,3 +314,3 @@ QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header, -QVBox *KJanusWidget::addVBoxPage( const QStringList &items, +Q3VBox *KJanusWidget::addVBoxPage( const QStringList &items, const QString &header, @@ -317,3 +325,3 @@ QVBox *KJanusWidget::addVBoxPage( const QStringList &items, - QVBox *page = new QVBox(FindParent() , "vbox_page" ); + Q3VBox *page = new Q3VBox(FindParent() , "vbox_page" ); page->setSpacing( KDialog::spacingHintSmall() ); @@ -324,3 +332,3 @@ QVBox *KJanusWidget::addVBoxPage( const QStringList &items, -QVBox *KJanusWidget::addVBoxPage( const QString &itemName, +Q3VBox *KJanusWidget::addVBoxPage( const QString &itemName, const QString &header, @@ -333,3 +341,3 @@ QVBox *KJanusWidget::addVBoxPage( const QString &itemName, -QHBox *KJanusWidget::addHBoxPage( const QStringList &items, +Q3HBox *KJanusWidget::addHBoxPage( const QStringList &items, const QString &header, @@ -342,3 +350,3 @@ QHBox *KJanusWidget::addHBoxPage( const QStringList &items, - QHBox *page = new QHBox(FindParent(), "hbox_page"); + Q3HBox *page = new Q3HBox(FindParent(), "hbox_page"); page->setSpacing( KDialog::spacingHint() ); @@ -349,3 +357,3 @@ QHBox *KJanusWidget::addHBoxPage( const QStringList &items, -QHBox *KJanusWidget::addHBoxPage( const QString &itemName, +Q3HBox *KJanusWidget::addHBoxPage( const QString &itemName, const QString &header, @@ -358,3 +366,3 @@ QHBox *KJanusWidget::addHBoxPage( const QString &itemName, -QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, +Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir, const QStringList &items, @@ -369,3 +377,3 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, - QGrid *page = new QGrid( n, dir, FindParent(), "page" ); + Q3Grid *page = new Q3Grid( n, dir, FindParent(), "page" ); page->setSpacing( KDialog::spacingHint() ); @@ -377,3 +385,3 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, -QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, +Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir, const QString &itemName, @@ -387,6 +395,6 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, -void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page) +void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page) { bool isTop = true; - QListViewItem *curTop = 0, *child, *last, *newChild; + Q3ListViewItem *curTop = 0, *child, *last, *newChild; unsigned int index = 1; @@ -414,5 +422,5 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p if (isTop) - newChild = new QListViewItem(mTreeList, name); + newChild = new Q3ListViewItem(mTreeList, name); else - newChild = new QListViewItem(curTop, name); + newChild = new Q3ListViewItem(curTop, name); @@ -433,5 +441,5 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p if (isTop) - newChild = new QListViewItem(mTreeList, last, name); + newChild = new Q3ListViewItem(mTreeList, last, name); else - newChild = new QListViewItem(curTop, last, name); + newChild = new Q3ListViewItem(curTop, last, name); } @@ -461,3 +469,3 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p -void KJanusWidget::addPageWidget( QFrame *page, const QStringList &items, +void KJanusWidget::addPageWidget( Q3Frame *page, const QStringList &items, const QString &header,const QPixmap &pixmap ) @@ -552,3 +560,3 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget ) } - QGridLayout *gbox = new QGridLayout( mSwallowPage, 1, 1, 0 ); + Q3GridLayout *gbox = new Q3GridLayout( mSwallowPage, 1, 1, 0 ); @@ -557,6 +565,6 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget ) // - QObjectList *l = (QObjectList*)mSwallowPage->children(); // silence please - for( uint i=0; i < l->count(); i++ ) + QObjectList l = mSwallowPage->children(); // silence please + for( uint i=0; i < l.count(); i++ ) { - QObject *o = l->at(i); + QObject *o = l.at(i); if( o->isWidgetType() ) @@ -599,3 +607,3 @@ bool KJanusWidget::slotShowPage() { - QListViewItem *node = mTreeList->selectedItem(); + Q3ListViewItem *node = mTreeList->selectedItem(); if( node == 0 ) { return( false ); } @@ -608,3 +616,3 @@ bool KJanusWidget::slotShowPage() { - QListBoxItem *node = mIconList->item( mIconList->currentItem() ); + Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() ); if( node == 0 ) { return( false ); } @@ -648,5 +656,5 @@ bool KJanusWidget::showPage( QWidget *w ) { - QMap<QListViewItem *, QWidget *>::Iterator it; + QMap<Q3ListViewItem *, QWidget *>::Iterator it; for (it = mTreeListToPageStack.begin(); it != mTreeListToPageStack.end(); ++it){ - QListViewItem *key = it.key(); + Q3ListViewItem *key = it.key(); QWidget *val = it.data(); @@ -660,5 +668,5 @@ bool KJanusWidget::showPage( QWidget *w ) { - QMap<QListBoxItem *, QWidget *>::Iterator it; + QMap<Q3ListBoxItem *, QWidget *>::Iterator it; for (it = mIconListToPageStack.begin(); it != mIconListToPageStack.end(); ++it){ - QListBoxItem *key = it.key(); + Q3ListBoxItem *key = it.key(); QWidget *val = it.data(); @@ -688,3 +696,3 @@ int KJanusWidget::activePageIndex() const if( mFace == TreeList) { - QListViewItem *node = mTreeList->selectedItem(); + Q3ListViewItem *node = mTreeList->selectedItem(); if( node == 0 ) { return -1; } @@ -694,3 +702,3 @@ int KJanusWidget::activePageIndex() const else if (mFace == IconList) { - QListBoxItem *node = mIconList->item( mIconList->currentItem() ); + Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() ); if( node == 0 ) { return( false ); } @@ -763,3 +771,3 @@ void KJanusWidget::slotFontChanged() // makes the treelist behave like the list of kcontrol -void KJanusWidget::slotItemClicked(QListViewItem *it) +void KJanusWidget::slotItemClicked(Q3ListViewItem *it) { @@ -897,7 +905,7 @@ void KJanusWidget::unfoldTreeList( bool persist ) if( persist ) - connect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); + connect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) ); else - disconnect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); + disconnect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) ); - for( QListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) + for( Q3ListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) item->setOpen( true ); @@ -955,3 +963,3 @@ bool KJanusWidget::eventFilter( QObject *o, QEvent *e ) KJanusWidget::IconListBox::IconListBox( QWidget *parent, const char *name, - WFlags f ) + Qt::WFlags f ) :KListBox( parent, name, f ), mShowAll(false), mHeightValid(false), @@ -967,3 +975,3 @@ void KJanusWidget::IconListBox::updateMinimumHeight() int h = frameWidth()*2; - for( QListBoxItem *i = item(0); i != 0; i = i->next() ) + for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) { @@ -982,3 +990,3 @@ void KJanusWidget::IconListBox::updateWidth() int maxWidth = 10; - for( QListBoxItem *i = item(0); i != 0; i = i->next() ) + for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) { @@ -988,3 +996,3 @@ void KJanusWidget::IconListBox::updateWidth() - for( QListBoxItem *i = item(0); i != 0; i = i->next() ) + for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) { @@ -1024,5 +1032,5 @@ void KJanusWidget::IconListBox::setShowAll( bool showAll ) -KJanusWidget::IconListItem::IconListItem( QListBox *listbox, const QPixmap &pixmap, +KJanusWidget::IconListItem::IconListItem( Q3ListBox *listbox, const QPixmap &pixmap, const QString &text ) - : QListBoxItem( listbox ) + : Q3ListBoxItem( listbox ) { @@ -1085,3 +1093,3 @@ void KJanusWidget::IconListItem::paint( QPainter *painter ) -int KJanusWidget::IconListItem::height( const QListBox *lb ) const +int KJanusWidget::IconListItem::height( const Q3ListBox *lb ) const { @@ -1098,3 +1106,3 @@ int KJanusWidget::IconListItem::height( const QListBox *lb ) const -int KJanusWidget::IconListItem::width( const QListBox *lb ) const +int KJanusWidget::IconListItem::width( const Q3ListBox *lb ) const { @@ -1124,3 +1132,3 @@ void KJanusWidget::removePage( QWidget *page ) { - QMap<QListViewItem*, QWidget *>::Iterator i; + QMap<Q3ListViewItem*, QWidget *>::Iterator i; for( i = mTreeListToPageStack.begin(); i != mTreeListToPageStack.end(); ++i ) @@ -1139,3 +1147,3 @@ void KJanusWidget::removePage( QWidget *page ) { - QMap<QListBoxItem*, QWidget *>::Iterator i; + QMap<Q3ListBoxItem*, QWidget *>::Iterator i; for( i = mIconListToPageStack.begin(); i != mIconListToPageStack.end(); ++i ) diff --git a/microkde/kdeui/kjanuswidget.h b/microkde/kdeui/kjanuswidget.h index 6d3f23d..72465ea 100644 --- a/microkde/kdeui/kjanuswidget.h +++ b/microkde/kdeui/kjanuswidget.h @@ -22,6 +22,12 @@ -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qwidget.h> #include <qmap.h> -#include <qgrid.h> +#include <q3grid.h> +//Added by qt3to4: +#include <QShowEvent> +#include <Q3Frame> +#include <QPixmap> +#include <QLabel> +#include <QEvent> #include <klistbox.h> @@ -40,8 +46,8 @@ class KSeparator; class KListView; -class QWidgetStack; +class Q3WidgetStack; class QLabel; class QTabWidget; -class QListViewItem; -class QVBox; -class QHBox; +class Q3ListViewItem; +class Q3VBox; +class Q3HBox; @@ -104,3 +110,3 @@ class KJanusWidget : public QWidget public: - IconListBox( QWidget *parent=0, const char *name=0, WFlags f=0 ); + IconListBox( QWidget *parent=0, const char *name=0, Qt::WFlags f=0 ); void updateMinimumHeight(); @@ -195,3 +201,3 @@ class KJanusWidget : public QWidget */ - virtual QFrame *plainPage(); + virtual Q3Frame *plainPage(); @@ -216,3 +222,3 @@ class KJanusWidget : public QWidget */ - virtual QFrame *addPage(const QString &item,const QString &header=QString::null, + virtual Q3Frame *addPage(const QString &item,const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -233,3 +239,3 @@ class KJanusWidget : public QWidget **/ - virtual QFrame *addPage(const QStringList &items, const QString &header=QString::null, + virtual Q3Frame *addPage(const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -255,3 +261,3 @@ class KJanusWidget : public QWidget * Tabbed. */ - virtual QVBox *addVBoxPage( const QString &item, + virtual Q3VBox *addVBoxPage( const QString &item, const QString &header=QString::null, @@ -271,3 +277,3 @@ class KJanusWidget : public QWidget **/ - virtual QVBox *addVBoxPage( const QStringList &items, + virtual Q3VBox *addVBoxPage( const QStringList &items, const QString &header=QString::null, @@ -295,3 +301,3 @@ class KJanusWidget : public QWidget */ - virtual QHBox *addHBoxPage( const QString &itemName, + virtual Q3HBox *addHBoxPage( const QString &itemName, const QString &header=QString::null, @@ -311,3 +317,3 @@ class KJanusWidget : public QWidget **/ - virtual QHBox *addHBoxPage( const QStringList &items, + virtual Q3HBox *addHBoxPage( const QStringList &items, const QString &header=QString::null, @@ -339,3 +345,3 @@ class KJanusWidget : public QWidget //US changed Orientation into Direction for compatibility - virtual QGrid *addGridPage( int n, QGrid::Direction dir, + virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, const QString &itemName, @@ -357,3 +363,3 @@ class KJanusWidget : public QWidget //US changed Orientation into Direction for compatibility - virtual QGrid *addGridPage( int n, QGrid::Direction dir, + virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, const QStringList &items, @@ -519,5 +525,5 @@ class KJanusWidget : public QWidget //US not yet implemented void slotFontChanged(); - void slotItemClicked(QListViewItem *it); + void slotItemClicked(Q3ListViewItem *it); void pageGone( QObject *obj); // signal from the added page's "destroyed" signal - void slotReopen(QListViewItem *item); + void slotReopen(Q3ListViewItem *item); @@ -525,5 +531,5 @@ class KJanusWidget : public QWidget bool showPage( QWidget *w ); - void addPageWidget( QFrame *page, const QStringList &items, + void addPageWidget( Q3Frame *page, const QStringList &items, const QString &header, const QPixmap &pixmap ); - void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page); + void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page); QWidget *FindParent(); @@ -534,3 +540,3 @@ class KJanusWidget : public QWidget // Obsolete members. Remove in KDE 4. - QPtrList<QWidget> *mPageList; + Q3PtrList<QWidget> *mPageList; QStringList *mTitleList; @@ -540,6 +546,6 @@ class KJanusWidget : public QWidget IconListBox *mIconList; - QWidgetStack *mPageStack; + Q3WidgetStack *mPageStack; QLabel *mTitleLabel; QTabWidget *mTabControl; - QFrame *mPlainPage; + Q3Frame *mPlainPage; QWidget *mSwallowPage; @@ -549,4 +555,4 @@ class KJanusWidget : public QWidget bool mShowIconsInTreeList; - QMap<QListViewItem *, QWidget *> mTreeListToPageStack; - QMap<QListBoxItem *, QWidget *> mIconListToPageStack; + QMap<Q3ListViewItem *, QWidget *> mTreeListToPageStack; + QMap<Q3ListBoxItem *, QWidget *> mIconListToPageStack; QMap<QString, QPixmap> mFolderIconMap; diff --git a/microkde/kdeui/klistbox.cpp b/microkde/kdeui/klistbox.cpp index c65b892..71020b3 100644 --- a/microkde/kdeui/klistbox.cpp +++ b/microkde/kdeui/klistbox.cpp @@ -18,2 +18,7 @@ #include <qtimer.h> +//Added by qt3to4: +#include <QEvent> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QFocusEvent> @@ -28,2 +33,3 @@ #ifdef Q_WS_X11 +#include <QX11Info> #include <X11/Xlib.h> @@ -33,4 +39,4 @@ #endif -KListBox::KListBox( QWidget *parent, const char *name, WFlags f ) - : QListBox( parent, name, f ) +KListBox::KListBox( QWidget *parent, const char *name, Qt::WFlags f ) + : Q3ListBox( parent, name, f ) { @@ -38,8 +44,8 @@ KListBox::KListBox( QWidget *parent, const char *name, WFlags f ) this, SLOT( slotOnViewport() ) ); - connect( this, SIGNAL( onItem( QListBoxItem * ) ), - this, SLOT( slotOnItem( QListBoxItem * ) ) ); + connect( this, SIGNAL( onItem( Q3ListBoxItem * ) ), + this, SLOT( slotOnItem( Q3ListBoxItem * ) ) ); - connect( this, SIGNAL( mouseButtonClicked( int, QListBoxItem *, + connect( this, SIGNAL( mouseButtonClicked( int, Q3ListBoxItem *, const QPoint & ) ), - this, SLOT( slotMouseButtonClicked( int, QListBoxItem *, + this, SLOT( slotMouseButtonClicked( int, Q3ListBoxItem *, const QPoint & ) ) ); @@ -62,3 +68,3 @@ KListBox::KListBox( QWidget *parent, const char *name, WFlags f ) -void KListBox::slotOnItem( QListBoxItem *item ) +void KListBox::slotOnItem( Q3ListBoxItem *item ) { @@ -141,3 +147,3 @@ void KListBox::slotAutoSelect() uint keybstate; - XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, + XQueryPointer( x11Info().display(), x11Info().appRootWindow(), &root, &child, &root_x, &root_y, &win_x, &win_y, &keybstate ); @@ -145,3 +151,3 @@ void KListBox::slotAutoSelect() - QListBoxItem* previousItem = item( currentItem() ); + Q3ListBoxItem* previousItem = item( currentItem() ); setCurrentItem( m_pCurrentItem ); @@ -169,3 +175,3 @@ void KListBox::slotAutoSelect() bool down = index( previousItem ) < index( m_pCurrentItem ); - QListBoxItem* it = down ? previousItem : m_pCurrentItem; + Q3ListBoxItem* it = down ? previousItem : m_pCurrentItem; for (;it ; it = it->next() ) { @@ -188,3 +194,3 @@ void KListBox::slotAutoSelect() - if( selectionMode() == QListBox::Single ) + if( selectionMode() == Q3ListBox::Single ) emit selectionChanged( m_pCurrentItem ); @@ -215,3 +221,3 @@ void KListBox::slotAutoSelect() -void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) +void KListBox::emitExecute( Q3ListBoxItem *item, const QPoint &pos ) { @@ -222,3 +228,3 @@ void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) uint keybstate; - XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, + XQueryPointer( x11Info().display(), x11Info().appRootWindow(), &root, &child, &root_x, &root_y, &win_x, &win_y, &keybstate ); @@ -248,3 +254,3 @@ void KListBox::keyPressEvent(QKeyEvent *e) { - if( e->key() == Key_Escape ) + if( e->key() == Qt::Key_Escape ) { @@ -252,3 +258,3 @@ void KListBox::keyPressEvent(QKeyEvent *e) } - else if( e->key() == Key_F1 ) + else if( e->key() == Qt::Key_F1 ) { @@ -258,3 +264,3 @@ void KListBox::keyPressEvent(QKeyEvent *e) { - QListBox::keyPressEvent(e); + Q3ListBox::keyPressEvent(e); } @@ -266,3 +272,3 @@ void KListBox::focusOutEvent( QFocusEvent *fe ) - QListBox::focusOutEvent( fe ); + Q3ListBox::focusOutEvent( fe ); } @@ -273,3 +279,3 @@ void KListBox::leaveEvent( QEvent *e ) - QListBox::leaveEvent( e ); + Q3ListBox::leaveEvent( e ); } @@ -278,3 +284,3 @@ void KListBox::contentsMousePressEvent( QMouseEvent *e ) { - if( (selectionMode() == Extended) && (e->state() & ShiftButton) && !(e->state() & ControlButton) ) { + if( (selectionMode() == Extended) && (e->state() & Qt::ShiftButton) && !(e->state() & Qt::ControlButton) ) { bool block = signalsBlocked(); @@ -287,3 +293,3 @@ void KListBox::contentsMousePressEvent( QMouseEvent *e ) - QListBox::contentsMousePressEvent( e ); + Q3ListBox::contentsMousePressEvent( e ); } @@ -292,5 +298,5 @@ void KListBox::contentsMouseDoubleClickEvent ( QMouseEvent * e ) { - QListBox::contentsMouseDoubleClickEvent( e ); + Q3ListBox::contentsMouseDoubleClickEvent( e ); - QListBoxItem* item = itemAt( e->pos() ); + Q3ListBoxItem* item = itemAt( e->pos() ); @@ -299,3 +305,3 @@ void KListBox::contentsMouseDoubleClickEvent ( QMouseEvent * e ) - if( (e->button() == LeftButton) && !m_bUseSingle ) + if( (e->button() == Qt::LeftButton) && !m_bUseSingle ) emitExecute( item, e->globalPos() ); @@ -304,5 +310,5 @@ void KListBox::contentsMouseDoubleClickEvent ( QMouseEvent * e ) -void KListBox::slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ) +void KListBox::slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos ) { - if( (btn == LeftButton) && item ) + if( (btn == Qt::LeftButton) && item ) emitExecute( item, pos ); diff --git a/microkde/kdeui/klistbox.h b/microkde/kdeui/klistbox.h index 8023780..5ec514b 100644 --- a/microkde/kdeui/klistbox.h +++ b/microkde/kdeui/klistbox.h @@ -20,3 +20,8 @@ -#include <qlistbox.h> +#include <q3listbox.h> +//Added by qt3to4: +#include <QMouseEvent> +#include <QFocusEvent> +#include <QKeyEvent> +#include <QEvent> @@ -37,3 +42,3 @@ **/ -class KListBox : public QListBox +class KListBox : public Q3ListBox { @@ -42,3 +47,3 @@ class KListBox : public QListBox public: - KListBox( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); + KListBox( QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0 ); @@ -56,3 +61,3 @@ signals: */ - void executed( QListBoxItem *item ); + void executed( Q3ListBoxItem *item ); @@ -69,3 +74,3 @@ signals: */ - void executed( QListBoxItem *item, const QPoint &pos ); + void executed( Q3ListBoxItem *item, const QPoint &pos ); @@ -85,6 +90,6 @@ signals: */ - void doubleClicked( QListBoxItem *item, const QPoint &pos ); + void doubleClicked( Q3ListBoxItem *item, const QPoint &pos ); protected slots: - void slotOnItem( QListBoxItem *item ); + void slotOnItem( Q3ListBoxItem *item ); void slotOnViewport(); @@ -99,3 +104,3 @@ protected slots: protected: - void emitExecute( QListBoxItem *item, const QPoint &pos ); + void emitExecute( Q3ListBoxItem *item, const QPoint &pos ); @@ -125,3 +130,3 @@ protected: - QListBoxItem* m_pCurrentItem; + Q3ListBoxItem* m_pCurrentItem; @@ -131,3 +136,3 @@ protected: private slots: - void slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ); + void slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos ); diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp index 60f3084..0e98160 100644 --- a/microkde/kdeui/klistview.cpp +++ b/microkde/kdeui/klistview.cpp @@ -20,5 +20,5 @@ -#include <qdragobject.h> +#include <q3dragobject.h> #include <qtimer.h> -#include <qheader.h> +#include <q3header.h> #include <qcursor.h> @@ -27,2 +27,16 @@ #include <qpainter.h> +//Added by qt3to4: +#include <QDragLeaveEvent> +#include <QKeyEvent> +#include <Q3ValueList> +#include <Q3PtrList> +#include <QPixmap> +#include <QDragEnterEvent> +#include <QDragMoveEvent> +#include <QDropEvent> +#include <QResizeEvent> +#include <QFocusEvent> +#include <QMouseEvent> +#include <QEvent> +#include <QPaintEvent> @@ -40,3 +54,3 @@ #define private public -#include <qlistview.h> +#include <q3listview.h> #undef private @@ -48,5 +62,6 @@ #endif +#include <Q3Action> // /*US -class KListView::Tooltip : public QToolTip +class KListView::Tooltip /* TODO:hacker:TODO: : public QToolTip */ { @@ -69,3 +84,3 @@ private: KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) - : QToolTip (parent, group), + : /* XXX:hacker:XXX: QToolTip (parent, group), */ mParent (parent) @@ -125,3 +140,3 @@ public: - QListViewItem* pCurrentItem; + Q3ListViewItem* pCurrentItem; @@ -131,3 +146,3 @@ public: QTimer dragExpand; - QListViewItem* dragOverItem; + Q3ListViewItem* dragOverItem; QPoint dragOverPoint; @@ -138,3 +153,3 @@ public: //US KListViewLineEdit *editor; - QValueList<int> renameable; + Q3ValueList<int> renameable; @@ -172,4 +187,4 @@ public: QRect mOldDropHighlighter; - QListViewItem *afterItemDrop; - QListViewItem *parentItemDrop; + Q3ListViewItem *afterItemDrop; + Q3ListViewItem *parentItemDrop; @@ -228,3 +243,3 @@ void KListViewLineEdit::load(QListViewItem *i, int c) -static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir) +static int nextCol (KListView *pl, Q3ListViewItem *pi, int start, int dir) { @@ -241,5 +256,5 @@ static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir) -static QListViewItem *prevItem (QListViewItem *pi) +static Q3ListViewItem *prevItem (Q3ListViewItem *pi) { - QListViewItem *pa = pi->itemAbove(); + Q3ListViewItem *pa = pi->itemAbove(); @@ -254,3 +269,3 @@ static QListViewItem *prevItem (QListViewItem *pi) -static QListViewItem *lastQChild (QListViewItem *pi) +static Q3ListViewItem *lastQChild (Q3ListViewItem *pi) { @@ -262,3 +277,3 @@ static QListViewItem *lastQChild (QListViewItem *pi) */ - for (QListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling()) + for (Q3ListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling()) pi = pt; @@ -330,6 +345,6 @@ bool KListViewLineEdit::event (QEvent *pe) p->tabOrderedRenaming() && p->itemsRenameable() && - !(k->state() & ControlButton || k->state() & AltButton)) + !(k->state() & Qt::ControlButton || k->state() & AltButton)) { selectNextCell(item, col, - (k->key() == Key_Tab && !(k->state() & ShiftButton))); + (k->key() == Key_Tab && !(k->state() & Qt::ShiftButton))); return true; @@ -408,3 +423,3 @@ void KListViewLineEdit::slotSelectionChanged() KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse ) - : QListView( parent, name ), + : Q3ListView( parent, name ), d (new KListViewPrivate (this)) @@ -419,4 +434,4 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse this, SLOT( slotOnViewport() ) ); - connect( this, SIGNAL( onItem( QListViewItem * ) ), - this, SLOT( slotOnItem( QListViewItem * ) ) ); + connect( this, SIGNAL( onItem( Q3ListViewItem * ) ), + this, SLOT( slotOnItem( Q3ListViewItem * ) ) ); @@ -447,4 +462,4 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse { - connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), - this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); + connect (this, SIGNAL (rightButtonPressed (Q3ListViewItem*, const QPoint&, int)), + this, SLOT (emitContextMenu (Q3ListViewItem*, const QPoint&, int))); } @@ -452,8 +467,8 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse { - connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), - this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); + connect (this, SIGNAL (rightButtonClicked (Q3ListViewItem*, const QPoint&, int)), + this, SLOT (emitContextMenu (Q3ListViewItem*, const QPoint&, int))); } - connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)), - this, SLOT (emitContextMenu (KListView*, QListViewItem*))); + connect (this, SIGNAL (menuShortCutPressed (KListView*, Q3ListViewItem*)), + this, SLOT (emitContextMenu (KListView*, Q3ListViewItem*))); @@ -482,3 +497,3 @@ QSize KListView::sizeHint() const #ifdef DESKTOP_VERSION - return QListView::sizeHint(); + return Q3ListView::sizeHint(); #else @@ -505,3 +520,3 @@ bool KListView::isExecuteArea( int x ) -void KListView::slotOnItem( QListViewItem *item ) +void KListView::slotOnItem( Q3ListViewItem *item ) { @@ -536,8 +551,8 @@ void KListView::slotSettingsChanged(int category) - disconnect(this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), - this, SLOT (slotMouseButtonClicked (int, QListViewItem*, const QPoint &, int))); + disconnect(this, SIGNAL (mouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int)), + this, SLOT (slotMouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int))); if( d->bUseSingle ) - connect (this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), - this, SLOT (slotMouseButtonClicked( int, QListViewItem*, const QPoint &, int))); + connect (this, SIGNAL (mouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int)), + this, SLOT (slotMouseButtonClicked( int, Q3ListViewItem*, const QPoint &, int))); @@ -613,3 +628,3 @@ void KListView::slotAutoSelect() - QListViewItem* previousItem = currentItem(); + Q3ListViewItem* previousItem = currentItem(); setCurrentItem( d->pCurrentItem ); @@ -634,3 +649,3 @@ void KListView::slotAutoSelect() bool down = previousItem->itemPos() < d->pCurrentItem->itemPos(); - QListViewItemIterator lit( down ? previousItem : d->pCurrentItem ); + Q3ListViewItemIterator lit( down ? previousItem : d->pCurrentItem ); for ( ; lit.current(); ++lit ) { @@ -653,3 +668,3 @@ void KListView::slotAutoSelect() - if( selectionMode() == QListView::Single ) + if( selectionMode() == Q3ListView::Single ) emit selectionChanged( d->pCurrentItem ); @@ -686,3 +701,3 @@ void KListView::slotHeaderChanged() -void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c) +void KListView::emitExecute( int buttonstate, Q3ListViewItem *item, const QPoint &pos, int c) { @@ -703,3 +718,3 @@ void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint //Dont emit executed if in SC mode and Shift or Ctrl are pressed - if( !( (buttonstate==ShiftButton) || (buttonstate==ControlButton) )) { + if( !( (buttonstate==Qt::ShiftButton) || (buttonstate==Qt::ControlButton) )) { // if( !( ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) { @@ -716,3 +731,3 @@ void KListView::focusInEvent( QFocusEvent *fe ) // kdDebug()<<"KListView::focusInEvent()"<<endl; - QListView::focusInEvent( fe ); + Q3ListView::focusInEvent( fe ); if ((d->selectedBySimpleMove) @@ -749,3 +764,3 @@ void KListView::focusOutEvent( QFocusEvent *fe ) - QListView::focusOutEvent( fe ); + Q3ListView::focusOutEvent( fe ); } @@ -756,3 +771,3 @@ void KListView::leaveEvent( QEvent *e ) - QListView::leaveEvent( e ); + Q3ListView::leaveEvent( e ); } @@ -767,3 +782,3 @@ bool KListView::event( QEvent *e ) - return QListView::event(e); + return Q3ListView::event(e); } @@ -773,3 +788,3 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) //qDebug("KListView::contentsMousePressEvent"); - if( (selectionModeExt() == Extended) && (e->state() & ShiftButton) && !(e->state() & ControlButton) ) + if( (selectionModeExt() == Extended) && (e->state() & Qt::ShiftButton) && !(e->state() & Qt::ControlButton) ) { @@ -795,3 +810,3 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) QPoint p( contentsToViewport( e->pos() ) ); - QListViewItem *at = itemAt (p); + Q3ListViewItem *at = itemAt (p); @@ -803,3 +818,3 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) - if (e->button() == LeftButton && !rootDecoClicked) + if (e->button() == Qt::LeftButton && !rootDecoClicked) { @@ -815,3 +830,3 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) - QListView::contentsMousePressEvent( e ); + Q3ListView::contentsMousePressEvent( e ); } @@ -821,3 +836,3 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) if (!dragEnabled() || d->startDragPos.isNull() || !d->validDrag) { - QListView::contentsMouseMoveEvent (e); + Q3ListView::contentsMouseMoveEvent (e); return; @@ -826,3 +841,3 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) QPoint vp = contentsToViewport(e->pos()); - QListViewItem *item = itemAt( vp ); + Q3ListViewItem *item = itemAt( vp ); @@ -855,3 +870,3 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) { - QListView::contentsMouseReleaseEvent( 0 ); + Q3ListView::contentsMouseReleaseEvent( 0 ); startDrag(); @@ -864,3 +879,3 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) { - if (e->button() == LeftButton) + if (e->button() == Qt::LeftButton) { @@ -870,3 +885,3 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) QPoint p( contentsToViewport( e->pos() ) ); - QListViewItem *at = itemAt (p); + Q3ListViewItem *at = itemAt (p); if ( at ) @@ -892,3 +907,3 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) } - QListView::contentsMouseReleaseEvent( e ); + Q3ListView::contentsMouseReleaseEvent( e ); } @@ -903,4 +918,4 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) QPoint vp = contentsToViewport(e->pos()); - QListViewItem *item = itemAt( vp ); - emit QListView::doubleClicked( item ); // we do it now + Q3ListViewItem *item = itemAt( vp ); + emit Q3ListView::doubleClicked( item ); // we do it now @@ -913,3 +928,3 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) - if( (e->button() == LeftButton) && !d->bUseSingle ) { + if( (e->button() == Qt::LeftButton) && !d->bUseSingle ) { //qDebug("KListView::contentsMouseDoubleClickEvent: emitExecute"); @@ -921,3 +936,3 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) -void KListView::slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ) +void KListView::slotMouseButtonClicked( int btn, Q3ListViewItem *item, const QPoint &pos, int c ) { @@ -925,3 +940,3 @@ void KListView::slotMouseButtonClicked( int btn, QListViewItem *item, const QPoi - if( (btn == LeftButton) && item ) { + if( (btn == Qt::LeftButton) && item ) { //qDebug("KListView::slotMouseButtonClicked: emitExecute"); @@ -963,8 +978,8 @@ qDebug("KListView::contentsDropEvent drag&drop not supported yet"); -void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) +void KListView::movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme) { - QPtrList<QListViewItem> items, afterFirsts, afterNows; - QListViewItem *current=currentItem(); + Q3PtrList<Q3ListViewItem> items, afterFirsts, afterNows; + Q3ListViewItem *current=currentItem(); bool hasMoved=false; - for (QListViewItem *i = firstChild(), *iNext=0; i != 0; i = iNext) + for (Q3ListViewItem *i = firstChild(), *iNext=0; i != 0; i = iNext) { @@ -981,3 +996,3 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) - QListViewItem *afterFirst = i->itemAbove(); + Q3ListViewItem *afterFirst = i->itemAbove(); @@ -1002,3 +1017,3 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) clearSelection(); - for (QListViewItem *i=items.first(); i != 0; i=items.next() ) + for (Q3ListViewItem *i=items.first(); i != 0; i=items.next() ) i->setSelected(true); @@ -1088,3 +1103,3 @@ int KListView::depthToPixels( int depth ) -void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after) +void KListView::findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after) { @@ -1093,5 +1108,5 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte // Get the position to put it in - QListViewItem *atpos = itemAt(p); + Q3ListViewItem *atpos = itemAt(p); - QListViewItem *above; + Q3ListViewItem *above; if (!atpos) // put it at the end @@ -1125,4 +1140,4 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte // sibling, but of an upper-level group, rather than the "above" item - QListViewItem * betterAbove = above->parent(); - QListViewItem * last = above; + Q3ListViewItem * betterAbove = above->parent(); + Q3ListViewItem * last = above; while ( betterAbove ) @@ -1148,5 +1163,5 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte -QListViewItem* KListView::lastChild () const +Q3ListViewItem* KListView::lastChild () const { - QListViewItem* lastchild = firstChild(); + Q3ListViewItem* lastchild = firstChild(); @@ -1158,7 +1173,7 @@ QListViewItem* KListView::lastChild () const -QListViewItem *KListView::lastItem() const +Q3ListViewItem *KListView::lastItem() const { - QListViewItem* last = lastChild(); + Q3ListViewItem* last = lastChild(); - for (QListViewItemIterator it (last); it.current(); ++it) + for (Q3ListViewItemIterator it (last); it.current(); ++it) last = it.current(); @@ -1189,3 +1204,3 @@ qDebug("KListView::startDrag drag&drop not supported yet."); -QDragObject *KListView::dragObject() +Q3DragObject *KListView::dragObject() { @@ -1194,3 +1209,3 @@ QDragObject *KListView::dragObject() - return new QStoredDrag("application/x-qlistviewitem", viewport()); + return new Q3StoredDrag("application/x-qlistviewitem", viewport()); } @@ -1248,6 +1263,6 @@ void KListView::setDropVisualizer(bool b) -QPtrList<QListViewItem> KListView::selectedItems() const +Q3PtrList<Q3ListViewItem> KListView::selectedItems() const { - QPtrList<QListViewItem> list; - for (QListViewItem *i=firstChild(); i!=0; i=i->itemBelow()) + Q3PtrList<Q3ListViewItem> list; + for (Q3ListViewItem *i=firstChild(); i!=0; i=i->itemBelow()) if (i->isSelected()) list.append(i); @@ -1257,6 +1272,6 @@ QPtrList<QListViewItem> KListView::selectedItems() const -void KListView::moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after) +void KListView::moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after) { // sanity check - don't move a item into it's own child structure - QListViewItem *i = parent; + Q3ListViewItem *i = parent; while(i) @@ -1298,4 +1313,4 @@ void KListView::setDropVisualizerWidth (int w) -QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, - QListViewItem *after) +QRect KListView::drawDropVisualizer(QPainter *p, Q3ListViewItem *parent, + Q3ListViewItem *after) { @@ -1310,3 +1325,3 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, { - QListViewItem* it = 0L; + Q3ListViewItem* it = 0L; if (after->isOpen()) @@ -1340,3 +1355,3 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, if (p) - p->fillRect(insertmarker, Dense4Pattern); + p->fillRect(insertmarker, Qt::Dense4Pattern); @@ -1345,3 +1360,3 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, -QRect KListView::drawItemHighlighter(QPainter *painter, QListViewItem *item) +QRect KListView::drawItemHighlighter(QPainter *painter, Q3ListViewItem *item) { @@ -1378,3 +1393,3 @@ void KListView::cleanItemHighlighter () -void KListView::rename(QListViewItem *item, int c) +void KListView::rename(Q3ListViewItem *item, int c) { @@ -1405,3 +1420,3 @@ void KListView::setRenameable (int col, bool yesno) -void KListView::doneEditing(QListViewItem *item, int row) +void KListView::doneEditing(Q3ListViewItem *item, int row) { @@ -1449,3 +1464,3 @@ bool KListView::dropHighlighter() const -bool KListView::showTooltip(QListViewItem *item, const QPoint &, int column) const +bool KListView::showTooltip(Q3ListViewItem *item, const QPoint &, int column) const { @@ -1454,3 +1469,3 @@ bool KListView::showTooltip(QListViewItem *item, const QPoint &, int column) con -QString KListView::tooltip(QListViewItem *item, int column) const +QString KListView::tooltip(Q3ListViewItem *item, int column) const { @@ -1484,3 +1499,3 @@ void KListView::keyPressEvent (QKeyEvent* e) if (d->selectionMode != FileManager) - QListView::keyPressEvent (e); + Q3ListView::keyPressEvent (e); else @@ -1515,3 +1530,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) //don't care whether it's on the keypad or not - int e_state=(e->state() & ~Keypad); + int e_state=(e->state() & ~Qt::Keypad); @@ -1519,27 +1534,27 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - if ((e->key()!=Key_Shift) && (e->key()!=Key_Control) - && (e->key()!=Key_Meta) && (e->key()!=Key_Alt)) + if ((e->key()!=Qt::Key_Shift) && (e->key()!=Qt::Key_Control) + && (e->key()!=Qt::Key_Meta) && (e->key()!=Qt::Key_Alt)) { - if ((e_state==ShiftButton) && (!d->wasShiftEvent) && (!d->selectedBySimpleMove)) + if ((e_state==Qt::ShiftButton) && (!d->wasShiftEvent) && (!d->selectedBySimpleMove)) selectAll(FALSE); d->selectionDirection=0; - d->wasShiftEvent = (e_state == ShiftButton); + d->wasShiftEvent = (e_state == Qt::ShiftButton); }; - //d->wasShiftEvent = (e_state == ShiftButton); + //d->wasShiftEvent = (e_state == Qt::ShiftButton); - QListViewItem* item = currentItem(); + Q3ListViewItem* item = currentItem(); if (item==0) return; - QListViewItem* repaintItem1 = item; - QListViewItem* repaintItem2 = 0L; - QListViewItem* visItem = 0L; + Q3ListViewItem* repaintItem1 = item; + Q3ListViewItem* repaintItem2 = 0L; + Q3ListViewItem* visItem = 0L; - QListViewItem* nextItem = 0L; + Q3ListViewItem* nextItem = 0L; int items = 0; - bool shiftOrCtrl((e_state==ControlButton) || (e_state==ShiftButton)); + bool shiftOrCtrl((e_state==Qt::ControlButton) || (e_state==Qt::ShiftButton)); int selectedItems(0); - for (QListViewItem *tmpItem=firstChild(); tmpItem!=0; tmpItem=tmpItem->nextSibling()) + for (Q3ListViewItem *tmpItem=firstChild(); tmpItem!=0; tmpItem=tmpItem->nextSibling()) if (tmpItem->isSelected()) selectedItems++; @@ -1547,9 +1562,9 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) if (((selectedItems==0) || ((selectedItems==1) && (d->selectedUsingMouse))) - && (e_state==NoButton) - && ((e->key()==Key_Down) - || (e->key()==Key_Up) - || (e->key()==Key_Next) - || (e->key()==Key_Prior) - || (e->key()==Key_Home) - || (e->key()==Key_End))) + && (e_state==Qt::NoButton) + && ((e->key()==Qt::Key_Down) + || (e->key()==Qt::Key_Up) + || (e->key()==Qt::Key_Next) + || (e->key()==Qt::Key_Prior) + || (e->key()==Qt::Key_Home) + || (e->key()==Qt::Key_End))) { @@ -1565,3 +1580,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) { - case Key_Escape: + case Qt::Key_Escape: selectAll(FALSE); @@ -1570,3 +1585,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - case Key_Space: + case Qt::Key_Space: //toggle selection of current item @@ -1578,3 +1593,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - case Key_Insert: + case Qt::Key_Insert: //toggle selection of current item and move to the next item @@ -1602,3 +1617,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - case Key_Down: + case Qt::Key_Down: nextItem=item->itemBelow(); @@ -1635,3 +1650,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - case Key_Up: + case Qt::Key_Up: nextItem=item->itemAbove(); @@ -1670,3 +1685,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - case Key_End: + case Qt::Key_End: //move to the last item and toggle selection of all items inbetween @@ -1695,3 +1710,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - case Key_Home: + case Qt::Key_Home: // move to the first item and toggle selection of all items inbetween @@ -1717,3 +1732,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - case Key_Next: + case Qt::Key_Next: items=visibleHeight()/item->height(); @@ -1753,3 +1768,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - case Key_Prior: + case Qt::Key_Prior: items=visibleHeight()/item->height(); @@ -1787,3 +1802,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) - case Key_Minus: + case Qt::Key_Minus: if ( item->isOpen() ) @@ -1791,3 +1806,3 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) break; - case Key_Plus: + case Qt::Key_Plus: if ( !item->isOpen() && (item->isExpandable() || item->childCount()) ) @@ -1796,4 +1811,4 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) default: - bool realKey = ((e->key()!=Key_Shift) && (e->key()!=Key_Control) - && (e->key()!=Key_Meta) && (e->key()!=Key_Alt)); + bool realKey = ((e->key()!=Qt::Key_Shift) && (e->key()!=Qt::Key_Control) + && (e->key()!=Qt::Key_Meta) && (e->key()!=Qt::Key_Alt)); @@ -1803,5 +1818,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) //this is mainly for the "goto filename beginning with pressed char" feature (aleXXX) - QListView::SelectionMode oldSelectionMode = selectionMode(); - setSelectionMode (QListView::Multi); - QListView::keyPressEvent (e); + Q3ListView::SelectionMode oldSelectionMode = selectionMode(); + setSelectionMode (Q3ListView::Multi); + Q3ListView::keyPressEvent (e); setSelectionMode (oldSelectionMode); @@ -1852,3 +1867,3 @@ void KListView::setSelectionModeExt (SelectionModeExt mode) case NoSelection: - setSelectionMode (static_cast<QListView::SelectionMode>(static_cast<int>(mode))); + setSelectionMode (static_cast<Q3ListView::SelectionMode>(static_cast<int>(mode))); break; @@ -1856,3 +1871,3 @@ void KListView::setSelectionModeExt (SelectionModeExt mode) case FileManager: - setSelectionMode (QListView::Extended); + setSelectionMode (Q3ListView::Extended); break; @@ -1870,3 +1885,3 @@ KListView::SelectionModeExt KListView::selectionModeExt () const -int KListView::itemIndex( const QListViewItem *item ) const +int KListView::itemIndex( const Q3ListViewItem *item ) const { @@ -1878,3 +1893,3 @@ int KListView::itemIndex( const QListViewItem *item ) const else { - QListViewItemIterator it(firstChild()); + Q3ListViewItemIterator it(firstChild()); uint j = 0; @@ -1889,3 +1904,3 @@ int KListView::itemIndex( const QListViewItem *item ) const -QListViewItem* KListView::itemAtIndex(int index) +Q3ListViewItem* KListView::itemAtIndex(int index) { @@ -1895,3 +1910,3 @@ QListViewItem* KListView::itemAtIndex(int index) int j(0); - for (QListViewItemIterator it=firstChild(); it.current(); it++) + for (Q3ListViewItemIterator it=firstChild(); it.current(); it++) { @@ -1905,3 +1920,3 @@ QListViewItem* KListView::itemAtIndex(int index) -void KListView::emitContextMenu (KListView*, QListViewItem* i) +void KListView::emitContextMenu (KListView*, Q3ListViewItem* i) { @@ -1918,5 +1933,5 @@ void KListView::emitContextMenu (KListView*, QListViewItem* i) -void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) +void KListView::emitContextMenu (Q3ListViewItem* i, const QPoint& p, int col) { - QListViewItem* item = i; + Q3ListViewItem* item = i; int c = col; @@ -1935,3 +1950,3 @@ void KListView::setAcceptDrops (bool val) { - QListView::setAcceptDrops (val); + Q3ListView::setAcceptDrops (val); viewport()->setAcceptDrops (val); @@ -1947,3 +1962,3 @@ void KListView::viewportPaintEvent(QPaintEvent *e) { - QListView::viewportPaintEvent(e); + Q3ListView::viewportPaintEvent(e); @@ -1954,3 +1969,3 @@ void KListView::viewportPaintEvent(QPaintEvent *e) // This is where we actually draw the drop-visualizer - painter.fillRect(d->mOldDropVisualizer, Dense4Pattern); + painter.fillRect(d->mOldDropVisualizer, Qt::Dense4Pattern); } @@ -1990,3 +2005,3 @@ int KListView::addColumn(const QString& label, int width) { - int result = QListView::addColumn(label, width); + int result = Q3ListView::addColumn(label, width); if (d->fullWidth) { @@ -1998,5 +2013,5 @@ int KListView::addColumn(const QString& label, int width) -int KListView::addColumn(const QIconSet& iconset, const QString& label, int width) +int KListView::addColumn(const QIcon& iconset, const QString& label, int width) { - int result = QListView::addColumn(iconset, label, width); + int result = Q3ListView::addColumn(iconset, label, width); if (d->fullWidth) { @@ -2010,3 +2025,3 @@ void KListView::removeColumn(int index) { - QListView::removeColumn(index); + Q3ListView::removeColumn(index); //US if (d->fullWidth && index == columns()) header()->setStretchEnabled(true, columns()-1); @@ -2016,3 +2031,3 @@ void KListView::viewportResizeEvent(QResizeEvent* e) { - QListView::viewportResizeEvent(e); + Q3ListView::viewportResizeEvent(e); } @@ -2072,3 +2087,3 @@ void KListView::setSorting(int column, bool ascending) d->sortAscending = ascending; - QListView::setSorting(column, ascending); + Q3ListView::setSorting(column, ascending); } @@ -2085,4 +2100,4 @@ bool KListView::ascendingSort(void) const -KListViewItem::KListViewItem(QListView *parent) - : QListViewItem(parent) +KListViewItem::KListViewItem(Q3ListView *parent) + : Q3ListViewItem(parent) { @@ -2091,4 +2106,4 @@ KListViewItem::KListViewItem(QListView *parent) -KListViewItem::KListViewItem(QListViewItem *parent) - : QListViewItem(parent) +KListViewItem::KListViewItem(Q3ListViewItem *parent) + : Q3ListViewItem(parent) { @@ -2097,4 +2112,4 @@ KListViewItem::KListViewItem(QListViewItem *parent) -KListViewItem::KListViewItem(QListView *parent, QListViewItem *after) - : QListViewItem(parent, after) +KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after) + : Q3ListViewItem(parent, after) { @@ -2103,4 +2118,4 @@ KListViewItem::KListViewItem(QListView *parent, QListViewItem *after) -KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after) - : QListViewItem(parent, after) +KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after) + : Q3ListViewItem(parent, after) { @@ -2109,6 +2124,6 @@ KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after) -KListViewItem::KListViewItem(QListView *parent, +KListViewItem::KListViewItem(Q3ListView *parent, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) - : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) + : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { @@ -2117,6 +2132,6 @@ KListViewItem::KListViewItem(QListView *parent, -KListViewItem::KListViewItem(QListViewItem *parent, +KListViewItem::KListViewItem(Q3ListViewItem *parent, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) - : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) + : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { @@ -2125,6 +2140,6 @@ KListViewItem::KListViewItem(QListViewItem *parent, -KListViewItem::KListViewItem(QListView *parent, QListViewItem *after, +KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) - : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) + : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) { @@ -2133,6 +2148,6 @@ KListViewItem::KListViewItem(QListView *parent, QListViewItem *after, -KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after, +KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) - : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) + : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) { @@ -2214,3 +2229,3 @@ void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in //US if (listView()->viewport()->backgroundMode()==Qt::FixedColor) - if (listView()->viewport()->backgroundMode()==QWidget::PaletteBackground) + if (listView()->viewport()->backgroundMode()==Qt::PaletteBackground) _cg.setColor(QColorGroup::Background, static_cast< KListView* >(listView())->alternateBackground()); @@ -2219,3 +2234,3 @@ void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in } - QListViewItem::paintCell(p, _cg, column, width, alignment); + Q3ListViewItem::paintCell(p, _cg, column, width, alignment); } diff --git a/microkde/kdeui/klistview.h b/microkde/kdeui/klistview.h index 9f0d9fd..2176525 100644 --- a/microkde/kdeui/klistview.h +++ b/microkde/kdeui/klistview.h @@ -22,5 +22,16 @@ -#include <qlistview.h> - -#include <qptrlist.h> +#include <q3listview.h> + +#include <q3ptrlist.h> +//Added by qt3to4: +#include <QDragMoveEvent> +#include <QDropEvent> +#include <QDragLeaveEvent> +#include <QPaintEvent> +#include <QResizeEvent> +#include <QFocusEvent> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QEvent> +#include <QDragEnterEvent> @@ -32,3 +43,3 @@ class QDragEnterEvent; -class QDragObject; +class Q3DragObject; class KConfig; @@ -59,3 +70,3 @@ class KLineEdit; */ -class KListView : public QListView +class KListView : public Q3ListView { @@ -108,6 +119,6 @@ public: enum SelectionModeExt { - Single = QListView::Single, - Multi = QListView::Multi, - Extended = QListView::Extended, - NoSelection = QListView::NoSelection, + Single = Q3ListView::Single, + Multi = Q3ListView::Multi, + Extended = Q3ListView::Extended, + NoSelection = Q3ListView::NoSelection, FileManager @@ -116,3 +127,3 @@ public: { - QScrollView::repaintContents( contentsX(), contentsY(), + Q3ScrollView::repaintContents( contentsX(), contentsY(), visibleWidth(), visibleHeight(), erase ); @@ -163,3 +174,3 @@ public: */ - QPtrList<QListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?) + Q3PtrList<Q3ListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?) @@ -168,3 +179,3 @@ public: */ - void moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after); + void moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after); @@ -175,3 +186,3 @@ public: */ - QListViewItem *lastItem() const; + Q3ListViewItem *lastItem() const; @@ -182,3 +193,3 @@ public: */ - QListViewItem* lastChild () const; + Q3ListViewItem* lastChild () const; @@ -278,3 +289,3 @@ public: */ - int itemIndex( const QListViewItem *item ) const; + int itemIndex( const Q3ListViewItem *item ) const; @@ -285,3 +296,3 @@ public: */ - QListViewItem* itemAtIndex(int index); + Q3ListViewItem* itemAtIndex(int index); @@ -316,3 +327,3 @@ public: */ - virtual int addColumn(const QIconSet& iconset, const QString& label, int width = -1); + virtual int addColumn(const QIcon& iconset, const QString& label, int width = -1); /** @@ -390,3 +401,3 @@ signals: */ - void executed( QListViewItem *item ); + void executed( Q3ListViewItem *item ); @@ -403,3 +414,3 @@ signals: */ - void executed( QListViewItem *item, const QPoint &pos, int c ); + void executed( Q3ListViewItem *item, const QPoint &pos, int c ); @@ -419,4 +430,4 @@ signals: */ - void doubleClicked( QListViewItem *item, const QPoint &pos, int c ); - void contextRequest( QListViewItem *item, const QPoint &pos, int c ); + void doubleClicked( Q3ListViewItem *item, const QPoint &pos, int c ); + void contextRequest( Q3ListViewItem *item, const QPoint &pos, int c ); @@ -432,3 +443,3 @@ signals: */ - void dropped (QDropEvent * e, QListViewItem *after); + void dropped (QDropEvent * e, Q3ListViewItem *after); @@ -446,3 +457,3 @@ signals: */ - void dropped (KListView* list, QDropEvent* e, QListViewItem* after); + void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* after); @@ -460,3 +471,3 @@ signals: */ - void dropped (KListView* list, QDropEvent* e, QListViewItem* parent, QListViewItem* after); + void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after); @@ -473,3 +484,3 @@ signals: */ - void dropped (QDropEvent* e, QListViewItem* parent, QListViewItem* after); + void dropped (QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after); @@ -504,3 +515,3 @@ signals: */ - void moved (QListViewItem *item, QListViewItem *afterFirst, QListViewItem *afterNow); + void moved (Q3ListViewItem *item, Q3ListViewItem *afterFirst, Q3ListViewItem *afterNow); @@ -512,3 +523,3 @@ signals: */ - void moved(QPtrList<QListViewItem> &items, QPtrList<QListViewItem> &afterFirst, QPtrList<QListViewItem> &afterNow); + void moved(Q3PtrList<Q3ListViewItem> &items, Q3PtrList<Q3ListViewItem> &afterFirst, Q3PtrList<Q3ListViewItem> &afterNow); @@ -521,3 +532,3 @@ signals: */ - void itemRenamed(QListViewItem* item, const QString &str, int col); + void itemRenamed(Q3ListViewItem* item, const QString &str, int col); @@ -526,3 +537,3 @@ signals: */ - void itemRenamed(QListViewItem* item); + void itemRenamed(Q3ListViewItem* item); void signalDelete(); @@ -539,3 +550,3 @@ signals: */ - void menuShortCutPressed (KListView* list, QListViewItem* item); + void menuShortCutPressed (KListView* list, Q3ListViewItem* item); @@ -549,3 +560,3 @@ signals: */ - void contextMenu (KListView* l, QListViewItem* i, const QPoint& p); + void contextMenu (KListView* l, Q3ListViewItem* i, const QPoint& p); @@ -555,3 +566,3 @@ public slots: */ - virtual void rename(QListViewItem *item, int c); + virtual void rename(Q3ListViewItem *item, int c); @@ -675,3 +686,3 @@ protected: */ - inline bool below (QListViewItem* i, const QPoint& p) + inline bool below (Q3ListViewItem* i, const QPoint& p) { @@ -691,3 +702,3 @@ protected: //US I added buttonstate to pass the current keyboard status - void emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c); + void emitExecute( int buttonstate, Q3ListViewItem *item, const QPoint &pos, int c); @@ -723,3 +734,3 @@ protected: */ - virtual QString tooltip(QListViewItem* item, int column) const; + virtual QString tooltip(Q3ListViewItem* item, int column) const; @@ -728,3 +739,3 @@ protected: */ - virtual bool showTooltip(QListViewItem *item, const QPoint &pos, int column) const; + virtual bool showTooltip(Q3ListViewItem *item, const QPoint &pos, int column) const; @@ -807,3 +818,3 @@ protected: */ - virtual QDragObject *dragObject(); + virtual Q3DragObject *dragObject(); @@ -823,3 +834,3 @@ protected: */ - virtual QRect drawDropVisualizer (QPainter *p, QListViewItem *parent, QListViewItem *after); + virtual QRect drawDropVisualizer (QPainter *p, Q3ListViewItem *parent, Q3ListViewItem *after); @@ -831,3 +842,3 @@ protected: */ - virtual QRect drawItemHighlighter(QPainter *painter, QListViewItem *item); + virtual QRect drawItemHighlighter(QPainter *painter, Q3ListViewItem *item); @@ -888,4 +899,4 @@ protected slots: - void slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ); - void doneEditing(QListViewItem *item, int row); + void slotMouseButtonClicked( int btn, Q3ListViewItem *item, const QPoint &pos, int c ); + void doneEditing(Q3ListViewItem *item, int row); @@ -904,3 +915,3 @@ protected slots: */ - void emitContextMenu (QListViewItem*, const QPoint&, int); + void emitContextMenu (Q3ListViewItem*, const QPoint&, int); @@ -909,3 +920,3 @@ protected slots: */ - void emitContextMenu (KListView*, QListViewItem*); + void emitContextMenu (KListView*, Q3ListViewItem*); @@ -915,3 +926,3 @@ protected slots: */ - void slotOnItem( QListViewItem *item ); + void slotOnItem( Q3ListViewItem *item ); @@ -941,3 +952,3 @@ protected: */ - virtual void movableDropEvent (QListViewItem* parent, QListViewItem* afterme); + virtual void movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme); @@ -949,3 +960,3 @@ protected: */ - virtual void findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after); + virtual void findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after); @@ -976,3 +987,3 @@ private: */ -class KListViewItem : public QListViewItem +class KListViewItem : public Q3ListViewItem { @@ -985,8 +996,8 @@ public: */ - KListViewItem(QListView *parent); - KListViewItem(QListViewItem *parent); - KListViewItem(QListView *parent, QListViewItem *after); - KListViewItem(QListViewItem *parent, QListViewItem *after); + KListViewItem(Q3ListView *parent); + KListViewItem(Q3ListViewItem *parent); + KListViewItem(Q3ListView *parent, Q3ListViewItem *after); + KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after); - KListViewItem(QListView *parent, + KListViewItem(Q3ListView *parent, QString, QString = QString::null, @@ -996,3 +1007,3 @@ public: - KListViewItem(QListViewItem *parent, + KListViewItem(Q3ListViewItem *parent, QString, QString = QString::null, @@ -1002,3 +1013,3 @@ public: - KListViewItem(QListView *parent, QListViewItem *after, + KListViewItem(Q3ListView *parent, Q3ListViewItem *after, QString, QString = QString::null, @@ -1008,3 +1019,3 @@ public: - KListViewItem(QListViewItem *parent, QListViewItem *after, + KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after, QString, QString = QString::null, diff --git a/microkde/kdeui/kmainwindow.cpp b/microkde/kdeui/kmainwindow.cpp index fa678f2..bac0db8 100644 --- a/microkde/kdeui/kmainwindow.cpp +++ b/microkde/kdeui/kmainwindow.cpp @@ -23,3 +23,3 @@ */ -#include <qobjectlist.h> +#include <qobject.h> #include <qstringlist.h> @@ -29,2 +29,8 @@ #include <qapplication.h> +//Added by qt3to4: +#include <QCloseEvent> +#include <QPaintEvent> +#include <QResizeEvent> +#include <QChildEvent> +#include <Q3PtrList> @@ -56,3 +62,3 @@ static bool no_query_exit = false; KMainWindow::KMainWindow( QWidget* parent, const char *name ) - : QMainWindow( parent, name ) /*LR, f ) with the default widget flag we cannot have fastload */ /*US, KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )*/ + : Q3MainWindow( parent, name ) /*LR, f ) with the default widget flag we cannot have fastload */ /*US, KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )*/ { @@ -278,3 +284,3 @@ void KMainWindow::setPlainCaption( const QString &caption ) { - QMainWindow::setCaption( caption ); + Q3MainWindow::setCaption( caption ); #ifndef Q_WS_QWS @@ -423,6 +429,6 @@ void KMainWindow::createStandardStatusBarAction(){ -QToolBar *KMainWindow::tBar( ) +Q3ToolBar *KMainWindow::tBar( ) { if ( ! mQToolBar ) - mQToolBar = new QToolBar( this ); + mQToolBar = new Q3ToolBar( this ); return mQToolBar; @@ -445,12 +451,13 @@ KToolBar *KMainWindow::toolBar( const char * name ) */ - return new KToolBar(this, Top, false, name, honor_mode ); // non-XMLGUI + return new KToolBar(this, Qt::Top, false, name, honor_mode ); // non-XMLGUI } -QPtrListIterator<KToolBar> KMainWindow::toolBarIterator() +Q3PtrListIterator<KToolBar> KMainWindow::toolBarIterator() { toolbarList.clear(); - QPtrList<QToolBar> lst; - for ( int i = (int)QMainWindow::Unmanaged; i <= (int)Minimized; ++i ) { - lst = toolBars( (ToolBarDock)i ); - for ( QToolBar *tb = lst.first(); tb; tb = lst.next() ) { + QList<Q3ToolBar*> lst; + for ( int i = (int)Qt::Unmanaged; i <= (int)Qt::Minimized; ++i ) { + lst = toolBars( (Qt::ToolBarDock)i ); + for(QList<Q3ToolBar*>::iterator i=lst.begin();i!=lst.end();++i) { + Q3ToolBar *tb = *i; if ( !tb->inherits( "KToolBar" ) ) @@ -460,3 +467,3 @@ QPtrListIterator<KToolBar> KMainWindow::toolBarIterator() } - return QPtrListIterator<KToolBar>( toolbarList ); + return Q3PtrListIterator<KToolBar>( toolbarList ); } @@ -471,3 +478,3 @@ void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindo //US this, SLOT( setSettingsDirty() ) ); - connect( this, SIGNAL( toolBarPositionChanged(QToolBar *) ), + connect( this, SIGNAL( toolBarPositionChanged(Q3ToolBar *) ), this, SLOT( setSettingsDirty() ) ); @@ -505,3 +512,3 @@ void KMainWindow::saveAutoSaveSettings() { - ASSERT( d->autoSaveSettings ); + Q_ASSERT( d->autoSaveSettings ); //kdDebug(200) << "KMainWindow::saveAutoSaveSettings -> saving settings" << endl; @@ -641,3 +648,3 @@ void KMainWindow::saveMainWindowSettings(KConfig *config, const QString &configG KToolBar *toolbar = 0; - QPtrListIterator<KToolBar> it( toolBarIterator() ); + Q3PtrListIterator<KToolBar> it( toolBarIterator() ); while ( ( toolbar = it.current() ) ) { @@ -716,10 +723,12 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config entryList = config->readListEntry (QString::fromLatin1("MenuBar")); - entry = entryList.first(); - if (entry==QString::fromLatin1("Disabled")) - { - mb->hide(); - } else - { - mb->show(); - } + if(!entryList.empty()) { + entry = entryList.first(); + if (entry==QString::fromLatin1("Disabled")) + { + mb->hide(); + } else + { + mb->show(); + } + } } @@ -728,3 +737,3 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config KToolBar *toolbar; - QPtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator + Q3PtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator @@ -758,3 +767,3 @@ void KMainWindow::finalizeGUI( bool force ) // Both the XMLGUI and applySettings call this, hence "force" for the latter. - QPtrListIterator<KToolBar> it( toolBarIterator() ); + Q3PtrListIterator<KToolBar> it( toolBarIterator() ); for ( ; it.current() ; ++ it ) @@ -853,3 +862,3 @@ void KMainWindow::resizeEvent( QResizeEvent * e) setSettingsDirty(); - QMainWindow::resizeEvent( e ); + Q3MainWindow::resizeEvent( e ); } @@ -871,3 +880,3 @@ QMenuBar *KMainWindow::menuBar() // setMenuBar method. - QMainWindow::menuBar(); + Q3MainWindow::menuBar(); } @@ -886,3 +895,3 @@ QStatusBar *KMainWindow::statusBar() // setStatusBar method. - QMainWindow::statusBar(); + Q3MainWindow::statusBar(); } @@ -910,12 +919,6 @@ QMenuBar *KMainWindow::internalMenuBar() //US QObjectList *l = queryList( "KMenuBar", 0, false, false ); - QObjectList *l = queryList( "QMenuBar", 0, false, false ); - if ( !l || !l->first() ) { - delete l; - return 0; - } - -//US KMenuBar *m = (KMenuBar*)l->first(); - QMenuBar *m = (QMenuBar*)l->first(); - delete l; - return m; + QObjectList l = queryList( "QMenuBar", 0, false, false ); + if(l.empty()) + return 0; + return (QMenuBar*)l.front(); } @@ -926,12 +929,6 @@ QStatusBar *KMainWindow::internalStatusBar() //US QObjectList *l = queryList( "KStatusBar", 0, false, false ); - QObjectList *l = queryList( "QStatusBar", 0, false, false ); - if ( !l || !l->first() ) { - delete l; - return 0; - } - -//US KStatusBar *s = (KStatusBar*)l->first(); - QStatusBar *s = (QStatusBar*)l->first(); - delete l; - return s; + QObjectList l = queryList( "QStatusBar", 0, false, false ); + if(l.empty()) + return 0; + return (QStatusBar*)l.front(); } @@ -940,3 +937,3 @@ void KMainWindow::childEvent( QChildEvent* e) { - QMainWindow::childEvent( e ); + Q3MainWindow::childEvent( e ); } @@ -945,3 +942,3 @@ void KMainWindow::paintEvent( QPaintEvent * e) { - QMainWindow::paintEvent( e ); + Q3MainWindow::paintEvent( e ); } diff --git a/microkde/kdeui/kmainwindow.h b/microkde/kdeui/kmainwindow.h index 2dc8033..a3ac82f 100644 --- a/microkde/kdeui/kmainwindow.h +++ b/microkde/kdeui/kmainwindow.h @@ -1 +1,6 @@ +//Added by qt3to4: +#include <QResizeEvent> +#include <QChildEvent> +#include <QCloseEvent> +#include <QPaintEvent> /* @@ -52,4 +57,4 @@ class KAction; #include <kxmlguiclient.h> -#include <qmainwindow.h> -#include <qptrlist.h> +#include <q3mainwindow.h> +#include <q3ptrlist.h> @@ -57,3 +62,3 @@ class KActionCollection; -class KMainWindow : public QMainWindow, virtual public KXMLGUIClient +class KMainWindow : public Q3MainWindow, virtual public KXMLGUIClient { @@ -322,3 +327,3 @@ public: // method for getting rid of KDE-Crap - QToolBar *tBar( ); + Q3ToolBar *tBar( ); @@ -327,3 +332,3 @@ public: */ - QPtrListIterator<KToolBar> toolBarIterator(); + Q3PtrListIterator<KToolBar> toolBarIterator(); @@ -760,3 +765,3 @@ private slots: private: - QToolBar * mQToolBar; + Q3ToolBar * mQToolBar; //US KMenuBar *internalMenuBar(); @@ -769,3 +774,3 @@ private: - QPtrList<KToolBar> toolbarList; + Q3PtrList<KToolBar> toolbarList; diff --git a/microkde/kdeui/knuminput.cpp b/microkde/kdeui/knuminput.cpp index 335d6f4..da01a20 100644 --- a/microkde/kdeui/knuminput.cpp +++ b/microkde/kdeui/knuminput.cpp @@ -44,2 +44,5 @@ #include <qstyle.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QEvent> @@ -108,7 +111,7 @@ void KNumInput::setLabel(const QString & label, int a) else m_label = new QLabel(label, this, "KNumInput::QLabel"); - m_label->setAlignment((a & (~(AlignTop|AlignBottom|AlignVCenter))) - | AlignVCenter); + m_label->setAlignment((a & (~(Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter))) + | Qt::AlignVCenter); // if no vertical alignment set, use Top alignment - if(!(a & (AlignTop|AlignBottom|AlignVCenter))) - a |= AlignTop; + if(!(a & (Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter))) + a |= Qt::AlignTop; m_alignment = a; @@ -133,3 +136,3 @@ void KNumInput::layout(bool deep) - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_colw1 = m_sizeLabel.width() + 4; @@ -204,3 +207,3 @@ KIntSpinBox::KIntSpinBox(QWidget *parent, const char *name) { - editor()->setAlignment(AlignRight); + setAlignment(Qt::AlignRight); val_base = 10; @@ -217,3 +220,3 @@ KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base, { - editor()->setAlignment(AlignRight); + setAlignment(Qt::AlignRight); val_base = base; @@ -245,5 +248,5 @@ void KIntSpinBox::setEditFocus(bool mark) { - editor()->setFocus(); + setFocus(); if(mark) - editor()->selectAll(); + selectAll(); } @@ -327,3 +330,3 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) - step = m_spin->lineStep(); // maybe QRangeControl didn't like out lineStep? + step = m_spin->singleStep(); // maybe QRangeControl didn't like out lineStep? @@ -334,3 +337,3 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) m_slider = new QSlider(lower, upper, step, m_spin->value(), - QSlider::Horizontal, this); + Qt::Horizontal, this); m_slider->setTickmarks(QSlider::Below); @@ -360,3 +363,3 @@ void KIntNumInput::setMinValue(int min) { - setRange(min, m_spin->maxValue(), m_spin->lineStep(), m_slider); + setRange(min, m_spin->maxValue(), m_spin->singleStep(), m_slider); } @@ -370,3 +373,3 @@ void KIntNumInput::setMaxValue(int max) { - setRange(m_spin->minValue(), max, m_spin->lineStep(), m_slider); + setRange(m_spin->minValue(), max, m_spin->singleStep(), m_slider); } @@ -417,3 +420,3 @@ QSize KIntNumInput::minimumSizeHint() const // if in extra row, then count it here - if(m_label && (m_alignment & (AlignBottom|AlignTop))) + if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop))) h += 4 + m_sizeLabel.height(); @@ -426,3 +429,3 @@ QSize KIntNumInput::minimumSizeHint() const - if(m_alignment & (AlignTop|AlignBottom)) + if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) w = QMAX(w, m_sizeLabel.width() + 4); @@ -446,3 +449,3 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignTop)) { + if(m_label && (m_alignment & Qt::AlignTop)) { m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); @@ -451,3 +454,3 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_label->setGeometry(0, 0, w, m_sizeSpin.height()); @@ -462,3 +465,3 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignBottom)) + if(m_label && (m_alignment & Qt::AlignBottom)) m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); @@ -648,3 +651,3 @@ QSize KDoubleNumInput::minimumSizeHint() const // if in extra row, then count it here - if(m_label && (m_alignment & (AlignBottom|AlignTop))) + if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop))) h += 4 + m_sizeLabel.height(); @@ -657,3 +660,3 @@ QSize KDoubleNumInput::minimumSizeHint() const - if(m_alignment & (AlignTop|AlignBottom)) + if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) w = QMAX(w, m_sizeLabel.width() + 4); @@ -668,3 +671,3 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignTop)) { + if(m_label && (m_alignment & Qt::AlignTop)) { m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); @@ -673,3 +676,3 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_label->setGeometry(0, 0, w, m_sizeEdit.height()); @@ -685,3 +688,3 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignBottom)) + if(m_label && (m_alignment & Qt::AlignBottom)) m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); @@ -732,3 +735,3 @@ void KDoubleNumInput::setRange(double lower, double upper, double step, int slvalue = spin->value(); - int slstep = spin->lineStep(); + int slstep = spin->singleStep(); if (m_slider) { @@ -739,3 +742,3 @@ void KDoubleNumInput::setRange(double lower, double upper, double step, m_slider = new QSlider(slmin, slmax, slstep, slvalue, - QSlider::Horizontal, this); + Qt::Horizontal, this); m_slider->setTickmarks(QSlider::Below); @@ -914,3 +917,3 @@ KDoubleSpinBox::KDoubleSpinBox( QWidget * parent, const char * name ) { - editor()->setAlignment( Qt::AlignRight ); + setAlignment( Qt::AlignRight ); d = new Private(); @@ -924,3 +927,3 @@ KDoubleSpinBox::KDoubleSpinBox( double lower, double upper, double step, { - editor()->setAlignment( Qt::AlignRight ); + setAlignment( Qt::AlignRight ); d = new Private(); @@ -1029,3 +1032,3 @@ void KDoubleSpinBox::setMaxValue( double value ) { double KDoubleSpinBox::lineStep() const { - return d->mapToDouble( base::lineStep() ); + return d->mapToDouble( base::singleStep() ); } @@ -1074,3 +1077,3 @@ void KDoubleSpinBox::updateValidator() { this, "d->mValidator" ); - base::setValidator( d->mValidator ); + lineEdit()->setValidator( d->mValidator ); } else diff --git a/microkde/kdeui/knuminput.h b/microkde/kdeui/knuminput.h index 123fefa..9f9e200 100644 --- a/microkde/kdeui/knuminput.h +++ b/microkde/kdeui/knuminput.h @@ -31,2 +31,7 @@ #include <qspinbox.h> +#include <QLineEdit> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> +#include <QEvent> @@ -83,3 +88,3 @@ public: */ - virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); + virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); @@ -304,3 +309,3 @@ public: */ - virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); + virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); @@ -590,3 +595,3 @@ public: */ - virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); + virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); /** @@ -760,2 +765,6 @@ public: + void setValidator(const QValidator *v) { + lineEdit()->setValidator(v); + } + protected: diff --git a/microkde/kdeui/kpopupmenu.cpp b/microkde/kdeui/kpopupmenu.cpp index 96d2a87..7e1503c 100644 --- a/microkde/kdeui/kpopupmenu.cpp +++ b/microkde/kdeui/kpopupmenu.cpp @@ -3,2 +3,5 @@ #include <qtimer.h> +//Added by qt3to4: +#include <QFocusEvent> +#include <Q3PopupMenu> @@ -6,3 +9,3 @@ KPopupMenu::KPopupMenu ( QWidget * parent, const char * name ) - : QPopupMenu ( parent, name ) {;} + : Q3PopupMenu ( parent, name ) {;} diff --git a/microkde/kdeui/kpopupmenu.h b/microkde/kdeui/kpopupmenu.h index fd00f36..1c903ad 100644 --- a/microkde/kdeui/kpopupmenu.h +++ b/microkde/kdeui/kpopupmenu.h @@ -3,3 +3,5 @@ -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <QFocusEvent> #ifdef DESKTOP_VERSION @@ -11,3 +13,3 @@ -class KPopupMenu : public QPopupMenu +class KPopupMenu : public Q3PopupMenu { diff --git a/microkde/kdeui/kseparator.cpp b/microkde/kdeui/kseparator.cpp index d028420..66000f0 100644 --- a/microkde/kdeui/kseparator.cpp +++ b/microkde/kdeui/kseparator.cpp @@ -20,2 +20,4 @@ #include <qstyle.h> +//Added by qt3to4: +#include <Q3Frame> @@ -28,4 +30,4 @@ -KSeparator::KSeparator(QWidget* parent, const char* name, WFlags f) - : QFrame(parent, name, f) +KSeparator::KSeparator(QWidget* parent, const char* name, Qt::WFlags f) + : Q3Frame(parent, name, f) { @@ -38,4 +40,4 @@ KSeparator::KSeparator(QWidget* parent, const char* name, WFlags f) -KSeparator::KSeparator(int orientation, QWidget* parent, const char* name, WFlags f) - : QFrame(parent, name, f) +KSeparator::KSeparator(int orientation, QWidget* parent, const char* name, Qt::WFlags f) + : Q3Frame(parent, name, f) { @@ -52,5 +54,5 @@ void KSeparator::setOrientation(int orientation) { - case Vertical: + case Qt::Vertical: case VLine: - setFrameStyle( QFrame::VLine | QFrame::Sunken ); + setFrameStyle( Q3Frame::VLine | Q3Frame::Sunken ); setMinimumSize(2, 0); @@ -61,5 +63,5 @@ void KSeparator::setOrientation(int orientation) - case Horizontal: + case Qt::Horizontal: case HLine: - setFrameStyle( QFrame::HLine | QFrame::Sunken ); + setFrameStyle( Q3Frame::HLine | Q3Frame::Sunken ); setMinimumSize(0, 2); diff --git a/microkde/kdeui/kseparator.h b/microkde/kdeui/kseparator.h index 6d2712a..c673475 100644 --- a/microkde/kdeui/kseparator.h +++ b/microkde/kdeui/kseparator.h @@ -22,3 +22,3 @@ -#include <qframe.h> +#include <q3frame.h> @@ -30,3 +30,3 @@ */ -class KSeparator : public QFrame +class KSeparator : public Q3Frame { @@ -38,3 +38,3 @@ class KSeparator : public QFrame **/ - KSeparator(QWidget* parent=0, const char* name=0, WFlags f=0); + KSeparator(QWidget* parent=0, const char* name=0, Qt::WFlags f=0); /** @@ -46,3 +46,3 @@ class KSeparator : public QFrame KSeparator(int orientation, QWidget* parent=0, const char* name=0, - WFlags f=0); + Qt::WFlags f=0); diff --git a/microkde/kdeui/ksqueezedtextlabel.cpp b/microkde/kdeui/ksqueezedtextlabel.cpp index 37fa29a..e2c61fd 100644 --- a/microkde/kdeui/ksqueezedtextlabel.cpp +++ b/microkde/kdeui/ksqueezedtextlabel.cpp @@ -20,2 +20,5 @@ #include <qtooltip.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> diff --git a/microkde/kdeui/ksqueezedtextlabel.h b/microkde/kdeui/ksqueezedtextlabel.h index 1634adc..487d0b0 100644 --- a/microkde/kdeui/ksqueezedtextlabel.h +++ b/microkde/kdeui/ksqueezedtextlabel.h @@ -22,2 +22,4 @@ #include <qlabel.h> +//Added by qt3to4: +#include <QResizeEvent> diff --git a/microkde/kdeui/kstdaction.cpp b/microkde/kdeui/kstdaction.cpp index cfd7b54..f0d162d 100644 --- a/microkde/kdeui/kstdaction.cpp +++ b/microkde/kdeui/kstdaction.cpp @@ -21,3 +21,3 @@ #include <qtoolbutton.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp index 027e5e9..02db316 100644 --- a/microkde/kdeui/ktoolbar.cpp +++ b/microkde/kdeui/ktoolbar.cpp @@ -27,5 +27,16 @@ #undef Always -#include <qdockwindow.h> +#include <q3dockwindow.h> #endif - +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PtrList> +#include <QPixmap> +#include <Q3Frame> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QChildEvent> +#include <QEvent> +#include <QShowEvent> +#include <QDesktopWidget> +#include <QBoxLayout> @@ -42,3 +53,3 @@ #include <qrect.h> -#include <qobjectlist.h> +#include <qobject.h> #include <qtimer.h> @@ -71,4 +82,4 @@ -#include <qpopupmenu.h> -#include <qmainwindow.h> +#include <q3popupmenu.h> +#include <q3mainwindow.h> @@ -104,3 +115,3 @@ public: //US oldPos = Qt::DockUnmanaged; - oldPos = QMainWindow::Unmanaged; + oldPos = Qt::Unmanaged; @@ -131,3 +142,3 @@ public: - QMainWindow::ToolBarDock oldPos; + Qt::ToolBarDock oldPos; @@ -138,5 +149,5 @@ public: //US ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {} - ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( QMainWindow::Top ) {} + ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {} //US ToolBarInfo( Qt::Dock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} - ToolBarInfo( QMainWindow::ToolBarDock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} + ToolBarInfo( Qt::ToolBarDock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} int index, offset; @@ -144,3 +155,3 @@ public: //US Qt::Dock dock; - QMainWindow::ToolBarDock dock; + Qt::ToolBarDock dock; }; @@ -148,3 +159,3 @@ public: ToolBarInfo toolBarInfo; - QValueList<int> iconSizes; + Q3ValueList<int> iconSizes; QTimer repaintTimer; @@ -160,11 +171,11 @@ public: - QPtrList<QWidget> idleButtons; + Q3PtrList<QWidget> idleButtons; }; -KToolBarSeparator::KToolBarSeparator(Orientation o , bool l, QToolBar *parent, +KToolBarSeparator::KToolBarSeparator(Qt::Orientation o , bool l, Q3ToolBar *parent, const char* name ) - :QFrame( parent, name ), line( l ) + :Q3Frame( parent, name ), line( l ) { - connect( parent, SIGNAL(orientationChanged(Orientation)), - this, SLOT(setOrientation(Orientation)) ); + connect( parent, SIGNAL(orientationChanged(Qt::Orientation)), + this, SLOT(setOrientation(Qt::Orientation)) ); setOrientation( o ); @@ -174,3 +185,3 @@ KToolBarSeparator::KToolBarSeparator(Orientation o , bool l, QToolBar *parent, -void KToolBarSeparator::setOrientation( Orientation o ) +void KToolBarSeparator::setOrientation( Qt::Orientation o ) { @@ -178,3 +189,3 @@ void KToolBarSeparator::setOrientation( Orientation o ) if ( line ) { - if ( orientation() == Vertical ) + if ( orientation() == Qt::Vertical ) setFrameStyle( HLine + Sunken ); @@ -194,3 +205,3 @@ QSize KToolBarSeparator::sizeHint() const { - return orientation() == Vertical ? QSize( 0, 6 ) : QSize( 6, 0 ); + return orientation() == Qt::Vertical ? QSize( 0, 6 ) : QSize( 6, 0 ); } @@ -204,4 +215,4 @@ KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool rea #ifdef DESKTOP_VERSION - : QToolBar( QString::fromLatin1( name ), - parent && parent->inherits( "QMainWindow" ) ? static_cast<QMainWindow*>(parent) : 0, + : Q3ToolBar( QString::fromLatin1( name ), + parent && parent->inherits( "Q3MainWindow" ) ? static_cast<Q3MainWindow*>(parent) : 0, parent, FALSE, @@ -209,3 +220,3 @@ KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool rea #else - : QPEToolBar( parent && parent->inherits( "QMainWindow" ) ? static_cast<QMainWindow*>(parent) : 0, + : QPEToolBar( parent && parent->inherits( "Q3MainWindow" ) ? static_cast<Q3MainWindow*>(parent) : 0, QString::fromLatin1( name )) @@ -218,5 +229,5 @@ KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool rea -KToolBar::KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) +KToolBar::KToolBar( Q3MainWindow *parentWindow, Qt::ToolBarDock dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) #ifdef DESKTOP_VERSION - : QToolBar( QString::fromLatin1( name ), + : Q3ToolBar( QString::fromLatin1( name ), parentWindow, dock, newLine, @@ -233,5 +244,5 @@ KToolBar::KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock, bo -KToolBar::KToolBar( QMainWindow *parentWindow, QWidget *dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) +KToolBar::KToolBar( Q3MainWindow *parentWindow, QWidget *dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) #ifdef DESKTOP_VERSION - : QToolBar( QString::fromLatin1( name ), + : Q3ToolBar( QString::fromLatin1( name ), parentWindow, dock, newLine, @@ -282,4 +293,4 @@ void KToolBar::init( bool readConfig, bool honorStyle ) if ( mainWindow() ) - connect( mainWindow(), SIGNAL( toolBarPositionChanged( QToolBar * ) ), - this, SLOT( toolBarPosChanged( QToolBar * ) ) ); + connect( mainWindow(), SIGNAL( toolBarPositionChanged( Q3ToolBar * ) ), + this, SLOT( toolBarPosChanged( Q3ToolBar * ) ) ); @@ -343,3 +354,3 @@ int KToolBar::insertButton(const QPixmap& pixmap, int id, const char *signal, -int KToolBar::insertButton(const QString& icon, int id, QPopupMenu *popup, +int KToolBar::insertButton(const QString& icon, int id, Q3PopupMenu *popup, bool enabled, const QString &text, int index ) @@ -355,3 +366,3 @@ int KToolBar::insertButton(const QString& icon, int id, QPopupMenu *popup, -int KToolBar::insertButton(const QPixmap& pixmap, int id, QPopupMenu *popup, +int KToolBar::insertButton(const QPixmap& pixmap, int id, Q3PopupMenu *popup, bool enabled, const QString &text, int index ) @@ -542,3 +553,3 @@ void KToolBar::setButtonIcon( int id, const QString& _icon ) -void KToolBar::setButtonIconSet( int id, const QIconSet& iconset ) +void KToolBar::setButtonIconSet( int id, const QIcon& iconset ) { @@ -554,3 +565,3 @@ void KToolBar::setButtonIconSet( int id, const QIconSet& iconset ) -void KToolBar::setDelayedPopup (int id , QPopupMenu *_popup, bool toggle ) +void KToolBar::setDelayedPopup (int id , Q3PopupMenu *_popup, bool toggle ) { @@ -789,3 +800,3 @@ void KToolBar::clear () { - QToolBar::clear(); + Q3ToolBar::clear(); widget2id.clear(); @@ -878,3 +889,3 @@ void KToolBar::setBarPos (BarPosition bpos) //US mainWindow()->moveDockWindow( this, (Dock)bpos ); - mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos ); + mainWindow()->moveToolBar( this, (Qt::ToolBarDock)bpos ); } @@ -884,11 +895,11 @@ const KToolBar::BarPosition KToolBar::barPos() { - if ( !(QMainWindow*)mainWindow() ) + if ( !(Q3MainWindow*)mainWindow() ) return KToolBar::Top; //US Dock dock; - QMainWindow::ToolBarDock dock; + Qt::ToolBarDock dock; int dm1, dm2; bool dm3; - ((QMainWindow*)mainWindow())->getLocation( (QToolBar*)this, dock, dm1, dm3, dm2 ); + ((Q3MainWindow*)mainWindow())->getLocation( (Q3ToolBar*)this, dock, dm1, dm3, dm2 ); //US if ( dock == DockUnmanaged ) { - if ( dock == QMainWindow::Unmanaged ) { + if ( dock == Qt::Unmanaged ) { return (KToolBar::BarPosition)Top; @@ -969,3 +980,3 @@ void KToolBar::setIconText(IconText icontext, bool update) if ( mainWindow() ) { - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); mw->setUpdatesEnabled( FALSE ); @@ -1006,3 +1017,3 @@ void KToolBar::setIconSize(int size, bool update) if ( mainWindow() ) { - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); mw->setUpdatesEnabled( FALSE ); @@ -1064,6 +1075,6 @@ void KToolBar::setFlat (bool flag) //US mainWindow()->moveDockWindow( this, DockMinimized ); - mainWindow()->moveToolBar( this, QMainWindow::Minimized ); + mainWindow()->moveToolBar( this, Qt::Minimized ); else //US mainWindow()->moveDockWindow( this, DockTop ); - mainWindow()->moveToolBar( this, QMainWindow::Top ); + mainWindow()->moveToolBar( this, Qt::Top ); // And remember to save the new look later @@ -1251,5 +1262,5 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) return; - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); if ( mw->toolBarsMovable() && d->m_enableContext ) { - if ( m->button() == RightButton ) { + if ( m->button() == Qt::RightButton ) { int i = contextMenu()->exec( m->globalPos(), 0 ); @@ -1260,3 +1271,3 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) //US mw->moveDockWindow( this, DockLeft ); - mw->moveToolBar( this, QMainWindow::Left ); + mw->moveToolBar( this, Qt::Left ); break; @@ -1264,3 +1275,3 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) //US mw->moveDockWindow( this, DockRight ); - mw->moveToolBar( this, QMainWindow::Right ); + mw->moveToolBar( this, Qt::Right ); break; @@ -1268,3 +1279,3 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) //US mw->moveDockWindow( this, DockTop ); - mw->moveToolBar( this, QMainWindow::Top ); + mw->moveToolBar( this, Qt::Top ); break; @@ -1272,3 +1283,3 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) //US mw->moveDockWindow( this, DockBottom ); - mw->moveToolBar( this, QMainWindow::Bottom ); + mw->moveToolBar( this, Qt::Bottom ); break; @@ -1278,3 +1289,3 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) //US mw->moveDockWindow( this, DockMinimized ); - mw->moveToolBar( this, QMainWindow::Minimized ); + mw->moveToolBar( this, Qt::Minimized ); break; @@ -1334,3 +1345,3 @@ void KToolBar::rebuildLayout() } - if ( w->inherits( "QPopupMenu" ) ) + if ( w->inherits( "Q3PopupMenu" ) ) continue; @@ -1366,3 +1377,3 @@ void KToolBar::childEvent( QChildEvent *e ) if ( e->type() == QEvent::ChildInserted ) { - if ( !e->child()->inherits( "QPopupMenu" ) && + if ( !e->child()->inherits( "Q3PopupMenu" ) && ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) { @@ -1377,6 +1388,6 @@ void KToolBar::childEvent( QChildEvent *e ) } - } else { + } else if( e->type() == QEvent::ChildRemoved ) { removeWidgetInternal( w ); } - if ( isVisibleTo( 0 ) ) + /* TODO:hacker: if ( isVisibleTo( 0 ) ) { @@ -1392,5 +1403,5 @@ void KToolBar::childEvent( QChildEvent *e ) layoutTimer->start( 50, TRUE ); - } + } */ } - QToolBar::childEvent( e ); + Q3ToolBar::childEvent( e ); } @@ -1418,3 +1429,3 @@ void KToolBar::repaintMe() setUpdatesEnabled( true ); - QToolBar::repaint( true ); + Q3ToolBar::repaint( true ); qDebug(" KToolBar::repaintMe() "); @@ -1425,3 +1436,3 @@ void KToolBar::showEvent( QShowEvent *e ) rebuildLayout(); - QToolBar::showEvent( e ); + Q3ToolBar::showEvent( e ); } @@ -1430,3 +1441,3 @@ void KToolBar::setStretchableWidget( QWidget *w ) { - QToolBar::setStretchableWidget( w ); + Q3ToolBar::setStretchableWidget( w ); stretchableWidget = w; @@ -1436,3 +1447,3 @@ QSizePolicy KToolBar::sizePolicy() const { - if ( orientation() == Horizontal ) + if ( orientation() == Qt::Horizontal ) return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); @@ -1444,3 +1455,3 @@ QSize KToolBar::sizeHint() const { - QSize sh = QToolBar::sizeHint(); + QSize sh = Q3ToolBar::sizeHint(); //qDebug("%x KToolBar::sizeHint() %d %d ",this, QToolBar::sizeHint().width(),QToolBar::sizeHint().height() ); @@ -1510,3 +1521,3 @@ QSize KToolBar::sizeHint() const default: - minSize = QToolBar::sizeHint(); + minSize = Q3ToolBar::sizeHint(); break; @@ -1534,3 +1545,3 @@ void KToolBar::hide() { - QToolBar::hide(); + Q3ToolBar::hide(); } @@ -1539,3 +1550,3 @@ void KToolBar::show() { - QToolBar::show(); + Q3ToolBar::show(); } @@ -1546,3 +1557,3 @@ void KToolBar::resizeEvent( QResizeEvent *e ) setUpdatesEnabled( FALSE ); - QToolBar::resizeEvent( e ); + Q3ToolBar::resizeEvent( e ); if (b) @@ -1728,3 +1739,3 @@ void KToolBar::applyAppearanceSettings(KConfig *config, const QString &_configGr - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); @@ -1807,15 +1818,15 @@ void KToolBar::applySettings(KConfig *config, const QString &_configGroup) */ - QMainWindow::ToolBarDock pos(QMainWindow::Top); + Qt::ToolBarDock pos(Qt::DockTop); if ( position == "Top" ) - pos = QMainWindow::Top; + pos = Qt::Top; else if ( position == "Bottom" ) - pos = QMainWindow::Bottom; + pos = Qt::Bottom; else if ( position == "Left" ) - pos = QMainWindow::Left; + pos = Qt::Left; else if ( position == "Right" ) - pos = QMainWindow::Right; + pos = Qt::Right; else if ( position == "Floating" ) - pos = QMainWindow::TornOff; + pos = Qt::TornOff; else if ( position == "Flat" ) - pos = QMainWindow::Minimized; + pos = Qt::Minimized; @@ -1829,3 +1840,3 @@ void KToolBar::applySettings(KConfig *config, const QString &_configGroup) { - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); @@ -1864,3 +1875,3 @@ bool KToolBar::event( QEvent *e ) - return QToolBar::event( e ); + return Q3ToolBar::event( e ); } @@ -1882,3 +1893,3 @@ void KToolBar::slotRepaint() -void KToolBar::toolBarPosChanged( QToolBar *tb ) +void KToolBar::toolBarPosChanged( Q3ToolBar *tb ) { @@ -1887,5 +1898,5 @@ void KToolBar::toolBarPosChanged( QToolBar *tb ) //US if ( d->oldPos == DockMinimized ) - if ( d->oldPos == QMainWindow::Minimized ) + if ( d->oldPos == Qt::Minimized ) rebuildLayout(); - d->oldPos = (QMainWindow::ToolBarDock)barPos(); + d->oldPos = (Qt::ToolBarDock)barPos(); /*US @@ -2033,3 +2044,3 @@ void KToolBar::getAttributes( QString &position, QString &icontext, int &index ) if ( mainWindow() ) { - QMainWindow::ToolBarDock dock; + Qt::ToolBarDock dock; bool newLine; @@ -2102,3 +2113,3 @@ void KToolBar::positionYourself( bool force ) //US KPopupMenu *KToolBar::contextMenu() -QPopupMenu *KToolBar::contextMenu() +Q3PopupMenu *KToolBar::contextMenu() { @@ -2110,3 +2121,3 @@ QPopupMenu *KToolBar::contextMenu() //US context = new KPopupMenu( this, "qt_dockwidget_internal" ); - context = new QPopupMenu( this, "qt_dockwidget_internal" ); + context = new Q3PopupMenu( this, "qt_dockwidget_internal" ); //US context->insertTitle(i18n("Toolbar Menu")); @@ -2114,3 +2125,3 @@ QPopupMenu *KToolBar::contextMenu() //US KPopupMenu *orient = new KPopupMenu( context, "orient" ); - QPopupMenu *orient = new QPopupMenu( context, "orient" ); + Q3PopupMenu *orient = new Q3PopupMenu( context, "orient" ); orient->insertItem( i18n("toolbar position string","Top"), CONTEXT_TOP ); @@ -2124,3 +2135,3 @@ QPopupMenu *KToolBar::contextMenu() //US KPopupMenu *mode = new KPopupMenu( context, "mode" ); - QPopupMenu *mode = new QPopupMenu( context, "mode" ); + Q3PopupMenu *mode = new Q3PopupMenu( context, "mode" ); mode->insertItem( i18n("Icons Only"), CONTEXT_ICONS ); @@ -2131,6 +2142,6 @@ QPopupMenu *KToolBar::contextMenu() //US KPopupMenu *size = new KPopupMenu( context, "size" ); - QPopupMenu *size = new QPopupMenu( context, "size" ); + Q3PopupMenu *size = new Q3PopupMenu( context, "size" ); size->insertItem( i18n("Default"), CONTEXT_ICONSIZES ); // Query the current theme for available sizes - QValueList<int> avSizes; + Q3ValueList<int> avSizes; /*US @@ -2147,3 +2158,3 @@ QPopupMenu *KToolBar::contextMenu() - QValueList<int>::Iterator it; + Q3ValueList<int>::Iterator it; for (it=avSizes.begin(); it!=avSizes.end(); it++) { @@ -2220,4 +2231,4 @@ void KToolBar::slotContextAboutToShow() - QValueList<int>::ConstIterator iIt = d->iconSizes.begin(); - QValueList<int>::ConstIterator iEnd = d->iconSizes.end(); + Q3ValueList<int>::ConstIterator iIt = d->iconSizes.begin(); + Q3ValueList<int>::ConstIterator iEnd = d->iconSizes.end(); for (; iIt != iEnd; ++iIt ) diff --git a/microkde/kdeui/ktoolbar.h b/microkde/kdeui/ktoolbar.h index 3319fa8..4e00abd 100644 --- a/microkde/kdeui/ktoolbar.h +++ b/microkde/kdeui/ktoolbar.h @@ -28,3 +28,3 @@ #define private public -#include <qtoolbar.h> +#include <q3toolbar.h> #undef private @@ -32,3 +32,3 @@ #else -#include <qtoolbar.h> +#include <q3toolbar.h> #endif @@ -36,10 +36,18 @@ -#include <qmainwindow.h> +#include <q3mainwindow.h> #include <qcombobox.h> #include <qmap.h> -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <QPixmap> +#include <QResizeEvent> +#include <Q3PopupMenu> +#include <QMouseEvent> +#include <QChildEvent> +#include <QEvent> +#include <QShowEvent> #include <kglobal.h> -#include <qguardedptr.h> -#include <qframe.h> -#include <qiconset.h> +#include <qpointer.h> +#include <q3frame.h> +#include <qicon.h> @@ -48,3 +56,3 @@ class QSize; class QPixmap; -class QPopupMenu; +class Q3PopupMenu; class QStringList; @@ -65,3 +73,3 @@ class KToolBarPrivate; -class KToolBarSeparator : public QFrame +class KToolBarSeparator : public Q3Frame { @@ -69,6 +77,6 @@ class KToolBarSeparator : public QFrame public: - KToolBarSeparator( Orientation, bool l, QToolBar *parent, const char* name=0 ); + KToolBarSeparator( Qt::Orientation, bool l, Q3ToolBar *parent, const char* name=0 ); QSize sizeHint() const; - Orientation orientation() const { return orient; } + Qt::Orientation orientation() const { return orient; } QSizePolicy sizePolicy() const; @@ -76,3 +84,3 @@ public: public slots: - void setOrientation( Orientation ); + void setOrientation( Qt::Orientation ); protected: @@ -80,3 +88,3 @@ protected: private: - Orientation orient; + Qt::Orientation orient; bool line; @@ -113,6 +121,6 @@ private: #ifndef DESKTOP_VERSION -#define QToolBar QPEToolBar +#define Q3ToolBar QPEToolBar #endif - class KToolBar : public QToolBar + class KToolBar : public Q3ToolBar { @@ -129,3 +137,3 @@ private: #ifndef DESKTOP_VERSION -#undef QToolBar +#undef Q3ToolBar #endif @@ -177,3 +185,3 @@ public: */ - KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock /*= QMainWindow::Top*/, bool newLine = false, + KToolBar( Q3MainWindow *parentWindow, Qt::ToolBarDock dock /*= QMainWindow::Top*/, bool newLine = false, const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); @@ -195,3 +203,3 @@ public: */ - KToolBar( QMainWindow *parentWindow, QWidget *dock, bool newLine = false, + KToolBar( Q3MainWindow *parentWindow, QWidget *dock, bool newLine = false, const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); @@ -305,3 +313,3 @@ public: */ - int insertButton(const QString& icon, int id, QPopupMenu *popup, + int insertButton(const QString& icon, int id, Q3PopupMenu *popup, bool enabled, const QString&_text, int index=-1); @@ -320,3 +328,3 @@ public: */ - int insertButton(const QPixmap& pixmap, int id, QPopupMenu *popup, + int insertButton(const QPixmap& pixmap, int id, Q3PopupMenu *popup, bool enabled, const QString&_text, int index=-1); @@ -361,3 +369,3 @@ public: int size=70, int index=-1, - QComboBox::Policy policy = QComboBox::AtBottom); + QComboBox::Policy policy = QComboBox::InsertAtBottom); @@ -377,3 +385,3 @@ public: int size=70, int index=-1, - QComboBox::Policy policy = QComboBox::AtBottom); + QComboBox::Policy policy = QComboBox::InsertAtBottom); @@ -467,3 +475,3 @@ public: */ - void setButtonIconSet( int id, const QIconSet& iconset ); + void setButtonIconSet( int id, const QIcon& iconset ); @@ -493,3 +501,3 @@ public: */ - void setDelayedPopup (int id , QPopupMenu *_popup, bool toggle = false); + void setDelayedPopup (int id , Q3PopupMenu *_popup, bool toggle = false); @@ -1062,3 +1070,3 @@ public slots: virtual void setIconText( const QString &txt ) - { QToolBar::setIconText( txt ); } + { Q3ToolBar::setIconText( txt ); } void slotRepaint(); @@ -1079,3 +1087,3 @@ private slots: void slotIconChanged(int); - void toolBarPosChanged( QToolBar *tb ); + void toolBarPosChanged( Q3ToolBar *tb ); void slotContextAboutToShow(); @@ -1092,3 +1100,3 @@ private: //US KPopupMenu *contextMenu(); - QPopupMenu *contextMenu(); + Q3PopupMenu *contextMenu(); @@ -1098,6 +1106,6 @@ private: //US KPopupMenu *context; - QPopupMenu *context; - QPtrList<QWidget> widgets; + Q3PopupMenu *context; + Q3PtrList<QWidget> widgets; QTimer *layoutTimer; - QGuardedPtr<QWidget> stretchableWidget, rightAligned; + QPointer<QWidget> stretchableWidget, rightAligned; protected: diff --git a/microkde/kdeui/ktoolbarbutton.cpp b/microkde/kdeui/ktoolbarbutton.cpp index 1d5d0e5..7b98b32 100644 --- a/microkde/kdeui/ktoolbarbutton.cpp +++ b/microkde/kdeui/ktoolbarbutton.cpp @@ -35,3 +35,3 @@ #include <qbitmap.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcursor.h> @@ -39,2 +39,6 @@ #include <qlayout.h> +//Added by qt3to4: +#include <QPixmap> +#include <QMouseEvent> +#include <QEvent> @@ -50,3 +54,3 @@ -template class QIntDict<KToolBarButton>; +template class Q3IntDict<KToolBarButton>; @@ -117,3 +121,3 @@ KToolBarButton::KToolBarButton( const QString& _icon, int _id, - setFocusPolicy( NoFocus ); + setFocusPolicy( Qt::NoFocus ); @@ -148,3 +152,3 @@ KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id, - setFocusPolicy( NoFocus ); + setFocusPolicy( Qt::NoFocus ); @@ -163,3 +167,3 @@ KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id, // set our pixmap and do our initial setup - setIconSet( QIconSet( pixmap )); + setIconSet( QIcon( pixmap )); modeChange(); @@ -294,3 +298,3 @@ void KToolBarButton::setIcon( const QString &icon ) -void KToolBarButton::setIconSet( const QIconSet &iconset ) +void KToolBarButton::setIconSet( const QIcon &iconset ) { @@ -307,4 +311,4 @@ void KToolBarButton::setPixmap( const QPixmap &pixmap ) } - QIconSet set = iconSet(); - set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Active ); + QIcon set = iconSet(); + set.setPixmap( pixmap, QIcon::Automatic, QIcon::Active ); QToolButton::setIconSet( set ); @@ -314,4 +318,4 @@ void KToolBarButton::setDefaultPixmap( const QPixmap &pixmap ) { - QIconSet set = iconSet(); - set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Normal ); + QIcon set = iconSet(); + set.setPixmap( pixmap, QIcon::Automatic, QIcon::Normal ); QToolButton::setIconSet( set ); @@ -321,4 +325,4 @@ void KToolBarButton::setDisabledPixmap( const QPixmap &pixmap ) { - QIconSet set = iconSet(); - set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Disabled ); + QIcon set = iconSet(); + set.setPixmap( pixmap, QIcon::Automatic, QIcon::Disabled ); QToolButton::setIconSet( set ); @@ -328,3 +332,3 @@ void KToolBarButton::setDefaultIcon( const QString& icon ) { - QIconSet set = iconSet(); + QIcon set = iconSet(); QPixmap pm; @@ -336,3 +340,3 @@ void KToolBarButton::setDefaultIcon( const QString& icon ) d->m_iconSize ); - set.setPixmap( pm, QIconSet::Automatic, QIconSet::Normal ); + set.setPixmap( pm, QIcon::Automatic, QIcon::Normal ); QToolButton::setIconSet( set ); @@ -342,3 +346,3 @@ void KToolBarButton::setDisabledIcon( const QString& icon ) { - QIconSet set = iconSet(); + QIcon set = iconSet(); QPixmap pm; @@ -350,3 +354,3 @@ void KToolBarButton::setDisabledIcon( const QString& icon ) d->m_iconSize ); - set.setPixmap( pm, QIconSet::Automatic, QIconSet::Disabled ); + set.setPixmap( pm, QIcon::Automatic, QIcon::Disabled ); QToolButton::setIconSet( set ); @@ -354,3 +358,3 @@ void KToolBarButton::setDisabledIcon( const QString& icon ) -QPopupMenu *KToolBarButton::popup() +QMenu *KToolBarButton::popup() { @@ -361,3 +365,3 @@ QPopupMenu *KToolBarButton::popup() -void KToolBarButton::setPopup(QPopupMenu *p, bool) +void KToolBarButton::setPopup(Q3PopupMenu *p, bool) { @@ -368,3 +372,3 @@ void KToolBarButton::setPopup(QPopupMenu *p, bool) -void KToolBarButton::setDelayedPopup (QPopupMenu *p, bool) +void KToolBarButton::setDelayedPopup (Q3PopupMenu *p, bool) { @@ -453,17 +457,23 @@ void KToolBarButton::drawButton( QPainter *_painter ) #ifdef DESKTOP_VERSION - QStyle::SFlags flags = QStyle::Style_Default; - QStyle::SCFlags active = QStyle::SC_None; + QStyle::State flags = QStyle::State_None; + QStyle::SubControls active = QStyle::SC_None; if (isDown()) { - flags |= QStyle::Style_Down; + flags |= QStyle::State_DownArrow; active |= QStyle::SC_ToolButton; } - if (isEnabled()) flags |= QStyle::Style_Enabled; - if (isOn()) flags |= QStyle::Style_On; - if (isEnabled() && d->m_isRaised) flags |= QStyle::Style_Raised; - if (hasFocus()) flags |= QStyle::Style_HasFocus; + if (isEnabled()) flags |= QStyle::State_Enabled; + if (isOn()) flags |= QStyle::State_On; + if (isEnabled() && d->m_isRaised) flags |= QStyle::State_Raised; + if (hasFocus()) flags |= QStyle::State_HasFocus; + + QStyleOptionToolButton qsotb; + qsotb.initFrom(this); + qsotb.state = flags; + qsotb.activeSubControls = active; + qsotb.rect = rect(); + qsotb.palette = palette(); // Draw a styled toolbutton - style().drawComplexControl(QStyle::CC_ToolButton, _painter, this, rect(), - colorGroup(), flags, QStyle::SC_ToolButton, active, QStyleOption()); + style()->drawComplexControl(QStyle::CC_ToolButton, &qsotb, _painter, this); @@ -486,5 +496,5 @@ void KToolBarButton::drawButton( QPainter *_painter ) */ - QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, - isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : - QIconSet::Disabled); + QPixmap pixmap = iconSet().pixmap( QIcon::Automatic, + isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) : + QIcon::Disabled); @@ -510,5 +520,5 @@ void KToolBarButton::drawButton( QPainter *_painter ) */ - QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, - isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : - QIconSet::Disabled); + QPixmap pixmap = iconSet().pixmap( QIcon::Automatic, + isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) : + QIcon::Disabled); @@ -528,3 +538,3 @@ void KToolBarButton::drawButton( QPainter *_painter ) { - textFlags = AlignVCenter|AlignLeft; + textFlags = Qt::AlignVCenter|Qt::AlignLeft; if (!pixmap.isNull()) @@ -546,3 +556,3 @@ void KToolBarButton::drawButton( QPainter *_painter ) { - textFlags = AlignVCenter|AlignLeft; + textFlags = Qt::AlignVCenter|Qt::AlignLeft; dx = (width() - fm.width(textLabel())) / 2; @@ -565,5 +575,5 @@ void KToolBarButton::drawButton( QPainter *_painter ) */ - QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, - isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : - QIconSet::Disabled); + QPixmap pixmap = iconSet().pixmap( QIcon::Automatic, + isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) : + QIcon::Disabled); @@ -583,3 +593,3 @@ void KToolBarButton::drawButton( QPainter *_painter ) { - textFlags = AlignBottom|AlignHCenter; + textFlags = Qt::AlignBottom|Qt::AlignHCenter; dx = (width() - fm.width(textLabel())) / 2; @@ -612,10 +622,14 @@ void KToolBarButton::drawButton( QPainter *_painter ) #ifdef DESKTOP_VERSION - QStyle::SFlags arrowFlags = QStyle::Style_Default; + QStyle::State arrowFlags = QStyle::State_None; + + if (isDown()) arrowFlags |= QStyle::State_DownArrow; + if (isEnabled()) arrowFlags |= QStyle::State_Enabled; - if (isDown()) arrowFlags |= QStyle::Style_Down; - if (isEnabled()) arrowFlags |= QStyle::Style_Enabled; + QStyleOption qso; + qso.initFrom(this); + qso.state = arrowFlags; + qso.rect = QRect(width()-7, height()-7, 7, 7); + qso.palette = palette(); - style().drawPrimitive(QStyle::PE_ArrowDown, _painter, - QRect(width()-7, height()-7, 7, 7), colorGroup(), - arrowFlags, QStyleOption() ); + style()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &qso, _painter); #else diff --git a/microkde/kdeui/ktoolbarbutton.h b/microkde/kdeui/ktoolbarbutton.h index 9aaa13c..ad02e4e 100644 --- a/microkde/kdeui/ktoolbarbutton.h +++ b/microkde/kdeui/ktoolbarbutton.h @@ -28,4 +28,7 @@ #include <qtoolbutton.h> -#include <qintdict.h> +#include <q3intdict.h> #include <qstring.h> +//Added by qt3to4: +#include <QEvent> +#include <Q3PopupMenu> #include <kglobal.h> @@ -36,3 +39,3 @@ class KToolBarButtonPrivate; class QEvent; -class QPopupMenu; +class Q3PopupMenu; class QPainter; @@ -152,3 +155,3 @@ public: */ - virtual void setIconSet( const QIconSet &iconset ); + virtual void setIconSet( const QIcon &iconset ); @@ -211,3 +214,3 @@ public: */ - QPopupMenu *popup(); + QMenu *popup(); @@ -226,3 +229,3 @@ public: */ - void setPopup (QPopupMenu *p, bool unused = false); + void setPopup (Q3PopupMenu *p, bool unused = false); @@ -237,3 +240,3 @@ public: */ - void setDelayedPopup(QPopupMenu *p, bool unused = false); + void setDelayedPopup(Q3PopupMenu *p, bool unused = false); @@ -305,3 +308,3 @@ private: */ -class KToolBarButtonList : public QIntDict<KToolBarButton> +class KToolBarButtonList : public Q3IntDict<KToolBarButton> { diff --git a/microkde/kdeui/ktoolbarhandler.cpp b/microkde/kdeui/ktoolbarhandler.cpp index 7b97233..4d3ace7 100644 --- a/microkde/kdeui/ktoolbarhandler.cpp +++ b/microkde/kdeui/ktoolbarhandler.cpp @@ -20,3 +20,5 @@ -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <Q3PtrList> #include <kapplication.h> @@ -46,3 +48,3 @@ namespace public: - BarActionBuilder( KActionCollection *actionCollection, KMainWindow *mainWindow, QPtrList<KToolBar> &oldToolBarList ) + BarActionBuilder( KActionCollection *actionCollection, KMainWindow *mainWindow, Q3PtrList<KToolBar> &oldToolBarList ) : m_actionCollection( actionCollection ), m_mainWindow( mainWindow ), m_needsRebuild( false ) @@ -72,8 +74,8 @@ namespace - QPtrList<KAction> create() + Q3PtrList<KAction> create() { if ( !m_needsRebuild ) - return QPtrList<KAction>(); + return Q3PtrList<KAction>(); - QPtrListIterator<KToolBar> toolBarIt( m_toolBars ); + Q3PtrListIterator<KToolBar> toolBarIt( m_toolBars ); for ( ; toolBarIt.current(); ++toolBarIt ) @@ -81,3 +83,3 @@ namespace - QPtrList<KAction> actions; + Q3PtrList<KAction> actions; @@ -93,3 +95,3 @@ namespace - QPtrListIterator<KAction> actionIt( m_toolBarActions ); + Q3PtrListIterator<KAction> actionIt( m_toolBarActions ); for ( ; actionIt.current(); ++actionIt ) @@ -101,3 +103,3 @@ namespace - const QPtrList<KToolBar> &toolBars() const { return m_toolBars; } + const Q3PtrList<KToolBar> &toolBars() const { return m_toolBars; } @@ -117,4 +119,4 @@ namespace - QPtrList<KToolBar> m_toolBars; - QPtrList<KAction> m_toolBarActions; + Q3PtrList<KToolBar> m_toolBars; + Q3PtrList<KAction> m_toolBarActions; @@ -226,3 +228,3 @@ void ToolBarHandler::connectToActionContainers() { - QPtrListIterator<KAction> actionIt( m_actions ); + Q3PtrListIterator<KAction> actionIt( m_actions ); for ( ; actionIt.current(); ++actionIt ) @@ -241,3 +243,3 @@ void ToolBarHandler::connectToActionContainer( QWidget *container ) //US QPopupMenu *popupMenu = dynamic_cast<QPopupMenu *>( container ); - QPopupMenu *popupMenu = (QPopupMenu *)( container ); + Q3PopupMenu *popupMenu = (Q3PopupMenu *)( container ); if ( !popupMenu ) diff --git a/microkde/kdeui/ktoolbarhandler.h b/microkde/kdeui/ktoolbarhandler.h index a1340ae..35f0d18 100644 --- a/microkde/kdeui/ktoolbarhandler.h +++ b/microkde/kdeui/ktoolbarhandler.h @@ -22,4 +22,4 @@ #include <qobject.h> -#include <qguardedptr.h> -#include <qptrlist.h> +#include <qpointer.h> +#include <q3ptrlist.h> #include <kxmlguiclient.h> @@ -59,5 +59,5 @@ private: - QGuardedPtr<KMainWindow> m_mainWindow; - QPtrList<KAction> m_actions; - QPtrList<KToolBar> m_toolBars; + QPointer<KMainWindow> m_mainWindow; + Q3PtrList<KAction> m_actions; + Q3PtrList<KToolBar> m_toolBars; }; diff --git a/microkde/kdeui/kxmlguiclient.cpp b/microkde/kdeui/kxmlguiclient.cpp index 073e30b..8740bde 100644 --- a/microkde/kdeui/kxmlguiclient.cpp +++ b/microkde/kdeui/kxmlguiclient.cpp @@ -41,2 +41,4 @@ #include <assert.h> +//Added by qt3to4: +#include <Q3PtrList> @@ -65,3 +67,3 @@ public: //QPtrList<KXMLGUIClient> m_supers; - QPtrList<KXMLGUIClient> m_children; + Q3PtrList<KXMLGUIClient> m_children; //US KXMLGUIBuilder *m_builder; @@ -87,3 +89,3 @@ KXMLGUIClient::~KXMLGUIClient() - QPtrListIterator<KXMLGUIClient> it( d->m_children ); + Q3PtrListIterator<KXMLGUIClient> it( d->m_children ); for ( ; it.current(); ++it ) { @@ -101,3 +103,3 @@ KAction *KXMLGUIClient::action( const char *name ) const if ( !act ) { - QPtrListIterator<KXMLGUIClient> childIt( d->m_children ); + Q3PtrListIterator<KXMLGUIClient> childIt( d->m_children ); for (; childIt.current(); ++childIt ) { @@ -590,3 +592,3 @@ void KXMLGUIClient::removeChildClient( KXMLGUIClient *child ) -const QPtrList<KXMLGUIClient> *KXMLGUIClient::childClients() +const Q3PtrList<KXMLGUIClient> *KXMLGUIClient::childClients() { @@ -608,3 +610,3 @@ KXMLGUIBuilder *KXMLGUIClient::clientBuilder() const -void KXMLGUIClient::plugActionList( const QString &name, const QPtrList<KAction> &actionList ) +void KXMLGUIClient::plugActionList( const QString &name, const Q3PtrList<KAction> &actionList ) { diff --git a/microkde/kdeui/kxmlguiclient.h b/microkde/kdeui/kxmlguiclient.h index cd74c8e..b9d7b09 100644 --- a/microkde/kdeui/kxmlguiclient.h +++ b/microkde/kdeui/kxmlguiclient.h @@ -23,3 +23,3 @@ //US #include <qdom.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qmap.h> @@ -163,3 +163,3 @@ public: */ - const QPtrList<KXMLGUIClient> *childClients(); + const Q3PtrList<KXMLGUIClient> *childClients(); @@ -230,3 +230,3 @@ public: */ - void plugActionList( const QString &name, const QPtrList<KAction> &actionList ); + void plugActionList( const QString &name, const Q3PtrList<KAction> &actionList ); diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp index 8398956..57e7ea6 100644 --- a/microkde/kdialog.cpp +++ b/microkde/kdialog.cpp @@ -2,3 +2,3 @@ #include <kdialog.h> -#include <qapp.h> +#include <qapplication.h> #include <qlabel.h> @@ -6,3 +6,5 @@ #include <qlayout.h> -#include <qprogressbar.h> +#include <q3progressbar.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <klocale.h> @@ -32,5 +34,5 @@ KProgressDialog::KProgressDialog( QWidget *parent, const char *name, bool modal { - QVBoxLayout* lay= new QVBoxLayout ( this ); + Q3VBoxLayout* lay= new Q3VBoxLayout ( this ); mLabel = new QLabel ( "abc",this ); - mBar = new QProgressBar ( this ); + mBar = new Q3ProgressBar ( this ); mButton = new QPushButton ( i18n("Cancel"),this ); diff --git a/microkde/kdialog.h b/microkde/kdialog.h index bc80689..5f9bf0e 100644 --- a/microkde/kdialog.h +++ b/microkde/kdialog.h @@ -4,4 +4,6 @@ #include <qdialog.h> +//Added by qt3to4: +#include <QLabel> class QLabel; -class QProgressBar; +class Q3ProgressBar; class QPushButton ; @@ -31,3 +33,3 @@ class KProgressDialog : public QDialog QLabel * mLabel; - QProgressBar *mBar; + Q3ProgressBar *mBar; QPushButton *mButton; diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index d5c7e61..a40bad6 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp @@ -3,3 +3,7 @@ #include <qlayout.h> -#include <qframe.h> +#include <q3frame.h> +//Added by qt3to4: +#include <QPixmap> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> @@ -137,3 +141,3 @@ void KDialogBase::initLayout() delete mTopLayout; - mTopLayout = new QVBoxLayout( this ); + mTopLayout = new Q3VBoxLayout( this ); mTopLayout->setMargin( marginHintSmall() ); @@ -143,3 +147,3 @@ void KDialogBase::initLayout() - QBoxLayout *buttonLayout = new QHBoxLayout; + Q3BoxLayout *buttonLayout = new Q3HBoxLayout; mTopLayout->addLayout( buttonLayout ); @@ -157,6 +161,6 @@ void KDialogBase::initLayout() -QFrame *KDialogBase::addPage( const QString &name ) +Q3Frame *KDialogBase::addPage( const QString &name ) { // kdDebug() << "KDialogBase::addPage(): " << name << endl; - QFrame *frame = new QFrame( tabWidget() ); + Q3Frame *frame = new Q3Frame( tabWidget() ); tabWidget()->addTab( frame, name ); @@ -165,3 +169,3 @@ QFrame *KDialogBase::addPage( const QString &name ) -QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) +Q3Frame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) { @@ -256,6 +260,6 @@ bool KDialogBase::showPage( int index ) -QFrame *KDialogBase::plainPage() +Q3Frame *KDialogBase::plainPage() { if ( !mPlainPage ) { - mPlainPage = new QFrame( this ); + mPlainPage = new Q3Frame( this ); setMainWidget( mPlainPage ); diff --git a/microkde/kdialogbase.h b/microkde/kdialogbase.h index 17c186b..64cbd17 100644 --- a/microkde/kdialogbase.h +++ b/microkde/kdialogbase.h @@ -3,3 +3,5 @@ -#include <qframe.h> +#include <q3frame.h> +//Added by qt3to4: +#include <QPixmap> @@ -10,3 +12,3 @@ class QLayout; class QTabWidget; -class QBoxLayout; +class Q3BoxLayout; @@ -61,4 +63,4 @@ class KDialogBase : public KDialog - QFrame *addPage( const QString & ); - QFrame *addPage( const QString &, int, const QPixmap & ); + Q3Frame *addPage( const QString & ); + Q3Frame *addPage( const QString &, int, const QPixmap & ); @@ -79,3 +81,3 @@ class KDialogBase : public KDialog - QFrame *plainPage(); + Q3Frame *plainPage(); @@ -130,4 +132,4 @@ class KDialogBase : public KDialog QTabWidget *mTabWidget; - QFrame *mPlainPage; - QBoxLayout *mTopLayout; + Q3Frame *mPlainPage; + Q3BoxLayout *mTopLayout; diff --git a/microkde/keditlistbox.cpp b/microkde/keditlistbox.cpp index 55b7784..257a44a 100644 --- a/microkde/keditlistbox.cpp +++ b/microkde/keditlistbox.cpp @@ -23,6 +23,9 @@ #include <qlayout.h> -#include <qgroupbox.h> -#include <qlistbox.h> -#include <qwhatsthis.h> +#include <q3groupbox.h> +#include <q3listbox.h> +#include <q3whatsthis.h> #include <qlabel.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3StrList> @@ -49,3 +52,3 @@ KEditListBox::KEditListBox(QWidget *parent, const char *name, bool checkAtEntering, int buttons ) - :QGroupBox(parent, name ) + :Q3GroupBox(parent, name ) { @@ -56,3 +59,3 @@ KEditListBox::KEditListBox(const QString& title, QWidget *parent, const char *name, bool checkAtEntering, int buttons) - :QGroupBox(title, parent, name ) + :Q3GroupBox(title, parent, name ) { @@ -64,3 +67,3 @@ KEditListBox::KEditListBox(const QString& title, const CustomEditor& custom, bool checkAtEntering, int buttons) - :QGroupBox(title, parent, name ) + :Q3GroupBox(title, parent, name ) { @@ -97,3 +100,3 @@ void KEditListBox::init( bool checkAtEntering, int buttons, QWidget * gb = this; - QGridLayout * grid = new QGridLayout(gb, 7 - lostButtons, 2, + Q3GridLayout * grid = new Q3GridLayout(gb, 7 - lostButtons, 2, KDialog::marginHint(), @@ -111,3 +114,3 @@ void KEditListBox::init( bool checkAtEntering, int buttons, - m_listBox = new QListBox(gb); + m_listBox = new Q3ListBox(gb); @@ -206,3 +209,3 @@ void KEditListBox::moveItemUp() - QListBoxItem *selItem = m_listBox->item(selIndex); + Q3ListBoxItem *selItem = m_listBox->item(selIndex); m_listBox->takeItem(selItem); @@ -229,3 +232,3 @@ void KEditListBox::moveItemDown() - QListBoxItem *selItem = m_listBox->item(selIndex); + Q3ListBoxItem *selItem = m_listBox->item(selIndex); m_listBox->takeItem(selItem); @@ -351,10 +354,12 @@ void KEditListBox::insertStringList(const QStringList& list, int index) -void KEditListBox::insertStrList(const QStrList* list, int index) +void KEditListBox::insertStrList(const Q3StrList* list, int index) { - m_listBox->insertStrList(list,index); + for(Q3StrList::const_iterator i=list->begin();i!=list->end();++i) + m_listBox->insertItem(*i,index++); } -void KEditListBox::insertStrList(const QStrList& list, int index) +void KEditListBox::insertStrList(const Q3StrList& list, int index) { - m_listBox->insertStrList(list,index); + for(Q3StrList::const_iterator i=list.begin();i!=list.end();++i) + m_listBox->insertItem(*i,index++); } diff --git a/microkde/keditlistbox.h b/microkde/keditlistbox.h index 130d933..e43d958 100644 --- a/microkde/keditlistbox.h +++ b/microkde/keditlistbox.h @@ -22,4 +22,6 @@ -#include <qgroupbox.h> -#include <qlistbox.h> +#include <q3groupbox.h> +#include <q3listbox.h> +//Added by qt3to4: +#include <Q3StrList> @@ -38,3 +40,3 @@ class KEditListBoxPrivate; */ -class KEditListBox : public QGroupBox +class KEditListBox : public Q3GroupBox { @@ -128,3 +130,3 @@ public: */ - QListBox* listBox() const { return m_listBox; } + Q3ListBox* listBox() const { return m_listBox; } /** @@ -161,3 +163,3 @@ public: */ - void insertStrList(const QStrList* list, int index=-1); + void insertStrList(const Q3StrList* list, int index=-1); /** @@ -165,3 +167,3 @@ public: */ - void insertStrList(const QStrList& list, int index=-1); + void insertStrList(const Q3StrList& list, int index=-1); /** @@ -209,3 +211,3 @@ public: private: - QListBox *m_listBox; + Q3ListBox *m_listBox; QPushButton *servUpButton, *servDownButton; diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 383e711..c1bfdef 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp @@ -6,2 +6,4 @@ #include <qapplication.h> +//Added by qt3to4: +#include <Q3VBoxLayout> @@ -15,3 +17,3 @@ QString KFileDialog::getSaveFileName( const QString & fn, QDialog dia ( par, "input-dialog", true ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lay.setMargin(7); @@ -44,3 +46,3 @@ QString KFileDialog::getOpenFileName( const QString & fn, // QLineEdit lab ( &dia ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lay.setMargin(7); @@ -68,3 +70,3 @@ QString KFileDialog::getExistingDirectory( const QString & fn, -#include <qfiledialog.h> +#include <q3filedialog.h> @@ -73,3 +75,3 @@ QString KFileDialog::getSaveFileName( const QString & fn, { - return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); + return Q3FileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); } @@ -79,3 +81,3 @@ QString KFileDialog::getOpenFileName( const QString & fn, - return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); + return Q3FileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); } @@ -84,3 +86,3 @@ QString KFileDialog::getExistingDirectory( const QString & fn, { - return QFileDialog::getExistingDirectory( fn, par, "exidtingdir", cap ); + return Q3FileDialog::getExistingDirectory( fn, par, "exidtingdir", cap ); } diff --git a/microkde/kfontdialog.cpp b/microkde/kfontdialog.cpp index 174123c..f83c2a8 100644 --- a/microkde/kfontdialog.cpp +++ b/microkde/kfontdialog.cpp @@ -9,2 +9,4 @@ #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3VBoxLayout> QFont KFontDialog::getFont( const QFont & f, bool & ok ) @@ -14,3 +16,3 @@ QFont KFontDialog::getFont( const QFont & f, bool & ok ) OFontSelector s ( true, &d, "fontsel"); - QVBoxLayout l ( &d ); + Q3VBoxLayout l ( &d ); l.addWidget( &s ); diff --git a/microkde/kglobal.cpp b/microkde/kglobal.cpp index 53edd08..9cc5835 100644 --- a/microkde/kglobal.cpp +++ b/microkde/kglobal.cpp @@ -2,4 +2,5 @@ #include "kstandarddirs.h" -#include <qkeycode.h> +#include <qnamespace.h> #include <qapplication.h> +#include <QDesktopWidget> @@ -15,3 +16,3 @@ KLocale *KGlobal::locale() if ( !mLocale ) { - ASSERT(mAppName); + Q_ASSERT(!mAppName.isEmpty()); diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index 2e483e9..1f08255 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp @@ -6,2 +6,3 @@ #include <qapplication.h> +#include <QDesktopWidget> diff --git a/microkde/kiconloader.cpp b/microkde/kiconloader.cpp index 4842d71..e7f657d 100644 --- a/microkde/kiconloader.cpp +++ b/microkde/kiconloader.cpp @@ -6,2 +6,4 @@ #include <qdir.h> +//Added by qt3to4: +#include <QPixmap> QPixmap KIconLoader::loadIcon( const QString& name, KIcon::Group, int, @@ -16,3 +18,3 @@ QPixmap KIconLoader::loadIcon( const QString& name, KIcon::Group, int, } -QIconSet KIconLoader::loadIconSet( const QString& name) const +QIcon KIconLoader::loadIconSet( const QString& name) const { @@ -23,3 +25,3 @@ QIconSet KIconLoader::loadIconSet( const QString& name) const //qDebug("KIconLoader::loadIconSet: %s ************", file.latin1() ); - QIconSet is ( pixmapLoader ); + QIcon is ( pixmapLoader ); return is; @@ -79,3 +81,3 @@ QPixmap KIconLoader::loadIcon( const QString& name, KIcon::Group, int, -QIconSet KIconLoader::loadIconSet( const QString& name) const +QIcon KIconLoader::loadIconSet( const QString& name) const { @@ -83,4 +85,4 @@ QIconSet KIconLoader::loadIconSet( const QString& name) const - QIconSet is ;//= Resource::loadIconSet( px ); - QIconSet* isPtr = 0;//LR&is; + QIcon is ;//= Resource::loadIconSet( px ); + QIcon* isPtr = 0;//LR&is; if (isPtr == 0) diff --git a/microkde/kiconloader.h b/microkde/kiconloader.h index 68fec4e..2abb667 100644 --- a/microkde/kiconloader.h +++ b/microkde/kiconloader.h @@ -6,3 +6,3 @@ //US -#include <qiconset.h> +#include <qicon.h> @@ -36,3 +36,3 @@ class KIconLoader QString iconPath( const QString &, int ) const; - QIconSet loadIconSet( const QString &name) const; + QIcon loadIconSet( const QString &name) const; diff --git a/microkde/kio/kfile/kurlrequester.cpp b/microkde/kio/kfile/kurlrequester.cpp index ca94570..ce62da7 100644 --- a/microkde/kio/kfile/kurlrequester.cpp +++ b/microkde/kio/kfile/kurlrequester.cpp @@ -29,2 +29,4 @@ #include <qpushbutton.h> +//Added by qt3to4: +#include <QPixmap> @@ -184,3 +186,3 @@ KURLRequester::KURLRequester( QWidget *editWidget, QWidget *parent, KURLRequester::KURLRequester( QWidget *parent, const char *name ) - : QHBox( parent, name ) + : Q3HBox( parent, name ) { @@ -193,3 +195,3 @@ KURLRequester::KURLRequester( const QString& url, QWidget *parent, const char *name ) - : QHBox( parent, name ) + : Q3HBox( parent, name ) { @@ -218,4 +220,4 @@ void KURLRequester::init() myButton = new KURLDragPushButton( this, "kfile button"); - QIconSet iconSet = SmallIconSet("fileopen"); - QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal ); + QIcon iconSet = SmallIconSet("fileopen"); + QPixmap pixMap = iconSet.pixmap( QIcon::Small, QIcon::Normal ); myButton->setIconSet( iconSet ); diff --git a/microkde/kio/kfile/kurlrequester.h b/microkde/kio/kfile/kurlrequester.h index faa3326..5d4fa11 100644 --- a/microkde/kio/kfile/kurlrequester.h +++ b/microkde/kio/kfile/kurlrequester.h @@ -22,3 +22,3 @@ -#include <qhbox.h> +#include <q3hbox.h> @@ -55,3 +55,3 @@ class QTimer; */ -class KURLRequester : public QHBox +class KURLRequester : public Q3HBox { diff --git a/microkde/kio/kio/kdirwatch.cpp b/microkde/kio/kio/kdirwatch.cpp index 1596d1f..5f07c54 100644 --- a/microkde/kio/kio/kdirwatch.cpp +++ b/microkde/kio/kio/kdirwatch.cpp @@ -54,4 +54,4 @@ $Id$ #include <qfile.h> -#include <qintdict.h> -#include <qptrlist.h> +#include <q3intdict.h> +#include <q3ptrlist.h> #include <qsocketnotifier.h> @@ -59,2 +59,4 @@ $Id$ #include <qtimer.h> +//Added by qt3to4: +#include <Q3CString> @@ -186,3 +188,3 @@ KDirWatchPrivate::KDirWatchPrivate() KConfig *config = KGlobal::config(); - KConfigGroupSaver saver( config, QCString("DirWatch") ); + KConfigGroupSaver saver( config, Q3CString("DirWatch") ); @@ -733,3 +735,3 @@ void KDirWatchPrivate::removeEntries( KDirWatch* instance ) { - QPtrList<Entry> list; + Q3PtrList<Entry> list; int minfreq = 3600000; @@ -1009,3 +1011,3 @@ void KDirWatchPrivate::slotRescan() #ifdef HAVE_DNOTIFY - QPtrList<Entry> dList, cList; + Q3PtrList<Entry> dList, cList; diff --git a/microkde/kio/kio/kdirwatch_p.h b/microkde/kio/kio/kdirwatch_p.h index 0ab482f..be74f2a 100644 --- a/microkde/kio/kio/kdirwatch_p.h +++ b/microkde/kio/kio/kdirwatch_p.h @@ -20,3 +20,3 @@ $Id$ -#include <qptrlist.h> +#include <q3ptrlist.h> @@ -60,5 +60,5 @@ public: // instances interested in events - QPtrList<Client> m_clients; + Q3PtrList<Client> m_clients; // nonexistent entries of this directory - QPtrList<Entry> m_entries; + Q3PtrList<Entry> m_entries; QString path; @@ -126,3 +126,3 @@ private: bool delayRemove; - QPtrList<Entry> removeList; + Q3PtrList<Entry> removeList; @@ -143,3 +143,3 @@ private: QSocketNotifier *mSn; - QIntDict<Entry> fd_Entry; + Q3IntDict<Entry> fd_Entry; diff --git a/microkde/klineedit.h b/microkde/klineedit.h index 70c72d1..9eb749d 100644 --- a/microkde/klineedit.h +++ b/microkde/klineedit.h @@ -4,2 +4,4 @@ #include <qlineedit.h> +//Added by qt3to4: +#include <QKeyEvent> diff --git a/microkde/klineeditdlg.h b/microkde/klineeditdlg.h index 68e9252..d0004cd 100644 --- a/microkde/klineeditdlg.h +++ b/microkde/klineeditdlg.h @@ -9,2 +9,4 @@ #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3VBoxLayout> @@ -17,3 +19,3 @@ class KLineEditDlg : public QDialog mEdit = new KLineEdit( this ); - QVBoxLayout* vl = new QVBoxLayout( this ); + Q3VBoxLayout* vl = new Q3VBoxLayout( this ); vl->setSpacing(5); diff --git a/microkde/kresources/configdialog.cpp b/microkde/kresources/configdialog.cpp index 55253c0..4820faf 100644 --- a/microkde/kresources/configdialog.cpp +++ b/microkde/kresources/configdialog.cpp @@ -27,3 +27,3 @@ -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> @@ -31,6 +31,9 @@ #include <qpushbutton.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qcheckbox.h> -#include <qscrollview.h> +#include <q3scrollview.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3Frame> @@ -57,3 +60,3 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, - QFrame *main; + Q3Frame *main; @@ -61,6 +64,6 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, - QVBoxLayout *mainLayout = new QVBoxLayout( main, 0, spacingHint() ); + Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main, 0, spacingHint() ); - QGroupBox *generalGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); + Q3GroupBox *generalGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main ); generalGroupBox->layout()->setSpacing( spacingHint() ); @@ -84,3 +87,3 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, - QGroupBox *resourceGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); + Q3GroupBox *resourceGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main ); resourceGroupBox->layout()->setSpacing( spacingHint()); diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp index fc7a42e..1a9d063 100644 --- a/microkde/kresources/configpage.cpp +++ b/microkde/kresources/configpage.cpp @@ -30,3 +30,3 @@ $Id$ -#include <qgroupbox.h> +#include <q3groupbox.h> @@ -39,2 +39,6 @@ $Id$ #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3ValueList> +#include <Q3VBoxLayout> #include <kapplication.h> @@ -63,7 +67,7 @@ using namespace KRES; -class ConfigViewItem : public QCheckListItem +class ConfigViewItem : public Q3CheckListItem { public: - ConfigViewItem( QListView *parent, Resource* resource ) : - QCheckListItem( parent, resource->resourceName(), CheckBox ), + ConfigViewItem( Q3ListView *parent, Resource* resource ) : + Q3CheckListItem( parent, resource->resourceName(), CheckBox ), mResource( resource ), @@ -99,5 +103,5 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name ) - QVBoxLayout *mainLayout = new QVBoxLayout( this ); + Q3VBoxLayout *mainLayout = new Q3VBoxLayout( this ); - QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this ); + Q3GroupBox *groupBox = new Q3GroupBox( i18n( "Resources" ), this ); groupBox->setColumnLayout(0, Qt::Vertical ); @@ -105,3 +109,3 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name ) groupBox->layout()->setMargin( 5 ); - QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 ); + Q3GridLayout *groupBoxLayout = new Q3GridLayout( groupBox->layout(), 4, 2 ); @@ -147,4 +151,4 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name ) SLOT( slotSelectionChanged() ) ); - connect( mListView, SIGNAL( clicked( QListViewItem * ) ), - SLOT( slotItemClicked( QListViewItem * ) ) ); + connect( mListView, SIGNAL( clicked( Q3ListViewItem * ) ), + SLOT( slotItemClicked( Q3ListViewItem * ) ) ); @@ -161,3 +165,3 @@ ConfigPage::~ConfigPage() { - QValueList<ResourcePageInfo>::Iterator it; + Q3ValueList<ResourcePageInfo>::Iterator it; for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) { @@ -232,3 +236,3 @@ void ConfigPage::save() - QValueList<ResourcePageInfo>::Iterator it; + Q3ValueList<ResourcePageInfo>::Iterator it; for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) @@ -343,3 +347,3 @@ void ConfigPage::slotAdd() bool onlyReadOnly = true; - QListViewItem *it = mListView->firstChild(); + Q3ListViewItem *it = mListView->firstChild(); while ( it != 0 ) { @@ -368,3 +372,3 @@ void ConfigPage::slotRemove() - QListViewItem *item = mListView->currentItem(); + Q3ListViewItem *item = mListView->currentItem(); ConfigViewItem *confItem = static_cast<ConfigViewItem*>( item ); @@ -395,3 +399,3 @@ void ConfigPage::slotEdit() - QListViewItem *item = mListView->currentItem(); + Q3ListViewItem *item = mListView->currentItem(); ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item ); @@ -437,3 +441,3 @@ void ConfigPage::slotStandard() - QListViewItem *it = mListView->firstChild(); + Q3ListViewItem *it = mListView->firstChild(); while ( it != 0 ) { @@ -484,3 +488,3 @@ void ConfigPage::resourceDeleted( Resource* resource ) -void ConfigPage::slotItemClicked( QListViewItem *item ) +void ConfigPage::slotItemClicked( Q3ListViewItem *item ) { @@ -506,3 +510,3 @@ void ConfigPage::saveResourceSettings() - QListViewItem *item = mListView->firstChild(); + Q3ListViewItem *item = mListView->firstChild(); while ( item ) { diff --git a/microkde/kresources/configpage.h b/microkde/kresources/configpage.h index be9239e..dc1aa50 100644 --- a/microkde/kresources/configpage.h +++ b/microkde/kresources/configpage.h @@ -27,2 +27,4 @@ #include <qwidget.h> +//Added by qt3to4: +#include <Q3ValueList> @@ -33,3 +35,3 @@ class KListView; -class QListViewItem; +class Q3ListViewItem; class QPushButton; @@ -75,3 +77,3 @@ class ConfigPage : public QWidget, public ManagerListener<Resource> protected slots: - void slotItemClicked( QListViewItem * ); + void slotItemClicked( Q3ListViewItem * ); @@ -88,3 +90,3 @@ class ConfigPage : public QWidget, public ManagerListener<Resource> QStringList mFamilyMap; - QValueList<ResourcePageInfo> mInfoMap; + Q3ValueList<ResourcePageInfo> mInfoMap; @@ -97,3 +99,3 @@ class ConfigPage : public QWidget, public ManagerListener<Resource> - QListViewItem* mLastItem; + Q3ListViewItem* mLastItem; static const QString syncfamily; diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp index 86b22b2..4f286d1 100644 --- a/microkde/kresources/factory.cpp +++ b/microkde/kresources/factory.cpp @@ -43,4 +43,4 @@ using namespace KRES; -QDict<Factory> *Factory::mSelves = 0; -static KStaticDeleter< QDict<Factory> > staticDeleter; +Q3Dict<Factory> *Factory::mSelves = 0; +static KStaticDeleter< Q3Dict<Factory> > staticDeleter; @@ -53,3 +53,3 @@ Factory *Factory::self( const QString& resourceFamily) { - mSelves = staticDeleter.setObject( new QDict<Factory> ); + mSelves = staticDeleter.setObject( new Q3Dict<Factory> ); } diff --git a/microkde/kresources/factory.h b/microkde/kresources/factory.h index ea01b23..709fde0 100644 --- a/microkde/kresources/factory.h +++ b/microkde/kresources/factory.h @@ -26,3 +26,3 @@ -#include <qdict.h> +#include <q3dict.h> #include <qstring.h> @@ -116,3 +116,3 @@ class Factory private: - static QDict<Factory> *mSelves; + static Q3Dict<Factory> *mSelves; diff --git a/microkde/kresources/kcmkresources.cpp b/microkde/kresources/kcmkresources.cpp index d600a31..f5eb826 100644 --- a/microkde/kresources/kcmkresources.cpp +++ b/microkde/kresources/kcmkresources.cpp @@ -22,2 +22,5 @@ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3Frame> @@ -42,5 +45,5 @@ KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringLi { - QFrame *main = plainPage(); + Q3Frame *main = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( main ); + Q3VBoxLayout *layout = new Q3VBoxLayout( main ); mConfigPage = new KRES::ConfigPage( main ); diff --git a/microkde/kresources/manager.h b/microkde/kresources/manager.h index 69062da..88705d4 100644 --- a/microkde/kresources/manager.h +++ b/microkde/kresources/manager.h @@ -34,4 +34,6 @@ $Id$ -#include <qdict.h> +#include <q3dict.h> #include <qstringlist.h> +//Added by qt3to4: +#include <Q3PtrList> @@ -177,3 +179,3 @@ class Manager : private ManagerImplListener - mListeners = new QPtrList<ManagerListener<T> >; + mListeners = new Q3PtrList<ManagerListener<T> >; } @@ -332,3 +334,3 @@ class Manager : private ManagerImplListener Factory *mFactory; - QPtrList<ManagerListener<T> > *mListeners; + Q3PtrList<ManagerListener<T> > *mListeners; }; diff --git a/microkde/kresources/managerimpl.cpp b/microkde/kresources/managerimpl.cpp index a6d2007..4c0751c 100644 --- a/microkde/kresources/managerimpl.cpp +++ b/microkde/kresources/managerimpl.cpp @@ -37,2 +37,4 @@ $Id$ #include <qfile.h> +//Added by qt3to4: +#include <Q3PtrList> @@ -234,5 +236,5 @@ Resource::List *ManagerImpl::resourceList() -QPtrList<Resource> ManagerImpl::resources() +Q3PtrList<Resource> ManagerImpl::resources() { - QPtrList<Resource> result; + Q3PtrList<Resource> result; @@ -245,5 +247,5 @@ QPtrList<Resource> ManagerImpl::resources() -QPtrList<Resource> ManagerImpl::resources( bool active ) +Q3PtrList<Resource> ManagerImpl::resources( bool active ) { - QPtrList<Resource> result; + Q3PtrList<Resource> result; diff --git a/microkde/kresources/managerimpl.h b/microkde/kresources/managerimpl.h index 56a2db6..1f728e5 100644 --- a/microkde/kresources/managerimpl.h +++ b/microkde/kresources/managerimpl.h @@ -34,4 +34,4 @@ $Id$ #include <qstring.h> -#include <qptrlist.h> -#include <qdict.h> +#include <q3ptrlist.h> +#include <q3dict.h> //US @@ -83,6 +83,6 @@ class ManagerImpl : public QObject - QPtrList<Resource> resources(); + Q3PtrList<Resource> resources(); // Get only active or passive resources - QPtrList<Resource> resources( bool active ); + Q3PtrList<Resource> resources( bool active ); diff --git a/microkde/kresources/resource.h b/microkde/kresources/resource.h index ed5af96..1f9527c 100644 --- a/microkde/kresources/resource.h +++ b/microkde/kresources/resource.h @@ -30,3 +30,3 @@ -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qwidget.h> @@ -241,3 +241,3 @@ class Resource : public QObject public: - typedef QValueList<Resource *> List; + typedef Q3ValueList<Resource *> List; diff --git a/microkde/kresources/selectdialog.cpp b/microkde/kresources/selectdialog.cpp index fba8648..d5b83e9 100644 --- a/microkde/kresources/selectdialog.cpp +++ b/microkde/kresources/selectdialog.cpp @@ -36,5 +36,9 @@ -#include <qlistbox.h> +#include <q3listbox.h> #include <qlayout.h> -#include <qgroupbox.h> +#include <q3groupbox.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3Frame> +#include <Q3PtrList> @@ -48,3 +52,3 @@ using namespace KRES; //US : KDialog( parent, name, true ) -SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, +SelectDialog::SelectDialog( Q3PtrList<Resource> list, QWidget *parent, const char *name ) @@ -59,3 +63,3 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, //US - QFrame *main = plainPage(); + Q3Frame *main = plainPage(); /*US @@ -67,3 +71,3 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, //US QVBoxLayout *mainLayout = new QVBoxLayout( this ); - QVBoxLayout *mainLayout = new QVBoxLayout( main ); + Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main ); mainLayout->setMargin( marginHint() ); @@ -71,3 +75,3 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, //US QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, this ); - QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, main ); + Q3GroupBox *groupBox = new Q3GroupBox( 2, Qt::Horizontal, main ); groupBox->setTitle( i18n( "Resources" ) ); @@ -75,3 +79,3 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, //US mResourceId = new KListBox( groupBox ); - mResourceId = new QListBox( groupBox ); + mResourceId = new Q3ListBox( groupBox ); @@ -103,3 +107,3 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, mResourceId->setCurrentItem( 0 ); - connect( mResourceId, SIGNAL(returnPressed(QListBoxItem*)), + connect( mResourceId, SIGNAL(returnPressed(Q3ListBoxItem*)), SLOT(accept()) ); @@ -115,3 +119,3 @@ Resource *SelectDialog::resource() -Resource *SelectDialog::getResource( QPtrList<Resource> list, QWidget *parent ) +Resource *SelectDialog::getResource( Q3PtrList<Resource> list, QWidget *parent ) { diff --git a/microkde/kresources/selectdialog.h b/microkde/kresources/selectdialog.h index 7026212..be5152b 100644 --- a/microkde/kresources/selectdialog.h +++ b/microkde/kresources/selectdialog.h @@ -27,3 +27,3 @@ #include <qobject.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qmap.h> @@ -33,3 +33,3 @@ //US class KListBox; -class QListBox; +class Q3ListBox; @@ -64,3 +64,3 @@ class SelectDialog : KDialogBase */ - SelectDialog( QPtrList<Resource> list, QWidget *parent = 0, + SelectDialog( Q3PtrList<Resource> list, QWidget *parent = 0, const char *name = 0); @@ -78,3 +78,3 @@ class SelectDialog : KDialogBase */ - static Resource *getResource( QPtrList<Resource> list, QWidget *parent = 0 ); + static Resource *getResource( Q3PtrList<Resource> list, QWidget *parent = 0 ); @@ -82,3 +82,3 @@ class SelectDialog : KDialogBase //US KListBox *mResourceId; - QListBox *mResourceId; + Q3ListBox *mResourceId; diff --git a/microkde/ksystemtray.cpp b/microkde/ksystemtray.cpp index 4f81d02..0d0045f 100644 --- a/microkde/ksystemtray.cpp +++ b/microkde/ksystemtray.cpp @@ -1,2 +1,5 @@ #include "ksystemtray.h" +//Added by qt3to4: +#include <QMouseEvent> +#include <QLabel> diff --git a/microkde/ksystemtray.h b/microkde/ksystemtray.h index f3e4f6a..6708c86 100644 --- a/microkde/ksystemtray.h +++ b/microkde/ksystemtray.h @@ -4,2 +4,4 @@ #include <qlabel.h> +//Added by qt3to4: +#include <QMouseEvent> diff --git a/microkde/ktempfile.cpp b/microkde/ktempfile.cpp index b9166bd..d61d22e 100644 --- a/microkde/ktempfile.cpp +++ b/microkde/ktempfile.cpp @@ -1,2 +1,2 @@ -#include <qtextstream.h> +#include <q3textstream.h> @@ -21,3 +21,3 @@ QString KTempFile::name() -QTextStream *KTempFile::textStream() +Q3TextStream *KTempFile::textStream() { diff --git a/microkde/ktempfile.h b/microkde/ktempfile.h index 20dfa82..1ac7258 100644 --- a/microkde/ktempfile.h +++ b/microkde/ktempfile.h @@ -5,3 +5,3 @@ -class QTextStream; +class Q3TextStream; @@ -16,3 +16,3 @@ class KTempFile - QTextStream *textStream(); + Q3TextStream *textStream(); }; diff --git a/microkde/ktextedit.cpp b/microkde/ktextedit.cpp index 4dd6875..d74706b 100644 --- a/microkde/ktextedit.cpp +++ b/microkde/ktextedit.cpp @@ -4,2 +4,4 @@ #include <qpe/qpeapplication.h> +//Added by qt3to4: +#include <QMouseEvent> #endif @@ -7,3 +9,3 @@ -KTextEdit::KTextEdit ( QWidget *parent ) : QMultiLineEdit( parent ) +KTextEdit::KTextEdit ( QWidget *parent ) : Q3MultiLineEdit( parent ) { @@ -19,3 +21,3 @@ void KTextEdit::mousePressEvent(QMouseEvent *e) { - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { mAllowPopupMenu = true; @@ -24,5 +26,5 @@ void KTextEdit::mousePressEvent(QMouseEvent *e) } - if ( e->button() == RightButton && !mAllowPopupMenu ) + if ( e->button() == Qt::RightButton && !mAllowPopupMenu ) return; - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { if ( hasMarkedText () ) @@ -34,3 +36,3 @@ void KTextEdit::mousePressEvent(QMouseEvent *e) } - QMultiLineEdit::mousePressEvent( e ); + Q3MultiLineEdit::mousePressEvent( e ); } @@ -39,3 +41,3 @@ void KTextEdit::mouseReleaseEvent(QMouseEvent *e) { - QMultiLineEdit::mouseReleaseEvent(e); + Q3MultiLineEdit::mouseReleaseEvent(e); } @@ -50,3 +52,3 @@ void KTextEdit::mouseMoveEvent(QMouseEvent *e) mAllowPopupMenu = false; - QMultiLineEdit::mouseMoveEvent(e); + Q3MultiLineEdit::mouseMoveEvent(e); } diff --git a/microkde/ktextedit.h b/microkde/ktextedit.h index 87c0602..b7c8924 100644 --- a/microkde/ktextedit.h +++ b/microkde/ktextedit.h @@ -3,5 +3,7 @@ -#include <qmultilineedit.h> +#include <q3multilineedit.h> +//Added by qt3to4: +#include <QMouseEvent> -class KTextEdit : public QMultiLineEdit +class KTextEdit : public Q3MultiLineEdit { diff --git a/microkde/kurl.cpp b/microkde/kurl.cpp index 2574e25..122ad71 100644 --- a/microkde/kurl.cpp +++ b/microkde/kurl.cpp @@ -36,3 +36,3 @@ #endif -#include <qurl.h> +#include <q3url.h> #include <qdir.h> @@ -43,2 +43,4 @@ #include <qtextcodec.h> +//Added by qt3to4: +#include <Q3CString> @@ -59,3 +61,3 @@ static QString encode( const QString& segment, bool encode_slash, int encoding_h - QCString local; + Q3CString local; if (encoding_hint==0) @@ -102,3 +104,3 @@ static QString encode( const QString& segment, bool encode_slash, int encoding_h else - new_segment[ new_length++ ] = local[i]; + new_segment[ new_length++ ] = character; } @@ -207,3 +209,3 @@ static void decode( const QString& segment, QString &decoded, QString &encoded, - QCString csegment = textCodec->fromUnicode(segment); + Q3CString csegment = textCodec->fromUnicode(segment); // Check if everything went ok @@ -280,3 +282,3 @@ static void decode( const QString& segment, QString &decoded, QString &encoded, array.resetRawData(new_segment, new_length); - QCString validate = textCodec->fromUnicode(decoded); + Q3CString validate = textCodec->fromUnicode(decoded); @@ -421,3 +423,3 @@ KURL::KURL( const char * url, int encoding_hint ) -KURL::KURL( const QCString& url, int encoding_hint ) +KURL::KURL( const Q3CString& url, int encoding_hint ) { @@ -462,3 +464,3 @@ QDataStream & operator>> (QDataStream & s, KURL & a) #ifndef QT_NO_NETWORKPROTOCOL -KURL::KURL( const QUrl &u ) +KURL::KURL( const Q3Url &u ) { @@ -591,3 +593,3 @@ void KURL::parse( const QString& _url, int encoding_hint ) goto Node9; - if ( !isalpha( (int)x ) ) + if ( !x.isLetter() ) goto NodeErr; @@ -597,3 +599,3 @@ void KURL::parse( const QString& _url, int encoding_hint ) // Proceed with :// :/ or : - while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) || + while( pos < len && ( buf[pos].isLetter() || buf[pos].isDigit() || buf[pos] == '+' || buf[pos] == '-')) pos++; @@ -771,3 +773,3 @@ void KURL::parse( const QString& _url, int encoding_hint ) start = pos; - if ( !isdigit( buf[pos++] ) ) + if ( !buf[pos++].isDigit() ) goto NodeErr; @@ -775,3 +777,3 @@ void KURL::parse( const QString& _url, int encoding_hint ) // Node 8b: Accept any amount of digits - while( pos < len && isdigit( buf[pos] ) ) pos++; + while( pos < len && buf[pos].isDigit() ) pos++; port = QString( buf + start, pos - start ); @@ -850,3 +852,3 @@ KURL& KURL::operator=( const char * _url ) #ifndef QT_NO_NETWORKPROTOCOL -KURL& KURL::operator=( const QUrl & u ) +KURL& KURL::operator=( const Q3Url & u ) { @@ -1376,3 +1378,3 @@ KURL KURL::join( const KURL::List & lst ) { - if (!u.m_strRef_encoded) u.m_strRef_encoded = tmp.url(); + if (u.m_strRef_encoded.isEmpty()) u.m_strRef_encoded = tmp.url(); else u.m_strRef_encoded += "#" + tmp.url(); // Support more than one suburl thingy @@ -1420,3 +1422,3 @@ QString KURL::fileName( bool _strip_trailing_slash ) const QString fileName_encoded = m_strPath_encoded.mid(i+1); - n += fileName_encoded.contains("%2f", false); + n += fileName_encoded.count("%2f", Qt::CaseInsensitive); } diff --git a/microkde/kurl.h b/microkde/kurl.h index cd65a1c..016eb24 100644 --- a/microkde/kurl.h +++ b/microkde/kurl.h @@ -23,5 +23,7 @@ #include <qstring.h> -#include <qvaluelist.h> +#include <q3valuelist.h> +//Added by qt3to4: +#include <Q3CString> -class QUrl; +class Q3Url; class QStringList; @@ -66,3 +68,3 @@ public: */ - class List : public QValueList<KURL> + class List : public Q3ValueList<KURL> { @@ -137,3 +139,3 @@ public: */ - KURL( const QCString& url, int encoding_hint = 0 ); + KURL( const Q3CString& url, int encoding_hint = 0 ); /** @@ -147,3 +149,3 @@ public: */ - KURL( const QUrl &u ); + KURL( const Q3Url &u ); /** @@ -660,3 +662,3 @@ public: KURL& operator=( const char * _url ); - KURL& operator=( const QUrl & u ); + KURL& operator=( const Q3Url & u ); diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index 9c87682..88f17e5 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp @@ -21,6 +21,8 @@ -#include <qhbox.h> -#include <qvbox.h> +#include <q3hbox.h> +#include <q3vbox.h> #include <qcursor.h> #include <qlayout.h> +//Added by qt3to4: +#include <QPixmap> @@ -75,3 +77,3 @@ void KCMultiDialog::slotDefault() - QPtrListIterator<KCModule> it(modules); + Q3PtrListIterator<KCModule> it(modules); for (; it.current(); ++it) @@ -93,3 +95,3 @@ void KCMultiDialog::slotApply() { - QPtrListIterator<KCModule> it(modules); + Q3PtrListIterator<KCModule> it(modules); for (; it.current(); ++it) @@ -107,3 +109,3 @@ qDebug("KCMultiDialog::slotOk clicked"); - QPtrListIterator<KCModule> it(modules); + Q3PtrListIterator<KCModule> it(modules); for (; it.current(); ++it) @@ -155,5 +157,5 @@ void KCMultiDialog::addModule(const QString& path, bool withfallback) */ -QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) +Q3VBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) { - QVBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); + Q3VBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); return page; diff --git a/microkde/kutils/kcmultidialog.h b/microkde/kutils/kcmultidialog.h index 66412ac..78f8a00 100644 --- a/microkde/kutils/kcmultidialog.h +++ b/microkde/kutils/kcmultidialog.h @@ -24,4 +24,4 @@ -#include <qptrlist.h> -#include <qptrdict.h> +#include <q3ptrlist.h> +#include <q3ptrdict.h> @@ -77,3 +77,3 @@ public: void addModule(KCModule* module );//, const QString& modulename, const QString& iconname); - QVBox* getNewVBoxPage(const QString & modulename) ; + Q3VBox* getNewVBoxPage(const QString & modulename) ; @@ -135,3 +135,3 @@ private: */ - QPtrList<KCModule> modules; + Q3PtrList<KCModule> modules; /* diff --git a/microkde/microkde.pro b/microkde/microkde.pro index 7120bdd..4ff06a3 100644 --- a/microkde/microkde.pro +++ b/microkde/microkde.pro @@ -8,3 +8,3 @@ INCLUDEPATH += . ../ ../kabc ./kdecore ./kdeui ./kio/kfile ./kio/kio -TARGET = microkde +TARGET = xmicrokde DESTDIR= ../bin @@ -180 +180,3 @@ KDGanttMinimizeSplitter.cpp \ kidmanager.cpp +#The following line was inserted by qt3to4 +QT += xml qt3support diff --git a/microkde/microkdeE.pro b/microkde/microkdeE.pro index 8fe2bd5..514e7b3 100644 --- a/microkde/microkdeE.pro +++ b/microkde/microkdeE.pro @@ -9,3 +9,3 @@ DEFINES += KDE_QT_ONLY -TARGET = microkde +TARGET = xmicrokde OBJECTS_DIR = obj/$(PLATFORM) diff --git a/microkde/ofileselector_p.cpp b/microkde/ofileselector_p.cpp index f4f112e..0f95c84 100644 --- a/microkde/ofileselector_p.cpp +++ b/microkde/ofileselector_p.cpp @@ -267,3 +267,3 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st /* let's fill device parts */ - QPopupMenu* pop = new QPopupMenu(this); + Q3PopupMenu* pop = new Q3PopupMenu(this); connect(pop, SIGNAL( activated(int) ), diff --git a/microkde/ofileselector_p.h b/microkde/ofileselector_p.h index 834fd70..a7d97fe 100644 --- a/microkde/ofileselector_p.h +++ b/microkde/ofileselector_p.h @@ -139,3 +139,3 @@ private: OFileSelector* m_sel; - QPopupMenu* m_fsPop; + Q3PopupMenu* m_fsPop; bool compliesMime( const QString& ); diff --git a/microkde/qlayoutengine_p.h b/microkde/qlayoutengine_p.h index 2d6a556..e782703 100644 --- a/microkde/qlayoutengine_p.h +++ b/microkde/qlayoutengine_p.h @@ -1 +1,3 @@ +//Added by qt3to4: +#include <Q3MemArray> // THIS IS A COPY OF THE FILE FOUND IN $QTDIR/src/kernel. Needed to modify qsplitter @@ -57,6 +59,2 @@ -#ifndef QT_H -#include "qabstractlayout.h" -#endif // QT_H - #ifndef QT_NO_LAYOUT @@ -83,3 +81,3 @@ struct QLayoutStruct -void qGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, +void qGeomCalc( Q3MemArray<QLayoutStruct> &chain, int start, int count, int pos, int space, int spacer ); |