summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/klistview.cpp
Unidiff
Diffstat (limited to 'microkde/kdeui/klistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/klistview.cpp337
1 files changed, 176 insertions, 161 deletions
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
@@ -18,13 +18,27 @@
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>
@@ -38,7 +52,7 @@
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"
@@ -46,9 +60,10 @@
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
51class KListView::Tooltip : public QToolTip 66class KListView::Tooltip /* TODO:hacker:TODO: : public QToolTip */
52{ 67{
53public: 68public:
54 Tooltip (KListView* parent, QToolTipGroup* group = 0L); 69 Tooltip (KListView* parent, QToolTipGroup* group = 0L);
@@ -67,7 +82,7 @@ private:
67}; 82};
68 83
69KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) 84KListView::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}
@@ -123,20 +138,20 @@ public:
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;
@@ -170,8 +185,8 @@ public:
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};
@@ -226,7 +241,7 @@ void KListViewLineEdit::load(QListViewItem *i, int c)
226 *tabOrderedRename functionality. 241 *tabOrderedRename functionality.
227 */ 242 */
228 243
229static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir) 244static int nextCol (KListView *pl, Q3ListViewItem *pi, int start, int dir)
230{ 245{
231 if (pi) 246 if (pi)
232 { 247 {
@@ -239,9 +254,9 @@ static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir)
239 return -1; 254 return -1;
240} 255}
241 256
242static QListViewItem *prevItem (QListViewItem *pi) 257static 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.
@@ -252,7 +267,7 @@ static QListViewItem *prevItem (QListViewItem *pi)
252 return NULL; 267 return NULL;
253} 268}
254 269
255static QListViewItem *lastQChild (QListViewItem *pi) 270static Q3ListViewItem *lastQChild (Q3ListViewItem *pi)
256{ 271{
257 if (pi) 272 if (pi)
258 { 273 {
@@ -260,7 +275,7 @@ static QListViewItem *lastQChild (QListViewItem *pi)
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
@@ -328,10 +343,10 @@ bool KListViewLineEdit::event (QEvent *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 }
@@ -406,7 +421,7 @@ void KListViewLineEdit::slotSelectionChanged()
406*/ 421*/
407 422
408KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse ) 423KListView::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
@@ -417,8 +432,8 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse
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()));
@@ -445,17 +460,17 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse
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");
@@ -480,7 +495,7 @@ 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
@@ -503,7 +518,7 @@ bool KListView::isExecuteArea( int x )
503 } 518 }
504} 519}
505 520
506void KListView::slotOnItem( QListViewItem *item ) 521void 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 ) {
@@ -534,12 +549,12 @@ void KListView::slotSettingsChanged(int category)
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();
@@ -611,7 +626,7 @@ void KListView::slotAutoSelect()
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
@@ -632,7 +647,7 @@ void KListView::slotAutoSelect()
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 );
@@ -651,7 +666,7 @@ void KListView::slotAutoSelect()
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) )
@@ -684,7 +699,7 @@ void KListView::slotHeaderChanged()
684 } 699 }
685} 700}
686 701
687void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c) 702void 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) ) ) {
@@ -701,7 +716,7 @@ void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint
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 );
@@ -714,7 +729,7 @@ void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint
714void KListView::focusInEvent( QFocusEvent *fe ) 729void 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)
@@ -747,14 +762,14 @@ void KListView::focusOutEvent( QFocusEvent *fe )
747 emit selectionChanged(); 762 emit selectionChanged();
748 }; 763 };
749 764
750 QListView::focusOutEvent( fe ); 765 Q3ListView::focusOutEvent( fe );
751} 766}
752 767
753void KListView::leaveEvent( QEvent *e ) 768void 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
760bool KListView::event( QEvent *e ) 775bool KListView::event( QEvent *e )
@@ -765,13 +780,13 @@ bool KListView::event( QEvent *e )
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
771void KListView::contentsMousePressEvent( QMouseEvent *e ) 786void 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 );
@@ -793,7 +808,7 @@ void KListView::contentsMousePressEvent( QMouseEvent *e )
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
@@ -801,7 +816,7 @@ void KListView::contentsMousePressEvent( QMouseEvent *e )
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();
@@ -813,18 +828,18 @@ void KListView::contentsMousePressEvent( QMouseEvent *e )
813 } 828 }
814 } 829 }
815 830
816 QListView::contentsMousePressEvent( e ); 831 Q3ListView::contentsMousePressEvent( e );
817} 832}
818 833
819void KListView::contentsMouseMoveEvent( QMouseEvent *e ) 834void 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 )
@@ -853,7 +868,7 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e )
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;
@@ -862,13 +877,13 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e )
862 877
863void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) 878void 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)
@@ -890,7 +905,7 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e )
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
896void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) 911void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e )
@@ -901,8 +916,8 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e )
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
@@ -911,7 +926,7 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e )
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);
@@ -919,11 +934,11 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e )
919 } 934 }
920} 935}
921 936
922void KListView::slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ) 937void 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);
@@ -961,12 +976,12 @@ qDebug("KListView::contentsDropEvent drag&drop not supported yet");
961 976
962} 977}
963 978
964void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) 979void 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())
@@ -979,7 +994,7 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme)
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 {
@@ -1000,7 +1015,7 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme)
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);
@@ -1086,14 +1101,14 @@ int KListView::depthToPixels( int depth )
1086 return treeStepSize() * ( depth + (rootIsDecorated() ? 1 : 0) ) + itemMargin(); 1101 return treeStepSize() * ( depth + (rootIsDecorated() ? 1 : 0) ) + itemMargin();
1087} 1102}
1088 1103
1089void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after) 1104void 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
@@ -1123,8 +1138,8 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte
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
@@ -1146,9 +1161,9 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte
1146 parent = after ? after->parent() : 0L ; 1161 parent = after ? after->parent() : 0L ;
1147} 1162}
1148 1163
1149QListViewItem* KListView::lastChild () const 1164Q3ListViewItem* 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());
@@ -1156,11 +1171,11 @@ QListViewItem* KListView::lastChild () const
1156 return lastchild; 1171 return lastchild;
1157} 1172}
1158 1173
1159QListViewItem *KListView::lastItem() const 1174Q3ListViewItem *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;
@@ -1187,12 +1202,12 @@ qDebug("KListView::startDrag drag&drop not supported yet.");
1187*/ 1202*/
1188} 1203}
1189 1204
1190QDragObject *KListView::dragObject() 1205Q3DragObject *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
1198void KListView::setItemsMovable(bool b) 1213void KListView::setItemsMovable(bool b)
@@ -1246,19 +1261,19 @@ void KListView::setDropVisualizer(bool b)
1246 d->dropVisualizer=b; 1261 d->dropVisualizer=b;
1247} 1262}
1248 1263
1249QPtrList<QListViewItem> KListView::selectedItems() const 1264Q3PtrList<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
1258void KListView::moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after) 1273void 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)
@@ -1296,8 +1311,8 @@ void KListView::setDropVisualizerWidth (int w)
1296 d->mDropVisualizerWidth = w > 0 ? w : 1; 1311 d->mDropVisualizerWidth = w > 0 ? w : 1;
1297} 1312}
1298 1313
1299QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, 1314QRect KListView::drawDropVisualizer(QPainter *p, Q3ListViewItem *parent,
1300 QListViewItem *after) 1315 Q3ListViewItem *after)
1301{ 1316{
1302 QRect insertmarker; 1317 QRect insertmarker;
1303 1318
@@ -1308,7 +1323,7 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent,
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)
@@ -1338,12 +1353,12 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent,
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
1346QRect KListView::drawItemHighlighter(QPainter *painter, QListViewItem *item) 1361QRect KListView::drawItemHighlighter(QPainter *painter, Q3ListViewItem *item)
1347{ 1362{
1348 QRect r; 1363 QRect r;
1349 1364
@@ -1376,7 +1391,7 @@ void KListView::cleanItemHighlighter ()
1376 } 1391 }
1377} 1392}
1378 1393
1379void KListView::rename(QListViewItem *item, int c) 1394void KListView::rename(Q3ListViewItem *item, int c)
1380{ 1395{
1381 if (d->renameable.contains(c)) 1396 if (d->renameable.contains(c))
1382 { 1397 {
@@ -1403,7 +1418,7 @@ void KListView::setRenameable (int col, bool yesno)
1403 d->renameable.remove(col); 1418 d->renameable.remove(col);
1404} 1419}
1405 1420
1406void KListView::doneEditing(QListViewItem *item, int row) 1421void 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);
@@ -1447,12 +1462,12 @@ bool KListView::dropHighlighter() const
1447 return d->dropHighlighter; 1462 return d->dropHighlighter;
1448} 1463}
1449 1464
1450bool KListView::showTooltip(QListViewItem *item, const QPoint &, int column) const 1465bool 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
1455QString KListView::tooltip(QListViewItem *item, int column) const 1470QString KListView::tooltip(Q3ListViewItem *item, int column) const
1456{ 1471{
1457 return item->text(column); 1472 return item->text(column);
1458} 1473}
@@ -1482,7 +1497,7 @@ void KListView::keyPressEvent (QKeyEvent* e)
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}
@@ -1513,45 +1528,45 @@ bool KListView::automaticSelection() const
1513void KListView::fileManagerKeyPressEvent (QKeyEvent* e) 1528void 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;
@@ -1563,12 +1578,12 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
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;
@@ -1576,7 +1591,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
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 {
@@ -1600,7 +1615,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
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)
@@ -1633,7 +1648,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
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
@@ -1668,7 +1683,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
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)
@@ -1693,7 +1708,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
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;
@@ -1715,7 +1730,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
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)
@@ -1751,7 +1766,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
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)
@@ -1785,25 +1800,25 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e)
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 {
@@ -1850,11 +1865,11 @@ void KListView::setSelectionModeExt (SelectionModeExt mode)
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:
@@ -1868,7 +1883,7 @@ KListView::SelectionModeExt KListView::selectionModeExt () const
1868 return d->selectionMode; 1883 return d->selectionMode;
1869} 1884}
1870 1885
1871int KListView::itemIndex( const QListViewItem *item ) const 1886int KListView::itemIndex( const Q3ListViewItem *item ) const
1872{ 1887{
1873 if ( !item ) 1888 if ( !item )
1874 return -1; 1889 return -1;
@@ -1876,7 +1891,7 @@ int KListView::itemIndex( const QListViewItem *item ) const
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
@@ -1887,13 +1902,13 @@ int KListView::itemIndex( const QListViewItem *item ) const
1887 } 1902 }
1888} 1903}
1889 1904
1890QListViewItem* KListView::itemAtIndex(int index) 1905Q3ListViewItem* 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();
@@ -1903,7 +1918,7 @@ QListViewItem* KListView::itemAtIndex(int index)
1903} 1918}
1904 1919
1905 1920
1906void KListView::emitContextMenu (KListView*, QListViewItem* i) 1921void KListView::emitContextMenu (KListView*, Q3ListViewItem* i)
1907{ 1922{
1908 QPoint p; 1923 QPoint p;
1909 // qDebug("KListView::emitContextMenu "); 1924 // qDebug("KListView::emitContextMenu ");
@@ -1916,9 +1931,9 @@ void KListView::emitContextMenu (KListView*, QListViewItem* i)
1916 emit contextMenu (this, i, p); 1931 emit contextMenu (this, i, p);
1917} 1932}
1918 1933
1919void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) 1934void 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");
@@ -1933,7 +1948,7 @@ void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col)
1933 1948
1934void KListView::setAcceptDrops (bool val) 1949void 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
@@ -1945,14 +1960,14 @@ int KListView::dropVisualizerWidth () const
1945 1960
1946void KListView::viewportPaintEvent(QPaintEvent *e) 1961void 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 {
@@ -1988,7 +2003,7 @@ bool KListView::fullWidth() const
1988 2003
1989int KListView::addColumn(const QString& label, int width) 2004int 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);
@@ -1996,9 +2011,9 @@ int KListView::addColumn(const QString& label, int width)
1996 return result; 2011 return result;
1997} 2012}
1998 2013
1999int KListView::addColumn(const QIconSet& iconset, const QString& label, int width) 2014int 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);
@@ -2008,13 +2023,13 @@ int KListView::addColumn(const QIconSet& iconset, const QString& label, int widt
2008 2023
2009void KListView::removeColumn(int index) 2024void 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
2015void KListView::viewportResizeEvent(QResizeEvent* e) 2030void KListView::viewportResizeEvent(QResizeEvent* e)
2016{ 2031{
2017 QListView::viewportResizeEvent(e); 2032 Q3ListView::viewportResizeEvent(e);
2018} 2033}
2019 2034
2020const QColor &KListView::alternateBackground() const 2035const QColor &KListView::alternateBackground() const
@@ -2070,7 +2085,7 @@ 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
2076int KListView::columnSorted(void) const 2091int KListView::columnSorted(void) const
@@ -2083,58 +2098,58 @@ bool KListView::ascendingSort(void) const
2083 return d->sortAscending; 2098 return d->sortAscending;
2084} 2099}
2085 2100
2086KListViewItem::KListViewItem(QListView *parent) 2101KListViewItem::KListViewItem(Q3ListView *parent)
2087 : QListViewItem(parent) 2102 : Q3ListViewItem(parent)
2088{ 2103{
2089 init(); 2104 init();
2090} 2105}
2091 2106
2092KListViewItem::KListViewItem(QListViewItem *parent) 2107KListViewItem::KListViewItem(Q3ListViewItem *parent)
2093 : QListViewItem(parent) 2108 : Q3ListViewItem(parent)
2094{ 2109{
2095 init(); 2110 init();
2096} 2111}
2097 2112
2098KListViewItem::KListViewItem(QListView *parent, QListViewItem *after) 2113KListViewItem::KListViewItem(Q3ListView *parent, Q3ListViewItem *after)
2099 : QListViewItem(parent, after) 2114 : Q3ListViewItem(parent, after)
2100{ 2115{
2101 init(); 2116 init();
2102} 2117}
2103 2118
2104KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after) 2119KListViewItem::KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after)
2105 : QListViewItem(parent, after) 2120 : Q3ListViewItem(parent, after)
2106{ 2121{
2107 init(); 2122 init();
2108} 2123}
2109 2124
2110KListViewItem::KListViewItem(QListView *parent, 2125KListViewItem::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
2118KListViewItem::KListViewItem(QListViewItem *parent, 2133KListViewItem::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
2126KListViewItem::KListViewItem(QListView *parent, QListViewItem *after, 2141KListViewItem::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
2134KListViewItem::KListViewItem(QListViewItem *parent, QListViewItem *after, 2149KListViewItem::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}
@@ -2212,12 +2227,12 @@ void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in
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