summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/listboxdnd.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /kdevdesigner/designer/listboxdnd.cpp
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz
tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdevdesigner/designer/listboxdnd.cpp')
-rw-r--r--kdevdesigner/designer/listboxdnd.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/kdevdesigner/designer/listboxdnd.cpp b/kdevdesigner/designer/listboxdnd.cpp
index 8ed979f2..9c57eb18 100644
--- a/kdevdesigner/designer/listboxdnd.cpp
+++ b/kdevdesigner/designer/listboxdnd.cpp
@@ -1,15 +1,15 @@
/**********************************************************************
** Copyright (C) 2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qt Designer.
+** This file is part of TQt Designer.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
@@ -17,7 +17,7 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
+** information about TQt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
@@ -32,13 +32,13 @@
#include <tqvaluelist.h>
// The Dragobject Declaration ---------------------------------------
-class ListBoxItemDrag : public QStoredDrag
+class ListBoxItemDrag : public TQStoredDrag
{
public:
- ListBoxItemDrag( ListBoxItemList & items, bool sendPtr = FALSE, TQListBox * parent = 0, const char * name = 0 );
+ ListBoxItemDrag( ListBoxItemList & items, bool sendPtr = FALSE, TQListBox * tqparent = 0, const char * name = 0 );
~ListBoxItemDrag() {};
static bool canDecode( TQDragMoveEvent * event );
- static bool decode( TQDropEvent * event, TQListBox * parent, TQListBoxItem * insertPoint );
+ static bool decode( TQDropEvent * event, TQListBox * tqparent, TQListBoxItem * insertPoint );
enum ItemType { ListBoxText = 1, ListBoxPixmap = 2 };
};
// ------------------------------------------------------------------
@@ -81,7 +81,7 @@ bool ListBoxDnd::dropEvent( TQDropEvent * event )
bool ListBoxDnd::mouseMoveEvent( TQMouseEvent * event )
{
- if ( event->state() & LeftButton ) {
+ if ( event->state() & Qt::LeftButton ) {
if ( ( event->pos() - mousePressPos ).manhattanLength() > 3 ) {
ListBoxItemList list;
@@ -141,7 +141,7 @@ void ListBoxDnd::removeList( ListBoxItemList & list )
{
TQListBoxItem * i = list.first();
while ( i ) {
- ((TQListBox *)src)->takeItem( i ); // remove item from QListBox
+ ((TQListBox *)src)->takeItem( i ); // remove item from TQListBox
i = list.next();
}
}
@@ -152,8 +152,8 @@ void ListBoxDnd::updateLine( const TQPoint & dragPos )
TQListBoxItem *item = itemAt( dragPos );
int ypos = item ?
- ( src->itemRect( item ).bottom() - ( line->height() / 2 ) ) :
- ( src->itemRect( ((TQListBox *)src)->firstItem() ).top() );
+ ( src->tqitemRect( item ).bottom() - ( line->height() / 2 ) ) :
+ ( src->tqitemRect( ((TQListBox *)src)->firstItem() ).top() );
line->resize( src->viewport()->width(), line->height() );
line->move( 0, ypos );
@@ -166,9 +166,9 @@ TQListBoxItem * ListBoxDnd::itemAt( TQPoint pos )
TQListBoxItem * last = src->item( src->count() - 1 );
int i = src->index( result );
- if ( result && ( pos.y() < (src->itemRect(result).top() + src->itemHeight(i)/2) ) )
+ if ( result && ( pos.y() < (src->tqitemRect(result).top() + src->itemHeight(i)/2) ) )
result = result->prev();
- else if ( !result && pos.y() > src->itemRect( last ).bottom() )
+ else if ( !result && pos.y() > src->tqitemRect( last ).bottom() )
result = last;
return result;
@@ -184,15 +184,15 @@ bool ListBoxDnd::canDecode( TQDragEnterEvent * event )
// The Dragobject Implementation ------------------------------------
// ------------------------------------------------------------------
-ListBoxItemDrag::ListBoxItemDrag( ListBoxItemList & items, bool sendPtr, TQListBox * parent, const char * name )
- : TQStoredDrag( "qt/listboxitem", parent, name )
+ListBoxItemDrag::ListBoxItemDrag( ListBoxItemList & items, bool sendPtr, TQListBox * tqparent, const char * name )
+ : TQStoredDrag( "qt/listboxitem", tqparent, name )
{
// ### FIX!
- TQByteArray data( sizeof( Q_INT32 ) + sizeof( TQListBoxItem ) * items.count() );
+ TQByteArray data( sizeof( TQ_INT32 ) + sizeof( TQListBoxItem ) * items.count() );
TQDataStream stream( data, IO_WriteOnly );
stream << items.count();
- stream << (Q_UINT8) sendPtr; // just transfer item pointer; omit data
+ stream << (TQ_UINT8) sendPtr; // just transfer item pointer; omit data
TQListBoxItem * i = items.first();
@@ -200,7 +200,7 @@ ListBoxItemDrag::ListBoxItemDrag( ListBoxItemList & items, bool sendPtr, TQListB
while ( i ) {
- stream << (Q_ULONG) i; //###FIX: demands sizeof(ulong) >= sizeof(void*)
+ stream << (TQ_ULONG) i; //###FIX: demands sizeof(ulong) >= sizeof(void*)
i = items.next();
}
@@ -209,21 +209,21 @@ ListBoxItemDrag::ListBoxItemDrag( ListBoxItemList & items, bool sendPtr, TQListB
while ( i ) {
- Q_UINT8 b = 0;
+ TQ_UINT8 b = 0;
- b = (Q_UINT8) ( i->text() != TQString::null ); // does item have text ?
+ b = (TQ_UINT8) ( i->text() != TQString() ); // does item have text ?
stream << b;
if ( b ) {
stream << i->text();
}
- b = (Q_UINT8) ( !!i->pixmap() ); // does item have a pixmap ?
+ b = (TQ_UINT8) ( !!i->pixmap() ); // does item have a pixmap ?
stream << b;
if ( b ) {
stream << ( *i->pixmap() );
}
- stream << (Q_UINT8) i->isSelectable();
+ stream << (TQ_UINT8) i->isSelectable();
i = items.next();
}
@@ -238,9 +238,9 @@ bool ListBoxItemDrag::canDecode( TQDragMoveEvent * event )
return event->provides( "qt/listboxitem" );
}
-bool ListBoxItemDrag::decode( TQDropEvent * event, TQListBox * parent, TQListBoxItem * after )
+bool ListBoxItemDrag::decode( TQDropEvent * event, TQListBox * tqparent, TQListBoxItem * after )
{
- TQByteArray data = event->encodedData( "qt/listboxitem" );
+ TQByteArray data = event->tqencodedData( "qt/listboxitem" );
if ( data.size() ) {
event->accept();
@@ -249,7 +249,7 @@ bool ListBoxItemDrag::decode( TQDropEvent * event, TQListBox * parent, TQListBox
int count = 0;
stream >> count;
- Q_UINT8 recievePtr = 0; // data contains just item pointers; no data
+ TQ_UINT8 recievePtr = 0; // data contains just item pointers; no data
stream >> recievePtr;
TQListBoxItem * item = 0;
@@ -258,11 +258,11 @@ bool ListBoxItemDrag::decode( TQDropEvent * event, TQListBox * parent, TQListBox
for( int i = 0; i < count; i++ ) {
- Q_ULONG p = 0; //###FIX: demands sizeof(ulong) >= sizeof(void*)
+ TQ_ULONG p = 0; //###FIX: demands sizeof(ulong) >= sizeof(void*)
stream >> p;
item = (TQListBoxItem *) p;
- parent->insertItem( item, after );
+ tqparent->insertItem( item, after );
}
@@ -270,27 +270,27 @@ bool ListBoxItemDrag::decode( TQDropEvent * event, TQListBox * parent, TQListBox
for ( int i = 0; i < count; i++ ) {
- Q_UINT8 hasText = 0;
+ TQ_UINT8 hasText = 0;
TQString text;
stream >> hasText;
if ( hasText ) {
stream >> text;
}
- Q_UINT8 hasPixmap = 0;
+ TQ_UINT8 hasPixmap = 0;
TQPixmap pixmap;
stream >> hasPixmap;
if ( hasPixmap ) {
stream >> pixmap;
}
- Q_UINT8 isSelectable = 0;
+ TQ_UINT8 isSelectable = 0;
stream >> isSelectable;
if ( hasPixmap ) {
- item = new TQListBoxPixmap( parent, pixmap, text, after );
+ item = new TQListBoxPixmap( tqparent, pixmap, text, after );
} else {
- item = new TQListBoxText( parent, text, after );
+ item = new TQListBoxText( tqparent, text, after );
}
item->setSelectable( isSelectable );