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 | |||
@@ -27,8 +27,11 @@ | |||
27 | 27 | ||
28 | #include <assert.h> | 28 | #include <assert.h> |
29 | 29 | ||
30 | #include <qtooltip.h> | 30 | #include <qtooltip.h> |
31 | //Added by qt3to4: | ||
32 | #include <Q3CString> | ||
33 | #include <Q3ValueList> | ||
31 | //US#include <qwhatsthis.h> | 34 | //US#include <qwhatsthis.h> |
32 | //US#include <kaccel.h> | 35 | //US#include <kaccel.h> |
33 | //US#include <kaccelbase.h> | 36 | //US#include <kaccelbase.h> |
34 | #include <kapplication.h> | 37 | #include <kapplication.h> |
@@ -41,11 +44,11 @@ | |||
41 | #include <ktoolbarbutton.h> | 44 | #include <ktoolbarbutton.h> |
42 | 45 | ||
43 | //US added this includefiles | 46 | //US added this includefiles |
44 | #include <qmenubar.h> | 47 | #include <qmenubar.h> |
45 | #include <qtoolbar.h> | 48 | #include <q3toolbar.h> |
46 | #include <qpopupmenu.h> | 49 | #include <q3popupmenu.h> |
47 | #include <qiconset.h> | 50 | #include <qicon.h> |
48 | 51 | ||
49 | /** | 52 | /** |
50 | * How it works. | 53 | * How it works. |
51 | * KActionCollection is an organizing container for KActions. | 54 | * KActionCollection is an organizing container for KActions. |
@@ -86,9 +89,9 @@ public: | |||
86 | m_configurable = true; | 89 | m_configurable = true; |
87 | } | 90 | } |
88 | 91 | ||
89 | KAccel *m_kaccel; | 92 | KAccel *m_kaccel; |
90 | QValueList<KAccel*> m_kaccelList; | 93 | Q3ValueList<KAccel*> m_kaccelList; |
91 | 94 | ||
92 | QString m_groupText; | 95 | QString m_groupText; |
93 | QString m_group; | 96 | QString m_group; |
94 | 97 | ||
@@ -106,9 +109,9 @@ public: | |||
106 | int m_id; | 109 | int m_id; |
107 | QWidget* m_representative; | 110 | QWidget* m_representative; |
108 | }; | 111 | }; |
109 | 112 | ||
110 | QValueList<Container> m_containers; | 113 | Q3ValueList<Container> m_containers; |
111 | }; | 114 | }; |
112 | 115 | ||
113 | //--------------------------------------------------------------------- | 116 | //--------------------------------------------------------------------- |
114 | // KAction | 117 | // KAction |
@@ -129,9 +132,9 @@ KAction::KAction( const QString& text, const QString& sIconName, const KShortcut | |||
129 | initPrivate( text, cut, receiver, slot ); | 132 | initPrivate( text, cut, receiver, slot ); |
130 | d->setIconName( sIconName ); | 133 | d->setIconName( sIconName ); |
131 | } | 134 | } |
132 | 135 | ||
133 | KAction::KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 136 | KAction::KAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
134 | const QObject* receiver, const char* slot, | 137 | const QObject* receiver, const char* slot, |
135 | KActionCollection* parent, const char* name ) | 138 | KActionCollection* parent, const char* name ) |
136 | : QObject( parent, name ) | 139 | : QObject( parent, name ) |
137 | { | 140 | { |
@@ -163,9 +166,9 @@ KAction::KAction( const QString& text, const KShortcut& cut, | |||
163 | : QObject( parent, name ) | 166 | : QObject( parent, name ) |
164 | { | 167 | { |
165 | initPrivate( text, cut, receiver, slot ); | 168 | initPrivate( text, cut, receiver, slot ); |
166 | } | 169 | } |
167 | KAction::KAction( const QString& text, const QIconSet& pix, | 170 | KAction::KAction( const QString& text, const QIcon& pix, |
168 | const KShortcut& cut, | 171 | const KShortcut& cut, |
169 | QObject* parent, const char* name ) | 172 | QObject* parent, const char* name ) |
170 | : QObject( parent, name ) | 173 | : QObject( parent, name ) |
171 | { | 174 | { |
@@ -181,9 +184,9 @@ KAction::KAction( const QString& text, const QString& pix, | |||
181 | initPrivate( text, cut, 0, 0 ); | 184 | initPrivate( text, cut, 0, 0 ); |
182 | d->setIconName( pix ); | 185 | d->setIconName( pix ); |
183 | } | 186 | } |
184 | 187 | ||
185 | KAction::KAction( const QString& text, const QIconSet& pix, | 188 | KAction::KAction( const QString& text, const QIcon& pix, |
186 | const KShortcut& cut, | 189 | const KShortcut& cut, |
187 | const QObject* receiver, const char* slot, QObject* parent, | 190 | const QObject* receiver, const char* slot, QObject* parent, |
188 | const char* name ) | 191 | const char* name ) |
189 | : QObject( parent, name ) | 192 | : QObject( parent, name ) |
@@ -505,10 +508,10 @@ void KAction::updateShortcut( int i ) | |||
505 | { | 508 | { |
506 | int id = itemId( i ); | 509 | int id = itemId( i ); |
507 | 510 | ||
508 | QWidget* w = container( i ); | 511 | QWidget* w = container( i ); |
509 | if ( w->inherits( "QPopupMenu" ) ) { | 512 | if ( w->inherits( "Q3PopupMenu" ) ) { |
510 | QPopupMenu* menu = static_cast<QPopupMenu*>(w); | 513 | Q3PopupMenu* menu = static_cast<Q3PopupMenu*>(w); |
511 | updateShortcut( menu, id ); | 514 | updateShortcut( menu, id ); |
512 | } | 515 | } |
513 | else if ( w->inherits( "QMenuBar" ) ) | 516 | else if ( w->inherits( "QMenuBar" ) ) |
514 | //US static_cast<QMenuBar*>(w)->setAccel( d->m_cut.keyCodeQt(), id ); | 517 | //US static_cast<QMenuBar*>(w)->setAccel( d->m_cut.keyCodeQt(), id ); |
@@ -517,9 +520,9 @@ void KAction::updateShortcut( int i ) | |||
517 | ; //qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed"); | 520 | ; //qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed"); |
518 | 521 | ||
519 | } | 522 | } |
520 | 523 | ||
521 | void KAction::updateShortcut( QPopupMenu* menu, int id ) | 524 | void KAction::updateShortcut( Q3PopupMenu* menu, int id ) |
522 | { | 525 | { |
523 | /*US | 526 | /*US |
524 | //kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl; | 527 | //kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl; |
525 | // If the action has a KAccel object, | 528 | // If the action has a KAccel object, |
@@ -620,9 +623,9 @@ void KAction::updateToolTip( int i ) | |||
620 | QWidget *w = container( i ); | 623 | QWidget *w = container( i ); |
621 | 624 | ||
622 | if ( w->inherits( "KToolBar" ) ) | 625 | if ( w->inherits( "KToolBar" ) ) |
623 | QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); | 626 | QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); |
624 | else if ( w->inherits( "QToolBar" ) ) | 627 | else if ( w->inherits( "Q3ToolBar" ) ) |
625 | QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); | 628 | QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); |
626 | } | 629 | } |
627 | 630 | ||
628 | QString KAction::toolTip() const | 631 | QString KAction::toolTip() const |
@@ -645,11 +648,11 @@ int KAction::plug( QWidget *w, int index ) | |||
645 | //US return -1; | 648 | //US return -1; |
646 | 649 | ||
647 | plugShortcut(); | 650 | plugShortcut(); |
648 | 651 | ||
649 | if ( w->inherits("QPopupMenu") ) | 652 | if ( w->inherits("Q3PopupMenu") ) |
650 | { | 653 | { |
651 | QPopupMenu* menu = static_cast<QPopupMenu*>( w ); | 654 | Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( w ); |
652 | int id; | 655 | int id; |
653 | // Don't insert shortcut into menu if it's already in a KAccel object. | 656 | // Don't insert shortcut into menu if it's already in a KAccel object. |
654 | //qDebug("KAction::plug warning: real shortcuts not available yet. "); | 657 | //qDebug("KAction::plug warning: real shortcuts not available yet. "); |
655 | //US int keyQt = (d->m_kaccelList.count() || d->m_kaccel) ? 0 : d->m_cut.keyCodeQt(); | 658 | //US int keyQt = (d->m_kaccelList.count() || d->m_kaccel) ? 0 : d->m_cut.keyCodeQt(); |
@@ -720,9 +723,9 @@ int KAction::plug( QWidget *w, int index ) | |||
720 | bar->insertButton( icon, id_, SIGNAL( clicked() ), this, | 723 | bar->insertButton( icon, id_, SIGNAL( clicked() ), this, |
721 | SLOT( slotActivated() ), | 724 | SLOT( slotActivated() ), |
722 | d->isEnabled(), d->plainText(), index/*US, instance*/ ); | 725 | d->isEnabled(), d->plainText(), index/*US, instance*/ ); |
723 | } | 726 | } |
724 | bar->getButton( id_ )->setName( QCString("toolbutton_")+name() ); | 727 | bar->getButton( id_ )->setName( Q3CString("toolbutton_")+name() ); |
725 | 728 | ||
726 | //US if ( !d->whatsThis().isEmpty() ) | 729 | //US if ( !d->whatsThis().isEmpty() ) |
727 | //US QWhatsThis::add( bar->getButton(id_), whatsThisWithIcon() ); | 730 | //US QWhatsThis::add( bar->getButton(id_), whatsThisWithIcon() ); |
728 | if ( !d->toolTip().isEmpty() ) | 731 | if ( !d->toolTip().isEmpty() ) |
@@ -748,11 +751,11 @@ void KAction::unplug( QWidget *w ) | |||
748 | if ( i == -1 ) | 751 | if ( i == -1 ) |
749 | return; | 752 | return; |
750 | int id = itemId( i ); | 753 | int id = itemId( i ); |
751 | 754 | ||
752 | if ( w->inherits( "QPopupMenu" ) ) | 755 | if ( w->inherits( "Q3PopupMenu" ) ) |
753 | { | 756 | { |
754 | QPopupMenu *menu = static_cast<QPopupMenu *>( w ); | 757 | Q3PopupMenu *menu = static_cast<Q3PopupMenu *>( w ); |
755 | menu->removeItem( id ); | 758 | menu->removeItem( id ); |
756 | } | 759 | } |
757 | else if ( w->inherits( "KToolBar" ) ) | 760 | else if ( w->inherits( "KToolBar" ) ) |
758 | { | 761 | { |
@@ -861,10 +864,10 @@ void KAction::setEnabled(bool enable) | |||
861 | void KAction::updateEnabled( int i ) | 864 | void KAction::updateEnabled( int i ) |
862 | { | 865 | { |
863 | QWidget *w = container( i ); | 866 | QWidget *w = container( i ); |
864 | 867 | ||
865 | if ( w->inherits("QPopupMenu") ) | 868 | if ( w->inherits("Q3PopupMenu") ) |
866 | static_cast<QPopupMenu*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); | 869 | static_cast<Q3PopupMenu*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); |
867 | else if ( w->inherits("QMenuBar") ) | 870 | else if ( w->inherits("QMenuBar") ) |
868 | static_cast<QMenuBar*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); | 871 | static_cast<QMenuBar*>(w)->setItemEnabled( itemId( i ), d->isEnabled() ); |
869 | else if ( w->inherits( "KToolBar" ) ) | 872 | else if ( w->inherits( "KToolBar" ) ) |
870 | { | 873 | { |
@@ -905,12 +908,12 @@ void KAction::setText( const QString& text ) | |||
905 | void KAction::updateText( int i ) | 908 | void KAction::updateText( int i ) |
906 | { | 909 | { |
907 | QWidget *w = container( i ); | 910 | QWidget *w = container( i ); |
908 | 911 | ||
909 | if ( w->inherits( "QPopupMenu" ) ) { | 912 | if ( w->inherits( "Q3PopupMenu" ) ) { |
910 | int id = itemId( i ); | 913 | int id = itemId( i ); |
911 | static_cast<QPopupMenu*>(w)->changeItem( id, d->text() ); | 914 | static_cast<Q3PopupMenu*>(w)->changeItem( id, d->text() ); |
912 | updateShortcut( static_cast<QPopupMenu*>(w), id ); | 915 | updateShortcut( static_cast<Q3PopupMenu*>(w), id ); |
913 | } | 916 | } |
914 | else if ( w->inherits( "QMenuBar" ) ) | 917 | else if ( w->inherits( "QMenuBar" ) ) |
915 | static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() ); | 918 | static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() ); |
916 | else if ( w->inherits( "KToolBar" ) ) | 919 | else if ( w->inherits( "KToolBar" ) ) |
@@ -946,18 +949,18 @@ void KAction::setIcon( const QString &icon ) | |||
946 | void KAction::updateIcon( int id ) | 949 | void KAction::updateIcon( int id ) |
947 | { | 950 | { |
948 | QWidget* w = container( id ); | 951 | QWidget* w = container( id ); |
949 | 952 | ||
950 | if ( w->inherits( "QPopupMenu" ) ) { | 953 | if ( w->inherits( "Q3PopupMenu" ) ) { |
951 | int itemId_ = itemId( id ); | 954 | int itemId_ = itemId( id ); |
952 | static_cast<QPopupMenu*>(w)->changeItem( itemId_, d->iconSet( KIcon::Small ), d->text() ); | 955 | static_cast<Q3PopupMenu*>(w)->changeItem( itemId_, d->iconSet( KIcon::Small ), d->text() ); |
953 | updateShortcut( static_cast<QPopupMenu*>(w), itemId_ ); | 956 | updateShortcut( static_cast<Q3PopupMenu*>(w), itemId_ ); |
954 | } | 957 | } |
955 | else if ( w->inherits( "QMenuBar" ) ) | 958 | else if ( w->inherits( "QMenuBar" ) ) |
956 | static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet( KIcon::Small ), d->text() ); | 959 | static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet( KIcon::Small ), d->text() ); |
957 | else if ( w->inherits( "KToolBar" ) ) | 960 | else if ( w->inherits( "KToolBar" ) ) |
958 | static_cast<KToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); | 961 | static_cast<KToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); |
959 | else if ( w->inherits( "QToolBar" ) ) | 962 | else if ( w->inherits( "Q3ToolBar" ) ) |
960 | { | 963 | { |
961 | qDebug("KAction::updateIcon has top be fixed"); | 964 | qDebug("KAction::updateIcon has top be fixed"); |
962 | //US static_cast<QToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); | 965 | //US static_cast<QToolBar *>(w)->setButtonIcon( itemId( id ), d->iconName() ); |
963 | } | 966 | } |
@@ -967,9 +970,9 @@ QString KAction::icon() const | |||
967 | { | 970 | { |
968 | return d->iconName( ); | 971 | return d->iconName( ); |
969 | } | 972 | } |
970 | 973 | ||
971 | void KAction::setIconSet( const QIconSet &iconset ) | 974 | void KAction::setIconSet( const QIcon &iconset ) |
972 | { | 975 | { |
973 | d->setIconSet( iconset ); | 976 | d->setIconSet( iconset ); |
974 | 977 | ||
975 | int len = containerCount(); | 978 | int len = containerCount(); |
@@ -981,13 +984,13 @@ void KAction::setIconSet( const QIconSet &iconset ) | |||
981 | void KAction::updateIconSet( int id ) | 984 | void KAction::updateIconSet( int id ) |
982 | { | 985 | { |
983 | QWidget *w = container( id ); | 986 | QWidget *w = container( id ); |
984 | 987 | ||
985 | if ( w->inherits( "QPopupMenu" ) ) | 988 | if ( w->inherits( "Q3PopupMenu" ) ) |
986 | { | 989 | { |
987 | int itemId_ = itemId( id ); | 990 | int itemId_ = itemId( id ); |
988 | static_cast<QPopupMenu*>(w)->changeItem( itemId_, d->iconSet(), d->text() ); | 991 | static_cast<Q3PopupMenu*>(w)->changeItem( itemId_, d->iconSet(), d->text() ); |
989 | updateShortcut( static_cast<QPopupMenu*>(w), itemId_ ); | 992 | updateShortcut( static_cast<Q3PopupMenu*>(w), itemId_ ); |
990 | } | 993 | } |
991 | else if ( w->inherits( "QMenuBar" ) ) | 994 | else if ( w->inherits( "QMenuBar" ) ) |
992 | static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet(), d->text() ); | 995 | static_cast<QMenuBar*>(w)->changeItem( itemId( id ), d->iconSet(), d->text() ); |
993 | else if ( w->inherits( "KToolBar" ) ) | 996 | else if ( w->inherits( "KToolBar" ) ) |
@@ -998,9 +1001,9 @@ void KAction::updateIconSet( int id ) | |||
998 | static_cast<KToolBar *>(w)->setButtonIconSet( itemId( id ), d->iconSet( KIcon::Small ) ); | 1001 | static_cast<KToolBar *>(w)->setButtonIconSet( itemId( id ), d->iconSet( KIcon::Small ) ); |
999 | } | 1002 | } |
1000 | } | 1003 | } |
1001 | 1004 | ||
1002 | QIconSet KAction::iconSet( KIcon::Group group, int size ) const | 1005 | QIcon KAction::iconSet( KIcon::Group group, int size ) const |
1003 | { | 1006 | { |
1004 | return d->iconSet( group, size ); | 1007 | return d->iconSet( group, size ); |
1005 | } | 1008 | } |
1006 | 1009 | ||
@@ -1021,9 +1024,9 @@ void KAction::setWhatsThis( const QString& text ) | |||
1021 | 1024 | ||
1022 | void KAction::updateWhatsThis( int i ) | 1025 | void KAction::updateWhatsThis( int i ) |
1023 | { | 1026 | { |
1024 | qDebug("KAction::updateWhatsThis ...1 has top be fixed"); | 1027 | qDebug("KAction::updateWhatsThis ...1 has top be fixed"); |
1025 | QPopupMenu* pm = popupMenu( i ); | 1028 | Q3PopupMenu* pm = popupMenu( i ); |
1026 | if ( pm ) | 1029 | if ( pm ) |
1027 | { | 1030 | { |
1028 | pm->setWhatsThis( itemId( i ), d->whatsThis() ); | 1031 | pm->setWhatsThis( itemId( i ), d->whatsThis() ); |
1029 | return; | 1032 | return; |
@@ -1063,12 +1066,12 @@ KToolBar* KAction::toolBar( int index ) const | |||
1063 | //US return dynamic_cast<KToolBar *>( d->m_containers[ index ].m_container ); | 1066 | //US return dynamic_cast<KToolBar *>( d->m_containers[ index ].m_container ); |
1064 | return (KToolBar *)( d->m_containers[ index ].m_container ); | 1067 | return (KToolBar *)( d->m_containers[ index ].m_container ); |
1065 | } | 1068 | } |
1066 | 1069 | ||
1067 | QPopupMenu* KAction::popupMenu( int index ) const | 1070 | Q3PopupMenu* KAction::popupMenu( int index ) const |
1068 | { | 1071 | { |
1069 | //US return dynamic_cast<QPopupMenu *>( d->m_containers[ index ].m_container ); | 1072 | //US return dynamic_cast<QPopupMenu *>( d->m_containers[ index ].m_container ); |
1070 | return (QPopupMenu *)( d->m_containers[ index ].m_container ); | 1073 | return (Q3PopupMenu *)( d->m_containers[ index ].m_container ); |
1071 | } | 1074 | } |
1072 | 1075 | ||
1073 | QWidget* KAction::representative( int index ) const | 1076 | QWidget* KAction::representative( int index ) const |
1074 | { | 1077 | { |
@@ -1154,9 +1157,9 @@ void KAction::slotDestroyed() | |||
1154 | 1157 | ||
1155 | int KAction::findContainer( const QWidget* widget ) const | 1158 | int KAction::findContainer( const QWidget* widget ) const |
1156 | { | 1159 | { |
1157 | int pos = 0; | 1160 | int pos = 0; |
1158 | QValueList<KActionPrivate::Container>::ConstIterator it = d->m_containers.begin(); | 1161 | Q3ValueList<KActionPrivate::Container>::ConstIterator it = d->m_containers.begin(); |
1159 | while( it != d->m_containers.end() ) | 1162 | while( it != d->m_containers.end() ) |
1160 | { | 1163 | { |
1161 | if ( (*it).m_representative == widget || (*it).m_container == widget ) | 1164 | if ( (*it).m_representative == widget || (*it).m_container == widget ) |
1162 | return pos; | 1165 | return pos; |
@@ -1169,9 +1172,9 @@ int KAction::findContainer( const QWidget* widget ) const | |||
1169 | 1172 | ||
1170 | void KAction::removeContainer( int index ) | 1173 | void KAction::removeContainer( int index ) |
1171 | { | 1174 | { |
1172 | int i = 0; | 1175 | int i = 0; |
1173 | QValueList<KActionPrivate::Container>::Iterator it = d->m_containers.begin(); | 1176 | Q3ValueList<KActionPrivate::Container>::Iterator it = d->m_containers.begin(); |
1174 | while( it != d->m_containers.end() ) | 1177 | while( it != d->m_containers.end() ) |
1175 | { | 1178 | { |
1176 | if ( i == index ) | 1179 | if ( i == index ) |
1177 | { | 1180 | { |
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 | |||
@@ -28,10 +28,12 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | //US #include <qkeysequence.h> | 30 | //US #include <qkeysequence.h> |
31 | #include <qobject.h> | 31 | #include <qobject.h> |
32 | #include <qvaluelist.h> | 32 | #include <q3valuelist.h> |
33 | #include <qguardedptr.h> | 33 | #include <qpointer.h> |
34 | //Added by qt3to4: | ||
35 | #include <Q3PopupMenu> | ||
34 | #include <kguiitem.h> | 36 | #include <kguiitem.h> |
35 | #include <kshortcut.h> | 37 | #include <kshortcut.h> |
36 | #include <kstdaction.h> | 38 | #include <kstdaction.h> |
37 | //US#include <kicontheme.h> | 39 | //US#include <kicontheme.h> |
@@ -39,12 +41,12 @@ | |||
39 | //US added the following files | 41 | //US added the following files |
40 | #include <kiconloader.h> | 42 | #include <kiconloader.h> |
41 | 43 | ||
42 | class QMenuBar; | 44 | class QMenuBar; |
43 | class QPopupMenu; | 45 | class Q3PopupMenu; |
44 | //USclass QComboBox; | 46 | //USclass QComboBox; |
45 | //USclass QPoint; | 47 | //USclass QPoint; |
46 | class QIconSet; | 48 | class QIcon; |
47 | class QString; | 49 | class QString; |
48 | class KToolBar; | 50 | class KToolBar; |
49 | 51 | ||
50 | class KAccel; | 52 | class KAccel; |
@@ -258,9 +260,9 @@ public: | |||
258 | * @param parent This action's parent. | 260 | * @param parent This action's parent. |
259 | * @param name An internal name for this action. | 261 | * @param name An internal name for this action. |
260 | */ | 262 | */ |
261 | 263 | ||
262 | KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 264 | KAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
263 | const QObject* receiver, const char* slot, | 265 | const QObject* receiver, const char* slot, |
264 | KActionCollection* parent, const char* name ); | 266 | KActionCollection* parent, const char* name ); |
265 | 267 | ||
266 | /** | 268 | /** |
@@ -307,9 +309,9 @@ public: | |||
307 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); | 309 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); |
308 | /** | 310 | /** |
309 | * @obsolete | 311 | * @obsolete |
310 | */ | 312 | */ |
311 | KAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), | 313 | KAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), |
312 | QObject* parent = 0, const char* name = 0 ); | 314 | QObject* parent = 0, const char* name = 0 ); |
313 | /** | 315 | /** |
314 | * @obsolete | 316 | * @obsolete |
315 | */ | 317 | */ |
@@ -317,9 +319,9 @@ public: | |||
317 | QObject* parent = 0, const char* name = 0 ); | 319 | QObject* parent = 0, const char* name = 0 ); |
318 | /** | 320 | /** |
319 | * @obsolete | 321 | * @obsolete |
320 | */ | 322 | */ |
321 | KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 323 | KAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
322 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); | 324 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); |
323 | /** | 325 | /** |
324 | * @obsolete | 326 | * @obsolete |
325 | */ | 327 | */ |
@@ -460,12 +462,12 @@ public: | |||
460 | /** | 462 | /** |
461 | * Get the QIconSet from which the icons used to display this action will | 463 | * Get the QIconSet from which the icons used to display this action will |
462 | * be chosen. | 464 | * be chosen. |
463 | */ | 465 | */ |
464 | virtual QIconSet iconSet( KIcon::Group group, int size=0 ) const; | 466 | virtual QIcon iconSet( KIcon::Group group, int size=0 ) const; |
465 | 467 | ||
466 | #ifndef KDE_NO_COMPAT | 468 | #ifndef KDE_NO_COMPAT |
467 | QIconSet iconSet() const | 469 | QIcon iconSet() const |
468 | { | 470 | { |
469 | return iconSet( KIcon::Small ); | 471 | return iconSet( KIcon::Small ); |
470 | } | 472 | } |
471 | #endif | 473 | #endif |
@@ -517,9 +519,9 @@ public slots: | |||
517 | /** | 519 | /** |
518 | * Sets the QIconSet from which the icons used to display this action will | 520 | * Sets the QIconSet from which the icons used to display this action will |
519 | * be chosen. | 521 | * be chosen. |
520 | */ | 522 | */ |
521 | virtual void setIconSet( const QIconSet &iconSet ); | 523 | virtual void setIconSet( const QIcon &iconSet ); |
522 | 524 | ||
523 | virtual void setIcon( const QString& icon ); | 525 | virtual void setIcon( const QString& icon ); |
524 | 526 | ||
525 | /** | 527 | /** |
@@ -545,18 +547,18 @@ protected slots: | |||
545 | virtual void slotActivated(); | 547 | virtual void slotActivated(); |
546 | 548 | ||
547 | protected: | 549 | protected: |
548 | KToolBar* toolBar( int index ) const; | 550 | KToolBar* toolBar( int index ) const; |
549 | QPopupMenu* popupMenu( int index ) const; | 551 | Q3PopupMenu* popupMenu( int index ) const; |
550 | void removeContainer( int index ); | 552 | void removeContainer( int index ); |
551 | int findContainer( const QWidget* widget ) const; | 553 | int findContainer( const QWidget* widget ) const; |
552 | void plugMainWindowAccel( QWidget *w ); | 554 | void plugMainWindowAccel( QWidget *w ); |
553 | 555 | ||
554 | void addContainer( QWidget* parent, int id ); | 556 | void addContainer( QWidget* parent, int id ); |
555 | void addContainer( QWidget* parent, QWidget* representative ); | 557 | void addContainer( QWidget* parent, QWidget* representative ); |
556 | 558 | ||
557 | virtual void updateShortcut( int i ); | 559 | virtual void updateShortcut( int i ); |
558 | virtual void updateShortcut( QPopupMenu* menu, int id ); | 560 | virtual void updateShortcut( Q3PopupMenu* menu, int id ); |
559 | virtual void updateGroup( int id ); | 561 | virtual void updateGroup( int id ); |
560 | virtual void updateText(int i ); | 562 | virtual void updateText(int i ); |
561 | virtual void updateEnabled(int i); | 563 | virtual void updateEnabled(int i); |
562 | virtual void updateIconSet(int i); | 564 | virtual void updateIconSet(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 | |||
@@ -27,11 +27,13 @@ | |||
27 | 27 | ||
28 | #include <assert.h> | 28 | #include <assert.h> |
29 | 29 | ||
30 | #include <qfontdatabase.h> | 30 | #include <qfontdatabase.h> |
31 | #include <qobjectlist.h> | 31 | #include <qobject.h> |
32 | //US#include <qwhatsthis.h> | 32 | //US#include <qwhatsthis.h> |
33 | #include <qtimer.h> | 33 | #include <qtimer.h> |
34 | //Added by qt3to4: | ||
35 | #include <Q3ValueList> | ||
34 | 36 | ||
35 | //US#include <kaccel.h> | 37 | //US#include <kaccel.h> |
36 | //US#include <kapplication.h> | 38 | //US#include <kapplication.h> |
37 | #include <kconfig.h> | 39 | #include <kconfig.h> |
@@ -47,15 +49,15 @@ | |||
47 | 49 | ||
48 | //US added the following includefiles | 50 | //US added the following includefiles |
49 | #include <kconfigbase.h> | 51 | #include <kconfigbase.h> |
50 | #include <qwidget.h> | 52 | #include <qwidget.h> |
51 | #include <qpopupmenu.h> | 53 | #include <q3popupmenu.h> |
52 | #include <qmenubar.h> | 54 | #include <qmenubar.h> |
53 | #include <qmainwindow.h> | 55 | #include <q3mainwindow.h> |
54 | #include <qtoolbar.h> | 56 | #include <q3toolbar.h> |
55 | #include <qcombobox.h> | 57 | #include <qcombobox.h> |
56 | #include <qmainwindow.h> | 58 | #include <q3mainwindow.h> |
57 | 59 | #include <qcoreapplication.h> | |
58 | 60 | ||
59 | static QFontDatabase *fontDataBase = 0; | 61 | static QFontDatabase *fontDataBase = 0; |
60 | 62 | ||
61 | static void cleanupFontDatabase() | 63 | static void cleanupFontDatabase() |
@@ -82,9 +84,9 @@ static void get_fonts( QStringList &lst ) | |||
82 | } | 84 | } |
83 | lst.sort(); | 85 | lst.sort(); |
84 | } | 86 | } |
85 | 87 | ||
86 | static QValueList<int> get_standard_font_sizes() | 88 | static Q3ValueList<int> get_standard_font_sizes() |
87 | { | 89 | { |
88 | if ( !fontDataBase ) { | 90 | if ( !fontDataBase ) { |
89 | fontDataBase = new QFontDatabase(); | 91 | fontDataBase = new QFontDatabase(); |
90 | qAddPostRoutine( cleanupFontDatabase ); | 92 | qAddPostRoutine( cleanupFontDatabase ); |
@@ -119,9 +121,9 @@ KToggleAction::KToggleAction( const QString& text, const KShortcut& cut, | |||
119 | { | 121 | { |
120 | d = new KToggleActionPrivate; | 122 | d = new KToggleActionPrivate; |
121 | } | 123 | } |
122 | 124 | ||
123 | KToggleAction::KToggleAction( const QString& text, const QIconSet& pix, | 125 | KToggleAction::KToggleAction( const QString& text, const QIcon& pix, |
124 | const KShortcut& cut, | 126 | const KShortcut& cut, |
125 | QObject* parent, const char* name ) | 127 | QObject* parent, const char* name ) |
126 | : KAction( text, pix, cut, parent, name ) | 128 | : KAction( text, pix, cut, parent, name ) |
127 | { | 129 | { |
@@ -135,9 +137,9 @@ KToggleAction::KToggleAction( const QString& text, const QString& pix, | |||
135 | { | 137 | { |
136 | d = new KToggleActionPrivate; | 138 | d = new KToggleActionPrivate; |
137 | } | 139 | } |
138 | 140 | ||
139 | KToggleAction::KToggleAction( const QString& text, const QIconSet& pix, | 141 | KToggleAction::KToggleAction( const QString& text, const QIcon& pix, |
140 | const KShortcut& cut, | 142 | const KShortcut& cut, |
141 | const QObject* receiver, | 143 | const QObject* receiver, |
142 | const char* slot, QObject* parent, | 144 | const char* slot, QObject* parent, |
143 | const char* name ) | 145 | const char* name ) |
@@ -168,9 +170,9 @@ KToggleAction::~KToggleAction() | |||
168 | } | 170 | } |
169 | 171 | ||
170 | int KToggleAction::plug( QWidget* widget, int index ) | 172 | int KToggleAction::plug( QWidget* widget, int index ) |
171 | { | 173 | { |
172 | if ( !widget->inherits("QPopupMenu") && !widget->inherits("KToolBar") ) | 174 | if ( !widget->inherits("Q3PopupMenu") && !widget->inherits("KToolBar") ) |
173 | { | 175 | { |
174 | kdWarning() << "Can not plug KToggleAction in " << widget->className() << endl; | 176 | kdWarning() << "Can not plug KToggleAction in " << widget->className() << endl; |
175 | return -1; | 177 | return -1; |
176 | } | 178 | } |
@@ -183,13 +185,13 @@ int KToggleAction::plug( QWidget* widget, int index ) | |||
183 | int _index = KAction::plug( widget, index ); | 185 | int _index = KAction::plug( widget, index ); |
184 | if ( _index == -1 ) | 186 | if ( _index == -1 ) |
185 | return _index; | 187 | return _index; |
186 | 188 | ||
187 | if ( widget->inherits("QPopupMenu") ) | 189 | if ( widget->inherits("Q3PopupMenu") ) |
188 | { | 190 | { |
189 | int id = itemId( _index ); | 191 | int id = itemId( _index ); |
190 | 192 | ||
191 | static_cast<QPopupMenu*>(widget)->setItemChecked( id, d->m_checked ); | 193 | static_cast<Q3PopupMenu*>(widget)->setItemChecked( id, d->m_checked ); |
192 | } else if ( widget->inherits( "KToolBar" ) ) { | 194 | } else if ( widget->inherits( "KToolBar" ) ) { |
193 | 195 | ||
194 | KToolBar *bar = static_cast<KToolBar *>( widget ); | 196 | KToolBar *bar = static_cast<KToolBar *>( widget ); |
195 | 197 | ||
@@ -213,15 +215,14 @@ void KToggleAction::setChecked( bool c ) | |||
213 | for( int i = 0; i < len; ++i ) | 215 | for( int i = 0; i < len; ++i ) |
214 | updateChecked( i ); | 216 | updateChecked( i ); |
215 | 217 | ||
216 | if ( c && parent() && !exclusiveGroup().isEmpty() ) { | 218 | if ( c && parent() && !exclusiveGroup().isEmpty() ) { |
217 | const QObjectList *list = parent()->children(); | 219 | const QObjectList list = parent()->children(); |
218 | if ( list ) { | 220 | if ( !list.empty() ) { |
219 | QObjectListIt it( *list ); | 221 | for(QObjectList::const_iterator it=list.begin();it!=list.end();++it) { |
220 | for( ; it.current(); ++it ) { | 222 | if ( (*it)->inherits( "KToggleAction" ) && (*it) != this && |
221 | if ( it.current()->inherits( "KToggleAction" ) && it.current() != this && | 223 | static_cast<KToggleAction*>((*it))->exclusiveGroup() == exclusiveGroup() ) { |
222 | static_cast<KToggleAction*>(it.current())->exclusiveGroup() == exclusiveGroup() ) { | 224 | KToggleAction *a = static_cast<KToggleAction*>(*it); |
223 | KToggleAction *a = static_cast<KToggleAction*>(it.current()); | ||
224 | if( a->isChecked() ) { | 225 | if( a->isChecked() ) { |
225 | a->setChecked( false ); | 226 | a->setChecked( false ); |
226 | emit a->toggled( false ); | 227 | emit a->toggled( false ); |
227 | } | 228 | } |
@@ -234,10 +235,10 @@ void KToggleAction::setChecked( bool c ) | |||
234 | void KToggleAction::updateChecked( int id ) | 235 | void KToggleAction::updateChecked( int id ) |
235 | { | 236 | { |
236 | QWidget *w = container( id ); | 237 | QWidget *w = container( id ); |
237 | 238 | ||
238 | if ( w->inherits( "QPopupMenu" ) ) | 239 | if ( w->inherits( "Q3PopupMenu" ) ) |
239 | static_cast<QPopupMenu*>(w)->setItemChecked( itemId( id ), d->m_checked ); | 240 | static_cast<Q3PopupMenu*>(w)->setItemChecked( itemId( id ), d->m_checked ); |
240 | else if ( w->inherits( "QMenuBar" ) ) | 241 | else if ( w->inherits( "QMenuBar" ) ) |
241 | static_cast<QMenuBar*>(w)->setItemChecked( itemId( id ), d->m_checked ); | 242 | static_cast<QMenuBar*>(w)->setItemChecked( itemId( id ), d->m_checked ); |
242 | else if ( w->inherits( "KToolBar" ) ) | 243 | else if ( w->inherits( "KToolBar" ) ) |
243 | { | 244 | { |
@@ -282,9 +283,9 @@ KRadioAction::KRadioAction( const QString& text, const KShortcut& cut, | |||
282 | : KToggleAction( text, cut, receiver, slot, parent, name ) | 283 | : KToggleAction( text, cut, receiver, slot, parent, name ) |
283 | { | 284 | { |
284 | } | 285 | } |
285 | 286 | ||
286 | KRadioAction::KRadioAction( const QString& text, const QIconSet& pix, | 287 | KRadioAction::KRadioAction( const QString& text, const QIcon& pix, |
287 | const KShortcut& cut, | 288 | const KShortcut& cut, |
288 | QObject* parent, const char* name ) | 289 | QObject* parent, const char* name ) |
289 | : KToggleAction( text, pix, cut, parent, name ) | 290 | : KToggleAction( text, pix, cut, parent, name ) |
290 | { | 291 | { |
@@ -296,9 +297,9 @@ KRadioAction::KRadioAction( const QString& text, const QString& pix, | |||
296 | : KToggleAction( text, pix, cut, parent, name ) | 297 | : KToggleAction( text, pix, cut, parent, name ) |
297 | { | 298 | { |
298 | } | 299 | } |
299 | 300 | ||
300 | KRadioAction::KRadioAction( const QString& text, const QIconSet& pix, | 301 | KRadioAction::KRadioAction( const QString& text, const QIcon& pix, |
301 | const KShortcut& cut, | 302 | const KShortcut& cut, |
302 | const QObject* receiver, const char* slot, | 303 | const QObject* receiver, const char* slot, |
303 | QObject* parent, const char* name ) | 304 | QObject* parent, const char* name ) |
304 | : KToggleAction( text, pix, cut, receiver, slot, parent, name ) | 305 | : KToggleAction( text, pix, cut, receiver, slot, parent, name ) |
@@ -348,9 +349,9 @@ public: | |||
348 | m_comboWidth = -1; | 349 | m_comboWidth = -1; |
349 | } | 350 | } |
350 | bool m_edit; | 351 | bool m_edit; |
351 | bool m_menuAccelsEnabled; | 352 | bool m_menuAccelsEnabled; |
352 | QPopupMenu *m_menu; | 353 | Q3PopupMenu *m_menu; |
353 | int m_current; | 354 | int m_current; |
354 | int m_comboWidth; | 355 | int m_comboWidth; |
355 | QStringList m_list; | 356 | QStringList m_list; |
356 | 357 | ||
@@ -386,9 +387,9 @@ KSelectAction::KSelectAction( const QString& text, const KShortcut& cut, | |||
386 | { | 387 | { |
387 | d = new KSelectActionPrivate; | 388 | d = new KSelectActionPrivate; |
388 | } | 389 | } |
389 | 390 | ||
390 | KSelectAction::KSelectAction( const QString& text, const QIconSet& pix, | 391 | KSelectAction::KSelectAction( const QString& text, const QIcon& pix, |
391 | const KShortcut& cut, | 392 | const KShortcut& cut, |
392 | QObject* parent, const char* name ) | 393 | QObject* parent, const char* name ) |
393 | : KAction( text, pix, cut, parent, name ) | 394 | : KAction( text, pix, cut, parent, name ) |
394 | { | 395 | { |
@@ -402,9 +403,9 @@ KSelectAction::KSelectAction( const QString& text, const QString& pix, | |||
402 | { | 403 | { |
403 | d = new KSelectActionPrivate; | 404 | d = new KSelectActionPrivate; |
404 | } | 405 | } |
405 | 406 | ||
406 | KSelectAction::KSelectAction( const QString& text, const QIconSet& pix, | 407 | KSelectAction::KSelectAction( const QString& text, const QIcon& pix, |
407 | const KShortcut& cut, | 408 | const KShortcut& cut, |
408 | const QObject* receiver, | 409 | const QObject* receiver, |
409 | const char* slot, QObject* parent, | 410 | const char* slot, QObject* parent, |
410 | const char* name ) | 411 | const char* name ) |
@@ -438,9 +439,9 @@ KSelectAction::~KSelectAction() | |||
438 | 439 | ||
439 | void KSelectAction::setCurrentItem( int id ) | 440 | void KSelectAction::setCurrentItem( int id ) |
440 | { | 441 | { |
441 | if ( id >= (int)d->m_list.count() ) { | 442 | if ( id >= (int)d->m_list.count() ) { |
442 | ASSERT(id < (int)d->m_list.count()); | 443 | Q_ASSERT(id < (int)d->m_list.count()); |
443 | return; | 444 | return; |
444 | } | 445 | } |
445 | 446 | ||
446 | if ( d->m_menu ) | 447 | if ( d->m_menu ) |
@@ -478,15 +479,15 @@ void KSelectAction::setComboWidth( int width ) | |||
478 | for( int i = 0; i < len; ++i ) | 479 | for( int i = 0; i < len; ++i ) |
479 | updateComboWidth( i ); | 480 | updateComboWidth( i ); |
480 | 481 | ||
481 | } | 482 | } |
482 | QPopupMenu* KSelectAction::popupMenu() const | 483 | Q3PopupMenu* KSelectAction::popupMenu() const |
483 | { | 484 | { |
484 | kdDebug(129) << "KSelectAction::popupMenu()" << endl; // remove -- ellis | 485 | kdDebug(129) << "KSelectAction::popupMenu()" << endl; // remove -- ellis |
485 | if ( !d->m_menu ) | 486 | if ( !d->m_menu ) |
486 | { | 487 | { |
487 | //US d->m_menu = new KPopupMenu(0L, "KSelectAction::popupMenu()"); | 488 | //US d->m_menu = new KPopupMenu(0L, "KSelectAction::popupMenu()"); |
488 | d->m_menu = new QPopupMenu(0L, "QSelectAction::popupMenu()"); | 489 | d->m_menu = new Q3PopupMenu(0L, "QSelectAction::popupMenu()"); |
489 | setupMenu(); | 490 | setupMenu(); |
490 | if ( d->m_current >= 0 ) | 491 | if ( d->m_current >= 0 ) |
491 | d->m_menu->setItemChecked( d->m_current, true ); | 492 | d->m_menu->setItemChecked( d->m_current, true ); |
492 | } | 493 | } |
@@ -642,14 +643,14 @@ int KSelectAction::plug( QWidget *widget, int index ) | |||
642 | //US if (kapp && !kapp->authorizeKAction(name())) | 643 | //US if (kapp && !kapp->authorizeKAction(name())) |
643 | //US return -1; | 644 | //US return -1; |
644 | 645 | ||
645 | kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis | 646 | kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis |
646 | if ( widget->inherits("QPopupMenu") ) | 647 | if ( widget->inherits("Q3PopupMenu") ) |
647 | { | 648 | { |
648 | // Create the PopupMenu and store it in m_menu | 649 | // Create the PopupMenu and store it in m_menu |
649 | (void)popupMenu(); | 650 | (void)popupMenu(); |
650 | 651 | ||
651 | QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); | 652 | Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); |
652 | int id; | 653 | int id; |
653 | 654 | ||
654 | if ( hasIconSet() ) | 655 | if ( hasIconSet() ) |
655 | id = menu->insertItem( iconSet(), text(), d->m_menu, -1, index ); | 656 | id = menu->insertItem( iconSet(), text(), d->m_menu, -1, index ); |
@@ -681,9 +682,9 @@ int KSelectAction::plug( QWidget *widget, int index ) | |||
681 | KComboBox *cb = bar->getCombo( id_ ); | 682 | KComboBox *cb = bar->getCombo( id_ ); |
682 | if ( cb ) | 683 | if ( cb ) |
683 | { | 684 | { |
684 | cb->setMaximumHeight( 34 ); | 685 | cb->setMaximumHeight( 34 ); |
685 | if (!isEditable()) cb->setFocusPolicy(QWidget::NoFocus); | 686 | if (!isEditable()) cb->setFocusPolicy(Qt::NoFocus); |
686 | cb->setMinimumWidth( cb->sizeHint().width() ); | 687 | cb->setMinimumWidth( cb->sizeHint().width() ); |
687 | if ( d->m_comboWidth > 0 ) | 688 | if ( d->m_comboWidth > 0 ) |
688 | { | 689 | { |
689 | cb->setMinimumWidth( d->m_comboWidth ); | 690 | cb->setMinimumWidth( d->m_comboWidth ); |
@@ -851,9 +852,9 @@ KListAction::KListAction( const QString& text, const KShortcut& cut, | |||
851 | if ( receiver ) | 852 | if ( receiver ) |
852 | connect( this, SIGNAL( activated( int ) ), receiver, slot ); | 853 | connect( this, SIGNAL( activated( int ) ), receiver, slot ); |
853 | } | 854 | } |
854 | 855 | ||
855 | KListAction::KListAction( const QString& text, const QIconSet& pix, | 856 | KListAction::KListAction( const QString& text, const QIcon& pix, |
856 | const KShortcut& cut, | 857 | const KShortcut& cut, |
857 | QObject* parent, const char* name ) | 858 | QObject* parent, const char* name ) |
858 | : KSelectAction( text, pix, cut, parent, name ) | 859 | : KSelectAction( text, pix, cut, parent, name ) |
859 | { | 860 | { |
@@ -867,9 +868,9 @@ KListAction::KListAction( const QString& text, const QString& pix, | |||
867 | { | 868 | { |
868 | d = new KListActionPrivate; | 869 | d = new KListActionPrivate; |
869 | } | 870 | } |
870 | 871 | ||
871 | KListAction::KListAction( const QString& text, const QIconSet& pix, | 872 | KListAction::KListAction( const QString& text, const QIcon& pix, |
872 | const KShortcut& cut, const QObject* receiver, | 873 | const KShortcut& cut, const QObject* receiver, |
873 | const char* slot, QObject* parent, | 874 | const char* slot, QObject* parent, |
874 | const char* name ) | 875 | const char* name ) |
875 | : KSelectAction( text, pix, cut, parent, name ) | 876 | : KSelectAction( text, pix, cut, parent, name ) |
@@ -964,9 +965,9 @@ KRecentFilesAction::KRecentFilesAction( const QString& text, | |||
964 | receiver, slot ); | 965 | receiver, slot ); |
965 | } | 966 | } |
966 | 967 | ||
967 | KRecentFilesAction::KRecentFilesAction( const QString& text, | 968 | KRecentFilesAction::KRecentFilesAction( const QString& text, |
968 | const QIconSet& pix, | 969 | const QIcon& pix, |
969 | const KShortcut& cut, | 970 | const KShortcut& cut, |
970 | QObject* parent, const char* name, | 971 | QObject* parent, const char* name, |
971 | uint maxItems ) | 972 | uint maxItems ) |
972 | : KListAction( text, pix, cut, parent, name) | 973 | : KListAction( text, pix, cut, parent, name) |
@@ -990,9 +991,9 @@ KRecentFilesAction::KRecentFilesAction( const QString& text, | |||
990 | init(); | 991 | init(); |
991 | } | 992 | } |
992 | 993 | ||
993 | KRecentFilesAction::KRecentFilesAction( const QString& text, | 994 | KRecentFilesAction::KRecentFilesAction( const QString& text, |
994 | const QIconSet& pix, | 995 | const QIcon& pix, |
995 | const KShortcut& cut, | 996 | const KShortcut& cut, |
996 | const QObject* receiver, | 997 | const QObject* receiver, |
997 | const char* slot, | 998 | const char* slot, |
998 | QObject* parent, const char* name, | 999 | QObject* parent, const char* name, |
@@ -1200,9 +1201,9 @@ KFontAction::KFontAction( const QString& text, const KShortcut& cut, | |||
1200 | KSelectAction::setItems( d->m_fonts ); | 1201 | KSelectAction::setItems( d->m_fonts ); |
1201 | setEditable( true ); | 1202 | setEditable( true ); |
1202 | } | 1203 | } |
1203 | 1204 | ||
1204 | KFontAction::KFontAction( const QString& text, const QIconSet& pix, | 1205 | KFontAction::KFontAction( const QString& text, const QIcon& pix, |
1205 | const KShortcut& cut, | 1206 | const KShortcut& cut, |
1206 | QObject* parent, const char* name ) | 1207 | QObject* parent, const char* name ) |
1207 | : KSelectAction( text, pix, cut, parent, name ) | 1208 | : KSelectAction( text, pix, cut, parent, name ) |
1208 | { | 1209 | { |
@@ -1222,9 +1223,9 @@ KFontAction::KFontAction( const QString& text, const QString& pix, | |||
1222 | KSelectAction::setItems( d->m_fonts ); | 1223 | KSelectAction::setItems( d->m_fonts ); |
1223 | setEditable( true ); | 1224 | setEditable( true ); |
1224 | } | 1225 | } |
1225 | 1226 | ||
1226 | KFontAction::KFontAction( const QString& text, const QIconSet& pix, | 1227 | KFontAction::KFontAction( const QString& text, const QIcon& pix, |
1227 | const KShortcut& cut, | 1228 | const KShortcut& cut, |
1228 | const QObject* receiver, const char* slot, | 1229 | const QObject* receiver, const char* slot, |
1229 | QObject* parent, const char* name ) | 1230 | QObject* parent, const char* name ) |
1230 | : KSelectAction( text, pix, cut, receiver, slot, parent, name ) | 1231 | : KSelectAction( text, pix, cut, receiver, slot, parent, name ) |
@@ -1360,9 +1361,9 @@ KFontSizeAction::KFontSizeAction( const QString& text, | |||
1360 | { | 1361 | { |
1361 | init(); | 1362 | init(); |
1362 | } | 1363 | } |
1363 | 1364 | ||
1364 | KFontSizeAction::KFontSizeAction( const QString& text, const QIconSet& pix, | 1365 | KFontSizeAction::KFontSizeAction( const QString& text, const QIcon& pix, |
1365 | const KShortcut& cut, | 1366 | const KShortcut& cut, |
1366 | QObject* parent, const char* name ) | 1367 | QObject* parent, const char* name ) |
1367 | : KSelectAction( text, pix, cut, parent, name ) | 1368 | : KSelectAction( text, pix, cut, parent, name ) |
1368 | { | 1369 | { |
@@ -1376,9 +1377,9 @@ KFontSizeAction::KFontSizeAction( const QString& text, const QString& pix, | |||
1376 | { | 1377 | { |
1377 | init(); | 1378 | init(); |
1378 | } | 1379 | } |
1379 | 1380 | ||
1380 | KFontSizeAction::KFontSizeAction( const QString& text, const QIconSet& pix, | 1381 | KFontSizeAction::KFontSizeAction( const QString& text, const QIcon& pix, |
1381 | const KShortcut& cut, | 1382 | const KShortcut& cut, |
1382 | const QObject* receiver, | 1383 | const QObject* receiver, |
1383 | const char* slot, QObject* parent, | 1384 | const char* slot, QObject* parent, |
1384 | const char* name ) | 1385 | const char* name ) |
@@ -1413,11 +1414,11 @@ void KFontSizeAction::init() | |||
1413 | { | 1414 | { |
1414 | d = new KFontSizeActionPrivate; | 1415 | d = new KFontSizeActionPrivate; |
1415 | 1416 | ||
1416 | setEditable( true ); | 1417 | setEditable( true ); |
1417 | QValueList<int> sizes = get_standard_font_sizes(); | 1418 | Q3ValueList<int> sizes = get_standard_font_sizes(); |
1418 | QStringList lst; | 1419 | QStringList lst; |
1419 | for ( QValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it ) | 1420 | for ( Q3ValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it ) |
1420 | lst.append( QString::number( *it ) ); | 1421 | lst.append( QString::number( *it ) ); |
1421 | 1422 | ||
1422 | setItems( lst ); | 1423 | setItems( lst ); |
1423 | } | 1424 | } |
@@ -1436,9 +1437,9 @@ void KFontSizeAction::setFontSize( int size ) | |||
1436 | 1437 | ||
1437 | int index = items().findIndex( QString::number( size ) ); | 1438 | int index = items().findIndex( QString::number( size ) ); |
1438 | if ( index == -1 ) { | 1439 | if ( index == -1 ) { |
1439 | // Insert at the correct position in the list (to keep sorting) | 1440 | // Insert at the correct position in the list (to keep sorting) |
1440 | QValueList<int> lst; | 1441 | Q3ValueList<int> lst; |
1441 | // Convert to list of ints | 1442 | // Convert to list of ints |
1442 | QStringList itemsList = items(); | 1443 | QStringList itemsList = items(); |
1443 | for (QStringList::Iterator it = itemsList.begin() ; it != itemsList.end() ; ++it) | 1444 | for (QStringList::Iterator it = itemsList.begin() ; it != itemsList.end() ; ++it) |
1444 | lst.append( (*it).toInt() ); | 1445 | lst.append( (*it).toInt() ); |
@@ -1449,9 +1450,9 @@ qDebug("KFontSizeAction::setFontSize heapsort not found."); | |||
1449 | //US has to be fixed | 1450 | //US has to be fixed |
1450 | //US qHeapSort( lst ); | 1451 | //US qHeapSort( lst ); |
1451 | // Convert back to string list | 1452 | // Convert back to string list |
1452 | QStringList strLst; | 1453 | QStringList strLst; |
1453 | for (QValueList<int>::Iterator it = lst.begin() ; it != lst.end() ; ++it) | 1454 | for (Q3ValueList<int>::Iterator it = lst.begin() ; it != lst.end() ; ++it) |
1454 | strLst.append( QString::number(*it) ); | 1455 | strLst.append( QString::number(*it) ); |
1455 | KSelectAction::setItems( strLst ); | 1456 | KSelectAction::setItems( strLst ); |
1456 | // Find new current item | 1457 | // Find new current item |
1457 | index = lst.findIndex( size ); | 1458 | index = lst.findIndex( size ); |
@@ -1491,9 +1492,9 @@ class KActionMenu::KActionMenuPrivate | |||
1491 | public: | 1492 | public: |
1492 | KActionMenuPrivate() | 1493 | KActionMenuPrivate() |
1493 | { | 1494 | { |
1494 | //US m_popup = new KPopupMenu(0L,"KActionMenu::KActionMenuPrivate"); | 1495 | //US m_popup = new KPopupMenu(0L,"KActionMenu::KActionMenuPrivate"); |
1495 | m_popup = new QPopupMenu(0L,"KActionMenu::KActionMenuPrivate"); | 1496 | m_popup = new Q3PopupMenu(0L,"KActionMenu::KActionMenuPrivate"); |
1496 | m_delayed = true; | 1497 | m_delayed = true; |
1497 | m_stickyMenu = true; | 1498 | m_stickyMenu = true; |
1498 | } | 1499 | } |
1499 | ~KActionMenuPrivate() | 1500 | ~KActionMenuPrivate() |
@@ -1501,9 +1502,9 @@ public: | |||
1501 | delete m_popup; m_popup = 0; | 1502 | delete m_popup; m_popup = 0; |
1502 | } | 1503 | } |
1503 | 1504 | ||
1504 | //US KPopupMenu *m_popup; | 1505 | //US KPopupMenu *m_popup; |
1505 | QPopupMenu *m_popup; | 1506 | Q3PopupMenu *m_popup; |
1506 | bool m_delayed; | 1507 | bool m_delayed; |
1507 | bool m_stickyMenu; | 1508 | bool m_stickyMenu; |
1508 | }; | 1509 | }; |
1509 | 1510 | ||
@@ -1521,9 +1522,9 @@ KActionMenu::KActionMenu( const QString& text, QObject* parent, | |||
1521 | d = new KActionMenuPrivate; | 1522 | d = new KActionMenuPrivate; |
1522 | setShortcutConfigurable( false ); | 1523 | setShortcutConfigurable( false ); |
1523 | } | 1524 | } |
1524 | 1525 | ||
1525 | KActionMenu::KActionMenu( const QString& text, const QIconSet& icon, | 1526 | KActionMenu::KActionMenu( const QString& text, const QIcon& icon, |
1526 | QObject* parent, const char* name ) | 1527 | QObject* parent, const char* name ) |
1527 | : KAction( text, icon, 0, parent, name ) | 1528 | : KAction( text, icon, 0, parent, name ) |
1528 | { | 1529 | { |
1529 | d = new KActionMenuPrivate; | 1530 | d = new KActionMenuPrivate; |
@@ -1551,9 +1552,9 @@ void KActionMenu::popup( const QPoint& global ) | |||
1551 | } | 1552 | } |
1552 | 1553 | ||
1553 | 1554 | ||
1554 | //US KPopupMenu* KActionMenu::popupMenu() const | 1555 | //US KPopupMenu* KActionMenu::popupMenu() const |
1555 | QPopupMenu* KActionMenu::popupMenu() const | 1556 | Q3PopupMenu* KActionMenu::popupMenu() const |
1556 | { | 1557 | { |
1557 | return d->m_popup; | 1558 | return d->m_popup; |
1558 | } | 1559 | } |
1559 | 1560 | ||
@@ -1591,11 +1592,11 @@ int KActionMenu::plug( QWidget* widget, int index ) | |||
1591 | if (kapp && !kapp->authorizeKAction(name())) | 1592 | if (kapp && !kapp->authorizeKAction(name())) |
1592 | return -1; | 1593 | return -1; |
1593 | */ | 1594 | */ |
1594 | kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis | 1595 | kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis |
1595 | if ( widget->inherits("QPopupMenu") ) | 1596 | if ( widget->inherits("Q3PopupMenu") ) |
1596 | { | 1597 | { |
1597 | QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); | 1598 | Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); |
1598 | int id; | 1599 | int id; |
1599 | if ( hasIconSet() ) | 1600 | if ( hasIconSet() ) |
1600 | id = menu->insertItem( iconSet(), text(), d->m_popup, -1, index ); | 1601 | id = menu->insertItem( iconSet(), text(), d->m_popup, -1, index ); |
1601 | else | 1602 | else |
@@ -1780,14 +1781,14 @@ int KToolBarPopupAction::plug( QWidget *widget, int index ) | |||
1780 | return KAction::plug( widget, index ); | 1781 | return KAction::plug( widget, index ); |
1781 | } | 1782 | } |
1782 | 1783 | ||
1783 | //US KPopupMenu *KToolBarPopupAction::popupMenu() const | 1784 | //US KPopupMenu *KToolBarPopupAction::popupMenu() const |
1784 | QPopupMenu *KToolBarPopupAction::popupMenu() const | 1785 | Q3PopupMenu *KToolBarPopupAction::popupMenu() const |
1785 | { | 1786 | { |
1786 | if ( !m_popup ) { | 1787 | if ( !m_popup ) { |
1787 | KToolBarPopupAction *that = const_cast<KToolBarPopupAction*>(this); | 1788 | KToolBarPopupAction *that = const_cast<KToolBarPopupAction*>(this); |
1788 | //US that->m_popup = new KPopupMenu; | 1789 | //US that->m_popup = new KPopupMenu; |
1789 | that->m_popup = new QPopupMenu; | 1790 | that->m_popup = new Q3PopupMenu; |
1790 | } | 1791 | } |
1791 | return m_popup; | 1792 | return m_popup; |
1792 | } | 1793 | } |
1793 | 1794 | ||
@@ -1952,9 +1953,9 @@ void KWidgetAction::unplug( QWidget *w ) | |||
1952 | void KWidgetAction::slotToolbarDestroyed() | 1953 | void KWidgetAction::slotToolbarDestroyed() |
1953 | { | 1954 | { |
1954 | //Q_ASSERT( m_widget ); // When exiting the app the widget could be destroyed before the toolbar. | 1955 | //Q_ASSERT( m_widget ); // When exiting the app the widget could be destroyed before the toolbar. |
1955 | 1956 | ||
1956 | ASSERT( isPlugged() ); | 1957 | Q_ASSERT( isPlugged() ); |
1957 | if( !m_widget || !isPlugged() ) | 1958 | if( !m_widget || !isPlugged() ) |
1958 | return; | 1959 | return; |
1959 | 1960 | ||
1960 | // Don't let a toolbar being destroyed, delete my widget. | 1961 | // Don't let a toolbar being destroyed, delete my widget. |
@@ -1973,11 +1974,11 @@ KActionSeparator::~KActionSeparator() | |||
1973 | } | 1974 | } |
1974 | 1975 | ||
1975 | int KActionSeparator::plug( QWidget *widget, int index ) | 1976 | int KActionSeparator::plug( QWidget *widget, int index ) |
1976 | { | 1977 | { |
1977 | if ( widget->inherits("QPopupMenu") ) | 1978 | if ( widget->inherits("Q3PopupMenu") ) |
1978 | { | 1979 | { |
1979 | QPopupMenu* menu = static_cast<QPopupMenu*>( widget ); | 1980 | Q3PopupMenu* menu = static_cast<Q3PopupMenu*>( widget ); |
1980 | 1981 | ||
1981 | int id = menu->insertSeparator( index ); | 1982 | int id = menu->insertSeparator( index ); |
1982 | 1983 | ||
1983 | addContainer( menu, id ); | 1984 | addContainer( menu, id ); |
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 | |||
@@ -33,13 +33,16 @@ | |||
33 | //US#include <qvaluelist.h> | 33 | //US#include <qvaluelist.h> |
34 | //US#include <qguardedptr.h> | 34 | //US#include <qguardedptr.h> |
35 | //US#include <kguiitem.h> | 35 | //US#include <kguiitem.h> |
36 | #include <kshortcut.h> | 36 | #include <kshortcut.h> |
37 | //Added by qt3to4: | ||
38 | #include <Q3CString> | ||
39 | #include <Q3PopupMenu> | ||
37 | //US#include <kstdaction.h> | 40 | //US#include <kstdaction.h> |
38 | //US#include <kicontheme.h> | 41 | //US#include <kicontheme.h> |
39 | 42 | ||
40 | class QMenuBar; | 43 | class QMenuBar; |
41 | class QPopupMenu; | 44 | class Q3PopupMenu; |
42 | //USclass QComboBox; | 45 | //USclass QComboBox; |
43 | //USclass QPoint; | 46 | //USclass QPoint; |
44 | //USclass QIconSet; | 47 | //USclass QIconSet; |
45 | //USclass QString; | 48 | //USclass QString; |
@@ -53,9 +56,9 @@ class KURL; | |||
53 | //USclass KInstance; | 56 | //USclass KInstance; |
54 | 57 | ||
55 | 58 | ||
56 | //US class KToolBar needs to be replaced | 59 | //US class KToolBar needs to be replaced |
57 | class KToolBar; | 60 | #include "ktoolbar.h" |
58 | class KActionCollection; | 61 | class KActionCollection; |
59 | 62 | ||
60 | //US class KPopupMenu needs to be replaced | 63 | //US class KPopupMenu needs to be replaced |
61 | //US class KPopupMenu; | 64 | //US class KPopupMenu; |
@@ -104,9 +107,9 @@ public: | |||
104 | * @param cut The corresponding keyboard accelerator (shortcut). | 107 | * @param cut The corresponding keyboard accelerator (shortcut). |
105 | * @param parent This action's parent. | 108 | * @param parent This action's parent. |
106 | * @param name An internal name for this action. | 109 | * @param name An internal name for this action. |
107 | */ | 110 | */ |
108 | KToggleAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), | 111 | KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), |
109 | QObject* parent = 0, const char* name = 0 ); | 112 | QObject* parent = 0, const char* name = 0 ); |
110 | 113 | ||
111 | /** | 114 | /** |
112 | * @param text The text that will be displayed. | 115 | * @param text The text that will be displayed. |
@@ -126,9 +129,9 @@ public: | |||
126 | * @param slot The SLOT to invoke to execute this action. | 129 | * @param slot The SLOT to invoke to execute this action. |
127 | * @param parent This action's parent. | 130 | * @param parent This action's parent. |
128 | * @param name An internal name for this action. | 131 | * @param name An internal name for this action. |
129 | */ | 132 | */ |
130 | KToggleAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 133 | KToggleAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
131 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); | 134 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); |
132 | 135 | ||
133 | /** | 136 | /** |
134 | * @param text The text that will be displayed. | 137 | * @param text The text that will be displayed. |
@@ -245,9 +248,9 @@ public: | |||
245 | * @param cut The corresponding keyboard accelerator (shortcut). | 248 | * @param cut The corresponding keyboard accelerator (shortcut). |
246 | * @param parent This action's parent. | 249 | * @param parent This action's parent. |
247 | * @param name An internal name for this action. | 250 | * @param name An internal name for this action. |
248 | */ | 251 | */ |
249 | KRadioAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), | 252 | KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), |
250 | QObject* parent = 0, const char* name = 0 ); | 253 | QObject* parent = 0, const char* name = 0 ); |
251 | 254 | ||
252 | /** | 255 | /** |
253 | * @param text The text that will be displayed. | 256 | * @param text The text that will be displayed. |
@@ -267,9 +270,9 @@ public: | |||
267 | * @param slot The SLOT to invoke to execute this action. | 270 | * @param slot The SLOT to invoke to execute this action. |
268 | * @param parent This action's parent. | 271 | * @param parent This action's parent. |
269 | * @param name An internal name for this action. | 272 | * @param name An internal name for this action. |
270 | */ | 273 | */ |
271 | KRadioAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 274 | KRadioAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
272 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); | 275 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); |
273 | 276 | ||
274 | /** | 277 | /** |
275 | * @param text The text that will be displayed. | 278 | * @param text The text that will be displayed. |
@@ -351,9 +354,9 @@ public: | |||
351 | * @param cut The corresponding keyboard accelerator (shortcut). | 354 | * @param cut The corresponding keyboard accelerator (shortcut). |
352 | * @param parent This action's parent. | 355 | * @param parent This action's parent. |
353 | * @param name An internal name for this action. | 356 | * @param name An internal name for this action. |
354 | */ | 357 | */ |
355 | KSelectAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), | 358 | KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), |
356 | QObject* parent = 0, const char* name = 0 ); | 359 | QObject* parent = 0, const char* name = 0 ); |
357 | 360 | ||
358 | /** | 361 | /** |
359 | * @param text The text that will be displayed. | 362 | * @param text The text that will be displayed. |
@@ -373,9 +376,9 @@ public: | |||
373 | * @param slot The SLOT to invoke to execute this action. | 376 | * @param slot The SLOT to invoke to execute this action. |
374 | * @param parent This action's parent. | 377 | * @param parent This action's parent. |
375 | * @param name An internal name for this action. | 378 | * @param name An internal name for this action. |
376 | */ | 379 | */ |
377 | KSelectAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 380 | KSelectAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
378 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); | 381 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); |
379 | 382 | ||
380 | /** | 383 | /** |
381 | * @param text The text that will be displayed. | 384 | * @param text The text that will be displayed. |
@@ -437,9 +440,9 @@ public: | |||
437 | * This returns the maximum width set by setComboWidth | 440 | * This returns the maximum width set by setComboWidth |
438 | */ | 441 | */ |
439 | virtual int comboWidth() const; | 442 | virtual int comboWidth() const; |
440 | 443 | ||
441 | QPopupMenu* popupMenu() const; | 444 | Q3PopupMenu* popupMenu() const; |
442 | 445 | ||
443 | /** | 446 | /** |
444 | * Deprecated. See @ref setMenuAccelsEnabled . | 447 | * Deprecated. See @ref setMenuAccelsEnabled . |
445 | * @since 3.1 | 448 | * @since 3.1 |
@@ -566,9 +569,9 @@ public: | |||
566 | * @param cut The corresponding keyboard accelerator (shortcut). | 569 | * @param cut The corresponding keyboard accelerator (shortcut). |
567 | * @param parent This action's parent. | 570 | * @param parent This action's parent. |
568 | * @param name An internal name for this action. | 571 | * @param name An internal name for this action. |
569 | */ | 572 | */ |
570 | KListAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), | 573 | KListAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), |
571 | QObject* parent = 0, const char* name = 0 ); | 574 | QObject* parent = 0, const char* name = 0 ); |
572 | 575 | ||
573 | /** | 576 | /** |
574 | * @param text The text that will be displayed. | 577 | * @param text The text that will be displayed. |
@@ -588,9 +591,9 @@ public: | |||
588 | * @param slot The SLOT to invoke to execute this action. | 591 | * @param slot The SLOT to invoke to execute this action. |
589 | * @param parent This action's parent. | 592 | * @param parent This action's parent. |
590 | * @param name An internal name for this action. | 593 | * @param name An internal name for this action. |
591 | */ | 594 | */ |
592 | KListAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 595 | KListAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
593 | const QObject* receiver, const char* slot, QObject* parent, | 596 | const QObject* receiver, const char* slot, QObject* parent, |
594 | const char* name = 0 ); | 597 | const char* name = 0 ); |
595 | 598 | ||
596 | /** | 599 | /** |
@@ -684,9 +687,9 @@ public: | |||
684 | * @param parent This action's parent. | 687 | * @param parent This action's parent. |
685 | * @param name An internal name for this action. | 688 | * @param name An internal name for this action. |
686 | * @param maxItems The maximum number of files to display | 689 | * @param maxItems The maximum number of files to display |
687 | */ | 690 | */ |
688 | KRecentFilesAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 691 | KRecentFilesAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
689 | QObject* parent, const char* name = 0, | 692 | QObject* parent, const char* name = 0, |
690 | uint maxItems = 10 ); | 693 | uint maxItems = 10 ); |
691 | 694 | ||
692 | /** | 695 | /** |
@@ -711,9 +714,9 @@ public: | |||
711 | * @param parent This action's parent. | 714 | * @param parent This action's parent. |
712 | * @param name An internal name for this action. | 715 | * @param name An internal name for this action. |
713 | * @param maxItems The maximum number of files to display | 716 | * @param maxItems The maximum number of files to display |
714 | */ | 717 | */ |
715 | KRecentFilesAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 718 | KRecentFilesAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
716 | const QObject* receiver, const char* slot, | 719 | const QObject* receiver, const char* slot, |
717 | QObject* parent, const char* name = 0, | 720 | QObject* parent, const char* name = 0, |
718 | uint maxItems = 10 ); | 721 | uint maxItems = 10 ); |
719 | 722 | ||
@@ -833,13 +836,13 @@ public: | |||
833 | const char* name = 0 ); | 836 | const char* name = 0 ); |
834 | KFontAction( const QString& text, const KShortcut& cut, | 837 | KFontAction( const QString& text, const KShortcut& cut, |
835 | const QObject* receiver, const char* slot, QObject* parent, | 838 | const QObject* receiver, const char* slot, QObject* parent, |
836 | const char* name = 0 ); | 839 | const char* name = 0 ); |
837 | KFontAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), | 840 | KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), |
838 | QObject* parent = 0, const char* name = 0 ); | 841 | QObject* parent = 0, const char* name = 0 ); |
839 | KFontAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), | 842 | KFontAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), |
840 | QObject* parent = 0, const char* name = 0 ); | 843 | QObject* parent = 0, const char* name = 0 ); |
841 | KFontAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 844 | KFontAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
842 | const QObject* receiver, const char* slot, QObject* parent, | 845 | const QObject* receiver, const char* slot, QObject* parent, |
843 | const char* name = 0 ); | 846 | const char* name = 0 ); |
844 | KFontAction( const QString& text, const QString& pix, const KShortcut& cut, | 847 | KFontAction( const QString& text, const QString& pix, const KShortcut& cut, |
845 | const QObject* receiver, const char* slot, QObject* parent, | 848 | const QObject* receiver, const char* slot, QObject* parent, |
@@ -872,13 +875,13 @@ public: | |||
872 | KFontSizeAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0, | 875 | KFontSizeAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0, |
873 | const char* name = 0 ); | 876 | const char* name = 0 ); |
874 | KFontSizeAction( const QString& text, const KShortcut& cut, const QObject* receiver, | 877 | KFontSizeAction( const QString& text, const KShortcut& cut, const QObject* receiver, |
875 | const char* slot, QObject* parent, const char* name = 0 ); | 878 | const char* slot, QObject* parent, const char* name = 0 ); |
876 | KFontSizeAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), | 879 | KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), |
877 | QObject* parent = 0, const char* name = 0 ); | 880 | QObject* parent = 0, const char* name = 0 ); |
878 | KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), | 881 | KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), |
879 | QObject* parent = 0, const char* name = 0 ); | 882 | QObject* parent = 0, const char* name = 0 ); |
880 | KFontSizeAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 883 | KFontSizeAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
881 | const QObject* receiver, const char* slot, | 884 | const QObject* receiver, const char* slot, |
882 | QObject* parent, const char* name = 0 ); | 885 | QObject* parent, const char* name = 0 ); |
883 | KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut, | 886 | KFontSizeAction( const QString& text, const QString& pix, const KShortcut& cut, |
884 | const QObject* receiver, const char* slot, | 887 | const QObject* receiver, const char* slot, |
@@ -930,9 +933,9 @@ class KActionMenu : public KAction | |||
930 | 933 | ||
931 | public: | 934 | public: |
932 | KActionMenu( const QString& text, QObject* parent = 0, | 935 | KActionMenu( const QString& text, QObject* parent = 0, |
933 | const char* name = 0 ); | 936 | const char* name = 0 ); |
934 | KActionMenu( const QString& text, const QIconSet& icon, | 937 | KActionMenu( const QString& text, const QIcon& icon, |
935 | QObject* parent = 0, const char* name = 0 ); | 938 | QObject* parent = 0, const char* name = 0 ); |
936 | KActionMenu( const QString& text, const QString& icon, | 939 | KActionMenu( const QString& text, const QString& icon, |
937 | QObject* parent = 0, const char* name = 0 ); | 940 | QObject* parent = 0, const char* name = 0 ); |
938 | KActionMenu( QObject* parent = 0, const char* name = 0 ); | 941 | KActionMenu( QObject* parent = 0, const char* name = 0 ); |
@@ -941,9 +944,9 @@ public: | |||
941 | virtual void insert( KAction*, int index = -1 ); | 944 | virtual void insert( KAction*, int index = -1 ); |
942 | virtual void remove( KAction* ); | 945 | virtual void remove( KAction* ); |
943 | 946 | ||
944 | //US KPopupMenu* popupMenu() const; | 947 | //US KPopupMenu* popupMenu() const; |
945 | QPopupMenu* popupMenu() const; | 948 | Q3PopupMenu* popupMenu() const; |
946 | void popup( const QPoint& global ); | 949 | void popup( const QPoint& global ); |
947 | 950 | ||
948 | /** | 951 | /** |
949 | * Returns true if this action creates a delayed popup menu | 952 | * Returns true if this action creates a delayed popup menu |
@@ -1066,9 +1069,9 @@ public: | |||
1066 | * button. You may want to plug items into it on creation, or connect to | 1069 | * button. You may want to plug items into it on creation, or connect to |
1067 | * aboutToShow for a more dynamic menu. | 1070 | * aboutToShow for a more dynamic menu. |
1068 | */ | 1071 | */ |
1069 | //US KPopupMenu *popupMenu() const; | 1072 | //US KPopupMenu *popupMenu() const; |
1070 | QPopupMenu *popupMenu() const; | 1073 | Q3PopupMenu *popupMenu() const; |
1071 | 1074 | ||
1072 | /** | 1075 | /** |
1073 | * Returns true if this action creates a delayed popup menu | 1076 | * Returns true if this action creates a delayed popup menu |
1074 | * when plugged in a KToolbar. | 1077 | * when plugged in a KToolbar. |
@@ -1097,9 +1100,9 @@ public: | |||
1097 | void setStickyMenu(bool sticky); | 1100 | void setStickyMenu(bool sticky); |
1098 | 1101 | ||
1099 | private: | 1102 | private: |
1100 | //US KPopupMenu *m_popup; | 1103 | //US KPopupMenu *m_popup; |
1101 | QPopupMenu *m_popup; | 1104 | Q3PopupMenu *m_popup; |
1102 | bool m_delayed:1; | 1105 | bool m_delayed:1; |
1103 | bool m_stickyMenu:1; | 1106 | bool m_stickyMenu:1; |
1104 | protected: | 1107 | protected: |
1105 | virtual void virtual_hook( int id, void* data ); | 1108 | virtual void virtual_hook( int id, void* data ); |
@@ -1146,10 +1149,10 @@ public: | |||
1146 | public slots: | 1149 | public slots: |
1147 | virtual void setChecked( bool ); | 1150 | virtual void setChecked( bool ); |
1148 | 1151 | ||
1149 | private: | 1152 | private: |
1150 | QCString m_toolBarName; | 1153 | Q3CString m_toolBarName; |
1151 | QGuardedPtr<KToolBar> m_toolBar; | 1154 | QPointer<KToolBar> m_toolBar; |
1152 | protected: | 1155 | protected: |
1153 | virtual void virtual_hook( int id, void* data ); | 1156 | virtual void virtual_hook( int id, void* data ); |
1154 | private: | 1157 | private: |
1155 | class KToggleToolBarActionPrivate; | 1158 | class KToggleToolBarActionPrivate; |
@@ -1194,9 +1197,9 @@ public: | |||
1194 | virtual void unplug( QWidget *w ); | 1197 | virtual void unplug( QWidget *w ); |
1195 | protected slots: | 1198 | protected slots: |
1196 | void slotToolbarDestroyed(); | 1199 | void slotToolbarDestroyed(); |
1197 | private: | 1200 | private: |
1198 | QGuardedPtr<QWidget> m_widget; | 1201 | QPointer<QWidget> m_widget; |
1199 | bool m_autoSized; | 1202 | bool m_autoSized; |
1200 | protected: | 1203 | protected: |
1201 | virtual void virtual_hook( int id, void* data ); | 1204 | virtual void virtual_hook( int id, void* data ); |
1202 | private: | 1205 | private: |
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 | |||
@@ -25,9 +25,11 @@ | |||
25 | 25 | ||
26 | #include "kactioncollection.h" | 26 | #include "kactioncollection.h" |
27 | //US#include "kactionshortcutlist.h" | 27 | //US#include "kactionshortcutlist.h" |
28 | 28 | ||
29 | #include <qptrdict.h> | 29 | #include <q3ptrdict.h> |
30 | //Added by qt3to4: | ||
31 | #include <Q3ValueList> | ||
30 | //US#include <qvariant.h> | 32 | //US#include <qvariant.h> |
31 | 33 | ||
32 | //US#include <kaccel.h> | 34 | //US#include <kaccel.h> |
33 | //US#include <kaccelbase.h> | 35 | //US#include <kaccelbase.h> |
@@ -35,10 +37,10 @@ | |||
35 | #include <kdebug.h> | 37 | #include <kdebug.h> |
36 | //US#include <kxmlguifactory.h> | 38 | //US#include <kxmlguifactory.h> |
37 | 39 | ||
38 | //US I included the following files | 40 | //US I included the following files |
39 | #include <qasciidict.h> | 41 | #include <q3asciidict.h> |
40 | #include <qptrlist.h> | 42 | #include <q3ptrlist.h> |
41 | #include "kaction.h" | 43 | #include "kaction.h" |
42 | #include <kglobal.h> | 44 | #include <kglobal.h> |
43 | #include <qobject.h> | 45 | #include <qobject.h> |
44 | #include <qwidget.h> | 46 | #include <qwidget.h> |
@@ -66,15 +68,15 @@ public: | |||
66 | //bool m_bOneKAccelOnly; | 68 | //bool m_bOneKAccelOnly; |
67 | //int m_iWidgetCurrent; | 69 | //int m_iWidgetCurrent; |
68 | //QValueList<QWidget*> m_widgetList; | 70 | //QValueList<QWidget*> m_widgetList; |
69 | //QValueList<KAccel*> m_kaccelList; | 71 | //QValueList<KAccel*> m_kaccelList; |
70 | QValueList<KActionCollection*> m_docList; | 72 | Q3ValueList<KActionCollection*> m_docList; |
71 | QWidget *m_widget; | 73 | QWidget *m_widget; |
72 | KAccel *m_kaccel; | 74 | KAccel *m_kaccel; |
73 | KAccel *m_builderKAccel; | 75 | KAccel *m_builderKAccel; |
74 | 76 | ||
75 | QAsciiDict<KAction> m_actionDict; | 77 | Q3AsciiDict<KAction> m_actionDict; |
76 | QPtrDict< QPtrList<KAction> > m_dctHighlightContainers; | 78 | Q3PtrDict< Q3PtrList<KAction> > m_dctHighlightContainers; |
77 | bool m_highlight; | 79 | bool m_highlight; |
78 | KAction *m_currentHighlightAction; | 80 | KAction *m_currentHighlightAction; |
79 | bool m_statusCleared; | 81 | bool m_statusCleared; |
80 | }; | 82 | }; |
@@ -132,9 +134,9 @@ KActionCollection::KActionCollection( const KActionCollection © ) | |||
132 | 134 | ||
133 | KActionCollection::~KActionCollection() | 135 | KActionCollection::~KActionCollection() |
134 | { | 136 | { |
135 | kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl; | 137 | kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl; |
136 | for ( QAsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { | 138 | for ( Q3AsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { |
137 | KAction* pAction = it.current(); | 139 | KAction* pAction = it.current(); |
138 | if ( pAction->m_parentCollection == this ) | 140 | if ( pAction->m_parentCollection == this ) |
139 | pAction->m_parentCollection = 0L; | 141 | pAction->m_parentCollection = 0L; |
140 | } | 142 | } |
@@ -364,9 +366,9 @@ KAction* KActionCollection::_take( KAction* action ) | |||
364 | } | 366 | } |
365 | 367 | ||
366 | void KActionCollection::_clear() | 368 | void KActionCollection::_clear() |
367 | { | 369 | { |
368 | QAsciiDictIterator<KAction> it( d->m_actionDict ); | 370 | Q3AsciiDictIterator<KAction> it( d->m_actionDict ); |
369 | while ( it.current() ) | 371 | while ( it.current() ) |
370 | _remove( it.current() ); | 372 | _remove( it.current() ); |
371 | } | 373 | } |
372 | 374 | ||
@@ -385,9 +387,9 @@ KAction* KActionCollection::action( const char* name, const char* classname ) co | |||
385 | if ( !classname && name ) | 387 | if ( !classname && name ) |
386 | pAction = d->m_actionDict[ name ]; | 388 | pAction = d->m_actionDict[ name ]; |
387 | 389 | ||
388 | else { | 390 | else { |
389 | QAsciiDictIterator<KAction> it( d->m_actionDict ); | 391 | Q3AsciiDictIterator<KAction> it( d->m_actionDict ); |
390 | for( ; it.current(); ++it ) | 392 | for( ; it.current(); ++it ) |
391 | { | 393 | { |
392 | if ( ( !name || strcmp( it.current()->name(), name ) == 0 ) && | 394 | if ( ( !name || strcmp( it.current()->name(), name ) == 0 ) && |
393 | ( !classname || strcmp( it.current()->className(), classname ) == 0 ) ) { | 395 | ( !classname || strcmp( it.current()->className(), classname ) == 0 ) ) { |
@@ -406,9 +408,9 @@ KAction* KActionCollection::action( const char* name, const char* classname ) co | |||
406 | } | 408 | } |
407 | 409 | ||
408 | KAction* KActionCollection::action( int index ) const | 410 | KAction* KActionCollection::action( int index ) const |
409 | { | 411 | { |
410 | QAsciiDictIterator<KAction> it( d->m_actionDict ); | 412 | Q3AsciiDictIterator<KAction> it( d->m_actionDict ); |
411 | it += index; | 413 | it += index; |
412 | return it.current(); | 414 | return it.current(); |
413 | // return d->m_actions.at( index ); | 415 | // return d->m_actions.at( index ); |
414 | } | 416 | } |
@@ -431,9 +433,9 @@ uint KActionCollection::count() const | |||
431 | QStringList KActionCollection::groups() const | 433 | QStringList KActionCollection::groups() const |
432 | { | 434 | { |
433 | QStringList lst; | 435 | QStringList lst; |
434 | 436 | ||
435 | QAsciiDictIterator<KAction> it( d->m_actionDict ); | 437 | Q3AsciiDictIterator<KAction> it( d->m_actionDict ); |
436 | for( ; it.current(); ++it ) | 438 | for( ; it.current(); ++it ) |
437 | if ( !it.current()->group().isEmpty() && !lst.contains( it.current()->group() ) ) | 439 | if ( !it.current()->group().isEmpty() && !lst.contains( it.current()->group() ) ) |
438 | lst.append( it.current()->group() ); | 440 | lst.append( it.current()->group() ); |
439 | 441 | ||
@@ -443,9 +445,9 @@ QStringList KActionCollection::groups() const | |||
443 | KActionPtrList KActionCollection::actions( const QString& group ) const | 445 | KActionPtrList KActionCollection::actions( const QString& group ) const |
444 | { | 446 | { |
445 | KActionPtrList lst; | 447 | KActionPtrList lst; |
446 | 448 | ||
447 | QAsciiDictIterator<KAction> it( d->m_actionDict ); | 449 | Q3AsciiDictIterator<KAction> it( d->m_actionDict ); |
448 | for( ; it.current(); ++it ) | 450 | for( ; it.current(); ++it ) |
449 | if ( it.current()->group() == group ) | 451 | if ( it.current()->group() == group ) |
450 | lst.append( it.current() ); | 452 | lst.append( it.current() ); |
451 | else if ( it.current()->group().isEmpty() && group.isEmpty() ) | 453 | else if ( it.current()->group().isEmpty() && group.isEmpty() ) |
@@ -457,9 +459,9 @@ KActionPtrList KActionCollection::actions( const QString& group ) const | |||
457 | KActionPtrList KActionCollection::actions() const | 459 | KActionPtrList KActionCollection::actions() const |
458 | { | 460 | { |
459 | KActionPtrList lst; | 461 | KActionPtrList lst; |
460 | 462 | ||
461 | QAsciiDictIterator<KAction> it( d->m_actionDict ); | 463 | Q3AsciiDictIterator<KAction> it( d->m_actionDict ); |
462 | for( ; it.current(); ++it ) | 464 | for( ; it.current(); ++it ) |
463 | lst.append( it.current() ); | 465 | lst.append( it.current() ); |
464 | 466 | ||
465 | return lst; | 467 | return lst; |
@@ -507,23 +509,23 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action ) | |||
507 | { | 509 | { |
508 | if ( !d->m_highlight ) | 510 | if ( !d->m_highlight ) |
509 | return; | 511 | return; |
510 | 512 | ||
511 | QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; | 513 | Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; |
512 | 514 | ||
513 | if ( !actionList ) | 515 | if ( !actionList ) |
514 | { | 516 | { |
515 | actionList = new QPtrList<KAction>; | 517 | actionList = new Q3PtrList<KAction>; |
516 | 518 | ||
517 | if ( container->inherits( "QPopupMenu" ) ) | 519 | if ( container->inherits( "Q3PopupMenu" ) ) |
518 | { | 520 | { |
519 | connect( container, SIGNAL( highlighted( int ) ), | 521 | connect( container, SIGNAL( highlighted( int ) ), |
520 | this, SLOT( slotMenuItemHighlighted( int ) ) ); | 522 | this, SLOT( slotMenuItemHighlighted( int ) ) ); |
521 | connect( container, SIGNAL( aboutToHide() ), | 523 | connect( container, SIGNAL( aboutToHide() ), |
522 | this, SLOT( slotMenuAboutToHide() ) ); | 524 | this, SLOT( slotMenuAboutToHide() ) ); |
523 | } | 525 | } |
524 | //US else if ( container->inherits( "KToolBar" ) ) | 526 | //US else if ( container->inherits( "KToolBar" ) ) |
525 | else if ( container->inherits( "QToolBar" ) ) | 527 | else if ( container->inherits( "Q3ToolBar" ) ) |
526 | { | 528 | { |
527 | connect( container, SIGNAL( highlighted( int, bool ) ), | 529 | connect( container, SIGNAL( highlighted( int, bool ) ), |
528 | this, SLOT( slotToolBarButtonHighlighted( int, bool ) ) ); | 530 | this, SLOT( slotToolBarButtonHighlighted( int, bool ) ) ); |
529 | } | 531 | } |
@@ -541,9 +543,9 @@ void KActionCollection::disconnectHighlight( QWidget *container, KAction *action | |||
541 | { | 543 | { |
542 | if ( !d->m_highlight ) | 544 | if ( !d->m_highlight ) |
543 | return; | 545 | return; |
544 | 546 | ||
545 | QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; | 547 | Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; |
546 | 548 | ||
547 | if ( !actionList ) | 549 | if ( !actionList ) |
548 | return; | 550 | return; |
549 | 551 | ||
@@ -624,14 +626,14 @@ void KActionCollection::slotDestroyed() | |||
624 | } | 626 | } |
625 | 627 | ||
626 | KAction *KActionCollection::findAction( QWidget *container, int id ) | 628 | KAction *KActionCollection::findAction( QWidget *container, int id ) |
627 | { | 629 | { |
628 | QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ]; | 630 | Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ]; |
629 | 631 | ||
630 | if ( !actionList ) | 632 | if ( !actionList ) |
631 | return 0; | 633 | return 0; |
632 | 634 | ||
633 | QPtrListIterator<KAction> it( *actionList ); | 635 | Q3PtrListIterator<KAction> it( *actionList ); |
634 | for (; it.current(); ++it ) | 636 | for (; it.current(); ++it ) |
635 | if ( it.current()->isPlugged( container, id ) ) | 637 | if ( it.current()->isPlugged( container, id ) ) |
636 | return it.current(); | 638 | return it.current(); |
637 | 639 | ||
@@ -643,11 +645,11 @@ KActionCollection KActionCollection::operator+(const KActionCollection &c ) cons | |||
643 | { | 645 | { |
644 | kdWarning(129) << "KActionCollection::operator+(): function is severely deprecated." << endl; | 646 | kdWarning(129) << "KActionCollection::operator+(): function is severely deprecated." << endl; |
645 | KActionCollection ret( *this ); | 647 | KActionCollection ret( *this ); |
646 | 648 | ||
647 | QValueList<KAction *> actions = c.actions(); | 649 | Q3ValueList<KAction *> actions = c.actions(); |
648 | QValueList<KAction *>::ConstIterator it = actions.begin(); | 650 | Q3ValueList<KAction *>::ConstIterator it = actions.begin(); |
649 | QValueList<KAction *>::ConstIterator end = actions.end(); | 651 | Q3ValueList<KAction *>::ConstIterator end = actions.end(); |
650 | for (; it != end; ++it ) | 652 | for (; it != end; ++it ) |
651 | ret.insert( *it ); | 653 | ret.insert( *it ); |
652 | 654 | ||
653 | return ret; | 655 | return ret; |
@@ -669,9 +671,9 @@ KActionCollection &KActionCollection::operator=( const KActionCollection © ) | |||
669 | 671 | ||
670 | KActionCollection &KActionCollection::operator+=( const KActionCollection &c ) | 672 | KActionCollection &KActionCollection::operator+=( const KActionCollection &c ) |
671 | { | 673 | { |
672 | kdWarning(129) << "KActionCollection::operator+=(): function is severely deprecated." << endl; | 674 | kdWarning(129) << "KActionCollection::operator+=(): function is severely deprecated." << endl; |
673 | QAsciiDictIterator<KAction> it(c.d->m_actionDict); | 675 | Q3AsciiDictIterator<KAction> it(c.d->m_actionDict); |
674 | for ( ; it.current(); ++it ) | 676 | for ( ; it.current(); ++it ) |
675 | insert( it.current() ); | 677 | insert( it.current() ); |
676 | 678 | ||
677 | return *this; | 679 | return *this; |
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 | |||
@@ -29,8 +29,10 @@ | |||
29 | #include <kaction.h> | 29 | #include <kaction.h> |
30 | 30 | ||
31 | //US #include <qkeysequence.h> | 31 | //US #include <qkeysequence.h> |
32 | #include <qobject.h> | 32 | #include <qobject.h> |
33 | //Added by qt3to4: | ||
34 | #include <Q3ValueList> | ||
33 | //US#include <qvaluelist.h> | 35 | //US#include <qvaluelist.h> |
34 | //US#include <qguardedptr.h> | 36 | //US#include <qguardedptr.h> |
35 | //US #include <kguiitem.h> | 37 | //US #include <kguiitem.h> |
36 | //US#include <kshortcut.h> | 38 | //US#include <kshortcut.h> |
@@ -59,9 +61,9 @@ | |||
59 | //US added inclidefiles | 61 | //US added inclidefiles |
60 | class QWidget; | 62 | class QWidget; |
61 | 63 | ||
62 | 64 | ||
63 | typedef QValueList<KAction *> KActionPtrList; | 65 | typedef Q3ValueList<KAction *> KActionPtrList; |
64 | 66 | ||
65 | /** | 67 | /** |
66 | * A managed set of KAction objects. | 68 | * A managed set of KAction objects. |
67 | */ | 69 | */ |
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 | |||
@@ -48,9 +48,11 @@ | |||
48 | //US #include "kbuttonbox.moc" | 48 | //US #include "kbuttonbox.moc" |
49 | 49 | ||
50 | #include <kbuttonbox.h> | 50 | #include <kbuttonbox.h> |
51 | #include <qpushbutton.h> | 51 | #include <qpushbutton.h> |
52 | #include <qptrlist.h> | 52 | #include <q3ptrlist.h> |
53 | //Added by qt3to4: | ||
54 | #include <QResizeEvent> | ||
53 | #include <assert.h> | 55 | #include <assert.h> |
54 | 56 | ||
55 | #define minButtonWidth 50 | 57 | #define minButtonWidth 50 |
56 | 58 | ||
@@ -61,20 +63,20 @@ public: | |||
61 | unsigned short stretch; | 63 | unsigned short stretch; |
62 | unsigned short actual_size; | 64 | unsigned short actual_size; |
63 | }; | 65 | }; |
64 | 66 | ||
65 | template class QPtrList<KButtonBox::Item>; | 67 | template class Q3PtrList<KButtonBox::Item>; |
66 | 68 | ||
67 | class KButtonBoxPrivate { | 69 | class KButtonBoxPrivate { |
68 | public: | 70 | public: |
69 | unsigned short border; | 71 | unsigned short border; |
70 | unsigned short autoborder; | 72 | unsigned short autoborder; |
71 | unsigned short orientation; | 73 | unsigned short orientation; |
72 | bool activated; | 74 | bool activated; |
73 | QPtrList<KButtonBox::Item> buttons; | 75 | Q3PtrList<KButtonBox::Item> buttons; |
74 | }; | 76 | }; |
75 | 77 | ||
76 | KButtonBox::KButtonBox(QWidget *parent, Orientation _orientation, | 78 | KButtonBox::KButtonBox(QWidget *parent, Qt::Orientation _orientation, |
77 | int border, int autoborder) | 79 | int border, int autoborder) |
78 | : QWidget(parent) | 80 | : QWidget(parent) |
79 | { | 81 | { |
80 | data = new KButtonBoxPrivate; | 82 | data = new KButtonBoxPrivate; |
@@ -148,9 +150,9 @@ void KButtonBox::layout() { | |||
148 | 150 | ||
149 | void KButtonBox::placeButtons() { | 151 | void KButtonBox::placeButtons() { |
150 | unsigned int i; | 152 | unsigned int i; |
151 | 153 | ||
152 | if(data->orientation == Horizontal) { | 154 | if(data->orientation == Qt::Horizontal) { |
153 | // calculate free size and stretches | 155 | // calculate free size and stretches |
154 | int fs = width() - 2 * data->border; | 156 | int fs = width() - 2 * data->border; |
155 | int stretch = 0; | 157 | int stretch = 0; |
156 | for(i = 0; i < data->buttons.count(); i++) { | 158 | for(i = 0; i < data->buttons.count(); i++) { |
@@ -250,9 +252,9 @@ QSize KButtonBox::sizeHint() const { | |||
250 | s = that->buttonSizeHint(b); | 252 | s = that->buttonSizeHint(b); |
251 | else | 253 | else |
252 | s = bs; | 254 | s = bs; |
253 | 255 | ||
254 | if(data->orientation == Horizontal) | 256 | if(data->orientation == Qt::Horizontal) |
255 | dw += s.width(); | 257 | dw += s.width(); |
256 | else | 258 | else |
257 | dw += s.height(); | 259 | dw += s.height(); |
258 | 260 | ||
@@ -260,18 +262,18 @@ QSize KButtonBox::sizeHint() const { | |||
260 | dw += data->autoborder; | 262 | dw += data->autoborder; |
261 | } | 263 | } |
262 | } | 264 | } |
263 | 265 | ||
264 | if(data->orientation == Horizontal) | 266 | if(data->orientation == Qt::Horizontal) |
265 | return QSize(dw, bs.height() + 2 * data->border); | 267 | return QSize(dw, bs.height() + 2 * data->border); |
266 | else | 268 | else |
267 | return QSize(bs.width() + 2 * data->border, dw); | 269 | return QSize(bs.width() + 2 * data->border, dw); |
268 | } | 270 | } |
269 | } | 271 | } |
270 | 272 | ||
271 | QSizePolicy KButtonBox::sizePolicy() const | 273 | QSizePolicy KButtonBox::sizePolicy() const |
272 | { | 274 | { |
273 | return data->orientation == Horizontal? | 275 | return data->orientation == Qt::Horizontal? |
274 | QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) : | 276 | QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) : |
275 | QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); | 277 | QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); |
276 | } | 278 | } |
277 | 279 | ||
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 | |||
@@ -20,8 +20,10 @@ | |||
20 | #ifndef __KBUTTONBOX__H__ | 20 | #ifndef __KBUTTONBOX__H__ |
21 | #define __KBUTTONBOX__H__ | 21 | #define __KBUTTONBOX__H__ |
22 | 22 | ||
23 | #include <qwidget.h> | 23 | #include <qwidget.h> |
24 | //Added by qt3to4: | ||
25 | #include <QResizeEvent> | ||
24 | class QPushButton; | 26 | class QPushButton; |
25 | 27 | ||
26 | class KButtonBoxPrivate; | 28 | class KButtonBoxPrivate; |
27 | /** | 29 | /** |
@@ -47,9 +49,9 @@ public: | |||
47 | * If @p _orientation is @p Vertical, the buttons inserted with | 49 | * If @p _orientation is @p Vertical, the buttons inserted with |
48 | * @ref addButton() are laid out from top to bottom, otherwise they | 50 | * @ref addButton() are laid out from top to bottom, otherwise they |
49 | * are laid out from left to right. | 51 | * are laid out from left to right. |
50 | */ | 52 | */ |
51 | KButtonBox(QWidget *parent, Orientation _orientation = Horizontal, | 53 | KButtonBox(QWidget *parent, Qt::Orientation _orientation = Qt::Horizontal, |
52 | int border = 0, int _autoborder = 6); | 54 | int border = 0, int _autoborder = 6); |
53 | 55 | ||
54 | /** | 56 | /** |
55 | * Free private data field | 57 | * Free private data field |
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 | |||
@@ -19,9 +19,9 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <qregexp.h> | 21 | #include <qregexp.h> |
22 | #include <qstring.h> | 22 | #include <qstring.h> |
23 | #include <qiconset.h> | 23 | #include <qicon.h> |
24 | #include <qpixmap.h> | 24 | #include <qpixmap.h> |
25 | 25 | ||
26 | #include <assert.h> | 26 | #include <assert.h> |
27 | //US #include <kiconloader.h> | 27 | //US #include <kiconloader.h> |
@@ -61,9 +61,9 @@ public: | |||
61 | QString m_toolTip; | 61 | QString m_toolTip; |
62 | QString m_whatsThis; | 62 | QString m_whatsThis; |
63 | QString m_statusText; | 63 | QString m_statusText; |
64 | QString m_iconName; | 64 | QString m_iconName; |
65 | QIconSet m_iconSet; | 65 | QIcon m_iconSet; |
66 | bool m_hasIcon : 1; | 66 | bool m_hasIcon : 1; |
67 | bool m_enabled : 1; | 67 | bool m_enabled : 1; |
68 | }; | 68 | }; |
69 | 69 | ||
@@ -81,9 +81,9 @@ KGuiItem::KGuiItem( const QString &text, const QString &iconName, | |||
81 | d->m_whatsThis = whatsThis; | 81 | d->m_whatsThis = whatsThis; |
82 | setIconName( iconName ); | 82 | setIconName( iconName ); |
83 | } | 83 | } |
84 | 84 | ||
85 | KGuiItem::KGuiItem( const QString &text, const QIconSet &iconSet, | 85 | KGuiItem::KGuiItem( const QString &text, const QIcon &iconSet, |
86 | const QString &toolTip, const QString &whatsThis ) | 86 | const QString &toolTip, const QString &whatsThis ) |
87 | { | 87 | { |
88 | d = new KGuiItemPrivate; | 88 | d = new KGuiItemPrivate; |
89 | d->m_text = text; | 89 | d->m_text = text; |
@@ -123,9 +123,9 @@ QString KGuiItem::plainText() const { | |||
123 | 123 | ||
124 | return stripped; | 124 | return stripped; |
125 | } | 125 | } |
126 | 126 | ||
127 | QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const | 127 | QIcon KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const |
128 | { | 128 | { |
129 | if( d->m_hasIcon ) | 129 | if( d->m_hasIcon ) |
130 | { | 130 | { |
131 | if( !d->m_iconName.isEmpty()) | 131 | if( !d->m_iconName.isEmpty()) |
@@ -147,9 +147,9 @@ QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instan | |||
147 | return d->m_iconSet; | 147 | return d->m_iconSet; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | else | 150 | else |
151 | return QIconSet(); | 151 | return QIcon(); |
152 | } | 152 | } |
153 | 153 | ||
154 | QString KGuiItem::iconName() const | 154 | QString KGuiItem::iconName() const |
155 | { | 155 | { |
@@ -176,9 +176,9 @@ bool KGuiItem::hasIcon() const | |||
176 | void KGuiItem::setText( const QString &text ) { | 176 | void KGuiItem::setText( const QString &text ) { |
177 | d->m_text=text; | 177 | d->m_text=text; |
178 | } | 178 | } |
179 | 179 | ||
180 | void KGuiItem::setIconSet( const QIconSet &iconset ) | 180 | void KGuiItem::setIconSet( const QIcon &iconset ) |
181 | { | 181 | { |
182 | d->m_iconSet = iconset; | 182 | d->m_iconSet = iconset; |
183 | d->m_iconName = QString::null; | 183 | d->m_iconName = QString::null; |
184 | d->m_hasIcon = !iconset.isNull(); | 184 | d->m_hasIcon = !iconset.isNull(); |
@@ -186,9 +186,9 @@ void KGuiItem::setIconSet( const QIconSet &iconset ) | |||
186 | 186 | ||
187 | void KGuiItem::setIconName( const QString &iconName ) | 187 | void KGuiItem::setIconName( const QString &iconName ) |
188 | { | 188 | { |
189 | d->m_iconName = iconName; | 189 | d->m_iconName = iconName; |
190 | d->m_iconSet = QIconSet(); | 190 | d->m_iconSet = QIcon(); |
191 | d->m_hasIcon = !iconName.isEmpty(); | 191 | d->m_hasIcon = !iconName.isEmpty(); |
192 | } | 192 | } |
193 | 193 | ||
194 | void KGuiItem::setToolTip( const QString &toolTip) { | 194 | void KGuiItem::setToolTip( const QString &toolTip) { |
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 | |||
@@ -22,11 +22,11 @@ | |||
22 | #ifndef __kguiitem_h__ | 22 | #ifndef __kguiitem_h__ |
23 | #define __kguiitem_h__ | 23 | #define __kguiitem_h__ |
24 | 24 | ||
25 | #include <qstring.h> | 25 | #include <qstring.h> |
26 | #include <qiconset.h> | 26 | #include <qicon.h> |
27 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
28 | #include <qvaluelist.h> | 28 | #include <q3valuelist.h> |
29 | //US#include <kicontheme.h> | 29 | //US#include <kicontheme.h> |
30 | #include <kglobal.h> | 30 | #include <kglobal.h> |
31 | 31 | ||
32 | //US added the following files | 32 | //US added the following files |
@@ -41,9 +41,9 @@ public: | |||
41 | const QString &iconName = QString::null, | 41 | const QString &iconName = QString::null, |
42 | const QString &toolTip = QString::null, | 42 | const QString &toolTip = QString::null, |
43 | const QString &whatsThis = QString::null ); | 43 | const QString &whatsThis = QString::null ); |
44 | 44 | ||
45 | KGuiItem( const QString &text, const QIconSet &iconSet, | 45 | KGuiItem( const QString &text, const QIcon &iconSet, |
46 | const QString &toolTip = QString::null, | 46 | const QString &toolTip = QString::null, |
47 | const QString &whatsThis = QString::null ); | 47 | const QString &whatsThis = QString::null ); |
48 | 48 | ||
49 | KGuiItem( const KGuiItem &rhs ); | 49 | KGuiItem( const KGuiItem &rhs ); |
@@ -52,12 +52,12 @@ public: | |||
52 | ~KGuiItem(); | 52 | ~KGuiItem(); |
53 | 53 | ||
54 | QString text() const; | 54 | QString text() const; |
55 | QString plainText() const; | 55 | QString plainText() const; |
56 | QIconSet iconSet( KIcon::Group, int size = 0/*US , KInstance* instance = KGlobal::instance()*/) const; | 56 | QIcon iconSet( KIcon::Group, int size = 0/*US , KInstance* instance = KGlobal::instance()*/) const; |
57 | 57 | ||
58 | #ifndef KDE_NO_COMPAT | 58 | #ifndef KDE_NO_COMPAT |
59 | QIconSet iconSet() const { return iconSet( KIcon::Small); } | 59 | QIcon iconSet() const { return iconSet( KIcon::Small); } |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | QString iconName() const; | 62 | QString iconName() const; |
63 | QString toolTip() const; | 63 | QString toolTip() const; |
@@ -68,9 +68,9 @@ public: | |||
68 | bool hasIconSet() const { return hasIcon(); } | 68 | bool hasIconSet() const { return hasIcon(); } |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | void setText( const QString &text ); | 71 | void setText( const QString &text ); |
72 | void setIconSet( const QIconSet &iconset ); | 72 | void setIconSet( const QIcon &iconset ); |
73 | void setIconName( const QString &iconName ); | 73 | void setIconName( const QString &iconName ); |
74 | void setToolTip( const QString &tooltip ); | 74 | void setToolTip( const QString &tooltip ); |
75 | void setWhatsThis( const QString &whatsThis ); | 75 | void setWhatsThis( const QString &whatsThis ); |
76 | void setEnabled( bool enable ); | 76 | void setEnabled( bool enable ); |
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 | |||
@@ -21,17 +21,25 @@ | |||
21 | #include <qpixmap.h> | 21 | #include <qpixmap.h> |
22 | #include <qbitmap.h> | 22 | #include <qbitmap.h> |
23 | #include <qlayout.h> | 23 | #include <qlayout.h> |
24 | #include <qlabel.h> | 24 | #include <qlabel.h> |
25 | #include <qwidgetstack.h> | 25 | #include <q3widgetstack.h> |
26 | #include <qtabwidget.h> | 26 | #include <qtabwidget.h> |
27 | #include <qlistview.h> | 27 | #include <q3listview.h> |
28 | #include <qhbox.h> | 28 | #include <q3hbox.h> |
29 | #include <qvbox.h> | 29 | #include <q3vbox.h> |
30 | #include <qgrid.h> | 30 | #include <q3grid.h> |
31 | #include <qpainter.h> | 31 | #include <qpainter.h> |
32 | #include <qobjectlist.h> | 32 | #include <qobject.h> |
33 | #include <qstringlist.h> | 33 | #include <qstringlist.h> |
34 | //Added by qt3to4: | ||
35 | #include <Q3HBoxLayout> | ||
36 | #include <Q3GridLayout> | ||
37 | #include <Q3PtrList> | ||
38 | #include <Q3Frame> | ||
39 | #include <QEvent> | ||
40 | #include <Q3VBoxLayout> | ||
41 | #include <QShowEvent> | ||
34 | /*US | 42 | /*US |
35 | #include <qbitmap.h> | 43 | #include <qbitmap.h> |
36 | #include <qgrid.h> | 44 | #include <qgrid.h> |
37 | #include <qhbox.h> | 45 | #include <qhbox.h> |
@@ -64,15 +72,15 @@ | |||
64 | #include <klistview.h> | 72 | #include <klistview.h> |
65 | 73 | ||
66 | #include "kjanuswidget.h" | 74 | #include "kjanuswidget.h" |
67 | 75 | ||
68 | class KJanusWidget::IconListItem : public QListBoxItem | 76 | class KJanusWidget::IconListItem : public Q3ListBoxItem |
69 | { | 77 | { |
70 | public: | 78 | public: |
71 | IconListItem( QListBox *listbox, const QPixmap &pixmap, | 79 | IconListItem( Q3ListBox *listbox, const QPixmap &pixmap, |
72 | const QString &text ); | 80 | const QString &text ); |
73 | virtual int height( const QListBox *lb ) const; | 81 | virtual int height( const Q3ListBox *lb ) const; |
74 | virtual int width( const QListBox *lb ) const; | 82 | virtual int width( const Q3ListBox *lb ) const; |
75 | int expandMinimumWidth( int width ); | 83 | int expandMinimumWidth( int width ); |
76 | 84 | ||
77 | protected: | 85 | protected: |
78 | const QPixmap &defaultPixmap(); | 86 | const QPixmap &defaultPixmap(); |
@@ -97,23 +105,23 @@ public: | |||
97 | // Dictionary of title string associated with page. | 105 | // Dictionary of title string associated with page. |
98 | QMap<int, QString> mIntToTitle; | 106 | QMap<int, QString> mIntToTitle; |
99 | }; | 107 | }; |
100 | 108 | ||
101 | template class QPtrList<QListViewItem>; | 109 | template class Q3PtrList<Q3ListViewItem>; |
102 | 110 | ||
103 | 111 | ||
104 | KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) | 112 | KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) |
105 | : QWidget( parent, name ), | 113 | : QWidget( parent, name ), |
106 | mValid(false), mPageList(0), | 114 | mValid(false), mPageList(0), |
107 | mTitleList(0), mFace(face), mTitleLabel(0), mActivePageWidget(0), | 115 | mTitleList(0), mFace(face), mTitleLabel(0), mActivePageWidget(0), |
108 | mShowIconsInTreeList(false), d(0) | 116 | mShowIconsInTreeList(false), d(0) |
109 | { | 117 | { |
110 | QVBoxLayout *topLayout = new QVBoxLayout( this ); | 118 | Q3VBoxLayout *topLayout = new Q3VBoxLayout( this ); |
111 | if( mFace == TreeList || mFace == IconList ) | 119 | if( mFace == TreeList || mFace == IconList ) |
112 | { | 120 | { |
113 | d = new KJanusWidgetPrivate; | 121 | d = new KJanusWidgetPrivate; |
114 | 122 | ||
115 | QFrame *page = 0; | 123 | Q3Frame *page = 0; |
116 | if( mFace == TreeList ) | 124 | if( mFace == TreeList ) |
117 | { | 125 | { |
118 | //US | 126 | //US |
119 | qDebug("KJanusWidget::KJanusWidget TreeList not implemented yet"); | 127 | qDebug("KJanusWidget::KJanusWidget TreeList not implemented yet"); |
@@ -144,9 +152,9 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) | |||
144 | */ | 152 | */ |
145 | } | 153 | } |
146 | else | 154 | else |
147 | { | 155 | { |
148 | QHBoxLayout *hbox = new QHBoxLayout( topLayout ); | 156 | Q3HBoxLayout *hbox = new Q3HBoxLayout( topLayout ); |
149 | mIconList = new IconListBox( this ); | 157 | mIconList = new IconListBox( this ); |
150 | 158 | ||
151 | QFont listFont( mIconList->font() ); | 159 | QFont listFont( mIconList->font() ); |
152 | listFont.setBold( true ); | 160 | listFont.setBold( true ); |
@@ -155,18 +163,18 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) | |||
155 | mIconList->verticalScrollBar()->installEventFilter( this ); | 163 | mIconList->verticalScrollBar()->installEventFilter( this ); |
156 | hbox->addWidget( mIconList ); | 164 | hbox->addWidget( mIconList ); |
157 | connect( mIconList, SIGNAL(selectionChanged()), SLOT(slotShowPage())); | 165 | connect( mIconList, SIGNAL(selectionChanged()), SLOT(slotShowPage())); |
158 | hbox->addSpacing( KDialog::marginHint() ); | 166 | hbox->addSpacing( KDialog::marginHint() ); |
159 | page = new QFrame( this ); | 167 | page = new Q3Frame( this ); |
160 | hbox->addWidget( page, 10 ); | 168 | hbox->addWidget( page, 10 ); |
161 | } | 169 | } |
162 | 170 | ||
163 | // | 171 | // |
164 | // Rest of page area. Title at top with a separator below and a | 172 | // Rest of page area. Title at top with a separator below and a |
165 | // pagestack using all available space at bottom. | 173 | // pagestack using all available space at bottom. |
166 | // | 174 | // |
167 | 175 | ||
168 | QVBoxLayout *vbox = new QVBoxLayout( page, 0, KDialog::spacingHint() ); | 176 | Q3VBoxLayout *vbox = new Q3VBoxLayout( page, 0, KDialog::spacingHint() ); |
169 | 177 | ||
170 | mTitleLabel = new QLabel( QString::fromLatin1("Empty page"), page, "KJanusWidgetTitleLabel" ); | 178 | mTitleLabel = new QLabel( QString::fromLatin1("Empty page"), page, "KJanusWidgetTitleLabel" ); |
171 | vbox->addWidget( mTitleLabel ); | 179 | vbox->addWidget( mTitleLabel ); |
172 | 180 | ||
@@ -174,12 +182,12 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) | |||
174 | titleFont.setBold( true ); | 182 | titleFont.setBold( true ); |
175 | mTitleLabel->setFont( titleFont ); | 183 | mTitleLabel->setFont( titleFont ); |
176 | 184 | ||
177 | mTitleSep = new KSeparator( page ); | 185 | mTitleSep = new KSeparator( page ); |
178 | mTitleSep->setFrameStyle( QFrame::HLine|QFrame::Plain ); | 186 | mTitleSep->setFrameStyle( Q3Frame::HLine|Q3Frame::Plain ); |
179 | vbox->addWidget( mTitleSep ); | 187 | vbox->addWidget( mTitleSep ); |
180 | 188 | ||
181 | mPageStack = new QWidgetStack( page ); | 189 | mPageStack = new Q3WidgetStack( page ); |
182 | connect(mPageStack, SIGNAL(aboutToShow(QWidget *)), | 190 | connect(mPageStack, SIGNAL(aboutToShow(QWidget *)), |
183 | SIGNAL(aboutToShowPage(QWidget *))); | 191 | SIGNAL(aboutToShowPage(QWidget *))); |
184 | vbox->addWidget( mPageStack, 10 ); | 192 | vbox->addWidget( mPageStack, 10 ); |
185 | } | 193 | } |
@@ -198,9 +206,9 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) | |||
198 | } | 206 | } |
199 | else | 207 | else |
200 | { | 208 | { |
201 | mFace = Plain; | 209 | mFace = Plain; |
202 | mPlainPage = new QFrame( this ); | 210 | mPlainPage = new Q3Frame( this ); |
203 | topLayout->addWidget( mPlainPage, 10 ); | 211 | topLayout->addWidget( mPlainPage, 10 ); |
204 | } | 212 | } |
205 | /*US | 213 | /*US |
206 | if ( kapp ) | 214 | if ( kapp ) |
@@ -244,9 +252,9 @@ bool KJanusWidget::isValid() const | |||
244 | return( mValid ); | 252 | return( mValid ); |
245 | } | 253 | } |
246 | 254 | ||
247 | 255 | ||
248 | QFrame *KJanusWidget::plainPage() | 256 | Q3Frame *KJanusWidget::plainPage() |
249 | { | 257 | { |
250 | return( mPlainPage ); | 258 | return( mPlainPage ); |
251 | } | 259 | } |
252 | 260 | ||
@@ -265,18 +273,18 @@ QWidget *KJanusWidget::FindParent() | |||
265 | return this; | 273 | return this; |
266 | } | 274 | } |
267 | } | 275 | } |
268 | 276 | ||
269 | QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header, | 277 | Q3Frame *KJanusWidget::addPage( const QStringList &items, const QString &header, |
270 | const QPixmap &pixmap ) | 278 | const QPixmap &pixmap ) |
271 | { | 279 | { |
272 | if( mValid == false ) | 280 | if( mValid == false ) |
273 | { | 281 | { |
274 | kdDebug() << "addPage: Invalid object" << endl; | 282 | kdDebug() << "addPage: Invalid object" << endl; |
275 | return( 0 ); | 283 | return( 0 ); |
276 | } | 284 | } |
277 | 285 | ||
278 | QFrame *page = new QFrame( FindParent(), "page" ); | 286 | Q3Frame *page = new Q3Frame( FindParent(), "page" ); |
279 | addPageWidget( page, items, header, pixmap ); | 287 | addPageWidget( page, items, header, pixmap ); |
280 | 288 | ||
281 | return page; | 289 | return page; |
282 | } | 290 | } |
@@ -286,15 +294,15 @@ void KJanusWidget::pageGone( QObject *obj ) | |||
286 | // QObject* obj = (QObject*)sender(); | 294 | // QObject* obj = (QObject*)sender(); |
287 | removePage( static_cast<QWidget*>( obj ) ); | 295 | removePage( static_cast<QWidget*>( obj ) ); |
288 | } | 296 | } |
289 | 297 | ||
290 | void KJanusWidget::slotReopen( QListViewItem * item ) | 298 | void KJanusWidget::slotReopen( Q3ListViewItem * item ) |
291 | { | 299 | { |
292 | if( item ) | 300 | if( item ) |
293 | item->setOpen( true ); | 301 | item->setOpen( true ); |
294 | } | 302 | } |
295 | 303 | ||
296 | QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header, | 304 | Q3Frame *KJanusWidget::addPage( const QString &itemName, const QString &header, |
297 | const QPixmap &pixmap ) | 305 | const QPixmap &pixmap ) |
298 | { | 306 | { |
299 | 307 | ||
300 | QStringList items; | 308 | QStringList items; |
@@ -303,9 +311,9 @@ QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header, | |||
303 | } | 311 | } |
304 | 312 | ||
305 | 313 | ||
306 | 314 | ||
307 | QVBox *KJanusWidget::addVBoxPage( const QStringList &items, | 315 | Q3VBox *KJanusWidget::addVBoxPage( const QStringList &items, |
308 | const QString &header, | 316 | const QString &header, |
309 | const QPixmap &pixmap ) | 317 | const QPixmap &pixmap ) |
310 | { | 318 | { |
311 | if( mValid == false ) | 319 | if( mValid == false ) |
@@ -314,50 +322,50 @@ QVBox *KJanusWidget::addVBoxPage( const QStringList &items, | |||
314 | 322 | ||
315 | return( 0 ); | 323 | return( 0 ); |
316 | } | 324 | } |
317 | 325 | ||
318 | QVBox *page = new QVBox(FindParent() , "vbox_page" ); | 326 | Q3VBox *page = new Q3VBox(FindParent() , "vbox_page" ); |
319 | page->setSpacing( KDialog::spacingHintSmall() ); | 327 | page->setSpacing( KDialog::spacingHintSmall() ); |
320 | addPageWidget( page, items, header, pixmap ); | 328 | addPageWidget( page, items, header, pixmap ); |
321 | 329 | ||
322 | return page; | 330 | return page; |
323 | } | 331 | } |
324 | 332 | ||
325 | QVBox *KJanusWidget::addVBoxPage( const QString &itemName, | 333 | Q3VBox *KJanusWidget::addVBoxPage( const QString &itemName, |
326 | const QString &header, | 334 | const QString &header, |
327 | const QPixmap &pixmap ) | 335 | const QPixmap &pixmap ) |
328 | { | 336 | { |
329 | QStringList items; | 337 | QStringList items; |
330 | items << itemName; | 338 | items << itemName; |
331 | return addVBoxPage(items, header, pixmap); | 339 | return addVBoxPage(items, header, pixmap); |
332 | } | 340 | } |
333 | 341 | ||
334 | QHBox *KJanusWidget::addHBoxPage( const QStringList &items, | 342 | Q3HBox *KJanusWidget::addHBoxPage( const QStringList &items, |
335 | const QString &header, | 343 | const QString &header, |
336 | const QPixmap &pixmap ) | 344 | const QPixmap &pixmap ) |
337 | { | 345 | { |
338 | if( mValid == false ) { | 346 | if( mValid == false ) { |
339 | kdDebug() << "addPage: Invalid object" << endl; | 347 | kdDebug() << "addPage: Invalid object" << endl; |
340 | return( 0 ); | 348 | return( 0 ); |
341 | } | 349 | } |
342 | 350 | ||
343 | QHBox *page = new QHBox(FindParent(), "hbox_page"); | 351 | Q3HBox *page = new Q3HBox(FindParent(), "hbox_page"); |
344 | page->setSpacing( KDialog::spacingHint() ); | 352 | page->setSpacing( KDialog::spacingHint() ); |
345 | addPageWidget( page, items, header, pixmap ); | 353 | addPageWidget( page, items, header, pixmap ); |
346 | 354 | ||
347 | return page; | 355 | return page; |
348 | } | 356 | } |
349 | 357 | ||
350 | QHBox *KJanusWidget::addHBoxPage( const QString &itemName, | 358 | Q3HBox *KJanusWidget::addHBoxPage( const QString &itemName, |
351 | const QString &header, | 359 | const QString &header, |
352 | const QPixmap &pixmap ) | 360 | const QPixmap &pixmap ) |
353 | { | 361 | { |
354 | QStringList items; | 362 | QStringList items; |
355 | items << itemName; | 363 | items << itemName; |
356 | return addHBoxPage(items, header, pixmap); | 364 | return addHBoxPage(items, header, pixmap); |
357 | } | 365 | } |
358 | 366 | ||
359 | QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, | 367 | Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir, |
360 | const QStringList &items, | 368 | const QStringList &items, |
361 | const QString &header, | 369 | const QString &header, |
362 | const QPixmap &pixmap ) | 370 | const QPixmap &pixmap ) |
363 | { | 371 | { |
@@ -366,17 +374,17 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, | |||
366 | kdDebug() << "addPage: Invalid object" << endl; | 374 | kdDebug() << "addPage: Invalid object" << endl; |
367 | return( 0 ); | 375 | return( 0 ); |
368 | } | 376 | } |
369 | 377 | ||
370 | QGrid *page = new QGrid( n, dir, FindParent(), "page" ); | 378 | Q3Grid *page = new Q3Grid( n, dir, FindParent(), "page" ); |
371 | page->setSpacing( KDialog::spacingHint() ); | 379 | page->setSpacing( KDialog::spacingHint() ); |
372 | addPageWidget( page, items, header, pixmap ); | 380 | addPageWidget( page, items, header, pixmap ); |
373 | 381 | ||
374 | return page; | 382 | return page; |
375 | } | 383 | } |
376 | 384 | ||
377 | 385 | ||
378 | QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, | 386 | Q3Grid *KJanusWidget::addGridPage( int n, Qt::Orientation dir, |
379 | const QString &itemName, | 387 | const QString &itemName, |
380 | const QString &header, | 388 | const QString &header, |
381 | const QPixmap &pixmap ) | 389 | const QPixmap &pixmap ) |
382 | { | 390 | { |
@@ -384,12 +392,12 @@ QGrid *KJanusWidget::addGridPage( int n, QGrid::Direction dir, | |||
384 | items << itemName; | 392 | items << itemName; |
385 | return addGridPage(n, dir, items, header, pixmap); | 393 | return addGridPage(n, dir, items, header, pixmap); |
386 | } | 394 | } |
387 | 395 | ||
388 | void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page) | 396 | void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page) |
389 | { | 397 | { |
390 | bool isTop = true; | 398 | bool isTop = true; |
391 | QListViewItem *curTop = 0, *child, *last, *newChild; | 399 | Q3ListViewItem *curTop = 0, *child, *last, *newChild; |
392 | unsigned int index = 1; | 400 | unsigned int index = 1; |
393 | QStringList curPath; | 401 | QStringList curPath; |
394 | 402 | ||
395 | for ( QStringList::ConstIterator it = items.begin(); it != items.end(); ++it, index++ ) { | 403 | for ( QStringList::ConstIterator it = items.begin(); it != items.end(); ++it, index++ ) { |
@@ -411,11 +419,11 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p | |||
411 | if (last == 0 && child == 0) { | 419 | if (last == 0 && child == 0) { |
412 | // This node didn't have any children at all, lets just insert the | 420 | // This node didn't have any children at all, lets just insert the |
413 | // new child. | 421 | // new child. |
414 | if (isTop) | 422 | if (isTop) |
415 | newChild = new QListViewItem(mTreeList, name); | 423 | newChild = new Q3ListViewItem(mTreeList, name); |
416 | else | 424 | else |
417 | newChild = new QListViewItem(curTop, name); | 425 | newChild = new Q3ListViewItem(curTop, name); |
418 | 426 | ||
419 | } | 427 | } |
420 | else if (child != 0) { | 428 | else if (child != 0) { |
421 | // we found the given name in this child. | 429 | // we found the given name in this child. |
@@ -430,11 +438,11 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p | |||
430 | } | 438 | } |
431 | else { | 439 | else { |
432 | // the node had some children, but we didn't find the given name | 440 | // the node had some children, but we didn't find the given name |
433 | if (isTop) | 441 | if (isTop) |
434 | newChild = new QListViewItem(mTreeList, last, name); | 442 | newChild = new Q3ListViewItem(mTreeList, last, name); |
435 | else | 443 | else |
436 | newChild = new QListViewItem(curTop, last, name); | 444 | newChild = new Q3ListViewItem(curTop, last, name); |
437 | } | 445 | } |
438 | 446 | ||
439 | // Now make the element expandable if it is a path component, and make | 447 | // Now make the element expandable if it is a path component, and make |
440 | // ready for next loop | 448 | // ready for next loop |
@@ -458,9 +466,9 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p | |||
458 | } | 466 | } |
459 | } | 467 | } |
460 | } | 468 | } |
461 | 469 | ||
462 | void KJanusWidget::addPageWidget( QFrame *page, const QStringList &items, | 470 | void KJanusWidget::addPageWidget( Q3Frame *page, const QStringList &items, |
463 | const QString &header,const QPixmap &pixmap ) | 471 | const QString &header,const QPixmap &pixmap ) |
464 | { | 472 | { |
465 | /*US the following signal causes a segmentation fault while closing the dialog. | 473 | /*US the following signal causes a segmentation fault while closing the dialog. |
466 | Why not just remove all pages in the destructor?? | 474 | Why not just remove all pages in the destructor?? |
@@ -549,17 +557,17 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget ) | |||
549 | if( mSwallowPage->layout() != 0 ) | 557 | if( mSwallowPage->layout() != 0 ) |
550 | { | 558 | { |
551 | delete mSwallowPage->layout(); | 559 | delete mSwallowPage->layout(); |
552 | } | 560 | } |
553 | QGridLayout *gbox = new QGridLayout( mSwallowPage, 1, 1, 0 ); | 561 | Q3GridLayout *gbox = new Q3GridLayout( mSwallowPage, 1, 1, 0 ); |
554 | 562 | ||
555 | // | 563 | // |
556 | // Hide old children | 564 | // Hide old children |
557 | // | 565 | // |
558 | QObjectList *l = (QObjectList*)mSwallowPage->children(); // silence please | 566 | QObjectList l = mSwallowPage->children(); // silence please |
559 | for( uint i=0; i < l->count(); i++ ) | 567 | for( uint i=0; i < l.count(); i++ ) |
560 | { | 568 | { |
561 | QObject *o = l->at(i); | 569 | QObject *o = l.at(i); |
562 | if( o->isWidgetType() ) | 570 | if( o->isWidgetType() ) |
563 | { | 571 | { |
564 | ((QWidget*)o)->hide(); | 572 | ((QWidget*)o)->hide(); |
565 | } | 573 | } |
@@ -596,18 +604,18 @@ bool KJanusWidget::slotShowPage() | |||
596 | } | 604 | } |
597 | 605 | ||
598 | if( mFace == TreeList ) | 606 | if( mFace == TreeList ) |
599 | { | 607 | { |
600 | QListViewItem *node = mTreeList->selectedItem(); | 608 | Q3ListViewItem *node = mTreeList->selectedItem(); |
601 | if( node == 0 ) { return( false ); } | 609 | if( node == 0 ) { return( false ); } |
602 | 610 | ||
603 | QWidget *stackItem = mTreeListToPageStack[node]; | 611 | QWidget *stackItem = mTreeListToPageStack[node]; |
604 | // Make sure to call through the virtual function showPage(int) | 612 | // Make sure to call through the virtual function showPage(int) |
605 | return showPage(d->mPageToInt[stackItem]); | 613 | return showPage(d->mPageToInt[stackItem]); |
606 | } | 614 | } |
607 | else if( mFace == IconList ) | 615 | else if( mFace == IconList ) |
608 | { | 616 | { |
609 | QListBoxItem *node = mIconList->item( mIconList->currentItem() ); | 617 | Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() ); |
610 | if( node == 0 ) { return( false ); } | 618 | if( node == 0 ) { return( false ); } |
611 | QWidget *stackItem = mIconListToPageStack[node]; | 619 | QWidget *stackItem = mIconListToPageStack[node]; |
612 | // Make sure to call through the virtual function showPage(int) | 620 | // Make sure to call through the virtual function showPage(int) |
613 | return showPage(d->mPageToInt[stackItem]); | 621 | return showPage(d->mPageToInt[stackItem]); |
@@ -645,11 +653,11 @@ bool KJanusWidget::showPage( QWidget *w ) | |||
645 | int index = d->mPageToInt[w]; | 653 | int index = d->mPageToInt[w]; |
646 | mTitleLabel->setText( d->mIntToTitle[index] ); | 654 | mTitleLabel->setText( d->mIntToTitle[index] ); |
647 | if( mFace == TreeList ) | 655 | if( mFace == TreeList ) |
648 | { | 656 | { |
649 | QMap<QListViewItem *, QWidget *>::Iterator it; | 657 | QMap<Q3ListViewItem *, QWidget *>::Iterator it; |
650 | for (it = mTreeListToPageStack.begin(); it != mTreeListToPageStack.end(); ++it){ | 658 | for (it = mTreeListToPageStack.begin(); it != mTreeListToPageStack.end(); ++it){ |
651 | QListViewItem *key = it.key(); | 659 | Q3ListViewItem *key = it.key(); |
652 | QWidget *val = it.data(); | 660 | QWidget *val = it.data(); |
653 | if (val == w) { | 661 | if (val == w) { |
654 | mTreeList->setSelected(key, true ); | 662 | mTreeList->setSelected(key, true ); |
655 | break; | 663 | break; |
@@ -657,11 +665,11 @@ bool KJanusWidget::showPage( QWidget *w ) | |||
657 | } | 665 | } |
658 | } | 666 | } |
659 | else | 667 | else |
660 | { | 668 | { |
661 | QMap<QListBoxItem *, QWidget *>::Iterator it; | 669 | QMap<Q3ListBoxItem *, QWidget *>::Iterator it; |
662 | for (it = mIconListToPageStack.begin(); it != mIconListToPageStack.end(); ++it){ | 670 | for (it = mIconListToPageStack.begin(); it != mIconListToPageStack.end(); ++it){ |
663 | QListBoxItem *key = it.key(); | 671 | Q3ListBoxItem *key = it.key(); |
664 | QWidget *val = it.data(); | 672 | QWidget *val = it.data(); |
665 | if (val == w) { | 673 | if (val == w) { |
666 | mIconList->setSelected( key, true ); | 674 | mIconList->setSelected( key, true ); |
667 | break; | 675 | break; |
@@ -685,15 +693,15 @@ bool KJanusWidget::showPage( QWidget *w ) | |||
685 | 693 | ||
686 | int KJanusWidget::activePageIndex() const | 694 | int KJanusWidget::activePageIndex() const |
687 | { | 695 | { |
688 | if( mFace == TreeList) { | 696 | if( mFace == TreeList) { |
689 | QListViewItem *node = mTreeList->selectedItem(); | 697 | Q3ListViewItem *node = mTreeList->selectedItem(); |
690 | if( node == 0 ) { return -1; } | 698 | if( node == 0 ) { return -1; } |
691 | QWidget *stackItem = mTreeListToPageStack[node]; | 699 | QWidget *stackItem = mTreeListToPageStack[node]; |
692 | return d->mPageToInt[stackItem]; | 700 | return d->mPageToInt[stackItem]; |
693 | } | 701 | } |
694 | else if (mFace == IconList) { | 702 | else if (mFace == IconList) { |
695 | QListBoxItem *node = mIconList->item( mIconList->currentItem() ); | 703 | Q3ListBoxItem *node = mIconList->item( mIconList->currentItem() ); |
696 | if( node == 0 ) { return( false ); } | 704 | if( node == 0 ) { return( false ); } |
697 | QWidget *stackItem = mIconListToPageStack[node]; | 705 | QWidget *stackItem = mIconListToPageStack[node]; |
698 | return d->mPageToInt[stackItem]; | 706 | return d->mPageToInt[stackItem]; |
699 | } | 707 | } |
@@ -760,9 +768,9 @@ void KJanusWidget::slotFontChanged() | |||
760 | } | 768 | } |
761 | */ | 769 | */ |
762 | 770 | ||
763 | // makes the treelist behave like the list of kcontrol | 771 | // makes the treelist behave like the list of kcontrol |
764 | void KJanusWidget::slotItemClicked(QListViewItem *it) | 772 | void KJanusWidget::slotItemClicked(Q3ListViewItem *it) |
765 | { | 773 | { |
766 | if(it && (it->childCount()>0)) | 774 | if(it && (it->childCount()>0)) |
767 | it->setOpen(!it->isOpen()); | 775 | it->setOpen(!it->isOpen()); |
768 | } | 776 | } |
@@ -894,13 +902,13 @@ void KJanusWidget::unfoldTreeList( bool persist ) | |||
894 | { | 902 | { |
895 | if( mFace == TreeList ) | 903 | if( mFace == TreeList ) |
896 | { | 904 | { |
897 | if( persist ) | 905 | if( persist ) |
898 | connect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); | 906 | connect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) ); |
899 | else | 907 | else |
900 | disconnect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); | 908 | disconnect( mTreeList, SIGNAL( collapsed( Q3ListViewItem * ) ), this, SLOT( slotReopen( Q3ListViewItem * ) ) ); |
901 | 909 | ||
902 | for( QListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) | 910 | for( Q3ListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) |
903 | item->setOpen( true ); | 911 | item->setOpen( true ); |
904 | } | 912 | } |
905 | } | 913 | } |
906 | 914 | ||
@@ -952,9 +960,9 @@ bool KJanusWidget::eventFilter( QObject *o, QEvent *e ) | |||
952 | // | 960 | // |
953 | 961 | ||
954 | 962 | ||
955 | KJanusWidget::IconListBox::IconListBox( QWidget *parent, const char *name, | 963 | KJanusWidget::IconListBox::IconListBox( QWidget *parent, const char *name, |
956 | WFlags f ) | 964 | Qt::WFlags f ) |
957 | :KListBox( parent, name, f ), mShowAll(false), mHeightValid(false), | 965 | :KListBox( parent, name, f ), mShowAll(false), mHeightValid(false), |
958 | mWidthValid(false) | 966 | mWidthValid(false) |
959 | { | 967 | { |
960 | } | 968 | } |
@@ -964,9 +972,9 @@ void KJanusWidget::IconListBox::updateMinimumHeight() | |||
964 | { | 972 | { |
965 | if( mShowAll == true && mHeightValid == false ) | 973 | if( mShowAll == true && mHeightValid == false ) |
966 | { | 974 | { |
967 | int h = frameWidth()*2; | 975 | int h = frameWidth()*2; |
968 | for( QListBoxItem *i = item(0); i != 0; i = i->next() ) | 976 | for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) |
969 | { | 977 | { |
970 | h += i->height( this ); | 978 | h += i->height( this ); |
971 | } | 979 | } |
972 | setMinimumHeight( h ); | 980 | setMinimumHeight( h ); |
@@ -979,15 +987,15 @@ void KJanusWidget::IconListBox::updateWidth() | |||
979 | { | 987 | { |
980 | if( mWidthValid == false ) | 988 | if( mWidthValid == false ) |
981 | { | 989 | { |
982 | int maxWidth = 10; | 990 | int maxWidth = 10; |
983 | for( QListBoxItem *i = item(0); i != 0; i = i->next() ) | 991 | for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) |
984 | { | 992 | { |
985 | int w = ((IconListItem *)i)->width(this); | 993 | int w = ((IconListItem *)i)->width(this); |
986 | maxWidth = QMAX( w, maxWidth ); | 994 | maxWidth = QMAX( w, maxWidth ); |
987 | } | 995 | } |
988 | 996 | ||
989 | for( QListBoxItem *i = item(0); i != 0; i = i->next() ) | 997 | for( Q3ListBoxItem *i = item(0); i != 0; i = i->next() ) |
990 | { | 998 | { |
991 | ((IconListItem *)i)->expandMinimumWidth( maxWidth ); | 999 | ((IconListItem *)i)->expandMinimumWidth( maxWidth ); |
992 | } | 1000 | } |
993 | 1001 | ||
@@ -1021,11 +1029,11 @@ void KJanusWidget::IconListBox::setShowAll( bool showAll ) | |||
1021 | } | 1029 | } |
1022 | 1030 | ||
1023 | 1031 | ||
1024 | 1032 | ||
1025 | KJanusWidget::IconListItem::IconListItem( QListBox *listbox, const QPixmap &pixmap, | 1033 | KJanusWidget::IconListItem::IconListItem( Q3ListBox *listbox, const QPixmap &pixmap, |
1026 | const QString &text ) | 1034 | const QString &text ) |
1027 | : QListBoxItem( listbox ) | 1035 | : Q3ListBoxItem( listbox ) |
1028 | { | 1036 | { |
1029 | mPixmap = pixmap; | 1037 | mPixmap = pixmap; |
1030 | if( mPixmap.isNull() == true ) | 1038 | if( mPixmap.isNull() == true ) |
1031 | { | 1039 | { |
@@ -1082,9 +1090,9 @@ void KJanusWidget::IconListItem::paint( QPainter *painter ) | |||
1082 | painter->drawText( 0, hp+7, mMinimumWidth, ht, Qt::AlignCenter, text() ); | 1090 | painter->drawText( 0, hp+7, mMinimumWidth, ht, Qt::AlignCenter, text() ); |
1083 | } | 1091 | } |
1084 | } | 1092 | } |
1085 | 1093 | ||
1086 | int KJanusWidget::IconListItem::height( const QListBox *lb ) const | 1094 | int KJanusWidget::IconListItem::height( const Q3ListBox *lb ) const |
1087 | { | 1095 | { |
1088 | if( text().isEmpty() == true ) | 1096 | if( text().isEmpty() == true ) |
1089 | { | 1097 | { |
1090 | return( mPixmap.height() ); | 1098 | return( mPixmap.height() ); |
@@ -1095,9 +1103,9 @@ int KJanusWidget::IconListItem::height( const QListBox *lb ) const | |||
1095 | } | 1103 | } |
1096 | } | 1104 | } |
1097 | 1105 | ||
1098 | 1106 | ||
1099 | int KJanusWidget::IconListItem::width( const QListBox *lb ) const | 1107 | int KJanusWidget::IconListItem::width( const Q3ListBox *lb ) const |
1100 | { | 1108 | { |
1101 | int wt = lb->fontMetrics().boundingRect(text()).width()+10; | 1109 | int wt = lb->fontMetrics().boundingRect(text()).width()+10; |
1102 | int wp = mPixmap.width() + 10; | 1110 | int wp = mPixmap.width() + 10; |
1103 | int w = QMAX( wt, wp ); | 1111 | int w = QMAX( wt, wp ); |
@@ -1121,9 +1129,9 @@ void KJanusWidget::removePage( QWidget *page ) | |||
1121 | int index = d->mPageToInt[page]; | 1129 | int index = d->mPageToInt[page]; |
1122 | 1130 | ||
1123 | if ( mFace == TreeList ) | 1131 | if ( mFace == TreeList ) |
1124 | { | 1132 | { |
1125 | QMap<QListViewItem*, QWidget *>::Iterator i; | 1133 | QMap<Q3ListViewItem*, QWidget *>::Iterator i; |
1126 | for( i = mTreeListToPageStack.begin(); i != mTreeListToPageStack.end(); ++i ) | 1134 | for( i = mTreeListToPageStack.begin(); i != mTreeListToPageStack.end(); ++i ) |
1127 | if (i.data()==page) | 1135 | if (i.data()==page) |
1128 | { | 1136 | { |
1129 | delete i.key(); | 1137 | delete i.key(); |
@@ -1136,9 +1144,9 @@ void KJanusWidget::removePage( QWidget *page ) | |||
1136 | } | 1144 | } |
1137 | } | 1145 | } |
1138 | else if ( mFace == IconList ) | 1146 | else if ( mFace == IconList ) |
1139 | { | 1147 | { |
1140 | QMap<QListBoxItem*, QWidget *>::Iterator i; | 1148 | QMap<Q3ListBoxItem*, QWidget *>::Iterator i; |
1141 | for( i = mIconListToPageStack.begin(); i != mIconListToPageStack.end(); ++i ) | 1149 | for( i = mIconListToPageStack.begin(); i != mIconListToPageStack.end(); ++i ) |
1142 | if (i.data()==page) | 1150 | if (i.data()==page) |
1143 | { | 1151 | { |
1144 | delete i.key(); | 1152 | delete i.key(); |
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 | |||
@@ -19,12 +19,18 @@ | |||
19 | 19 | ||
20 | #ifndef _KJANUS_WIDGET_H_ | 20 | #ifndef _KJANUS_WIDGET_H_ |
21 | #define _KJANUS_WIDGET_H_ | 21 | #define _KJANUS_WIDGET_H_ |
22 | 22 | ||
23 | #include <qptrlist.h> | 23 | #include <q3ptrlist.h> |
24 | #include <qwidget.h> | 24 | #include <qwidget.h> |
25 | #include <qmap.h> | 25 | #include <qmap.h> |
26 | #include <qgrid.h> | 26 | #include <q3grid.h> |
27 | //Added by qt3to4: | ||
28 | #include <QShowEvent> | ||
29 | #include <Q3Frame> | ||
30 | #include <QPixmap> | ||
31 | #include <QLabel> | ||
32 | #include <QEvent> | ||
27 | #include <klistbox.h> | 33 | #include <klistbox.h> |
28 | 34 | ||
29 | /*US | 35 | /*US |
30 | #include <qptrlist.h> | 36 | #include <qptrlist.h> |
@@ -37,14 +43,14 @@ | |||
37 | */ | 43 | */ |
38 | 44 | ||
39 | class KSeparator; | 45 | class KSeparator; |
40 | class KListView; | 46 | class KListView; |
41 | class QWidgetStack; | 47 | class Q3WidgetStack; |
42 | class QLabel; | 48 | class QLabel; |
43 | class QTabWidget; | 49 | class QTabWidget; |
44 | class QListViewItem; | 50 | class Q3ListViewItem; |
45 | class QVBox; | 51 | class Q3VBox; |
46 | class QHBox; | 52 | class Q3HBox; |
47 | 53 | ||
48 | /** | 54 | /** |
49 | * Provides a number of ready to use layouts (faces). It is used | 55 | * Provides a number of ready to use layouts (faces). It is used |
50 | * as an internal widget in @ref KDialogBase, but can also used as a | 56 | * as an internal widget in @ref KDialogBase, but can also used as a |
@@ -101,9 +107,9 @@ class KJanusWidget : public QWidget | |||
101 | private: | 107 | private: |
102 | class IconListBox : public KListBox | 108 | class IconListBox : public KListBox |
103 | { | 109 | { |
104 | public: | 110 | public: |
105 | IconListBox( QWidget *parent=0, const char *name=0, WFlags f=0 ); | 111 | IconListBox( QWidget *parent=0, const char *name=0, Qt::WFlags f=0 ); |
106 | void updateMinimumHeight(); | 112 | void updateMinimumHeight(); |
107 | void updateWidth(); | 113 | void updateWidth(); |
108 | void invalidateHeight(); | 114 | void invalidateHeight(); |
109 | void invalidateWidth(); | 115 | void invalidateWidth(); |
@@ -192,9 +198,9 @@ class KJanusWidget : public QWidget | |||
192 | * Returns the empty widget that is available in Plain mode. | 198 | * Returns the empty widget that is available in Plain mode. |
193 | * | 199 | * |
194 | * @return The widget or 0 if the face in not Plain. | 200 | * @return The widget or 0 if the face in not Plain. |
195 | */ | 201 | */ |
196 | virtual QFrame *plainPage(); | 202 | virtual Q3Frame *plainPage(); |
197 | 203 | ||
198 | /** | 204 | /** |
199 | * Add a new page when the class is used in TreeList, IconList or Tabbed | 205 | * Add a new page when the class is used in TreeList, IconList or Tabbed |
200 | * mode. The returned widget is empty and you must add your widgets | 206 | * mode. The returned widget is empty and you must add your widgets |
@@ -213,9 +219,9 @@ class KJanusWidget : public QWidget | |||
213 | * | 219 | * |
214 | * @return The empty page or 0 if the face is not TreeList, IconList or | 220 | * @return The empty page or 0 if the face is not TreeList, IconList or |
215 | * Tabbed. | 221 | * Tabbed. |
216 | */ | 222 | */ |
217 | virtual QFrame *addPage(const QString &item,const QString &header=QString::null, | 223 | virtual Q3Frame *addPage(const QString &item,const QString &header=QString::null, |
218 | const QPixmap &pixmap=QPixmap() ); | 224 | const QPixmap &pixmap=QPixmap() ); |
219 | 225 | ||
220 | /** | 226 | /** |
221 | * This is like addPage just above, with the difference that the first | 227 | * This is like addPage just above, with the difference that the first |
@@ -230,9 +236,9 @@ class KJanusWidget : public QWidget | |||
230 | * | 236 | * |
231 | * Deleting the returned frame will cause the listitem or tab to be | 237 | * Deleting the returned frame will cause the listitem or tab to be |
232 | * removed (you can re-add a page with the same name later. | 238 | * removed (you can re-add a page with the same name later. |
233 | **/ | 239 | **/ |
234 | virtual QFrame *addPage(const QStringList &items, const QString &header=QString::null, | 240 | virtual Q3Frame *addPage(const QStringList &items, const QString &header=QString::null, |
235 | const QPixmap &pixmap=QPixmap() ); | 241 | const QPixmap &pixmap=QPixmap() ); |
236 | 242 | ||
237 | /** | 243 | /** |
238 | * Add a new page when the class is used in TreeList, IconList or Tabbed | 244 | * Add a new page when the class is used in TreeList, IconList or Tabbed |
@@ -252,9 +258,9 @@ class KJanusWidget : public QWidget | |||
252 | * prefer a pixmap with size 32x32 pixels. | 258 | * prefer a pixmap with size 32x32 pixels. |
253 | * | 259 | * |
254 | * @return The empty page or 0 if the face is not TreeList, IconList or | 260 | * @return The empty page or 0 if the face is not TreeList, IconList or |
255 | * Tabbed. */ | 261 | * Tabbed. */ |
256 | virtual QVBox *addVBoxPage( const QString &item, | 262 | virtual Q3VBox *addVBoxPage( const QString &item, |
257 | const QString &header=QString::null, | 263 | const QString &header=QString::null, |
258 | const QPixmap &pixmap=QPixmap() ); | 264 | const QPixmap &pixmap=QPixmap() ); |
259 | 265 | ||
260 | /** | 266 | /** |
@@ -268,9 +274,9 @@ class KJanusWidget : public QWidget | |||
268 | * | 274 | * |
269 | * Deleting the returned frame will cause the listitem or tab to be | 275 | * Deleting the returned frame will cause the listitem or tab to be |
270 | * removed (you can re-add a page with the same name later. | 276 | * removed (you can re-add a page with the same name later. |
271 | **/ | 277 | **/ |
272 | virtual QVBox *addVBoxPage( const QStringList &items, | 278 | virtual Q3VBox *addVBoxPage( const QStringList &items, |
273 | const QString &header=QString::null, | 279 | const QString &header=QString::null, |
274 | const QPixmap &pixmap=QPixmap() ); | 280 | const QPixmap &pixmap=QPixmap() ); |
275 | 281 | ||
276 | /** | 282 | /** |
@@ -292,9 +298,9 @@ class KJanusWidget : public QWidget | |||
292 | * | 298 | * |
293 | * @return The empty page or 0 if the face is not TreeList, IconList or | 299 | * @return The empty page or 0 if the face is not TreeList, IconList or |
294 | * Tabbed. | 300 | * Tabbed. |
295 | */ | 301 | */ |
296 | virtual QHBox *addHBoxPage( const QString &itemName, | 302 | virtual Q3HBox *addHBoxPage( const QString &itemName, |
297 | const QString &header=QString::null, | 303 | const QString &header=QString::null, |
298 | const QPixmap &pixmap=QPixmap() ); | 304 | const QPixmap &pixmap=QPixmap() ); |
299 | 305 | ||
300 | /** | 306 | /** |
@@ -308,9 +314,9 @@ class KJanusWidget : public QWidget | |||
308 | * | 314 | * |
309 | * Deleting the returned frame will cause the listitem or tab to be | 315 | * Deleting the returned frame will cause the listitem or tab to be |
310 | * removed (you can re-add a page with the same name later. | 316 | * removed (you can re-add a page with the same name later. |
311 | **/ | 317 | **/ |
312 | virtual QHBox *addHBoxPage( const QStringList &items, | 318 | virtual Q3HBox *addHBoxPage( const QStringList &items, |
313 | const QString &header=QString::null, | 319 | const QString &header=QString::null, |
314 | const QPixmap &pixmap=QPixmap() ); | 320 | const QPixmap &pixmap=QPixmap() ); |
315 | 321 | ||
316 | /** | 322 | /** |
@@ -336,9 +342,9 @@ class KJanusWidget : public QWidget | |||
336 | * @return The empty page or 0 if the face is not TreeList, IconList or | 342 | * @return The empty page or 0 if the face is not TreeList, IconList or |
337 | * Tabbed. | 343 | * Tabbed. |
338 | */ | 344 | */ |
339 | //US changed Orientation into Direction for compatibility | 345 | //US changed Orientation into Direction for compatibility |
340 | virtual QGrid *addGridPage( int n, QGrid::Direction dir, | 346 | virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, |
341 | const QString &itemName, | 347 | const QString &itemName, |
342 | const QString &header=QString::null, | 348 | const QString &header=QString::null, |
343 | const QPixmap &pixmap=QPixmap() ); | 349 | const QPixmap &pixmap=QPixmap() ); |
344 | 350 | ||
@@ -354,9 +360,9 @@ class KJanusWidget : public QWidget | |||
354 | * Deleting the returned frame will cause the listitem or tab to be | 360 | * Deleting the returned frame will cause the listitem or tab to be |
355 | * removed (you can re-add a page with the same name later. | 361 | * removed (you can re-add a page with the same name later. |
356 | **/ | 362 | **/ |
357 | //US changed Orientation into Direction for compatibility | 363 | //US changed Orientation into Direction for compatibility |
358 | virtual QGrid *addGridPage( int n, QGrid::Direction dir, | 364 | virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, |
359 | const QStringList &items, | 365 | const QStringList &items, |
360 | const QString &header=QString::null, | 366 | const QString &header=QString::null, |
361 | const QPixmap &pixmap=QPixmap() ); | 367 | const QPixmap &pixmap=QPixmap() ); |
362 | 368 | ||
@@ -516,40 +522,40 @@ class KJanusWidget : public QWidget | |||
516 | 522 | ||
517 | private slots: | 523 | private slots: |
518 | bool slotShowPage(); | 524 | bool slotShowPage(); |
519 | //US not yet implemented void slotFontChanged(); | 525 | //US not yet implemented void slotFontChanged(); |
520 | void slotItemClicked(QListViewItem *it); | 526 | void slotItemClicked(Q3ListViewItem *it); |
521 | void pageGone( QObject *obj); // signal from the added page's "destroyed" signal | 527 | void pageGone( QObject *obj); // signal from the added page's "destroyed" signal |
522 | void slotReopen(QListViewItem *item); | 528 | void slotReopen(Q3ListViewItem *item); |
523 | 529 | ||
524 | protected: | 530 | protected: |
525 | bool showPage( QWidget *w ); | 531 | bool showPage( QWidget *w ); |
526 | void addPageWidget( QFrame *page, const QStringList &items, | 532 | void addPageWidget( Q3Frame *page, const QStringList &items, |
527 | const QString &header, const QPixmap &pixmap ); | 533 | const QString &header, const QPixmap &pixmap ); |
528 | void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page); | 534 | void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page); |
529 | QWidget *FindParent(); | 535 | QWidget *FindParent(); |
530 | 536 | ||
531 | private: | 537 | private: |
532 | bool mValid; | 538 | bool mValid; |
533 | 539 | ||
534 | // Obsolete members. Remove in KDE 4. | 540 | // Obsolete members. Remove in KDE 4. |
535 | QPtrList<QWidget> *mPageList; | 541 | Q3PtrList<QWidget> *mPageList; |
536 | QStringList *mTitleList; | 542 | QStringList *mTitleList; |
537 | 543 | ||
538 | int mFace; | 544 | int mFace; |
539 | KListView *mTreeList; | 545 | KListView *mTreeList; |
540 | IconListBox *mIconList; | 546 | IconListBox *mIconList; |
541 | QWidgetStack *mPageStack; | 547 | Q3WidgetStack *mPageStack; |
542 | QLabel *mTitleLabel; | 548 | QLabel *mTitleLabel; |
543 | QTabWidget *mTabControl; | 549 | QTabWidget *mTabControl; |
544 | QFrame *mPlainPage; | 550 | Q3Frame *mPlainPage; |
545 | QWidget *mSwallowPage; | 551 | QWidget *mSwallowPage; |
546 | QWidget *mActivePageWidget; | 552 | QWidget *mActivePageWidget; |
547 | KSeparator *mTitleSep; | 553 | KSeparator *mTitleSep; |
548 | //US QSplitter::ResizeMode mTreeListResizeMode; | 554 | //US QSplitter::ResizeMode mTreeListResizeMode; |
549 | bool mShowIconsInTreeList; | 555 | bool mShowIconsInTreeList; |
550 | QMap<QListViewItem *, QWidget *> mTreeListToPageStack; | 556 | QMap<Q3ListViewItem *, QWidget *> mTreeListToPageStack; |
551 | QMap<QListBoxItem *, QWidget *> mIconListToPageStack; | 557 | QMap<Q3ListBoxItem *, QWidget *> mIconListToPageStack; |
552 | QMap<QString, QPixmap> mFolderIconMap; | 558 | QMap<QString, QPixmap> mFolderIconMap; |
553 | QMap<QString, QStringList> mChildrenNames; | 559 | QMap<QString, QStringList> mChildrenNames; |
554 | QMap<QString, QWidget *> mChildPages; | 560 | QMap<QString, QWidget *> mChildPages; |
555 | 561 | ||
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 | |||
@@ -15,8 +15,13 @@ | |||
15 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 15 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
16 | Boston, MA 02111-1307, USA. | 16 | Boston, MA 02111-1307, USA. |
17 | */ | 17 | */ |
18 | #include <qtimer.h> | 18 | #include <qtimer.h> |
19 | //Added by qt3to4: | ||
20 | #include <QEvent> | ||
21 | #include <QMouseEvent> | ||
22 | #include <QKeyEvent> | ||
23 | #include <QFocusEvent> | ||
19 | 24 | ||
20 | #include <kglobalsettings.h> | 25 | #include <kglobalsettings.h> |
21 | //US#include <kcursor.h> | 26 | //US#include <kcursor.h> |
22 | #include <kapplication.h> | 27 | #include <kapplication.h> |
@@ -25,24 +30,25 @@ | |||
25 | 30 | ||
26 | #include "klistbox.h" | 31 | #include "klistbox.h" |
27 | 32 | ||
28 | #ifdef Q_WS_X11 | 33 | #ifdef Q_WS_X11 |
34 | #include <QX11Info> | ||
29 | #include <X11/Xlib.h> | 35 | #include <X11/Xlib.h> |
30 | #endif | 36 | #endif |
31 | #ifdef _WIN32_ | 37 | #ifdef _WIN32_ |
32 | #define Q_WS_QWS | 38 | #define Q_WS_QWS |
33 | #endif | 39 | #endif |
34 | KListBox::KListBox( QWidget *parent, const char *name, WFlags f ) | 40 | KListBox::KListBox( QWidget *parent, const char *name, Qt::WFlags f ) |
35 | : QListBox( parent, name, f ) | 41 | : Q3ListBox( parent, name, f ) |
36 | { | 42 | { |
37 | connect( this, SIGNAL( onViewport() ), | 43 | connect( this, SIGNAL( onViewport() ), |
38 | this, SLOT( slotOnViewport() ) ); | 44 | this, SLOT( slotOnViewport() ) ); |
39 | connect( this, SIGNAL( onItem( QListBoxItem * ) ), | 45 | connect( this, SIGNAL( onItem( Q3ListBoxItem * ) ), |
40 | this, SLOT( slotOnItem( QListBoxItem * ) ) ); | 46 | this, SLOT( slotOnItem( Q3ListBoxItem * ) ) ); |
41 | 47 | ||
42 | connect( this, SIGNAL( mouseButtonClicked( int, QListBoxItem *, | 48 | connect( this, SIGNAL( mouseButtonClicked( int, Q3ListBoxItem *, |
43 | const QPoint & ) ), | 49 | const QPoint & ) ), |
44 | this, SLOT( slotMouseButtonClicked( int, QListBoxItem *, | 50 | this, SLOT( slotMouseButtonClicked( int, Q3ListBoxItem *, |
45 | const QPoint & ) ) ); | 51 | const QPoint & ) ) ); |
46 | /*US | 52 | /*US |
47 | 53 | ||
48 | slotSettingsChanged(KApplication::SETTINGS_MOUSE); | 54 | slotSettingsChanged(KApplication::SETTINGS_MOUSE); |
@@ -59,9 +65,9 @@ KListBox::KListBox( QWidget *parent, const char *name, WFlags f ) | |||
59 | connect( m_pAutoSelect, SIGNAL( timeout() ), | 65 | connect( m_pAutoSelect, SIGNAL( timeout() ), |
60 | this, SLOT( slotAutoSelect() ) ); | 66 | this, SLOT( slotAutoSelect() ) ); |
61 | } | 67 | } |
62 | 68 | ||
63 | void KListBox::slotOnItem( QListBoxItem *item ) | 69 | void KListBox::slotOnItem( Q3ListBoxItem *item ) |
64 | { | 70 | { |
65 | /*US | 71 | /*US |
66 | if ( item && m_bChangeCursorOverItem && m_bUseSingle ) | 72 | if ( item && m_bChangeCursorOverItem && m_bUseSingle ) |
67 | viewport()->setCursor( KCursor().handCursor() ); | 73 | viewport()->setCursor( KCursor().handCursor() ); |
@@ -138,13 +144,13 @@ void KListBox::slotAutoSelect() | |||
138 | Window root; | 144 | Window root; |
139 | Window child; | 145 | Window child; |
140 | int root_x, root_y, win_x, win_y; | 146 | int root_x, root_y, win_x, win_y; |
141 | uint keybstate; | 147 | uint keybstate; |
142 | XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, | 148 | XQueryPointer( x11Info().display(), x11Info().appRootWindow(), &root, &child, |
143 | &root_x, &root_y, &win_x, &win_y, &keybstate ); | 149 | &root_x, &root_y, &win_x, &win_y, &keybstate ); |
144 | #endif | 150 | #endif |
145 | 151 | ||
146 | QListBoxItem* previousItem = item( currentItem() ); | 152 | Q3ListBoxItem* previousItem = item( currentItem() ); |
147 | setCurrentItem( m_pCurrentItem ); | 153 | setCurrentItem( m_pCurrentItem ); |
148 | 154 | ||
149 | if( m_pCurrentItem ) { | 155 | if( m_pCurrentItem ) { |
150 | #ifndef Q_WS_QWS //FIXME | 156 | #ifndef Q_WS_QWS //FIXME |
@@ -166,9 +172,9 @@ void KListBox::slotAutoSelect() | |||
166 | bool update = viewport()->isUpdatesEnabled(); | 172 | bool update = viewport()->isUpdatesEnabled(); |
167 | viewport()->setUpdatesEnabled( false ); | 173 | viewport()->setUpdatesEnabled( false ); |
168 | 174 | ||
169 | bool down = index( previousItem ) < index( m_pCurrentItem ); | 175 | bool down = index( previousItem ) < index( m_pCurrentItem ); |
170 | QListBoxItem* it = down ? previousItem : m_pCurrentItem; | 176 | Q3ListBoxItem* it = down ? previousItem : m_pCurrentItem; |
171 | for (;it ; it = it->next() ) { | 177 | for (;it ; it = it->next() ) { |
172 | if ( down && it == m_pCurrentItem ) { | 178 | if ( down && it == m_pCurrentItem ) { |
173 | setSelected( m_pCurrentItem, select ); | 179 | setSelected( m_pCurrentItem, select ); |
174 | break; | 180 | break; |
@@ -185,9 +191,9 @@ void KListBox::slotAutoSelect() | |||
185 | triggerUpdate( false ); | 191 | triggerUpdate( false ); |
186 | 192 | ||
187 | emit selectionChanged(); | 193 | emit selectionChanged(); |
188 | 194 | ||
189 | if( selectionMode() == QListBox::Single ) | 195 | if( selectionMode() == Q3ListBox::Single ) |
190 | emit selectionChanged( m_pCurrentItem ); | 196 | emit selectionChanged( m_pCurrentItem ); |
191 | } | 197 | } |
192 | #ifndef Q_WS_QWS //FIXME | 198 | #ifndef Q_WS_QWS //FIXME |
193 | else if( (keybstate & ControlMask) ) | 199 | else if( (keybstate & ControlMask) ) |
@@ -212,16 +218,16 @@ void KListBox::slotAutoSelect() | |||
212 | kdDebug() << "Thats not supposed to happen!!!!" << endl; | 218 | kdDebug() << "Thats not supposed to happen!!!!" << endl; |
213 | #endif | 219 | #endif |
214 | } | 220 | } |
215 | 221 | ||
216 | void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) | 222 | void KListBox::emitExecute( Q3ListBoxItem *item, const QPoint &pos ) |
217 | { | 223 | { |
218 | #ifdef Q_WS_X11 //FIXME | 224 | #ifdef Q_WS_X11 //FIXME |
219 | Window root; | 225 | Window root; |
220 | Window child; | 226 | Window child; |
221 | int root_x, root_y, win_x, win_y; | 227 | int root_x, root_y, win_x, win_y; |
222 | uint keybstate; | 228 | uint keybstate; |
223 | XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, | 229 | XQueryPointer( x11Info().display(), x11Info().appRootWindow(), &root, &child, |
224 | &root_x, &root_y, &win_x, &win_y, &keybstate ); | 230 | &root_x, &root_y, &win_x, &win_y, &keybstate ); |
225 | #endif | 231 | #endif |
226 | 232 | ||
227 | m_pAutoSelect->stop(); | 233 | m_pAutoSelect->stop(); |
@@ -245,67 +251,67 @@ void KListBox::emitExecute( QListBoxItem *item, const QPoint &pos ) | |||
245 | // should be done in QListView but it is not (at least now) | 251 | // should be done in QListView but it is not (at least now) |
246 | // | 252 | // |
247 | void KListBox::keyPressEvent(QKeyEvent *e) | 253 | void KListBox::keyPressEvent(QKeyEvent *e) |
248 | { | 254 | { |
249 | if( e->key() == Key_Escape ) | 255 | if( e->key() == Qt::Key_Escape ) |
250 | { | 256 | { |
251 | e->ignore(); | 257 | e->ignore(); |
252 | } | 258 | } |
253 | else if( e->key() == Key_F1 ) | 259 | else if( e->key() == Qt::Key_F1 ) |
254 | { | 260 | { |
255 | e->ignore(); | 261 | e->ignore(); |
256 | } | 262 | } |
257 | else | 263 | else |
258 | { | 264 | { |
259 | QListBox::keyPressEvent(e); | 265 | Q3ListBox::keyPressEvent(e); |
260 | } | 266 | } |
261 | } | 267 | } |
262 | 268 | ||
263 | void KListBox::focusOutEvent( QFocusEvent *fe ) | 269 | void KListBox::focusOutEvent( QFocusEvent *fe ) |
264 | { | 270 | { |
265 | m_pAutoSelect->stop(); | 271 | m_pAutoSelect->stop(); |
266 | 272 | ||
267 | QListBox::focusOutEvent( fe ); | 273 | Q3ListBox::focusOutEvent( fe ); |
268 | } | 274 | } |
269 | 275 | ||
270 | void KListBox::leaveEvent( QEvent *e ) | 276 | void KListBox::leaveEvent( QEvent *e ) |
271 | { | 277 | { |
272 | m_pAutoSelect->stop(); | 278 | m_pAutoSelect->stop(); |
273 | 279 | ||
274 | QListBox::leaveEvent( e ); | 280 | Q3ListBox::leaveEvent( e ); |
275 | } | 281 | } |
276 | 282 | ||
277 | void KListBox::contentsMousePressEvent( QMouseEvent *e ) | 283 | void KListBox::contentsMousePressEvent( QMouseEvent *e ) |
278 | { | 284 | { |
279 | if( (selectionMode() == Extended) && (e->state() & ShiftButton) && !(e->state() & ControlButton) ) { | 285 | if( (selectionMode() == Extended) && (e->state() & Qt::ShiftButton) && !(e->state() & Qt::ControlButton) ) { |
280 | bool block = signalsBlocked(); | 286 | bool block = signalsBlocked(); |
281 | blockSignals( true ); | 287 | blockSignals( true ); |
282 | 288 | ||
283 | clearSelection(); | 289 | clearSelection(); |
284 | 290 | ||
285 | blockSignals( block ); | 291 | blockSignals( block ); |
286 | } | 292 | } |
287 | 293 | ||
288 | QListBox::contentsMousePressEvent( e ); | 294 | Q3ListBox::contentsMousePressEvent( e ); |
289 | } | 295 | } |
290 | 296 | ||
291 | void KListBox::contentsMouseDoubleClickEvent ( QMouseEvent * e ) | 297 | void KListBox::contentsMouseDoubleClickEvent ( QMouseEvent * e ) |
292 | { | 298 | { |
293 | QListBox::contentsMouseDoubleClickEvent( e ); | 299 | Q3ListBox::contentsMouseDoubleClickEvent( e ); |
294 | 300 | ||
295 | QListBoxItem* item = itemAt( e->pos() ); | 301 | Q3ListBoxItem* item = itemAt( e->pos() ); |
296 | 302 | ||
297 | if( item ) { | 303 | if( item ) { |
298 | emit doubleClicked( item, e->globalPos() ); | 304 | emit doubleClicked( item, e->globalPos() ); |
299 | 305 | ||
300 | if( (e->button() == LeftButton) && !m_bUseSingle ) | 306 | if( (e->button() == Qt::LeftButton) && !m_bUseSingle ) |
301 | emitExecute( item, e->globalPos() ); | 307 | emitExecute( item, e->globalPos() ); |
302 | } | 308 | } |
303 | } | 309 | } |
304 | 310 | ||
305 | void KListBox::slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ) | 311 | void KListBox::slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos ) |
306 | { | 312 | { |
307 | if( (btn == LeftButton) && item ) | 313 | if( (btn == Qt::LeftButton) && item ) |
308 | emitExecute( item, pos ); | 314 | emitExecute( item, pos ); |
309 | } | 315 | } |
310 | 316 | ||
311 | void KListBox::virtual_hook( int, void* ) | 317 | void KListBox::virtual_hook( int, void* ) |
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 | |||
@@ -17,9 +17,14 @@ | |||
17 | */ | 17 | */ |
18 | #ifndef KLISTBOX_H | 18 | #ifndef KLISTBOX_H |
19 | #define KLISTBOX_H | 19 | #define KLISTBOX_H |
20 | 20 | ||
21 | #include <qlistbox.h> | 21 | #include <q3listbox.h> |
22 | //Added by qt3to4: | ||
23 | #include <QMouseEvent> | ||
24 | #include <QFocusEvent> | ||
25 | #include <QKeyEvent> | ||
26 | #include <QEvent> | ||
22 | 27 | ||
23 | /** | 28 | /** |
24 | * Extends the functionality of @ref QListBox to honor the system | 29 | * Extends the functionality of @ref QListBox to honor the system |
25 | * wide settings for Single Click/Double Click mode, Auto Selection and | 30 | * wide settings for Single Click/Double Click mode, Auto Selection and |
@@ -34,14 +39,14 @@ | |||
34 | * something connect to the @ref QListBox::selectionChanged() signal. | 39 | * something connect to the @ref QListBox::selectionChanged() signal. |
35 | * | 40 | * |
36 | * @short A variant of @ref QListBox that honors KDE's system-wide settings. | 41 | * @short A variant of @ref QListBox that honors KDE's system-wide settings. |
37 | **/ | 42 | **/ |
38 | class KListBox : public QListBox | 43 | class KListBox : public Q3ListBox |
39 | { | 44 | { |
40 | Q_OBJECT | 45 | Q_OBJECT |
41 | 46 | ||
42 | public: | 47 | public: |
43 | KListBox( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 48 | KListBox( QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0 ); |
44 | 49 | ||
45 | signals: | 50 | signals: |
46 | 51 | ||
47 | /** | 52 | /** |
@@ -53,9 +58,9 @@ signals: | |||
53 | * | 58 | * |
54 | * Note that you may not delete any @ref QListBoxItem objects in slots | 59 | * Note that you may not delete any @ref QListBoxItem objects in slots |
55 | * connected to this signal. | 60 | * connected to this signal. |
56 | */ | 61 | */ |
57 | void executed( QListBoxItem *item ); | 62 | void executed( Q3ListBoxItem *item ); |
58 | 63 | ||
59 | /** | 64 | /** |
60 | * Emitted whenever the user executes an listbox item. | 65 | * Emitted whenever the user executes an listbox item. |
61 | * | 66 | * |
@@ -66,9 +71,9 @@ signals: | |||
66 | * | 71 | * |
67 | * Note that you may not delete any @ref QListBoxItem objects in slots | 72 | * Note that you may not delete any @ref QListBoxItem objects in slots |
68 | * connected to this signal. | 73 | * connected to this signal. |
69 | */ | 74 | */ |
70 | void executed( QListBoxItem *item, const QPoint &pos ); | 75 | void executed( Q3ListBoxItem *item, const QPoint &pos ); |
71 | 76 | ||
72 | /** | 77 | /** |
73 | * This signal gets emitted whenever the user double clicks into the | 78 | * This signal gets emitted whenever the user double clicks into the |
74 | * listbox. | 79 | * listbox. |
@@ -82,12 +87,12 @@ signals: | |||
82 | * This signal is more or less here for the sake of completeness. | 87 | * This signal is more or less here for the sake of completeness. |
83 | * You should normally not need to use this. In most cases it's better | 88 | * You should normally not need to use this. In most cases it's better |
84 | * to use @ref executed() instead. | 89 | * to use @ref executed() instead. |
85 | */ | 90 | */ |
86 | void doubleClicked( QListBoxItem *item, const QPoint &pos ); | 91 | void doubleClicked( Q3ListBoxItem *item, const QPoint &pos ); |
87 | 92 | ||
88 | protected slots: | 93 | protected slots: |
89 | void slotOnItem( QListBoxItem *item ); | 94 | void slotOnItem( Q3ListBoxItem *item ); |
90 | void slotOnViewport(); | 95 | void slotOnViewport(); |
91 | 96 | ||
92 | //US void slotSettingsChanged(int); | 97 | //US void slotSettingsChanged(int); |
93 | 98 | ||
@@ -96,9 +101,9 @@ protected slots: | |||
96 | */ | 101 | */ |
97 | void slotAutoSelect(); | 102 | void slotAutoSelect(); |
98 | 103 | ||
99 | protected: | 104 | protected: |
100 | void emitExecute( QListBoxItem *item, const QPoint &pos ); | 105 | void emitExecute( Q3ListBoxItem *item, const QPoint &pos ); |
101 | 106 | ||
102 | /** | 107 | /** |
103 | * @reimplemented | 108 | * @reimplemented |
104 | */ | 109 | */ |
@@ -122,15 +127,15 @@ protected: | |||
122 | 127 | ||
123 | bool m_bUseSingle; | 128 | bool m_bUseSingle; |
124 | //US bool m_bChangeCursorOverItem; | 129 | //US bool m_bChangeCursorOverItem; |
125 | 130 | ||
126 | QListBoxItem* m_pCurrentItem; | 131 | Q3ListBoxItem* m_pCurrentItem; |
127 | 132 | ||
128 | QTimer* m_pAutoSelect; | 133 | QTimer* m_pAutoSelect; |
129 | int m_autoSelectDelay; | 134 | int m_autoSelectDelay; |
130 | 135 | ||
131 | private slots: | 136 | private slots: |
132 | void slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ); | 137 | void slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos ); |
133 | 138 | ||
134 | protected: | 139 | protected: |
135 | virtual void virtual_hook( int id, void* data ); | 140 | virtual void virtual_hook( int id, void* data ); |
136 | private: | 141 | private: |
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 | |||
@@ -17,15 +17,29 @@ | |||
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <qdragobject.h> | 21 | #include <q3dragobject.h> |
22 | #include <qtimer.h> | 22 | #include <qtimer.h> |
23 | #include <qheader.h> | 23 | #include <q3header.h> |
24 | #include <qcursor.h> | 24 | #include <qcursor.h> |
25 | #include <qtooltip.h> | 25 | #include <qtooltip.h> |
26 | #include <qstyle.h> | 26 | #include <qstyle.h> |
27 | #include <qpainter.h> | 27 | #include <qpainter.h> |
28 | //Added by qt3to4: | ||
29 | #include <QDragLeaveEvent> | ||
30 | #include <QKeyEvent> | ||
31 | #include <Q3ValueList> | ||
32 | #include <Q3PtrList> | ||
33 | #include <QPixmap> | ||
34 | #include <QDragEnterEvent> | ||
35 | #include <QDragMoveEvent> | ||
36 | #include <QDropEvent> | ||
37 | #include <QResizeEvent> | ||
38 | #include <QFocusEvent> | ||
39 | #include <QMouseEvent> | ||
40 | #include <QEvent> | ||
41 | #include <QPaintEvent> | ||
28 | 42 | ||
29 | #include <kglobalsettings.h> | 43 | #include <kglobalsettings.h> |
30 | #include <kconfig.h> | 44 | #include <kconfig.h> |
31 | #include <kconfigbase.h> | 45 | #include <kconfigbase.h> |
@@ -37,19 +51,20 @@ | |||
37 | #define Q_WS_QWS | 51 | #define Q_WS_QWS |
38 | #endif | 52 | #endif |
39 | #ifndef _WIN32_ | 53 | #ifndef _WIN32_ |
40 | #define private public | 54 | #define private public |
41 | #include <qlistview.h> | 55 | #include <q3listview.h> |
42 | #undef private | 56 | #undef private |
43 | #endif | 57 | #endif |
44 | #include "klistview.h" | 58 | #include "klistview.h" |
45 | //US #include "klistviewlineedit.h" | 59 | //US #include "klistviewlineedit.h" |
46 | #ifndef DESKTOP_VERSION | 60 | #ifndef DESKTOP_VERSION |
47 | #include <qpe/qpeapplication.h> | 61 | #include <qpe/qpeapplication.h> |
48 | #endif | 62 | #endif |
63 | #include <Q3Action> | ||
49 | 64 | ||
50 | // /*US | 65 | // /*US |
51 | class KListView::Tooltip : public QToolTip | 66 | class KListView::Tooltip /* TODO:hacker:TODO: : public QToolTip */ |
52 | { | 67 | { |
53 | public: | 68 | public: |
54 | Tooltip (KListView* parent, QToolTipGroup* group = 0L); | 69 | Tooltip (KListView* parent, QToolTipGroup* group = 0L); |
55 | virtual ~Tooltip () {} | 70 | virtual ~Tooltip () {} |
@@ -66,9 +81,9 @@ private: | |||
66 | KListView* mParent; | 81 | KListView* mParent; |
67 | }; | 82 | }; |
68 | 83 | ||
69 | KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) | 84 | KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) |
70 | : QToolTip (parent, group), | 85 | : /* XXX:hacker:XXX: QToolTip (parent, group), */ |
71 | mParent (parent) | 86 | mParent (parent) |
72 | { | 87 | { |
73 | } | 88 | } |
74 | 89 | ||
@@ -122,22 +137,22 @@ public: | |||
122 | { | 137 | { |
123 | //US delete editor; | 138 | //US delete editor; |
124 | } | 139 | } |
125 | 140 | ||
126 | QListViewItem* pCurrentItem; | 141 | Q3ListViewItem* pCurrentItem; |
127 | 142 | ||
128 | QTimer autoSelect; | 143 | QTimer autoSelect; |
129 | int autoSelectDelay; | 144 | int autoSelectDelay; |
130 | 145 | ||
131 | QTimer dragExpand; | 146 | QTimer dragExpand; |
132 | QListViewItem* dragOverItem; | 147 | Q3ListViewItem* dragOverItem; |
133 | QPoint dragOverPoint; | 148 | QPoint dragOverPoint; |
134 | 149 | ||
135 | QPoint startDragPos; | 150 | QPoint startDragPos; |
136 | int dragDelay; | 151 | int dragDelay; |
137 | 152 | ||
138 | //US KListViewLineEdit *editor; | 153 | //US KListViewLineEdit *editor; |
139 | QValueList<int> renameable; | 154 | Q3ValueList<int> renameable; |
140 | 155 | ||
141 | bool cursorInExecuteArea:1; | 156 | bool cursorInExecuteArea:1; |
142 | bool bUseSingle:1; | 157 | bool bUseSingle:1; |
143 | bool bChangeCursorOverItem:1; | 158 | bool bChangeCursorOverItem:1; |
@@ -169,10 +184,10 @@ public: | |||
169 | 184 | ||
170 | QRect mOldDropVisualizer; | 185 | QRect mOldDropVisualizer; |
171 | int mDropVisualizerWidth; | 186 | int mDropVisualizerWidth; |
172 | QRect mOldDropHighlighter; | 187 | QRect mOldDropHighlighter; |
173 | QListViewItem *afterItemDrop; | 188 | Q3ListViewItem *afterItemDrop; |
174 | QListViewItem *parentItemDrop; | 189 | Q3ListViewItem *parentItemDrop; |
175 | 190 | ||
176 | QColor alternateBackground; | 191 | QColor alternateBackground; |
177 | }; | 192 | }; |
178 | 193 | ||
@@ -225,9 +240,9 @@ void KListViewLineEdit::load(QListViewItem *i, int c) | |||
225 | /*Helper functions to for | 240 | /*Helper functions to for |
226 | *tabOrderedRename functionality. | 241 | *tabOrderedRename functionality. |
227 | */ | 242 | */ |
228 | 243 | ||
229 | static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir) | 244 | static int nextCol (KListView *pl, Q3ListViewItem *pi, int start, int dir) |
230 | { | 245 | { |
231 | if (pi) | 246 | if (pi) |
232 | { | 247 | { |
233 | //Find the next renameable column in the current row | 248 | //Find the next renameable column in the current row |
@@ -238,11 +253,11 @@ static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir) | |||
238 | 253 | ||
239 | return -1; | 254 | return -1; |
240 | } | 255 | } |
241 | 256 | ||
242 | static QListViewItem *prevItem (QListViewItem *pi) | 257 | static Q3ListViewItem *prevItem (Q3ListViewItem *pi) |
243 | { | 258 | { |
244 | QListViewItem *pa = pi->itemAbove(); | 259 | Q3ListViewItem *pa = pi->itemAbove(); |
245 | 260 | ||
246 | /*Does what the QListViewItem::previousSibling() | 261 | /*Does what the QListViewItem::previousSibling() |
247 | *of my dreams would do. | 262 | *of my dreams would do. |
248 | */ | 263 | */ |
@@ -251,17 +266,17 @@ static QListViewItem *prevItem (QListViewItem *pi) | |||
251 | 266 | ||
252 | return NULL; | 267 | return NULL; |
253 | } | 268 | } |
254 | 269 | ||
255 | static QListViewItem *lastQChild (QListViewItem *pi) | 270 | static Q3ListViewItem *lastQChild (Q3ListViewItem *pi) |
256 | { | 271 | { |
257 | if (pi) | 272 | if (pi) |
258 | { | 273 | { |
259 | /*Since there's no QListViewItem::lastChild(). | 274 | /*Since there's no QListViewItem::lastChild(). |
260 | *This finds the last sibling for the given | 275 | *This finds the last sibling for the given |
261 | *item. | 276 | *item. |
262 | */ | 277 | */ |
263 | for (QListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling()) | 278 | for (Q3ListViewItem *pt = pi->nextSibling(); pt; pt = pt->nextSibling()) |
264 | pi = pt; | 279 | pi = pt; |
265 | } | 280 | } |
266 | 281 | ||
267 | return pi; | 282 | return pi; |
@@ -327,12 +342,12 @@ bool KListViewLineEdit::event (QEvent *pe) | |||
327 | QKeyEvent *k = (QKeyEvent *) pe; | 342 | QKeyEvent *k = (QKeyEvent *) pe; |
328 | 343 | ||
329 | if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab) && | 344 | if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab) && |
330 | p->tabOrderedRenaming() && p->itemsRenameable() && | 345 | p->tabOrderedRenaming() && p->itemsRenameable() && |
331 | !(k->state() & ControlButton || k->state() & AltButton)) | 346 | !(k->state() & Qt::ControlButton || k->state() & AltButton)) |
332 | { | 347 | { |
333 | selectNextCell(item, col, | 348 | selectNextCell(item, col, |
334 | (k->key() == Key_Tab && !(k->state() & ShiftButton))); | 349 | (k->key() == Key_Tab && !(k->state() & Qt::ShiftButton))); |
335 | return true; | 350 | return true; |
336 | } | 351 | } |
337 | } | 352 | } |
338 | 353 | ||
@@ -405,9 +420,9 @@ void KListViewLineEdit::slotSelectionChanged() | |||
405 | } | 420 | } |
406 | */ | 421 | */ |
407 | 422 | ||
408 | KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse ) | 423 | KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse ) |
409 | : QListView( parent, name ), | 424 | : Q3ListView( parent, name ), |
410 | d (new KListViewPrivate (this)) | 425 | d (new KListViewPrivate (this)) |
411 | { | 426 | { |
412 | #ifndef DESKTOP_VERSION | 427 | #ifndef DESKTOP_VERSION |
413 | if ( emulateRightMouse ) | 428 | if ( emulateRightMouse ) |
@@ -416,10 +431,10 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse | |||
416 | //US setDragAutoScroll(true); | 431 | //US setDragAutoScroll(true); |
417 | 432 | ||
418 | connect( this, SIGNAL( onViewport() ), | 433 | connect( this, SIGNAL( onViewport() ), |
419 | this, SLOT( slotOnViewport() ) ); | 434 | this, SLOT( slotOnViewport() ) ); |
420 | connect( this, SIGNAL( onItem( QListViewItem * ) ), | 435 | connect( this, SIGNAL( onItem( Q3ListViewItem * ) ), |
421 | this, SLOT( slotOnItem( QListViewItem * ) ) ); | 436 | this, SLOT( slotOnItem( Q3ListViewItem * ) ) ); |
422 | 437 | ||
423 | connect (this, SIGNAL(contentsMoving(int,int)), | 438 | connect (this, SIGNAL(contentsMoving(int,int)), |
424 | this, SLOT(cleanDropVisualizer())); | 439 | this, SLOT(cleanDropVisualizer())); |
425 | connect (this, SIGNAL(contentsMoving(int,int)), | 440 | connect (this, SIGNAL(contentsMoving(int,int)), |
@@ -444,19 +459,19 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse | |||
444 | 459 | ||
445 | // context menu handling | 460 | // context menu handling |
446 | if (d->showContextMenusOnPress) | 461 | if (d->showContextMenusOnPress) |
447 | { | 462 | { |
448 | connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), | 463 | connect (this, SIGNAL (rightButtonPressed (Q3ListViewItem*, const QPoint&, int)), |
449 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); | 464 | this, SLOT (emitContextMenu (Q3ListViewItem*, const QPoint&, int))); |
450 | } | 465 | } |
451 | else | 466 | else |
452 | { | 467 | { |
453 | connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), | 468 | connect (this, SIGNAL (rightButtonClicked (Q3ListViewItem*, const QPoint&, int)), |
454 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); | 469 | this, SLOT (emitContextMenu (Q3ListViewItem*, const QPoint&, int))); |
455 | } | 470 | } |
456 | 471 | ||
457 | connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)), | 472 | connect (this, SIGNAL (menuShortCutPressed (KListView*, Q3ListViewItem*)), |
458 | this, SLOT (emitContextMenu (KListView*, QListViewItem*))); | 473 | this, SLOT (emitContextMenu (KListView*, Q3ListViewItem*))); |
459 | 474 | ||
460 | 475 | ||
461 | //qDebug("KListView::KListView make alternate color configurable"); | 476 | //qDebug("KListView::KListView make alternate color configurable"); |
462 | d->alternateBackground = KGlobalSettings::alternateBackgroundColor(); | 477 | d->alternateBackground = KGlobalSettings::alternateBackgroundColor(); |
@@ -479,9 +494,9 @@ bool KListView::isExecuteArea( const QPoint& point ) | |||
479 | QSize KListView::sizeHint() const | 494 | QSize KListView::sizeHint() const |
480 | { | 495 | { |
481 | //qDebug("KListView::QSize sizeHint() "); | 496 | //qDebug("KListView::QSize sizeHint() "); |
482 | #ifdef DESKTOP_VERSION | 497 | #ifdef DESKTOP_VERSION |
483 | return QListView::sizeHint(); | 498 | return Q3ListView::sizeHint(); |
484 | #else | 499 | #else |
485 | return QSize ( 40, 40 ); | 500 | return QSize ( 40, 40 ); |
486 | #endif | 501 | #endif |
487 | 502 | ||
@@ -502,9 +517,9 @@ bool KListView::isExecuteArea( int x ) | |||
502 | return ( x > offset && x < ( offset + width ) ); | 517 | return ( x > offset && x < ( offset + width ) ); |
503 | } | 518 | } |
504 | } | 519 | } |
505 | 520 | ||
506 | void KListView::slotOnItem( QListViewItem *item ) | 521 | void KListView::slotOnItem( Q3ListViewItem *item ) |
507 | { | 522 | { |
508 | QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); | 523 | QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); |
509 | if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) { | 524 | if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) { |
510 | d->autoSelect.start( d->autoSelectDelay, true ); | 525 | d->autoSelect.start( d->autoSelectDelay, true ); |
@@ -533,14 +548,14 @@ void KListView::slotSettingsChanged(int category) | |||
533 | d->dragDelay = 2; | 548 | d->dragDelay = 2; |
534 | //US set explicitly d->bUseSingle = KGlobalSettings::singleClick(); | 549 | //US set explicitly d->bUseSingle = KGlobalSettings::singleClick(); |
535 | // qDebug("KListView::slotSettingsChanged: single%i", d->bUseSingle); | 550 | // qDebug("KListView::slotSettingsChanged: single%i", d->bUseSingle); |
536 | 551 | ||
537 | disconnect(this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), | 552 | disconnect(this, SIGNAL (mouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int)), |
538 | this, SLOT (slotMouseButtonClicked (int, QListViewItem*, const QPoint &, int))); | 553 | this, SLOT (slotMouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int))); |
539 | 554 | ||
540 | if( d->bUseSingle ) | 555 | if( d->bUseSingle ) |
541 | connect (this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), | 556 | connect (this, SIGNAL (mouseButtonClicked (int, Q3ListViewItem*, const QPoint &, int)), |
542 | this, SLOT (slotMouseButtonClicked( int, QListViewItem*, const QPoint &, int))); | 557 | this, SLOT (slotMouseButtonClicked( int, Q3ListViewItem*, const QPoint &, int))); |
543 | 558 | ||
544 | //US d->bChangeCursorOverItem = KGlobalSettings::changeCursorOverIcon(); | 559 | //US d->bChangeCursorOverItem = KGlobalSettings::changeCursorOverIcon(); |
545 | //US d->autoSelectDelay = KGlobalSettings::autoSelectDelay(); | 560 | //US d->autoSelectDelay = KGlobalSettings::autoSelectDelay(); |
546 | 561 | ||
@@ -610,9 +625,9 @@ void KListView::slotAutoSelect() | |||
610 | //Give this widget the keyboard focus. | 625 | //Give this widget the keyboard focus. |
611 | if( !hasFocus() ) | 626 | if( !hasFocus() ) |
612 | setFocus(); | 627 | setFocus(); |
613 | 628 | ||
614 | QListViewItem* previousItem = currentItem(); | 629 | Q3ListViewItem* previousItem = currentItem(); |
615 | setCurrentItem( d->pCurrentItem ); | 630 | setCurrentItem( d->pCurrentItem ); |
616 | 631 | ||
617 | #if 0 | 632 | #if 0 |
618 | #ifndef Q_WS_QWS | 633 | #ifndef Q_WS_QWS |
@@ -631,9 +646,9 @@ void KListView::slotAutoSelect() | |||
631 | bool update = viewport()->isUpdatesEnabled(); | 646 | bool update = viewport()->isUpdatesEnabled(); |
632 | viewport()->setUpdatesEnabled( false ); | 647 | viewport()->setUpdatesEnabled( false ); |
633 | 648 | ||
634 | bool down = previousItem->itemPos() < d->pCurrentItem->itemPos(); | 649 | bool down = previousItem->itemPos() < d->pCurrentItem->itemPos(); |
635 | QListViewItemIterator lit( down ? previousItem : d->pCurrentItem ); | 650 | Q3ListViewItemIterator lit( down ? previousItem : d->pCurrentItem ); |
636 | for ( ; lit.current(); ++lit ) { | 651 | for ( ; lit.current(); ++lit ) { |
637 | if ( down && lit.current() == d->pCurrentItem ) { | 652 | if ( down && lit.current() == d->pCurrentItem ) { |
638 | d->pCurrentItem->setSelected( select ); | 653 | d->pCurrentItem->setSelected( select ); |
639 | break; | 654 | break; |
@@ -650,9 +665,9 @@ void KListView::slotAutoSelect() | |||
650 | triggerUpdate(); | 665 | triggerUpdate(); |
651 | 666 | ||
652 | emit selectionChanged(); | 667 | emit selectionChanged(); |
653 | 668 | ||
654 | if( selectionMode() == QListView::Single ) | 669 | if( selectionMode() == Q3ListView::Single ) |
655 | emit selectionChanged( d->pCurrentItem ); | 670 | emit selectionChanged( d->pCurrentItem ); |
656 | } | 671 | } |
657 | else if( (keybstate & ControlMask) ) | 672 | else if( (keybstate & ControlMask) ) |
658 | setSelected( d->pCurrentItem, !d->pCurrentItem->isSelected() ); | 673 | setSelected( d->pCurrentItem, !d->pCurrentItem->isSelected() ); |
@@ -683,9 +698,9 @@ void KListView::slotHeaderChanged() | |||
683 | setColumnWidth( columns() - 1, viewport()->width() - w - 1 ); | 698 | setColumnWidth( columns() - 1, viewport()->width() - w - 1 ); |
684 | } | 699 | } |
685 | } | 700 | } |
686 | 701 | ||
687 | void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c) | 702 | void KListView::emitExecute( int buttonstate, Q3ListViewItem *item, const QPoint &pos, int c) |
688 | { | 703 | { |
689 | // qDebug("KListView::emitExecute buttonstate=%i", buttonstate); | 704 | // qDebug("KListView::emitExecute buttonstate=%i", buttonstate); |
690 | if( isExecuteArea( viewport()->mapFromGlobal(pos) ) ) { | 705 | if( isExecuteArea( viewport()->mapFromGlobal(pos) ) ) { |
691 | 706 | ||
@@ -700,9 +715,9 @@ void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint | |||
700 | //US special implementation for embedded systems | 715 | //US special implementation for embedded systems |
701 | d->autoSelect.stop(); | 716 | d->autoSelect.stop(); |
702 | 717 | ||
703 | //Dont emit executed if in SC mode and Shift or Ctrl are pressed | 718 | //Dont emit executed if in SC mode and Shift or Ctrl are pressed |
704 | if( !( (buttonstate==ShiftButton) || (buttonstate==ControlButton) )) { | 719 | if( !( (buttonstate==Qt::ShiftButton) || (buttonstate==Qt::ControlButton) )) { |
705 | // if( !( ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) { | 720 | // if( !( ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) { |
706 | 721 | ||
707 | emit executed( item ); | 722 | emit executed( item ); |
708 | emit executed( item, pos, c ); | 723 | emit executed( item, pos, c ); |
@@ -713,9 +728,9 @@ void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint | |||
713 | 728 | ||
714 | void KListView::focusInEvent( QFocusEvent *fe ) | 729 | void KListView::focusInEvent( QFocusEvent *fe ) |
715 | { | 730 | { |
716 | // kdDebug()<<"KListView::focusInEvent()"<<endl; | 731 | // kdDebug()<<"KListView::focusInEvent()"<<endl; |
717 | QListView::focusInEvent( fe ); | 732 | Q3ListView::focusInEvent( fe ); |
718 | if ((d->selectedBySimpleMove) | 733 | if ((d->selectedBySimpleMove) |
719 | && (d->selectionMode == FileManager) | 734 | && (d->selectionMode == FileManager) |
720 | && (fe->reason()!=QFocusEvent::Popup) | 735 | && (fe->reason()!=QFocusEvent::Popup) |
721 | && (fe->reason()!=QFocusEvent::ActiveWindow) | 736 | && (fe->reason()!=QFocusEvent::ActiveWindow) |
@@ -746,16 +761,16 @@ void KListView::focusOutEvent( QFocusEvent *fe ) | |||
746 | currentItem()->repaint(); | 761 | currentItem()->repaint(); |
747 | emit selectionChanged(); | 762 | emit selectionChanged(); |
748 | }; | 763 | }; |
749 | 764 | ||
750 | QListView::focusOutEvent( fe ); | 765 | Q3ListView::focusOutEvent( fe ); |
751 | } | 766 | } |
752 | 767 | ||
753 | void KListView::leaveEvent( QEvent *e ) | 768 | void KListView::leaveEvent( QEvent *e ) |
754 | { | 769 | { |
755 | d->autoSelect.stop(); | 770 | d->autoSelect.stop(); |
756 | 771 | ||
757 | QListView::leaveEvent( e ); | 772 | Q3ListView::leaveEvent( e ); |
758 | } | 773 | } |
759 | 774 | ||
760 | bool KListView::event( QEvent *e ) | 775 | bool KListView::event( QEvent *e ) |
761 | { | 776 | { |
@@ -764,15 +779,15 @@ bool KListView::event( QEvent *e ) | |||
764 | //US d->alternateBackground=KGlobalSettings::alternateBackgroundColor(); | 779 | //US d->alternateBackground=KGlobalSettings::alternateBackgroundColor(); |
765 | d->alternateBackground = QColor(240, 240, 240); | 780 | d->alternateBackground = QColor(240, 240, 240); |
766 | } | 781 | } |
767 | 782 | ||
768 | return QListView::event(e); | 783 | return Q3ListView::event(e); |
769 | } | 784 | } |
770 | 785 | ||
771 | void KListView::contentsMousePressEvent( QMouseEvent *e ) | 786 | void KListView::contentsMousePressEvent( QMouseEvent *e ) |
772 | { | 787 | { |
773 | //qDebug("KListView::contentsMousePressEvent"); | 788 | //qDebug("KListView::contentsMousePressEvent"); |
774 | if( (selectionModeExt() == Extended) && (e->state() & ShiftButton) && !(e->state() & ControlButton) ) | 789 | if( (selectionModeExt() == Extended) && (e->state() & Qt::ShiftButton) && !(e->state() & Qt::ControlButton) ) |
775 | { | 790 | { |
776 | bool block = signalsBlocked(); | 791 | bool block = signalsBlocked(); |
777 | blockSignals( true ); | 792 | blockSignals( true ); |
778 | 793 | ||
@@ -792,17 +807,17 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) | |||
792 | }; | 807 | }; |
793 | }; | 808 | }; |
794 | 809 | ||
795 | QPoint p( contentsToViewport( e->pos() ) ); | 810 | QPoint p( contentsToViewport( e->pos() ) ); |
796 | QListViewItem *at = itemAt (p); | 811 | Q3ListViewItem *at = itemAt (p); |
797 | 812 | ||
798 | // true if the root decoration of the item "at" was clicked (i.e. the +/- sign) | 813 | // true if the root decoration of the item "at" was clicked (i.e. the +/- sign) |
799 | bool rootDecoClicked = at | 814 | bool rootDecoClicked = at |
800 | && ( p.x() <= header()->cellPos( header()->mapToActual( 0 ) ) + | 815 | && ( p.x() <= header()->cellPos( header()->mapToActual( 0 ) ) + |
801 | treeStepSize() * ( at->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() ) | 816 | treeStepSize() * ( at->depth() + ( rootIsDecorated() ? 1 : 0) ) + itemMargin() ) |
802 | && ( p.x() >= header()->cellPos( header()->mapToActual( 0 ) ) ); | 817 | && ( p.x() >= header()->cellPos( header()->mapToActual( 0 ) ) ); |
803 | 818 | ||
804 | if (e->button() == LeftButton && !rootDecoClicked) | 819 | if (e->button() == Qt::LeftButton && !rootDecoClicked) |
805 | { | 820 | { |
806 | //Start a drag | 821 | //Start a drag |
807 | d->startDragPos = e->pos(); | 822 | d->startDragPos = e->pos(); |
808 | 823 | ||
@@ -812,20 +827,20 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) | |||
812 | d->pressedOnSelected = at->isSelected(); | 827 | d->pressedOnSelected = at->isSelected(); |
813 | } | 828 | } |
814 | } | 829 | } |
815 | 830 | ||
816 | QListView::contentsMousePressEvent( e ); | 831 | Q3ListView::contentsMousePressEvent( e ); |
817 | } | 832 | } |
818 | 833 | ||
819 | void KListView::contentsMouseMoveEvent( QMouseEvent *e ) | 834 | void KListView::contentsMouseMoveEvent( QMouseEvent *e ) |
820 | { | 835 | { |
821 | if (!dragEnabled() || d->startDragPos.isNull() || !d->validDrag) { | 836 | if (!dragEnabled() || d->startDragPos.isNull() || !d->validDrag) { |
822 | QListView::contentsMouseMoveEvent (e); | 837 | Q3ListView::contentsMouseMoveEvent (e); |
823 | return; | 838 | return; |
824 | } | 839 | } |
825 | 840 | ||
826 | QPoint vp = contentsToViewport(e->pos()); | 841 | QPoint vp = contentsToViewport(e->pos()); |
827 | QListViewItem *item = itemAt( vp ); | 842 | Q3ListViewItem *item = itemAt( vp ); |
828 | 843 | ||
829 | //do we process cursor changes at all? | 844 | //do we process cursor changes at all? |
830 | if ( item && d->bChangeCursorOverItem && d->bUseSingle ) | 845 | if ( item && d->bChangeCursorOverItem && d->bUseSingle ) |
831 | { | 846 | { |
@@ -852,24 +867,24 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) | |||
852 | newPos.y() > d->startDragPos.y()+d->dragDelay || | 867 | newPos.y() > d->startDragPos.y()+d->dragDelay || |
853 | newPos.y() < d->startDragPos.y()-d->dragDelay)) | 868 | newPos.y() < d->startDragPos.y()-d->dragDelay)) |
854 | //(d->startDragPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) | 869 | //(d->startDragPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) |
855 | { | 870 | { |
856 | QListView::contentsMouseReleaseEvent( 0 ); | 871 | Q3ListView::contentsMouseReleaseEvent( 0 ); |
857 | startDrag(); | 872 | startDrag(); |
858 | d->startDragPos = QPoint(); | 873 | d->startDragPos = QPoint(); |
859 | d->validDrag = false; | 874 | d->validDrag = false; |
860 | } | 875 | } |
861 | } | 876 | } |
862 | 877 | ||
863 | void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) | 878 | void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) |
864 | { | 879 | { |
865 | if (e->button() == LeftButton) | 880 | if (e->button() == Qt::LeftButton) |
866 | { | 881 | { |
867 | // If the row was already selected, maybe we want to start an in-place editing | 882 | // If the row was already selected, maybe we want to start an in-place editing |
868 | if ( d->pressedOnSelected && itemsRenameable() ) | 883 | if ( d->pressedOnSelected && itemsRenameable() ) |
869 | { | 884 | { |
870 | QPoint p( contentsToViewport( e->pos() ) ); | 885 | QPoint p( contentsToViewport( e->pos() ) ); |
871 | QListViewItem *at = itemAt (p); | 886 | Q3ListViewItem *at = itemAt (p); |
872 | if ( at ) | 887 | if ( at ) |
873 | { | 888 | { |
874 | // true if the root decoration of the item "at" was clicked (i.e. the +/- sign) | 889 | // true if the root decoration of the item "at" was clicked (i.e. the +/- sign) |
875 | bool rootDecoClicked = | 890 | bool rootDecoClicked = |
@@ -889,9 +904,9 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) | |||
889 | d->pressedOnSelected = false; | 904 | d->pressedOnSelected = false; |
890 | d->validDrag = false; | 905 | d->validDrag = false; |
891 | d->startDragPos = QPoint(); | 906 | d->startDragPos = QPoint(); |
892 | } | 907 | } |
893 | QListView::contentsMouseReleaseEvent( e ); | 908 | Q3ListView::contentsMouseReleaseEvent( e ); |
894 | } | 909 | } |
895 | 910 | ||
896 | void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) | 911 | void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) |
897 | { | 912 | { |
@@ -900,31 +915,31 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) | |||
900 | // whereas we don't do it in single click mode... (David) | 915 | // whereas we don't do it in single click mode... (David) |
901 | //QListView::contentsMouseDoubleClickEvent( e ); | 916 | //QListView::contentsMouseDoubleClickEvent( e ); |
902 | 917 | ||
903 | QPoint vp = contentsToViewport(e->pos()); | 918 | QPoint vp = contentsToViewport(e->pos()); |
904 | QListViewItem *item = itemAt( vp ); | 919 | Q3ListViewItem *item = itemAt( vp ); |
905 | emit QListView::doubleClicked( item ); // we do it now | 920 | emit Q3ListView::doubleClicked( item ); // we do it now |
906 | 921 | ||
907 | int col = item ? header()->mapToLogical( header()->cellAt( vp.x() ) ) : -1; | 922 | int col = item ? header()->mapToLogical( header()->cellAt( vp.x() ) ) : -1; |
908 | 923 | ||
909 | if( item ) { | 924 | if( item ) { |
910 | //qDebug("KListView::contentsMouseDoubleClickEvent: emit doubleClicked"); | 925 | //qDebug("KListView::contentsMouseDoubleClickEvent: emit doubleClicked"); |
911 | 926 | ||
912 | emit doubleClicked( item, e->globalPos(), col ); | 927 | emit doubleClicked( item, e->globalPos(), col ); |
913 | 928 | ||
914 | if( (e->button() == LeftButton) && !d->bUseSingle ) { | 929 | if( (e->button() == Qt::LeftButton) && !d->bUseSingle ) { |
915 | //qDebug("KListView::contentsMouseDoubleClickEvent: emitExecute"); | 930 | //qDebug("KListView::contentsMouseDoubleClickEvent: emitExecute"); |
916 | 931 | ||
917 | emitExecute( e->button(), item, e->globalPos(), col); | 932 | emitExecute( e->button(), item, e->globalPos(), col); |
918 | } | 933 | } |
919 | } | 934 | } |
920 | } | 935 | } |
921 | 936 | ||
922 | void KListView::slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ) | 937 | void KListView::slotMouseButtonClicked( int btn, Q3ListViewItem *item, const QPoint &pos, int c ) |
923 | { | 938 | { |
924 | //qDebug("KListView::slotMouseButtonClicked"); | 939 | //qDebug("KListView::slotMouseButtonClicked"); |
925 | 940 | ||
926 | if( (btn == LeftButton) && item ) { | 941 | if( (btn == Qt::LeftButton) && item ) { |
927 | //qDebug("KListView::slotMouseButtonClicked: emitExecute"); | 942 | //qDebug("KListView::slotMouseButtonClicked: emitExecute"); |
928 | 943 | ||
929 | emitExecute(btn, item, pos, c); | 944 | emitExecute(btn, item, pos, c); |
930 | } | 945 | } |
@@ -960,14 +975,14 @@ qDebug("KListView::contentsDropEvent drag&drop not supported yet"); | |||
960 | */ | 975 | */ |
961 | 976 | ||
962 | } | 977 | } |
963 | 978 | ||
964 | void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) | 979 | void KListView::movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme) |
965 | { | 980 | { |
966 | QPtrList<QListViewItem> items, afterFirsts, afterNows; | 981 | Q3PtrList<Q3ListViewItem> items, afterFirsts, afterNows; |
967 | QListViewItem *current=currentItem(); | 982 | Q3ListViewItem *current=currentItem(); |
968 | bool hasMoved=false; | 983 | bool hasMoved=false; |
969 | for (QListViewItem *i = firstChild(), *iNext=0; i != 0; i = iNext) | 984 | for (Q3ListViewItem *i = firstChild(), *iNext=0; i != 0; i = iNext) |
970 | { | 985 | { |
971 | iNext=i->itemBelow(); | 986 | iNext=i->itemBelow(); |
972 | if (!i->isSelected()) | 987 | if (!i->isSelected()) |
973 | continue; | 988 | continue; |
@@ -978,9 +993,9 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) | |||
978 | continue; | 993 | continue; |
979 | 994 | ||
980 | i->setSelected(false); | 995 | i->setSelected(false); |
981 | 996 | ||
982 | QListViewItem *afterFirst = i->itemAbove(); | 997 | Q3ListViewItem *afterFirst = i->itemAbove(); |
983 | 998 | ||
984 | if (!hasMoved) | 999 | if (!hasMoved) |
985 | { | 1000 | { |
986 | emit aboutToMove(); | 1001 | emit aboutToMove(); |
@@ -999,9 +1014,9 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) | |||
999 | 1014 | ||
1000 | afterme = i; | 1015 | afterme = i; |
1001 | } | 1016 | } |
1002 | clearSelection(); | 1017 | clearSelection(); |
1003 | for (QListViewItem *i=items.first(); i != 0; i=items.next() ) | 1018 | for (Q3ListViewItem *i=items.first(); i != 0; i=items.next() ) |
1004 | i->setSelected(true); | 1019 | i->setSelected(true); |
1005 | if (current) | 1020 | if (current) |
1006 | setCurrentItem(current); | 1021 | setCurrentItem(current); |
1007 | 1022 | ||
@@ -1085,16 +1100,16 @@ int KListView::depthToPixels( int depth ) | |||
1085 | { | 1100 | { |
1086 | return treeStepSize() * ( depth + (rootIsDecorated() ? 1 : 0) ) + itemMargin(); | 1101 | return treeStepSize() * ( depth + (rootIsDecorated() ? 1 : 0) ) + itemMargin(); |
1087 | } | 1102 | } |
1088 | 1103 | ||
1089 | void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after) | 1104 | void KListView::findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after) |
1090 | { | 1105 | { |
1091 | QPoint p (contentsToViewport(pos)); | 1106 | QPoint p (contentsToViewport(pos)); |
1092 | 1107 | ||
1093 | // Get the position to put it in | 1108 | // Get the position to put it in |
1094 | QListViewItem *atpos = itemAt(p); | 1109 | Q3ListViewItem *atpos = itemAt(p); |
1095 | 1110 | ||
1096 | QListViewItem *above; | 1111 | Q3ListViewItem *above; |
1097 | if (!atpos) // put it at the end | 1112 | if (!atpos) // put it at the end |
1098 | above = lastItem(); | 1113 | above = lastItem(); |
1099 | else | 1114 | else |
1100 | { | 1115 | { |
@@ -1122,10 +1137,10 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte | |||
1122 | } | 1137 | } |
1123 | 1138 | ||
1124 | // Ok, there's one more level of complexity. We may want to become a new | 1139 | // Ok, there's one more level of complexity. We may want to become a new |
1125 | // sibling, but of an upper-level group, rather than the "above" item | 1140 | // sibling, but of an upper-level group, rather than the "above" item |
1126 | QListViewItem * betterAbove = above->parent(); | 1141 | Q3ListViewItem * betterAbove = above->parent(); |
1127 | QListViewItem * last = above; | 1142 | Q3ListViewItem * last = above; |
1128 | while ( betterAbove ) | 1143 | while ( betterAbove ) |
1129 | { | 1144 | { |
1130 | // We are allowed to become a sibling of "betterAbove" only if we are | 1145 | // We are allowed to become a sibling of "betterAbove" only if we are |
1131 | // after its last child | 1146 | // after its last child |
@@ -1145,23 +1160,23 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte | |||
1145 | after = above; | 1160 | after = above; |
1146 | parent = after ? after->parent() : 0L ; | 1161 | parent = after ? after->parent() : 0L ; |
1147 | } | 1162 | } |
1148 | 1163 | ||
1149 | QListViewItem* KListView::lastChild () const | 1164 | Q3ListViewItem* KListView::lastChild () const |
1150 | { | 1165 | { |
1151 | QListViewItem* lastchild = firstChild(); | 1166 | Q3ListViewItem* lastchild = firstChild(); |
1152 | 1167 | ||
1153 | if (lastchild) | 1168 | if (lastchild) |
1154 | for (; lastchild->nextSibling(); lastchild = lastchild->nextSibling()); | 1169 | for (; lastchild->nextSibling(); lastchild = lastchild->nextSibling()); |
1155 | 1170 | ||
1156 | return lastchild; | 1171 | return lastchild; |
1157 | } | 1172 | } |
1158 | 1173 | ||
1159 | QListViewItem *KListView::lastItem() const | 1174 | Q3ListViewItem *KListView::lastItem() const |
1160 | { | 1175 | { |
1161 | QListViewItem* last = lastChild(); | 1176 | Q3ListViewItem* last = lastChild(); |
1162 | 1177 | ||
1163 | for (QListViewItemIterator it (last); it.current(); ++it) | 1178 | for (Q3ListViewItemIterator it (last); it.current(); ++it) |
1164 | last = it.current(); | 1179 | last = it.current(); |
1165 | 1180 | ||
1166 | return last; | 1181 | return last; |
1167 | } | 1182 | } |
@@ -1186,14 +1201,14 @@ qDebug("KListView::startDrag drag&drop not supported yet."); | |||
1186 | emit moved(); | 1201 | emit moved(); |
1187 | */ | 1202 | */ |
1188 | } | 1203 | } |
1189 | 1204 | ||
1190 | QDragObject *KListView::dragObject() | 1205 | Q3DragObject *KListView::dragObject() |
1191 | { | 1206 | { |
1192 | if (!currentItem()) | 1207 | if (!currentItem()) |
1193 | return 0; | 1208 | return 0; |
1194 | 1209 | ||
1195 | return new QStoredDrag("application/x-qlistviewitem", viewport()); | 1210 | return new Q3StoredDrag("application/x-qlistviewitem", viewport()); |
1196 | } | 1211 | } |
1197 | 1212 | ||
1198 | void KListView::setItemsMovable(bool b) | 1213 | void KListView::setItemsMovable(bool b) |
1199 | { | 1214 | { |
@@ -1245,21 +1260,21 @@ void KListView::setDropVisualizer(bool b) | |||
1245 | { | 1260 | { |
1246 | d->dropVisualizer=b; | 1261 | d->dropVisualizer=b; |
1247 | } | 1262 | } |
1248 | 1263 | ||
1249 | QPtrList<QListViewItem> KListView::selectedItems() const | 1264 | Q3PtrList<Q3ListViewItem> KListView::selectedItems() const |
1250 | { | 1265 | { |
1251 | QPtrList<QListViewItem> list; | 1266 | Q3PtrList<Q3ListViewItem> list; |
1252 | for (QListViewItem *i=firstChild(); i!=0; i=i->itemBelow()) | 1267 | for (Q3ListViewItem *i=firstChild(); i!=0; i=i->itemBelow()) |
1253 | if (i->isSelected()) list.append(i); | 1268 | if (i->isSelected()) list.append(i); |
1254 | return list; | 1269 | return list; |
1255 | } | 1270 | } |
1256 | 1271 | ||
1257 | 1272 | ||
1258 | void KListView::moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after) | 1273 | void KListView::moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after) |
1259 | { | 1274 | { |
1260 | // sanity check - don't move a item into it's own child structure | 1275 | // sanity check - don't move a item into it's own child structure |
1261 | QListViewItem *i = parent; | 1276 | Q3ListViewItem *i = parent; |
1262 | while(i) | 1277 | while(i) |
1263 | { | 1278 | { |
1264 | if(i == item) | 1279 | if(i == item) |
1265 | return; | 1280 | return; |
@@ -1295,10 +1310,10 @@ void KListView::setDropVisualizerWidth (int w) | |||
1295 | { | 1310 | { |
1296 | d->mDropVisualizerWidth = w > 0 ? w : 1; | 1311 | d->mDropVisualizerWidth = w > 0 ? w : 1; |
1297 | } | 1312 | } |
1298 | 1313 | ||
1299 | QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, | 1314 | QRect KListView::drawDropVisualizer(QPainter *p, Q3ListViewItem *parent, |
1300 | QListViewItem *after) | 1315 | Q3ListViewItem *after) |
1301 | { | 1316 | { |
1302 | QRect insertmarker; | 1317 | QRect insertmarker; |
1303 | 1318 | ||
1304 | if (!after && !parent) | 1319 | if (!after && !parent) |
@@ -1307,9 +1322,9 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, | |||
1307 | { | 1322 | { |
1308 | int level = 0; | 1323 | int level = 0; |
1309 | if (after) | 1324 | if (after) |
1310 | { | 1325 | { |
1311 | QListViewItem* it = 0L; | 1326 | Q3ListViewItem* it = 0L; |
1312 | if (after->isOpen()) | 1327 | if (after->isOpen()) |
1313 | { | 1328 | { |
1314 | // Look for the last child (recursively) | 1329 | // Look for the last child (recursively) |
1315 | it = after->firstChild(); | 1330 | it = after->firstChild(); |
@@ -1337,14 +1352,14 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, | |||
1337 | 1352 | ||
1338 | // This is not used anymore, at least by KListView itself (see viewportPaintEvent) | 1353 | // This is not used anymore, at least by KListView itself (see viewportPaintEvent) |
1339 | // Remove for KDE 3.0. | 1354 | // Remove for KDE 3.0. |
1340 | if (p) | 1355 | if (p) |
1341 | p->fillRect(insertmarker, Dense4Pattern); | 1356 | p->fillRect(insertmarker, Qt::Dense4Pattern); |
1342 | 1357 | ||
1343 | return insertmarker; | 1358 | return insertmarker; |
1344 | } | 1359 | } |
1345 | 1360 | ||
1346 | QRect KListView::drawItemHighlighter(QPainter *painter, QListViewItem *item) | 1361 | QRect KListView::drawItemHighlighter(QPainter *painter, Q3ListViewItem *item) |
1347 | { | 1362 | { |
1348 | QRect r; | 1363 | QRect r; |
1349 | 1364 | ||
1350 | if (item) | 1365 | if (item) |
@@ -1375,9 +1390,9 @@ void KListView::cleanItemHighlighter () | |||
1375 | viewport()->repaint(rect, true); | 1390 | viewport()->repaint(rect, true); |
1376 | } | 1391 | } |
1377 | } | 1392 | } |
1378 | 1393 | ||
1379 | void KListView::rename(QListViewItem *item, int c) | 1394 | void KListView::rename(Q3ListViewItem *item, int c) |
1380 | { | 1395 | { |
1381 | if (d->renameable.contains(c)) | 1396 | if (d->renameable.contains(c)) |
1382 | { | 1397 | { |
1383 | ensureItemVisible(item); | 1398 | ensureItemVisible(item); |
@@ -1402,9 +1417,9 @@ void KListView::setRenameable (int col, bool yesno) | |||
1402 | else if (!yesno && d->renameable.find(col)!=d->renameable.end()) | 1417 | else if (!yesno && d->renameable.find(col)!=d->renameable.end()) |
1403 | d->renameable.remove(col); | 1418 | d->renameable.remove(col); |
1404 | } | 1419 | } |
1405 | 1420 | ||
1406 | void KListView::doneEditing(QListViewItem *item, int row) | 1421 | void KListView::doneEditing(Q3ListViewItem *item, int row) |
1407 | { | 1422 | { |
1408 | emit itemRenamed(item, item->text(row), row); | 1423 | emit itemRenamed(item, item->text(row), row); |
1409 | emit itemRenamed(item); | 1424 | emit itemRenamed(item); |
1410 | } | 1425 | } |
@@ -1446,14 +1461,14 @@ bool KListView::dropHighlighter() const | |||
1446 | { | 1461 | { |
1447 | return d->dropHighlighter; | 1462 | return d->dropHighlighter; |
1448 | } | 1463 | } |
1449 | 1464 | ||
1450 | bool KListView::showTooltip(QListViewItem *item, const QPoint &, int column) const | 1465 | bool KListView::showTooltip(Q3ListViewItem *item, const QPoint &, int column) const |
1451 | { | 1466 | { |
1452 | return ((tooltip(item, column).length()>0) && (column==tooltipColumn())); | 1467 | return ((tooltip(item, column).length()>0) && (column==tooltipColumn())); |
1453 | } | 1468 | } |
1454 | 1469 | ||
1455 | QString KListView::tooltip(QListViewItem *item, int column) const | 1470 | QString KListView::tooltip(Q3ListViewItem *item, int column) const |
1456 | { | 1471 | { |
1457 | return item->text(column); | 1472 | return item->text(column); |
1458 | } | 1473 | } |
1459 | 1474 | ||
@@ -1481,9 +1496,9 @@ void KListView::keyPressEvent (QKeyEvent* e) | |||
1481 | return; | 1496 | return; |
1482 | } | 1497 | } |
1483 | 1498 | ||
1484 | if (d->selectionMode != FileManager) | 1499 | if (d->selectionMode != FileManager) |
1485 | QListView::keyPressEvent (e); | 1500 | Q3ListView::keyPressEvent (e); |
1486 | else | 1501 | else |
1487 | fileManagerKeyPressEvent (e); | 1502 | fileManagerKeyPressEvent (e); |
1488 | } | 1503 | } |
1489 | 1504 | ||
@@ -1512,47 +1527,47 @@ bool KListView::automaticSelection() const | |||
1512 | 1527 | ||
1513 | void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | 1528 | void KListView::fileManagerKeyPressEvent (QKeyEvent* e) |
1514 | { | 1529 | { |
1515 | //don't care whether it's on the keypad or not | 1530 | //don't care whether it's on the keypad or not |
1516 | int e_state=(e->state() & ~Keypad); | 1531 | int e_state=(e->state() & ~Qt::Keypad); |
1517 | 1532 | ||
1518 | int oldSelectionDirection(d->selectionDirection); | 1533 | int oldSelectionDirection(d->selectionDirection); |
1519 | 1534 | ||
1520 | if ((e->key()!=Key_Shift) && (e->key()!=Key_Control) | 1535 | if ((e->key()!=Qt::Key_Shift) && (e->key()!=Qt::Key_Control) |
1521 | && (e->key()!=Key_Meta) && (e->key()!=Key_Alt)) | 1536 | && (e->key()!=Qt::Key_Meta) && (e->key()!=Qt::Key_Alt)) |
1522 | { | 1537 | { |
1523 | if ((e_state==ShiftButton) && (!d->wasShiftEvent) && (!d->selectedBySimpleMove)) | 1538 | if ((e_state==Qt::ShiftButton) && (!d->wasShiftEvent) && (!d->selectedBySimpleMove)) |
1524 | selectAll(FALSE); | 1539 | selectAll(FALSE); |
1525 | d->selectionDirection=0; | 1540 | d->selectionDirection=0; |
1526 | d->wasShiftEvent = (e_state == ShiftButton); | 1541 | d->wasShiftEvent = (e_state == Qt::ShiftButton); |
1527 | }; | 1542 | }; |
1528 | 1543 | ||
1529 | //d->wasShiftEvent = (e_state == ShiftButton); | 1544 | //d->wasShiftEvent = (e_state == Qt::ShiftButton); |
1530 | 1545 | ||
1531 | 1546 | ||
1532 | QListViewItem* item = currentItem(); | 1547 | Q3ListViewItem* item = currentItem(); |
1533 | if (item==0) return; | 1548 | if (item==0) return; |
1534 | 1549 | ||
1535 | QListViewItem* repaintItem1 = item; | 1550 | Q3ListViewItem* repaintItem1 = item; |
1536 | QListViewItem* repaintItem2 = 0L; | 1551 | Q3ListViewItem* repaintItem2 = 0L; |
1537 | QListViewItem* visItem = 0L; | 1552 | Q3ListViewItem* visItem = 0L; |
1538 | 1553 | ||
1539 | QListViewItem* nextItem = 0L; | 1554 | Q3ListViewItem* nextItem = 0L; |
1540 | int items = 0; | 1555 | int items = 0; |
1541 | 1556 | ||
1542 | bool shiftOrCtrl((e_state==ControlButton) || (e_state==ShiftButton)); | 1557 | bool shiftOrCtrl((e_state==Qt::ControlButton) || (e_state==Qt::ShiftButton)); |
1543 | int selectedItems(0); | 1558 | int selectedItems(0); |
1544 | for (QListViewItem *tmpItem=firstChild(); tmpItem!=0; tmpItem=tmpItem->nextSibling()) | 1559 | for (Q3ListViewItem *tmpItem=firstChild(); tmpItem!=0; tmpItem=tmpItem->nextSibling()) |
1545 | if (tmpItem->isSelected()) selectedItems++; | 1560 | if (tmpItem->isSelected()) selectedItems++; |
1546 | 1561 | ||
1547 | if (((selectedItems==0) || ((selectedItems==1) && (d->selectedUsingMouse))) | 1562 | if (((selectedItems==0) || ((selectedItems==1) && (d->selectedUsingMouse))) |
1548 | && (e_state==NoButton) | 1563 | && (e_state==Qt::NoButton) |
1549 | && ((e->key()==Key_Down) | 1564 | && ((e->key()==Qt::Key_Down) |
1550 | || (e->key()==Key_Up) | 1565 | || (e->key()==Qt::Key_Up) |
1551 | || (e->key()==Key_Next) | 1566 | || (e->key()==Qt::Key_Next) |
1552 | || (e->key()==Key_Prior) | 1567 | || (e->key()==Qt::Key_Prior) |
1553 | || (e->key()==Key_Home) | 1568 | || (e->key()==Qt::Key_Home) |
1554 | || (e->key()==Key_End))) | 1569 | || (e->key()==Qt::Key_End))) |
1555 | { | 1570 | { |
1556 | d->selectedBySimpleMove=true; | 1571 | d->selectedBySimpleMove=true; |
1557 | d->selectedUsingMouse=false; | 1572 | d->selectedUsingMouse=false; |
1558 | } | 1573 | } |
@@ -1562,22 +1577,22 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
1562 | bool emitSelectionChanged(false); | 1577 | bool emitSelectionChanged(false); |
1563 | 1578 | ||
1564 | switch (e->key()) | 1579 | switch (e->key()) |
1565 | { | 1580 | { |
1566 | case Key_Escape: | 1581 | case Qt::Key_Escape: |
1567 | selectAll(FALSE); | 1582 | selectAll(FALSE); |
1568 | emitSelectionChanged=TRUE; | 1583 | emitSelectionChanged=TRUE; |
1569 | break; | 1584 | break; |
1570 | 1585 | ||
1571 | case Key_Space: | 1586 | case Qt::Key_Space: |
1572 | //toggle selection of current item | 1587 | //toggle selection of current item |
1573 | if (d->selectedBySimpleMove) | 1588 | if (d->selectedBySimpleMove) |
1574 | d->selectedBySimpleMove=false; | 1589 | d->selectedBySimpleMove=false; |
1575 | item->setSelected(!item->isSelected()); | 1590 | item->setSelected(!item->isSelected()); |
1576 | emitSelectionChanged=TRUE; | 1591 | emitSelectionChanged=TRUE; |
1577 | break; | 1592 | break; |
1578 | 1593 | ||
1579 | case Key_Insert: | 1594 | case Qt::Key_Insert: |
1580 | //toggle selection of current item and move to the next item | 1595 | //toggle selection of current item and move to the next item |
1581 | if (d->selectedBySimpleMove) | 1596 | if (d->selectedBySimpleMove) |
1582 | { | 1597 | { |
1583 | d->selectedBySimpleMove=false; | 1598 | d->selectedBySimpleMove=false; |
@@ -1599,9 +1614,9 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
1599 | d->selectionDirection=1; | 1614 | d->selectionDirection=1; |
1600 | emitSelectionChanged=TRUE; | 1615 | emitSelectionChanged=TRUE; |
1601 | break; | 1616 | break; |
1602 | 1617 | ||
1603 | case Key_Down: | 1618 | case Qt::Key_Down: |
1604 | nextItem=item->itemBelow(); | 1619 | nextItem=item->itemBelow(); |
1605 | //toggle selection of current item and move to the next item | 1620 | //toggle selection of current item and move to the next item |
1606 | if (shiftOrCtrl) | 1621 | if (shiftOrCtrl) |
1607 | { | 1622 | { |
@@ -1632,9 +1647,9 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
1632 | setCurrentItem(nextItem); | 1647 | setCurrentItem(nextItem); |
1633 | }; | 1648 | }; |
1634 | break; | 1649 | break; |
1635 | 1650 | ||
1636 | case Key_Up: | 1651 | case Qt::Key_Up: |
1637 | nextItem=item->itemAbove(); | 1652 | nextItem=item->itemAbove(); |
1638 | d->selectionDirection=-1; | 1653 | d->selectionDirection=-1; |
1639 | //move to the prev. item and toggle selection of this one | 1654 | //move to the prev. item and toggle selection of this one |
1640 | // => No, can't select the last item, with this. For symmetry, let's | 1655 | // => No, can't select the last item, with this. For symmetry, let's |
@@ -1667,9 +1682,9 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
1667 | setCurrentItem(nextItem); | 1682 | setCurrentItem(nextItem); |
1668 | }; | 1683 | }; |
1669 | break; | 1684 | break; |
1670 | 1685 | ||
1671 | case Key_End: | 1686 | case Qt::Key_End: |
1672 | //move to the last item and toggle selection of all items inbetween | 1687 | //move to the last item and toggle selection of all items inbetween |
1673 | nextItem=item; | 1688 | nextItem=item; |
1674 | if (d->selectedBySimpleMove) | 1689 | if (d->selectedBySimpleMove) |
1675 | item->setSelected(false); | 1690 | item->setSelected(false); |
@@ -1692,9 +1707,9 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
1692 | } | 1707 | } |
1693 | emitSelectionChanged=TRUE; | 1708 | emitSelectionChanged=TRUE; |
1694 | break; | 1709 | break; |
1695 | 1710 | ||
1696 | case Key_Home: | 1711 | case Qt::Key_Home: |
1697 | // move to the first item and toggle selection of all items inbetween | 1712 | // move to the first item and toggle selection of all items inbetween |
1698 | nextItem = firstChild(); | 1713 | nextItem = firstChild(); |
1699 | visItem = nextItem; | 1714 | visItem = nextItem; |
1700 | repaintItem2 = visItem; | 1715 | repaintItem2 = visItem; |
@@ -1714,9 +1729,9 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
1714 | setCurrentItem( firstChild() ); | 1729 | setCurrentItem( firstChild() ); |
1715 | emitSelectionChanged=TRUE; | 1730 | emitSelectionChanged=TRUE; |
1716 | break; | 1731 | break; |
1717 | 1732 | ||
1718 | case Key_Next: | 1733 | case Qt::Key_Next: |
1719 | items=visibleHeight()/item->height(); | 1734 | items=visibleHeight()/item->height(); |
1720 | nextItem=item; | 1735 | nextItem=item; |
1721 | if (d->selectedBySimpleMove) | 1736 | if (d->selectedBySimpleMove) |
1722 | item->setSelected(false); | 1737 | item->setSelected(false); |
@@ -1750,9 +1765,9 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
1750 | nextItem=nextItem->itemBelow(); | 1765 | nextItem=nextItem->itemBelow(); |
1751 | } | 1766 | } |
1752 | break; | 1767 | break; |
1753 | 1768 | ||
1754 | case Key_Prior: | 1769 | case Qt::Key_Prior: |
1755 | items=visibleHeight()/item->height(); | 1770 | items=visibleHeight()/item->height(); |
1756 | nextItem=item; | 1771 | nextItem=item; |
1757 | if (d->selectedBySimpleMove) | 1772 | if (d->selectedBySimpleMove) |
1758 | item->setSelected(false); | 1773 | item->setSelected(false); |
@@ -1784,27 +1799,27 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
1784 | nextItem=nextItem->itemAbove(); | 1799 | nextItem=nextItem->itemAbove(); |
1785 | } | 1800 | } |
1786 | break; | 1801 | break; |
1787 | 1802 | ||
1788 | case Key_Minus: | 1803 | case Qt::Key_Minus: |
1789 | if ( item->isOpen() ) | 1804 | if ( item->isOpen() ) |
1790 | setOpen( item, FALSE ); | 1805 | setOpen( item, FALSE ); |
1791 | break; | 1806 | break; |
1792 | case Key_Plus: | 1807 | case Qt::Key_Plus: |
1793 | if ( !item->isOpen() && (item->isExpandable() || item->childCount()) ) | 1808 | if ( !item->isOpen() && (item->isExpandable() || item->childCount()) ) |
1794 | setOpen( item, TRUE ); | 1809 | setOpen( item, TRUE ); |
1795 | break; | 1810 | break; |
1796 | default: | 1811 | default: |
1797 | bool realKey = ((e->key()!=Key_Shift) && (e->key()!=Key_Control) | 1812 | bool realKey = ((e->key()!=Qt::Key_Shift) && (e->key()!=Qt::Key_Control) |
1798 | && (e->key()!=Key_Meta) && (e->key()!=Key_Alt)); | 1813 | && (e->key()!=Qt::Key_Meta) && (e->key()!=Qt::Key_Alt)); |
1799 | 1814 | ||
1800 | bool selectCurrentItem = (d->selectedBySimpleMove) && (item->isSelected()); | 1815 | bool selectCurrentItem = (d->selectedBySimpleMove) && (item->isSelected()); |
1801 | if (realKey && selectCurrentItem) | 1816 | if (realKey && selectCurrentItem) |
1802 | item->setSelected(false); | 1817 | item->setSelected(false); |
1803 | //this is mainly for the "goto filename beginning with pressed char" feature (aleXXX) | 1818 | //this is mainly for the "goto filename beginning with pressed char" feature (aleXXX) |
1804 | QListView::SelectionMode oldSelectionMode = selectionMode(); | 1819 | Q3ListView::SelectionMode oldSelectionMode = selectionMode(); |
1805 | setSelectionMode (QListView::Multi); | 1820 | setSelectionMode (Q3ListView::Multi); |
1806 | QListView::keyPressEvent (e); | 1821 | Q3ListView::keyPressEvent (e); |
1807 | setSelectionMode (oldSelectionMode); | 1822 | setSelectionMode (oldSelectionMode); |
1808 | if (realKey && selectCurrentItem) | 1823 | if (realKey && selectCurrentItem) |
1809 | { | 1824 | { |
1810 | currentItem()->setSelected(true); | 1825 | currentItem()->setSelected(true); |
@@ -1849,13 +1864,13 @@ void KListView::setSelectionModeExt (SelectionModeExt mode) | |||
1849 | case Single: | 1864 | case Single: |
1850 | case Multi: | 1865 | case Multi: |
1851 | case Extended: | 1866 | case Extended: |
1852 | case NoSelection: | 1867 | case NoSelection: |
1853 | setSelectionMode (static_cast<QListView::SelectionMode>(static_cast<int>(mode))); | 1868 | setSelectionMode (static_cast<Q3ListView::SelectionMode>(static_cast<int>(mode))); |
1854 | break; | 1869 | break; |
1855 | 1870 | ||
1856 | case FileManager: | 1871 | case FileManager: |
1857 | setSelectionMode (QListView::Extended); | 1872 | setSelectionMode (Q3ListView::Extended); |
1858 | break; | 1873 | break; |
1859 | 1874 | ||
1860 | default: | 1875 | default: |
1861 | kdWarning () << "Warning: illegal selection mode " << int(mode) << " set!" << endl; | 1876 | kdWarning () << "Warning: illegal selection mode " << int(mode) << " set!" << endl; |
@@ -1867,17 +1882,17 @@ KListView::SelectionModeExt KListView::selectionModeExt () const | |||
1867 | { | 1882 | { |
1868 | return d->selectionMode; | 1883 | return d->selectionMode; |
1869 | } | 1884 | } |
1870 | 1885 | ||
1871 | int KListView::itemIndex( const QListViewItem *item ) const | 1886 | int KListView::itemIndex( const Q3ListViewItem *item ) const |
1872 | { | 1887 | { |
1873 | if ( !item ) | 1888 | if ( !item ) |
1874 | return -1; | 1889 | return -1; |
1875 | 1890 | ||
1876 | if ( item == firstChild() ) | 1891 | if ( item == firstChild() ) |
1877 | return 0; | 1892 | return 0; |
1878 | else { | 1893 | else { |
1879 | QListViewItemIterator it(firstChild()); | 1894 | Q3ListViewItemIterator it(firstChild()); |
1880 | uint j = 0; | 1895 | uint j = 0; |
1881 | for (; it.current() && it.current() != item; ++it, ++j ); | 1896 | for (; it.current() && it.current() != item; ++it, ++j ); |
1882 | 1897 | ||
1883 | if( !it.current() ) | 1898 | if( !it.current() ) |
@@ -1886,15 +1901,15 @@ int KListView::itemIndex( const QListViewItem *item ) const | |||
1886 | return j; | 1901 | return j; |
1887 | } | 1902 | } |
1888 | } | 1903 | } |
1889 | 1904 | ||
1890 | QListViewItem* KListView::itemAtIndex(int index) | 1905 | Q3ListViewItem* KListView::itemAtIndex(int index) |
1891 | { | 1906 | { |
1892 | if (index<0) | 1907 | if (index<0) |
1893 | return 0; | 1908 | return 0; |
1894 | 1909 | ||
1895 | int j(0); | 1910 | int j(0); |
1896 | for (QListViewItemIterator it=firstChild(); it.current(); it++) | 1911 | for (Q3ListViewItemIterator it=firstChild(); it.current(); it++) |
1897 | { | 1912 | { |
1898 | if (j==index) | 1913 | if (j==index) |
1899 | return it.current(); | 1914 | return it.current(); |
1900 | j++; | 1915 | j++; |
@@ -1902,9 +1917,9 @@ QListViewItem* KListView::itemAtIndex(int index) | |||
1902 | return 0; | 1917 | return 0; |
1903 | } | 1918 | } |
1904 | 1919 | ||
1905 | 1920 | ||
1906 | void KListView::emitContextMenu (KListView*, QListViewItem* i) | 1921 | void KListView::emitContextMenu (KListView*, Q3ListViewItem* i) |
1907 | { | 1922 | { |
1908 | QPoint p; | 1923 | QPoint p; |
1909 | // qDebug("KListView::emitContextMenu "); | 1924 | // qDebug("KListView::emitContextMenu "); |
1910 | 1925 | ||
@@ -1915,11 +1930,11 @@ void KListView::emitContextMenu (KListView*, QListViewItem* i) | |||
1915 | 1930 | ||
1916 | emit contextMenu (this, i, p); | 1931 | emit contextMenu (this, i, p); |
1917 | } | 1932 | } |
1918 | 1933 | ||
1919 | void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) | 1934 | void KListView::emitContextMenu (Q3ListViewItem* i, const QPoint& p, int col) |
1920 | { | 1935 | { |
1921 | QListViewItem* item = i; | 1936 | Q3ListViewItem* item = i; |
1922 | int c = col; | 1937 | int c = col; |
1923 | // do not trust the values for QListViewItem* i and int col; | 1938 | // do not trust the values for QListViewItem* i and int col; |
1924 | // qDebug("KListView::emitContextMenu col"); | 1939 | // qDebug("KListView::emitContextMenu col"); |
1925 | if ( col == -1 ) { | 1940 | if ( col == -1 ) { |
@@ -1932,9 +1947,9 @@ void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) | |||
1932 | } | 1947 | } |
1933 | 1948 | ||
1934 | void KListView::setAcceptDrops (bool val) | 1949 | void KListView::setAcceptDrops (bool val) |
1935 | { | 1950 | { |
1936 | QListView::setAcceptDrops (val); | 1951 | Q3ListView::setAcceptDrops (val); |
1937 | viewport()->setAcceptDrops (val); | 1952 | viewport()->setAcceptDrops (val); |
1938 | } | 1953 | } |
1939 | 1954 | ||
1940 | int KListView::dropVisualizerWidth () const | 1955 | int KListView::dropVisualizerWidth () const |
@@ -1944,16 +1959,16 @@ int KListView::dropVisualizerWidth () const | |||
1944 | 1959 | ||
1945 | 1960 | ||
1946 | void KListView::viewportPaintEvent(QPaintEvent *e) | 1961 | void KListView::viewportPaintEvent(QPaintEvent *e) |
1947 | { | 1962 | { |
1948 | QListView::viewportPaintEvent(e); | 1963 | Q3ListView::viewportPaintEvent(e); |
1949 | 1964 | ||
1950 | if (d->mOldDropVisualizer.isValid() && e->rect().intersects(d->mOldDropVisualizer)) | 1965 | if (d->mOldDropVisualizer.isValid() && e->rect().intersects(d->mOldDropVisualizer)) |
1951 | { | 1966 | { |
1952 | QPainter painter(viewport()); | 1967 | QPainter painter(viewport()); |
1953 | 1968 | ||
1954 | // This is where we actually draw the drop-visualizer | 1969 | // This is where we actually draw the drop-visualizer |
1955 | painter.fillRect(d->mOldDropVisualizer, Dense4Pattern); | 1970 | painter.fillRect(d->mOldDropVisualizer, Qt::Dense4Pattern); |
1956 | } | 1971 | } |
1957 | if (d->mOldDropHighlighter.isValid() && e->rect().intersects(d->mOldDropHighlighter)) | 1972 | if (d->mOldDropHighlighter.isValid() && e->rect().intersects(d->mOldDropHighlighter)) |
1958 | { | 1973 | { |
1959 | QPainter painter(viewport()); | 1974 | QPainter painter(viewport()); |
@@ -1987,19 +2002,19 @@ bool KListView::fullWidth() const | |||
1987 | } | 2002 | } |
1988 | 2003 | ||
1989 | int KListView::addColumn(const QString& label, int width) | 2004 | int KListView::addColumn(const QString& label, int width) |
1990 | { | 2005 | { |
1991 | int result = QListView::addColumn(label, width); | 2006 | int result = Q3ListView::addColumn(label, width); |
1992 | if (d->fullWidth) { | 2007 | if (d->fullWidth) { |
1993 | //US header()->setStretchEnabled(false, columns()-2); | 2008 | //US header()->setStretchEnabled(false, columns()-2); |
1994 | //US header()->setStretchEnabled(true, columns()-1); | 2009 | //US header()->setStretchEnabled(true, columns()-1); |
1995 | } | 2010 | } |
1996 | return result; | 2011 | return result; |
1997 | } | 2012 | } |
1998 | 2013 | ||
1999 | int KListView::addColumn(const QIconSet& iconset, const QString& label, int width) | 2014 | int KListView::addColumn(const QIcon& iconset, const QString& label, int width) |
2000 | { | 2015 | { |
2001 | int result = QListView::addColumn(iconset, label, width); | 2016 | int result = Q3ListView::addColumn(iconset, label, width); |
2002 | if (d->fullWidth) { | 2017 | if (d->fullWidth) { |
2003 | //US header()->setStretchEnabled(false, columns()-2); | 2018 | //US header()->setStretchEnabled(false, columns()-2); |
2004 | //US header()->setStretchEnabled(true, columns()-1); | 2019 | //US header()->setStretchEnabled(true, columns()-1); |
2005 | } | 2020 | } |
@@ -2007,15 +2022,15 @@ int KListView::addColumn(const QIconSet& iconset, const QString& label, int widt | |||
2007 | } | 2022 | } |
2008 | 2023 | ||
2009 | void KListView::removeColumn(int index) | 2024 | void KListView::removeColumn(int index) |
2010 | { | 2025 | { |
2011 | QListView::removeColumn(index); | 2026 | Q3ListView::removeColumn(index); |
2012 | //US if (d->fullWidth && index == columns()) header()->setStretchEnabled(true, columns()-1); | 2027 | //US if (d->fullWidth && index == columns()) header()->setStretchEnabled(true, columns()-1); |
2013 | } | 2028 | } |
2014 | 2029 | ||
2015 | void KListView::viewportResizeEvent(QResizeEvent* e) | 2030 | void KListView::viewportResizeEvent(QResizeEvent* e) |
2016 | { | 2031 | { |
2017 | QListView::viewportResizeEvent(e); | 2032 | Q3ListView::viewportResizeEvent(e); |
2018 | } | 2033 | } |
2019 | 2034 | ||
2020 | const QColor &KListView::alternateBackground() const | 2035 | const QColor &KListView::alternateBackground() const |
2021 | { | 2036 | { |
@@ -2069,9 +2084,9 @@ void KListView::restoreLayout(KConfig *config, const QString &group) | |||
2069 | void KListView::setSorting(int column, bool ascending) | 2084 | void KListView::setSorting(int column, bool ascending) |
2070 | { | 2085 | { |
2071 | d->sortColumn = column; | 2086 | d->sortColumn = column; |
2072 | d->sortAscending = ascending; | 2087 | d->sortAscending = ascending; |
2073 | QListView::setSorting(column, ascending); | 2088 | Q3ListView::setSorting(column, ascending); |
2074 | } | 2089 | } |
2075 | 2090 | ||
2076 | int KListView::columnSorted(void) const | 2091 | int KListView::columnSorted(void) const |
2077 | { | 2092 | { |
@@ -2082,60 +2097,60 @@ bool KListView::ascendingSort(void) const | |||
2082 | { | 2097 | { |
2083 | return d->sortAscending; | 2098 | return d->sortAscending; |
2084 | } | 2099 | } |
2085 | 2100 | ||
2086 | KListViewItem::KListViewItem(QListView *parent) | 2101 | KListViewItem::KListViewItem(Q3ListView *parent) |
2087 | : QListViewItem(parent) | 2102 | : Q3ListViewItem(parent) |
2088 | { | 2103 | { |
2089 | init(); | 2104 | init(); |
2090 | } | 2105 | } |
2091 | 2106 | ||
2092 | KListViewItem::KListViewItem(QListViewItem *parent) | 2107 | KListViewItem::KListViewItem(Q3ListViewItem *parent) |
2093 | : QListViewItem(parent) | 2108 | : Q3ListViewItem(parent) |
2094 | { | 2109 | { |
2095 | init(); | 2110 | init(); |
2096 | } | 2111 | } |
2097 | 2112 | ||
2098 | KListViewItem::KListViewItem(QListView *parent, QListViewItem *after) | 2113 | KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after) |
2099 | : QListViewItem(parent, after) | 2114 | : Q3ListViewItem(parent, after) |
2100 | { | 2115 | { |
2101 | init(); | 2116 | init(); |
2102 | } | 2117 | } |
2103 | 2118 | ||
2104 | KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after) | 2119 | KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after) |
2105 | : QListViewItem(parent, after) | 2120 | : Q3ListViewItem(parent, after) |
2106 | { | 2121 | { |
2107 | init(); | 2122 | init(); |
2108 | } | 2123 | } |
2109 | 2124 | ||
2110 | KListViewItem::KListViewItem(QListView *parent, | 2125 | KListViewItem::KListViewItem(Q3ListView *parent, |
2111 | QString label1, QString label2, QString label3, QString label4, | 2126 | QString label1, QString label2, QString label3, QString label4, |
2112 | QString label5, QString label6, QString label7, QString label8) | 2127 | QString label5, QString label6, QString label7, QString label8) |
2113 | : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) | 2128 | : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) |
2114 | { | 2129 | { |
2115 | init(); | 2130 | init(); |
2116 | } | 2131 | } |
2117 | 2132 | ||
2118 | KListViewItem::KListViewItem(QListViewItem *parent, | 2133 | KListViewItem::KListViewItem(Q3ListViewItem *parent, |
2119 | QString label1, QString label2, QString label3, QString label4, | 2134 | QString label1, QString label2, QString label3, QString label4, |
2120 | QString label5, QString label6, QString label7, QString label8) | 2135 | QString label5, QString label6, QString label7, QString label8) |
2121 | : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) | 2136 | : Q3ListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) |
2122 | { | 2137 | { |
2123 | init(); | 2138 | init(); |
2124 | } | 2139 | } |
2125 | 2140 | ||
2126 | KListViewItem::KListViewItem(QListView *parent, QListViewItem *after, | 2141 | KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after, |
2127 | QString label1, QString label2, QString label3, QString label4, | 2142 | QString label1, QString label2, QString label3, QString label4, |
2128 | QString label5, QString label6, QString label7, QString label8) | 2143 | QString label5, QString label6, QString label7, QString label8) |
2129 | : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) | 2144 | : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) |
2130 | { | 2145 | { |
2131 | init(); | 2146 | init(); |
2132 | } | 2147 | } |
2133 | 2148 | ||
2134 | KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after, | 2149 | KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after, |
2135 | QString label1, QString label2, QString label3, QString label4, | 2150 | QString label1, QString label2, QString label3, QString label4, |
2136 | QString label5, QString label6, QString label7, QString label8) | 2151 | QString label5, QString label6, QString label7, QString label8) |
2137 | : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) | 2152 | : Q3ListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) |
2138 | { | 2153 | { |
2139 | init(); | 2154 | init(); |
2140 | } | 2155 | } |
2141 | 2156 | ||
@@ -2211,14 +2226,14 @@ void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in | |||
2211 | p->setBrushOrigin( o.x()-listView()->contentsX(), o.y()-listView()->contentsY() ); | 2226 | p->setBrushOrigin( o.x()-listView()->contentsX(), o.y()-listView()->contentsY() ); |
2212 | } | 2227 | } |
2213 | else if (isAlternate()) { | 2228 | else if (isAlternate()) { |
2214 | //US if (listView()->viewport()->backgroundMode()==Qt::FixedColor) | 2229 | //US if (listView()->viewport()->backgroundMode()==Qt::FixedColor) |
2215 | if (listView()->viewport()->backgroundMode()==QWidget::PaletteBackground) | 2230 | if (listView()->viewport()->backgroundMode()==Qt::PaletteBackground) |
2216 | _cg.setColor(QColorGroup::Background, static_cast< KListView* >(listView())->alternateBackground()); | 2231 | _cg.setColor(QColorGroup::Background, static_cast< KListView* >(listView())->alternateBackground()); |
2217 | else | 2232 | else |
2218 | _cg.setColor(QColorGroup::Base, static_cast< KListView* >(listView())->alternateBackground()); | 2233 | _cg.setColor(QColorGroup::Base, static_cast< KListView* >(listView())->alternateBackground()); |
2219 | } | 2234 | } |
2220 | QListViewItem::paintCell(p, _cg, column, width, alignment); | 2235 | Q3ListViewItem::paintCell(p, _cg, column, width, alignment); |
2221 | } | 2236 | } |
2222 | 2237 | ||
2223 | //US we do not have a "global KDE" variable to setup singleClick functionality | 2238 | //US we do not have a "global KDE" variable to setup singleClick functionality |
2224 | void KListView::setSingleClick(bool s) | 2239 | void KListView::setSingleClick(bool s) |
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 | |||
@@ -19,19 +19,30 @@ | |||
19 | */ | 19 | */ |
20 | #ifndef KLISTVIEW_H | 20 | #ifndef KLISTVIEW_H |
21 | #define KLISTVIEW_H | 21 | #define KLISTVIEW_H |
22 | 22 | ||
23 | #include <qlistview.h> | 23 | #include <q3listview.h> |
24 | 24 | ||
25 | #include <qptrlist.h> | 25 | #include <q3ptrlist.h> |
26 | //Added by qt3to4: | ||
27 | #include <QDragMoveEvent> | ||
28 | #include <QDropEvent> | ||
29 | #include <QDragLeaveEvent> | ||
30 | #include <QPaintEvent> | ||
31 | #include <QResizeEvent> | ||
32 | #include <QFocusEvent> | ||
33 | #include <QMouseEvent> | ||
34 | #include <QKeyEvent> | ||
35 | #include <QEvent> | ||
36 | #include <QDragEnterEvent> | ||
26 | 37 | ||
27 | //US | 38 | //US |
28 | class QDropEvent; | 39 | class QDropEvent; |
29 | class QDragLeaveEvent; | 40 | class QDragLeaveEvent; |
30 | class QDragMoveEvent; | 41 | class QDragMoveEvent; |
31 | class QDragEnterEvent; | 42 | class QDragEnterEvent; |
32 | 43 | ||
33 | class QDragObject; | 44 | class Q3DragObject; |
34 | class KConfig; | 45 | class KConfig; |
35 | class KLineEdit; | 46 | class KLineEdit; |
36 | /** | 47 | /** |
37 | * This Widget extends the functionality of QListView to honor the system | 48 | * This Widget extends the functionality of QListView to honor the system |
@@ -56,9 +67,9 @@ class KLineEdit; | |||
56 | * and @ref setDragEnabled(true). | 67 | * and @ref setDragEnabled(true). |
57 | * | 68 | * |
58 | * @version $Id$ | 69 | * @version $Id$ |
59 | */ | 70 | */ |
60 | class KListView : public QListView | 71 | class KListView : public Q3ListView |
61 | { | 72 | { |
62 | Q_OBJECT | 73 | Q_OBJECT |
63 | Q_ENUMS( SelectionModeExt ) | 74 | Q_ENUMS( SelectionModeExt ) |
64 | Q_PROPERTY( bool fullWidth READ fullWidth WRITE setFullWidth ) | 75 | Q_PROPERTY( bool fullWidth READ fullWidth WRITE setFullWidth ) |
@@ -105,17 +116,17 @@ public: | |||
105 | * | 116 | * |
106 | * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected | 117 | * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected |
107 | */ | 118 | */ |
108 | enum SelectionModeExt { | 119 | enum SelectionModeExt { |
109 | Single = QListView::Single, | 120 | Single = Q3ListView::Single, |
110 | Multi = QListView::Multi, | 121 | Multi = Q3ListView::Multi, |
111 | Extended = QListView::Extended, | 122 | Extended = Q3ListView::Extended, |
112 | NoSelection = QListView::NoSelection, | 123 | NoSelection = Q3ListView::NoSelection, |
113 | FileManager | 124 | FileManager |
114 | }; | 125 | }; |
115 | void repaintContents( bool erase = true ) | 126 | void repaintContents( bool erase = true ) |
116 | { | 127 | { |
117 | QScrollView::repaintContents( contentsX(), contentsY(), | 128 | Q3ScrollView::repaintContents( contentsX(), contentsY(), |
118 | visibleWidth(), visibleHeight(), erase ); | 129 | visibleWidth(), visibleHeight(), erase ); |
119 | }; | 130 | }; |
120 | /** | 131 | /** |
121 | * Constructor. | 132 | * Constructor. |
@@ -160,28 +171,28 @@ public: | |||
160 | 171 | ||
161 | /** | 172 | /** |
162 | * @return a list containing the currently selected items. | 173 | * @return a list containing the currently selected items. |
163 | */ | 174 | */ |
164 | QPtrList<QListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?) | 175 | Q3PtrList<Q3ListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?) |
165 | 176 | ||
166 | /** | 177 | /** |
167 | * Arbitrarily move @p item to @p parent, positioned immediately after item @p after. | 178 | * Arbitrarily move @p item to @p parent, positioned immediately after item @p after. |
168 | */ | 179 | */ |
169 | void moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after); | 180 | void moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after); |
170 | 181 | ||
171 | /** | 182 | /** |
172 | * @return the last item (not child!) of this listview. | 183 | * @return the last item (not child!) of this listview. |
173 | * | 184 | * |
174 | * @see lastChild() | 185 | * @see lastChild() |
175 | */ | 186 | */ |
176 | QListViewItem *lastItem() const; | 187 | Q3ListViewItem *lastItem() const; |
177 | 188 | ||
178 | /** | 189 | /** |
179 | * @return the last child of this listview. | 190 | * @return the last child of this listview. |
180 | * | 191 | * |
181 | * @see lastItem() | 192 | * @see lastItem() |
182 | */ | 193 | */ |
183 | QListViewItem* lastChild () const; | 194 | Q3ListViewItem* lastChild () const; |
184 | 195 | ||
185 | /** | 196 | /** |
186 | * @return the lineedit used for inline renaming. | 197 | * @return the lineedit used for inline renaming. |
187 | * Use that to setup a @ref KCompletion or @ref QValidator for the lineedit | 198 | * Use that to setup a @ref KCompletion or @ref QValidator for the lineedit |
@@ -275,16 +286,16 @@ public: | |||
275 | * Returns the index of @p item within the item tree or -1 if | 286 | * Returns the index of @p item within the item tree or -1 if |
276 | * @p item doesn't exist in this list view. This function takes | 287 | * @p item doesn't exist in this list view. This function takes |
277 | * all items into account not only the visible ones. | 288 | * all items into account not only the visible ones. |
278 | */ | 289 | */ |
279 | int itemIndex( const QListViewItem *item ) const; | 290 | int itemIndex( const Q3ListViewItem *item ) const; |
280 | 291 | ||
281 | /** | 292 | /** |
282 | * Returns the item of @p index within the item tree or 0 if | 293 | * Returns the item of @p index within the item tree or 0 if |
283 | * @p index doesn't exist in this list view. This function takes | 294 | * @p index doesn't exist in this list view. This function takes |
284 | * all items into account not only the visible ones. | 295 | * all items into account not only the visible ones. |
285 | */ | 296 | */ |
286 | QListViewItem* itemAtIndex(int index); | 297 | Q3ListViewItem* itemAtIndex(int index); |
287 | 298 | ||
288 | /** | 299 | /** |
289 | * @deprecated | 300 | * @deprecated |
290 | * @see #setFullWidth() | 301 | * @see #setFullWidth() |
@@ -313,9 +324,9 @@ public: | |||
313 | virtual int addColumn(const QString& label, int width = -1); | 324 | virtual int addColumn(const QString& label, int width = -1); |
314 | /** | 325 | /** |
315 | * Reimplemented for full width support | 326 | * Reimplemented for full width support |
316 | */ | 327 | */ |
317 | virtual int addColumn(const QIconSet& iconset, const QString& label, int width = -1); | 328 | virtual int addColumn(const QIcon& iconset, const QString& label, int width = -1); |
318 | /** | 329 | /** |
319 | * Reimplemented for full width support | 330 | * Reimplemented for full width support |
320 | * | 331 | * |
321 | * @see #addColumn() | 332 | * @see #addColumn() |
@@ -387,9 +398,9 @@ signals: | |||
387 | * | 398 | * |
388 | * Note that you may not delete any @ref QListViewItem objects in slots | 399 | * Note that you may not delete any @ref QListViewItem objects in slots |
389 | * connected to this signal. | 400 | * connected to this signal. |
390 | */ | 401 | */ |
391 | void executed( QListViewItem *item ); | 402 | void executed( Q3ListViewItem *item ); |
392 | 403 | ||
393 | /** | 404 | /** |
394 | * This signal is emitted whenever the user executes an listview item. | 405 | * This signal is emitted whenever the user executes an listview item. |
395 | * That means depending on the KDE wide Single Click/Double Click | 406 | * That means depending on the KDE wide Single Click/Double Click |
@@ -400,9 +411,9 @@ signals: | |||
400 | * | 411 | * |
401 | * Note that you may not delete any @ref QListViewItem objects in slots | 412 | * Note that you may not delete any @ref QListViewItem objects in slots |
402 | * connected to this signal. | 413 | * connected to this signal. |
403 | */ | 414 | */ |
404 | void executed( QListViewItem *item, const QPoint &pos, int c ); | 415 | void executed( Q3ListViewItem *item, const QPoint &pos, int c ); |
405 | 416 | ||
406 | /** | 417 | /** |
407 | * This signal gets emitted whenever the user double clicks into the | 418 | * This signal gets emitted whenever the user double clicks into the |
408 | * listview. | 419 | * listview. |
@@ -416,10 +427,10 @@ signals: | |||
416 | * This signal is more or less here for the sake of completeness. | 427 | * This signal is more or less here for the sake of completeness. |
417 | * You should normally not need to use this. In most cases its better | 428 | * You should normally not need to use this. In most cases its better |
418 | * to use @ref #executed() instead. | 429 | * to use @ref #executed() instead. |
419 | */ | 430 | */ |
420 | void doubleClicked( QListViewItem *item, const QPoint &pos, int c ); | 431 | void doubleClicked( Q3ListViewItem *item, const QPoint &pos, int c ); |
421 | void contextRequest( QListViewItem *item, const QPoint &pos, int c ); | 432 | void contextRequest( Q3ListViewItem *item, const QPoint &pos, int c ); |
422 | 433 | ||
423 | /** | 434 | /** |
424 | * This signal gets emitted whenever something acceptable is | 435 | * This signal gets emitted whenever something acceptable is |
425 | * dropped onto the listview. | 436 | * dropped onto the listview. |
@@ -429,9 +440,9 @@ signals: | |||
429 | * the drop was above all items) | 440 | * the drop was above all items) |
430 | * | 441 | * |
431 | * @see #acceptDrop() | 442 | * @see #acceptDrop() |
432 | */ | 443 | */ |
433 | void dropped (QDropEvent * e, QListViewItem *after); | 444 | void dropped (QDropEvent * e, Q3ListViewItem *after); |
434 | 445 | ||
435 | /** | 446 | /** |
436 | * This signal gets emitted whenever something acceptable is | 447 | * This signal gets emitted whenever something acceptable is |
437 | * dropped onto the listview. | 448 | * dropped onto the listview. |
@@ -443,9 +454,9 @@ signals: | |||
443 | * @param e is the drop event itself (it has already been accepted) | 454 | * @param e is the drop event itself (it has already been accepted) |
444 | * @param after is the item after which the drop occured (or 0L, if | 455 | * @param after is the item after which the drop occured (or 0L, if |
445 | * the drop was above all items | 456 | * the drop was above all items |
446 | */ | 457 | */ |
447 | void dropped (KListView* list, QDropEvent* e, QListViewItem* after); | 458 | void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* after); |
448 | 459 | ||
449 | /** | 460 | /** |
450 | * This signal gets emitted whenever something acceptable is | 461 | * This signal gets emitted whenever something acceptable is |
451 | * dropped onto the listview. | 462 | * dropped onto the listview. |
@@ -457,9 +468,9 @@ signals: | |||
457 | * @param parent the item that is to be the parent of the new item | 468 | * @param parent the item that is to be the parent of the new item |
458 | * @param after is the item after which the drop occured (or 0L, if | 469 | * @param after is the item after which the drop occured (or 0L, if |
459 | * the drop was above all items | 470 | * the drop was above all items |
460 | */ | 471 | */ |
461 | void dropped (KListView* list, QDropEvent* e, QListViewItem* parent, QListViewItem* after); | 472 | void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after); |
462 | 473 | ||
463 | /** | 474 | /** |
464 | * This signal gets emitted whenever something acceptable is | 475 | * This signal gets emitted whenever something acceptable is |
465 | * dropped onto the listview. | 476 | * dropped onto the listview. |
@@ -470,9 +481,9 @@ signals: | |||
470 | * @param parent the item that is to be the parent of the new item | 481 | * @param parent the item that is to be the parent of the new item |
471 | * @param after is the item after which the drop occured (or 0L, if | 482 | * @param after is the item after which the drop occured (or 0L, if |
472 | * the drop was above all items | 483 | * the drop was above all items |
473 | */ | 484 | */ |
474 | void dropped (QDropEvent* e, QListViewItem* parent, QListViewItem* after); | 485 | void dropped (QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after); |
475 | 486 | ||
476 | /** | 487 | /** |
477 | * This signal is emitted when ever the user moves an item in the list via | 488 | * This signal is emitted when ever the user moves an item in the list via |
478 | * DnD. | 489 | * DnD. |
@@ -501,31 +512,31 @@ signals: | |||
501 | * @param item the item that was moved | 512 | * @param item the item that was moved |
502 | * @param afterFirst the item that parameter item was in before the move, in the list | 513 | * @param afterFirst the item that parameter item was in before the move, in the list |
503 | * @param afterNow the item it's currently after. | 514 | * @param afterNow the item it's currently after. |
504 | */ | 515 | */ |
505 | void moved (QListViewItem *item, QListViewItem *afterFirst, QListViewItem *afterNow); | 516 | void moved (Q3ListViewItem *item, Q3ListViewItem *afterFirst, Q3ListViewItem *afterNow); |
506 | 517 | ||
507 | 518 | ||
508 | /** | 519 | /** |
509 | * This signal is emitted after all the items have been moved. It reports info for | 520 | * This signal is emitted after all the items have been moved. It reports info for |
510 | * each and every item moved, in order. The first element in @p items associates | 521 | * each and every item moved, in order. The first element in @p items associates |
511 | * with the first of afterFirst and afterNow. | 522 | * with the first of afterFirst and afterNow. |
512 | */ | 523 | */ |
513 | void moved(QPtrList<QListViewItem> &items, QPtrList<QListViewItem> &afterFirst, QPtrList<QListViewItem> &afterNow); | 524 | void moved(Q3PtrList<Q3ListViewItem> &items, Q3PtrList<Q3ListViewItem> &afterFirst, Q3PtrList<Q3ListViewItem> &afterNow); |
514 | 525 | ||
515 | /** | 526 | /** |
516 | * This signal gets emitted when an item is renamed via in-place renaming. | 527 | * This signal gets emitted when an item is renamed via in-place renaming. |
517 | * | 528 | * |
518 | * @param item is the renamed item. | 529 | * @param item is the renamed item. |
519 | * @param str is the new value of column @p col. | 530 | * @param str is the new value of column @p col. |
520 | * @param col is the renamed column. | 531 | * @param col is the renamed column. |
521 | */ | 532 | */ |
522 | void itemRenamed(QListViewItem* item, const QString &str, int col); | 533 | void itemRenamed(Q3ListViewItem* item, const QString &str, int col); |
523 | 534 | ||
524 | /** | 535 | /** |
525 | * Same as above, but without the extra information. | 536 | * Same as above, but without the extra information. |
526 | */ | 537 | */ |
527 | void itemRenamed(QListViewItem* item); | 538 | void itemRenamed(Q3ListViewItem* item); |
528 | void signalDelete(); | 539 | void signalDelete(); |
529 | 540 | ||
530 | /** | 541 | /** |
531 | * This signal is emitted when the shortcut key for popup-menus is pressed. | 542 | * This signal is emitted when the shortcut key for popup-menus is pressed. |
@@ -536,9 +547,9 @@ signals: | |||
536 | * | 547 | * |
537 | * @param list is this listview. | 548 | * @param list is this listview. |
538 | * @param item is the @ref currentItem() at the time the key was pressed. May be 0L. | 549 | * @param item is the @ref currentItem() at the time the key was pressed. May be 0L. |
539 | */ | 550 | */ |
540 | void menuShortCutPressed (KListView* list, QListViewItem* item); | 551 | void menuShortCutPressed (KListView* list, Q3ListViewItem* item); |
541 | 552 | ||
542 | /** | 553 | /** |
543 | * This signal is emitted whenever a context-menu should be shown for item @p i. | 554 | * This signal is emitted whenever a context-menu should be shown for item @p i. |
544 | * It automatically adjusts for all settings involved (Menu key, showMenuOnPress/Click). | 555 | * It automatically adjusts for all settings involved (Menu key, showMenuOnPress/Click). |
@@ -546,15 +557,15 @@ signals: | |||
546 | * @param l is this listview. | 557 | * @param l is this listview. |
547 | * @param i is the item for which the menu should be shown. May be 0L. | 558 | * @param i is the item for which the menu should be shown. May be 0L. |
548 | * @param p is the point at which the menu should be shown. | 559 | * @param p is the point at which the menu should be shown. |
549 | */ | 560 | */ |
550 | void contextMenu (KListView* l, QListViewItem* i, const QPoint& p); | 561 | void contextMenu (KListView* l, Q3ListViewItem* i, const QPoint& p); |
551 | 562 | ||
552 | public slots: | 563 | public slots: |
553 | /** | 564 | /** |
554 | * Rename column @p c of @p item. | 565 | * Rename column @p c of @p item. |
555 | */ | 566 | */ |
556 | virtual void rename(QListViewItem *item, int c); | 567 | virtual void rename(Q3ListViewItem *item, int c); |
557 | 568 | ||
558 | /** | 569 | /** |
559 | * By default, if you called setItemsRenameable(true), | 570 | * By default, if you called setItemsRenameable(true), |
560 | * only the first column is renameable. | 571 | * only the first column is renameable. |
@@ -672,9 +683,9 @@ protected: | |||
672 | * @param i the item whose rect() is passed to the above function. | 683 | * @param i the item whose rect() is passed to the above function. |
673 | * @param p is translated from contents coordinates to viewport coordinates | 684 | * @param p is translated from contents coordinates to viewport coordinates |
674 | * before being passed to the above function. | 685 | * before being passed to the above function. |
675 | */ | 686 | */ |
676 | inline bool below (QListViewItem* i, const QPoint& p) | 687 | inline bool below (Q3ListViewItem* i, const QPoint& p) |
677 | { | 688 | { |
678 | return below (itemRect(i), contentsToViewport(p)); | 689 | return below (itemRect(i), contentsToViewport(p)); |
679 | } | 690 | } |
680 | 691 | ||
@@ -688,9 +699,9 @@ protected: | |||
688 | * Emit signal @ref #executed. | 699 | * Emit signal @ref #executed. |
689 | * @internal | 700 | * @internal |
690 | */ | 701 | */ |
691 | //US I added buttonstate to pass the current keyboard status | 702 | //US I added buttonstate to pass the current keyboard status |
692 | void emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c); | 703 | void emitExecute( int buttonstate, Q3ListViewItem *item, const QPoint &pos, int c); |
693 | 704 | ||
694 | /** | 705 | /** |
695 | * Reimplemented for internal reasons. | 706 | * Reimplemented for internal reasons. |
696 | * Further reimplementations should call this function or else | 707 | * Further reimplementations should call this function or else |
@@ -720,14 +731,14 @@ protected: | |||
720 | 731 | ||
721 | /** | 732 | /** |
722 | * @return the tooltip for @p column of @p item. | 733 | * @return the tooltip for @p column of @p item. |
723 | */ | 734 | */ |
724 | virtual QString tooltip(QListViewItem* item, int column) const; | 735 | virtual QString tooltip(Q3ListViewItem* item, int column) const; |
725 | 736 | ||
726 | /** | 737 | /** |
727 | * @return whether the tooltip for @p column of @p item shall be shown at point @p pos. | 738 | * @return whether the tooltip for @p column of @p item shall be shown at point @p pos. |
728 | */ | 739 | */ |
729 | virtual bool showTooltip(QListViewItem *item, const QPoint &pos, int column) const; | 740 | virtual bool showTooltip(Q3ListViewItem *item, const QPoint &pos, int column) const; |
730 | 741 | ||
731 | /** | 742 | /** |
732 | * Reimplemented for internal reasons. | 743 | * Reimplemented for internal reasons. |
733 | * Further reimplementations should call this function or else | 744 | * Further reimplementations should call this function or else |
@@ -804,9 +815,9 @@ protected: | |||
804 | * @return a dragobject encoding the current selection. | 815 | * @return a dragobject encoding the current selection. |
805 | * | 816 | * |
806 | * @see setDragEnabled() | 817 | * @see setDragEnabled() |
807 | */ | 818 | */ |
808 | virtual QDragObject *dragObject(); | 819 | virtual Q3DragObject *dragObject(); |
809 | 820 | ||
810 | /** | 821 | /** |
811 | * @return true if the @p event provides some acceptable | 822 | * @return true if the @p event provides some acceptable |
812 | * format. | 823 | * format. |
@@ -820,17 +831,17 @@ protected: | |||
820 | * If after == 0 then the marker should be drawn at the top. | 831 | * If after == 0 then the marker should be drawn at the top. |
821 | * | 832 | * |
822 | * @return the rectangle that you painted to. | 833 | * @return the rectangle that you painted to. |
823 | */ | 834 | */ |
824 | virtual QRect drawDropVisualizer (QPainter *p, QListViewItem *parent, QListViewItem *after); | 835 | virtual QRect drawDropVisualizer (QPainter *p, Q3ListViewItem *parent, Q3ListViewItem *after); |
825 | 836 | ||
826 | /** | 837 | /** |
827 | * Paint the drag rectangle. If painter is null, don't try to :) | 838 | * Paint the drag rectangle. If painter is null, don't try to :) |
828 | * | 839 | * |
829 | * | 840 | * |
830 | * @return the rectangle that you painted to. | 841 | * @return the rectangle that you painted to. |
831 | */ | 842 | */ |
832 | virtual QRect drawItemHighlighter(QPainter *painter, QListViewItem *item); | 843 | virtual QRect drawItemHighlighter(QPainter *painter, Q3ListViewItem *item); |
833 | 844 | ||
834 | /** | 845 | /** |
835 | * This method calls @ref dragObject() and starts the drag. | 846 | * This method calls @ref dragObject() and starts the drag. |
836 | * | 847 | * |
@@ -885,10 +896,10 @@ protected slots: | |||
885 | * @internal | 896 | * @internal |
886 | */ | 897 | */ |
887 | void slotSettingsChanged(int); | 898 | void slotSettingsChanged(int); |
888 | 899 | ||
889 | void slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ); | 900 | void slotMouseButtonClicked( int btn, Q3ListViewItem *item, const QPoint &pos, int c ); |
890 | void doneEditing(QListViewItem *item, int row); | 901 | void doneEditing(Q3ListViewItem *item, int row); |
891 | 902 | ||
892 | /** | 903 | /** |
893 | * Repaint the rect where I was drawing the drop line. | 904 | * Repaint the rect where I was drawing the drop line. |
894 | */ | 905 | */ |
@@ -901,20 +912,20 @@ protected slots: | |||
901 | 912 | ||
902 | /** | 913 | /** |
903 | * Emit the @ref contextMenu signal. This slot is for mouse actions. | 914 | * Emit the @ref contextMenu signal. This slot is for mouse actions. |
904 | */ | 915 | */ |
905 | void emitContextMenu (QListViewItem*, const QPoint&, int); | 916 | void emitContextMenu (Q3ListViewItem*, const QPoint&, int); |
906 | 917 | ||
907 | /** | 918 | /** |
908 | * Emit the @ref #contextMenu signal. This slot is for key presses. | 919 | * Emit the @ref #contextMenu signal. This slot is for key presses. |
909 | */ | 920 | */ |
910 | void emitContextMenu (KListView*, QListViewItem*); | 921 | void emitContextMenu (KListView*, Q3ListViewItem*); |
911 | 922 | ||
912 | /** | 923 | /** |
913 | * Accessory slot for AutoSelect | 924 | * Accessory slot for AutoSelect |
914 | * @internal | 925 | * @internal |
915 | */ | 926 | */ |
916 | void slotOnItem( QListViewItem *item ); | 927 | void slotOnItem( Q3ListViewItem *item ); |
917 | 928 | ||
918 | /** | 929 | /** |
919 | * Accessory slot for AutoSelect/ChangeCursorOverItem | 930 | * Accessory slot for AutoSelect/ChangeCursorOverItem |
920 | * @internal | 931 | * @internal |
@@ -938,17 +949,17 @@ protected slots: | |||
938 | protected: | 949 | protected: |
939 | /** | 950 | /** |
940 | * Handle dropEvent when itemsMovable() is set to true. | 951 | * Handle dropEvent when itemsMovable() is set to true. |
941 | */ | 952 | */ |
942 | virtual void movableDropEvent (QListViewItem* parent, QListViewItem* afterme); | 953 | virtual void movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme); |
943 | 954 | ||
944 | /** | 955 | /** |
945 | * Where is the nearest QListViewItem that I'm going to drop? | 956 | * Where is the nearest QListViewItem that I'm going to drop? |
946 | * | 957 | * |
947 | * FIXME KDE 4.0: Make this method const so it can be called from an | 958 | * FIXME KDE 4.0: Make this method const so it can be called from an |
948 | * acceptDrag method without ugly casts | 959 | * acceptDrag method without ugly casts |
949 | */ | 960 | */ |
950 | virtual void findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after); | 961 | virtual void findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after); |
951 | 962 | ||
952 | /** | 963 | /** |
953 | * A special keyPressEvent (for FileManager selection mode). | 964 | * A special keyPressEvent (for FileManager selection mode). |
954 | */ | 965 | */ |
@@ -973,41 +984,41 @@ private: | |||
973 | * a drop-in replacement for @ref QListViewItem | 984 | * a drop-in replacement for @ref QListViewItem |
974 | * | 985 | * |
975 | * @short listview item with alternate background colour support | 986 | * @short listview item with alternate background colour support |
976 | */ | 987 | */ |
977 | class KListViewItem : public QListViewItem | 988 | class KListViewItem : public Q3ListViewItem |
978 | { | 989 | { |
979 | public: | 990 | public: |
980 | /** | 991 | /** |
981 | * constructors. The semantics remain as in @ref QListViewItem. | 992 | * constructors. The semantics remain as in @ref QListViewItem. |
982 | * Although they accept a @ref QListViewItem as parent, please | 993 | * Although they accept a @ref QListViewItem as parent, please |
983 | * don't mix KListViewItem (or subclasses) with QListViewItem | 994 | * don't mix KListViewItem (or subclasses) with QListViewItem |
984 | * (or subclasses). | 995 | * (or subclasses). |
985 | */ | 996 | */ |
986 | KListViewItem(QListView *parent); | 997 | KListViewItem(Q3ListView *parent); |
987 | KListViewItem(QListViewItem *parent); | 998 | KListViewItem(Q3ListViewItem *parent); |
988 | KListViewItem(QListView *parent, QListViewItem *after); | 999 | KListViewItem(Q3ListView *parent, Q3ListViewItem *after); |
989 | KListViewItem(QListViewItem *parent, QListViewItem *after); | 1000 | KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after); |
990 | 1001 | ||
991 | KListViewItem(QListView *parent, | 1002 | KListViewItem(Q3ListView *parent, |
992 | QString, QString = QString::null, | 1003 | QString, QString = QString::null, |
993 | QString = QString::null, QString = QString::null, | 1004 | QString = QString::null, QString = QString::null, |
994 | QString = QString::null, QString = QString::null, | 1005 | QString = QString::null, QString = QString::null, |
995 | QString = QString::null, QString = QString::null); | 1006 | QString = QString::null, QString = QString::null); |
996 | 1007 | ||
997 | KListViewItem(QListViewItem *parent, | 1008 | KListViewItem(Q3ListViewItem *parent, |
998 | QString, QString = QString::null, | 1009 | QString, QString = QString::null, |
999 | QString = QString::null, QString = QString::null, | 1010 | QString = QString::null, QString = QString::null, |
1000 | QString = QString::null, QString = QString::null, | 1011 | QString = QString::null, QString = QString::null, |
1001 | QString = QString::null, QString = QString::null); | 1012 | QString = QString::null, QString = QString::null); |
1002 | 1013 | ||
1003 | KListViewItem(QListView *parent, QListViewItem *after, | 1014 | KListViewItem(Q3ListView *parent, Q3ListViewItem *after, |
1004 | QString, QString = QString::null, | 1015 | QString, QString = QString::null, |
1005 | QString = QString::null, QString = QString::null, | 1016 | QString = QString::null, QString = QString::null, |
1006 | QString = QString::null, QString = QString::null, | 1017 | QString = QString::null, QString = QString::null, |
1007 | QString = QString::null, QString = QString::null); | 1018 | QString = QString::null, QString = QString::null); |
1008 | 1019 | ||
1009 | KListViewItem(QListViewItem *parent, QListViewItem *after, | 1020 | KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after, |
1010 | QString, QString = QString::null, | 1021 | QString, QString = QString::null, |
1011 | QString = QString::null, QString = QString::null, | 1022 | QString = QString::null, QString = QString::null, |
1012 | QString = QString::null, QString = QString::null, | 1023 | QString = QString::null, QString = QString::null, |
1013 | QString = QString::null, QString = QString::null); | 1024 | 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 | |||
@@ -20,14 +20,20 @@ | |||
20 | along with this library; see the file COPYING.LIB. If not, write to | 20 | along with this library; see the file COPYING.LIB. If not, write to |
21 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 21 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
22 | Boston, MA 02111-1307, USA. | 22 | Boston, MA 02111-1307, USA. |
23 | */ | 23 | */ |
24 | #include <qobjectlist.h> | 24 | #include <qobject.h> |
25 | #include <qstringlist.h> | 25 | #include <qstringlist.h> |
26 | #include <qtimer.h> | 26 | #include <qtimer.h> |
27 | #include <qmenubar.h> | 27 | #include <qmenubar.h> |
28 | #include <qstatusbar.h> | 28 | #include <qstatusbar.h> |
29 | #include <qapplication.h> | 29 | #include <qapplication.h> |
30 | //Added by qt3to4: | ||
31 | #include <QCloseEvent> | ||
32 | #include <QPaintEvent> | ||
33 | #include <QResizeEvent> | ||
34 | #include <QChildEvent> | ||
35 | #include <Q3PtrList> | ||
30 | 36 | ||
31 | 37 | ||
32 | #include "kdebug.h" | 38 | #include "kdebug.h" |
33 | #include "kmainwindow.h" | 39 | #include "kmainwindow.h" |
@@ -53,9 +59,9 @@ public: | |||
53 | 59 | ||
54 | static bool no_query_exit = false; | 60 | static bool no_query_exit = false; |
55 | 61 | ||
56 | KMainWindow::KMainWindow( QWidget* parent, const char *name ) | 62 | KMainWindow::KMainWindow( QWidget* parent, const char *name ) |
57 | : QMainWindow( parent, name ) /*LR, f ) with the default widget flag we cannot have fastload */ /*US, KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )*/ | 63 | : Q3MainWindow( parent, name ) /*LR, f ) with the default widget flag we cannot have fastload */ /*US, KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )*/ |
58 | { | 64 | { |
59 | mQToolBar = 0; | 65 | mQToolBar = 0; |
60 | initKMainWindow(name); | 66 | initKMainWindow(name); |
61 | } | 67 | } |
@@ -275,9 +281,9 @@ void KMainWindow::setCaption( const QString &caption, bool modified ) | |||
275 | } | 281 | } |
276 | 282 | ||
277 | void KMainWindow::setPlainCaption( const QString &caption ) | 283 | void KMainWindow::setPlainCaption( const QString &caption ) |
278 | { | 284 | { |
279 | QMainWindow::setCaption( caption ); | 285 | Q3MainWindow::setCaption( caption ); |
280 | #ifndef Q_WS_QWS | 286 | #ifndef Q_WS_QWS |
281 | //US the following is disabled for the embedded version | 287 | //US the following is disabled for the embedded version |
282 | //US NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 ); | 288 | //US NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 ); |
283 | //US info.setName( caption.utf8().data() ); | 289 | //US info.setName( caption.utf8().data() ); |
@@ -420,12 +426,12 @@ void KMainWindow::createStandardStatusBarAction(){ | |||
420 | d->showStatusBarAction->setChecked(!internalStatusBar()->isHidden()); | 426 | d->showStatusBarAction->setChecked(!internalStatusBar()->isHidden()); |
421 | } | 427 | } |
422 | } | 428 | } |
423 | 429 | ||
424 | QToolBar *KMainWindow::tBar( ) | 430 | Q3ToolBar *KMainWindow::tBar( ) |
425 | { | 431 | { |
426 | if ( ! mQToolBar ) | 432 | if ( ! mQToolBar ) |
427 | mQToolBar = new QToolBar( this ); | 433 | mQToolBar = new Q3ToolBar( this ); |
428 | return mQToolBar; | 434 | return mQToolBar; |
429 | } | 435 | } |
430 | 436 | ||
431 | KToolBar *KMainWindow::toolBar( const char * name ) | 437 | KToolBar *KMainWindow::toolBar( const char * name ) |
@@ -442,24 +448,25 @@ KToolBar *KMainWindow::toolBar( const char * name ) | |||
442 | if ( builderClient() ) | 448 | if ( builderClient() ) |
443 | return new KToolBar(this, name, honor_mode); // XMLGUI constructor | 449 | return new KToolBar(this, name, honor_mode); // XMLGUI constructor |
444 | else | 450 | else |
445 | */ | 451 | */ |
446 | return new KToolBar(this, Top, false, name, honor_mode ); // non-XMLGUI | 452 | return new KToolBar(this, Qt::Top, false, name, honor_mode ); // non-XMLGUI |
447 | } | 453 | } |
448 | 454 | ||
449 | QPtrListIterator<KToolBar> KMainWindow::toolBarIterator() | 455 | Q3PtrListIterator<KToolBar> KMainWindow::toolBarIterator() |
450 | { | 456 | { |
451 | toolbarList.clear(); | 457 | toolbarList.clear(); |
452 | QPtrList<QToolBar> lst; | 458 | QList<Q3ToolBar*> lst; |
453 | for ( int i = (int)QMainWindow::Unmanaged; i <= (int)Minimized; ++i ) { | 459 | for ( int i = (int)Qt::Unmanaged; i <= (int)Qt::Minimized; ++i ) { |
454 | lst = toolBars( (ToolBarDock)i ); | 460 | lst = toolBars( (Qt::ToolBarDock)i ); |
455 | for ( QToolBar *tb = lst.first(); tb; tb = lst.next() ) { | 461 | for(QList<Q3ToolBar*>::iterator i=lst.begin();i!=lst.end();++i) { |
462 | Q3ToolBar *tb = *i; | ||
456 | if ( !tb->inherits( "KToolBar" ) ) | 463 | if ( !tb->inherits( "KToolBar" ) ) |
457 | continue; | 464 | continue; |
458 | toolbarList.append( (KToolBar*)tb ); | 465 | toolbarList.append( (KToolBar*)tb ); |
459 | } | 466 | } |
460 | } | 467 | } |
461 | return QPtrListIterator<KToolBar>( toolbarList ); | 468 | return Q3PtrListIterator<KToolBar>( toolbarList ); |
462 | } | 469 | } |
463 | 470 | ||
464 | void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindowSize ) | 471 | void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindowSize ) |
465 | { | 472 | { |
@@ -468,9 +475,9 @@ void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindo | |||
468 | d->autoSaveWindowSize = saveWindowSize; | 475 | d->autoSaveWindowSize = saveWindowSize; |
469 | // Get notified when the user moves a toolbar around | 476 | // Get notified when the user moves a toolbar around |
470 | //US connect( this, SIGNAL( dockWindowPositionChanged( QDockWindow * ) ), | 477 | //US connect( this, SIGNAL( dockWindowPositionChanged( QDockWindow * ) ), |
471 | //US this, SLOT( setSettingsDirty() ) ); | 478 | //US this, SLOT( setSettingsDirty() ) ); |
472 | connect( this, SIGNAL( toolBarPositionChanged(QToolBar *) ), | 479 | connect( this, SIGNAL( toolBarPositionChanged(Q3ToolBar *) ), |
473 | this, SLOT( setSettingsDirty() ) ); | 480 | this, SLOT( setSettingsDirty() ) ); |
474 | 481 | ||
475 | 482 | ||
476 | // Get default values | 483 | // Get default values |
@@ -502,9 +509,9 @@ QString KMainWindow::autoSaveGroup() const | |||
502 | } | 509 | } |
503 | 510 | ||
504 | void KMainWindow::saveAutoSaveSettings() | 511 | void KMainWindow::saveAutoSaveSettings() |
505 | { | 512 | { |
506 | ASSERT( d->autoSaveSettings ); | 513 | Q_ASSERT( d->autoSaveSettings ); |
507 | //kdDebug(200) << "KMainWindow::saveAutoSaveSettings -> saving settings" << endl; | 514 | //kdDebug(200) << "KMainWindow::saveAutoSaveSettings -> saving settings" << endl; |
508 | saveMainWindowSettings( KGlobal::config(), d->autoSaveGroup ); | 515 | saveMainWindowSettings( KGlobal::config(), d->autoSaveGroup ); |
509 | KGlobal::config()->sync(); | 516 | KGlobal::config()->sync(); |
510 | d->settingsDirty = false; | 517 | d->settingsDirty = false; |
@@ -638,9 +645,9 @@ void KMainWindow::saveMainWindowSettings(KConfig *config, const QString &configG | |||
638 | } | 645 | } |
639 | 646 | ||
640 | int n = 1; // Toolbar counter. toolbars are counted from 1, | 647 | int n = 1; // Toolbar counter. toolbars are counted from 1, |
641 | KToolBar *toolbar = 0; | 648 | KToolBar *toolbar = 0; |
642 | QPtrListIterator<KToolBar> it( toolBarIterator() ); | 649 | Q3PtrListIterator<KToolBar> it( toolBarIterator() ); |
643 | while ( ( toolbar = it.current() ) ) { | 650 | while ( ( toolbar = it.current() ) ) { |
644 | ++it; | 651 | ++it; |
645 | QString group; | 652 | QString group; |
646 | if (!configGroup.isEmpty()) | 653 | if (!configGroup.isEmpty()) |
@@ -713,21 +720,23 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config | |||
713 | if (mb) { | 720 | if (mb) { |
714 | entryList.clear(); | 721 | entryList.clear(); |
715 | //US i = config->readListEntry (QString::fromLatin1("MenuBar"), entryList, ';'); | 722 | //US i = config->readListEntry (QString::fromLatin1("MenuBar"), entryList, ';'); |
716 | entryList = config->readListEntry (QString::fromLatin1("MenuBar")); | 723 | entryList = config->readListEntry (QString::fromLatin1("MenuBar")); |
717 | entry = entryList.first(); | 724 | if(!entryList.empty()) { |
718 | if (entry==QString::fromLatin1("Disabled")) | 725 | entry = entryList.first(); |
719 | { | 726 | if (entry==QString::fromLatin1("Disabled")) |
720 | mb->hide(); | 727 | { |
721 | } else | 728 | mb->hide(); |
722 | { | 729 | } else |
723 | mb->show(); | 730 | { |
724 | } | 731 | mb->show(); |
732 | } | ||
733 | } | ||
725 | } | 734 | } |
726 | 735 | ||
727 | int n = 1; // Toolbar counter. toolbars are counted from 1, | 736 | int n = 1; // Toolbar counter. toolbars are counted from 1, |
728 | KToolBar *toolbar; | 737 | KToolBar *toolbar; |
729 | QPtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator | 738 | Q3PtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator |
730 | 739 | ||
731 | for ( ; it.current(); ++it) { | 740 | for ( ; it.current(); ++it) { |
732 | toolbar= it.current(); | 741 | toolbar= it.current(); |
733 | QString group; | 742 | QString group; |
@@ -755,9 +764,9 @@ void KMainWindow::finalizeGUI( bool force ) | |||
755 | // Since we can't do that immediately, we move them, and _then_ | 764 | // Since we can't do that immediately, we move them, and _then_ |
756 | // we call positionYourself again for each of them, but this time | 765 | // we call positionYourself again for each of them, but this time |
757 | // the toolbariterator should give them in the proper order. | 766 | // the toolbariterator should give them in the proper order. |
758 | // Both the XMLGUI and applySettings call this, hence "force" for the latter. | 767 | // Both the XMLGUI and applySettings call this, hence "force" for the latter. |
759 | QPtrListIterator<KToolBar> it( toolBarIterator() ); | 768 | Q3PtrListIterator<KToolBar> it( toolBarIterator() ); |
760 | for ( ; it.current() ; ++ it ) | 769 | for ( ; it.current() ; ++ it ) |
761 | it.current()->positionYourself( force ); | 770 | it.current()->positionYourself( force ); |
762 | 771 | ||
763 | d->settingsDirty = false; | 772 | d->settingsDirty = false; |
@@ -850,9 +859,9 @@ QString KMainWindow::settingsGroup() const | |||
850 | void KMainWindow::resizeEvent( QResizeEvent * e) | 859 | void KMainWindow::resizeEvent( QResizeEvent * e) |
851 | { | 860 | { |
852 | if ( d->autoSaveWindowSize ) | 861 | if ( d->autoSaveWindowSize ) |
853 | setSettingsDirty(); | 862 | setSettingsDirty(); |
854 | QMainWindow::resizeEvent( e ); | 863 | Q3MainWindow::resizeEvent( e ); |
855 | } | 864 | } |
856 | 865 | ||
857 | bool KMainWindow::hasMenuBar() | 866 | bool KMainWindow::hasMenuBar() |
858 | { | 867 | { |
@@ -868,9 +877,9 @@ QMenuBar *KMainWindow::menuBar() | |||
868 | //US mb = new KMenuBar( this ); | 877 | //US mb = new KMenuBar( this ); |
869 | mb = new QMenuBar( this ); | 878 | mb = new QMenuBar( this ); |
870 | // trigger a re-layout and trigger a call to the private | 879 | // trigger a re-layout and trigger a call to the private |
871 | // setMenuBar method. | 880 | // setMenuBar method. |
872 | QMainWindow::menuBar(); | 881 | Q3MainWindow::menuBar(); |
873 | } | 882 | } |
874 | return mb; | 883 | return mb; |
875 | } | 884 | } |
876 | 885 | ||
@@ -883,9 +892,9 @@ QStatusBar *KMainWindow::statusBar() | |||
883 | //US sb = new KStatusBar( this ); | 892 | //US sb = new KStatusBar( this ); |
884 | sb = new QStatusBar( this ); | 893 | sb = new QStatusBar( this ); |
885 | // trigger a re-layout and trigger a call to the private | 894 | // trigger a re-layout and trigger a call to the private |
886 | // setStatusBar method. | 895 | // setStatusBar method. |
887 | QMainWindow::statusBar(); | 896 | Q3MainWindow::statusBar(); |
888 | } | 897 | } |
889 | return sb; | 898 | return sb; |
890 | } | 899 | } |
891 | 900 | ||
@@ -907,44 +916,32 @@ void KMainWindow::shuttingDown() | |||
907 | //US KMenuBar *KMainWindow::internalMenuBar() | 916 | //US KMenuBar *KMainWindow::internalMenuBar() |
908 | QMenuBar *KMainWindow::internalMenuBar() | 917 | QMenuBar *KMainWindow::internalMenuBar() |
909 | { | 918 | { |
910 | //US QObjectList *l = queryList( "KMenuBar", 0, false, false ); | 919 | //US QObjectList *l = queryList( "KMenuBar", 0, false, false ); |
911 | QObjectList *l = queryList( "QMenuBar", 0, false, false ); | 920 | QObjectList l = queryList( "QMenuBar", 0, false, false ); |
912 | if ( !l || !l->first() ) { | 921 | if(l.empty()) |
913 | delete l; | 922 | return 0; |
914 | return 0; | 923 | return (QMenuBar*)l.front(); |
915 | } | ||
916 | |||
917 | //US KMenuBar *m = (KMenuBar*)l->first(); | ||
918 | QMenuBar *m = (QMenuBar*)l->first(); | ||
919 | delete l; | ||
920 | return m; | ||
921 | } | 924 | } |
922 | 925 | ||
923 | //US KStatusBar *KMainWindow::internalStatusBar() | 926 | //US KStatusBar *KMainWindow::internalStatusBar() |
924 | QStatusBar *KMainWindow::internalStatusBar() | 927 | QStatusBar *KMainWindow::internalStatusBar() |
925 | { | 928 | { |
926 | //US QObjectList *l = queryList( "KStatusBar", 0, false, false ); | 929 | //US QObjectList *l = queryList( "KStatusBar", 0, false, false ); |
927 | QObjectList *l = queryList( "QStatusBar", 0, false, false ); | 930 | QObjectList l = queryList( "QStatusBar", 0, false, false ); |
928 | if ( !l || !l->first() ) { | 931 | if(l.empty()) |
929 | delete l; | 932 | return 0; |
930 | return 0; | 933 | return (QStatusBar*)l.front(); |
931 | } | ||
932 | |||
933 | //US KStatusBar *s = (KStatusBar*)l->first(); | ||
934 | QStatusBar *s = (QStatusBar*)l->first(); | ||
935 | delete l; | ||
936 | return s; | ||
937 | } | 934 | } |
938 | 935 | ||
939 | void KMainWindow::childEvent( QChildEvent* e) | 936 | void KMainWindow::childEvent( QChildEvent* e) |
940 | { | 937 | { |
941 | QMainWindow::childEvent( e ); | 938 | Q3MainWindow::childEvent( e ); |
942 | } | 939 | } |
943 | 940 | ||
944 | void KMainWindow::paintEvent( QPaintEvent * e) | 941 | void KMainWindow::paintEvent( QPaintEvent * e) |
945 | { | 942 | { |
946 | QMainWindow::paintEvent( e ); | 943 | Q3MainWindow::paintEvent( e ); |
947 | } | 944 | } |
948 | 945 | ||
949 | QSize KMainWindow::sizeForCentralWidgetSize(QSize size) | 946 | QSize KMainWindow::sizeForCentralWidgetSize(QSize size) |
950 | { | 947 | { |
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,4 +1,9 @@ | |||
1 | //Added by qt3to4: | ||
2 | #include <QResizeEvent> | ||
3 | #include <QChildEvent> | ||
4 | #include <QCloseEvent> | ||
5 | #include <QPaintEvent> | ||
1 | /* | 6 | /* |
2 | This file is part of the KDE libraries | 7 | This file is part of the KDE libraries |
3 | 8 | ||
4 | This library is free software; you can redistribute it and/or | 9 | This library is free software; you can redistribute it and/or |
@@ -49,14 +54,14 @@ class KAction; | |||
49 | 54 | ||
50 | #include <ktoolbar.h> | 55 | #include <ktoolbar.h> |
51 | #include <ktoolbarhandler.h> | 56 | #include <ktoolbarhandler.h> |
52 | #include <kxmlguiclient.h> | 57 | #include <kxmlguiclient.h> |
53 | #include <qmainwindow.h> | 58 | #include <q3mainwindow.h> |
54 | #include <qptrlist.h> | 59 | #include <q3ptrlist.h> |
55 | 60 | ||
56 | class KActionCollection; | 61 | class KActionCollection; |
57 | 62 | ||
58 | class KMainWindow : public QMainWindow, virtual public KXMLGUIClient | 63 | class KMainWindow : public Q3MainWindow, virtual public KXMLGUIClient |
59 | { | 64 | { |
60 | Q_OBJECT | 65 | Q_OBJECT |
61 | 66 | ||
62 | private: | 67 | private: |
@@ -319,14 +324,14 @@ public: | |||
319 | * @return A pointer to the toolbar | 324 | * @return A pointer to the toolbar |
320 | **/ | 325 | **/ |
321 | KToolBar *toolBar( const char *name=0 ); | 326 | KToolBar *toolBar( const char *name=0 ); |
322 | // method for getting rid of KDE-Crap | 327 | // method for getting rid of KDE-Crap |
323 | QToolBar *tBar( ); | 328 | Q3ToolBar *tBar( ); |
324 | 329 | ||
325 | /** | 330 | /** |
326 | * @return An iterator over the list of all toolbars for this window. | 331 | * @return An iterator over the list of all toolbars for this window. |
327 | */ | 332 | */ |
328 | QPtrListIterator<KToolBar> toolBarIterator(); | 333 | Q3PtrListIterator<KToolBar> toolBarIterator(); |
329 | 334 | ||
330 | /** | 335 | /** |
331 | * @return A KAccel instance bound to this mainwindow. Used automatically | 336 | * @return A KAccel instance bound to this mainwindow. Used automatically |
332 | * by KAction to make keybindings work in all cases. | 337 | * by KAction to make keybindings work in all cases. |
@@ -757,18 +762,18 @@ private slots: | |||
757 | 762 | ||
758 | void saveAutoSaveSettings(); | 763 | void saveAutoSaveSettings(); |
759 | 764 | ||
760 | private: | 765 | private: |
761 | QToolBar * mQToolBar; | 766 | Q3ToolBar * mQToolBar; |
762 | //US KMenuBar *internalMenuBar(); | 767 | //US KMenuBar *internalMenuBar(); |
763 | QMenuBar *internalMenuBar(); | 768 | QMenuBar *internalMenuBar(); |
764 | //US KStatusBar *internalStatusBar(); | 769 | //US KStatusBar *internalStatusBar(); |
765 | QStatusBar *internalStatusBar(); | 770 | QStatusBar *internalStatusBar(); |
766 | 771 | ||
767 | KMainWindowPrivate *d; | 772 | KMainWindowPrivate *d; |
768 | void initKMainWindow(const char *name); | 773 | void initKMainWindow(const char *name); |
769 | 774 | ||
770 | QPtrList<KToolBar> toolbarList; | 775 | Q3PtrList<KToolBar> toolbarList; |
771 | 776 | ||
772 | protected: | 777 | protected: |
773 | virtual void virtual_hook( int id, void* data ); | 778 | virtual void virtual_hook( int id, void* data ); |
774 | 779 | ||
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 | |||
@@ -41,8 +41,11 @@ | |||
41 | #include <qsize.h> | 41 | #include <qsize.h> |
42 | #include <qslider.h> | 42 | #include <qslider.h> |
43 | #include <qspinbox.h> | 43 | #include <qspinbox.h> |
44 | #include <qstyle.h> | 44 | #include <qstyle.h> |
45 | //Added by qt3to4: | ||
46 | #include <QResizeEvent> | ||
47 | #include <QEvent> | ||
45 | 48 | ||
46 | #include <kglobal.h> | 49 | #include <kglobal.h> |
47 | #include <klocale.h> | 50 | #include <klocale.h> |
48 | #include <kdebug.h> | 51 | #include <kdebug.h> |
@@ -105,13 +108,13 @@ void KNumInput::setLabel(const QString & label, int a) | |||
105 | } | 108 | } |
106 | else { | 109 | else { |
107 | if (m_label) m_label->setText(label); | 110 | if (m_label) m_label->setText(label); |
108 | else m_label = new QLabel(label, this, "KNumInput::QLabel"); | 111 | else m_label = new QLabel(label, this, "KNumInput::QLabel"); |
109 | m_label->setAlignment((a & (~(AlignTop|AlignBottom|AlignVCenter))) | 112 | m_label->setAlignment((a & (~(Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter))) |
110 | | AlignVCenter); | 113 | | Qt::AlignVCenter); |
111 | // if no vertical alignment set, use Top alignment | 114 | // if no vertical alignment set, use Top alignment |
112 | if(!(a & (AlignTop|AlignBottom|AlignVCenter))) | 115 | if(!(a & (Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter))) |
113 | a |= AlignTop; | 116 | a |= Qt::AlignTop; |
114 | m_alignment = a; | 117 | m_alignment = a; |
115 | } | 118 | } |
116 | 119 | ||
117 | layout(true); | 120 | layout(true); |
@@ -130,9 +133,9 @@ void KNumInput::layout(bool deep) | |||
130 | 133 | ||
131 | // label sizeHint | 134 | // label sizeHint |
132 | m_sizeLabel = (m_label ? m_label->sizeHint() : QSize(0,0)); | 135 | m_sizeLabel = (m_label ? m_label->sizeHint() : QSize(0,0)); |
133 | 136 | ||
134 | if(m_label && (m_alignment & AlignVCenter)) | 137 | if(m_label && (m_alignment & Qt::AlignVCenter)) |
135 | m_colw1 = m_sizeLabel.width() + 4; | 138 | m_colw1 = m_sizeLabel.width() + 4; |
136 | else | 139 | else |
137 | m_colw1 = 0; | 140 | m_colw1 = 0; |
138 | 141 | ||
@@ -201,9 +204,9 @@ void KNumInput::setSteps(int minor, int major) | |||
201 | 204 | ||
202 | KIntSpinBox::KIntSpinBox(QWidget *parent, const char *name) | 205 | KIntSpinBox::KIntSpinBox(QWidget *parent, const char *name) |
203 | : QSpinBox(0, 99, 1, parent, name) | 206 | : QSpinBox(0, 99, 1, parent, name) |
204 | { | 207 | { |
205 | editor()->setAlignment(AlignRight); | 208 | setAlignment(Qt::AlignRight); |
206 | val_base = 10; | 209 | val_base = 10; |
207 | setValue(0); | 210 | setValue(0); |
208 | } | 211 | } |
209 | 212 | ||
@@ -214,9 +217,9 @@ KIntSpinBox::~KIntSpinBox() | |||
214 | KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base, | 217 | KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base, |
215 | QWidget* parent, const char* name) | 218 | QWidget* parent, const char* name) |
216 | : QSpinBox(lower, upper, step, parent, name) | 219 | : QSpinBox(lower, upper, step, parent, name) |
217 | { | 220 | { |
218 | editor()->setAlignment(AlignRight); | 221 | setAlignment(Qt::AlignRight); |
219 | val_base = base; | 222 | val_base = base; |
220 | setValue(value); | 223 | setValue(value); |
221 | } | 224 | } |
222 | 225 | ||
@@ -242,11 +245,11 @@ int KIntSpinBox::mapTextToValue(bool* ok) | |||
242 | } | 245 | } |
243 | 246 | ||
244 | void KIntSpinBox::setEditFocus(bool mark) | 247 | void KIntSpinBox::setEditFocus(bool mark) |
245 | { | 248 | { |
246 | editor()->setFocus(); | 249 | setFocus(); |
247 | if(mark) | 250 | if(mark) |
248 | editor()->selectAll(); | 251 | selectAll(); |
249 | } | 252 | } |
250 | 253 | ||
251 | 254 | ||
252 | // ---------------------------------------------------------------------------- | 255 | // ---------------------------------------------------------------------------- |
@@ -324,16 +327,16 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) | |||
324 | m_spin->setMinValue(lower); | 327 | m_spin->setMinValue(lower); |
325 | m_spin->setMaxValue(upper); | 328 | m_spin->setMaxValue(upper); |
326 | m_spin->setLineStep(step); | 329 | m_spin->setLineStep(step); |
327 | 330 | ||
328 | step = m_spin->lineStep(); // maybe QRangeControl didn't like out lineStep? | 331 | step = m_spin->singleStep(); // maybe QRangeControl didn't like out lineStep? |
329 | 332 | ||
330 | if(slider) { | 333 | if(slider) { |
331 | if (m_slider) | 334 | if (m_slider) |
332 | m_slider->setRange(lower, upper); | 335 | m_slider->setRange(lower, upper); |
333 | else { | 336 | else { |
334 | m_slider = new QSlider(lower, upper, step, m_spin->value(), | 337 | m_slider = new QSlider(lower, upper, step, m_spin->value(), |
335 | QSlider::Horizontal, this); | 338 | Qt::Horizontal, this); |
336 | m_slider->setTickmarks(QSlider::Below); | 339 | m_slider->setTickmarks(QSlider::Below); |
337 | connect(m_slider, SIGNAL(valueChanged(int)), | 340 | connect(m_slider, SIGNAL(valueChanged(int)), |
338 | m_spin, SLOT(setValue(int))); | 341 | m_spin, SLOT(setValue(int))); |
339 | } | 342 | } |
@@ -357,9 +360,9 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) | |||
357 | } | 360 | } |
358 | 361 | ||
359 | void KIntNumInput::setMinValue(int min) | 362 | void KIntNumInput::setMinValue(int min) |
360 | { | 363 | { |
361 | setRange(min, m_spin->maxValue(), m_spin->lineStep(), m_slider); | 364 | setRange(min, m_spin->maxValue(), m_spin->singleStep(), m_slider); |
362 | } | 365 | } |
363 | 366 | ||
364 | int KIntNumInput::minValue() const | 367 | int KIntNumInput::minValue() const |
365 | { | 368 | { |
@@ -367,9 +370,9 @@ int KIntNumInput::minValue() const | |||
367 | } | 370 | } |
368 | 371 | ||
369 | void KIntNumInput::setMaxValue(int max) | 372 | void KIntNumInput::setMaxValue(int max) |
370 | { | 373 | { |
371 | setRange(m_spin->minValue(), max, m_spin->lineStep(), m_slider); | 374 | setRange(m_spin->minValue(), max, m_spin->singleStep(), m_slider); |
372 | } | 375 | } |
373 | 376 | ||
374 | int KIntNumInput::maxValue() const | 377 | int KIntNumInput::maxValue() const |
375 | { | 378 | { |
@@ -414,18 +417,18 @@ QSize KIntNumInput::minimumSizeHint() const | |||
414 | 417 | ||
415 | h = 2 + QMAX(m_sizeSpin.height(), m_sizeSlider.height()); | 418 | h = 2 + QMAX(m_sizeSpin.height(), m_sizeSlider.height()); |
416 | 419 | ||
417 | // if in extra row, then count it here | 420 | // if in extra row, then count it here |
418 | if(m_label && (m_alignment & (AlignBottom|AlignTop))) | 421 | if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop))) |
419 | h += 4 + m_sizeLabel.height(); | 422 | h += 4 + m_sizeLabel.height(); |
420 | else | 423 | else |
421 | // label is in the same row as the other widgets | 424 | // label is in the same row as the other widgets |
422 | h = QMAX(h, m_sizeLabel.height() + 2); | 425 | h = QMAX(h, m_sizeLabel.height() + 2); |
423 | 426 | ||
424 | w = m_slider ? m_slider->sizeHint().width() + 8 : 0; | 427 | w = m_slider ? m_slider->sizeHint().width() + 8 : 0; |
425 | w += m_colw1 + m_colw2; | 428 | w += m_colw1 + m_colw2; |
426 | 429 | ||
427 | if(m_alignment & (AlignTop|AlignBottom)) | 430 | if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) |
428 | w = QMAX(w, m_sizeLabel.width() + 4); | 431 | w = QMAX(w, m_sizeLabel.width() + 4); |
429 | 432 | ||
430 | return QSize(w, h); | 433 | return QSize(w, h); |
431 | } | 434 | } |
@@ -443,14 +446,14 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) | |||
443 | { | 446 | { |
444 | int w = m_colw1; | 447 | int w = m_colw1; |
445 | int h = 0; | 448 | int h = 0; |
446 | 449 | ||
447 | if(m_label && (m_alignment & AlignTop)) { | 450 | if(m_label && (m_alignment & Qt::AlignTop)) { |
448 | m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); | 451 | m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); |
449 | h += m_sizeLabel.height() + 4; | 452 | h += m_sizeLabel.height() + 4; |
450 | } | 453 | } |
451 | 454 | ||
452 | if(m_label && (m_alignment & AlignVCenter)) | 455 | if(m_label && (m_alignment & Qt::AlignVCenter)) |
453 | m_label->setGeometry(0, 0, w, m_sizeSpin.height()); | 456 | m_label->setGeometry(0, 0, w, m_sizeSpin.height()); |
454 | 457 | ||
455 | m_spin->setGeometry(w, h, m_slider ? m_colw2 : QMAX(m_colw2, e->size().width() - w), m_sizeSpin.height()); | 458 | m_spin->setGeometry(w, h, m_slider ? m_colw2 : QMAX(m_colw2, e->size().width() - w), m_sizeSpin.height()); |
456 | w += m_colw2 + 8; | 459 | w += m_colw2 + 8; |
@@ -459,9 +462,9 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) | |||
459 | m_slider->setGeometry(w, h, e->size().width() - w, m_sizeSpin.height()); | 462 | m_slider->setGeometry(w, h, e->size().width() - w, m_sizeSpin.height()); |
460 | 463 | ||
461 | h += m_sizeSpin.height() + 2; | 464 | h += m_sizeSpin.height() + 2; |
462 | 465 | ||
463 | if(m_label && (m_alignment & AlignBottom)) | 466 | if(m_label && (m_alignment & Qt::AlignBottom)) |
464 | m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); | 467 | m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); |
465 | } | 468 | } |
466 | 469 | ||
467 | KIntNumInput::~KIntNumInput() | 470 | KIntNumInput::~KIntNumInput() |
@@ -645,18 +648,18 @@ QSize KDoubleNumInput::minimumSizeHint() const | |||
645 | 648 | ||
646 | h = 2 + QMAX(m_sizeEdit.height(), m_sizeSlider.height()); | 649 | h = 2 + QMAX(m_sizeEdit.height(), m_sizeSlider.height()); |
647 | 650 | ||
648 | // if in extra row, then count it here | 651 | // if in extra row, then count it here |
649 | if(m_label && (m_alignment & (AlignBottom|AlignTop))) | 652 | if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop))) |
650 | h += 4 + m_sizeLabel.height(); | 653 | h += 4 + m_sizeLabel.height(); |
651 | else | 654 | else |
652 | // label is in the same row as the other widgets | 655 | // label is in the same row as the other widgets |
653 | h = QMAX(h, m_sizeLabel.height() + 2); | 656 | h = QMAX(h, m_sizeLabel.height() + 2); |
654 | 657 | ||
655 | w = m_slider ? m_slider->sizeHint().width() + 8 : 0; | 658 | w = m_slider ? m_slider->sizeHint().width() + 8 : 0; |
656 | w += m_colw1 + m_colw2; | 659 | w += m_colw1 + m_colw2; |
657 | 660 | ||
658 | if(m_alignment & (AlignTop|AlignBottom)) | 661 | if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) |
659 | w = QMAX(w, m_sizeLabel.width() + 4); | 662 | w = QMAX(w, m_sizeLabel.width() + 4); |
660 | 663 | ||
661 | return QSize(w, h); | 664 | return QSize(w, h); |
662 | } | 665 | } |
@@ -665,14 +668,14 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) | |||
665 | { | 668 | { |
666 | int w = m_colw1; | 669 | int w = m_colw1; |
667 | int h = 0; | 670 | int h = 0; |
668 | 671 | ||
669 | if(m_label && (m_alignment & AlignTop)) { | 672 | if(m_label && (m_alignment & Qt::AlignTop)) { |
670 | m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); | 673 | m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); |
671 | h += m_sizeLabel.height() + 4; | 674 | h += m_sizeLabel.height() + 4; |
672 | } | 675 | } |
673 | 676 | ||
674 | if(m_label && (m_alignment & AlignVCenter)) | 677 | if(m_label && (m_alignment & Qt::AlignVCenter)) |
675 | m_label->setGeometry(0, 0, w, m_sizeEdit.height()); | 678 | m_label->setGeometry(0, 0, w, m_sizeEdit.height()); |
676 | 679 | ||
677 | d->spin->setGeometry(w, h, m_slider ? m_colw2 | 680 | d->spin->setGeometry(w, h, m_slider ? m_colw2 |
678 | : e->size().width() - w, m_sizeEdit.height()); | 681 | : e->size().width() - w, m_sizeEdit.height()); |
@@ -682,9 +685,9 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) | |||
682 | m_slider->setGeometry(w, h, e->size().width() - w, m_sizeEdit.height()); | 685 | m_slider->setGeometry(w, h, e->size().width() - w, m_sizeEdit.height()); |
683 | 686 | ||
684 | h += m_sizeEdit.height() + 2; | 687 | h += m_sizeEdit.height() + 2; |
685 | 688 | ||
686 | if(m_label && (m_alignment & AlignBottom)) | 689 | if(m_label && (m_alignment & Qt::AlignBottom)) |
687 | m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); | 690 | m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); |
688 | } | 691 | } |
689 | 692 | ||
690 | void KDoubleNumInput::doLayout() | 693 | void KDoubleNumInput::doLayout() |
@@ -729,16 +732,16 @@ void KDoubleNumInput::setRange(double lower, double upper, double step, | |||
729 | QSpinBox * spin = d->spin; | 732 | QSpinBox * spin = d->spin; |
730 | int slmax = spin->maxValue(); | 733 | int slmax = spin->maxValue(); |
731 | int slmin = spin->minValue(); | 734 | int slmin = spin->minValue(); |
732 | int slvalue = spin->value(); | 735 | int slvalue = spin->value(); |
733 | int slstep = spin->lineStep(); | 736 | int slstep = spin->singleStep(); |
734 | if (m_slider) { | 737 | if (m_slider) { |
735 | m_slider->setRange(slmin, slmax); | 738 | m_slider->setRange(slmin, slmax); |
736 | m_slider->setLineStep(slstep); | 739 | m_slider->setLineStep(slstep); |
737 | m_slider->setValue(slvalue); | 740 | m_slider->setValue(slvalue); |
738 | } else { | 741 | } else { |
739 | m_slider = new QSlider(slmin, slmax, slstep, slvalue, | 742 | m_slider = new QSlider(slmin, slmax, slstep, slvalue, |
740 | QSlider::Horizontal, this); | 743 | Qt::Horizontal, this); |
741 | m_slider->setTickmarks(QSlider::Below); | 744 | m_slider->setTickmarks(QSlider::Below); |
742 | // feedback line: when one moves, the other moves, too: | 745 | // feedback line: when one moves, the other moves, too: |
743 | connect(m_slider, SIGNAL(valueChanged(int)), | 746 | connect(m_slider, SIGNAL(valueChanged(int)), |
744 | SLOT(sliderMoved(int)) ); | 747 | SLOT(sliderMoved(int)) ); |
@@ -911,9 +914,9 @@ public: | |||
911 | 914 | ||
912 | KDoubleSpinBox::KDoubleSpinBox( QWidget * parent, const char * name ) | 915 | KDoubleSpinBox::KDoubleSpinBox( QWidget * parent, const char * name ) |
913 | : QSpinBox( parent, name ) | 916 | : QSpinBox( parent, name ) |
914 | { | 917 | { |
915 | editor()->setAlignment( Qt::AlignRight ); | 918 | setAlignment( Qt::AlignRight ); |
916 | d = new Private(); | 919 | d = new Private(); |
917 | updateValidator(); | 920 | updateValidator(); |
918 | } | 921 | } |
919 | 922 | ||
@@ -921,9 +924,9 @@ KDoubleSpinBox::KDoubleSpinBox( double lower, double upper, double step, | |||
921 | double value, int precision, | 924 | double value, int precision, |
922 | QWidget * parent, const char * name ) | 925 | QWidget * parent, const char * name ) |
923 | : QSpinBox( parent, name ) | 926 | : QSpinBox( parent, name ) |
924 | { | 927 | { |
925 | editor()->setAlignment( Qt::AlignRight ); | 928 | setAlignment( Qt::AlignRight ); |
926 | d = new Private(); | 929 | d = new Private(); |
927 | setRange( lower, upper, step, precision ); | 930 | setRange( lower, upper, step, precision ); |
928 | setValue( value ); | 931 | setValue( value ); |
929 | connect( this, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)) ); | 932 | connect( this, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)) ); |
@@ -1026,9 +1029,9 @@ void KDoubleSpinBox::setMaxValue( double value ) { | |||
1026 | updateValidator(); | 1029 | updateValidator(); |
1027 | } | 1030 | } |
1028 | 1031 | ||
1029 | double KDoubleSpinBox::lineStep() const { | 1032 | double KDoubleSpinBox::lineStep() const { |
1030 | return d->mapToDouble( base::lineStep() ); | 1033 | return d->mapToDouble( base::singleStep() ); |
1031 | } | 1034 | } |
1032 | 1035 | ||
1033 | void KDoubleSpinBox::setLineStep( double step ) { | 1036 | void KDoubleSpinBox::setLineStep( double step ) { |
1034 | bool ok = false; | 1037 | bool ok = false; |
@@ -1071,9 +1074,9 @@ void KDoubleSpinBox::slotValueChanged( int value ) { | |||
1071 | void KDoubleSpinBox::updateValidator() { | 1074 | void KDoubleSpinBox::updateValidator() { |
1072 | if ( !d->mValidator ) { | 1075 | if ( !d->mValidator ) { |
1073 | d->mValidator = new KDoubleValidator( minValue(), maxValue(), precision(), | 1076 | d->mValidator = new KDoubleValidator( minValue(), maxValue(), precision(), |
1074 | this, "d->mValidator" ); | 1077 | this, "d->mValidator" ); |
1075 | base::setValidator( d->mValidator ); | 1078 | lineEdit()->setValidator( d->mValidator ); |
1076 | } else | 1079 | } else |
1077 | d->mValidator->setRange( minValue(), maxValue(), precision() ); | 1080 | d->mValidator->setRange( minValue(), maxValue(), precision() ); |
1078 | } | 1081 | } |
1079 | 1082 | ||
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 | |||
@@ -28,8 +28,13 @@ | |||
28 | #define K_NUMINPUT_H | 28 | #define K_NUMINPUT_H |
29 | 29 | ||
30 | #include <qwidget.h> | 30 | #include <qwidget.h> |
31 | #include <qspinbox.h> | 31 | #include <qspinbox.h> |
32 | #include <QLineEdit> | ||
33 | //Added by qt3to4: | ||
34 | #include <QResizeEvent> | ||
35 | #include <QLabel> | ||
36 | #include <QEvent> | ||
32 | 37 | ||
33 | class QLabel; | 38 | class QLabel; |
34 | class QSlider; | 39 | class QSlider; |
35 | class QLineEdit; | 40 | class QLineEdit; |
@@ -80,9 +85,9 @@ public: | |||
80 | * @li @p AlignVCenter The label is placed left beside the edit | 85 | * @li @p AlignVCenter The label is placed left beside the edit |
81 | * @li @p AlignBottom The label is placed below the edit/slider | 86 | * @li @p AlignBottom The label is placed below the edit/slider |
82 | * | 87 | * |
83 | */ | 88 | */ |
84 | virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); | 89 | virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); |
85 | 90 | ||
86 | /** | 91 | /** |
87 | * @return the text of the label. | 92 | * @return the text of the label. |
88 | */ | 93 | */ |
@@ -301,9 +306,9 @@ public: | |||
301 | 306 | ||
302 | /** | 307 | /** |
303 | * @reimplemented | 308 | * @reimplemented |
304 | */ | 309 | */ |
305 | virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); | 310 | virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); |
306 | 311 | ||
307 | /** | 312 | /** |
308 | * This method returns the minimum size necessary to display the | 313 | * This method returns the minimum size necessary to display the |
309 | * control. The minimum size is enough to show all the labels | 314 | * control. The minimum size is enough to show all the labels |
@@ -587,9 +592,9 @@ public: | |||
587 | 592 | ||
588 | /** | 593 | /** |
589 | * @reimplemented | 594 | * @reimplemented |
590 | */ | 595 | */ |
591 | virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); | 596 | virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop); |
592 | /** | 597 | /** |
593 | * @reimplemented | 598 | * @reimplemented |
594 | */ | 599 | */ |
595 | virtual QSize minimumSizeHint() const; | 600 | virtual QSize minimumSizeHint() const; |
@@ -757,8 +762,12 @@ public: | |||
757 | * | 762 | * |
758 | */ | 763 | */ |
759 | void setEditFocus(bool mark); | 764 | void setEditFocus(bool mark); |
760 | 765 | ||
766 | void setValidator(const QValidator *v) { | ||
767 | lineEdit()->setValidator(v); | ||
768 | } | ||
769 | |||
761 | protected: | 770 | protected: |
762 | 771 | ||
763 | /** | 772 | /** |
764 | * Overloaded the method in QSpinBox | 773 | * Overloaded the method in QSpinBox |
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 | |||
@@ -1,11 +1,14 @@ | |||
1 | 1 | ||
2 | #include <kpopupmenu.h> | 2 | #include <kpopupmenu.h> |
3 | #include <qtimer.h> | 3 | #include <qtimer.h> |
4 | //Added by qt3to4: | ||
5 | #include <QFocusEvent> | ||
6 | #include <Q3PopupMenu> | ||
4 | 7 | ||
5 | 8 | ||
6 | KPopupMenu::KPopupMenu ( QWidget * parent, const char * name ) | 9 | KPopupMenu::KPopupMenu ( QWidget * parent, const char * name ) |
7 | : QPopupMenu ( parent, name ) {;} | 10 | : Q3PopupMenu ( parent, name ) {;} |
8 | 11 | ||
9 | 12 | ||
10 | 13 | ||
11 | KMenuBar::KMenuBar ( QWidget * parent, const char * name ) | 14 | KMenuBar::KMenuBar ( QWidget * parent, const char * 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 | |||
@@ -1,16 +1,18 @@ | |||
1 | #ifndef KPOPUPMENU_H | 1 | #ifndef KPOPUPMENU_H |
2 | #define KPOPUPMENU_H | 2 | #define KPOPUPMENU_H |
3 | 3 | ||
4 | #include <qpopupmenu.h> | 4 | #include <q3popupmenu.h> |
5 | //Added by qt3to4: | ||
6 | #include <QFocusEvent> | ||
5 | #ifdef DESKTOP_VERSION | 7 | #ifdef DESKTOP_VERSION |
6 | #include <qmenubar.h> | 8 | #include <qmenubar.h> |
7 | #define QPEMenuBar QMenuBar | 9 | #define QPEMenuBar QMenuBar |
8 | #else | 10 | #else |
9 | #include <qpe/qpemenubar.h> | 11 | #include <qpe/qpemenubar.h> |
10 | #endif | 12 | #endif |
11 | 13 | ||
12 | class KPopupMenu : public QPopupMenu | 14 | class KPopupMenu : public Q3PopupMenu |
13 | { | 15 | { |
14 | Q_OBJECT | 16 | Q_OBJECT |
15 | public: | 17 | public: |
16 | KPopupMenu ( QWidget * parent=0, const char * name=0 ); | 18 | KPopupMenu ( QWidget * parent=0, const char * name=0 ); |
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 | |||
@@ -17,28 +17,30 @@ | |||
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qstyle.h> | 20 | #include <qstyle.h> |
21 | //Added by qt3to4: | ||
22 | #include <Q3Frame> | ||
21 | 23 | ||
22 | #include <kdebug.h> | 24 | #include <kdebug.h> |
23 | //US #include <kapplication.h> | 25 | //US #include <kapplication.h> |
24 | 26 | ||
25 | //US #include "kseparator.moc" | 27 | //US #include "kseparator.moc" |
26 | 28 | ||
27 | #include "kseparator.h" | 29 | #include "kseparator.h" |
28 | 30 | ||
29 | KSeparator::KSeparator(QWidget* parent, const char* name, WFlags f) | 31 | KSeparator::KSeparator(QWidget* parent, const char* name, Qt::WFlags f) |
30 | : QFrame(parent, name, f) | 32 | : Q3Frame(parent, name, f) |
31 | { | 33 | { |
32 | setLineWidth(1); | 34 | setLineWidth(1); |
33 | setMidLineWidth(0); | 35 | setMidLineWidth(0); |
34 | setOrientation( HLine ); | 36 | setOrientation( HLine ); |
35 | } | 37 | } |
36 | 38 | ||
37 | 39 | ||
38 | 40 | ||
39 | KSeparator::KSeparator(int orientation, QWidget* parent, const char* name, WFlags f) | 41 | KSeparator::KSeparator(int orientation, QWidget* parent, const char* name, Qt::WFlags f) |
40 | : QFrame(parent, name, f) | 42 | : Q3Frame(parent, name, f) |
41 | { | 43 | { |
42 | setLineWidth(1); | 44 | setLineWidth(1); |
43 | setMidLineWidth(0); | 45 | setMidLineWidth(0); |
44 | setOrientation( orientation ); | 46 | setOrientation( orientation ); |
@@ -49,20 +51,20 @@ KSeparator::KSeparator(int orientation, QWidget* parent, const char* name, WFlag | |||
49 | void KSeparator::setOrientation(int orientation) | 51 | void KSeparator::setOrientation(int orientation) |
50 | { | 52 | { |
51 | switch(orientation) | 53 | switch(orientation) |
52 | { | 54 | { |
53 | case Vertical: | 55 | case Qt::Vertical: |
54 | case VLine: | 56 | case VLine: |
55 | setFrameStyle( QFrame::VLine | QFrame::Sunken ); | 57 | setFrameStyle( Q3Frame::VLine | Q3Frame::Sunken ); |
56 | setMinimumSize(2, 0); | 58 | setMinimumSize(2, 0); |
57 | break; | 59 | break; |
58 | 60 | ||
59 | default: | 61 | default: |
60 | kdWarning() << "KSeparator::setOrientation(): invalid orientation, using default orientation HLine" << endl; | 62 | kdWarning() << "KSeparator::setOrientation(): invalid orientation, using default orientation HLine" << endl; |
61 | 63 | ||
62 | case Horizontal: | 64 | case Qt::Horizontal: |
63 | case HLine: | 65 | case HLine: |
64 | setFrameStyle( QFrame::HLine | QFrame::Sunken ); | 66 | setFrameStyle( Q3Frame::HLine | Q3Frame::Sunken ); |
65 | setMinimumSize(0, 2); | 67 | setMinimumSize(0, 2); |
66 | break; | 68 | break; |
67 | } | 69 | } |
68 | } | 70 | } |
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 | |||
@@ -19,33 +19,33 @@ | |||
19 | 19 | ||
20 | #ifndef __KSEPARATOR_H__ | 20 | #ifndef __KSEPARATOR_H__ |
21 | #define __KSEPARATOR_H__ | 21 | #define __KSEPARATOR_H__ |
22 | 22 | ||
23 | #include <qframe.h> | 23 | #include <q3frame.h> |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * Standard horizontal or vertical separator. | 26 | * Standard horizontal or vertical separator. |
27 | * | 27 | * |
28 | * @author Michael Roth <mroth@wirlweb.de> | 28 | * @author Michael Roth <mroth@wirlweb.de> |
29 | * @version $Id$ | 29 | * @version $Id$ |
30 | */ | 30 | */ |
31 | class KSeparator : public QFrame | 31 | class KSeparator : public Q3Frame |
32 | { | 32 | { |
33 | Q_OBJECT | 33 | Q_OBJECT |
34 | Q_PROPERTY( int orientation READ orientation WRITE setOrientation ) | 34 | Q_PROPERTY( int orientation READ orientation WRITE setOrientation ) |
35 | public: | 35 | public: |
36 | /** | 36 | /** |
37 | * Constructor. | 37 | * Constructor. |
38 | **/ | 38 | **/ |
39 | KSeparator(QWidget* parent=0, const char* name=0, WFlags f=0); | 39 | KSeparator(QWidget* parent=0, const char* name=0, Qt::WFlags f=0); |
40 | /** | 40 | /** |
41 | * Constructor. | 41 | * Constructor. |
42 | * | 42 | * |
43 | * @param orientation Set the orientation of the separator. | 43 | * @param orientation Set the orientation of the separator. |
44 | * Possible values are HLine or Horizontal and VLine or Vertical. | 44 | * Possible values are HLine or Horizontal and VLine or Vertical. |
45 | **/ | 45 | **/ |
46 | KSeparator(int orientation, QWidget* parent=0, const char* name=0, | 46 | KSeparator(int orientation, QWidget* parent=0, const char* name=0, |
47 | WFlags f=0); | 47 | Qt::WFlags f=0); |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Returns the orientation of the separator. | 50 | * Returns the orientation of the separator. |
51 | * | 51 | * |
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 | |||
@@ -17,8 +17,11 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include "ksqueezedtextlabel.h" | 19 | #include "ksqueezedtextlabel.h" |
20 | #include <qtooltip.h> | 20 | #include <qtooltip.h> |
21 | //Added by qt3to4: | ||
22 | #include <QResizeEvent> | ||
23 | #include <QLabel> | ||
21 | 24 | ||
22 | KSqueezedTextLabel::KSqueezedTextLabel( const QString &text , QWidget *parent, const char *name ) | 25 | KSqueezedTextLabel::KSqueezedTextLabel( const QString &text , QWidget *parent, const char *name ) |
23 | : QLabel ( parent, name ) { | 26 | : QLabel ( parent, name ) { |
24 | setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed )); | 27 | setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed )); |
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 | |||
@@ -19,8 +19,10 @@ | |||
19 | #ifndef KSQUEEZEDTEXTLABEL_H | 19 | #ifndef KSQUEEZEDTEXTLABEL_H |
20 | #define KSQUEEZEDTEXTLABEL_H | 20 | #define KSQUEEZEDTEXTLABEL_H |
21 | 21 | ||
22 | #include <qlabel.h> | 22 | #include <qlabel.h> |
23 | //Added by qt3to4: | ||
24 | #include <QResizeEvent> | ||
23 | 25 | ||
24 | /** | 26 | /** |
25 | * A label class that squeezes its text into the label | 27 | * A label class that squeezes its text into the label |
26 | * | 28 | * |
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 | |||
@@ -18,9 +18,9 @@ | |||
18 | 18 | ||
19 | #include "kstdaction.h" | 19 | #include "kstdaction.h" |
20 | 20 | ||
21 | #include <qtoolbutton.h> | 21 | #include <qtoolbutton.h> |
22 | #include <qwhatsthis.h> | 22 | #include <q3whatsthis.h> |
23 | 23 | ||
24 | //US #include <kaboutdata.h> | 24 | //US #include <kaboutdata.h> |
25 | #include <kaction.h> | 25 | #include <kaction.h> |
26 | #include <kapplication.h> | 26 | #include <kapplication.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 | |||
@@ -24,11 +24,22 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #ifdef KDE_USE_FINAL | 26 | #ifdef KDE_USE_FINAL |
27 | #undef Always | 27 | #undef Always |
28 | #include <qdockwindow.h> | 28 | #include <q3dockwindow.h> |
29 | #endif | 29 | #endif |
30 | 30 | //Added by qt3to4: | |
31 | #include <Q3ValueList> | ||
32 | #include <Q3PtrList> | ||
33 | #include <QPixmap> | ||
34 | #include <Q3Frame> | ||
35 | #include <QResizeEvent> | ||
36 | #include <QMouseEvent> | ||
37 | #include <QChildEvent> | ||
38 | #include <QEvent> | ||
39 | #include <QShowEvent> | ||
40 | #include <QDesktopWidget> | ||
41 | #include <QBoxLayout> | ||
31 | 42 | ||
32 | 43 | ||
33 | #include "ktoolbar.h" | 44 | #include "ktoolbar.h" |
34 | #include "kmainwindow.h" | 45 | #include "kmainwindow.h" |
@@ -39,9 +50,9 @@ | |||
39 | #include <qtooltip.h> | 50 | #include <qtooltip.h> |
40 | #include <qdrawutil.h> | 51 | #include <qdrawutil.h> |
41 | #include <qstring.h> | 52 | #include <qstring.h> |
42 | #include <qrect.h> | 53 | #include <qrect.h> |
43 | #include <qobjectlist.h> | 54 | #include <qobject.h> |
44 | #include <qtimer.h> | 55 | #include <qtimer.h> |
45 | #include <qstyle.h> | 56 | #include <qstyle.h> |
46 | #include <qapplication.h> | 57 | #include <qapplication.h> |
47 | 58 | ||
@@ -68,10 +79,10 @@ | |||
68 | 79 | ||
69 | //US | 80 | //US |
70 | #include "kconfigbase.h" | 81 | #include "kconfigbase.h" |
71 | 82 | ||
72 | #include <qpopupmenu.h> | 83 | #include <q3popupmenu.h> |
73 | #include <qmainwindow.h> | 84 | #include <q3mainwindow.h> |
74 | 85 | ||
75 | enum { | 86 | enum { |
76 | CONTEXT_TOP = 0, | 87 | CONTEXT_TOP = 0, |
77 | CONTEXT_LEFT = 1, | 88 | CONTEXT_LEFT = 1, |
@@ -101,9 +112,9 @@ public: | |||
101 | m_xmlguiClient = 0; | 112 | m_xmlguiClient = 0; |
102 | m_configurePlugged = false; | 113 | m_configurePlugged = false; |
103 | 114 | ||
104 | //US oldPos = Qt::DockUnmanaged; | 115 | //US oldPos = Qt::DockUnmanaged; |
105 | oldPos = QMainWindow::Unmanaged; | 116 | oldPos = Qt::Unmanaged; |
106 | 117 | ||
107 | modified = m_isHorizontal = positioned = FALSE; | 118 | modified = m_isHorizontal = positioned = FALSE; |
108 | 119 | ||
109 | HiddenDefault = false; | 120 | HiddenDefault = false; |
@@ -128,26 +139,26 @@ public: | |||
128 | bool positioned : 1; | 139 | bool positioned : 1; |
129 | 140 | ||
130 | QWidget *m_parent; | 141 | QWidget *m_parent; |
131 | 142 | ||
132 | QMainWindow::ToolBarDock oldPos; | 143 | Qt::ToolBarDock oldPos; |
133 | 144 | ||
134 | KXMLGUIClient *m_xmlguiClient; | 145 | KXMLGUIClient *m_xmlguiClient; |
135 | 146 | ||
136 | struct ToolBarInfo | 147 | struct ToolBarInfo |
137 | { | 148 | { |
138 | //US ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {} | 149 | //US ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {} |
139 | ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( QMainWindow::Top ) {} | 150 | ToolBarInfo() : index( 0 ), offset( -1 ), newline( FALSE ), dock( Qt::DockTop ) {} |
140 | //US ToolBarInfo( Qt::Dock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} | 151 | //US ToolBarInfo( Qt::Dock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} |
141 | ToolBarInfo( QMainWindow::ToolBarDock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} | 152 | ToolBarInfo( Qt::ToolBarDock d, int i, bool n, int o ) : index( i ), offset( o ), newline( n ), dock( d ) {} |
142 | int index, offset; | 153 | int index, offset; |
143 | bool newline; | 154 | bool newline; |
144 | //US Qt::Dock dock; | 155 | //US Qt::Dock dock; |
145 | QMainWindow::ToolBarDock dock; | 156 | Qt::ToolBarDock dock; |
146 | }; | 157 | }; |
147 | 158 | ||
148 | ToolBarInfo toolBarInfo; | 159 | ToolBarInfo toolBarInfo; |
149 | QValueList<int> iconSizes; | 160 | Q3ValueList<int> iconSizes; |
150 | QTimer repaintTimer; | 161 | QTimer repaintTimer; |
151 | 162 | ||
152 | // Default Values. | 163 | // Default Values. |
153 | bool HiddenDefault; | 164 | bool HiddenDefault; |
@@ -157,27 +168,27 @@ public: | |||
157 | bool NewLineDefault; | 168 | bool NewLineDefault; |
158 | int OffsetDefault; | 169 | int OffsetDefault; |
159 | QString PositionDefault; | 170 | QString PositionDefault; |
160 | 171 | ||
161 | QPtrList<QWidget> idleButtons; | 172 | Q3PtrList<QWidget> idleButtons; |
162 | }; | 173 | }; |
163 | 174 | ||
164 | KToolBarSeparator::KToolBarSeparator(Orientation o , bool l, QToolBar *parent, | 175 | KToolBarSeparator::KToolBarSeparator(Qt::Orientation o , bool l, Q3ToolBar *parent, |
165 | const char* name ) | 176 | const char* name ) |
166 | :QFrame( parent, name ), line( l ) | 177 | :Q3Frame( parent, name ), line( l ) |
167 | { | 178 | { |
168 | connect( parent, SIGNAL(orientationChanged(Orientation)), | 179 | connect( parent, SIGNAL(orientationChanged(Qt::Orientation)), |
169 | this, SLOT(setOrientation(Orientation)) ); | 180 | this, SLOT(setOrientation(Qt::Orientation)) ); |
170 | setOrientation( o ); | 181 | setOrientation( o ); |
171 | setBackgroundMode( parent->backgroundMode() ); | 182 | setBackgroundMode( parent->backgroundMode() ); |
172 | setBackgroundOrigin( ParentOrigin ); | 183 | setBackgroundOrigin( ParentOrigin ); |
173 | } | 184 | } |
174 | 185 | ||
175 | void KToolBarSeparator::setOrientation( Orientation o ) | 186 | void KToolBarSeparator::setOrientation( Qt::Orientation o ) |
176 | { | 187 | { |
177 | orient = o; | 188 | orient = o; |
178 | if ( line ) { | 189 | if ( line ) { |
179 | if ( orientation() == Vertical ) | 190 | if ( orientation() == Qt::Vertical ) |
180 | setFrameStyle( HLine + Sunken ); | 191 | setFrameStyle( HLine + Sunken ); |
181 | else | 192 | else |
182 | setFrameStyle( VLine + Sunken ); | 193 | setFrameStyle( VLine + Sunken ); |
183 | } else { | 194 | } else { |
@@ -191,9 +202,9 @@ void KToolBarSeparator::styleChange( QStyle& ) | |||
191 | } | 202 | } |
192 | 203 | ||
193 | QSize KToolBarSeparator::sizeHint() const | 204 | QSize KToolBarSeparator::sizeHint() const |
194 | { | 205 | { |
195 | return orientation() == Vertical ? QSize( 0, 6 ) : QSize( 6, 0 ); | 206 | return orientation() == Qt::Vertical ? QSize( 0, 6 ) : QSize( 6, 0 ); |
196 | } | 207 | } |
197 | 208 | ||
198 | QSizePolicy KToolBarSeparator::sizePolicy() const | 209 | QSizePolicy KToolBarSeparator::sizePolicy() const |
199 | { | 210 | { |
@@ -201,25 +212,25 @@ QSizePolicy KToolBarSeparator::sizePolicy() const | |||
201 | } | 212 | } |
202 | 213 | ||
203 | KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool readConfig ) | 214 | KToolBar::KToolBar( QWidget *parent, const char *name, bool honorStyle, bool readConfig ) |
204 | #ifdef DESKTOP_VERSION | 215 | #ifdef DESKTOP_VERSION |
205 | : QToolBar( QString::fromLatin1( name ), | 216 | : Q3ToolBar( QString::fromLatin1( name ), |
206 | parent && parent->inherits( "QMainWindow" ) ? static_cast<QMainWindow*>(parent) : 0, | 217 | parent && parent->inherits( "Q3MainWindow" ) ? static_cast<Q3MainWindow*>(parent) : 0, |
207 | parent, FALSE, | 218 | parent, FALSE, |
208 | name ? name : "mainToolBar") | 219 | name ? name : "mainToolBar") |
209 | #else | 220 | #else |
210 | : QPEToolBar( parent && parent->inherits( "QMainWindow" ) ? static_cast<QMainWindow*>(parent) : 0, | 221 | : QPEToolBar( parent && parent->inherits( "Q3MainWindow" ) ? static_cast<Q3MainWindow*>(parent) : 0, |
211 | QString::fromLatin1( name )) | 222 | QString::fromLatin1( name )) |
212 | 223 | ||
213 | 224 | ||
214 | #endif | 225 | #endif |
215 | { | 226 | { |
216 | init( readConfig, honorStyle ); | 227 | init( readConfig, honorStyle ); |
217 | } | 228 | } |
218 | 229 | ||
219 | KToolBar::KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) | 230 | KToolBar::KToolBar( Q3MainWindow *parentWindow, Qt::ToolBarDock dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) |
220 | #ifdef DESKTOP_VERSION | 231 | #ifdef DESKTOP_VERSION |
221 | : QToolBar( QString::fromLatin1( name ), | 232 | : Q3ToolBar( QString::fromLatin1( name ), |
222 | parentWindow, dock, newLine, | 233 | parentWindow, dock, newLine, |
223 | name ? name : "mainToolBar") | 234 | name ? name : "mainToolBar") |
224 | #else | 235 | #else |
225 | : QPEToolBar( parentWindow,QString::fromLatin1( name )) | 236 | : QPEToolBar( parentWindow,QString::fromLatin1( name )) |
@@ -230,11 +241,11 @@ KToolBar::KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock, bo | |||
230 | { | 241 | { |
231 | init( readConfig, honorStyle ); | 242 | init( readConfig, honorStyle ); |
232 | } | 243 | } |
233 | 244 | ||
234 | KToolBar::KToolBar( QMainWindow *parentWindow, QWidget *dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) | 245 | KToolBar::KToolBar( Q3MainWindow *parentWindow, QWidget *dock, bool newLine, const char *name, bool honorStyle, bool readConfig ) |
235 | #ifdef DESKTOP_VERSION | 246 | #ifdef DESKTOP_VERSION |
236 | : QToolBar( QString::fromLatin1( name ), | 247 | : Q3ToolBar( QString::fromLatin1( name ), |
237 | parentWindow, dock, newLine, | 248 | parentWindow, dock, newLine, |
238 | name ? name : "mainToolBar") | 249 | name ? name : "mainToolBar") |
239 | #else | 250 | #else |
240 | : QPEToolBar( parentWindow,QString::fromLatin1( name )) | 251 | : QPEToolBar( parentWindow,QString::fromLatin1( name )) |
@@ -279,10 +290,10 @@ void KToolBar::init( bool readConfig, bool honorStyle ) | |||
279 | if ( readConfig ) | 290 | if ( readConfig ) |
280 | slotReadConfig(); | 291 | slotReadConfig(); |
281 | 292 | ||
282 | if ( mainWindow() ) | 293 | if ( mainWindow() ) |
283 | connect( mainWindow(), SIGNAL( toolBarPositionChanged( QToolBar * ) ), | 294 | connect( mainWindow(), SIGNAL( toolBarPositionChanged( Q3ToolBar * ) ), |
284 | this, SLOT( toolBarPosChanged( QToolBar * ) ) ); | 295 | this, SLOT( toolBarPosChanged( Q3ToolBar * ) ) ); |
285 | 296 | ||
286 | // Hack to make sure we recalculate our size when we dock. | 297 | // Hack to make sure we recalculate our size when we dock. |
287 | //US connect( this, SIGNAL(placeChanged(QDockWindow::Place)), SLOT(rebuildLayout()) ); | 298 | //US connect( this, SIGNAL(placeChanged(QDockWindow::Place)), SLOT(rebuildLayout()) ); |
288 | } | 299 | } |
@@ -340,9 +351,9 @@ int KToolBar::insertButton(const QPixmap& pixmap, int id, const char *signal, | |||
340 | return index; | 351 | return index; |
341 | } | 352 | } |
342 | 353 | ||
343 | 354 | ||
344 | int KToolBar::insertButton(const QString& icon, int id, QPopupMenu *popup, | 355 | int KToolBar::insertButton(const QString& icon, int id, Q3PopupMenu *popup, |
345 | bool enabled, const QString &text, int index ) | 356 | bool enabled, const QString &text, int index ) |
346 | { | 357 | { |
347 | KToolBarButton *button = new KToolBarButton( icon, id, this, 0, text ); | 358 | KToolBarButton *button = new KToolBarButton( icon, id, this, 0, text ); |
348 | insertWidgetInternal( button, index, id ); | 359 | insertWidgetInternal( button, index, id ); |
@@ -352,9 +363,9 @@ int KToolBar::insertButton(const QString& icon, int id, QPopupMenu *popup, | |||
352 | return index; | 363 | return index; |
353 | } | 364 | } |
354 | 365 | ||
355 | 366 | ||
356 | int KToolBar::insertButton(const QPixmap& pixmap, int id, QPopupMenu *popup, | 367 | int KToolBar::insertButton(const QPixmap& pixmap, int id, Q3PopupMenu *popup, |
357 | bool enabled, const QString &text, int index ) | 368 | bool enabled, const QString &text, int index ) |
358 | { | 369 | { |
359 | KToolBarButton *button = new KToolBarButton( pixmap, id, this, 0, text ); | 370 | KToolBarButton *button = new KToolBarButton( pixmap, id, this, 0, text ); |
360 | insertWidgetInternal( button, index, id ); | 371 | insertWidgetInternal( button, index, id ); |
@@ -539,9 +550,9 @@ void KToolBar::setButtonIcon( int id, const QString& _icon ) | |||
539 | if ( button ) | 550 | if ( button ) |
540 | button->setIcon( _icon ); | 551 | button->setIcon( _icon ); |
541 | } | 552 | } |
542 | 553 | ||
543 | void KToolBar::setButtonIconSet( int id, const QIconSet& iconset ) | 554 | void KToolBar::setButtonIconSet( int id, const QIcon& iconset ) |
544 | { | 555 | { |
545 | Id2WidgetMap::Iterator it = id2widget.find( id ); | 556 | Id2WidgetMap::Iterator it = id2widget.find( id ); |
546 | if ( it == id2widget.end() ) | 557 | if ( it == id2widget.end() ) |
547 | return; | 558 | return; |
@@ -551,9 +562,9 @@ void KToolBar::setButtonIconSet( int id, const QIconSet& iconset ) | |||
551 | button->setIconSet( iconset ); | 562 | button->setIconSet( iconset ); |
552 | } | 563 | } |
553 | 564 | ||
554 | 565 | ||
555 | void KToolBar::setDelayedPopup (int id , QPopupMenu *_popup, bool toggle ) | 566 | void KToolBar::setDelayedPopup (int id , Q3PopupMenu *_popup, bool toggle ) |
556 | { | 567 | { |
557 | Id2WidgetMap::Iterator it = id2widget.find( id ); | 568 | Id2WidgetMap::Iterator it = id2widget.find( id ); |
558 | if ( it == id2widget.end() ) | 569 | if ( it == id2widget.end() ) |
559 | return; | 570 | return; |
@@ -786,9 +797,9 @@ void KToolBar::setItemAutoSized (int id, bool yes ) | |||
786 | 797 | ||
787 | 798 | ||
788 | void KToolBar::clear () | 799 | void KToolBar::clear () |
789 | { | 800 | { |
790 | QToolBar::clear(); | 801 | Q3ToolBar::clear(); |
791 | widget2id.clear(); | 802 | widget2id.clear(); |
792 | id2widget.clear(); | 803 | id2widget.clear(); |
793 | } | 804 | } |
794 | 805 | ||
@@ -875,23 +886,23 @@ void KToolBar::setBarPos (BarPosition bpos) | |||
875 | { | 886 | { |
876 | if ( !mainWindow() ) | 887 | if ( !mainWindow() ) |
877 | return; | 888 | return; |
878 | //US mainWindow()->moveDockWindow( this, (Dock)bpos ); | 889 | //US mainWindow()->moveDockWindow( this, (Dock)bpos ); |
879 | mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos ); | 890 | mainWindow()->moveToolBar( this, (Qt::ToolBarDock)bpos ); |
880 | } | 891 | } |
881 | 892 | ||
882 | 893 | ||
883 | const KToolBar::BarPosition KToolBar::barPos() | 894 | const KToolBar::BarPosition KToolBar::barPos() |
884 | { | 895 | { |
885 | if ( !(QMainWindow*)mainWindow() ) | 896 | if ( !(Q3MainWindow*)mainWindow() ) |
886 | return KToolBar::Top; | 897 | return KToolBar::Top; |
887 | //US Dock dock; | 898 | //US Dock dock; |
888 | QMainWindow::ToolBarDock dock; | 899 | Qt::ToolBarDock dock; |
889 | int dm1, dm2; | 900 | int dm1, dm2; |
890 | bool dm3; | 901 | bool dm3; |
891 | ((QMainWindow*)mainWindow())->getLocation( (QToolBar*)this, dock, dm1, dm3, dm2 ); | 902 | ((Q3MainWindow*)mainWindow())->getLocation( (Q3ToolBar*)this, dock, dm1, dm3, dm2 ); |
892 | //US if ( dock == DockUnmanaged ) { | 903 | //US if ( dock == DockUnmanaged ) { |
893 | if ( dock == QMainWindow::Unmanaged ) { | 904 | if ( dock == Qt::Unmanaged ) { |
894 | return (KToolBar::BarPosition)Top; | 905 | return (KToolBar::BarPosition)Top; |
895 | } | 906 | } |
896 | return (BarPosition)dock; | 907 | return (BarPosition)dock; |
897 | } | 908 | } |
@@ -966,9 +977,9 @@ void KToolBar::setIconText(IconText icontext, bool update) | |||
966 | emit modechange(); // tell buttons what happened | 977 | emit modechange(); // tell buttons what happened |
967 | 978 | ||
968 | // ugly hack to force a QMainWindow::triggerLayout( TRUE ) | 979 | // ugly hack to force a QMainWindow::triggerLayout( TRUE ) |
969 | if ( mainWindow() ) { | 980 | if ( mainWindow() ) { |
970 | QMainWindow *mw = mainWindow(); | 981 | Q3MainWindow *mw = mainWindow(); |
971 | mw->setUpdatesEnabled( FALSE ); | 982 | mw->setUpdatesEnabled( FALSE ); |
972 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); | 983 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); |
973 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); | 984 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); |
974 | mw->setUpdatesEnabled( TRUE ); | 985 | mw->setUpdatesEnabled( TRUE ); |
@@ -1003,9 +1014,9 @@ void KToolBar::setIconSize(int size, bool update) | |||
1003 | emit modechange(); // tell buttons what happened | 1014 | emit modechange(); // tell buttons what happened |
1004 | 1015 | ||
1005 | // ugly hack to force a QMainWindow::triggerLayout( TRUE ) | 1016 | // ugly hack to force a QMainWindow::triggerLayout( TRUE ) |
1006 | if ( mainWindow() ) { | 1017 | if ( mainWindow() ) { |
1007 | QMainWindow *mw = mainWindow(); | 1018 | Q3MainWindow *mw = mainWindow(); |
1008 | mw->setUpdatesEnabled( FALSE ); | 1019 | mw->setUpdatesEnabled( FALSE ); |
1009 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); | 1020 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); |
1010 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); | 1021 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); |
1011 | mw->setUpdatesEnabled( TRUE ); | 1022 | mw->setUpdatesEnabled( TRUE ); |
@@ -1061,12 +1072,12 @@ void KToolBar::setFlat (bool flag) | |||
1061 | if ( !mainWindow() ) | 1072 | if ( !mainWindow() ) |
1062 | return; | 1073 | return; |
1063 | if ( flag ) | 1074 | if ( flag ) |
1064 | //US mainWindow()->moveDockWindow( this, DockMinimized ); | 1075 | //US mainWindow()->moveDockWindow( this, DockMinimized ); |
1065 | mainWindow()->moveToolBar( this, QMainWindow::Minimized ); | 1076 | mainWindow()->moveToolBar( this, Qt::Minimized ); |
1066 | else | 1077 | else |
1067 | //US mainWindow()->moveDockWindow( this, DockTop ); | 1078 | //US mainWindow()->moveDockWindow( this, DockTop ); |
1068 | mainWindow()->moveToolBar( this, QMainWindow::Top ); | 1079 | mainWindow()->moveToolBar( this, Qt::Top ); |
1069 | // And remember to save the new look later | 1080 | // And remember to save the new look later |
1070 | /*US | 1081 | /*US |
1071 | if ( mainWindow()->inherits( "KMainWindow" ) ) | 1082 | if ( mainWindow()->inherits( "KMainWindow" ) ) |
1072 | static_cast<KMainWindow *>(mainWindow())->setSettingsDirty(); | 1083 | static_cast<KMainWindow *>(mainWindow())->setSettingsDirty(); |
@@ -1248,36 +1259,36 @@ void KToolBar::doConnections( KToolBarButton *button ) | |||
1248 | void KToolBar::mousePressEvent ( QMouseEvent *m ) | 1259 | void KToolBar::mousePressEvent ( QMouseEvent *m ) |
1249 | { | 1260 | { |
1250 | if ( !mainWindow() ) | 1261 | if ( !mainWindow() ) |
1251 | return; | 1262 | return; |
1252 | QMainWindow *mw = mainWindow(); | 1263 | Q3MainWindow *mw = mainWindow(); |
1253 | if ( mw->toolBarsMovable() && d->m_enableContext ) { | 1264 | if ( mw->toolBarsMovable() && d->m_enableContext ) { |
1254 | if ( m->button() == RightButton ) { | 1265 | if ( m->button() == Qt::RightButton ) { |
1255 | int i = contextMenu()->exec( m->globalPos(), 0 ); | 1266 | int i = contextMenu()->exec( m->globalPos(), 0 ); |
1256 | switch ( i ) { | 1267 | switch ( i ) { |
1257 | case -1: | 1268 | case -1: |
1258 | return; // popup cancelled | 1269 | return; // popup cancelled |
1259 | case CONTEXT_LEFT: | 1270 | case CONTEXT_LEFT: |
1260 | //US mw->moveDockWindow( this, DockLeft ); | 1271 | //US mw->moveDockWindow( this, DockLeft ); |
1261 | mw->moveToolBar( this, QMainWindow::Left ); | 1272 | mw->moveToolBar( this, Qt::Left ); |
1262 | break; | 1273 | break; |
1263 | case CONTEXT_RIGHT: | 1274 | case CONTEXT_RIGHT: |
1264 | //US mw->moveDockWindow( this, DockRight ); | 1275 | //US mw->moveDockWindow( this, DockRight ); |
1265 | mw->moveToolBar( this, QMainWindow::Right ); | 1276 | mw->moveToolBar( this, Qt::Right ); |
1266 | break; | 1277 | break; |
1267 | case CONTEXT_TOP: | 1278 | case CONTEXT_TOP: |
1268 | //US mw->moveDockWindow( this, DockTop ); | 1279 | //US mw->moveDockWindow( this, DockTop ); |
1269 | mw->moveToolBar( this, QMainWindow::Top ); | 1280 | mw->moveToolBar( this, Qt::Top ); |
1270 | break; | 1281 | break; |
1271 | case CONTEXT_BOTTOM: | 1282 | case CONTEXT_BOTTOM: |
1272 | //US mw->moveDockWindow( this, DockBottom ); | 1283 | //US mw->moveDockWindow( this, DockBottom ); |
1273 | mw->moveToolBar( this, QMainWindow::Bottom ); | 1284 | mw->moveToolBar( this, Qt::Bottom ); |
1274 | break; | 1285 | break; |
1275 | case CONTEXT_FLOAT: | 1286 | case CONTEXT_FLOAT: |
1276 | break; | 1287 | break; |
1277 | case CONTEXT_FLAT: | 1288 | case CONTEXT_FLAT: |
1278 | //US mw->moveDockWindow( this, DockMinimized ); | 1289 | //US mw->moveDockWindow( this, DockMinimized ); |
1279 | mw->moveToolBar( this, QMainWindow::Minimized ); | 1290 | mw->moveToolBar( this, Qt::Minimized ); |
1280 | break; | 1291 | break; |
1281 | case CONTEXT_ICONS: | 1292 | case CONTEXT_ICONS: |
1282 | setIconText( IconOnly ); | 1293 | setIconText( IconOnly ); |
1283 | break; | 1294 | break; |
@@ -1331,9 +1342,9 @@ void KToolBar::rebuildLayout() | |||
1331 | l->addSpacing( 6 ); | 1342 | l->addSpacing( 6 ); |
1332 | w->hide(); | 1343 | w->hide(); |
1333 | continue; | 1344 | continue; |
1334 | } | 1345 | } |
1335 | if ( w->inherits( "QPopupMenu" ) ) | 1346 | if ( w->inherits( "Q3PopupMenu" ) ) |
1336 | continue; | 1347 | continue; |
1337 | l->addWidget( w ); | 1348 | l->addWidget( w ); |
1338 | w->show(); | 1349 | w->show(); |
1339 | } | 1350 | } |
@@ -1363,9 +1374,9 @@ void KToolBar::childEvent( QChildEvent *e ) | |||
1363 | 1374 | ||
1364 | if ( e->child()->isWidgetType() ) { | 1375 | if ( e->child()->isWidgetType() ) { |
1365 | QWidget * w = (QWidget*)e->child(); | 1376 | QWidget * w = (QWidget*)e->child(); |
1366 | if ( e->type() == QEvent::ChildInserted ) { | 1377 | if ( e->type() == QEvent::ChildInserted ) { |
1367 | if ( !e->child()->inherits( "QPopupMenu" ) && | 1378 | if ( !e->child()->inherits( "Q3PopupMenu" ) && |
1368 | ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) { | 1379 | ::qstrcmp( "qt_dockwidget_internal", e->child()->name() ) != 0 ) { |
1369 | 1380 | ||
1370 | // prevent items that have been explicitly inserted by insert*() from | 1381 | // prevent items that have been explicitly inserted by insert*() from |
1371 | // being inserted again | 1382 | // being inserted again |
@@ -1374,12 +1385,12 @@ void KToolBar::childEvent( QChildEvent *e ) | |||
1374 | int dummy = -1; | 1385 | int dummy = -1; |
1375 | insertWidgetInternal( w, dummy, -1 ); | 1386 | insertWidgetInternal( w, dummy, -1 ); |
1376 | } | 1387 | } |
1377 | } | 1388 | } |
1378 | } else { | 1389 | } else if( e->type() == QEvent::ChildRemoved ) { |
1379 | removeWidgetInternal( w ); | 1390 | removeWidgetInternal( w ); |
1380 | } | 1391 | } |
1381 | if ( isVisibleTo( 0 ) ) | 1392 | /* TODO:hacker: if ( isVisibleTo( 0 ) ) |
1382 | { | 1393 | { |
1383 | QBoxLayout *l = boxLayout(); | 1394 | QBoxLayout *l = boxLayout(); |
1384 | // QLayout *l = layout(); | 1395 | // QLayout *l = layout(); |
1385 | 1396 | ||
@@ -1389,11 +1400,11 @@ void KToolBar::childEvent( QChildEvent *e ) | |||
1389 | while ( it.current() ) { | 1400 | while ( it.current() ) { |
1390 | it.deleteCurrent(); | 1401 | it.deleteCurrent(); |
1391 | } | 1402 | } |
1392 | layoutTimer->start( 50, TRUE ); | 1403 | layoutTimer->start( 50, TRUE ); |
1393 | } | 1404 | } */ |
1394 | } | 1405 | } |
1395 | QToolBar::childEvent( e ); | 1406 | Q3ToolBar::childEvent( e ); |
1396 | } | 1407 | } |
1397 | 1408 | ||
1398 | void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) | 1409 | void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) |
1399 | { | 1410 | { |
@@ -1415,35 +1426,35 @@ void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) | |||
1415 | } | 1426 | } |
1416 | void KToolBar::repaintMe() | 1427 | void KToolBar::repaintMe() |
1417 | { | 1428 | { |
1418 | setUpdatesEnabled( true ); | 1429 | setUpdatesEnabled( true ); |
1419 | QToolBar::repaint( true ); | 1430 | Q3ToolBar::repaint( true ); |
1420 | qDebug(" KToolBar::repaintMe() "); | 1431 | qDebug(" KToolBar::repaintMe() "); |
1421 | } | 1432 | } |
1422 | 1433 | ||
1423 | void KToolBar::showEvent( QShowEvent *e ) | 1434 | void KToolBar::showEvent( QShowEvent *e ) |
1424 | { | 1435 | { |
1425 | rebuildLayout(); | 1436 | rebuildLayout(); |
1426 | QToolBar::showEvent( e ); | 1437 | Q3ToolBar::showEvent( e ); |
1427 | } | 1438 | } |
1428 | 1439 | ||
1429 | void KToolBar::setStretchableWidget( QWidget *w ) | 1440 | void KToolBar::setStretchableWidget( QWidget *w ) |
1430 | { | 1441 | { |
1431 | QToolBar::setStretchableWidget( w ); | 1442 | Q3ToolBar::setStretchableWidget( w ); |
1432 | stretchableWidget = w; | 1443 | stretchableWidget = w; |
1433 | } | 1444 | } |
1434 | 1445 | ||
1435 | QSizePolicy KToolBar::sizePolicy() const | 1446 | QSizePolicy KToolBar::sizePolicy() const |
1436 | { | 1447 | { |
1437 | if ( orientation() == Horizontal ) | 1448 | if ( orientation() == Qt::Horizontal ) |
1438 | return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); | 1449 | return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); |
1439 | else | 1450 | else |
1440 | return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ); | 1451 | return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ); |
1441 | } | 1452 | } |
1442 | 1453 | ||
1443 | QSize KToolBar::sizeHint() const | 1454 | QSize KToolBar::sizeHint() const |
1444 | { | 1455 | { |
1445 | QSize sh = QToolBar::sizeHint(); | 1456 | QSize sh = Q3ToolBar::sizeHint(); |
1446 | //qDebug("%x KToolBar::sizeHint() %d %d ",this, QToolBar::sizeHint().width(),QToolBar::sizeHint().height() ); | 1457 | //qDebug("%x KToolBar::sizeHint() %d %d ",this, QToolBar::sizeHint().width(),QToolBar::sizeHint().height() ); |
1447 | if ( sh.height() <= 20 || sh.width() < 60 ) | 1458 | if ( sh.height() <= 20 || sh.width() < 60 ) |
1448 | return QSize( sizeHintW, sizeHintH ); | 1459 | return QSize( sizeHintW, sizeHintH ); |
1449 | KToolBar* ttt = (KToolBar*) this; | 1460 | KToolBar* ttt = (KToolBar*) this; |
@@ -1507,9 +1518,9 @@ QSize KToolBar::sizeHint() const | |||
1507 | minSize += QSize(margin*2, margin*2); | 1518 | minSize += QSize(margin*2, margin*2); |
1508 | break; | 1519 | break; |
1509 | 1520 | ||
1510 | default: | 1521 | default: |
1511 | minSize = QToolBar::sizeHint(); | 1522 | minSize = Q3ToolBar::sizeHint(); |
1512 | break; | 1523 | break; |
1513 | } | 1524 | } |
1514 | return minSize; | 1525 | return minSize; |
1515 | #endif | 1526 | #endif |
@@ -1531,21 +1542,21 @@ bool KToolBar::highlight() const | |||
1531 | } | 1542 | } |
1532 | 1543 | ||
1533 | void KToolBar::hide() | 1544 | void KToolBar::hide() |
1534 | { | 1545 | { |
1535 | QToolBar::hide(); | 1546 | Q3ToolBar::hide(); |
1536 | } | 1547 | } |
1537 | 1548 | ||
1538 | void KToolBar::show() | 1549 | void KToolBar::show() |
1539 | { | 1550 | { |
1540 | QToolBar::show(); | 1551 | Q3ToolBar::show(); |
1541 | } | 1552 | } |
1542 | 1553 | ||
1543 | void KToolBar::resizeEvent( QResizeEvent *e ) | 1554 | void KToolBar::resizeEvent( QResizeEvent *e ) |
1544 | { | 1555 | { |
1545 | bool b = isUpdatesEnabled(); | 1556 | bool b = isUpdatesEnabled(); |
1546 | setUpdatesEnabled( FALSE ); | 1557 | setUpdatesEnabled( FALSE ); |
1547 | QToolBar::resizeEvent( e ); | 1558 | Q3ToolBar::resizeEvent( e ); |
1548 | if (b) | 1559 | if (b) |
1549 | d->repaintTimer.start( 100, true ); | 1560 | d->repaintTimer.start( 100, true ); |
1550 | } | 1561 | } |
1551 | 1562 | ||
@@ -1725,9 +1736,9 @@ void KToolBar::applyAppearanceSettings(KConfig *config, const QString &_configGr | |||
1725 | setIconSize(iconsize, false); | 1736 | setIconSize(iconsize, false); |
1726 | doUpdate = true; | 1737 | doUpdate = true; |
1727 | } | 1738 | } |
1728 | 1739 | ||
1729 | QMainWindow *mw = mainWindow(); | 1740 | Q3MainWindow *mw = mainWindow(); |
1730 | 1741 | ||
1731 | // ...and if we should highlight | 1742 | // ...and if we should highlight |
1732 | if ( highlight != d->m_highlight ) { | 1743 | if ( highlight != d->m_highlight ) { |
1733 | d->m_highlight = highlight; | 1744 | d->m_highlight = highlight; |
@@ -1804,21 +1815,21 @@ void KToolBar::applySettings(KConfig *config, const QString &_configGroup) | |||
1804 | pos = DockTornOff; | 1815 | pos = DockTornOff; |
1805 | else if ( position == "Flat" ) | 1816 | else if ( position == "Flat" ) |
1806 | pos = DockMinimized; | 1817 | pos = DockMinimized; |
1807 | */ | 1818 | */ |
1808 | QMainWindow::ToolBarDock pos(QMainWindow::Top); | 1819 | Qt::ToolBarDock pos(Qt::DockTop); |
1809 | if ( position == "Top" ) | 1820 | if ( position == "Top" ) |
1810 | pos = QMainWindow::Top; | 1821 | pos = Qt::Top; |
1811 | else if ( position == "Bottom" ) | 1822 | else if ( position == "Bottom" ) |
1812 | pos = QMainWindow::Bottom; | 1823 | pos = Qt::Bottom; |
1813 | else if ( position == "Left" ) | 1824 | else if ( position == "Left" ) |
1814 | pos = QMainWindow::Left; | 1825 | pos = Qt::Left; |
1815 | else if ( position == "Right" ) | 1826 | else if ( position == "Right" ) |
1816 | pos = QMainWindow::Right; | 1827 | pos = Qt::Right; |
1817 | else if ( position == "Floating" ) | 1828 | else if ( position == "Floating" ) |
1818 | pos = QMainWindow::TornOff; | 1829 | pos = Qt::TornOff; |
1819 | else if ( position == "Flat" ) | 1830 | else if ( position == "Flat" ) |
1820 | pos = QMainWindow::Minimized; | 1831 | pos = Qt::Minimized; |
1821 | 1832 | ||
1822 | //kdDebug(220) << "KToolBar::applySettings hidden=" << hidden << endl; | 1833 | //kdDebug(220) << "KToolBar::applySettings hidden=" << hidden << endl; |
1823 | if (hidden) | 1834 | if (hidden) |
1824 | hide(); | 1835 | hide(); |
@@ -1826,9 +1837,9 @@ void KToolBar::applySettings(KConfig *config, const QString &_configGroup) | |||
1826 | show(); | 1837 | show(); |
1827 | 1838 | ||
1828 | if ( mainWindow() ) | 1839 | if ( mainWindow() ) |
1829 | { | 1840 | { |
1830 | QMainWindow *mw = mainWindow(); | 1841 | Q3MainWindow *mw = mainWindow(); |
1831 | 1842 | ||
1832 | //kdDebug(220) << "KToolBar::applySettings updating ToolbarInfo" << endl; | 1843 | //kdDebug(220) << "KToolBar::applySettings updating ToolbarInfo" << endl; |
1833 | d->toolBarInfo = KToolBarPrivate::ToolBarInfo( pos, index, newLine, offset ); | 1844 | d->toolBarInfo = KToolBarPrivate::ToolBarInfo( pos, index, newLine, offset ); |
1834 | 1845 | ||
@@ -1861,9 +1872,9 @@ bool KToolBar::event( QEvent *e ) | |||
1861 | childEvent((QChildEvent *)e); | 1872 | childEvent((QChildEvent *)e); |
1862 | return true; | 1873 | return true; |
1863 | } | 1874 | } |
1864 | 1875 | ||
1865 | return QToolBar::event( e ); | 1876 | return Q3ToolBar::event( e ); |
1866 | } | 1877 | } |
1867 | 1878 | ||
1868 | void KToolBar::slotRepaint() | 1879 | void KToolBar::slotRepaint() |
1869 | { | 1880 | { |
@@ -1879,16 +1890,16 @@ void KToolBar::slotRepaint() | |||
1879 | setUpdatesEnabled( TRUE ); | 1890 | setUpdatesEnabled( TRUE ); |
1880 | repaint( TRUE ); | 1891 | repaint( TRUE ); |
1881 | } | 1892 | } |
1882 | 1893 | ||
1883 | void KToolBar::toolBarPosChanged( QToolBar *tb ) | 1894 | void KToolBar::toolBarPosChanged( Q3ToolBar *tb ) |
1884 | { | 1895 | { |
1885 | if ( tb != this ) | 1896 | if ( tb != this ) |
1886 | return; | 1897 | return; |
1887 | //US if ( d->oldPos == DockMinimized ) | 1898 | //US if ( d->oldPos == DockMinimized ) |
1888 | if ( d->oldPos == QMainWindow::Minimized ) | 1899 | if ( d->oldPos == Qt::Minimized ) |
1889 | rebuildLayout(); | 1900 | rebuildLayout(); |
1890 | d->oldPos = (QMainWindow::ToolBarDock)barPos(); | 1901 | d->oldPos = (Qt::ToolBarDock)barPos(); |
1891 | /*US | 1902 | /*US |
1892 | if ( mainWindow() && mainWindow()->inherits( "KMainWindow" ) ) | 1903 | if ( mainWindow() && mainWindow()->inherits( "KMainWindow" ) ) |
1893 | static_cast<KMainWindow *>(mainWindow())->setSettingsDirty(); | 1904 | static_cast<KMainWindow *>(mainWindow())->setSettingsDirty(); |
1894 | */ | 1905 | */ |
@@ -2030,9 +2041,9 @@ void KToolBar::getAttributes( QString &position, QString &icontext, int &index ) | |||
2030 | break; | 2041 | break; |
2031 | } | 2042 | } |
2032 | 2043 | ||
2033 | if ( mainWindow() ) { | 2044 | if ( mainWindow() ) { |
2034 | QMainWindow::ToolBarDock dock; | 2045 | Qt::ToolBarDock dock; |
2035 | bool newLine; | 2046 | bool newLine; |
2036 | int offset; | 2047 | int offset; |
2037 | mainWindow()->getLocation( this, dock, index, newLine, offset ); | 2048 | mainWindow()->getLocation( this, dock, index, newLine, offset ); |
2038 | } | 2049 | } |
@@ -2099,21 +2110,21 @@ void KToolBar::positionYourself( bool force ) | |||
2099 | d->positioned = TRUE; | 2110 | d->positioned = TRUE; |
2100 | } | 2111 | } |
2101 | 2112 | ||
2102 | //US KPopupMenu *KToolBar::contextMenu() | 2113 | //US KPopupMenu *KToolBar::contextMenu() |
2103 | QPopupMenu *KToolBar::contextMenu() | 2114 | Q3PopupMenu *KToolBar::contextMenu() |
2104 | { | 2115 | { |
2105 | if ( context ) | 2116 | if ( context ) |
2106 | return context; | 2117 | return context; |
2107 | 2118 | ||
2108 | // Construct our context popup menu. Name it qt_dockwidget_internal so it | 2119 | // Construct our context popup menu. Name it qt_dockwidget_internal so it |
2109 | // won't be deleted by QToolBar::clear(). | 2120 | // won't be deleted by QToolBar::clear(). |
2110 | //US context = new KPopupMenu( this, "qt_dockwidget_internal" ); | 2121 | //US context = new KPopupMenu( this, "qt_dockwidget_internal" ); |
2111 | context = new QPopupMenu( this, "qt_dockwidget_internal" ); | 2122 | context = new Q3PopupMenu( this, "qt_dockwidget_internal" ); |
2112 | //US context->insertTitle(i18n("Toolbar Menu")); | 2123 | //US context->insertTitle(i18n("Toolbar Menu")); |
2113 | 2124 | ||
2114 | //US KPopupMenu *orient = new KPopupMenu( context, "orient" ); | 2125 | //US KPopupMenu *orient = new KPopupMenu( context, "orient" ); |
2115 | QPopupMenu *orient = new QPopupMenu( context, "orient" ); | 2126 | Q3PopupMenu *orient = new Q3PopupMenu( context, "orient" ); |
2116 | orient->insertItem( i18n("toolbar position string","Top"), CONTEXT_TOP ); | 2127 | orient->insertItem( i18n("toolbar position string","Top"), CONTEXT_TOP ); |
2117 | orient->insertItem( i18n("toolbar position string","Left"), CONTEXT_LEFT ); | 2128 | orient->insertItem( i18n("toolbar position string","Left"), CONTEXT_LEFT ); |
2118 | orient->insertItem( i18n("toolbar position string","Right"), CONTEXT_RIGHT ); | 2129 | orient->insertItem( i18n("toolbar position string","Right"), CONTEXT_RIGHT ); |
2119 | orient->insertItem( i18n("toolbar position string","Bottom"), CONTEXT_BOTTOM ); | 2130 | orient->insertItem( i18n("toolbar position string","Bottom"), CONTEXT_BOTTOM ); |
@@ -2121,19 +2132,19 @@ QPopupMenu *KToolBar::contextMenu() | |||
2121 | //orient->insertItem( i18n("toolbar position string","Floating"), CONTEXT_FLOAT ); | 2132 | //orient->insertItem( i18n("toolbar position string","Floating"), CONTEXT_FLOAT ); |
2122 | orient->insertItem( i18n("min toolbar", "Flat"), CONTEXT_FLAT ); | 2133 | orient->insertItem( i18n("min toolbar", "Flat"), CONTEXT_FLAT ); |
2123 | 2134 | ||
2124 | //US KPopupMenu *mode = new KPopupMenu( context, "mode" ); | 2135 | //US KPopupMenu *mode = new KPopupMenu( context, "mode" ); |
2125 | QPopupMenu *mode = new QPopupMenu( context, "mode" ); | 2136 | Q3PopupMenu *mode = new Q3PopupMenu( context, "mode" ); |
2126 | mode->insertItem( i18n("Icons Only"), CONTEXT_ICONS ); | 2137 | mode->insertItem( i18n("Icons Only"), CONTEXT_ICONS ); |
2127 | mode->insertItem( i18n("Text Only"), CONTEXT_TEXT ); | 2138 | mode->insertItem( i18n("Text Only"), CONTEXT_TEXT ); |
2128 | mode->insertItem( i18n("Text Alongside Icons"), CONTEXT_TEXTRIGHT ); | 2139 | mode->insertItem( i18n("Text Alongside Icons"), CONTEXT_TEXTRIGHT ); |
2129 | mode->insertItem( i18n("Text Under Icons"), CONTEXT_TEXTUNDER ); | 2140 | mode->insertItem( i18n("Text Under Icons"), CONTEXT_TEXTUNDER ); |
2130 | 2141 | ||
2131 | //US KPopupMenu *size = new KPopupMenu( context, "size" ); | 2142 | //US KPopupMenu *size = new KPopupMenu( context, "size" ); |
2132 | QPopupMenu *size = new QPopupMenu( context, "size" ); | 2143 | Q3PopupMenu *size = new Q3PopupMenu( context, "size" ); |
2133 | size->insertItem( i18n("Default"), CONTEXT_ICONSIZES ); | 2144 | size->insertItem( i18n("Default"), CONTEXT_ICONSIZES ); |
2134 | // Query the current theme for available sizes | 2145 | // Query the current theme for available sizes |
2135 | QValueList<int> avSizes; | 2146 | Q3ValueList<int> avSizes; |
2136 | /*US | 2147 | /*US |
2137 | KIconTheme *theme = KGlobal::instance()->iconLoader()->theme(); | 2148 | KIconTheme *theme = KGlobal::instance()->iconLoader()->theme(); |
2138 | if (!::qstrcmp(QObject::name(), "mainToolBar")) | 2149 | if (!::qstrcmp(QObject::name(), "mainToolBar")) |
2139 | avSizes = theme->querySizes( KIcon::MainToolbar); | 2150 | avSizes = theme->querySizes( KIcon::MainToolbar); |
@@ -2144,9 +2155,9 @@ QPopupMenu *KToolBar::contextMenu() | |||
2144 | avSizes << 32; | 2155 | avSizes << 32; |
2145 | 2156 | ||
2146 | d->iconSizes = avSizes; | 2157 | d->iconSizes = avSizes; |
2147 | 2158 | ||
2148 | QValueList<int>::Iterator it; | 2159 | Q3ValueList<int>::Iterator it; |
2149 | for (it=avSizes.begin(); it!=avSizes.end(); it++) { | 2160 | for (it=avSizes.begin(); it!=avSizes.end(); it++) { |
2150 | QString text; | 2161 | QString text; |
2151 | if ( *it < 19 ) | 2162 | if ( *it < 19 ) |
2152 | text = i18n("Small (%1x%2)").arg(*it).arg(*it); | 2163 | text = i18n("Small (%1x%2)").arg(*it).arg(*it); |
@@ -2217,10 +2228,10 @@ void KToolBar::slotContextAboutToShow() | |||
2217 | context->setItemChecked(CONTEXT_TEXTUNDER, true); | 2228 | context->setItemChecked(CONTEXT_TEXTUNDER, true); |
2218 | break; | 2229 | break; |
2219 | } | 2230 | } |
2220 | 2231 | ||
2221 | QValueList<int>::ConstIterator iIt = d->iconSizes.begin(); | 2232 | Q3ValueList<int>::ConstIterator iIt = d->iconSizes.begin(); |
2222 | QValueList<int>::ConstIterator iEnd = d->iconSizes.end(); | 2233 | Q3ValueList<int>::ConstIterator iEnd = d->iconSizes.end(); |
2223 | for (; iIt != iEnd; ++iIt ) | 2234 | for (; iIt != iEnd; ++iIt ) |
2224 | context->setItemChecked( CONTEXT_ICONSIZES + *iIt, false ); | 2235 | context->setItemChecked( CONTEXT_ICONSIZES + *iIt, false ); |
2225 | 2236 | ||
2226 | context->setItemChecked( CONTEXT_ICONSIZES, false ); | 2237 | context->setItemChecked( CONTEXT_ICONSIZES, 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 | |||
@@ -25,29 +25,37 @@ | |||
25 | #define KTOOLBAR_H | 25 | #define KTOOLBAR_H |
26 | 26 | ||
27 | #ifndef DESKTOP_VERSION | 27 | #ifndef DESKTOP_VERSION |
28 | #define private public | 28 | #define private public |
29 | #include <qtoolbar.h> | 29 | #include <q3toolbar.h> |
30 | #undef private | 30 | #undef private |
31 | #include <qpe/qpetoolbar.h> | 31 | #include <qpe/qpetoolbar.h> |
32 | #else | 32 | #else |
33 | #include <qtoolbar.h> | 33 | #include <q3toolbar.h> |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | 36 | ||
37 | #include <qmainwindow.h> | 37 | #include <q3mainwindow.h> |
38 | #include <qcombobox.h> | 38 | #include <qcombobox.h> |
39 | #include <qmap.h> | 39 | #include <qmap.h> |
40 | #include <qptrlist.h> | 40 | #include <q3ptrlist.h> |
41 | //Added by qt3to4: | ||
42 | #include <QPixmap> | ||
43 | #include <QResizeEvent> | ||
44 | #include <Q3PopupMenu> | ||
45 | #include <QMouseEvent> | ||
46 | #include <QChildEvent> | ||
47 | #include <QEvent> | ||
48 | #include <QShowEvent> | ||
41 | #include <kglobal.h> | 49 | #include <kglobal.h> |
42 | #include <qguardedptr.h> | 50 | #include <qpointer.h> |
43 | #include <qframe.h> | 51 | #include <q3frame.h> |
44 | #include <qiconset.h> | 52 | #include <qicon.h> |
45 | 53 | ||
46 | class QDomElement; | 54 | class QDomElement; |
47 | class QSize; | 55 | class QSize; |
48 | class QPixmap; | 56 | class QPixmap; |
49 | class QPopupMenu; | 57 | class Q3PopupMenu; |
50 | class QStringList; | 58 | class QStringList; |
51 | class QDomDocument; | 59 | class QDomDocument; |
52 | class QTimer; | 60 | class QTimer; |
53 | 61 | ||
@@ -62,24 +70,24 @@ class KComboBox; | |||
62 | class KXMLGUIClient; | 70 | class KXMLGUIClient; |
63 | 71 | ||
64 | class KToolBarPrivate; | 72 | class KToolBarPrivate; |
65 | 73 | ||
66 | class KToolBarSeparator : public QFrame | 74 | class KToolBarSeparator : public Q3Frame |
67 | { | 75 | { |
68 | Q_OBJECT | 76 | Q_OBJECT |
69 | public: | 77 | public: |
70 | KToolBarSeparator( Orientation, bool l, QToolBar *parent, const char* name=0 ); | 78 | KToolBarSeparator( Qt::Orientation, bool l, Q3ToolBar *parent, const char* name=0 ); |
71 | 79 | ||
72 | QSize sizeHint() const; | 80 | QSize sizeHint() const; |
73 | Orientation orientation() const { return orient; } | 81 | Qt::Orientation orientation() const { return orient; } |
74 | QSizePolicy sizePolicy() const; | 82 | QSizePolicy sizePolicy() const; |
75 | bool showLine() const { return line; } | 83 | bool showLine() const { return line; } |
76 | public slots: | 84 | public slots: |
77 | void setOrientation( Orientation ); | 85 | void setOrientation( Qt::Orientation ); |
78 | protected: | 86 | protected: |
79 | void styleChange( QStyle& ); | 87 | void styleChange( QStyle& ); |
80 | private: | 88 | private: |
81 | Orientation orient; | 89 | Qt::Orientation orient; |
82 | bool line; | 90 | bool line; |
83 | }; | 91 | }; |
84 | 92 | ||
85 | 93 | ||
@@ -110,12 +118,12 @@ private: | |||
110 | // strange things are happening ... so I have to use strange define methods ... | 118 | // strange things are happening ... so I have to use strange define methods ... |
111 | // porting KToolBar back to Qt2 really needs some strange hacks | 119 | // porting KToolBar back to Qt2 really needs some strange hacks |
112 | 120 | ||
113 | #ifndef DESKTOP_VERSION | 121 | #ifndef DESKTOP_VERSION |
114 | #define QToolBar QPEToolBar | 122 | #define Q3ToolBar QPEToolBar |
115 | #endif | 123 | #endif |
116 | 124 | ||
117 | class KToolBar : public QToolBar | 125 | class KToolBar : public Q3ToolBar |
118 | { | 126 | { |
119 | Q_OBJECT | 127 | Q_OBJECT |
120 | 128 | ||
121 | 129 | ||
@@ -126,9 +134,9 @@ private: | |||
126 | Q_PROPERTY( bool fullSize READ fullSize WRITE setFullSize ) | 134 | Q_PROPERTY( bool fullSize READ fullSize WRITE setFullSize ) |
127 | Q_PROPERTY( int iconSize READ iconSize WRITE setIconSize ) | 135 | Q_PROPERTY( int iconSize READ iconSize WRITE setIconSize ) |
128 | Q_PROPERTY( QString text READ text WRITE setText ) | 136 | Q_PROPERTY( QString text READ text WRITE setText ) |
129 | #ifndef DESKTOP_VERSION | 137 | #ifndef DESKTOP_VERSION |
130 | #undef QToolBar | 138 | #undef Q3ToolBar |
131 | #endif | 139 | #endif |
132 | public: | 140 | public: |
133 | enum IconText{IconOnly = 0, IconTextRight, TextOnly, IconTextBottom}; | 141 | enum IconText{IconOnly = 0, IconTextRight, TextOnly, IconTextBottom}; |
134 | /** | 142 | /** |
@@ -174,9 +182,9 @@ public: | |||
174 | * @param name The standard internal name | 182 | * @param name The standard internal name |
175 | * @param honor_style If true, then global settings for IconSize and IconText will be honored | 183 | * @param honor_style If true, then global settings for IconSize and IconText will be honored |
176 | * @param readConfig whether to apply the configuration (global and application-specific) | 184 | * @param readConfig whether to apply the configuration (global and application-specific) |
177 | */ | 185 | */ |
178 | KToolBar( QMainWindow *parentWindow, QMainWindow::ToolBarDock dock /*= QMainWindow::Top*/, bool newLine = false, | 186 | KToolBar( Q3MainWindow *parentWindow, Qt::ToolBarDock dock /*= QMainWindow::Top*/, bool newLine = false, |
179 | const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); | 187 | const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); |
180 | 188 | ||
181 | /** | 189 | /** |
182 | * Constructor for non-XML-GUI applications. | 190 | * Constructor for non-XML-GUI applications. |
@@ -192,9 +200,9 @@ public: | |||
192 | * @param name The standard internal name | 200 | * @param name The standard internal name |
193 | * @param honor_style If true, then global settings for IconSize and IconText will be honored | 201 | * @param honor_style If true, then global settings for IconSize and IconText will be honored |
194 | * @param readConfig whether to apply the configuration (global and application-specific) | 202 | * @param readConfig whether to apply the configuration (global and application-specific) |
195 | */ | 203 | */ |
196 | KToolBar( QMainWindow *parentWindow, QWidget *dock, bool newLine = false, | 204 | KToolBar( Q3MainWindow *parentWindow, QWidget *dock, bool newLine = false, |
197 | const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); | 205 | const char *name = 0, bool honor_style = FALSE, bool readConfig = TRUE ); |
198 | 206 | ||
199 | virtual ~KToolBar(); | 207 | virtual ~KToolBar(); |
200 | 208 | ||
@@ -302,9 +310,9 @@ public: | |||
302 | * this button (see @ref setDelayedPopup() for that). | 310 | * this button (see @ref setDelayedPopup() for that). |
303 | * You can add custom popups which inherit @ref QPopupMenu to get popups | 311 | * You can add custom popups which inherit @ref QPopupMenu to get popups |
304 | * with tables, drawings etc. Just don't fiddle with events there. | 312 | * with tables, drawings etc. Just don't fiddle with events there. |
305 | */ | 313 | */ |
306 | int insertButton(const QString& icon, int id, QPopupMenu *popup, | 314 | int insertButton(const QString& icon, int id, Q3PopupMenu *popup, |
307 | bool enabled, const QString&_text, int index=-1); | 315 | bool enabled, const QString&_text, int index=-1); |
308 | 316 | ||
309 | /** | 317 | /** |
310 | * Inserts a button with popupmenu. | 318 | * Inserts a button with popupmenu. |
@@ -317,9 +325,9 @@ public: | |||
317 | * this button (see @ref setDelayedPopup() for that). | 325 | * this button (see @ref setDelayedPopup() for that). |
318 | * You can add custom popups which inherit @ref QPopupMenu to get popups | 326 | * You can add custom popups which inherit @ref QPopupMenu to get popups |
319 | * with tables, drawings etc. Just don't fiddle with events there. | 327 | * with tables, drawings etc. Just don't fiddle with events there. |
320 | */ | 328 | */ |
321 | int insertButton(const QPixmap& pixmap, int id, QPopupMenu *popup, | 329 | int insertButton(const QPixmap& pixmap, int id, Q3PopupMenu *popup, |
322 | bool enabled, const QString&_text, int index=-1); | 330 | bool enabled, const QString&_text, int index=-1); |
323 | 331 | ||
324 | /** | 332 | /** |
325 | * Inserts a @ref KLineEdit. You have to specify signals and slots to | 333 | * Inserts a @ref KLineEdit. You have to specify signals and slots to |
@@ -358,9 +366,9 @@ public: | |||
358 | const char *signal, const QObject *receiver, | 366 | const char *signal, const QObject *receiver, |
359 | const char *slot, bool enabled=true, | 367 | const char *slot, bool enabled=true, |
360 | const QString& tooltiptext=QString::null, | 368 | const QString& tooltiptext=QString::null, |
361 | int size=70, int index=-1, | 369 | int size=70, int index=-1, |
362 | QComboBox::Policy policy = QComboBox::AtBottom); | 370 | QComboBox::Policy policy = QComboBox::InsertAtBottom); |
363 | 371 | ||
364 | /** | 372 | /** |
365 | * Insert a @ref KComboBox with text. | 373 | * Insert a @ref KComboBox with text. |
366 | * | 374 | * |
@@ -374,9 +382,9 @@ public: | |||
374 | const char *signal, QObject *recevier, | 382 | const char *signal, QObject *recevier, |
375 | const char *slot, bool enabled=true, | 383 | const char *slot, bool enabled=true, |
376 | const QString& tooltiptext=QString::null, | 384 | const QString& tooltiptext=QString::null, |
377 | int size=70, int index=-1, | 385 | int size=70, int index=-1, |
378 | QComboBox::Policy policy = QComboBox::AtBottom); | 386 | QComboBox::Policy policy = QComboBox::InsertAtBottom); |
379 | 387 | ||
380 | /** | 388 | /** |
381 | * Inserts a separator into the toolbar with the given id. | 389 | * Inserts a separator into the toolbar with the given id. |
382 | * Returns the separator's index | 390 | * Returns the separator's index |
@@ -464,9 +472,9 @@ public: | |||
464 | * Sets a button icon from a QIconSet. | 472 | * Sets a button icon from a QIconSet. |
465 | * | 473 | * |
466 | * Can be used while button is visible. | 474 | * Can be used while button is visible. |
467 | */ | 475 | */ |
468 | void setButtonIconSet( int id, const QIconSet& iconset ); | 476 | void setButtonIconSet( int id, const QIcon& iconset ); |
469 | 477 | ||
470 | /** | 478 | /** |
471 | * Sets a delayed popup for a button. | 479 | * Sets a delayed popup for a button. |
472 | * | 480 | * |
@@ -490,9 +498,9 @@ public: | |||
490 | * You may add popups which are derived from @ref QPopupMenu. You may | 498 | * You may add popups which are derived from @ref QPopupMenu. You may |
491 | * add popups that are already in the menu bar or are submenus of | 499 | * add popups that are already in the menu bar or are submenus of |
492 | * other popups. | 500 | * other popups. |
493 | */ | 501 | */ |
494 | void setDelayedPopup (int id , QPopupMenu *_popup, bool toggle = false); | 502 | void setDelayedPopup (int id , Q3PopupMenu *_popup, bool toggle = false); |
495 | 503 | ||
496 | /** | 504 | /** |
497 | * Turns a button into an autorepeat button. | 505 | * Turns a button into an autorepeat button. |
498 | * | 506 | * |
@@ -1059,9 +1067,9 @@ public: | |||
1059 | static IconText iconTextSetting(); | 1067 | static IconText iconTextSetting(); |
1060 | 1068 | ||
1061 | public slots: | 1069 | public slots: |
1062 | virtual void setIconText( const QString &txt ) | 1070 | virtual void setIconText( const QString &txt ) |
1063 | { QToolBar::setIconText( txt ); } | 1071 | { Q3ToolBar::setIconText( txt ); } |
1064 | void slotRepaint(); | 1072 | void slotRepaint(); |
1065 | 1073 | ||
1066 | protected: | 1074 | protected: |
1067 | void mousePressEvent( QMouseEvent * ); | 1075 | void mousePressEvent( QMouseEvent * ); |
@@ -1076,9 +1084,9 @@ private slots: | |||
1076 | void rebuildLayout(); | 1084 | void rebuildLayout(); |
1077 | void slotReadConfig (); | 1085 | void slotReadConfig (); |
1078 | void slotAppearanceChanged(); | 1086 | void slotAppearanceChanged(); |
1079 | void slotIconChanged(int); | 1087 | void slotIconChanged(int); |
1080 | void toolBarPosChanged( QToolBar *tb ); | 1088 | void toolBarPosChanged( Q3ToolBar *tb ); |
1081 | void slotContextAboutToShow(); | 1089 | void slotContextAboutToShow(); |
1082 | void widgetDestroyed(); | 1090 | void widgetDestroyed(); |
1083 | 1091 | ||
1084 | private: | 1092 | private: |
@@ -1089,18 +1097,18 @@ private: | |||
1089 | void insertWidgetInternal( QWidget *w, int &index, int id ); | 1097 | void insertWidgetInternal( QWidget *w, int &index, int id ); |
1090 | void removeWidgetInternal( QWidget *w ); | 1098 | void removeWidgetInternal( QWidget *w ); |
1091 | void getAttributes( QString &position, QString &icontext, int &index ); | 1099 | void getAttributes( QString &position, QString &icontext, int &index ); |
1092 | //US KPopupMenu *contextMenu(); | 1100 | //US KPopupMenu *contextMenu(); |
1093 | QPopupMenu *contextMenu(); | 1101 | Q3PopupMenu *contextMenu(); |
1094 | 1102 | ||
1095 | QMap<QWidget*, int > widget2id; | 1103 | QMap<QWidget*, int > widget2id; |
1096 | typedef QMap<int, QWidget* > Id2WidgetMap; | 1104 | typedef QMap<int, QWidget* > Id2WidgetMap; |
1097 | Id2WidgetMap id2widget; | 1105 | Id2WidgetMap id2widget; |
1098 | //US KPopupMenu *context; | 1106 | //US KPopupMenu *context; |
1099 | QPopupMenu *context; | 1107 | Q3PopupMenu *context; |
1100 | QPtrList<QWidget> widgets; | 1108 | Q3PtrList<QWidget> widgets; |
1101 | QTimer *layoutTimer; | 1109 | QTimer *layoutTimer; |
1102 | QGuardedPtr<QWidget> stretchableWidget, rightAligned; | 1110 | QPointer<QWidget> stretchableWidget, rightAligned; |
1103 | protected: | 1111 | protected: |
1104 | virtual void virtual_hook( int id, void* data ); | 1112 | virtual void virtual_hook( int id, void* data ); |
1105 | private: | 1113 | private: |
1106 | KToolBarPrivate *d; | 1114 | KToolBarPrivate *d; |
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 | |||
@@ -32,12 +32,16 @@ | |||
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qdrawutil.h> | 33 | #include <qdrawutil.h> |
34 | #include <qtooltip.h> | 34 | #include <qtooltip.h> |
35 | #include <qbitmap.h> | 35 | #include <qbitmap.h> |
36 | #include <qpopupmenu.h> | 36 | #include <q3popupmenu.h> |
37 | #include <qcursor.h> | 37 | #include <qcursor.h> |
38 | #include <qpainter.h> | 38 | #include <qpainter.h> |
39 | #include <qlayout.h> | 39 | #include <qlayout.h> |
40 | //Added by qt3to4: | ||
41 | #include <QPixmap> | ||
42 | #include <QMouseEvent> | ||
43 | #include <QEvent> | ||
40 | 44 | ||
41 | #include <kapplication.h> | 45 | #include <kapplication.h> |
42 | #include <kdebug.h> | 46 | #include <kdebug.h> |
43 | #include <kglobal.h> | 47 | #include <kglobal.h> |
@@ -47,9 +51,9 @@ | |||
47 | 51 | ||
48 | // needed to get our instance | 52 | // needed to get our instance |
49 | #include <kmainwindow.h> | 53 | #include <kmainwindow.h> |
50 | 54 | ||
51 | template class QIntDict<KToolBarButton>; | 55 | template class Q3IntDict<KToolBarButton>; |
52 | 56 | ||
53 | class KToolBarButtonPrivate | 57 | class KToolBarButtonPrivate |
54 | { | 58 | { |
55 | public: | 59 | public: |
@@ -114,9 +118,9 @@ KToolBarButton::KToolBarButton( const QString& _icon, int _id, | |||
114 | d->m_parent = (KToolBar*)_parent; | 118 | d->m_parent = (KToolBar*)_parent; |
115 | QToolButton::setTextLabel(_txt); | 119 | QToolButton::setTextLabel(_txt); |
116 | //US d->m_instance = _instance; | 120 | //US d->m_instance = _instance; |
117 | 121 | ||
118 | setFocusPolicy( NoFocus ); | 122 | setFocusPolicy( Qt::NoFocus ); |
119 | 123 | ||
120 | // connect all of our slots and start trapping events | 124 | // connect all of our slots and start trapping events |
121 | connect(d->m_parent, SIGNAL( modechange() ), | 125 | connect(d->m_parent, SIGNAL( modechange() ), |
122 | this, SLOT( modeChange() )); | 126 | this, SLOT( modeChange() )); |
@@ -145,9 +149,9 @@ KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id, | |||
145 | d->m_id = _id; | 149 | d->m_id = _id; |
146 | d->m_parent = (KToolBar *) _parent; | 150 | d->m_parent = (KToolBar *) _parent; |
147 | QToolButton::setTextLabel(txt); | 151 | QToolButton::setTextLabel(txt); |
148 | 152 | ||
149 | setFocusPolicy( NoFocus ); | 153 | setFocusPolicy( Qt::NoFocus ); |
150 | 154 | ||
151 | // connect all of our slots and start trapping events | 155 | // connect all of our slots and start trapping events |
152 | connect(d->m_parent, SIGNAL( modechange()), | 156 | connect(d->m_parent, SIGNAL( modechange()), |
153 | this, SLOT(modeChange())); | 157 | this, SLOT(modeChange())); |
@@ -160,9 +164,9 @@ KToolBarButton::KToolBarButton( const QPixmap& pixmap, int _id, | |||
160 | this, SLOT( slotReleased() )); | 164 | this, SLOT( slotReleased() )); |
161 | installEventFilter(this); | 165 | installEventFilter(this); |
162 | 166 | ||
163 | // set our pixmap and do our initial setup | 167 | // set our pixmap and do our initial setup |
164 | setIconSet( QIconSet( pixmap )); | 168 | setIconSet( QIcon( pixmap )); |
165 | modeChange(); | 169 | modeChange(); |
166 | } | 170 | } |
167 | 171 | ||
168 | KToolBarButton::~KToolBarButton() | 172 | KToolBarButton::~KToolBarButton() |
@@ -291,9 +295,9 @@ void KToolBarButton::setIcon( const QString &icon ) | |||
291 | */ | 295 | */ |
292 | QToolButton::setIconSet(KGlobal::iconLoader()->loadIconSet(d->m_iconName)); | 296 | QToolButton::setIconSet(KGlobal::iconLoader()->loadIconSet(d->m_iconName)); |
293 | } | 297 | } |
294 | 298 | ||
295 | void KToolBarButton::setIconSet( const QIconSet &iconset ) | 299 | void KToolBarButton::setIconSet( const QIcon &iconset ) |
296 | { | 300 | { |
297 | QToolButton::setIconSet( iconset ); | 301 | QToolButton::setIconSet( iconset ); |
298 | } | 302 | } |
299 | 303 | ||
@@ -304,70 +308,70 @@ void KToolBarButton::setPixmap( const QPixmap &pixmap ) | |||
304 | { | 308 | { |
305 | QToolButton::setPixmap( pixmap ); | 309 | QToolButton::setPixmap( pixmap ); |
306 | return; | 310 | return; |
307 | } | 311 | } |
308 | QIconSet set = iconSet(); | 312 | QIcon set = iconSet(); |
309 | set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Active ); | 313 | set.setPixmap( pixmap, QIcon::Automatic, QIcon::Active ); |
310 | QToolButton::setIconSet( set ); | 314 | QToolButton::setIconSet( set ); |
311 | } | 315 | } |
312 | 316 | ||
313 | void KToolBarButton::setDefaultPixmap( const QPixmap &pixmap ) | 317 | void KToolBarButton::setDefaultPixmap( const QPixmap &pixmap ) |
314 | { | 318 | { |
315 | QIconSet set = iconSet(); | 319 | QIcon set = iconSet(); |
316 | set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Normal ); | 320 | set.setPixmap( pixmap, QIcon::Automatic, QIcon::Normal ); |
317 | QToolButton::setIconSet( set ); | 321 | QToolButton::setIconSet( set ); |
318 | } | 322 | } |
319 | 323 | ||
320 | void KToolBarButton::setDisabledPixmap( const QPixmap &pixmap ) | 324 | void KToolBarButton::setDisabledPixmap( const QPixmap &pixmap ) |
321 | { | 325 | { |
322 | QIconSet set = iconSet(); | 326 | QIcon set = iconSet(); |
323 | set.setPixmap( pixmap, QIconSet::Automatic, QIconSet::Disabled ); | 327 | set.setPixmap( pixmap, QIcon::Automatic, QIcon::Disabled ); |
324 | QToolButton::setIconSet( set ); | 328 | QToolButton::setIconSet( set ); |
325 | } | 329 | } |
326 | 330 | ||
327 | void KToolBarButton::setDefaultIcon( const QString& icon ) | 331 | void KToolBarButton::setDefaultIcon( const QString& icon ) |
328 | { | 332 | { |
329 | QIconSet set = iconSet(); | 333 | QIcon set = iconSet(); |
330 | QPixmap pm; | 334 | QPixmap pm; |
331 | if (!strcmp(d->m_parent->name(), "mainToolBar")) | 335 | if (!strcmp(d->m_parent->name(), "mainToolBar")) |
332 | pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar, | 336 | pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar, |
333 | d->m_iconSize ); | 337 | d->m_iconSize ); |
334 | else | 338 | else |
335 | pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, | 339 | pm = /*US d->m_instance->iconLoader()*/KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, |
336 | d->m_iconSize ); | 340 | d->m_iconSize ); |
337 | set.setPixmap( pm, QIconSet::Automatic, QIconSet::Normal ); | 341 | set.setPixmap( pm, QIcon::Automatic, QIcon::Normal ); |
338 | QToolButton::setIconSet( set ); | 342 | QToolButton::setIconSet( set ); |
339 | } | 343 | } |
340 | 344 | ||
341 | void KToolBarButton::setDisabledIcon( const QString& icon ) | 345 | void KToolBarButton::setDisabledIcon( const QString& icon ) |
342 | { | 346 | { |
343 | QIconSet set = iconSet(); | 347 | QIcon set = iconSet(); |
344 | QPixmap pm; | 348 | QPixmap pm; |
345 | if (!strcmp(d->m_parent->name(), "mainToolBar")) | 349 | if (!strcmp(d->m_parent->name(), "mainToolBar")) |
346 | pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar, | 350 | pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::MainToolbar, |
347 | d->m_iconSize ); | 351 | d->m_iconSize ); |
348 | else | 352 | else |
349 | pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, | 353 | pm = /*US d->m_instance->iconLoader()*/ KGlobal::iconLoader()->loadIcon( icon, KIcon::Toolbar, |
350 | d->m_iconSize ); | 354 | d->m_iconSize ); |
351 | set.setPixmap( pm, QIconSet::Automatic, QIconSet::Disabled ); | 355 | set.setPixmap( pm, QIcon::Automatic, QIcon::Disabled ); |
352 | QToolButton::setIconSet( set ); | 356 | QToolButton::setIconSet( set ); |
353 | } | 357 | } |
354 | 358 | ||
355 | QPopupMenu *KToolBarButton::popup() | 359 | QMenu *KToolBarButton::popup() |
356 | { | 360 | { |
357 | // obsolete | 361 | // obsolete |
358 | // KDE4: remove me | 362 | // KDE4: remove me |
359 | return QToolButton::popup(); | 363 | return QToolButton::popup(); |
360 | } | 364 | } |
361 | 365 | ||
362 | void KToolBarButton::setPopup(QPopupMenu *p, bool) | 366 | void KToolBarButton::setPopup(Q3PopupMenu *p, bool) |
363 | { | 367 | { |
364 | QToolButton::setPopup(p); | 368 | QToolButton::setPopup(p); |
365 | QToolButton::setPopupDelay(1); | 369 | QToolButton::setPopupDelay(1); |
366 | } | 370 | } |
367 | 371 | ||
368 | 372 | ||
369 | void KToolBarButton::setDelayedPopup (QPopupMenu *p, bool) | 373 | void KToolBarButton::setDelayedPopup (Q3PopupMenu *p, bool) |
370 | { | 374 | { |
371 | QToolButton::setPopup(p); | 375 | QToolButton::setPopup(p); |
372 | //US QToolButton::setPopupDelay(QApplication::startDragTime()); | 376 | //US QToolButton::setPopupDelay(QApplication::startDragTime()); |
373 | } | 377 | } |
@@ -450,23 +454,29 @@ bool KToolBarButton::eventFilter(QObject *o, QEvent *ev) | |||
450 | 454 | ||
451 | void KToolBarButton::drawButton( QPainter *_painter ) | 455 | void KToolBarButton::drawButton( QPainter *_painter ) |
452 | { | 456 | { |
453 | #ifdef DESKTOP_VERSION | 457 | #ifdef DESKTOP_VERSION |
454 | QStyle::SFlags flags = QStyle::Style_Default; | 458 | QStyle::State flags = QStyle::State_None; |
455 | QStyle::SCFlags active = QStyle::SC_None; | 459 | QStyle::SubControls active = QStyle::SC_None; |
456 | 460 | ||
457 | if (isDown()) { | 461 | if (isDown()) { |
458 | flags |= QStyle::Style_Down; | 462 | flags |= QStyle::State_DownArrow; |
459 | active |= QStyle::SC_ToolButton; | 463 | active |= QStyle::SC_ToolButton; |
460 | } | 464 | } |
461 | if (isEnabled()) flags |= QStyle::Style_Enabled; | 465 | if (isEnabled()) flags |= QStyle::State_Enabled; |
462 | if (isOn()) flags |= QStyle::Style_On; | 466 | if (isOn()) flags |= QStyle::State_On; |
463 | if (isEnabled() && d->m_isRaised)flags |= QStyle::Style_Raised; | 467 | if (isEnabled() && d->m_isRaised)flags |= QStyle::State_Raised; |
464 | if (hasFocus())flags |= QStyle::Style_HasFocus; | 468 | if (hasFocus())flags |= QStyle::State_HasFocus; |
469 | |||
470 | QStyleOptionToolButton qsotb; | ||
471 | qsotb.initFrom(this); | ||
472 | qsotb.state = flags; | ||
473 | qsotb.activeSubControls = active; | ||
474 | qsotb.rect = rect(); | ||
475 | qsotb.palette = palette(); | ||
465 | 476 | ||
466 | // Draw a styled toolbutton | 477 | // Draw a styled toolbutton |
467 | style().drawComplexControl(QStyle::CC_ToolButton, _painter, this, rect(), | 478 | style()->drawComplexControl(QStyle::CC_ToolButton, &qsotb, _painter, this); |
468 | colorGroup(), flags, QStyle::SC_ToolButton, active, QStyleOption()); | ||
469 | 479 | ||
470 | #else | 480 | #else |
471 | style().drawToolButton(_painter, rect().x(), rect().y(), rect().width(), rect().height(), colorGroup()); | 481 | style().drawToolButton(_painter, rect().x(), rect().y(), rect().width(), rect().height(), colorGroup()); |
472 | #endif | 482 | #endif |
@@ -483,11 +493,11 @@ void KToolBarButton::drawButton( QPainter *_painter ) | |||
483 | isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : | 493 | isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : |
484 | QIconSet::Disabled, | 494 | QIconSet::Disabled, |
485 | isOn() ? QIconSet::On : QIconSet::Off ); | 495 | isOn() ? QIconSet::On : QIconSet::Off ); |
486 | */ | 496 | */ |
487 | QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, | 497 | QPixmap pixmap = iconSet().pixmap( QIcon::Automatic, |
488 | isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : | 498 | isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) : |
489 | QIconSet::Disabled); | 499 | QIcon::Disabled); |
490 | 500 | ||
491 | if( !pixmap.isNull()) | 501 | if( !pixmap.isNull()) |
492 | { | 502 | { |
493 | dx = ( width() - pixmap.width() ) / 2; | 503 | dx = ( width() - pixmap.width() ) / 2; |
@@ -507,11 +517,11 @@ void KToolBarButton::drawButton( QPainter *_painter ) | |||
507 | isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : | 517 | isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : |
508 | QIconSet::Disabled, | 518 | QIconSet::Disabled, |
509 | isOn() ? QIconSet::On : QIconSet::Off ); | 519 | isOn() ? QIconSet::On : QIconSet::Off ); |
510 | */ | 520 | */ |
511 | QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, | 521 | QPixmap pixmap = iconSet().pixmap( QIcon::Automatic, |
512 | isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : | 522 | isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) : |
513 | QIconSet::Disabled); | 523 | QIcon::Disabled); |
514 | 524 | ||
515 | if( !pixmap.isNull()) | 525 | if( !pixmap.isNull()) |
516 | { | 526 | { |
517 | dx = 4; | 527 | dx = 4; |
@@ -525,9 +535,9 @@ void KToolBarButton::drawButton( QPainter *_painter ) | |||
525 | } | 535 | } |
526 | 536 | ||
527 | if (!textLabel().isNull()) | 537 | if (!textLabel().isNull()) |
528 | { | 538 | { |
529 | textFlags = AlignVCenter|AlignLeft; | 539 | textFlags = Qt::AlignVCenter|Qt::AlignLeft; |
530 | if (!pixmap.isNull()) | 540 | if (!pixmap.isNull()) |
531 | dx = 4 + pixmap.width() + 2; | 541 | dx = 4 + pixmap.width() + 2; |
532 | else | 542 | else |
533 | dx = 4; | 543 | dx = 4; |
@@ -543,9 +553,9 @@ void KToolBarButton::drawButton( QPainter *_painter ) | |||
543 | else if (d->m_iconText == KToolBar::TextOnly) | 553 | else if (d->m_iconText == KToolBar::TextOnly) |
544 | { | 554 | { |
545 | if (!textLabel().isNull()) | 555 | if (!textLabel().isNull()) |
546 | { | 556 | { |
547 | textFlags = AlignVCenter|AlignLeft; | 557 | textFlags = Qt::AlignVCenter|Qt::AlignLeft; |
548 | dx = (width() - fm.width(textLabel())) / 2; | 558 | dx = (width() - fm.width(textLabel())) / 2; |
549 | dy = (height() - fm.lineSpacing()) / 2; | 559 | dy = (height() - fm.lineSpacing()) / 2; |
550 | if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) | 560 | if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) |
551 | { | 561 | { |
@@ -562,11 +572,11 @@ void KToolBarButton::drawButton( QPainter *_painter ) | |||
562 | isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : | 572 | isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : |
563 | QIconSet::Disabled, | 573 | QIconSet::Disabled, |
564 | isOn() ? QIconSet::On : QIconSet::Off ); | 574 | isOn() ? QIconSet::On : QIconSet::Off ); |
565 | */ | 575 | */ |
566 | QPixmap pixmap = iconSet().pixmap( QIconSet::Automatic, | 576 | QPixmap pixmap = iconSet().pixmap( QIcon::Automatic, |
567 | isEnabled() ? (d->m_isActive ? QIconSet::Active : QIconSet::Normal) : | 577 | isEnabled() ? (d->m_isActive ? QIcon::Active : QIcon::Normal) : |
568 | QIconSet::Disabled); | 578 | QIcon::Disabled); |
569 | 579 | ||
570 | if( !pixmap.isNull()) | 580 | if( !pixmap.isNull()) |
571 | { | 581 | { |
572 | dx = (width() - pixmap.width()) / 2; | 582 | dx = (width() - pixmap.width()) / 2; |
@@ -580,9 +590,9 @@ void KToolBarButton::drawButton( QPainter *_painter ) | |||
580 | } | 590 | } |
581 | 591 | ||
582 | if (!textLabel().isNull()) | 592 | if (!textLabel().isNull()) |
583 | { | 593 | { |
584 | textFlags = AlignBottom|AlignHCenter; | 594 | textFlags = Qt::AlignBottom|Qt::AlignHCenter; |
585 | dx = (width() - fm.width(textLabel())) / 2; | 595 | dx = (width() - fm.width(textLabel())) / 2; |
586 | dy = height() - fm.lineSpacing() - 4; | 596 | dy = height() - fm.lineSpacing() - 4; |
587 | 597 | ||
588 | if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) | 598 | if ( isDown() /*US && style().styleHint(QStyle::SH_GUIStyle) == WindowsStyle*/ ) |
@@ -609,16 +619,20 @@ void KToolBarButton::drawButton( QPainter *_painter ) | |||
609 | 619 | ||
610 | if (QToolButton::popup()) | 620 | if (QToolButton::popup()) |
611 | { | 621 | { |
612 | #ifdef DESKTOP_VERSION | 622 | #ifdef DESKTOP_VERSION |
613 | QStyle::SFlags arrowFlags = QStyle::Style_Default; | 623 | QStyle::State arrowFlags = QStyle::State_None; |
624 | |||
625 | if (isDown())arrowFlags |= QStyle::State_DownArrow; | ||
626 | if (isEnabled()) arrowFlags |= QStyle::State_Enabled; | ||
614 | 627 | ||
615 | if (isDown())arrowFlags |= QStyle::Style_Down; | 628 | QStyleOption qso; |
616 | if (isEnabled()) arrowFlags |= QStyle::Style_Enabled; | 629 | qso.initFrom(this); |
630 | qso.state = arrowFlags; | ||
631 | qso.rect = QRect(width()-7, height()-7, 7, 7); | ||
632 | qso.palette = palette(); | ||
617 | 633 | ||
618 | style().drawPrimitive(QStyle::PE_ArrowDown, _painter, | 634 | style()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &qso, _painter); |
619 | QRect(width()-7, height()-7, 7, 7), colorGroup(), | ||
620 | arrowFlags, QStyleOption() ); | ||
621 | #else | 635 | #else |
622 | style().drawArrow(_painter, Qt::DownArrow, isDown(), | 636 | style().drawArrow(_painter, Qt::DownArrow, isDown(), |
623 | width()-7, height()-7, 7, 7, colorGroup(), isEnabled() ); | 637 | width()-7, height()-7, 7, 7, colorGroup(), isEnabled() ); |
624 | #endif | 638 | #endif |
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 | |||
@@ -25,17 +25,20 @@ | |||
25 | #define _KTOOLBARBUTTON_H | 25 | #define _KTOOLBARBUTTON_H |
26 | 26 | ||
27 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
28 | #include <qtoolbutton.h> | 28 | #include <qtoolbutton.h> |
29 | #include <qintdict.h> | 29 | #include <q3intdict.h> |
30 | #include <qstring.h> | 30 | #include <qstring.h> |
31 | //Added by qt3to4: | ||
32 | #include <QEvent> | ||
33 | #include <Q3PopupMenu> | ||
31 | #include <kglobal.h> | 34 | #include <kglobal.h> |
32 | 35 | ||
33 | class KToolBar; | 36 | class KToolBar; |
34 | class KToolBarButtonPrivate; | 37 | class KToolBarButtonPrivate; |
35 | //USclass KInstance; | 38 | //USclass KInstance; |
36 | class QEvent; | 39 | class QEvent; |
37 | class QPopupMenu; | 40 | class Q3PopupMenu; |
38 | class QPainter; | 41 | class QPainter; |
39 | 42 | ||
40 | /** | 43 | /** |
41 | * A toolbar button. This is used internally by @ref KToolBar, use the | 44 | * A toolbar button. This is used internally by @ref KToolBar, use the |
@@ -149,9 +152,9 @@ public: | |||
149 | * If you call this you don't need to call any of the other methods | 152 | * If you call this you don't need to call any of the other methods |
150 | * that set icons or pixmaps. | 153 | * that set icons or pixmaps. |
151 | * @param iconset The iconset to use | 154 | * @param iconset The iconset to use |
152 | */ | 155 | */ |
153 | virtual void setIconSet( const QIconSet &iconset ); | 156 | virtual void setIconSet( const QIcon &iconset ); |
154 | 157 | ||
155 | #ifndef KDE_NO_COMPAT | 158 | #ifndef KDE_NO_COMPAT |
156 | /** | 159 | /** |
157 | * @deprecated | 160 | * @deprecated |
@@ -208,9 +211,9 @@ public: | |||
208 | 211 | ||
209 | /** | 212 | /** |
210 | * Return a pointer to this button's popup menu (if it exists) | 213 | * Return a pointer to this button's popup menu (if it exists) |
211 | */ | 214 | */ |
212 | QPopupMenu *popup(); | 215 | QMenu *popup(); |
213 | 216 | ||
214 | /** | 217 | /** |
215 | * Returns the button's id. | 218 | * Returns the button's id. |
216 | * @since 3.2 | 219 | * @since 3.2 |
@@ -223,9 +226,9 @@ public: | |||
223 | * behavior. | 226 | * behavior. |
224 | * | 227 | * |
225 | * @param p The new popup menu | 228 | * @param p The new popup menu |
226 | */ | 229 | */ |
227 | void setPopup (QPopupMenu *p, bool unused = false); | 230 | void setPopup (Q3PopupMenu *p, bool unused = false); |
228 | 231 | ||
229 | /** | 232 | /** |
230 | * Gives this button a delayed popup menu. | 233 | * Gives this button a delayed popup menu. |
231 | * | 234 | * |
@@ -234,9 +237,9 @@ public: | |||
234 | * held down for about half a second. | 237 | * held down for about half a second. |
235 | * | 238 | * |
236 | * @param p the new popup menu | 239 | * @param p the new popup menu |
237 | */ | 240 | */ |
238 | void setDelayedPopup(QPopupMenu *p, bool unused = false); | 241 | void setDelayedPopup(Q3PopupMenu *p, bool unused = false); |
239 | 242 | ||
240 | /** | 243 | /** |
241 | * Turn this button into a radio button | 244 | * Turn this button into a radio button |
242 | * | 245 | * |
@@ -302,9 +305,9 @@ private: | |||
302 | * List of @ref KToolBarButton objects. | 305 | * List of @ref KToolBarButton objects. |
303 | * @internal | 306 | * @internal |
304 | * @version $Id$ | 307 | * @version $Id$ |
305 | */ | 308 | */ |
306 | class KToolBarButtonList : public QIntDict<KToolBarButton> | 309 | class KToolBarButtonList : public Q3IntDict<KToolBarButton> |
307 | { | 310 | { |
308 | public: | 311 | public: |
309 | KToolBarButtonList(); | 312 | KToolBarButtonList(); |
310 | ~KToolBarButtonList() {} | 313 | ~KToolBarButtonList() {} |
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 | |||
@@ -17,9 +17,11 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include "ktoolbarhandler.h" | 19 | #include "ktoolbarhandler.h" |
20 | 20 | ||
21 | #include <qpopupmenu.h> | 21 | #include <q3popupmenu.h> |
22 | //Added by qt3to4: | ||
23 | #include <Q3PtrList> | ||
22 | #include <kapplication.h> | 24 | #include <kapplication.h> |
23 | #include <ktoolbar.h> | 25 | #include <ktoolbar.h> |
24 | #include <kmainwindow.h> | 26 | #include <kmainwindow.h> |
25 | #include <klocale.h> | 27 | #include <klocale.h> |
@@ -43,9 +45,9 @@ namespace | |||
43 | 45 | ||
44 | class BarActionBuilder | 46 | class BarActionBuilder |
45 | { | 47 | { |
46 | public: | 48 | public: |
47 | BarActionBuilder( KActionCollection *actionCollection, KMainWindow *mainWindow, QPtrList<KToolBar> &oldToolBarList ) | 49 | BarActionBuilder( KActionCollection *actionCollection, KMainWindow *mainWindow, Q3PtrList<KToolBar> &oldToolBarList ) |
48 | : m_actionCollection( actionCollection ), m_mainWindow( mainWindow ), m_needsRebuild( false ) | 50 | : m_actionCollection( actionCollection ), m_mainWindow( mainWindow ), m_needsRebuild( false ) |
49 | { | 51 | { |
50 | /*US | 52 | /*US |
51 | QPtrList<QDockWindow> dockWindows = m_mainWindow->dockWindows(); | 53 | QPtrList<QDockWindow> dockWindows = m_mainWindow->dockWindows(); |
@@ -69,18 +71,18 @@ namespace | |||
69 | } | 71 | } |
70 | 72 | ||
71 | bool needsRebuild() const { return m_needsRebuild; } | 73 | bool needsRebuild() const { return m_needsRebuild; } |
72 | 74 | ||
73 | QPtrList<KAction> create() | 75 | Q3PtrList<KAction> create() |
74 | { | 76 | { |
75 | if ( !m_needsRebuild ) | 77 | if ( !m_needsRebuild ) |
76 | return QPtrList<KAction>(); | 78 | return Q3PtrList<KAction>(); |
77 | 79 | ||
78 | QPtrListIterator<KToolBar> toolBarIt( m_toolBars ); | 80 | Q3PtrListIterator<KToolBar> toolBarIt( m_toolBars ); |
79 | for ( ; toolBarIt.current(); ++toolBarIt ) | 81 | for ( ; toolBarIt.current(); ++toolBarIt ) |
80 | handleToolBar( toolBarIt.current() ); | 82 | handleToolBar( toolBarIt.current() ); |
81 | 83 | ||
82 | QPtrList<KAction> actions; | 84 | Q3PtrList<KAction> actions; |
83 | 85 | ||
84 | if ( m_toolBarActions.count() == 0 ) | 86 | if ( m_toolBarActions.count() == 0 ) |
85 | return actions; | 87 | return actions; |
86 | 88 | ||
@@ -90,17 +92,17 @@ namespace | |||
90 | } | 92 | } |
91 | 93 | ||
92 | KActionMenu *menuAction = new KActionMenu( i18n( "Toolbars" ), m_actionCollection, "toolbars_submenu_action" ); | 94 | KActionMenu *menuAction = new KActionMenu( i18n( "Toolbars" ), m_actionCollection, "toolbars_submenu_action" ); |
93 | 95 | ||
94 | QPtrListIterator<KAction> actionIt( m_toolBarActions ); | 96 | Q3PtrListIterator<KAction> actionIt( m_toolBarActions ); |
95 | for ( ; actionIt.current(); ++actionIt ) | 97 | for ( ; actionIt.current(); ++actionIt ) |
96 | menuAction->insert( actionIt.current() ); | 98 | menuAction->insert( actionIt.current() ); |
97 | 99 | ||
98 | actions.append( menuAction ); | 100 | actions.append( menuAction ); |
99 | return actions; | 101 | return actions; |
100 | } | 102 | } |
101 | 103 | ||
102 | const QPtrList<KToolBar> &toolBars() const { return m_toolBars; } | 104 | const Q3PtrList<KToolBar> &toolBars() const { return m_toolBars; } |
103 | 105 | ||
104 | private: | 106 | private: |
105 | void handleToolBar( KToolBar *toolBar ) | 107 | void handleToolBar( KToolBar *toolBar ) |
106 | { | 108 | { |
@@ -114,10 +116,10 @@ namespace | |||
114 | 116 | ||
115 | KActionCollection *m_actionCollection; | 117 | KActionCollection *m_actionCollection; |
116 | KMainWindow *m_mainWindow; | 118 | KMainWindow *m_mainWindow; |
117 | 119 | ||
118 | QPtrList<KToolBar> m_toolBars; | 120 | Q3PtrList<KToolBar> m_toolBars; |
119 | QPtrList<KAction> m_toolBarActions; | 121 | Q3PtrList<KAction> m_toolBarActions; |
120 | 122 | ||
121 | bool m_needsRebuild : 1; | 123 | bool m_needsRebuild : 1; |
122 | }; | 124 | }; |
123 | } | 125 | } |
@@ -223,9 +225,9 @@ void ToolBarHandler::init( KMainWindow *mainWindow ) | |||
223 | } | 225 | } |
224 | 226 | ||
225 | void ToolBarHandler::connectToActionContainers() | 227 | void ToolBarHandler::connectToActionContainers() |
226 | { | 228 | { |
227 | QPtrListIterator<KAction> actionIt( m_actions ); | 229 | Q3PtrListIterator<KAction> actionIt( m_actions ); |
228 | for ( ; actionIt.current(); ++actionIt ) | 230 | for ( ; actionIt.current(); ++actionIt ) |
229 | connectToActionContainer( actionIt.current() ); | 231 | connectToActionContainer( actionIt.current() ); |
230 | } | 232 | } |
231 | 233 | ||
@@ -238,9 +240,9 @@ void ToolBarHandler::connectToActionContainer( KAction *action ) | |||
238 | 240 | ||
239 | void ToolBarHandler::connectToActionContainer( QWidget *container ) | 241 | void ToolBarHandler::connectToActionContainer( QWidget *container ) |
240 | { | 242 | { |
241 | //US QPopupMenu *popupMenu = dynamic_cast<QPopupMenu *>( container ); | 243 | //US QPopupMenu *popupMenu = dynamic_cast<QPopupMenu *>( container ); |
242 | QPopupMenu *popupMenu = (QPopupMenu *)( container ); | 244 | Q3PopupMenu *popupMenu = (Q3PopupMenu *)( container ); |
243 | if ( !popupMenu ) | 245 | if ( !popupMenu ) |
244 | return; | 246 | return; |
245 | 247 | ||
246 | connect( popupMenu, SIGNAL( aboutToShow() ), | 248 | connect( popupMenu, SIGNAL( aboutToShow() ), |
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 | |||
@@ -19,10 +19,10 @@ | |||
19 | #ifndef KBARHANDLER_H | 19 | #ifndef KBARHANDLER_H |
20 | #define KBARHANDLER_H | 20 | #define KBARHANDLER_H |
21 | 21 | ||
22 | #include <qobject.h> | 22 | #include <qobject.h> |
23 | #include <qguardedptr.h> | 23 | #include <qpointer.h> |
24 | #include <qptrlist.h> | 24 | #include <q3ptrlist.h> |
25 | #include <kxmlguiclient.h> | 25 | #include <kxmlguiclient.h> |
26 | #include <kaction.h> | 26 | #include <kaction.h> |
27 | 27 | ||
28 | class KMainWindow; | 28 | class KMainWindow; |
@@ -56,11 +56,11 @@ private: | |||
56 | 56 | ||
57 | struct Data; | 57 | struct Data; |
58 | Data *d; | 58 | Data *d; |
59 | 59 | ||
60 | QGuardedPtr<KMainWindow> m_mainWindow; | 60 | QPointer<KMainWindow> m_mainWindow; |
61 | QPtrList<KAction> m_actions; | 61 | Q3PtrList<KAction> m_actions; |
62 | QPtrList<KToolBar> m_toolBars; | 62 | Q3PtrList<KToolBar> m_toolBars; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | } // namespace KDEPrivate | 65 | } // namespace KDEPrivate |
66 | 66 | ||
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 | |||
@@ -38,8 +38,10 @@ | |||
38 | #include <kaction.h> | 38 | #include <kaction.h> |
39 | #include <kapplication.h> | 39 | #include <kapplication.h> |
40 | 40 | ||
41 | #include <assert.h> | 41 | #include <assert.h> |
42 | //Added by qt3to4: | ||
43 | #include <Q3PtrList> | ||
42 | 44 | ||
43 | class KXMLGUIClientPrivate | 45 | class KXMLGUIClientPrivate |
44 | { | 46 | { |
45 | public: | 47 | public: |
@@ -62,9 +64,9 @@ public: | |||
62 | //US QDomDocument m_buildDocument; | 64 | //US QDomDocument m_buildDocument; |
63 | //US KXMLGUIFactory *m_factory; | 65 | //US KXMLGUIFactory *m_factory; |
64 | KXMLGUIClient *m_parent; | 66 | KXMLGUIClient *m_parent; |
65 | //QPtrList<KXMLGUIClient> m_supers; | 67 | //QPtrList<KXMLGUIClient> m_supers; |
66 | QPtrList<KXMLGUIClient> m_children; | 68 | Q3PtrList<KXMLGUIClient> m_children; |
67 | //US KXMLGUIBuilder *m_builder; | 69 | //US KXMLGUIBuilder *m_builder; |
68 | //US QString m_xmlFile; | 70 | //US QString m_xmlFile; |
69 | //US QString m_localXMLFile; | 71 | //US QString m_localXMLFile; |
70 | }; | 72 | }; |
@@ -84,9 +86,9 @@ KXMLGUIClient::~KXMLGUIClient() | |||
84 | { | 86 | { |
85 | if ( d->m_parent ) | 87 | if ( d->m_parent ) |
86 | d->m_parent->removeChildClient( this ); | 88 | d->m_parent->removeChildClient( this ); |
87 | 89 | ||
88 | QPtrListIterator<KXMLGUIClient> it( d->m_children ); | 90 | Q3PtrListIterator<KXMLGUIClient> it( d->m_children ); |
89 | for ( ; it.current(); ++it ) { | 91 | for ( ; it.current(); ++it ) { |
90 | assert( it.current()->d->m_parent == this ); | 92 | assert( it.current()->d->m_parent == this ); |
91 | it.current()->d->m_parent = 0; | 93 | it.current()->d->m_parent = 0; |
92 | } | 94 | } |
@@ -98,9 +100,9 @@ KXMLGUIClient::~KXMLGUIClient() | |||
98 | KAction *KXMLGUIClient::action( const char *name ) const | 100 | KAction *KXMLGUIClient::action( const char *name ) const |
99 | { | 101 | { |
100 | KAction* act = actionCollection()->action( name ); | 102 | KAction* act = actionCollection()->action( name ); |
101 | if ( !act ) { | 103 | if ( !act ) { |
102 | QPtrListIterator<KXMLGUIClient> childIt( d->m_children ); | 104 | Q3PtrListIterator<KXMLGUIClient> childIt( d->m_children ); |
103 | for (; childIt.current(); ++childIt ) { | 105 | for (; childIt.current(); ++childIt ) { |
104 | act = childIt.current()->actionCollection()->action( name ); | 106 | act = childIt.current()->actionCollection()->action( name ); |
105 | if ( act ) | 107 | if ( act ) |
106 | break; | 108 | break; |
@@ -587,9 +589,9 @@ void KXMLGUIClient::removeChildClient( KXMLGUIClient *child ) | |||
587 | d->m_supers.append( super ); | 589 | d->m_supers.append( super ); |
588 | return true; | 590 | return true; |
589 | }*/ | 591 | }*/ |
590 | 592 | ||
591 | const QPtrList<KXMLGUIClient> *KXMLGUIClient::childClients() | 593 | const Q3PtrList<KXMLGUIClient> *KXMLGUIClient::childClients() |
592 | { | 594 | { |
593 | return &d->m_children; | 595 | return &d->m_children; |
594 | } | 596 | } |
595 | /*US | 597 | /*US |
@@ -605,9 +607,9 @@ KXMLGUIBuilder *KXMLGUIClient::clientBuilder() const | |||
605 | return d->m_builder; | 607 | return d->m_builder; |
606 | } | 608 | } |
607 | */ | 609 | */ |
608 | 610 | ||
609 | void KXMLGUIClient::plugActionList( const QString &name, const QPtrList<KAction> &actionList ) | 611 | void KXMLGUIClient::plugActionList( const QString &name, const Q3PtrList<KAction> &actionList ) |
610 | { | 612 | { |
611 | /*US | 613 | /*US |
612 | if ( !d->m_factory ) | 614 | if ( !d->m_factory ) |
613 | return; | 615 | return; |
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 | |||
@@ -20,9 +20,9 @@ | |||
20 | #define _KXMLGUICLIENT_H | 20 | #define _KXMLGUICLIENT_H |
21 | 21 | ||
22 | 22 | ||
23 | //US #include <qdom.h> | 23 | //US #include <qdom.h> |
24 | #include <qptrlist.h> | 24 | #include <q3ptrlist.h> |
25 | #include <qmap.h> | 25 | #include <qmap.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | 27 | ||
28 | class QWidget; | 28 | class QWidget; |
@@ -160,9 +160,9 @@ public: | |||
160 | 160 | ||
161 | /** | 161 | /** |
162 | * Retrieves a list of all child clients. | 162 | * Retrieves a list of all child clients. |
163 | */ | 163 | */ |
164 | const QPtrList<KXMLGUIClient> *childClients(); | 164 | const Q3PtrList<KXMLGUIClient> *childClients(); |
165 | 165 | ||
166 | /** | 166 | /** |
167 | * A client can have an own @ref KXMLGUIBuilder. | 167 | * A client can have an own @ref KXMLGUIBuilder. |
168 | * Use this method to assign your builder instance to the client (so that the | 168 | * Use this method to assign your builder instance to the client (so that the |
@@ -227,9 +227,9 @@ public: | |||
227 | * \note Forgetting to call unplugActionList() before | 227 | * \note Forgetting to call unplugActionList() before |
228 | * plugActionList() would leave the previous actions in the | 228 | * plugActionList() would leave the previous actions in the |
229 | * menu too.. | 229 | * menu too.. |
230 | */ | 230 | */ |
231 | void plugActionList( const QString &name, const QPtrList<KAction> &actionList ); | 231 | void plugActionList( const QString &name, const Q3PtrList<KAction> &actionList ); |
232 | 232 | ||
233 | /** | 233 | /** |
234 | * The complement of \ref plugActionList() ... | 234 | * The complement of \ref plugActionList() ... |
235 | */ | 235 | */ |