-rw-r--r-- | microkde/kdeui/klistview.cpp | 337 |
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 | |||
@@ -19,11 +19,25 @@ | |||
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> |
@@ -39,5 +53,5 @@ | |||
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 |
@@ -47,7 +61,8 @@ | |||
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: |
@@ -68,5 +83,5 @@ private: | |||
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 | { |
@@ -124,5 +139,5 @@ public: | |||
124 | } | 139 | } |
125 | 140 | ||
126 | QListViewItem* pCurrentItem; | 141 | Q3ListViewItem* pCurrentItem; |
127 | 142 | ||
128 | QTimer autoSelect; | 143 | QTimer autoSelect; |
@@ -130,5 +145,5 @@ public: | |||
130 | 145 | ||
131 | QTimer dragExpand; | 146 | QTimer dragExpand; |
132 | QListViewItem* dragOverItem; | 147 | Q3ListViewItem* dragOverItem; |
133 | QPoint dragOverPoint; | 148 | QPoint dragOverPoint; |
134 | 149 | ||
@@ -137,5 +152,5 @@ public: | |||
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; |
@@ -171,6 +186,6 @@ public: | |||
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; |
@@ -227,5 +242,5 @@ void KListViewLineEdit::load(QListViewItem *i, int c) | |||
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) |
@@ -240,7 +255,7 @@ static int nextCol (KListView *pl, QListViewItem *pi, int start, int dir) | |||
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() |
@@ -253,5 +268,5 @@ static QListViewItem *prevItem (QListViewItem *pi) | |||
253 | } | 268 | } |
254 | 269 | ||
255 | static QListViewItem *lastQChild (QListViewItem *pi) | 270 | static Q3ListViewItem *lastQChild (Q3ListViewItem *pi) |
256 | { | 271 | { |
257 | if (pi) | 272 | if (pi) |
@@ -261,5 +276,5 @@ static QListViewItem *lastQChild (QListViewItem *pi) | |||
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 | } |
@@ -329,8 +344,8 @@ bool KListViewLineEdit::event (QEvent *pe) | |||
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 | } |
@@ -407,5 +422,5 @@ void KListViewLineEdit::slotSelectionChanged() | |||
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 | { |
@@ -418,6 +433,6 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse | |||
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)), |
@@ -446,15 +461,15 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse | |||
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 | ||
@@ -481,5 +496,5 @@ QSize KListView::sizeHint() const | |||
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 ); |
@@ -504,5 +519,5 @@ bool KListView::isExecuteArea( int x ) | |||
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() ); |
@@ -535,10 +550,10 @@ void KListView::slotSettingsChanged(int category) | |||
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(); |
@@ -612,5 +627,5 @@ void KListView::slotAutoSelect() | |||
612 | setFocus(); | 627 | setFocus(); |
613 | 628 | ||
614 | QListViewItem* previousItem = currentItem(); | 629 | Q3ListViewItem* previousItem = currentItem(); |
615 | setCurrentItem( d->pCurrentItem ); | 630 | setCurrentItem( d->pCurrentItem ); |
616 | 631 | ||
@@ -633,5 +648,5 @@ void KListView::slotAutoSelect() | |||
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 ) { |
@@ -652,5 +667,5 @@ void KListView::slotAutoSelect() | |||
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 | } |
@@ -685,5 +700,5 @@ void KListView::slotHeaderChanged() | |||
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); |
@@ -702,5 +717,5 @@ void KListView::emitExecute( int buttonstate, QListViewItem *item, const QPoint | |||
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 | ||
@@ -715,5 +730,5 @@ 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) |
@@ -748,5 +763,5 @@ void KListView::focusOutEvent( QFocusEvent *fe ) | |||
748 | }; | 763 | }; |
749 | 764 | ||
750 | QListView::focusOutEvent( fe ); | 765 | Q3ListView::focusOutEvent( fe ); |
751 | } | 766 | } |
752 | 767 | ||
@@ -755,5 +770,5 @@ void KListView::leaveEvent( QEvent *e ) | |||
755 | d->autoSelect.stop(); | 770 | d->autoSelect.stop(); |
756 | 771 | ||
757 | QListView::leaveEvent( e ); | 772 | Q3ListView::leaveEvent( e ); |
758 | } | 773 | } |
759 | 774 | ||
@@ -766,5 +781,5 @@ bool KListView::event( QEvent *e ) | |||
766 | } | 781 | } |
767 | 782 | ||
768 | return QListView::event(e); | 783 | return Q3ListView::event(e); |
769 | } | 784 | } |
770 | 785 | ||
@@ -772,5 +787,5 @@ 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(); |
@@ -794,5 +809,5 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) | |||
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) |
@@ -802,5 +817,5 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) | |||
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 |
@@ -814,5 +829,5 @@ void KListView::contentsMousePressEvent( QMouseEvent *e ) | |||
814 | } | 829 | } |
815 | 830 | ||
816 | QListView::contentsMousePressEvent( e ); | 831 | Q3ListView::contentsMousePressEvent( e ); |
817 | } | 832 | } |
818 | 833 | ||
@@ -820,10 +835,10 @@ 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? |
@@ -854,5 +869,5 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) | |||
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(); |
@@ -863,5 +878,5 @@ void KListView::contentsMouseMoveEvent( QMouseEvent *e ) | |||
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 |
@@ -869,5 +884,5 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) | |||
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 | { |
@@ -891,5 +906,5 @@ void KListView::contentsMouseReleaseEvent( QMouseEvent *e ) | |||
891 | d->startDragPos = QPoint(); | 906 | d->startDragPos = QPoint(); |
892 | } | 907 | } |
893 | QListView::contentsMouseReleaseEvent( e ); | 908 | Q3ListView::contentsMouseReleaseEvent( e ); |
894 | } | 909 | } |
895 | 910 | ||
@@ -902,6 +917,6 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *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; |
@@ -912,5 +927,5 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) | |||
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 | ||
@@ -920,9 +935,9 @@ void KListView::contentsMouseDoubleClickEvent ( QMouseEvent *e ) | |||
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 | ||
@@ -962,10 +977,10 @@ qDebug("KListView::contentsDropEvent drag&drop not supported yet"); | |||
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(); |
@@ -980,5 +995,5 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) | |||
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) |
@@ -1001,5 +1016,5 @@ void KListView::movableDropEvent (QListViewItem* parent, QListViewItem* afterme) | |||
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) |
@@ -1087,12 +1102,12 @@ int KListView::depthToPixels( int depth ) | |||
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(); |
@@ -1124,6 +1139,6 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte | |||
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 | { |
@@ -1147,7 +1162,7 @@ void KListView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewIte | |||
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) |
@@ -1157,9 +1172,9 @@ QListViewItem* KListView::lastChild () const | |||
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 | ||
@@ -1188,10 +1203,10 @@ qDebug("KListView::startDrag drag&drop not supported yet."); | |||
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 | ||
@@ -1247,8 +1262,8 @@ void KListView::setDropVisualizer(bool 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; |
@@ -1256,8 +1271,8 @@ QPtrList<QListViewItem> KListView::selectedItems() const | |||
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 | { |
@@ -1297,6 +1312,6 @@ void KListView::setDropVisualizerWidth (int w) | |||
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; |
@@ -1309,5 +1324,5 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, | |||
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 | { |
@@ -1339,10 +1354,10 @@ QRect KListView::drawDropVisualizer(QPainter *p, QListViewItem *parent, | |||
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; |
@@ -1377,5 +1392,5 @@ void KListView::cleanItemHighlighter () | |||
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)) |
@@ -1404,5 +1419,5 @@ void KListView::setRenameable (int col, bool yesno) | |||
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); |
@@ -1448,10 +1463,10 @@ bool KListView::dropHighlighter() const | |||
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); |
@@ -1483,5 +1498,5 @@ void KListView::keyPressEvent (QKeyEvent* e) | |||
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); |
@@ -1514,43 +1529,43 @@ 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; |
@@ -1564,10 +1579,10 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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) |
@@ -1577,5 +1592,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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) |
@@ -1601,5 +1616,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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 |
@@ -1634,5 +1649,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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; |
@@ -1669,5 +1684,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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; |
@@ -1694,5 +1709,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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(); |
@@ -1716,5 +1731,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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; |
@@ -1752,5 +1767,5 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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; |
@@ -1786,15 +1801,15 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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()); |
@@ -1802,7 +1817,7 @@ void KListView::fileManagerKeyPressEvent (QKeyEvent* e) | |||
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) |
@@ -1851,9 +1866,9 @@ void KListView::setSelectionModeExt (SelectionModeExt mode) | |||
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 | ||
@@ -1869,5 +1884,5 @@ KListView::SelectionModeExt KListView::selectionModeExt () const | |||
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 ) |
@@ -1877,5 +1892,5 @@ int KListView::itemIndex( const QListViewItem *item ) const | |||
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 ); |
@@ -1888,5 +1903,5 @@ int KListView::itemIndex( const QListViewItem *item ) const | |||
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) |
@@ -1894,5 +1909,5 @@ QListViewItem* KListView::itemAtIndex(int index) | |||
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) |
@@ -1904,5 +1919,5 @@ QListViewItem* KListView::itemAtIndex(int index) | |||
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; |
@@ -1917,7 +1932,7 @@ void KListView::emitContextMenu (KListView*, QListViewItem* i) | |||
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; |
@@ -1934,5 +1949,5 @@ void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) | |||
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 | } |
@@ -1946,5 +1961,5 @@ int KListView::dropVisualizerWidth () const | |||
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)) |
@@ -1953,5 +1968,5 @@ void KListView::viewportPaintEvent(QPaintEvent *e) | |||
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)) |
@@ -1989,5 +2004,5 @@ bool KListView::fullWidth() const | |||
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); |
@@ -1997,7 +2012,7 @@ int KListView::addColumn(const QString& label, int width) | |||
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); |
@@ -2009,5 +2024,5 @@ int KListView::addColumn(const QIconSet& iconset, const QString& label, int widt | |||
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 | } |
@@ -2015,5 +2030,5 @@ void KListView::removeColumn(int index) | |||
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 | ||
@@ -2071,5 +2086,5 @@ void KListView::setSorting(int column, bool ascending) | |||
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 | ||
@@ -2084,56 +2099,56 @@ bool KListView::ascendingSort(void) const | |||
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(); |
@@ -2213,10 +2228,10 @@ void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in | |||
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 | ||