From f5cef3209f0daf93560f89371dde7a256925839f Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Mon, 1 Aug 2005 16:10:18 +0000 Subject: [PATCH] Use all my script to port it. I hope now we can port kdeedu and not remove it as previously svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=442095 --- extdate/extdatepicker.cpp | 28 +++++++++++------ extdate/extdatepicker.h | 8 +++-- extdate/extdatetbl.cpp | 48 ++++++++++++++++------------ extdate/extdatetbl.h | 21 ++++++++----- extdate/extdatetimeedit.cpp | 40 +++++++++++++---------- extdate/extdatetimeedit.h | 12 +++++-- extdate/extdatewidget.cpp | 2 ++ extdate/testwidget.cpp | 2 ++ extdate/testwidget.h | 2 ++ kdeeducore/keduvocdata.h | 4 +-- kdeeduplot/kplotobject.h | 6 ++-- kdeeduplot/kplotwidget.cpp | 20 +++++++----- kdeeduplot/kplotwidget.h | 7 ++++- kdeeduui/kdeeduglossary.cpp | 63 ++++++++++++++++++++----------------- kdeeduui/kdeeduglossary.h | 19 ++++++----- 15 files changed, 174 insertions(+), 108 deletions(-) diff --git a/extdate/extdatepicker.cpp b/extdate/extdatepicker.cpp index d64fca4..334b5ee 100644 --- a/extdate/extdatepicker.cpp +++ b/extdate/extdatepicker.cpp @@ -24,7 +24,15 @@ #include #include #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include #include #include @@ -84,19 +92,19 @@ void ExtDatePicker::fillWeeksCombo(const ExtDate &date) } ExtDatePicker::ExtDatePicker(QWidget *parent, ExtDate dt, const char *name) - : QFrame(parent,name) + : Q3Frame(parent,name) { init( dt ); } -ExtDatePicker::ExtDatePicker(QWidget *parent, ExtDate dt, const char *name, WFlags f) - : QFrame(parent,name, f) +ExtDatePicker::ExtDatePicker(QWidget *parent, ExtDate dt, const char *name, Qt::WFlags f) + : Q3Frame(parent,name, f) { init( dt ); } ExtDatePicker::ExtDatePicker( QWidget *parent, const char *name ) - : QFrame(parent,name) + : Q3Frame(parent,name) { init( ExtDate::currentDate() ); } @@ -212,8 +220,8 @@ ExtDatePicker::eventFilter(QObject *o, QEvent *e ) if ( e->type() == QEvent::KeyPress ) { QKeyEvent *k = (QKeyEvent *)e; - if ( (k->key() == Qt::Key_Prior) || - (k->key() == Qt::Key_Next) || + if ( (k->key() == Qt::Key_PageUp) || + (k->key() == Qt::Key_PageDown) || (k->key() == Qt::Key_Up) || (k->key() == Qt::Key_Down) ) { @@ -222,7 +230,7 @@ ExtDatePicker::eventFilter(QObject *o, QEvent *e ) return true; // eat event } } - return QFrame::eventFilter( o, e ); + return Q3Frame::eventFilter( o, e ); } void @@ -351,7 +359,7 @@ ExtDatePicker::selectMonthClicked() ExtDate date = table->getDate(); int i, month, months = d->calendar->monthsInYear(date); - QPopupMenu popup(selectMonth); + Q3PopupMenu popup(selectMonth); for (i = 1; i <= months; i++) popup.insertItem(d->calendar->monthName(i, d->calendar->year(date)), i); @@ -375,7 +383,7 @@ ExtDatePicker::selectYearClicked() { // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); - if (selectYear->state() == QButton::Off) + if (selectYear->state() == QCheckBox::Off) { return; } diff --git a/extdate/extdatepicker.h b/extdate/extdatepicker.h index 82a0f28..a1a176a 100644 --- a/extdate/extdatepicker.h +++ b/extdate/extdatepicker.h @@ -24,6 +24,10 @@ #include "extdatetime.h" +//Added by qt3to4: +#include +#include +#include class QLineEdit; class QToolButton; @@ -49,7 +53,7 @@ class ExtDateTable; * * @short A date selection widget. **/ -class KDE_EXPORT ExtDatePicker: public QFrame +class KDE_EXPORT ExtDatePicker: public Q3Frame { Q_OBJECT // Q_PROPERTY( ExtDate date READ date WRITE setDate) @@ -71,7 +75,7 @@ public: ExtDatePicker(QWidget *parent, ExtDate, const char *name, - WFlags f); // ### KDE 4.0: Merge + Qt::WFlags f); // ### KDE 4.0: Merge /** * Standard qt widget constructor. The initial date will be the diff --git a/extdate/extdatetbl.cpp b/extdate/extdatetbl.cpp index 704d4b9..cea09fd 100644 --- a/extdate/extdatetbl.cpp +++ b/extdate/extdatetbl.cpp @@ -48,7 +48,15 @@ #include #include "kpopupmenu.h" #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include #include @@ -77,7 +85,7 @@ public: QColor bgColor; BackgroundMode bgMode; }; - QDict customPaintingModes; + Q3Dict customPaintingModes; ExtCalendarSystem *calendar; }; @@ -107,7 +115,7 @@ ExtDateValidator::date(const QString& text, ExtDate& ed) const ed = tmp; return Acceptable; } else - return Valid; + return QValidator::Intermediate; } void @@ -116,8 +124,8 @@ ExtDateValidator::fixup( QString& ) const } -ExtDateTable::ExtDateTable(QWidget *parent, ExtDate date_, const char* name, WFlags f) - : QGridView(parent, name, f) +ExtDateTable::ExtDateTable(QWidget *parent, ExtDate date_, const char* name, Qt::WFlags f) + : Q3GridView(parent, name, f) { d = new ExtDateTablePrivate; setFontSize(10); @@ -126,7 +134,7 @@ ExtDateTable::ExtDateTable(QWidget *parent, ExtDate date_, const char* name, WFl kdDebug() << "ExtDateTable ctor: WARNING: Given date is invalid, using current date." << endl; date_=ExtDate::currentDate(); } - setFocusPolicy( QWidget::StrongFocus ); + setFocusPolicy( Qt::StrongFocus ); setNumRows(7); // 6 weeks max + headline setNumCols(7); // 7 days a week setHScrollBarMode(AlwaysOff); @@ -219,7 +227,7 @@ ExtDateTable::paintCell(QPainter *painter, int row, int col) painter->drawRect(0, 0, w, h); painter->setPen(textColor); } - painter->drawText(0, 0, w, h-1, AlignCenter, + painter->drawText(0, 0, w, h-1, Qt::AlignCenter, d->calendar->weekDayName(daynum, true), -1, &rect); painter->setPen(colorGroup().text()); painter->moveTo(0, h-1); @@ -293,7 +301,7 @@ ExtDateTable::paintCell(QPainter *painter, int row, int col) if ( paintRect ) painter->drawRect(0, 0, w, h); painter->setPen(pen); - painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect); + painter->drawText(0, 0, w, h, Qt::AlignCenter, text, -1, &rect); } if(rect.width()>maxCell.width()) maxCell.setWidth(rect.width()); if(rect.height()>maxCell.height()) maxCell.setHeight(rect.height()); @@ -349,8 +357,8 @@ ExtDateTable::keyPressEvent( QKeyEvent *e ) case Key_N: setDate(ExtDate::currentDate()); return; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: emit tableClicked(); return; default: @@ -363,7 +371,7 @@ ExtDateTable::keyPressEvent( QKeyEvent *e ) void ExtDateTable::viewportResizeEvent(QResizeEvent * e) { - QGridView::viewportResizeEvent(e); + Q3GridView::viewportResizeEvent(e); setCellWidth(viewport()->width()/7); setCellHeight(viewport()->height()/7); @@ -509,13 +517,13 @@ ExtDateTable::getDate() const void ExtDateTable::focusInEvent( QFocusEvent *e ) { // repaintContents(false); - QGridView::focusInEvent( e ); + Q3GridView::focusInEvent( e ); } void ExtDateTable::focusOutEvent( QFocusEvent *e ) { // repaintContents(false); - QGridView::focusOutEvent( e ); + Q3GridView::focusOutEvent( e ); } QSize @@ -541,7 +549,7 @@ bool ExtDateTable::popupMenuEnabled() const return d->popupMenuEnabled; } -void ExtDateTable::setCustomDatePainting(const ExtDate &date, const QColor &fgColor, BackgroundMode bgMode, const QColor &bgColor) +void ExtDateTable::setCustomDatePainting(const ExtDate &date, const QColor &fgColor, Qt::BackgroundMode bgMode, const QColor &bgColor) { if (!fgColor.isValid()) { @@ -574,7 +582,7 @@ ExtDateInternalWeekSelector::ExtDateInternalWeekSelector // ----- font=KGlobalSettings::generalFont(); setFont(font); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); setValidator(val); connect(this, SIGNAL(returnPressed()), SLOT(weekEnteredSlot())); } @@ -639,7 +647,7 @@ ExtDateInternalMonthPicker::~ExtDateInternalMonthPicker() { ExtDateInternalMonthPicker::ExtDateInternalMonthPicker (const ExtDate & date, QWidget* parent, const char* name) - : QGridView(parent, name), + : Q3GridView(parent, name), result(0) // invalid { //FIXME: Can't uncomment the following unless ExtDate is moved to kdelibs @@ -654,7 +662,7 @@ ExtDateInternalMonthPicker::ExtDateInternalMonthPicker setFont(font); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); setNumCols(3); d = new ExtDateInternalMonthPrivate(date.year(), date.month(), date.day()); // For monthsInYear != 12 @@ -821,7 +829,7 @@ ExtDateInternalYearSelector::ExtDateInternalYearSelector // ----- font=KGlobalSettings::generalFont(); setFont(font); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(Q3Frame::NoFrame); // set year limits (perhaps we should get rid of limits altogether) //there si also a year limit in ExtCalendarSystemGregorian... val->setRange(-50000, 50000); @@ -874,11 +882,11 @@ ExtDateInternalYearSelector::setYear(int year) } KPopupFrame::KPopupFrame(QWidget* parent, const char* name) - : QFrame(parent, name, WType_Popup), + : Q3Frame(parent, name, Qt::WType_Popup), result(0), // rejected main(0) { - setFrameStyle(QFrame::Box|QFrame::Raised); + setFrameStyle(Q3Frame::Box|Q3Frame::Raised); setMidLineWidth(2); } diff --git a/extdate/extdatetbl.h b/extdate/extdatetbl.h index b41d1eb..ddb9766 100644 --- a/extdate/extdatetbl.h +++ b/extdate/extdatetbl.h @@ -27,7 +27,14 @@ #define EXTDATETBL_H #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include #include #include "extcalendarsystemgregorian.h" @@ -65,7 +72,7 @@ private: * @version $Id$ * @author Tim Gilman, Mirko Boehm */ -class ExtDateInternalMonthPicker : public QGridView +class ExtDateInternalMonthPicker : public Q3GridView { Q_OBJECT protected: @@ -174,7 +181,7 @@ private: * @author Tim Gilman, Mirko Boehm * @version $Id$ */ -class KPopupFrame : public QFrame +class KPopupFrame : public Q3Frame { Q_OBJECT protected: @@ -229,7 +236,7 @@ public: private: - virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); } + virtual bool close(bool alsoDelete) { return Q3Frame::close(alsoDelete); } protected: virtual void virtual_hook( int id, void* data ); private: @@ -262,7 +269,7 @@ public: * @version $Id$ * @author Tim Gilman, Mirko Boehm */ -class ExtDateTable : public QGridView +class ExtDateTable : public Q3GridView { Q_OBJECT //Q_PROPERTY( ExtDate date READ getDate WRITE setDate ) @@ -274,7 +281,7 @@ public: */ ExtDateTable(QWidget *parent=0, ExtDate date=ExtDate::currentDate(), - const char* name=0, WFlags f=0); + const char* name=0, Qt::WFlags f=0); /** * The destructor. @@ -323,7 +330,7 @@ public: * * @since 3.2 */ - void setCustomDatePainting( const ExtDate &date, const QColor &fgColor, BackgroundMode bgMode=NoBgMode, const QColor &bgColor=QColor()); + void setCustomDatePainting( const ExtDate &date, const QColor &fgColor, Qt::BackgroundMode bgMode=NoBgMode, const QColor &bgColor=QColor()); /** * Unsets the custom painting of a date so that the date is painted as usual. diff --git a/extdate/extdatetimeedit.cpp b/extdate/extdatetimeedit.cpp index 3b89c10..5fa4c3a 100644 --- a/extdate/extdatetimeedit.cpp +++ b/extdate/extdatetimeedit.cpp @@ -31,14 +31,22 @@ //#include "../kernel/qrichtext_p.h" #include #include -#include +#include #include #include #include -#include +#include #include #include -#include //need for QTimeEdit +#include //need for QTimeEdit +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include #define EXTDATETIMEEDIT_HIDDEN_CHAR '0' @@ -336,16 +344,16 @@ private: QTextCursor *cursor; QSize sz; int focusSec; - QValueList< QNumberSection > sections; + Q3ValueList< QNumberSection > sections; QString sep; int offset; }; -class ExtDateTimeSpinWidget : public QSpinWidget +class ExtDateTimeSpinWidget : public Q3SpinWidget { public: ExtDateTimeSpinWidget( QWidget *parent, const char *name ) - : QSpinWidget( parent, name ) + : Q3SpinWidget( parent, name ) { } @@ -363,7 +371,7 @@ protected: if ( section == -1 ) return; - QSpinWidget::wheelEvent( e ); + Q3SpinWidget::wheelEvent( e ); } #endif }; @@ -374,7 +382,7 @@ protected: */ ExtDateTimeEditor::ExtDateTimeEditor( ExtDateTimeEditBase * parent, const char * name ) - : QWidget( parent, name, WNoAutoErase ) + : QWidget( parent, name, Qt::WNoAutoErase ) { d = new ExtDateTimeEditorPrivate(); cw = parent; @@ -526,8 +534,8 @@ bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) case Key_Backspace: if ( ::qt_cast(cw) ) ((ExtDateEdit*)cw)->removeFirstNumber( d->focusSection() ); - else if ( ::qt_cast(cw) ) - ((QTimeEdit*)cw)->removeFirstNumber( d->focusSection() ); + else if ( ::qt_cast(cw) ) + ((Q3TimeEdit*)cw)->removeFirstNumber( d->focusSection() ); return TRUE; case Key_Delete: cw->removeLastNumber( d->focusSection() ); @@ -577,11 +585,11 @@ bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) repaint( rect(), FALSE ); } return TRUE; - } else if ( !txt.isEmpty() && ::qt_cast(cw) && focusSection() == (int) d->sectionCount()-1 ) { + } else if ( !txt.isEmpty() && ::qt_cast(cw) && focusSection() == (int) d->sectionCount()-1 ) { // the first character of the AM/PM indicator toggles if the section has focus - QTimeEdit *te = (QTimeEdit*)cw; + Q3TimeEdit *te = (Q3TimeEdit*)cw; QTime time = te->time(); - if ( lAMPM && lAM && lPM && (te->display()&QTimeEdit::AMPM) ) { + if ( lAMPM && lAM && lPM && (te->display()&Q3TimeEdit::AMPM) ) { if ( txt[0] == (*lAM).lower()[0] && time.hour() >= 12 ) { time.setHMS( time.hour()-12, time.minute(), time.second(), time.msec() ); te->setTime( time ); @@ -747,7 +755,7 @@ public: ExtDate max; bool changed; ExtDateTimeEditor *ed; - QSpinWidget *controls; + Q3SpinWidget *controls; }; @@ -1675,7 +1683,7 @@ public: QTime max; bool changed; ExtDateTimeEditor *ed; - QSpinWidget *controls; + Q3SpinWidget *controls; }; /*! @@ -2620,7 +2628,7 @@ void ExtDateTimeEdit::init() { d = new ExtDateTimeEditPrivate(); de = new ExtDateEdit( this, "qt_datetime_dateedit" ); - te = new QTimeEdit( this, "qt_datetime_timeedit" ); + te = new Q3TimeEdit( this, "qt_datetime_timeedit" ); d->adv = FALSE; connect( de, SIGNAL( valueChanged( const ExtDate& ) ), this, SLOT( newValue( const ExtDate& ) ) ); diff --git a/extdate/extdatetimeedit.h b/extdate/extdatetimeedit.h index 048f7aa..c636356 100644 --- a/extdate/extdatetimeedit.h +++ b/extdate/extdatetimeedit.h @@ -31,10 +31,16 @@ #endif // QT_H #include "extdatetime.h" +//Added by qt3to4: +#include +#include +#include +#include +#include #ifndef QT_NO_DATETIMEEDIT -class QTimeEdit; +class Q3TimeEdit; class ExtDateTimeEditBase : public QWidget { @@ -249,7 +255,7 @@ public: ExtDateTime dateTime() const; ExtDateEdit* dateEdit() { return de; } - QTimeEdit* timeEdit() { return te; } + Q3TimeEdit* timeEdit() { return te; } virtual void setAutoAdvance( bool advance ); bool autoAdvance() const; @@ -270,7 +276,7 @@ protected slots: private: ExtDateEdit* de; - QTimeEdit* te; + Q3TimeEdit* te; ExtDateTimeEditPrivate* d; #if defined(Q_DISABLE_COPY) diff --git a/extdate/extdatewidget.cpp b/extdate/extdatewidget.cpp index d323172..77ba9ac 100644 --- a/extdate/extdatewidget.cpp +++ b/extdate/extdatewidget.cpp @@ -23,6 +23,8 @@ #include #include #include +//Added by qt3to4: +#include #include #include diff --git a/extdate/testwidget.cpp b/extdate/testwidget.cpp index 4dcd91c..18c2333 100644 --- a/extdate/testwidget.cpp +++ b/extdate/testwidget.cpp @@ -20,6 +20,8 @@ #include #include #include +//Added by qt3to4: +#include #include "extdatepicker.h" #include "extdatewidget.h" diff --git a/extdate/testwidget.h b/extdate/testwidget.h index ef69f8b..267645c 100644 --- a/extdate/testwidget.h +++ b/extdate/testwidget.h @@ -19,6 +19,8 @@ #define TESTWIDGET_H #include +//Added by qt3to4: +#include class KDatePicker; class KLineEdit; diff --git a/kdeeducore/keduvocdata.h b/kdeeducore/keduvocdata.h index 3a18ffc..c55b116 100644 --- a/kdeeducore/keduvocdata.h +++ b/kdeeducore/keduvocdata.h @@ -20,7 +20,7 @@ #define KEDUVOCDATA_H #include -#include +#include #include class KDE_EXPORT KEduVocDataItem @@ -40,7 +40,7 @@ private: QDomElement domElement; }; -typedef QValueList KEduVocDataItemList; +typedef Q3ValueList KEduVocDataItemList; class KDE_EXPORT KEduVocData { diff --git a/kdeeduplot/kplotobject.h b/kdeeduplot/kplotobject.h index 52d7954..d22f8f7 100644 --- a/kdeeduplot/kplotobject.h +++ b/kdeeduplot/kplotobject.h @@ -1,3 +1,5 @@ +//Added by qt3to4: +#include /*************************************************************************** kplotobject.h - A list of points to be plotted ------------------- @@ -169,7 +171,7 @@ public: */ DPoint* point( unsigned int i ) { return pList.at(i); } - QPtrList* points() { return &pList; } + Q3PtrList* points() { return &pList; } /**@short Add a point to the object's list. *@param p the DPoint to add. @@ -196,7 +198,7 @@ public: void clearPoints() { pList.clear(); } private: - QPtrList pList; + Q3PtrList pList; PTYPE Type; unsigned int Size, Parameter; QString Color, Name; diff --git a/kdeeduplot/kplotwidget.cpp b/kdeeduplot/kplotwidget.cpp index eb527ba..3146e1d 100644 --- a/kdeeduplot/kplotwidget.cpp +++ b/kdeeduplot/kplotwidget.cpp @@ -19,17 +19,21 @@ #include #include #include +//Added by qt3to4: +#include +#include +#include #include "kplotwidget.h" #include "kplotwidget.moc" KPlotWidget::KPlotWidget( double x1, double x2, double y1, double y2, QWidget *parent, const char* name ) - : QWidget( parent, name, WNoAutoErase ), + : QWidget( parent, name, Qt::WNoAutoErase ), dXtick(0.0), dYtick(0.0), nmajX(0), nminX(0), nmajY(0), nminY(0), ShowTickMarks( true ), ShowTickLabels( true ), ShowGrid( false ) { - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( Qt::NoBackground ); //set DataRect setLimits( x1, x2, y1, y2 ); @@ -184,7 +188,7 @@ void KPlotWidget::drawObjects( QPainter *p ) { case KPlotObject::CURVE : { - p->setPen( QPen( QColor( po->color() ), po->size(), (QPen::PenStyle)po->param() ) ); + p->setPen( QPen( QColor( po->color() ), po->size(), (Qt::PenStyle)po->param() ) ); DPoint *dp = po->points()->first(); p->moveTo( dp->qpoint( PixRect, DataRect ) ); for ( dp = po->points()->next(); dp; dp = po->points()->next() ) @@ -195,16 +199,16 @@ void KPlotWidget::drawObjects( QPainter *p ) { case KPlotObject::LABEL : //draw label centered at point in x, and slightly below point in y. { QPoint q = po->points()->first()->qpoint( PixRect, DataRect ); - p->drawText( q.x()-20, q.y()+6, 40, 10, Qt::AlignCenter | Qt::DontClip, po->name() ); + p->drawText( q.x()-20, q.y()+6, 40, 10, Qt::AlignCenter | Qt::TextDontClip, po->name() ); break; } case KPlotObject::POLYGON : { - p->setPen( QPen( QColor( po->color() ), po->size(), (QPen::PenStyle)po->param() ) ); + p->setPen( QPen( QColor( po->color() ), po->size(), (Qt::PenStyle)po->param() ) ); p->setBrush( po->color() ); - QPointArray a( po->count() ); + Q3PointArray a( po->count() ); unsigned int i=0; for ( DPoint *dp = po->points()->first(); dp; dp = po->points()->next() ) @@ -297,7 +301,7 @@ void KPlotWidget::drawBox( QPainter *p ) { QString str = QString( "%1" ).arg( lab, BottomAxis.labelFieldWidth(), BottomAxis.labelFmt(), BottomAxis.labelPrec() ); if ( px > 0 && px < PixRect.width() ) { QRect r( px - BIGTICKSIZE, PixRect.height()+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); - p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); + p->drawText( r, Qt::AlignCenter | Qt::TextDontClip, str ); } } @@ -343,7 +347,7 @@ void KPlotWidget::drawBox( QPainter *p ) { QString str = QString( "%1" ).arg( lab, LeftAxis.labelFieldWidth(), LeftAxis.labelFmt(), LeftAxis.labelPrec() ); if ( py > 0 && py < PixRect.height() ) { QRect r( -2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); - p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); + p->drawText( r, Qt::AlignCenter | Qt::TextDontClip, str ); } } diff --git a/kdeeduplot/kplotwidget.h b/kdeeduplot/kplotwidget.h index b24e31b..dd6bd1c 100644 --- a/kdeeduplot/kplotwidget.h +++ b/kdeeduplot/kplotwidget.h @@ -19,6 +19,11 @@ #define _KPLOTWIDGET_H_ #include +//Added by qt3to4: +#include +#include +#include +#include #include "kplotobject.h" #include "kplotaxis.h" @@ -248,7 +253,7 @@ protected: //Limits of the plot area in data units DRect DataRect; //List of KPlotObjects - QPtrList ObjectList; + Q3PtrList ObjectList; //Colors QColor cBackground, cForeground, cGrid; diff --git a/kdeeduui/kdeeduglossary.cpp b/kdeeduui/kdeeduglossary.cpp index 9d126db..c735035 100644 --- a/kdeeduui/kdeeduglossary.cpp +++ b/kdeeduui/kdeeduglossary.cpp @@ -22,12 +22,17 @@ #include #include -#include +#include #include #include #include #include #include +//Added by qt3to4: +#include +#include +#include +#include Glossary::Glossary() { @@ -49,7 +54,7 @@ bool Glossary::loadLayout( QDomDocument &Document, const KURL& url ) return false; } - if (!layoutFile.open(IO_ReadOnly)) + if (!layoutFile.open(QIODevice::ReadOnly)) return false; ///Check if document is well-formed @@ -80,7 +85,7 @@ Glossary* Glossary::readFromXML( const KURL& url, const QString& path ) if ( glossary->loadLayout( doc, url ) ) { - QValueList itemList; + Q3ValueList itemList; itemList = glossary->readItems( doc ); glossary->setItemlist( itemList ); glossary->fixImagePath(); @@ -92,8 +97,8 @@ Glossary* Glossary::readFromXML( const KURL& url, const QString& path ) void Glossary::fixImagePath() { kdDebug() << "Glossary::fixImagePath()" << endl; - QValueList::iterator it = m_itemlist.begin(); - const QValueList::iterator itEnd = m_itemlist.end(); + Q3ValueList::iterator it = m_itemlist.begin(); + const Q3ValueList::iterator itEnd = m_itemlist.end(); QString path = m_picturepath; QString firstpart = " Glossary::readItems( QDomDocument &itemDocument ) +Q3ValueList Glossary::readItems( QDomDocument &itemDocument ) { - QValueList list; + Q3ValueList list; QDomNodeList itemList; QDomNodeList refNodeList; @@ -206,7 +211,7 @@ GlossaryDialog::GlossaryDialog( bool folded, QWidget *parent, const char *name) m_htmlpart = new KHTMLPart( vs, "html-part" ); connect( m_htmlpart->browserExtension(), SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ), this, SLOT( displayItem( const KURL &, const KParts::URLArgs & ) ) ); - connect( m_glosstree, SIGNAL(clicked( QListViewItem * )), this, SLOT(slotClicked( QListViewItem * ))); + connect( m_glosstree, SIGNAL(clicked( Q3ListViewItem * )), this, SLOT(slotClicked( Q3ListViewItem * ))); connect( clear, SIGNAL(clicked()), m_search, SLOT(clear())); resize( 600, 400 ); @@ -230,9 +235,9 @@ void GlossaryDialog::displayItem( const KURL& url, const KParts::URLArgs& ) QString myurl = url.host().lower(); m_search->setText( "" ); m_search->updateSearch( "" ); - QListViewItem *found = 0; - QListViewItemIterator it( m_glosstree ); - QListViewItem *item; + Q3ListViewItem *found = 0; + Q3ListViewItemIterator it( m_glosstree ); + Q3ListViewItem *item; while ( it.current() ) { item = it.current(); @@ -250,16 +255,16 @@ void GlossaryDialog::updateTree() { m_glosstree->clear(); - QValueList::const_iterator itGl = m_glossaries.begin(); - const QValueList::const_iterator itGlEnd = m_glossaries.end(); + Q3ValueList::const_iterator itGl = m_glossaries.begin(); + const Q3ValueList::const_iterator itGlEnd = m_glossaries.end(); for ( ; itGl != itGlEnd ; ++itGl ) { - QValueList items = ( *itGl )->itemlist(); - QValueList::iterator it = items.begin(); - const QValueList::iterator itEnd = items.end(); + Q3ValueList items = ( *itGl )->itemlist(); + Q3ValueList::iterator it = items.begin(); + const Q3ValueList::iterator itEnd = items.end(); - QListViewItem *main = new QListViewItem( m_glosstree, ( *itGl )->name() ); + Q3ListViewItem *main = new Q3ListViewItem( m_glosstree, ( *itGl )->name() ); main->setExpandable( true ); main->setSelectable( false ); //XXX TMP!!! @@ -270,17 +275,17 @@ void GlossaryDialog::updateTree() if ( foldinsubtrees ) { QChar thisletter = ( *it )->name().upper()[0]; - QListViewItem *thisletteritem = findTreeWithLetter( thisletter, main ); + Q3ListViewItem *thisletteritem = findTreeWithLetter( thisletter, main ); if ( !thisletteritem ) { - thisletteritem = new QListViewItem( main, thisletter ); + thisletteritem = new Q3ListViewItem( main, thisletter ); thisletteritem->setExpandable( true ); thisletteritem->setSelectable( false ); } - new QListViewItem( thisletteritem, ( *it )->name() ); + new Q3ListViewItem( thisletteritem, ( *it )->name() ); } else - new QListViewItem( main, ( *it )->name() ); + new Q3ListViewItem( main, ( *it )->name() ); } main->sort(); } @@ -298,9 +303,9 @@ void GlossaryDialog::addGlossary( Glossary* newgloss ) updateTree(); } -QListViewItem* GlossaryDialog::findTreeWithLetter( const QChar& l, QListViewItem* i ) +Q3ListViewItem* GlossaryDialog::findTreeWithLetter( const QChar& l, Q3ListViewItem* i ) { - QListViewItem *it = i->firstChild(); + Q3ListViewItem *it = i->firstChild(); while ( it ) { if ( it->text(0)[0] == l ) @@ -310,7 +315,7 @@ QListViewItem* GlossaryDialog::findTreeWithLetter( const QChar& l, QListViewItem return 0; } -void GlossaryDialog::slotClicked( QListViewItem *item ) +void GlossaryDialog::slotClicked( Q3ListViewItem *item ) { if ( !item ) return; @@ -320,8 +325,8 @@ void GlossaryDialog::slotClicked( QListViewItem *item ) * in the m_itemList. When it is found the HTML will be * generated */ - QValueList::iterator itGl = m_glossaries.begin(); - const QValueList::iterator itGlEnd = m_glossaries.end(); + Q3ValueList::iterator itGl = m_glossaries.begin(); + const Q3ValueList::iterator itGlEnd = m_glossaries.end(); bool found = false; GlossaryItem *i = 0; @@ -329,9 +334,9 @@ void GlossaryDialog::slotClicked( QListViewItem *item ) while ( !found && itGl != itGlEnd ) { - QValueList items = ( *itGl )->itemlist(); - QValueList::const_iterator it = items.begin(); - const QValueList::const_iterator itEnd = items.end(); + Q3ValueList items = ( *itGl )->itemlist(); + Q3ValueList::const_iterator it = items.begin(); + const Q3ValueList::const_iterator itEnd = items.end(); while ( !found && it != itEnd ) { if ( ( *it )->name() == item->text( 0 ) ) diff --git a/kdeeduui/kdeeduglossary.h b/kdeeduui/kdeeduglossary.h index bd60958..1a5958d 100644 --- a/kdeeduui/kdeeduglossary.h +++ b/kdeeduui/kdeeduglossary.h @@ -18,10 +18,13 @@ #include #include +//Added by qt3to4: +#include +#include class QChar; class QDomDocument; -class QListViewItem; +class Q3ListViewItem; class KListView; class KListViewSearchLine; class KActionCollection; @@ -47,7 +50,7 @@ class Glossary m_itemlist.append( item ); } - QValueList itemlist()const{ + Q3ValueList itemlist()const{ return m_itemlist; } @@ -81,7 +84,7 @@ class Glossary /** * sets the internal list of items to @p list */ - void setItemlist( QValueList list ){ + void setItemlist( Q3ValueList list ){ m_itemlist = list; } @@ -132,7 +135,7 @@ class Glossary * the information of the items and return them as a * QValueList */ - virtual QValueList readItems( QDomDocument &itemDocument ); + virtual Q3ValueList readItems( QDomDocument &itemDocument ); QString m_backgroundpicture; @@ -159,7 +162,7 @@ class Glossary */ bool loadLayout( QDomDocument& doc, const KURL& url ); - QValueList m_itemlist; + Q3ValueList m_itemlist; /** * the name of the glossary @@ -255,7 +258,7 @@ class GlossaryDialog : public KDialogBase void addGlossary( Glossary* newgloss ); private: - QValueList m_glossaries; + Q3ValueList m_glossaries; /** * if true the items will be displayed folded @@ -270,12 +273,12 @@ class GlossaryDialog : public KDialogBase KActionCollection* m_actionCollection; - QListViewItem* findTreeWithLetter( const QChar&, QListViewItem* ); + Q3ListViewItem* findTreeWithLetter( const QChar&, Q3ListViewItem* ); KListViewSearchLine *m_search; private slots: - void slotClicked( QListViewItem * ); + void slotClicked( Q3ListViewItem * ); /** * The user clicked on a href. Emit the corresponding item */ -- 2.47.3