35 files changed, 950 insertions, 816 deletions
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 @@ -29,4 +29,7 @@ #include <qtooltip.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3ValueList> //US#include <qwhatsthis.h> //US#include <kaccel.h> @@ -43,7 +46,7 @@ //US added this includefiles #include <qmenubar.h> -#include <qtoolbar.h> -#include <qpopupmenu.h> -#include <qiconset.h> +#include <q3toolbar.h> +#include <q3popupmenu.h> +#include <qicon.h> /** @@ -88,5 +91,5 @@ public: KAccel *m_kaccel; - QValueList<KAccel*> m_kaccelList; + Q3ValueList<KAccel*> m_kaccelList; QString m_groupText; @@ -108,5 +111,5 @@ public: }; - QValueList<Container> m_containers; + Q3ValueList<Container> m_containers; }; @@ -131,5 +134,5 @@ 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, KActionCollection* parent, const char* name ) @@ -165,5 +168,5 @@ KAction::KAction( const QString& text, const KShortcut& cut, initPrivate( text, cut, receiver, slot ); } -KAction::KAction( const QString& text, const QIconSet& pix, +KAction::KAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name ) @@ -183,5 +186,5 @@ 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, const QObject* receiver, const char* slot, QObject* parent, @@ -507,6 +510,6 @@ 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 ); } @@ -519,5 +522,5 @@ void KAction::updateShortcut( int i ) } -void KAction::updateShortcut( QPopupMenu* menu, int id ) +void KAction::updateShortcut( Q3PopupMenu* menu, int id ) { /*US @@ -622,5 +625,5 @@ void KAction::updateToolTip( int i ) if ( w->inherits( "KToolBar" ) ) 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() ); } @@ -647,7 +650,7 @@ int KAction::plug( QWidget *w, int index ) plugShortcut(); - if ( w->inherits("QPopupMenu") ) + if ( w->inherits("Q3PopupMenu") ) { - QPopupMenu* menu = static_cast<QPopupMenu*>( w ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( w ); int id; // Don't insert shortcut into menu if it's already in a KAccel object. @@ -722,5 +725,5 @@ int KAction::plug( QWidget *w, int index ) d->isEnabled(), d->plainText(), index/*US, instance*/ ); } - bar->getButton( id_ )->setName( QCString("toolbutton_")+name() ); + bar->getButton( id_ )->setName( Q3CString("toolbutton_")+name() ); //US if ( !d->whatsThis().isEmpty() ) @@ -750,7 +753,7 @@ void KAction::unplug( QWidget *w ) int id = itemId( i ); - if ( w->inherits( "QPopupMenu" ) ) + if ( w->inherits( "Q3PopupMenu" ) ) { - QPopupMenu *menu = static_cast<QPopupMenu *>( w ); + Q3PopupMenu *menu = static_cast<Q3PopupMenu *>( w ); menu->removeItem( id ); } @@ -863,6 +866,6 @@ void KAction::updateEnabled( int i ) QWidget *w = container( 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") ) static_cast<QMenuBar*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); @@ -907,8 +910,8 @@ void KAction::updateText( int i ) QWidget *w = container( 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 ); } else if ( w->inherits( "QMenuBar" ) ) @@ -948,8 +951,8 @@ void KAction::updateIcon( int id ) QWidget* w = container( 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_ ); } else if ( w->inherits( "QMenuBar" ) ) @@ -957,5 +960,5 @@ void KAction::updateIcon( int id ) else if ( w->inherits( "KToolBar" ) ) static_cast<KToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); - else if ( w->inherits( "QToolBar" ) ) + else if ( w->inherits( "Q3ToolBar" ) ) { qDebug("KAction::updateIcon has top be fixed"); @@ -969,5 +972,5 @@ QString KAction::icon() const } -void KAction::setIconSet( const QIconSet &iconset ) +void KAction::setIconSet( const QIcon &iconset ) { d->setIconSet( iconset ); @@ -983,9 +986,9 @@ void KAction::updateIconSet( int id ) QWidget *w = container( 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_ ); } else if ( w->inherits( "QMenuBar" ) ) @@ -1000,5 +1003,5 @@ void KAction::updateIconSet( int id ) } -QIconSet KAction::iconSet( KIcon::Group group, int size ) const +QIcon KAction::iconSet( KIcon::Group group, int size ) const { return d->iconSet( group, size ); @@ -1023,5 +1026,5 @@ void KAction::updateWhatsThis( int i ) { qDebug("KAction::updateWhatsThis ...1 has top be fixed"); - QPopupMenu* pm = popupMenu( i ); + Q3PopupMenu* pm = popupMenu( i ); if ( pm ) { @@ -1065,8 +1068,8 @@ 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 ); } @@ -1156,5 +1159,5 @@ 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() ) { @@ -1171,5 +1174,5 @@ 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 @@ -30,6 +30,8 @@ //US #include <qkeysequence.h> #include <qobject.h> -#include <qvaluelist.h> -#include <qguardedptr.h> +#include <q3valuelist.h> +#include <qpointer.h> +//Added by qt3to4: +#include <Q3PopupMenu> #include <kguiitem.h> #include <kshortcut.h> @@ -41,8 +43,8 @@ class QMenuBar; -class QPopupMenu; +class Q3PopupMenu; //USclass QComboBox; //USclass QPoint; -class QIconSet; +class QIcon; class QString; class KToolBar; @@ -260,5 +262,5 @@ 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, KActionCollection* parent, const char* name ); @@ -309,5 +311,5 @@ public: * @obsolete */ - 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 ); /** @@ -319,5 +321,5 @@ public: * @obsolete */ - 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 ); /** @@ -462,8 +464,8 @@ public: * be chosen. */ - 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 { return iconSet( KIcon::Small ); @@ -519,5 +521,5 @@ public slots: * be chosen. */ - virtual void setIconSet( const QIconSet &iconSet ); + virtual void setIconSet( const QIcon &iconSet ); virtual void setIcon( const QString& icon ); @@ -547,5 +549,5 @@ protected slots: protected: KToolBar* toolBar( int index ) const; - QPopupMenu* popupMenu( int index ) const; + Q3PopupMenu* popupMenu( int index ) const; void removeContainer( int index ); int findContainer( const QWidget* widget ) const; @@ -556,5 +558,5 @@ 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 ); virtual void updateText(int i ); 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 @@ -29,7 +29,9 @@ #include <qfontdatabase.h> -#include <qobjectlist.h> +#include <qobject.h> //US#include <qwhatsthis.h> #include <qtimer.h> +//Added by qt3to4: +#include <Q3ValueList> //US#include <kaccel.h> @@ -49,11 +51,11 @@ #include <kconfigbase.h> #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> static QFontDatabase *fontDataBase = 0; @@ -84,5 +86,5 @@ static void get_fonts( QStringList &lst ) } -static QValueList<int> get_standard_font_sizes() +static Q3ValueList<int> get_standard_font_sizes() { if ( !fontDataBase ) { @@ -121,5 +123,5 @@ 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, QObject* parent, const char* name ) @@ -137,5 +139,5 @@ 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, const QObject* receiver, @@ -170,5 +172,5 @@ KToggleAction::~KToggleAction() int KToggleAction::plug( QWidget* widget, int index ) { - if ( !widget->inherits("QPopupMenu") && !widget->inherits("KToolBar") ) + if ( !widget->inherits("Q3PopupMenu") && !widget->inherits("KToolBar") ) { kdWarning() << "Can not plug KToggleAction in " << widget->className() << endl; @@ -185,9 +187,9 @@ int KToggleAction::plug( QWidget* widget, int index ) return _index; - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { int id = itemId( _index ); - static_cast<QPopupMenu*>(widget)->setItemChecked( id, d->m_checked ); + static_cast<Q3PopupMenu*>(widget)->setItemChecked( id, d->m_checked ); } else if ( widget->inherits( "KToolBar" ) ) { @@ -215,11 +217,10 @@ 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() ) { a->setChecked( false ); @@ -236,6 +237,6 @@ void KToggleAction::updateChecked( int id ) QWidget *w = container( 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" ) ) static_cast<QMenuBar*>(w)->setItemChecked( itemId( id ), d->m_checked ); @@ -284,5 +285,5 @@ 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, QObject* parent, const char* name ) @@ -298,5 +299,5 @@ 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, const QObject* receiver, const char* slot, @@ -350,5 +351,5 @@ public: bool m_edit; bool m_menuAccelsEnabled; - QPopupMenu *m_menu; + Q3PopupMenu *m_menu; int m_current; int m_comboWidth; @@ -388,5 +389,5 @@ 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, QObject* parent, const char* name ) @@ -404,5 +405,5 @@ 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, const QObject* receiver, @@ -440,5 +441,5 @@ 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; } @@ -480,5 +481,5 @@ void KSelectAction::setComboWidth( int width ) } -QPopupMenu* KSelectAction::popupMenu() const +Q3PopupMenu* KSelectAction::popupMenu() const { kdDebug(129) << "KSelectAction::popupMenu()" << endl; // remove -- ellis @@ -486,5 +487,5 @@ 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(); if ( d->m_current >= 0 ) @@ -644,10 +645,10 @@ int KSelectAction::plug( QWidget *widget, int index ) kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis - if ( widget->inherits("QPopupMenu") ) + if ( widget->inherits("Q3PopupMenu") ) { // Create the PopupMenu and store it in m_menu (void)popupMenu(); - QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); + Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); int id; @@ -683,5 +684,5 @@ 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() ); if ( d->m_comboWidth > 0 ) @@ -853,5 +854,5 @@ 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, QObject* parent, const char* name ) @@ -869,5 +870,5 @@ 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, const char* slot, QObject* parent, @@ -966,5 +967,5 @@ KRecentFilesAction::KRecentFilesAction( const QString& text, KRecentFilesAction::KRecentFilesAction( const QString& text, - const QIconSet& pix, + const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name, @@ -992,5 +993,5 @@ KRecentFilesAction::KRecentFilesAction( const QString& text, KRecentFilesAction::KRecentFilesAction( const QString& text, - const QIconSet& pix, + const QIcon& pix, const KShortcut& cut, const QObject* receiver, @@ -1202,5 +1203,5 @@ 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, QObject* parent, const char* name ) @@ -1224,5 +1225,5 @@ 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, const QObject* receiver, const char* slot, @@ -1362,5 +1363,5 @@ KFontSizeAction::KFontSizeAction( const QString& text, } -KFontSizeAction::KFontSizeAction( const QString& text, const QIconSet& pix, +KFontSizeAction::KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut, QObject* parent, const char* name ) @@ -1378,5 +1379,5 @@ 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, const QObject* receiver, @@ -1415,7 +1416,7 @@ 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 ) ); @@ -1438,5 +1439,5 @@ void KFontSizeAction::setFontSize( int size ) if ( index == -1 ) { // Insert at the correct position in the list (to keep sorting) - QValueList<int> lst; + Q3ValueList<int> lst; // Convert to list of ints QStringList itemsList = items(); @@ -1451,5 +1452,5 @@ qDebug("KFontSizeAction::setFontSize heapsort not found."); // Convert back to string list 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) ); KSelectAction::setItems( strLst ); @@ -1493,5 +1494,5 @@ 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; m_stickyMenu = true; @@ -1503,5 +1504,5 @@ public: //US KPopupMenu *m_popup; - QPopupMenu *m_popup; + Q3PopupMenu *m_popup; bool m_delayed; bool m_stickyMenu; @@ -1523,5 +1524,5 @@ 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 ) : KAction( text, icon, 0, parent, name ) @@ -1553,5 +1554,5 @@ void KActionMenu::popup( const QPoint& global ) //US KPopupMenu* KActionMenu::popupMenu() const -QPopupMenu* KActionMenu::popupMenu() const +Q3PopupMenu* KActionMenu::popupMenu() const { return d->m_popup; @@ -1593,7 +1594,7 @@ 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; if ( hasIconSet() ) @@ -1782,10 +1783,10 @@ int KToolBarPopupAction::plug( QWidget *widget, int index ) //US KPopupMenu *KToolBarPopupAction::popupMenu() const -QPopupMenu *KToolBarPopupAction::popupMenu() const +Q3PopupMenu *KToolBarPopupAction::popupMenu() const { if ( !m_popup ) { KToolBarPopupAction *that = const_cast<KToolBarPopupAction*>(this); //US that->m_popup = new KPopupMenu; - that->m_popup = new QPopupMenu; + that->m_popup = new Q3PopupMenu; } return m_popup; @@ -1954,5 +1955,5 @@ void KWidgetAction::slotToolbarDestroyed() //Q_ASSERT( m_widget ); // When exiting the app the widget could be destroyed before the toolbar. - ASSERT( isPlugged() ); + Q_ASSERT( isPlugged() ); if( !m_widget || !isPlugged() ) return; @@ -1975,7 +1976,7 @@ KActionSeparator::~KActionSeparator() 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 ); int id = menu->insertSeparator( index ); 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 @@ -35,9 +35,12 @@ //US#include <kguiitem.h> #include <kshortcut.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3PopupMenu> //US#include <kstdaction.h> //US#include <kicontheme.h> class QMenuBar; -class QPopupMenu; +class Q3PopupMenu; //USclass QComboBox; //USclass QPoint; @@ -55,5 +58,5 @@ class KURL; //US class KToolBar needs to be replaced -class KToolBar; +#include "ktoolbar.h" class KActionCollection; @@ -106,5 +109,5 @@ public: * @param name An internal name for this action. */ - 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 ); @@ -128,5 +131,5 @@ public: * @param name An internal name for this action. */ - 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 ); @@ -247,5 +250,5 @@ public: * @param name An internal name for this action. */ - 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 ); @@ -269,5 +272,5 @@ public: * @param name An internal name for this action. */ - 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 ); @@ -353,5 +356,5 @@ public: * @param name An internal name for this action. */ - 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 ); @@ -375,5 +378,5 @@ public: * @param name An internal name for this action. */ - 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 ); @@ -439,5 +442,5 @@ public: virtual int comboWidth() const; - QPopupMenu* popupMenu() const; + Q3PopupMenu* popupMenu() const; /** @@ -568,5 +571,5 @@ public: * @param name An internal name for this action. */ - 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 ); @@ -590,5 +593,5 @@ public: * @param name An internal name for this action. */ - 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, const char* name = 0 ); @@ -686,5 +689,5 @@ public: * @param maxItems The maximum number of files to display */ - 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, uint maxItems = 10 ); @@ -713,5 +716,5 @@ public: * @param maxItems The maximum number of files to display */ - 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, QObject* parent, const char* name = 0, @@ -835,9 +838,9 @@ public: const QObject* receiver, const char* slot, QObject* parent, 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 ); KFontAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), 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, const char* name = 0 ); @@ -874,9 +877,9 @@ public: KFontSizeAction( const QString& text, const KShortcut& cut, const QObject* receiver, 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 ); KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), 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, QObject* parent, const char* name = 0 ); @@ -932,5 +935,5 @@ public: KActionMenu( const QString& text, QObject* parent = 0, 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 ); KActionMenu( const QString& text, const QString& icon, @@ -943,5 +946,5 @@ public: //US KPopupMenu* popupMenu() const; - QPopupMenu* popupMenu() const; + Q3PopupMenu* popupMenu() const; void popup( const QPoint& global ); @@ -1068,5 +1071,5 @@ public: */ //US KPopupMenu *popupMenu() const; - QPopupMenu *popupMenu() const; + Q3PopupMenu *popupMenu() const; /** @@ -1099,5 +1102,5 @@ public: private: //US KPopupMenu *m_popup; - QPopupMenu *m_popup; + Q3PopupMenu *m_popup; bool m_delayed:1; bool m_stickyMenu:1; @@ -1148,6 +1151,6 @@ public slots: private: - QCString m_toolBarName; - QGuardedPtr<KToolBar> m_toolBar; + Q3CString m_toolBarName; + QPointer<KToolBar> m_toolBar; protected: virtual void virtual_hook( int id, void* data ); @@ -1196,5 +1199,5 @@ protected slots: void slotToolbarDestroyed(); private: - QGuardedPtr<QWidget> m_widget; + QPointer<QWidget> m_widget; bool m_autoSized; protected: 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 @@ -27,5 +27,7 @@ //US#include "kactionshortcutlist.h" -#include <qptrdict.h> +#include <q3ptrdict.h> +//Added by qt3to4: +#include <Q3ValueList> //US#include <qvariant.h> @@ -37,6 +39,6 @@ //US I included the following files -#include <qasciidict.h> -#include <qptrlist.h> +#include <q3asciidict.h> +#include <q3ptrlist.h> #include "kaction.h" #include <kglobal.h> @@ -68,11 +70,11 @@ public: //QValueList<QWidget*> m_widgetList; //QValueList<KAccel*> m_kaccelList; - QValueList<KActionCollection*> m_docList; + Q3ValueList<KActionCollection*> m_docList; QWidget *m_widget; KAccel *m_kaccel; KAccel *m_builderKAccel; - QAsciiDict<KAction> m_actionDict; - QPtrDict< QPtrList<KAction> > m_dctHighlightContainers; + Q3AsciiDict<KAction> m_actionDict; + Q3PtrDict< Q3PtrList<KAction> > m_dctHighlightContainers; bool m_highlight; KAction *m_currentHighlightAction; @@ -134,5 +136,5 @@ 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(); if ( pAction->m_parentCollection == this ) @@ -366,5 +368,5 @@ KAction* KActionCollection::_take( KAction* action ) void KActionCollection::_clear() { - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); while ( it.current() ) _remove( it.current() ); @@ -387,5 +389,5 @@ 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 ) { @@ -408,5 +410,5 @@ KAction* KActionCollection::action( const char* name, const char* classname ) co KAction* KActionCollection::action( int index ) const { - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); it += index; return it.current(); @@ -433,5 +435,5 @@ QStringList KActionCollection::groups() const QStringList lst; - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) if ( !it.current()->group().isEmpty() && !lst.contains( it.current()->group() ) ) @@ -445,5 +447,5 @@ KActionPtrList KActionCollection::actions( const QString& group ) const KActionPtrList lst; - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) if ( it.current()->group() == group ) @@ -459,5 +461,5 @@ KActionPtrList KActionCollection::actions() const KActionPtrList lst; - QAsciiDictIterator<KAction> it( d->m_actionDict ); + Q3AsciiDictIterator<KAction> it( d->m_actionDict ); for( ; it.current(); ++it ) lst.append( it.current() ); @@ -509,11 +511,11 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action ) return; - QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; + Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; if ( !actionList ) { - actionList = new QPtrList<KAction>; + actionList = new Q3PtrList<KAction>; - if ( container->inherits( "QPopupMenu" ) ) + if ( container->inherits( "Q3PopupMenu" ) ) { connect( container, SIGNAL( highlighted( int ) ), @@ -523,5 +525,5 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action ) } //US else if ( container->inherits( "KToolBar" ) ) - else if ( container->inherits( "QToolBar" ) ) + else if ( container->inherits( "Q3ToolBar" ) ) { connect( container, SIGNAL( highlighted( int, bool ) ), @@ -543,5 +545,5 @@ void KActionCollection::disconnectHighlight( QWidget *container, KAction *action return; - QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; + Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; if ( !actionList ) @@ -626,10 +628,10 @@ void KActionCollection::slotDestroyed() 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 ) ]; if ( !actionList ) return 0; - QPtrListIterator<KAction> it( *actionList ); + Q3PtrListIterator<KAction> it( *actionList ); for (; it.current(); ++it ) if ( it.current()->isPlugged( container, id ) ) @@ -645,7 +647,7 @@ KActionCollection KActionCollection::operator+(const KActionCollection &c ) cons KActionCollection ret( *this ); - 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 ) ret.insert( *it ); @@ -671,5 +673,5 @@ 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 ) insert( it.current() ); 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 @@ -31,4 +31,6 @@ //US #include <qkeysequence.h> #include <qobject.h> +//Added by qt3to4: +#include <Q3ValueList> //US#include <qvaluelist.h> //US#include <qguardedptr.h> @@ -61,5 +63,5 @@ 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 @@ -50,5 +50,7 @@ #include <kbuttonbox.h> #include <qpushbutton.h> -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <QResizeEvent> #include <assert.h> @@ -63,5 +65,5 @@ public: }; -template class QPtrList<KButtonBox::Item>; +template class Q3PtrList<KButtonBox::Item>; class KButtonBoxPrivate { @@ -71,8 +73,8 @@ public: unsigned short orientation; 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) : QWidget(parent) @@ -150,5 +152,5 @@ void KButtonBox::placeButtons() { unsigned int i; - if(data->orientation == Horizontal) { + if(data->orientation == Qt::Horizontal) { // calculate free size and stretches int fs = width() - 2 * data->border; @@ -252,5 +254,5 @@ QSize KButtonBox::sizeHint() const { s = bs; - if(data->orientation == Horizontal) + if(data->orientation == Qt::Horizontal) dw += s.width(); else @@ -262,5 +264,5 @@ QSize KButtonBox::sizeHint() const { } - if(data->orientation == Horizontal) + if(data->orientation == Qt::Horizontal) return QSize(dw, bs.height() + 2 * data->border); else @@ -271,5 +273,5 @@ QSize KButtonBox::sizeHint() const { QSizePolicy KButtonBox::sizePolicy() const { - return data->orientation == Horizontal? + return data->orientation == Qt::Horizontal? QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) : QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); 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 @@ -22,4 +22,6 @@ #include <qwidget.h> +//Added by qt3to4: +#include <QResizeEvent> class QPushButton; @@ -49,5 +51,5 @@ public: * are laid out from left to right. */ - 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 @@ -21,5 +21,5 @@ #include <qregexp.h> #include <qstring.h> -#include <qiconset.h> +#include <qicon.h> #include <qpixmap.h> @@ -63,5 +63,5 @@ public: QString m_statusText; QString m_iconName; - QIconSet m_iconSet; + QIcon m_iconSet; bool m_hasIcon : 1; bool m_enabled : 1; @@ -83,5 +83,5 @@ 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 ) { @@ -125,5 +125,5 @@ 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 { if( d->m_hasIcon ) @@ -149,5 +149,5 @@ QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instan } else - return QIconSet(); + return QIcon(); } @@ -178,5 +178,5 @@ void KGuiItem::setText( const QString &text ) { } -void KGuiItem::setIconSet( const QIconSet &iconset ) +void KGuiItem::setIconSet( const QIcon &iconset ) { d->m_iconSet = iconset; @@ -188,5 +188,5 @@ 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 @@ -24,7 +24,7 @@ #include <qstring.h> -#include <qiconset.h> +#include <qicon.h> #include <qpixmap.h> -#include <qvaluelist.h> +#include <q3valuelist.h> //US#include <kicontheme.h> #include <kglobal.h> @@ -43,5 +43,5 @@ public: const QString &whatsThis = QString::null ); - KGuiItem( const QString &text, const QIconSet &iconSet, + KGuiItem( const QString &text, const QIcon &iconSet, const QString &toolTip = QString::null, const QString &whatsThis = QString::null ); @@ -54,8 +54,8 @@ public: QString text() const; 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 @@ -70,5 +70,5 @@ public: void setText( const QString &text ); - void setIconSet( const QIconSet &iconset ); + void setIconSet( const QIcon &iconset ); void setIconName( const QString &iconName ); void setToolTip( const QString &tooltip ); 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 @@ -23,13 +23,21 @@ #include <qlayout.h> #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 #include <qbitmap.h> @@ -66,11 +74,11 @@ #include "kjanuswidget.h" -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 ); @@ -99,5 +107,5 @@ public: }; -template class QPtrList<QListViewItem>; +template class Q3PtrList<Q3ListViewItem>; @@ -108,10 +116,10 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) mShowIconsInTreeList(false), d(0) { - QVBoxLayout *topLayout = new QVBoxLayout( this ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this ); if( mFace == TreeList || mFace == IconList ) { d = new KJanusWidgetPrivate; - QFrame *page = 0; + Q3Frame *page = 0; if( mFace == TreeList ) { @@ -146,5 +154,5 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) else { - QHBoxLayout *hbox = new QHBoxLayout( topLayout ); + Q3HBoxLayout *hbox = new Q3HBoxLayout( topLayout ); mIconList = new IconListBox( this ); @@ -157,5 +165,5 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) connect( mIconList, SIGNAL(selectionChanged()), SLOT(slotShowPage())); hbox->addSpacing( KDialog::marginHint() ); - page = new QFrame( this ); + page = new Q3Frame( this ); hbox->addWidget( page, 10 ); } @@ -166,5 +174,5 @@ 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() ); mTitleLabel = new QLabel( QString::fromLatin1("Empty page"), page, "KJanusWidgetTitleLabel" ); @@ -176,8 +184,8 @@ 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 *)), SIGNAL(aboutToShowPage(QWidget *))); @@ -200,5 +208,5 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) { mFace = Plain; - mPlainPage = new QFrame( this ); + mPlainPage = new Q3Frame( this ); topLayout->addWidget( mPlainPage, 10 ); } @@ -246,5 +254,5 @@ bool KJanusWidget::isValid() const -QFrame *KJanusWidget::plainPage() +Q3Frame *KJanusWidget::plainPage() { return( mPlainPage ); @@ -267,5 +275,5 @@ QWidget *KJanusWidget::FindParent() } -QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header, +Q3Frame *KJanusWidget::addPage( const QStringList &items, const QString &header, const QPixmap &pixmap ) { @@ -276,5 +284,5 @@ 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 ); @@ -288,5 +296,5 @@ void KJanusWidget::pageGone( QObject *obj ) } -void KJanusWidget::slotReopen( QListViewItem * item ) +void KJanusWidget::slotReopen( Q3ListViewItem * item ) { if( item ) @@ -294,5 +302,5 @@ 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 ) { @@ -305,5 +313,5 @@ QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header, -QVBox *KJanusWidget::addVBoxPage( const QStringList &items, +Q3VBox *KJanusWidget::addVBoxPage( const QStringList &items, const QString &header, const QPixmap &pixmap ) @@ -316,5 +324,5 @@ QVBox *KJanusWidget::addVBoxPage( const QStringList &items, } - QVBox *page = new QVBox(FindParent() , "vbox_page" ); + Q3VBox *page = new Q3VBox(FindParent() , "vbox_page" ); page->setSpacing( KDialog::spacingHintSmall() ); addPageWidget( page, items, header, pixmap ); @@ -323,5 +331,5 @@ QVBox *KJanusWidget::addVBoxPage( const QStringList &items, } -QVBox *KJanusWidget::addVBoxPage( const QString &itemName, +Q3VBox *KJanusWidget::addVBoxPage( const QString &itemName, const QString &header, const QPixmap &pixmap ) @@ -332,5 +340,5 @@ QVBox *KJanusWidget::addVBoxPage( const QString &itemName, } -QHBox *KJanusWidget::addHBoxPage( const QStringList &items, +Q3HBox *KJanusWidget::addHBoxPage( const QStringList &items, const QString &header, const QPixmap &pixmap ) @@ -341,5 +349,5 @@ QHBox *KJanusWidget::addHBoxPage( const QStringList &items, } - QHBox *page = new QHBox(FindParent(), "hbox_page"); + Q3HBox *page = new Q3HBox(FindParent(), "hbox_page"); page->setSpacing( KDialog::spacingHint() ); addPageWidget( page, items, header, pixmap ); @@ -348,5 +356,5 @@ QHBox *KJanusWidget::addHBoxPage( const QStringList &items, } -QHBox *KJanusWidget::addHBoxPage( const QString &itemName, +Q3HBox *KJanusWidget::addHBoxPage( const QString &itemName, const QString &header, const QPixmap &pixmap ) @@ -357,5 +365,5 @@ 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, const QString &header, @@ -368,5 +376,5 @@ 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() ); addPageWidget( page, items, header, pixmap ); @@ -376,5 +384,5 @@ 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, const QString &header, @@ -386,8 +394,8 @@ 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; QStringList curPath; @@ -413,7 +421,7 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p // new child. if (isTop) - newChild = new QListViewItem(mTreeList, name); + newChild = new Q3ListViewItem(mTreeList, name); else - newChild = new QListViewItem(curTop, name); + newChild = new Q3ListViewItem(curTop, name); } @@ -432,7 +440,7 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p // the node had some children, but we didn't find the given name 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); } @@ -460,5 +468,5 @@ 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 ) { @@ -551,13 +559,13 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget ) delete mSwallowPage->layout(); } - QGridLayout *gbox = new QGridLayout( mSwallowPage, 1, 1, 0 ); + Q3GridLayout *gbox = new Q3GridLayout( mSwallowPage, 1, 1, 0 ); // // Hide old children // - 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() ) { @@ -598,5 +606,5 @@ bool KJanusWidget::slotShowPage() if( mFace == TreeList ) { - QListViewItem *node = mTreeList->selectedItem(); + Q3ListViewItem *node = mTreeList->selectedItem(); if( node == 0 ) { return( false ); } @@ -607,5 +615,5 @@ bool KJanusWidget::slotShowPage() else if( mFace == IconList ) { - QListBoxItem *node = mIconList->item( mIconList->currentItem() ); + Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() ); if( node == 0 ) { return( false ); } QWidget *stackItem = mIconListToPageStack[node]; @@ -647,7 +655,7 @@ bool KJanusWidget::showPage( QWidget *w ) if( mFace == TreeList ) { - 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(); if (val == w) { @@ -659,7 +667,7 @@ bool KJanusWidget::showPage( QWidget *w ) else { - 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(); if (val == w) { @@ -687,5 +695,5 @@ int KJanusWidget::activePageIndex() const { if( mFace == TreeList) { - QListViewItem *node = mTreeList->selectedItem(); + Q3ListViewItem *node = mTreeList->selectedItem(); if( node == 0 ) { return -1; } QWidget *stackItem = mTreeListToPageStack[node]; @@ -693,5 +701,5 @@ 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 ); } QWidget *stackItem = mIconListToPageStack[node]; @@ -762,5 +770,5 @@ void KJanusWidget::slotFontChanged() // makes the treelist behave like the list of kcontrol -void KJanusWidget::slotItemClicked(QListViewItem *it) +void KJanusWidget::slotItemClicked(Q3ListViewItem *it) { if(it && (it->childCount()>0)) @@ -896,9 +904,9 @@ 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 ); } @@ -954,5 +962,5 @@ 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), mWidthValid(false) @@ -966,5 +974,5 @@ 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() ) { h += i->height( this ); @@ -981,5 +989,5 @@ 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() ) { int w = ((IconListItem *)i)->width(this); @@ -987,5 +995,5 @@ void KJanusWidget::IconListBox::updateWidth() } - for( QListBoxItem *i = item(0); i != 0; i = i->next() ) + for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) { ((IconListItem *)i)->expandMinimumWidth( maxWidth ); @@ -1023,7 +1031,7 @@ 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 ) { mPixmap = pixmap; @@ -1084,5 +1092,5 @@ void KJanusWidget::IconListItem::paint( QPainter *painter ) } -int KJanusWidget::IconListItem::height( const QListBox *lb ) const +int KJanusWidget::IconListItem::height( const Q3ListBox *lb ) const { if( text().isEmpty() == true ) @@ -1097,5 +1105,5 @@ int KJanusWidget::IconListItem::height( const QListBox *lb ) const -int KJanusWidget::IconListItem::width( const QListBox *lb ) const +int KJanusWidget::IconListItem::width( const Q3ListBox *lb ) const { int wt = lb->fontMetrics().boundingRect(text()).width()+10; @@ -1123,5 +1131,5 @@ void KJanusWidget::removePage( QWidget *page ) if ( mFace == TreeList ) { - QMap<QListViewItem*, QWidget *>::Iterator i; + QMap<Q3ListViewItem*, QWidget *>::Iterator i; for( i = mTreeListToPageStack.begin(); i != mTreeListToPageStack.end(); ++i ) if (i.data()==page) @@ -1138,5 +1146,5 @@ void KJanusWidget::removePage( QWidget *page ) else if ( mFace == IconList ) { - QMap<QListBoxItem*, QWidget *>::Iterator i; + QMap<Q3ListBoxItem*, QWidget *>::Iterator i; for( i = mIconListToPageStack.begin(); i != mIconListToPageStack.end(); ++i ) if (i.data()==page) 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 @@ -21,8 +21,14 @@ #define _KJANUS_WIDGET_H_ -#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> @@ -39,10 +45,10 @@ class KSeparator; class KListView; -class QWidgetStack; +class Q3WidgetStack; class QLabel; class QTabWidget; -class QListViewItem; -class QVBox; -class QHBox; +class Q3ListViewItem; +class Q3VBox; +class Q3HBox; /** @@ -103,5 +109,5 @@ 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(); void updateWidth(); @@ -194,5 +200,5 @@ class KJanusWidget : public QWidget * @return The widget or 0 if the face in not Plain. */ - virtual QFrame *plainPage(); + virtual Q3Frame *plainPage(); /** @@ -215,5 +221,5 @@ class KJanusWidget : public QWidget * Tabbed. */ - 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() ); @@ -232,5 +238,5 @@ class KJanusWidget : public QWidget * removed (you can re-add a page with the same name later. **/ - 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() ); @@ -254,5 +260,5 @@ class KJanusWidget : public QWidget * @return The empty page or 0 if the face is not TreeList, IconList or * Tabbed. */ - virtual QVBox *addVBoxPage( const QString &item, + virtual Q3VBox *addVBoxPage( const QString &item, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -270,5 +276,5 @@ class KJanusWidget : public QWidget * removed (you can re-add a page with the same name later. **/ - virtual QVBox *addVBoxPage( const QStringList &items, + virtual Q3VBox *addVBoxPage( const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -294,5 +300,5 @@ class KJanusWidget : public QWidget * Tabbed. */ - virtual QHBox *addHBoxPage( const QString &itemName, + virtual Q3HBox *addHBoxPage( const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -310,5 +316,5 @@ class KJanusWidget : public QWidget * removed (you can re-add a page with the same name later. **/ - virtual QHBox *addHBoxPage( const QStringList &items, + virtual Q3HBox *addHBoxPage( const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); @@ -338,5 +344,5 @@ 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, const QString &header=QString::null, @@ -356,5 +362,5 @@ 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, const QString &header=QString::null, @@ -518,13 +524,13 @@ class KJanusWidget : public QWidget bool slotShowPage(); //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); protected: 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(); @@ -533,5 +539,5 @@ class KJanusWidget : public QWidget // Obsolete members. Remove in KDE 4. - QPtrList<QWidget> *mPageList; + Q3PtrList<QWidget> *mPageList; QStringList *mTitleList; @@ -539,8 +545,8 @@ class KJanusWidget : public QWidget KListView *mTreeList; IconListBox *mIconList; - QWidgetStack *mPageStack; + Q3WidgetStack *mPageStack; QLabel *mTitleLabel; QTabWidget *mTabControl; - QFrame *mPlainPage; + Q3Frame *mPlainPage; QWidget *mSwallowPage; QWidget *mActivePageWidget; @@ -548,6 +554,6 @@ class KJanusWidget : public QWidget //US QSplitter::ResizeMode mTreeListResizeMode; bool mShowIconsInTreeList; - QMap<QListViewItem *, QWidget *> mTreeListToPageStack; - QMap<QListBoxItem *, QWidget *> mIconListToPageStack; + QMap<Q3ListViewItem *, QWidget *> mTreeListToPageStack; + QMap<Q3ListBoxItem *, QWidget *> mIconListToPageStack; QMap<QString, QPixmap> mFolderIconMap; QMap<QString, QStringList> mChildrenNames; 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 @@ -17,4 +17,9 @@ */ #include <qtimer.h> +//Added by qt3to4: +#include <QEvent> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QFocusEvent> #include <kglobalsettings.h> @@ -27,4 +32,5 @@ #ifdef Q_WS_X11 +#include <QX11Info> #include <X11/Xlib.h> #endif @@ -32,15 +38,15 @@ #define Q_WS_QWS #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 ) { connect( this, SIGNAL( onViewport() ), 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 & ) ) ); /*US @@ -61,5 +67,5 @@ KListBox::KListBox( QWidget *parent, const char *name, WFlags f ) } -void KListBox::slotOnItem( QListBoxItem *item ) +void KListBox::slotOnItem( Q3ListBoxItem *item ) { /*US @@ -140,9 +146,9 @@ void KListBox::slotAutoSelect() int root_x, root_y, win_x, win_y; 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 ); #endif - QListBoxItem* previousItem = item( currentItem() ); + Q3ListBoxItem* previousItem = item( currentItem() ); setCurrentItem( m_pCurrentItem ); @@ -168,5 +174,5 @@ 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() ) { if ( down && it == m_pCurrentItem ) { @@ -187,5 +193,5 @@ void KListBox::slotAutoSelect() emit selectionChanged(); - if( selectionMode() == QListBox::Single ) + if( selectionMode() == Q3ListBox::Single ) emit selectionChanged( m_pCurrentItem ); } @@ -214,5 +220,5 @@ void KListBox::slotAutoSelect() } -void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) +void KListBox::emitExecute( Q3ListBoxItem *item, const QPoint &pos ) { #ifdef Q_WS_X11 //FIXME @@ -221,5 +227,5 @@ void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) int root_x, root_y, win_x, win_y; 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 ); #endif @@ -247,9 +253,9 @@ void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) void KListBox::keyPressEvent(QKeyEvent *e) { - if( e->key() == Key_Escape ) + if( e->key() == Qt::Key_Escape ) { e->ignore(); } - else if( e->key() == Key_F1 ) + else if( e->key() == Qt::Key_F1 ) { e->ignore(); @@ -257,5 +263,5 @@ void KListBox::keyPressEvent(QKeyEvent *e) else { - QListBox::keyPressEvent(e); + Q3ListBox::keyPressEvent(e); } } @@ -265,5 +271,5 @@ void KListBox::focusOutEvent( QFocusEvent *fe ) m_pAutoSelect->stop(); - QListBox::focusOutEvent( fe ); + Q3ListBox::focusOutEvent( fe ); } @@ -272,10 +278,10 @@ void KListBox::leaveEvent( QEvent *e ) m_pAutoSelect->stop(); - QListBox::leaveEvent( e ); + Q3ListBox::leaveEvent( e ); } 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(); blockSignals( true ); @@ -286,24 +292,24 @@ void KListBox::contentsMousePressEvent( QMouseEvent *e ) } - QListBox::contentsMousePressEvent( e ); + Q3ListBox::contentsMousePressEvent( e ); } void KListBox::contentsMouseDoubleClickEvent ( QMouseEvent * e ) { - QListBox::contentsMouseDoubleClickEvent( e ); + Q3ListBox::contentsMouseDoubleClickEvent( e ); - QListBoxItem* item = itemAt( e->pos() ); + Q3ListBoxItem* item = itemAt( e->pos() ); if( item ) { emit doubleClicked( item, e->globalPos() ); - if( (e->button() == LeftButton) && !m_bUseSingle ) + if( (e->button() == Qt::LeftButton) && !m_bUseSingle ) emitExecute( item, e->globalPos() ); } } -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 @@ -19,5 +19,10 @@ #define KLISTBOX_H -#include <qlistbox.h> +#include <q3listbox.h> +//Added by qt3to4: +#include <QMouseEvent> +#include <QFocusEvent> +#include <QKeyEvent> +#include <QEvent> /** @@ -36,10 +41,10 @@ * @short A variant of @ref QListBox that honors KDE's system-wide settings. **/ -class KListBox : public QListBox +class KListBox : public Q3ListBox { Q_OBJECT public: - KListBox( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); + KListBox( QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0 ); signals: @@ -55,5 +60,5 @@ signals: * connected to this signal. */ - void executed( QListBoxItem *item ); + void executed( Q3ListBoxItem *item ); /** @@ -68,5 +73,5 @@ signals: * connected to this signal. */ - void executed( QListBoxItem *item, const QPoint &pos ); + void executed( Q3ListBoxItem *item, const QPoint &pos ); /** @@ -84,8 +89,8 @@ signals: * to use @ref executed() instead. */ - 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(); @@ -98,5 +103,5 @@ protected slots: protected: - void emitExecute( QListBoxItem *item, const QPoint &pos ); + void emitExecute( Q3ListBoxItem *item, const QPoint &pos ); /** @@ -124,5 +129,5 @@ protected: //US bool m_bChangeCursorOverItem; - QListBoxItem* m_pCurrentItem; + Q3ListBoxItem* m_pCurrentItem; QTimer* m_pAutoSelect; @@ -130,5 +135,5 @@ protected: private slots: - void slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ); + void slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos ); protected: 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 @@ -19,11 +19,25 @@ */ -#include <qdragobject.h> +#include <q3dragobject.h> #include <qtimer.h> -#include <qheader.h> +#include <q3header.h> #include <qcursor.h> #include <qtooltip.h> #include <qstyle.h> #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> #include <kglobalsettings.h> @@ -39,5 +53,5 @@ #ifndef _WIN32_ #define private public -#include <qlistview.h> +#include <q3listview.h> #undef private #endif @@ -47,7 +61,8 @@ #include <qpe/qpeapplication.h> #endif +#include <Q3Action> // /*US -class KListView::Tooltip : public QToolTip +class KListView::Tooltip /* TODO:hacker:TODO: : public QToolTip */ { public: @@ -68,5 +83,5 @@ private: KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) - : QToolTip (parent, group), + : /* XXX:hacker:XXX: QToolTip (parent, group), */ mParent (parent) { @@ -124,5 +139,5 @@ public: } - QListViewItem* pCurrentItem; + Q3ListViewItem* pCurrentItem; QTimer autoSelect; @@ -130,5 +145,5 @@ public: QTimer dragExpand; - QListViewItem* dragOverItem; + Q3ListViewItem* dragOverItem; QPoint dragOverPoint; @@ -137,5 +152,5 @@ public: //US KListViewLineEdit *editor; - QValueList<int> renameable; + Q3ValueList<int> renameable; bool cursorInExecuteArea:1; @@ -171,6 +186,6 @@ public: int mDropVisualizerWidth; QRect mOldDropHighlighter; - QListViewItem *afterItemDrop; - QListViewItem *parentItemDrop; + Q3ListViewItem *afterItemDrop; + Q3ListViewItem *parentItemDrop; QColor alternateBackground; @@ -227,5 +242,5 @@ 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) { if (pi) @@ -240,7 +255,7 @@ 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(); /* Does what the QListViewItem::previousSibling() @@ -253,5 +268,5 @@ static QListViewItem *prevItem (QListViewItem *pi) } -static QListViewItem *lastQChild (QListViewItem *pi) +static Q3ListViewItem *lastQChild (Q3ListViewItem *pi) { if (pi) @@ -261,5 +276,5 @@ static QListViewItem *lastQChild (QListViewItem *pi) * item. */ - for (QListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling()) + for (Q3ListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling()) pi = pt; } @@ -329,8 +344,8 @@ bool KListViewLineEdit::event (QEvent *pe) if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab) && 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; } @@ -407,5 +422,5 @@ void KListViewLineEdit::slotSelectionChanged() KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse ) - : QListView( parent, name ), + : Q3ListView( parent, name ), d (new KListViewPrivate (this)) { @@ -418,6 +433,6 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse connect( this, SIGNAL( onViewport() ), this, SLOT( slotOnViewport() ) ); - connect( this, SIGNAL( onItem( QListViewItem * ) ), - this, SLOT( slotOnItem( QListViewItem * ) ) ); + connect( this, SIGNAL( onItem( Q3ListViewItem * ) ), + this, SLOT( slotOnItem( Q3ListViewItem * ) ) ); connect (this, SIGNAL(contentsMoving(int,int)), @@ -446,15 +461,15 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse if (d->showContextMenusOnPress) { - 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))); } else { - 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*))); @@ -481,5 +496,5 @@ QSize KListView::sizeHint() const //qDebug("KListView::QSize sizeHint() "); #ifdef DESKTOP_VERSION - return QListView::sizeHint(); + return Q3ListView::sizeHint(); #else return QSize ( 40, 40 ); @@ -504,5 +519,5 @@ bool KListView::isExecuteArea( int x ) } -void KListView::slotOnItem( QListViewItem *item ) +void KListView::slotOnItem( Q3ListViewItem *item ) { QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); @@ -535,10 +550,10 @@ void KListView::slotSettingsChanged(int category) // qDebug("KListView::slotSettingsChanged: single%i", d->bUseSingle); - 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))); //US d->bChangeCursorOverItem = KGlobalSettings::changeCursorOverIcon(); @@ -612,5 +627,5 @@ void KListView::slotAutoSelect() setFocus(); - QListViewItem* previousItem = currentItem(); + Q3ListViewItem* previousItem = currentItem(); setCurrentItem( d->pCurrentItem ); @@ -633,5 +648,5 @@ 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 ) { if ( down && lit.current() == d->pCurrentItem ) { @@ -652,5 +667,5 @@ void KListView::slotAutoSelect() emit selectionChanged(); - if( selectionMode() == QListView::Single ) + if( selectionMode() == Q3ListView::Single ) emit selectionChanged( d->pCurrentItem ); } @@ -685,5 +700,5 @@ 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) { // qDebug("KListView::emitExecute buttonstate=%i", buttonstate); @@ -702,5 +717,5 @@ 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)) ) ) { @@ -715,5 +730,5 @@ void KListView::focusInEvent( QFocusEvent *fe ) { // kdDebug()<<"KListView::focusInEvent()"<<endl; - QListView::focusInEvent( fe ); + Q3ListView::focusInEvent( fe ); if ((d->selectedBySimpleMove) && (d->selectionMode == FileManager) @@ -748,5 +763,5 @@ void KListView::focusOutEvent( QFocusEvent *fe ) }; - QListView::focusOutEvent( fe ); + Q3ListView::focusOutEvent( fe ); } @@ -755,5 +770,5 @@ void KListView::leaveEvent( QEvent *e ) d->autoSelect.stop(); - QListView::leaveEvent( e ); + Q3ListView::leaveEvent( e ); } @@ -766,5 +781,5 @@ bool KListView::event( QEvent *e ) } - return QListView::event(e); + return Q3ListView::event(e); } @@ -772,5 +787,5 @@ 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) ) { bool block = signalsBlocked(); @@ -794,5 +809,5 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) QPoint p( contentsToViewport( e->pos() ) ); - QListViewItem *at = itemAt (p); + Q3ListViewItem *at = itemAt (p); // true if the root decoration of the item "at" was clicked (i.e. the +/- sign) @@ -802,5 +817,5 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) && ( p.x() >= header()->cellPos( header()->mapToActual( 0 ) ) ); - if (e->button() == LeftButton && !rootDecoClicked) + if (e->button() == Qt::LeftButton && !rootDecoClicked) { //Start a drag @@ -814,5 +829,5 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) } - QListView::contentsMousePressEvent( e ); + Q3ListView::contentsMousePressEvent( e ); } @@ -820,10 +835,10 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) { if (!dragEnabled() || d->startDragPos.isNull() || !d->validDrag) { - QListView::contentsMouseMoveEvent (e); + Q3ListView::contentsMouseMoveEvent (e); return; } QPoint vp = contentsToViewport(e->pos()); - QListViewItem *item = itemAt( vp ); + Q3ListViewItem *item = itemAt( vp ); //do we process cursor changes at all? @@ -854,5 +869,5 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) //(d->startDragPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { - QListView::contentsMouseReleaseEvent( 0 ); + Q3ListView::contentsMouseReleaseEvent( 0 ); startDrag(); d->startDragPos = QPoint(); @@ -863,5 +878,5 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) { - if (e->button() == LeftButton) + if (e->button() == Qt::LeftButton) { // If the row was already selected, maybe we want to start an in-place editing @@ -869,5 +884,5 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) { QPoint p( contentsToViewport( e->pos() ) ); - QListViewItem *at = itemAt (p); + Q3ListViewItem *at = itemAt (p); if ( at ) { @@ -891,5 +906,5 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) d->startDragPos = QPoint(); } - QListView::contentsMouseReleaseEvent( e ); + Q3ListView::contentsMouseReleaseEvent( e ); } @@ -902,6 +917,6 @@ 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 int col = item ? header()->mapToLogical( header()->cellAt( vp.x() ) ) : -1; @@ -912,5 +927,5 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) emit doubleClicked( item, e->globalPos(), col ); - if( (e->button() == LeftButton) && !d->bUseSingle ) { + if( (e->button() == Qt::LeftButton) && !d->bUseSingle ) { //qDebug("KListView::contentsMouseDoubleClickEvent: emitExecute"); @@ -920,9 +935,9 @@ 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 ) { //qDebug("KListView::slotMouseButtonClicked"); - if( (btn == LeftButton) && item ) { + if( (btn == Qt::LeftButton) && item ) { //qDebug("KListView::slotMouseButtonClicked: emitExecute"); @@ -962,10 +977,10 @@ 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) { iNext=i->itemBelow(); @@ -980,5 +995,5 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) i->setSelected(false); - QListViewItem *afterFirst = i->itemAbove(); + Q3ListViewItem *afterFirst = i->itemAbove(); if (!hasMoved) @@ -1001,5 +1016,5 @@ 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); if (current) @@ -1087,12 +1102,12 @@ 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) { QPoint p (contentsToViewport(pos)); // 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 above = lastItem(); @@ -1124,6 +1139,6 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte // Ok, there's one more level of complexity. We may want to become a new // 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 ) { @@ -1147,7 +1162,7 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte } -QListViewItem* KListView::lastChild () const +Q3ListViewItem* KListView::lastChild () const { - QListViewItem* lastchild = firstChild(); + Q3ListViewItem* lastchild = firstChild(); if (lastchild) @@ -1157,9 +1172,9 @@ 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(); @@ -1188,10 +1203,10 @@ qDebug("KListView::startDrag drag&drop not supported yet."); } -QDragObject *KListView::dragObject() +Q3DragObject *KListView::dragObject() { if (!currentItem()) return 0; - return new QStoredDrag("application/x-qlistviewitem", viewport()); + return new Q3StoredDrag("application/x-qlistviewitem", viewport()); } @@ -1247,8 +1262,8 @@ 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); return list; @@ -1256,8 +1271,8 @@ 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) { @@ -1297,6 +1312,6 @@ void KListView::setDropVisualizerWidth (int w) } -QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, - QListViewItem *after) +QRect KListView::drawDropVisualizer(QPainter *p, Q3ListViewItem *parent, + Q3ListViewItem *after) { QRect insertmarker; @@ -1309,5 +1324,5 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, if (after) { - QListViewItem* it = 0L; + Q3ListViewItem* it = 0L; if (after->isOpen()) { @@ -1339,10 +1354,10 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, // Remove for KDE 3.0. if (p) - p->fillRect(insertmarker, Dense4Pattern); + p->fillRect(insertmarker, Qt::Dense4Pattern); return insertmarker; } -QRect KListView::drawItemHighlighter(QPainter *painter, QListViewItem *item) +QRect KListView::drawItemHighlighter(QPainter *painter, Q3ListViewItem *item) { QRect r; @@ -1377,5 +1392,5 @@ void KListView::cleanItemHighlighter () } -void KListView::rename(QListViewItem *item, int c) +void KListView::rename(Q3ListViewItem *item, int c) { if (d->renameable.contains(c)) @@ -1404,5 +1419,5 @@ void KListView::setRenameable (int col, bool yesno) } -void KListView::doneEditing(QListViewItem *item, int row) +void KListView::doneEditing(Q3ListViewItem *item, int row) { emit itemRenamed(item, item->text(row), row); @@ -1448,10 +1463,10 @@ bool KListView::dropHighlighter() const } -bool KListView::showTooltip(QListViewItem *item, const QPoint &, int column) const +bool KListView::showTooltip(Q3ListViewItem *item, const QPoint &, int column) const { return ((tooltip(item, column).length()>0) && (column==tooltipColumn())); } -QString KListView::tooltip(QListViewItem *item, int column) const +QString KListView::tooltip(Q3ListViewItem *item, int column) const { return item->text(column); @@ -1483,5 +1498,5 @@ void KListView::keyPressEvent (QKeyEvent* e) if (d->selectionMode != FileManager) - QListView::keyPressEvent (e); + Q3ListView::keyPressEvent (e); else fileManagerKeyPressEvent (e); @@ -1514,43 +1529,43 @@ 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); int oldSelectionDirection(d->selectionDirection); - 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++; 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))) { d->selectedBySimpleMove=true; @@ -1564,10 +1579,10 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) switch (e->key()) { - case Key_Escape: + case Qt::Key_Escape: selectAll(FALSE); emitSelectionChanged=TRUE; break; - case Key_Space: + case Qt::Key_Space: //toggle selection of current item if (d->selectedBySimpleMove) @@ -1577,5 +1592,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) break; - case Key_Insert: + case Qt::Key_Insert: //toggle selection of current item and move to the next item if (d->selectedBySimpleMove) @@ -1601,5 +1616,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) break; - case Key_Down: + case Qt::Key_Down: nextItem=item->itemBelow(); //toggle selection of current item and move to the next item @@ -1634,5 +1649,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) break; - case Key_Up: + case Qt::Key_Up: nextItem=item->itemAbove(); d->selectionDirection=-1; @@ -1669,5 +1684,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) break; - case Key_End: + case Qt::Key_End: //move to the last item and toggle selection of all items inbetween nextItem=item; @@ -1694,5 +1709,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) break; - case Key_Home: + case Qt::Key_Home: // move to the first item and toggle selection of all items inbetween nextItem = firstChild(); @@ -1716,5 +1731,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) break; - case Key_Next: + case Qt::Key_Next: items=visibleHeight()/item->height(); nextItem=item; @@ -1752,5 +1767,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) break; - case Key_Prior: + case Qt::Key_Prior: items=visibleHeight()/item->height(); nextItem=item; @@ -1786,15 +1801,15 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) break; - case Key_Minus: + case Qt::Key_Minus: if ( item->isOpen() ) setOpen( item, FALSE ); break; - case Key_Plus: + case Qt::Key_Plus: if ( !item->isOpen() && (item->isExpandable() || item->childCount()) ) setOpen( item, TRUE ); break; 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)); bool selectCurrentItem = (d->selectedBySimpleMove) && (item->isSelected()); @@ -1802,7 +1817,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) item->setSelected(false); //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); if (realKey && selectCurrentItem) @@ -1851,9 +1866,9 @@ void KListView::setSelectionModeExt (SelectionModeExt mode) case Extended: case NoSelection: - setSelectionMode (static_cast<QListView::SelectionMode>(static_cast<int>(mode))); + setSelectionMode (static_cast<Q3ListView::SelectionMode>(static_cast<int>(mode))); break; case FileManager: - setSelectionMode (QListView::Extended); + setSelectionMode (Q3ListView::Extended); break; @@ -1869,5 +1884,5 @@ KListView::SelectionModeExt KListView::selectionModeExt () const } -int KListView::itemIndex( const QListViewItem *item ) const +int KListView::itemIndex( const Q3ListViewItem *item ) const { if ( !item ) @@ -1877,5 +1892,5 @@ int KListView::itemIndex( const QListViewItem *item ) const return 0; else { - QListViewItemIterator it(firstChild()); + Q3ListViewItemIterator it(firstChild()); uint j = 0; for (; it.current() && it.current() != item; ++it, ++j ); @@ -1888,5 +1903,5 @@ int KListView::itemIndex( const QListViewItem *item ) const } -QListViewItem* KListView::itemAtIndex(int index) +Q3ListViewItem* KListView::itemAtIndex(int index) { if (index<0) @@ -1894,5 +1909,5 @@ QListViewItem* KListView::itemAtIndex(int index) int j(0); - for (QListViewItemIterator it=firstChild(); it.current(); it++) + for (Q3ListViewItemIterator it=firstChild(); it.current(); it++) { if (j==index) @@ -1904,5 +1919,5 @@ QListViewItem* KListView::itemAtIndex(int index) -void KListView::emitContextMenu (KListView*, QListViewItem* i) +void KListView::emitContextMenu (KListView*, Q3ListViewItem* i) { QPoint p; @@ -1917,7 +1932,7 @@ 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; // do not trust the values for QListViewItem* i and int col; @@ -1934,5 +1949,5 @@ void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) void KListView::setAcceptDrops (bool val) { - QListView::setAcceptDrops (val); + Q3ListView::setAcceptDrops (val); viewport()->setAcceptDrops (val); } @@ -1946,5 +1961,5 @@ int KListView::dropVisualizerWidth () const void KListView::viewportPaintEvent(QPaintEvent *e) { - QListView::viewportPaintEvent(e); + Q3ListView::viewportPaintEvent(e); if (d->mOldDropVisualizer.isValid() && e->rect().intersects(d->mOldDropVisualizer)) @@ -1953,5 +1968,5 @@ 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); } if (d->mOldDropHighlighter.isValid() && e->rect().intersects(d->mOldDropHighlighter)) @@ -1989,5 +2004,5 @@ bool KListView::fullWidth() const int KListView::addColumn(const QString& label, int width) { - int result = QListView::addColumn(label, width); + int result = Q3ListView::addColumn(label, width); if (d->fullWidth) { //US header()->setStretchEnabled(false, columns()-2); @@ -1997,7 +2012,7 @@ 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) { //US header()->setStretchEnabled(false, columns()-2); @@ -2009,5 +2024,5 @@ int KListView::addColumn(const QIconSet& iconset, const QString& label, int widt void KListView::removeColumn(int index) { - QListView::removeColumn(index); + Q3ListView::removeColumn(index); //US if (d->fullWidth && index == columns()) header()->setStretchEnabled(true, columns()-1); } @@ -2015,5 +2030,5 @@ void KListView::removeColumn(int index) void KListView::viewportResizeEvent(QResizeEvent* e) { - QListView::viewportResizeEvent(e); + Q3ListView::viewportResizeEvent(e); } @@ -2071,5 +2086,5 @@ void KListView::setSorting(int column, bool ascending) d->sortColumn = column; d->sortAscending = ascending; - QListView::setSorting(column, ascending); + Q3ListView::setSorting(column, ascending); } @@ -2084,56 +2099,56 @@ bool KListView::ascendingSort(void) const } -KListViewItem::KListViewItem(QListView *parent) - : QListViewItem(parent) +KListViewItem::KListViewItem(Q3ListView *parent) + : Q3ListViewItem(parent) { init(); } -KListViewItem::KListViewItem(QListViewItem *parent) - : QListViewItem(parent) +KListViewItem::KListViewItem(Q3ListViewItem *parent) + : Q3ListViewItem(parent) { init(); } -KListViewItem::KListViewItem(QListView *parent, QListViewItem *after) - : QListViewItem(parent, after) +KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after) + : Q3ListViewItem(parent, after) { init(); } -KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after) - : QListViewItem(parent, after) +KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after) + : Q3ListViewItem(parent, after) { init(); } -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) { init(); } -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) { init(); } -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) { init(); } -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) { init(); @@ -2213,10 +2228,10 @@ void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in else if (isAlternate()) { //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()); else _cg.setColor(QColorGroup::Base, static_cast< KListView* >(listView())->alternateBackground()); } - 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 @@ -21,7 +21,18 @@ #define KLISTVIEW_H -#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> //US @@ -31,5 +42,5 @@ class QDragMoveEvent; class QDragEnterEvent; -class QDragObject; +class Q3DragObject; class KConfig; class KLineEdit; @@ -58,5 +69,5 @@ class KLineEdit; * @version $Id$ */ -class KListView : public QListView +class KListView : public Q3ListView { Q_OBJECT @@ -107,13 +118,13 @@ 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 }; void repaintContents( bool erase = true ) { - QScrollView::repaintContents( contentsX(), contentsY(), + Q3ScrollView::repaintContents( contentsX(), contentsY(), visibleWidth(), visibleHeight(), erase ); }; @@ -162,10 +173,10 @@ public: * @return a list containing the currently selected items. */ - 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?) /** * Arbitrarily move @p item to @p parent, positioned immediately after item @p after. */ - void moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after); + void moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after); /** @@ -174,5 +185,5 @@ public: * @see lastChild() */ - QListViewItem *lastItem() const; + Q3ListViewItem *lastItem() const; /** @@ -181,5 +192,5 @@ public: * @see lastItem() */ - QListViewItem* lastChild () const; + Q3ListViewItem* lastChild () const; /** @@ -277,5 +288,5 @@ public: * all items into account not only the visible ones. */ - int itemIndex( const QListViewItem *item ) const; + int itemIndex( const Q3ListViewItem *item ) const; /** @@ -284,5 +295,5 @@ public: * all items into account not only the visible ones. */ - QListViewItem* itemAtIndex(int index); + Q3ListViewItem* itemAtIndex(int index); /** @@ -315,5 +326,5 @@ public: * Reimplemented for full width support */ - virtual int addColumn(const QIconSet& iconset, const QString& label, int width = -1); + virtual int addColumn(const QIcon& iconset, const QString& label, int width = -1); /** * Reimplemented for full width support @@ -389,5 +400,5 @@ signals: * connected to this signal. */ - void executed( QListViewItem *item ); + void executed( Q3ListViewItem *item ); /** @@ -402,5 +413,5 @@ signals: * connected to this signal. */ - void executed( QListViewItem *item, const QPoint &pos, int c ); + void executed( Q3ListViewItem *item, const QPoint &pos, int c ); /** @@ -418,6 +429,6 @@ signals: * to use @ref #executed() instead. */ - 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 ); /** @@ -431,5 +442,5 @@ signals: * @see #acceptDrop() */ - void dropped (QDropEvent * e, QListViewItem *after); + void dropped (QDropEvent * e, Q3ListViewItem *after); /** @@ -445,5 +456,5 @@ signals: * the drop was above all items */ - void dropped (KListView* list, QDropEvent* e, QListViewItem* after); + void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* after); /** @@ -459,5 +470,5 @@ signals: * the drop was above all items */ - void dropped (KListView* list, QDropEvent* e, QListViewItem* parent, QListViewItem* after); + void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after); /** @@ -472,5 +483,5 @@ signals: * the drop was above all items */ - void dropped (QDropEvent* e, QListViewItem* parent, QListViewItem* after); + void dropped (QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after); /** @@ -503,5 +514,5 @@ signals: * @param afterNow the item it's currently after. */ - void moved (QListViewItem *item, QListViewItem *afterFirst, QListViewItem *afterNow); + void moved (Q3ListViewItem *item, Q3ListViewItem *afterFirst, Q3ListViewItem *afterNow); @@ -511,5 +522,5 @@ signals: * with the first of afterFirst and afterNow. */ - void moved(QPtrList<QListViewItem> &items, QPtrList<QListViewItem> &afterFirst, QPtrList<QListViewItem> &afterNow); + void moved(Q3PtrList<Q3ListViewItem> &items, Q3PtrList<Q3ListViewItem> &afterFirst, Q3PtrList<Q3ListViewItem> &afterNow); /** @@ -520,10 +531,10 @@ signals: * @param col is the renamed column. */ - void itemRenamed(QListViewItem* item, const QString &str, int col); + void itemRenamed(Q3ListViewItem* item, const QString &str, int col); /** * Same as above, but without the extra information. */ - void itemRenamed(QListViewItem* item); + void itemRenamed(Q3ListViewItem* item); void signalDelete(); @@ -538,5 +549,5 @@ signals: * @param item is the @ref currentItem() at the time the key was pressed. May be 0L. */ - void menuShortCutPressed (KListView* list, QListViewItem* item); + void menuShortCutPressed (KListView* list, Q3ListViewItem* item); /** @@ -548,5 +559,5 @@ signals: * @param p is the point at which the menu should be shown. */ - void contextMenu (KListView* l, QListViewItem* i, const QPoint& p); + void contextMenu (KListView* l, Q3ListViewItem* i, const QPoint& p); public slots: @@ -554,5 +565,5 @@ public slots: * Rename column @p c of @p item. */ - virtual void rename(QListViewItem *item, int c); + virtual void rename(Q3ListViewItem *item, int c); /** @@ -674,5 +685,5 @@ protected: * before being passed to the above function. */ - inline bool below (QListViewItem* i, const QPoint& p) + inline bool below (Q3ListViewItem* i, const QPoint& p) { return below (itemRect(i), contentsToViewport(p)); @@ -690,5 +701,5 @@ 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); /** @@ -722,10 +733,10 @@ protected: * @return the tooltip for @p column of @p item. */ - virtual QString tooltip(QListViewItem* item, int column) const; + virtual QString tooltip(Q3ListViewItem* item, int column) const; /** * @return whether the tooltip for @p column of @p item shall be shown at point @p pos. */ - virtual bool showTooltip(QListViewItem *item, const QPoint &pos, int column) const; + virtual bool showTooltip(Q3ListViewItem *item, const QPoint &pos, int column) const; /** @@ -806,5 +817,5 @@ protected: * @see setDragEnabled() */ - virtual QDragObject *dragObject(); + virtual Q3DragObject *dragObject(); /** @@ -822,5 +833,5 @@ protected: * @return the rectangle that you painted to. */ - virtual QRect drawDropVisualizer (QPainter *p, QListViewItem *parent, QListViewItem *after); + virtual QRect drawDropVisualizer (QPainter *p, Q3ListViewItem *parent, Q3ListViewItem *after); /** @@ -830,5 +841,5 @@ protected: * @return the rectangle that you painted to. */ - virtual QRect drawItemHighlighter(QPainter *painter, QListViewItem *item); + virtual QRect drawItemHighlighter(QPainter *painter, Q3ListViewItem *item); /** @@ -887,6 +898,6 @@ protected slots: void slotSettingsChanged(int); - 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); /** @@ -903,10 +914,10 @@ protected slots: * Emit the @ref contextMenu signal. This slot is for mouse actions. */ - void emitContextMenu (QListViewItem*, const QPoint&, int); + void emitContextMenu (Q3ListViewItem*, const QPoint&, int); /** * Emit the @ref #contextMenu signal. This slot is for key presses. */ - void emitContextMenu (KListView*, QListViewItem*); + void emitContextMenu (KListView*, Q3ListViewItem*); /** @@ -914,5 +925,5 @@ protected slots: * @internal */ - void slotOnItem( QListViewItem *item ); + void slotOnItem( Q3ListViewItem *item ); /** @@ -940,5 +951,5 @@ protected: * Handle dropEvent when itemsMovable() is set to true. */ - virtual void movableDropEvent (QListViewItem* parent, QListViewItem* afterme); + virtual void movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme); /** @@ -948,5 +959,5 @@ protected: * acceptDrag method without ugly casts */ - virtual void findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after); + virtual void findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after); /** @@ -975,5 +986,5 @@ private: * @short listview item with alternate background colour support */ -class KListViewItem : public QListViewItem +class KListViewItem : public Q3ListViewItem { public: @@ -984,10 +995,10 @@ public: * (or subclasses). */ - 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, QString = QString::null, QString = QString::null, @@ -995,5 +1006,5 @@ public: QString = QString::null, QString = QString::null); - KListViewItem(QListViewItem *parent, + KListViewItem(Q3ListViewItem *parent, QString, QString = QString::null, QString = QString::null, QString = QString::null, @@ -1001,5 +1012,5 @@ public: QString = QString::null, QString = QString::null); - KListViewItem(QListView *parent, QListViewItem *after, + KListViewItem(Q3ListView *parent, Q3ListViewItem *after, QString, QString = QString::null, QString = QString::null, QString = QString::null, @@ -1007,5 +1018,5 @@ public: QString = QString::null, QString = QString::null); - KListViewItem(QListViewItem *parent, QListViewItem *after, + KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after, QString, QString = QString::null, QString = QString::null, 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 @@ -22,5 +22,5 @@ Boston, MA 02111-1307, USA. */ -#include <qobjectlist.h> +#include <qobject.h> #include <qstringlist.h> #include <qtimer.h> @@ -28,4 +28,10 @@ #include <qstatusbar.h> #include <qapplication.h> +//Added by qt3to4: +#include <QCloseEvent> +#include <QPaintEvent> +#include <QResizeEvent> +#include <QChildEvent> +#include <Q3PtrList> @@ -55,5 +61,5 @@ 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 )*/ { mQToolBar = 0; @@ -277,5 +283,5 @@ void KMainWindow::setCaption( const QString &caption, bool modified ) void KMainWindow::setPlainCaption( const QString &caption ) { - QMainWindow::setCaption( caption ); + Q3MainWindow::setCaption( caption ); #ifndef Q_WS_QWS //US the following is disabled for the embedded version @@ -422,8 +428,8 @@ void KMainWindow::createStandardStatusBarAction(){ } -QToolBar *KMainWindow::tBar( ) +Q3ToolBar *KMainWindow::tBar( ) { if ( ! mQToolBar ) - mQToolBar = new QToolBar( this ); + mQToolBar = new Q3ToolBar( this ); return mQToolBar; } @@ -444,14 +450,15 @@ KToolBar *KMainWindow::toolBar( const char * name ) else */ - 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" ) ) continue; @@ -459,5 +466,5 @@ QPtrListIterator<KToolBar> KMainWindow::toolBarIterator() } } - return QPtrListIterator<KToolBar>( toolbarList ); + return Q3PtrListIterator<KToolBar>( toolbarList ); } @@ -470,5 +477,5 @@ void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindo //US connect( this, SIGNAL( dockWindowPositionChanged( QDockWindow * ) ), //US this, SLOT( setSettingsDirty() ) ); - connect( this, SIGNAL( toolBarPositionChanged(QToolBar *) ), + connect( this, SIGNAL( toolBarPositionChanged(Q3ToolBar *) ), this, SLOT( setSettingsDirty() ) ); @@ -504,5 +511,5 @@ QString KMainWindow::autoSaveGroup() const void KMainWindow::saveAutoSaveSettings() { - ASSERT( d->autoSaveSettings ); + Q_ASSERT( d->autoSaveSettings ); //kdDebug(200) << "KMainWindow::saveAutoSaveSettings -> saving settings" << endl; saveMainWindowSettings( KGlobal::config(), d->autoSaveGroup ); @@ -640,5 +647,5 @@ void KMainWindow::saveMainWindowSettings(KConfig *config, const QString &configG int n = 1; // Toolbar counter. toolbars are counted from 1, KToolBar *toolbar = 0; - QPtrListIterator<KToolBar> it( toolBarIterator() ); + Q3PtrListIterator<KToolBar> it( toolBarIterator() ); while ( ( toolbar = it.current() ) ) { ++it; @@ -715,17 +722,19 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config //US i = config->readListEntry (QString::fromLatin1("MenuBar"), entryList, ';'); 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(); + } + } } int n = 1; // Toolbar counter. toolbars are counted from 1, KToolBar *toolbar; - QPtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator + Q3PtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator for ( ; it.current(); ++it) { @@ -757,5 +766,5 @@ void KMainWindow::finalizeGUI( bool force ) // the toolbariterator should give them in the proper order. // Both the XMLGUI and applySettings call this, hence "force" for the latter. - QPtrListIterator<KToolBar> it( toolBarIterator() ); + Q3PtrListIterator<KToolBar> it( toolBarIterator() ); for ( ; it.current() ; ++ it ) it.current()->positionYourself( force ); @@ -852,5 +861,5 @@ void KMainWindow::resizeEvent( QResizeEvent * e) if ( d->autoSaveWindowSize ) setSettingsDirty(); - QMainWindow::resizeEvent( e ); + Q3MainWindow::resizeEvent( e ); } @@ -870,5 +879,5 @@ QMenuBar *KMainWindow::menuBar() // trigger a re-layout and trigger a call to the private // setMenuBar method. - QMainWindow::menuBar(); + Q3MainWindow::menuBar(); } return mb; @@ -885,5 +894,5 @@ QStatusBar *KMainWindow::statusBar() // trigger a re-layout and trigger a call to the private // setStatusBar method. - QMainWindow::statusBar(); + Q3MainWindow::statusBar(); } return sb; @@ -909,14 +918,8 @@ 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(); } @@ -925,24 +928,18 @@ 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(); } void KMainWindow::childEvent( QChildEvent* e) { - QMainWindow::childEvent( e ); + Q3MainWindow::childEvent( e ); } 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,2 +1,7 @@ +//Added by qt3to4: +#include <QResizeEvent> +#include <QChildEvent> +#include <QCloseEvent> +#include <QPaintEvent> /* This file is part of the KDE libraries @@ -51,10 +56,10 @@ class KAction; #include <ktoolbarhandler.h> #include <kxmlguiclient.h> -#include <qmainwindow.h> -#include <qptrlist.h> +#include <q3mainwindow.h> +#include <q3ptrlist.h> class KActionCollection; -class KMainWindow : public QMainWindow, virtual public KXMLGUIClient +class KMainWindow : public Q3MainWindow, virtual public KXMLGUIClient { Q_OBJECT @@ -321,10 +326,10 @@ public: KToolBar *toolBar( const char *name=0 ); // method for getting rid of KDE-Crap - QToolBar *tBar( ); + Q3ToolBar *tBar( ); /** * @return An iterator over the list of all toolbars for this window. */ - QPtrListIterator<KToolBar> toolBarIterator(); + Q3PtrListIterator<KToolBar> toolBarIterator(); /** @@ -759,5 +764,5 @@ private slots: private: - QToolBar * mQToolBar; + Q3ToolBar * mQToolBar; //US KMenuBar *internalMenuBar(); QMenuBar *internalMenuBar(); @@ -768,5 +773,5 @@ private: void initKMainWindow(const char *name); - QPtrList<KToolBar> toolbarList; + Q3PtrList<KToolBar> toolbarList; protected: 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 @@ -43,4 +43,7 @@ #include <qspinbox.h> #include <qstyle.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QEvent> #include <kglobal.h> @@ -107,9 +110,9 @@ void KNumInput::setLabel(const QString & label, int a) if (m_label) m_label->setText(label); 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; } @@ -132,5 +135,5 @@ void KNumInput::layout(bool deep) m_sizeLabel = (m_label ? m_label->sizeHint() : QSize(0,0)); - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_colw1 = m_sizeLabel.width() + 4; else @@ -203,5 +206,5 @@ KIntSpinBox::KIntSpinBox(QWidget *parent, const char *name) : QSpinBox(0, 99, 1, parent, name) { - editor()->setAlignment(AlignRight); + setAlignment(Qt::AlignRight); val_base = 10; setValue(0); @@ -216,5 +219,5 @@ KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base, : QSpinBox(lower, upper, step, parent, name) { - editor()->setAlignment(AlignRight); + setAlignment(Qt::AlignRight); val_base = base; setValue(value); @@ -244,7 +247,7 @@ int KIntSpinBox::mapTextToValue(bool* ok) void KIntSpinBox::setEditFocus(bool mark) { - editor()->setFocus(); + setFocus(); if(mark) - editor()->selectAll(); + selectAll(); } @@ -326,5 +329,5 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) m_spin->setLineStep(step); - step = m_spin->lineStep(); // maybe QRangeControl didn't like out lineStep? + step = m_spin->singleStep(); // maybe QRangeControl didn't like out lineStep? if(slider) { @@ -333,5 +336,5 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) else { m_slider = new QSlider(lower, upper, step, m_spin->value(), - QSlider::Horizontal, this); + Qt::Horizontal, this); m_slider->setTickmarks(QSlider::Below); connect(m_slider, SIGNAL(valueChanged(int)), @@ -359,5 +362,5 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) 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); } @@ -369,5 +372,5 @@ int KIntNumInput::minValue() const 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); } @@ -416,5 +419,5 @@ 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(); else @@ -425,5 +428,5 @@ QSize KIntNumInput::minimumSizeHint() const w += m_colw1 + m_colw2; - if(m_alignment & (AlignTop|AlignBottom)) + if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) w = QMAX(w, m_sizeLabel.width() + 4); @@ -445,10 +448,10 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) int h = 0; - if(m_label && (m_alignment & AlignTop)) { + if(m_label && (m_alignment & Qt::AlignTop)) { m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); h += m_sizeLabel.height() + 4; } - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_label->setGeometry(0, 0, w, m_sizeSpin.height()); @@ -461,5 +464,5 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) h += m_sizeSpin.height() + 2; - if(m_label && (m_alignment & AlignBottom)) + if(m_label && (m_alignment & Qt::AlignBottom)) m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); } @@ -647,5 +650,5 @@ 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(); else @@ -656,5 +659,5 @@ QSize KDoubleNumInput::minimumSizeHint() const w += m_colw1 + m_colw2; - if(m_alignment & (AlignTop|AlignBottom)) + if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) w = QMAX(w, m_sizeLabel.width() + 4); @@ -667,10 +670,10 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) int h = 0; - if(m_label && (m_alignment & AlignTop)) { + if(m_label && (m_alignment & Qt::AlignTop)) { m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); h += m_sizeLabel.height() + 4; } - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_label->setGeometry(0, 0, w, m_sizeEdit.height()); @@ -684,5 +687,5 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) h += m_sizeEdit.height() + 2; - if(m_label && (m_alignment & AlignBottom)) + if(m_label && (m_alignment & Qt::AlignBottom)) m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); } @@ -731,5 +734,5 @@ void KDoubleNumInput::setRange(double lower, double upper, double step, int slmin = spin->minValue(); int slvalue = spin->value(); - int slstep = spin->lineStep(); + int slstep = spin->singleStep(); if (m_slider) { m_slider->setRange(slmin, slmax); @@ -738,5 +741,5 @@ void KDoubleNumInput::setRange(double lower, double upper, double step, } else { m_slider = new QSlider(slmin, slmax, slstep, slvalue, - QSlider::Horizontal, this); + Qt::Horizontal, this); m_slider->setTickmarks(QSlider::Below); // feedback line: when one moves, the other moves, too: @@ -913,5 +916,5 @@ KDoubleSpinBox::KDoubleSpinBox( QWidget * parent, const char * name ) : QSpinBox( parent, name ) { - editor()->setAlignment( Qt::AlignRight ); + setAlignment( Qt::AlignRight ); d = new Private(); updateValidator(); @@ -923,5 +926,5 @@ KDoubleSpinBox::KDoubleSpinBox( double lower, double upper, double step, : QSpinBox( parent, name ) { - editor()->setAlignment( Qt::AlignRight ); + setAlignment( Qt::AlignRight ); d = new Private(); setRange( lower, upper, step, precision ); @@ -1028,5 +1031,5 @@ void KDoubleSpinBox::setMaxValue( double value ) { double KDoubleSpinBox::lineStep() const { - return d->mapToDouble( base::lineStep() ); + return d->mapToDouble( base::singleStep() ); } @@ -1073,5 +1076,5 @@ void KDoubleSpinBox::updateValidator() { d->mValidator = new KDoubleValidator( minValue(), maxValue(), precision(), this, "d->mValidator" ); - base::setValidator( d->mValidator ); + lineEdit()->setValidator( d->mValidator ); } else d->mValidator->setRange( minValue(), maxValue(), precision() ); 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 @@ -30,4 +30,9 @@ #include <qwidget.h> #include <qspinbox.h> +#include <QLineEdit> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> +#include <QEvent> class QLabel; @@ -82,5 +87,5 @@ public: * */ - virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); + virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); /** @@ -303,5 +308,5 @@ public: * @reimplemented */ - virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); + virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); /** @@ -589,5 +594,5 @@ public: * @reimplemented */ - virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); + virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); /** * @reimplemented @@ -759,4 +764,8 @@ public: void setEditFocus(bool mark); + 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 @@ -2,8 +2,11 @@ #include <kpopupmenu.h> #include <qtimer.h> +//Added by qt3to4: +#include <QFocusEvent> +#include <Q3PopupMenu> 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 @@ -2,5 +2,7 @@ #define KPOPUPMENU_H -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <QFocusEvent> #ifdef DESKTOP_VERSION #include <qmenubar.h> @@ -10,5 +12,5 @@ #endif -class KPopupMenu : public QPopupMenu +class KPopupMenu : public Q3PopupMenu { Q_OBJECT 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 @@ -19,4 +19,6 @@ #include <qstyle.h> +//Added by qt3to4: +#include <Q3Frame> #include <kdebug.h> @@ -27,6 +29,6 @@ #include "kseparator.h" -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) { setLineWidth(1); @@ -37,6 +39,6 @@ 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) { setLineWidth(1); @@ -51,7 +53,7 @@ void KSeparator::setOrientation(int orientation) switch(orientation) { - case Vertical: + case Qt::Vertical: case VLine: - setFrameStyle( QFrame::VLine | QFrame::Sunken ); + setFrameStyle( Q3Frame::VLine | Q3Frame::Sunken ); setMinimumSize(2, 0); break; @@ -60,7 +62,7 @@ void KSeparator::setOrientation(int orientation) kdWarning() << "KSeparator::setOrientation(): invalid orientation, using default orientation HLine" << endl; - case Horizontal: + case Qt::Horizontal: case HLine: - setFrameStyle( QFrame::HLine | QFrame::Sunken ); + setFrameStyle( Q3Frame::HLine | Q3Frame::Sunken ); setMinimumSize(0, 2); break; 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 @@ -21,5 +21,5 @@ #define __KSEPARATOR_H__ -#include <qframe.h> +#include <q3frame.h> /** @@ -29,5 +29,5 @@ * @version $Id$ */ -class KSeparator : public QFrame +class KSeparator : public Q3Frame { Q_OBJECT @@ -37,5 +37,5 @@ class KSeparator : public QFrame * Constructor. **/ - KSeparator(QWidget* parent=0, const char* name=0, WFlags f=0); + KSeparator(QWidget* parent=0, const char* name=0, Qt::WFlags f=0); /** * Constructor. @@ -45,5 +45,5 @@ 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 @@ -19,4 +19,7 @@ #include "ksqueezedtextlabel.h" #include <qtooltip.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> KSqueezedTextLabel::KSqueezedTextLabel( const QString &text , QWidget *parent, const char *name ) 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 @@ -21,4 +21,6 @@ #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 @@ -20,5 +20,5 @@ #include <qtoolbutton.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> //US #include <kaboutdata.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 @@ -26,7 +26,18 @@ #ifdef KDE_USE_FINAL #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> @@ -41,5 +52,5 @@ #include <qstring.h> #include <qrect.h> -#include <qobjectlist.h> +#include <qobject.h> #include <qtimer.h> #include <qstyle.h> @@ -70,6 +81,6 @@ #include "kconfigbase.h" -#include <qpopupmenu.h> -#include <qmainwindow.h> +#include <q3popupmenu.h> +#include <q3mainwindow.h> enum { @@ -103,5 +114,5 @@ public: //US oldPos = Qt::DockUnmanaged; - oldPos = QMainWindow::Unmanaged; + oldPos = Qt::Unmanaged; modified = m_isHorizontal = positioned = FALSE; @@ -130,5 +141,5 @@ public: QWidget *m_parent; - QMainWindow::ToolBarDock oldPos; + Qt::ToolBarDock oldPos; KXMLGUIClient *m_xmlguiClient; @@ -137,15 +148,15 @@ 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; bool newline; //US Qt::Dock dock; - QMainWindow::ToolBarDock dock; + Qt::ToolBarDock dock; }; ToolBarInfo toolBarInfo; - QValueList<int> iconSizes; + Q3ValueList<int> iconSizes; QTimer repaintTimer; @@ -159,13 +170,13 @@ public: QString PositionDefault; - 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 ); setBackgroundMode( parent->backgroundMode() ); @@ -173,9 +184,9 @@ KToolBarSeparator::KToolBarSeparator(Orientation o , bool l, QToolBar *parent, } -void KToolBarSeparator::setOrientation( Orientation o ) +void KToolBarSeparator::setOrientation( Qt::Orientation o ) { orient = o; if ( line ) { - if ( orientation() == Vertical ) + if ( orientation() == Qt::Vertical ) setFrameStyle( HLine + Sunken ); else @@ -193,5 +204,5 @@ void KToolBarSeparator::styleChange( QStyle& ) QSize KToolBarSeparator::sizeHint() const { - return orientation() == Vertical ? QSize( 0, 6 ) : QSize( 6, 0 ); + return orientation() == Qt::Vertical ? QSize( 0, 6 ) : QSize( 6, 0 ); } @@ -203,10 +214,10 @@ QSizePolicy KToolBarSeparator::sizePolicy() const KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool readConfig ) #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, name ? name : "mainToolBar") #else - : QPEToolBar( parent && parent->inherits( "QMainWindow" ) ? static_cast<QMainWindow*>(parent) : 0, + : QPEToolBar( parent && parent->inherits( "Q3MainWindow" ) ? static_cast<Q3MainWindow*>(parent) : 0, QString::fromLatin1( name )) @@ -217,7 +228,7 @@ 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, name ? name : "mainToolBar") @@ -232,7 +243,7 @@ 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, name ? name : "mainToolBar") @@ -281,6 +292,6 @@ 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 * ) ) ); // Hack to make sure we recalculate our size when we dock. @@ -342,5 +353,5 @@ 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 ) { @@ -354,5 +365,5 @@ 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 ) { @@ -541,5 +552,5 @@ void KToolBar::setButtonIcon( int id, const QString& _icon ) } -void KToolBar::setButtonIconSet( int id, const QIconSet& iconset ) +void KToolBar::setButtonIconSet( int id, const QIcon& iconset ) { Id2WidgetMap::Iterator it = id2widget.find( id ); @@ -553,5 +564,5 @@ 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 ) { Id2WidgetMap::Iterator it = id2widget.find( id ); @@ -788,5 +799,5 @@ void KToolBar::setItemAutoSized (int id, bool yes ) void KToolBar::clear () { - QToolBar::clear(); + Q3ToolBar::clear(); widget2id.clear(); id2widget.clear(); @@ -877,5 +888,5 @@ void KToolBar::setBarPos (BarPosition bpos) return; //US mainWindow()->moveDockWindow( this, (Dock)bpos ); - mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos ); + mainWindow()->moveToolBar( this, (Qt::ToolBarDock)bpos ); } @@ -883,13 +894,13 @@ void KToolBar::setBarPos (BarPosition bpos) 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; } @@ -968,5 +979,5 @@ void KToolBar::setIconText(IconText icontext, bool update) // ugly hack to force a QMainWindow::triggerLayout( TRUE ) if ( mainWindow() ) { - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); mw->setUpdatesEnabled( FALSE ); mw->setToolBarsMovable( !mw->toolBarsMovable() ); @@ -1005,5 +1016,5 @@ void KToolBar::setIconSize(int size, bool update) // ugly hack to force a QMainWindow::triggerLayout( TRUE ) if ( mainWindow() ) { - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); mw->setUpdatesEnabled( FALSE ); mw->setToolBarsMovable( !mw->toolBarsMovable() ); @@ -1063,8 +1074,8 @@ void KToolBar::setFlat (bool flag) if ( 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 /*US @@ -1250,7 +1261,7 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) if ( !mainWindow() ) 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 ); switch ( i ) { @@ -1259,17 +1270,17 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) case CONTEXT_LEFT: //US mw->moveDockWindow( this, DockLeft ); - mw->moveToolBar( this, QMainWindow::Left ); + mw->moveToolBar( this, Qt::Left ); break; case CONTEXT_RIGHT: //US mw->moveDockWindow( this, DockRight ); - mw->moveToolBar( this, QMainWindow::Right ); + mw->moveToolBar( this, Qt::Right ); break; case CONTEXT_TOP: //US mw->moveDockWindow( this, DockTop ); - mw->moveToolBar( this, QMainWindow::Top ); + mw->moveToolBar( this, Qt::Top ); break; case CONTEXT_BOTTOM: //US mw->moveDockWindow( this, DockBottom ); - mw->moveToolBar( this, QMainWindow::Bottom ); + mw->moveToolBar( this, Qt::Bottom ); break; case CONTEXT_FLOAT: @@ -1277,5 +1288,5 @@ void KToolBar::mousePressEvent ( QMouseEvent *m ) case CONTEXT_FLAT: //US mw->moveDockWindow( this, DockMinimized ); - mw->moveToolBar( this, QMainWindow::Minimized ); + mw->moveToolBar( this, Qt::Minimized ); break; case CONTEXT_ICONS: @@ -1333,5 +1344,5 @@ void KToolBar::rebuildLayout() continue; } - if ( w->inherits( "QPopupMenu" ) ) + if ( w->inherits( "Q3PopupMenu" ) ) continue; l->addWidget( w ); @@ -1365,5 +1376,5 @@ void KToolBar::childEvent( QChildEvent *e ) QWidget * w = (QWidget*)e->child(); if ( e->type() == QEvent::ChildInserted ) { - if ( !e->child()->inherits( "QPopupMenu" ) && + if ( !e->child()->inherits( "Q3PopupMenu" ) && ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) { @@ -1376,8 +1387,8 @@ void KToolBar::childEvent( QChildEvent *e ) } } - } else { + } else if( e->type() == QEvent::ChildRemoved ) { removeWidgetInternal( w ); } - if ( isVisibleTo( 0 ) ) + /* TODO:hacker: if ( isVisibleTo( 0 ) ) { QBoxLayout *l = boxLayout(); @@ -1391,7 +1402,7 @@ void KToolBar::childEvent( QChildEvent *e ) } layoutTimer->start( 50, TRUE ); - } + } */ } - QToolBar::childEvent( e ); + Q3ToolBar::childEvent( e ); } @@ -1417,5 +1428,5 @@ void KToolBar::repaintMe() { setUpdatesEnabled( true ); - QToolBar::repaint( true ); + Q3ToolBar::repaint( true ); qDebug(" KToolBar::repaintMe() "); } @@ -1424,10 +1435,10 @@ void KToolBar::showEvent( QShowEvent *e ) { rebuildLayout(); - QToolBar::showEvent( e ); + Q3ToolBar::showEvent( e ); } void KToolBar::setStretchableWidget( QWidget *w ) { - QToolBar::setStretchableWidget( w ); + Q3ToolBar::setStretchableWidget( w ); stretchableWidget = w; } @@ -1435,5 +1446,5 @@ void KToolBar::setStretchableWidget( QWidget *w ) QSizePolicy KToolBar::sizePolicy() const { - if ( orientation() == Horizontal ) + if ( orientation() == Qt::Horizontal ) return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); else @@ -1443,5 +1454,5 @@ QSizePolicy KToolBar::sizePolicy() const 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() ); if ( sh.height() <= 20 || sh.width() < 60 ) @@ -1509,5 +1520,5 @@ QSize KToolBar::sizeHint() const default: - minSize = QToolBar::sizeHint(); + minSize = Q3ToolBar::sizeHint(); break; } @@ -1533,10 +1544,10 @@ bool KToolBar::highlight() const void KToolBar::hide() { - QToolBar::hide(); + Q3ToolBar::hide(); } void KToolBar::show() { - QToolBar::show(); + Q3ToolBar::show(); } @@ -1545,5 +1556,5 @@ void KToolBar::resizeEvent( QResizeEvent *e ) bool b = isUpdatesEnabled(); setUpdatesEnabled( FALSE ); - QToolBar::resizeEvent( e ); + Q3ToolBar::resizeEvent( e ); if (b) d->repaintTimer.start( 100, true ); @@ -1727,5 +1738,5 @@ void KToolBar::applyAppearanceSettings(KConfig *config, const QString &_configGr } - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); // ...and if we should highlight @@ -1806,17 +1817,17 @@ void KToolBar::applySettings(KConfig *config, const QString &_configGroup) pos = DockMinimized; */ - 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; //kdDebug(220) << "KToolBar::applySettings hidden=" << hidden << endl; @@ -1828,5 +1839,5 @@ void KToolBar::applySettings(KConfig *config, const QString &_configGroup) if ( mainWindow() ) { - QMainWindow *mw = mainWindow(); + Q3MainWindow *mw = mainWindow(); //kdDebug(220) << "KToolBar::applySettings updating ToolbarInfo" << endl; @@ -1863,5 +1874,5 @@ bool KToolBar::event( QEvent *e ) } - return QToolBar::event( e ); + return Q3ToolBar::event( e ); } @@ -1881,12 +1892,12 @@ void KToolBar::slotRepaint() } -void KToolBar::toolBarPosChanged( QToolBar *tb ) +void KToolBar::toolBarPosChanged( Q3ToolBar *tb ) { if ( tb != this ) return; //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 if ( mainWindow() && mainWindow()->inherits( "KMainWindow" ) ) @@ -2032,5 +2043,5 @@ void KToolBar::getAttributes( QString &position, QString &icontext, int &index ) if ( mainWindow() ) { - QMainWindow::ToolBarDock dock; + Qt::ToolBarDock dock; bool newLine; int offset; @@ -2101,5 +2112,5 @@ void KToolBar::positionYourself( bool force ) //US KPopupMenu *KToolBar::contextMenu() -QPopupMenu *KToolBar::contextMenu() +Q3PopupMenu *KToolBar::contextMenu() { if ( context ) @@ -2109,9 +2120,9 @@ QPopupMenu *KToolBar::contextMenu() // won't be deleted by QToolBar::clear(). //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")); //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 ); orient->insertItem( i18n("toolbar position string","Left"), CONTEXT_LEFT ); @@ -2123,5 +2134,5 @@ 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 ); mode->insertItem( i18n("Text Only"), CONTEXT_TEXT ); @@ -2130,8 +2141,8 @@ 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 KIconTheme *theme = KGlobal::instance()->iconLoader()->theme(); @@ -2146,5 +2157,5 @@ QPopupMenu *KToolBar::contextMenu() d->iconSizes = avSizes; - QValueList<int>::Iterator it; + Q3ValueList<int>::Iterator it; for (it=avSizes.begin(); it!=avSizes.end(); it++) { QString text; @@ -2219,6 +2230,6 @@ 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 ) context->setItemChecked( CONTEXT_ICONSIZES + *iIt, false ); 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 @@ -27,25 +27,33 @@ #ifndef DESKTOP_VERSION #define private public -#include <qtoolbar.h> +#include <q3toolbar.h> #undef private #include <qpe/qpetoolbar.h> #else -#include <qtoolbar.h> +#include <q3toolbar.h> #endif -#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> class QDomElement; class QSize; class QPixmap; -class QPopupMenu; +class Q3PopupMenu; class QStringList; class QDomDocument; @@ -64,20 +72,20 @@ class KXMLGUIClient; class KToolBarPrivate; -class KToolBarSeparator : public QFrame +class KToolBarSeparator : public Q3Frame { Q_OBJECT 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; bool showLine() const { return line; } public slots: - void setOrientation( Orientation ); + void setOrientation( Qt::Orientation ); protected: void styleChange( QStyle& ); private: - Orientation orient; + Qt::Orientation orient; bool line; }; @@ -112,8 +120,8 @@ private: #ifndef DESKTOP_VERSION -#define QToolBar QPEToolBar +#define Q3ToolBar QPEToolBar #endif - class KToolBar : public QToolBar + class KToolBar : public Q3ToolBar { Q_OBJECT @@ -128,5 +136,5 @@ private: Q_PROPERTY( QString text READ text WRITE setText ) #ifndef DESKTOP_VERSION -#undef QToolBar +#undef Q3ToolBar #endif public: @@ -176,5 +184,5 @@ public: * @param readConfig whether to apply the configuration (global and application-specific) */ - 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 ); @@ -194,5 +202,5 @@ public: * @param readConfig whether to apply the configuration (global and application-specific) */ - 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 ); @@ -304,5 +312,5 @@ public: * with tables, drawings etc. Just don't fiddle with events there. */ - 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); @@ -319,5 +327,5 @@ public: * with tables, drawings etc. Just don't fiddle with events there. */ - 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); @@ -360,5 +368,5 @@ public: const QString& tooltiptext=QString::null, int size=70, int index=-1, - QComboBox::Policy policy = QComboBox::AtBottom); + QComboBox::Policy policy = QComboBox::InsertAtBottom); /** @@ -376,5 +384,5 @@ public: const QString& tooltiptext=QString::null, int size=70, int index=-1, - QComboBox::Policy policy = QComboBox::AtBottom); + QComboBox::Policy policy = QComboBox::InsertAtBottom); /** @@ -466,5 +474,5 @@ public: * Can be used while button is visible. */ - void setButtonIconSet( int id, const QIconSet& iconset ); + void setButtonIconSet( int id, const QIcon& iconset ); /** @@ -492,5 +500,5 @@ public: * other popups. */ - void setDelayedPopup (int id , QPopupMenu *_popup, bool toggle = false); + void setDelayedPopup (int id , Q3PopupMenu *_popup, bool toggle = false); /** @@ -1061,5 +1069,5 @@ public: public slots: virtual void setIconText( const QString &txt ) - { QToolBar::setIconText( txt ); } + { Q3ToolBar::setIconText( txt ); } void slotRepaint(); @@ -1078,5 +1086,5 @@ private slots: void slotAppearanceChanged(); void slotIconChanged(int); - void toolBarPosChanged( QToolBar *tb ); + void toolBarPosChanged( Q3ToolBar *tb ); void slotContextAboutToShow(); void widgetDestroyed(); @@ -1091,5 +1099,5 @@ private: void getAttributes( QString &position, QString &icontext, int &index ); //US KPopupMenu *contextMenu(); - QPopupMenu *contextMenu(); + Q3PopupMenu *contextMenu(); QMap<QWidget*, int > widget2id; @@ -1097,8 +1105,8 @@ private: Id2WidgetMap id2widget; //US KPopupMenu *context; - QPopupMenu *context; - QPtrList<QWidget> widgets; + Q3PopupMenu *context; + Q3PtrList<QWidget> widgets; QTimer *layoutTimer; - QGuardedPtr<QWidget> stretchableWidget, rightAligned; + QPointer<QWidget> stretchableWidget, rightAligned; protected: virtual void virtual_hook( int id, void* data ); 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 @@ -34,8 +34,12 @@ #include <qtooltip.h> #include <qbitmap.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcursor.h> #include <qpainter.h> #include <qlayout.h> +//Added by qt3to4: +#include <QPixmap> +#include <QMouseEvent> +#include <QEvent> #include <kapplication.h> @@ -49,5 +53,5 @@ #include <kmainwindow.h> -template class QIntDict<KToolBarButton>; +template class Q3IntDict<KToolBarButton>; class KToolBarButtonPrivate @@ -116,5 +120,5 @@ KToolBarButton::KToolBarButton( const QString& _icon, int _id, //US d->m_instance = _instance; - setFocusPolicy( NoFocus ); + setFocusPolicy( Qt::NoFocus ); // connect all of our slots and start trapping events @@ -147,5 +151,5 @@ KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id, QToolButton::setTextLabel(txt); - setFocusPolicy( NoFocus ); + setFocusPolicy( Qt::NoFocus ); // connect all of our slots and start trapping events @@ -162,5 +166,5 @@ KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id, // set our pixmap and do our initial setup - setIconSet( QIconSet( pixmap )); + setIconSet( QIcon( pixmap )); modeChange(); } @@ -293,5 +297,5 @@ void KToolBarButton::setIcon( const QString &icon ) } -void KToolBarButton::setIconSet( const QIconSet &iconset ) +void KToolBarButton::setIconSet( const QIcon &iconset ) { QToolButton::setIconSet( iconset ); @@ -306,6 +310,6 @@ void KToolBarButton::setPixmap( const QPixmap &pixmap ) return; } - QIconSet set = iconSet(); - set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Active ); + QIcon set = iconSet(); + set.setPixmap( pixmap, QIcon::Automatic, QIcon::Active ); QToolButton::setIconSet( set ); } @@ -313,6 +317,6 @@ void KToolBarButton::setPixmap( const QPixmap &pixmap ) 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 ); } @@ -320,6 +324,6 @@ void KToolBarButton::setDefaultPixmap( const QPixmap &pixmap ) 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 ); } @@ -327,5 +331,5 @@ void KToolBarButton::setDisabledPixmap( const QPixmap &pixmap ) void KToolBarButton::setDefaultIcon( const QString& icon ) { - QIconSet set = iconSet(); + QIcon set = iconSet(); QPixmap pm; if (!strcmp(d->m_parent->name(), "mainToolBar")) @@ -335,5 +339,5 @@ void KToolBarButton::setDefaultIcon( const QString& icon ) pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, d->m_iconSize ); - set.setPixmap( pm, QIconSet::Automatic, QIconSet::Normal ); + set.setPixmap( pm, QIcon::Automatic, QIcon::Normal ); QToolButton::setIconSet( set ); } @@ -341,5 +345,5 @@ void KToolBarButton::setDefaultIcon( const QString& icon ) void KToolBarButton::setDisabledIcon( const QString& icon ) { - QIconSet set = iconSet(); + QIcon set = iconSet(); QPixmap pm; if (!strcmp(d->m_parent->name(), "mainToolBar")) @@ -349,9 +353,9 @@ void KToolBarButton::setDisabledIcon( const QString& icon ) pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, d->m_iconSize ); - set.setPixmap( pm, QIconSet::Automatic, QIconSet::Disabled ); + set.setPixmap( pm, QIcon::Automatic, QIcon::Disabled ); QToolButton::setIconSet( set ); } -QPopupMenu *KToolBarButton::popup() +QMenu *KToolBarButton::popup() { // obsolete @@ -360,5 +364,5 @@ QPopupMenu *KToolBarButton::popup() } -void KToolBarButton::setPopup(QPopupMenu *p, bool) +void KToolBarButton::setPopup(Q3PopupMenu *p, bool) { QToolButton::setPopup(p); @@ -367,5 +371,5 @@ void KToolBarButton::setPopup(QPopupMenu *p, bool) -void KToolBarButton::setDelayedPopup (QPopupMenu *p, bool) +void KToolBarButton::setDelayedPopup (Q3PopupMenu *p, bool) { QToolButton::setPopup(p); @@ -452,19 +456,25 @@ 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); #else @@ -485,7 +495,7 @@ void KToolBarButton::drawButton( QPainter *_painter ) isOn() ? QIconSet::On : QIconSet::Off ); */ - 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); if( !pixmap.isNull()) @@ -509,7 +519,7 @@ void KToolBarButton::drawButton( QPainter *_painter ) isOn() ? QIconSet::On : QIconSet::Off ); */ - 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); if( !pixmap.isNull()) @@ -527,5 +537,5 @@ void KToolBarButton::drawButton( QPainter *_painter ) if (!textLabel().isNull()) { - textFlags = AlignVCenter|AlignLeft; + textFlags = Qt::AlignVCenter|Qt::AlignLeft; if (!pixmap.isNull()) dx = 4 + pixmap.width() + 2; @@ -545,5 +555,5 @@ void KToolBarButton::drawButton( QPainter *_painter ) if (!textLabel().isNull()) { - textFlags = AlignVCenter|AlignLeft; + textFlags = Qt::AlignVCenter|Qt::AlignLeft; dx = (width() - fm.width(textLabel())) / 2; dy = (height() - fm.lineSpacing()) / 2; @@ -564,7 +574,7 @@ void KToolBarButton::drawButton( QPainter *_painter ) isOn() ? QIconSet::On : QIconSet::Off ); */ - 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); if( !pixmap.isNull()) @@ -582,5 +592,5 @@ void KToolBarButton::drawButton( QPainter *_painter ) if (!textLabel().isNull()) { - textFlags = AlignBottom|AlignHCenter; + textFlags = Qt::AlignBottom|Qt::AlignHCenter; dx = (width() - fm.width(textLabel())) / 2; dy = height() - fm.lineSpacing() - 4; @@ -611,12 +621,16 @@ 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 style().drawArrow(_painter, Qt::DownArrow, isDown(), 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 @@ -27,6 +27,9 @@ #include <qpixmap.h> #include <qtoolbutton.h> -#include <qintdict.h> +#include <q3intdict.h> #include <qstring.h> +//Added by qt3to4: +#include <QEvent> +#include <Q3PopupMenu> #include <kglobal.h> @@ -35,5 +38,5 @@ class KToolBarButtonPrivate; //USclass KInstance; class QEvent; -class QPopupMenu; +class Q3PopupMenu; class QPainter; @@ -151,5 +154,5 @@ public: * @param iconset The iconset to use */ - virtual void setIconSet( const QIconSet &iconset ); + virtual void setIconSet( const QIcon &iconset ); #ifndef KDE_NO_COMPAT @@ -210,5 +213,5 @@ public: * Return a pointer to this button's popup menu (if it exists) */ - QPopupMenu *popup(); + QMenu *popup(); /** @@ -225,5 +228,5 @@ public: * @param p The new popup menu */ - void setPopup (QPopupMenu *p, bool unused = false); + void setPopup (Q3PopupMenu *p, bool unused = false); /** @@ -236,5 +239,5 @@ public: * @param p the new popup menu */ - void setDelayedPopup(QPopupMenu *p, bool unused = false); + void setDelayedPopup(Q3PopupMenu *p, bool unused = false); /** @@ -304,5 +307,5 @@ private: * @version $Id$ */ -class KToolBarButtonList : public QIntDict<KToolBarButton> +class KToolBarButtonList : public Q3IntDict<KToolBarButton> { public: 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 @@ -19,5 +19,7 @@ #include "ktoolbarhandler.h" -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <Q3PtrList> #include <kapplication.h> #include <ktoolbar.h> @@ -45,5 +47,5 @@ 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 ) { @@ -71,14 +73,14 @@ namespace bool needsRebuild() const { return m_needsRebuild; } - 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 ) handleToolBar( toolBarIt.current() ); - QPtrList<KAction> actions; + Q3PtrList<KAction> actions; if ( m_toolBarActions.count() == 0 ) @@ -92,5 +94,5 @@ namespace KActionMenu *menuAction = new KActionMenu( i18n( "Toolbars" ), m_actionCollection, "toolbars_submenu_action" ); - QPtrListIterator<KAction> actionIt( m_toolBarActions ); + Q3PtrListIterator<KAction> actionIt( m_toolBarActions ); for ( ; actionIt.current(); ++actionIt ) menuAction->insert( actionIt.current() ); @@ -100,5 +102,5 @@ namespace } - const QPtrList<KToolBar> &toolBars() const { return m_toolBars; } + const Q3PtrList<KToolBar> &toolBars() const { return m_toolBars; } private: @@ -116,6 +118,6 @@ namespace KMainWindow *m_mainWindow; - QPtrList<KToolBar> m_toolBars; - QPtrList<KAction> m_toolBarActions; + Q3PtrList<KToolBar> m_toolBars; + Q3PtrList<KAction> m_toolBarActions; bool m_needsRebuild : 1; @@ -225,5 +227,5 @@ void ToolBarHandler::init( KMainWindow *mainWindow ) void ToolBarHandler::connectToActionContainers() { - QPtrListIterator<KAction> actionIt( m_actions ); + Q3PtrListIterator<KAction> actionIt( m_actions ); for ( ; actionIt.current(); ++actionIt ) connectToActionContainer( actionIt.current() ); @@ -240,5 +242,5 @@ void ToolBarHandler::connectToActionContainer( QWidget *container ) { //US QPopupMenu *popupMenu = dynamic_cast<QPopupMenu *>( container ); - QPopupMenu *popupMenu = (QPopupMenu *)( container ); + Q3PopupMenu *popupMenu = (Q3PopupMenu *)( container ); if ( !popupMenu ) return; 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 @@ -21,6 +21,6 @@ #include <qobject.h> -#include <qguardedptr.h> -#include <qptrlist.h> +#include <qpointer.h> +#include <q3ptrlist.h> #include <kxmlguiclient.h> #include <kaction.h> @@ -58,7 +58,7 @@ private: Data *d; - 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 @@ -40,4 +40,6 @@ #include <assert.h> +//Added by qt3to4: +#include <Q3PtrList> class KXMLGUIClientPrivate @@ -64,5 +66,5 @@ public: KXMLGUIClient *m_parent; //QPtrList<KXMLGUIClient> m_supers; - QPtrList<KXMLGUIClient> m_children; + Q3PtrList<KXMLGUIClient> m_children; //US KXMLGUIBuilder *m_builder; //US QString m_xmlFile; @@ -86,5 +88,5 @@ KXMLGUIClient::~KXMLGUIClient() d->m_parent->removeChildClient( this ); - QPtrListIterator<KXMLGUIClient> it( d->m_children ); + Q3PtrListIterator<KXMLGUIClient> it( d->m_children ); for ( ; it.current(); ++it ) { assert( it.current()->d->m_parent == this ); @@ -100,5 +102,5 @@ KAction *KXMLGUIClient::action( const char *name ) const KAction* act = actionCollection()->action( name ); if ( !act ) { - QPtrListIterator<KXMLGUIClient> childIt( d->m_children ); + Q3PtrListIterator<KXMLGUIClient> childIt( d->m_children ); for (; childIt.current(); ++childIt ) { act = childIt.current()->actionCollection()->action( name ); @@ -589,5 +591,5 @@ void KXMLGUIClient::removeChildClient( KXMLGUIClient *child ) }*/ -const QPtrList<KXMLGUIClient> *KXMLGUIClient::childClients() +const Q3PtrList<KXMLGUIClient> *KXMLGUIClient::childClients() { return &d->m_children; @@ -607,5 +609,5 @@ KXMLGUIBuilder *KXMLGUIClient::clientBuilder() const */ -void KXMLGUIClient::plugActionList( const QString &name, const QPtrList<KAction> &actionList ) +void KXMLGUIClient::plugActionList( const QString &name, const Q3PtrList<KAction> &actionList ) { /*US 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 @@ -22,5 +22,5 @@ //US #include <qdom.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qmap.h> #include <qstringlist.h> @@ -162,5 +162,5 @@ public: * Retrieves a list of all child clients. */ - const QPtrList<KXMLGUIClient> *childClients(); + const Q3PtrList<KXMLGUIClient> *childClients(); /** @@ -229,5 +229,5 @@ public: * menu too.. */ - void plugActionList( const QString &name, const QPtrList<KAction> &actionList ); + void plugActionList( const QString &name, const Q3PtrList<KAction> &actionList ); /** |