summaryrefslogtreecommitdiffstats
path: root/kaddressbook/views/cardview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kaddressbook/views/cardview.cpp')
-rw-r--r--kaddressbook/views/cardview.cpp262
1 files changed, 131 insertions, 131 deletions
diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp
index 82e98779..6e7d71d6 100644
--- a/kaddressbook/views/cardview.cpp
+++ b/kaddressbook/views/cardview.cpp
@@ -24,13 +24,13 @@
#include <limits.h>
-#include <qcursor.h>
-#include <qdatetime.h>
-#include <qlabel.h>
-#include <qpainter.h>
-#include <qstyle.h>
-#include <qtimer.h>
-#include <qtooltip.h>
+#include <tqcursor.h>
+#include <tqdatetime.h>
+#include <tqlabel.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
+#include <tqtooltip.h>
#include <kdebug.h>
#include <kglobalsettings.h>
@@ -42,10 +42,10 @@
class CardViewTip : public QLabel
{
public:
- CardViewTip( QWidget *parent = 0, const char *name = 0 )
- : QLabel( parent, name )
+ CardViewTip( TQWidget *parent = 0, const char *name = 0 )
+ : TQLabel( parent, name )
{
- setPalette( QToolTip::palette() );
+ setPalette( TQToolTip::palette() );
setFrameStyle( Panel | Plain );
setMidLineWidth( 0 );
setIndent( 1 );
@@ -54,7 +54,7 @@ class CardViewTip : public QLabel
~CardViewTip() {};
protected:
- void leaveEvent( QEvent* )
+ void leaveEvent( TQEvent* )
{
hide();
}
@@ -64,11 +64,11 @@ class CardViewTip : public QLabel
// Warning: make sure you use findRef() instead of find() to find an
// item! Only the pointer value is unique in the list.
//
-class CardViewItemList : public QPtrList<CardViewItem>
+class CardViewItemList : public TQPtrList<CardViewItem>
{
protected:
- virtual int compareItems( QPtrCollection::Item item1,
- QPtrCollection::Item item2 )
+ virtual int compareItems( TQPtrCollection::Item item1,
+ TQPtrCollection::Item item2 )
{
CardViewItem *cItem1 = (CardViewItem*)item1;
CardViewItem *cItem2 = (CardViewItem*)item2;
@@ -96,15 +96,15 @@ class CardViewSeparator
CardViewSeparator( CardView *view )
: mView( view )
{
- mRect = QRect( 0, 0, view->separatorWidth(), 0 );
+ mRect = TQRect( 0, 0, view->separatorWidth(), 0 );
}
~CardViewSeparator() {}
- void paintSeparator( QPainter *p, QColorGroup &cg )
+ void paintSeparator( TQPainter *p, TQColorGroup &cg )
{
p->fillRect( 0, 0, mRect.width(), mRect.height(),
- cg.brush(QColorGroup::Button) );
+ cg.brush(TQColorGroup::Button) );
}
void repaintSeparator()
@@ -114,7 +114,7 @@ class CardViewSeparator
private:
CardView *mView;
- QRect mRect;
+ TQRect mRect;
};
class CardViewPrivate
@@ -134,16 +134,16 @@ class CardViewPrivate
mItemWidth( 200 ),
mMaxFieldLines( INT_MAX ),
mCurrentItem( 0L ),
- mLastClickPos( QPoint(0, 0) ),
+ mLastClickPos( TQPoint(0, 0) ),
mRubberBandAnchor( 0 ),
- mCompText( QString::null )
+ mCompText( TQString::null )
{};
CardViewItemList mItemList;
- QPtrList<CardViewSeparator> mSeparatorList;
- QFontMetrics *mFm;
- QFontMetrics *mBFm;
- QFont mHeaderFont;
+ TQPtrList<CardViewSeparator> mSeparatorList;
+ TQFontMetrics *mFm;
+ TQFontMetrics *mBFm;
+ TQFont mHeaderFont;
CardView::SelectionMode mSelectionMode;
bool mDrawCardBorder;
bool mDrawFieldLabels;
@@ -157,8 +157,8 @@ class CardViewPrivate
int mItemWidth; // width of all items
uint mMaxFieldLines; // Max lines to dispaly pr field
CardViewItem *mCurrentItem;
- QPoint mLastClickPos;
- QTimer *mTimer; // times out if mouse rests for more than 500 msecs
+ TQPoint mLastClickPos;
+ TQTimer *mTimer; // times out if mouse rests for more than 500 msecs
CardViewTip *mTip; // passed to the item under a resting cursor to display full text
bool mOnSeparator; // set/reset on mouse movement
// for resizing by dragging the separators
@@ -173,8 +173,8 @@ class CardViewPrivate
int mPressed; // the colummn that was pressed on at resizing start
int mSpan; // pressed - first
// key completion
- QString mCompText; // current completion string
- QDateTime mCompUpdated; // ...was updated at this time
+ TQString mCompText; // current completion string
+ TQDateTime mCompUpdated; // ...was updated at this time
};
class CardViewItemPrivate
@@ -182,8 +182,8 @@ class CardViewItemPrivate
public:
CardViewItemPrivate() {}
- QString mCaption;
- QPtrList< CardViewItem::Field > mFieldList;
+ TQString mCaption;
+ TQPtrList< CardViewItem::Field > mFieldList;
bool mSelected;
int x; // horizontal position, set by the view
int y; // vertical position, set by the view
@@ -192,7 +192,7 @@ class CardViewItemPrivate
};
-CardViewItem::CardViewItem( CardView *parent, const QString &caption )
+CardViewItem::CardViewItem( CardView *parent, const TQString &caption )
: d( new CardViewItemPrivate() ), mView( parent )
{
d->mCaption = caption;
@@ -222,15 +222,15 @@ void CardViewItem::initialize()
mView->insertItem( this );
}
-void CardViewItem::paintCard( QPainter *p, QColorGroup &cg )
+void CardViewItem::paintCard( TQPainter *p, TQColorGroup &cg )
{
if ( !mView )
return;
- QPen pen;
- QBrush brush;
- QFontMetrics fm = *(mView->d->mFm);
- QFontMetrics bFm = *(mView->d->mBFm);
+ TQPen pen;
+ TQBrush brush;
+ TQFontMetrics fm = *(mView->d->mFm);
+ TQFontMetrics bFm = *(mView->d->mBFm);
bool drawLabels = mView->d->mDrawFieldLabels;
bool drawBorder = mView->d->mDrawCardBorder;
int mg = mView->itemMargin();
@@ -252,9 +252,9 @@ void CardViewItem::paintCard( QPainter *p, QColorGroup &cg )
// Draw a simple box
if ( isSelected() )
- pen = QPen( cg.highlight(), 1 );
+ pen = TQPen( cg.highlight(), 1 );
else
- pen = QPen( cg.button(), 1 );
+ pen = TQPen( cg.button(), 1 );
p->setPen( pen );
// Draw the border - this is only draw if the user asks for it.
@@ -263,15 +263,15 @@ void CardViewItem::paintCard( QPainter *p, QColorGroup &cg )
// set the proper pen color for the caption box
if ( isSelected() )
- brush = cg.brush( QColorGroup::Highlight );
+ brush = cg.brush( TQColorGroup::Highlight );
else
- brush = cg.brush( QColorGroup::Button );
+ brush = cg.brush( TQColorGroup::Button );
p->fillRect( mg, mg, w, 4 + bFm.height(), brush );
// Now paint the caption
p->save();
- QFont bFont = mView->headerFont();
+ TQFont bFont = mView->headerFont();
p->setFont( bFont );
if ( isSelected() )
p->setPen( cg.highlightedText() );
@@ -282,14 +282,14 @@ void CardViewItem::paintCard( QPainter *p, QColorGroup &cg )
p->restore();
// Go through the fields and draw them
- QPtrListIterator<CardViewItem::Field> iter( d->mFieldList );
- QString label, value;
+ TQPtrListIterator<CardViewItem::Field> iter( d->mFieldList );
+ TQString label, value;
int yPos = mg + 4 + bFm.height() + fm.height();
p->setPen( cg.text() );
int fh = fm.height();
int cln( 0 );
- QString tmp;
+ TQString tmp;
int maxLines = mView->maxFieldLines();
for ( iter.toFirst(); iter.current(); ++iter ) {
value = (*iter)->second;
@@ -316,14 +316,14 @@ void CardViewItem::paintCard( QPainter *p, QColorGroup &cg )
// if we are the current item and the view has focus, draw focus rect
if ( mView->currentItem() == this && mView->hasFocus() ) {
- mView->style().drawPrimitive( QStyle::PE_FocusRect, p,
- QRect( 0, 0, mView->itemWidth(), h + (2 * mg) ), cg,
- QStyle::Style_FocusAtBorder,
- QStyleOption( isSelected() ? cg.highlight() : cg.base() ) );
+ mView->style().drawPrimitive( TQStyle::PE_FocusRect, p,
+ TQRect( 0, 0, mView->itemWidth(), h + (2 * mg) ), cg,
+ TQStyle::Style_FocusAtBorder,
+ TQStyleOption( isSelected() ? cg.highlight() : cg.base() ) );
}
}
-const QString &CardViewItem::caption() const
+const TQString &CardViewItem::caption() const
{
return d->mCaption;
}
@@ -351,7 +351,7 @@ int CardViewItem::height( bool allowCache ) const
int fieldHeight = 0;
int lines;
int maxLines( mView->maxFieldLines() );
- QPtrListIterator<CardViewItem::Field> iter( d->mFieldList );
+ TQPtrListIterator<CardViewItem::Field> iter( d->mFieldList );
for ( iter.toFirst(); iter.current(); ++iter ) {
if ( !sef && (*iter)->second.isEmpty() )
continue;
@@ -375,7 +375,7 @@ void CardViewItem::setSelected( bool selected )
d->mSelected = selected;
}
-void CardViewItem::insertField( const QString &label, const QString &value )
+void CardViewItem::insertField( const TQString &label, const TQString &value )
{
CardViewItem::Field *f = new CardViewItem::Field( label, value );
d->mFieldList.append( f );
@@ -387,11 +387,11 @@ void CardViewItem::insertField( const QString &label, const QString &value )
}
}
-void CardViewItem::removeField( const QString &label )
+void CardViewItem::removeField( const TQString &label )
{
CardViewItem::Field *f;
- QPtrListIterator<CardViewItem::Field> iter( d->mFieldList );
+ TQPtrListIterator<CardViewItem::Field> iter( d->mFieldList );
for ( iter.toFirst(); iter.current(); ++iter ) {
f = *iter;
if ( f->first == label )
@@ -415,15 +415,15 @@ void CardViewItem::clearFields()
mView->setLayoutDirty( true );
}
-QString CardViewItem::trimString( const QString &text, int width,
- QFontMetrics &fm ) const
+TQString CardViewItem::trimString( const TQString &text, int width,
+ TQFontMetrics &fm ) const
{
if ( fm.width( text ) <= width )
return text;
- QString dots = "...";
+ TQString dots = "...";
int dotWidth = fm.width( dots );
- QString trimmed;
+ TQString trimmed;
int charNum = 0;
while ( fm.width( trimmed ) + dotWidth < width ) {
@@ -454,27 +454,27 @@ void CardViewItem::repaintCard()
mView->repaintItem( this );
}
-void CardViewItem::setCaption( const QString &caption )
+void CardViewItem::setCaption( const TQString &caption )
{
d->mCaption = caption;
repaintCard();
}
-QString CardViewItem::fieldValue( const QString &label ) const
+TQString CardViewItem::fieldValue( const TQString &label ) const
{
- QPtrListIterator<CardViewItem::Field> iter( d->mFieldList );
+ TQPtrListIterator<CardViewItem::Field> iter( d->mFieldList );
for ( iter.toFirst(); iter.current(); ++iter )
if ( (*iter)->first == label )
return (*iter)->second;
- return QString();
+ return TQString();
}
-void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip )
+void CardViewItem::showFullString( const TQPoint &itempos, CardViewTip *tip )
{
bool trimmed( false );
- QString s;
+ TQString s;
int mrg = mView->itemMargin();
int y = mView->d->mBFm->height() + 6 + mrg;
int w = mView->itemWidth() - (2 * mrg);
@@ -520,7 +520,7 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip )
if ( isLabel ) {
trimmed = mView->d->mFm->width( s ) > mw - colonWidth;
} else {
- QRect r( mView->d->mFm->boundingRect( 0, 0, INT_MAX, INT_MAX, Qt::AlignTop|Qt::AlignLeft, s ) );
+ TQRect r( mView->d->mFm->boundingRect( 0, 0, INT_MAX, INT_MAX, Qt::AlignTop|Qt::AlignLeft, s ) );
trimmed = r.width() > mw || r.height() / fh > QMIN( s.contains( '\n' ) + 1, maxLines );
}
}
@@ -532,8 +532,8 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip )
// find a proper position
int lx;
lx = isLabel || !drawLabels ? mrg : lw + mrg + 2;
- QPoint pnt( mView->contentsToViewport( QPoint( d->x, d->y ) ) );
- pnt += QPoint( lx, y );
+ TQPoint pnt( mView->contentsToViewport( TQPoint( d->x, d->y ) ) );
+ pnt += TQPoint( lx, y );
if ( pnt.x() < 0 )
pnt.setX( 0 );
if ( pnt.x() + tip->width() > mView->visibleWidth() )
@@ -546,7 +546,7 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip )
}
}
-CardViewItem::Field *CardViewItem::fieldAt( const QPoint & itempos ) const
+CardViewItem::Field *CardViewItem::fieldAt( const TQPoint & itempos ) const
{
int ypos = mView->d->mBFm->height() + 7 + mView->d->mItemMargin;
int iy = itempos.y();
@@ -569,28 +569,28 @@ CardViewItem::Field *CardViewItem::fieldAt( const QPoint & itempos ) const
}
-CardView::CardView( QWidget *parent, const char *name )
- : QScrollView( parent, name ),
+CardView::CardView( TQWidget *parent, const char *name )
+ : TQScrollView( parent, name ),
d( new CardViewPrivate() )
{
d->mItemList.setAutoDelete( true );
d->mSeparatorList.setAutoDelete( true );
- QFont f = font();
- d->mFm = new QFontMetrics( f );
+ TQFont f = font();
+ d->mFm = new TQFontMetrics( f );
f.setBold( true );
d->mHeaderFont = f;
- d->mBFm = new QFontMetrics( f );
+ d->mBFm = new TQFontMetrics( f );
d->mTip = new CardViewTip( viewport() );
d->mTip->hide();
- d->mTimer = new QTimer( this, "mouseTimer" );
+ d->mTimer = new TQTimer( this, "mouseTimer" );
viewport()->setMouseTracking( true );
viewport()->setFocusProxy( this );
viewport()->setFocusPolicy( WheelFocus );
viewport()->setBackgroundMode( PaletteBase );
- connect( d->mTimer, SIGNAL( timeout() ), this, SLOT( tryShowFullText() ) );
+ connect( d->mTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( tryShowFullText() ) );
setBackgroundMode( PaletteBackground, PaletteBase );
@@ -664,14 +664,14 @@ void CardView::setCurrentItem( CardViewItem *item )
emit currentChanged( item );
}
-CardViewItem *CardView::itemAt( const QPoint &viewPos ) const
+CardViewItem *CardView::itemAt( const TQPoint &viewPos ) const
{
CardViewItem *item = 0;
- QPtrListIterator<CardViewItem> iter( d->mItemList );
+ TQPtrListIterator<CardViewItem> iter( d->mItemList );
bool found = false;
for ( iter.toFirst(); iter.current() && !found; ++iter ) {
item = *iter;
- if ( QRect( item->d->x, item->d->y, d->mItemWidth, item->height() ).contains( viewPos ) )
+ if ( TQRect( item->d->x, item->d->y, d->mItemWidth, item->height() ).contains( viewPos ) )
found = true;
}
@@ -681,9 +681,9 @@ CardViewItem *CardView::itemAt( const QPoint &viewPos ) const
return 0;
}
-QRect CardView::itemRect( const CardViewItem *item ) const
+TQRect CardView::itemRect( const CardViewItem *item ) const
{
- return QRect( item->d->x, item->d->y, d->mItemWidth, item->height() );
+ return TQRect( item->d->x, item->d->y, d->mItemWidth, item->height() );
}
void CardView::ensureItemVisible( const CardViewItem *item )
@@ -694,7 +694,7 @@ void CardView::ensureItemVisible( const CardViewItem *item )
void CardView::repaintItem( const CardViewItem *item )
{
- repaintContents( QRect( item->d->x, item->d->y, d->mItemWidth, item->height() ) );
+ repaintContents( TQRect( item->d->x, item->d->y, d->mItemWidth, item->height() ) );
}
void CardView::setSelectionMode( CardView::SelectionMode mode )
@@ -711,7 +711,7 @@ CardView::SelectionMode CardView::selectionMode() const
void CardView::selectAll( bool state )
{
- QPtrListIterator<CardViewItem> iter( d->mItemList );
+ TQPtrListIterator<CardViewItem> iter( d->mItemList );
if ( !state ) {
for ( iter.toFirst(); iter.current(); ++iter ) {
if ( (*iter)->isSelected() ) {
@@ -785,7 +785,7 @@ bool CardView::isSelected( CardViewItem *item ) const
CardViewItem *CardView::selectedItem() const
{
// find the first selected item
- QPtrListIterator<CardViewItem> iter( d->mItemList );
+ TQPtrListIterator<CardViewItem> iter( d->mItemList );
for ( iter.toFirst(); iter.current(); ++iter ) {
if ( (*iter)->isSelected() )
return *iter;
@@ -804,7 +804,7 @@ int CardView::childCount() const
return d->mItemList.count();
}
-CardViewItem *CardView::findItem( const QString &text, const QString &label,
+CardViewItem *CardView::findItem( const TQString &text, const TQString &label,
Qt::StringComparisonMode compare ) const
{
// If the text is empty, we will return null, since empty text will
@@ -812,9 +812,9 @@ CardViewItem *CardView::findItem( const QString &text, const QString &label,
if ( text.isEmpty() )
return 0;
- QPtrListIterator<CardViewItem> iter( d->mItemList );
+ TQPtrListIterator<CardViewItem> iter( d->mItemList );
if ( compare & Qt::BeginsWith ) {
- QString value;
+ TQString value;
for ( iter.toFirst(); iter.current(); ++iter ) {
value = (*iter)->fieldValue( label ).upper();
if ( value.startsWith( text.upper() ) )
@@ -834,20 +834,20 @@ uint CardView::columnWidth() const
d->mItemWidth + d->mItemSpacing;
}
-void CardView::drawContents( QPainter *p, int clipx, int clipy,
+void CardView::drawContents( TQPainter *p, int clipx, int clipy,
int clipw, int cliph )
{
- QScrollView::drawContents( p, clipx, clipy, clipw, cliph );
+ TQScrollView::drawContents( p, clipx, clipy, clipw, cliph );
if ( d->mLayoutDirty )
calcLayout();
// allow setting costum colors in the viewport pale
- QColorGroup cg = viewport()->palette().active();
+ TQColorGroup cg = viewport()->palette().active();
- QRect clipRect( clipx, clipy, clipw, cliph );
- QRect cardRect;
- QRect sepRect;
+ TQRect clipRect( clipx, clipy, clipw, cliph );
+ TQRect cardRect;
+ TQRect sepRect;
CardViewItem *item;
CardViewSeparator *sep;
@@ -855,7 +855,7 @@ void CardView::drawContents( QPainter *p, int clipx, int clipy,
viewport()->erase( clipRect );
// Now tell the cards to draw, if they are in the clip region
- QPtrListIterator<CardViewItem> iter( d->mItemList );
+ TQPtrListIterator<CardViewItem> iter( d->mItemList );
for ( iter.toFirst(); iter.current(); ++iter) {
item = *iter;
cardRect.setRect( item->d->x, item->d->y, d->mItemWidth, item->height() );
@@ -870,7 +870,7 @@ void CardView::drawContents( QPainter *p, int clipx, int clipy,
}
// Followed by the separators if they are in the clip region
- QPtrListIterator<CardViewSeparator> sepIter( d->mSeparatorList );
+ TQPtrListIterator<CardViewSeparator> sepIter( d->mSeparatorList );
for ( sepIter.toFirst(); sepIter.current(); ++sepIter ) {
sep = *sepIter;
sepRect = sep->mRect;
@@ -884,9 +884,9 @@ void CardView::drawContents( QPainter *p, int clipx, int clipy,
}
}
-void CardView::resizeEvent( QResizeEvent *event )
+void CardView::resizeEvent( TQResizeEvent *event )
{
- QScrollView::resizeEvent( event );
+ TQScrollView::resizeEvent( event );
setLayoutDirty( true );
}
@@ -904,7 +904,7 @@ void CardView::calcLayout()
// delete the old separators
d->mSeparatorList.clear();
- QPtrListIterator<CardViewItem> iter( d->mItemList );
+ TQPtrListIterator<CardViewItem> iter( d->mItemList );
CardViewItem *item = 0;
CardViewSeparator *sep = 0;
xPos += cardSpacing;
@@ -924,7 +924,7 @@ void CardView::calcLayout()
if ( d->mDrawSeparators ) {
// Create a separator since the user asked
sep = new CardViewSeparator( this );
- sep->mRect.moveTopLeft( QPoint( xPos, yPos + d->mItemMargin ) );
+ sep->mRect.moveTopLeft( TQPoint( xPos, yPos + d->mItemMargin ) );
xPos += d->mSepWidth + cardSpacing;
d->mSeparatorList.append( sep );
}
@@ -944,7 +944,7 @@ void CardView::calcLayout()
// Update the height of all the separators now that we know the
// max height of a column
- QPtrListIterator<CardViewSeparator> sepIter( d->mSeparatorList );
+ TQPtrListIterator<CardViewSeparator> sepIter( d->mSeparatorList );
for ( sepIter.toFirst(); sepIter.current(); ++sepIter )
(*sepIter)->mRect.setHeight( maxHeight - 2 * cardSpacing - 2 * d->mItemMargin );
@@ -985,11 +985,11 @@ void CardView::setItemSpacing( uint spacing )
setLayoutDirty( true );
}
-void CardView::contentsMousePressEvent( QMouseEvent *e )
+void CardView::contentsMousePressEvent( TQMouseEvent *e )
{
- QScrollView::contentsMousePressEvent( e );
+ TQScrollView::contentsMousePressEvent( e );
- QPoint pos = contentsToViewport( e->pos() );
+ TQPoint pos = contentsToViewport( e->pos() );
d->mLastClickPos = e->pos();
CardViewItem *item = itemAt( e->pos() );
@@ -1100,9 +1100,9 @@ void CardView::contentsMousePressEvent( QMouseEvent *e )
}
}
-void CardView::contentsMouseReleaseEvent( QMouseEvent *e )
+void CardView::contentsMouseReleaseEvent( TQMouseEvent *e )
{
- QScrollView::contentsMouseReleaseEvent( e );
+ TQScrollView::contentsMouseReleaseEvent( e );
if ( d->mResizeAnchor && d->mSpan ) {
unsetCursor();
@@ -1133,9 +1133,9 @@ void CardView::contentsMouseReleaseEvent( QMouseEvent *e )
emit executed( item );
}
-void CardView::contentsMouseDoubleClickEvent( QMouseEvent *e )
+void CardView::contentsMouseDoubleClickEvent( TQMouseEvent *e )
{
- QScrollView::contentsMouseDoubleClickEvent( e );
+ TQScrollView::contentsMouseDoubleClickEvent( e );
CardViewItem *item = itemAt( e->pos() );
@@ -1148,7 +1148,7 @@ void CardView::contentsMouseDoubleClickEvent( QMouseEvent *e )
emit doubleClicked( item );
}
-void CardView::contentsMouseMoveEvent( QMouseEvent *e )
+void CardView::contentsMouseMoveEvent( TQMouseEvent *e )
{
// resizing
if ( d->mResizeAnchor ) {
@@ -1183,12 +1183,12 @@ void CardView::contentsMouseMoveEvent( QMouseEvent *e )
}
}
-void CardView::enterEvent( QEvent* )
+void CardView::enterEvent( TQEvent* )
{
d->mTimer->start( 500 );
}
-void CardView::leaveEvent( QEvent* )
+void CardView::leaveEvent( TQEvent* )
{
d->mTimer->stop();
if ( d->mOnSeparator ) {
@@ -1197,7 +1197,7 @@ void CardView::leaveEvent( QEvent* )
}
}
-void CardView::focusInEvent( QFocusEvent* )
+void CardView::focusInEvent( TQFocusEvent* )
{
if ( !d->mCurrentItem && d->mItemList.count() )
setCurrentItem( d->mItemList.first() );
@@ -1205,13 +1205,13 @@ void CardView::focusInEvent( QFocusEvent* )
d->mCurrentItem->repaintCard();
}
-void CardView::focusOutEvent( QFocusEvent* )
+void CardView::focusOutEvent( TQFocusEvent* )
{
if ( d->mCurrentItem )
d->mCurrentItem->repaintCard();
}
-void CardView::keyPressEvent( QKeyEvent *e )
+void CardView::keyPressEvent( TQKeyEvent *e )
{
if ( !(childCount() && d->mCurrentItem) ) {
e->ignore();
@@ -1240,12 +1240,12 @@ void CardView::keyPressEvent( QKeyEvent *e )
// look for an item in the previous/next column, starting from
// the vertical middle of the current item.
// FIXME use nice calculatd measures!!!
- QPoint aPoint( d->mCurrentItem->d->x, d->mCurrentItem->d->y );
- aPoint -= QPoint( 30, -(d->mCurrentItem->height() / 2) );
+ TQPoint aPoint( d->mCurrentItem->d->x, d->mCurrentItem->d->y );
+ aPoint -= TQPoint( 30, -(d->mCurrentItem->height() / 2) );
aItem = itemAt( aPoint );
// maybe we hit some space below an item
while ( !aItem && aPoint.y() > 27 ) {
- aPoint -= QPoint( 0, 16 );
+ aPoint -= TQPoint( 0, 16 );
aItem = itemAt( aPoint );
}
if ( aItem )
@@ -1256,11 +1256,11 @@ void CardView::keyPressEvent( QKeyEvent *e )
case Key_Right:
{
// FIXME use nice calculated measures!!!
- QPoint aPoint( d->mCurrentItem->d->x + d->mItemWidth, d->mCurrentItem->d->y );
- aPoint += QPoint( 30, (d->mCurrentItem->height() / 2) );
+ TQPoint aPoint( d->mCurrentItem->d->x + d->mItemWidth, d->mCurrentItem->d->y );
+ aPoint += TQPoint( 30, (d->mCurrentItem->height() / 2) );
aItem = itemAt( aPoint );
while ( !aItem && aPoint.y() > 27 ) {
- aPoint -= QPoint( 0, 16 );
+ aPoint -= TQPoint( 0, 16 );
aItem = itemAt( aPoint );
}
if ( aItem )
@@ -1278,13 +1278,13 @@ void CardView::keyPressEvent( QKeyEvent *e )
break;
case Key_Prior: // PageUp
{
- // QListView: "Make the item above the top visible and current"
+ // TQListView: "Make the item above the top visible and current"
// TODO if contentsY(), pick the top item of the leftmost visible column
if ( contentsX() <= 0 )
return;
int cw = columnWidth();
int theCol = ( QMAX( 0, ( contentsX() / cw) * cw ) ) + d->mItemSpacing;
- aItem = itemAt( QPoint( theCol + 1, d->mItemSpacing + 1 ) );
+ aItem = itemAt( TQPoint( theCol + 1, d->mItemSpacing + 1 ) );
if ( aItem )
setCurrentItem( aItem );
@@ -1292,7 +1292,7 @@ void CardView::keyPressEvent( QKeyEvent *e )
}
case Key_Next: // PageDown
{
- // QListView: "Make the item below the bottom visible and current"
+ // TQListView: "Make the item below the bottom visible and current"
// find the first not fully visible column.
// TODO: consider if a partly visible (or even hidden) item at the
// bottom of the rightmost column exists
@@ -1306,7 +1306,7 @@ void CardView::keyPressEvent( QKeyEvent *e )
while ( theCol > contentsWidth() )
theCol -= columnWidth();
- aItem = itemAt( QPoint( theCol, d->mItemSpacing + 1 ) );
+ aItem = itemAt( TQPoint( theCol, d->mItemSpacing + 1 ) );
if ( aItem )
setCurrentItem( aItem );
@@ -1383,7 +1383,7 @@ void CardView::keyPressEvent( QKeyEvent *e )
}
}
-void CardView::contentsWheelEvent( QWheelEvent *e )
+void CardView::contentsWheelEvent( TQWheelEvent *e )
{
scrollBy( 2 * e->delta() / -3, 0 );
}
@@ -1458,11 +1458,11 @@ void CardView::tryShowFullText()
{
d->mTimer->stop();
// if we have an item
- QPoint cpos = viewportToContents( viewport()->mapFromGlobal( QCursor::pos() ) );
+ TQPoint cpos = viewportToContents( viewport()->mapFromGlobal( TQCursor::pos() ) );
CardViewItem *item = itemAt( cpos );
if ( item ) {
// query it for a value to display
- QPoint ipos = cpos - itemRect( item ).topLeft();
+ TQPoint ipos = cpos - itemRect( item ).topLeft();
item->showFullString( ipos, d->mTip );
}
}
@@ -1477,7 +1477,7 @@ void CardView::drawRubberBands( int pos )
int x = d->mFirstX + tmpcw - d->mSepWidth - contentsX();
int h = visibleHeight();
- QPainter p( viewport() );
+ TQPainter p( viewport() );
p.setRasterOp( XorROP );
p.setPen( gray );
p.setBrush( gray );
@@ -1519,23 +1519,23 @@ void CardView::setItemWidth( int w )
updateContents();
}
-void CardView::setHeaderFont( const QFont &fnt )
+void CardView::setHeaderFont( const TQFont &fnt )
{
d->mHeaderFont = fnt;
delete d->mBFm;
- d->mBFm = new QFontMetrics( fnt );
+ d->mBFm = new TQFontMetrics( fnt );
}
-QFont CardView::headerFont() const
+TQFont CardView::headerFont() const
{
return d->mHeaderFont;
}
-void CardView::setFont( const QFont &fnt )
+void CardView::setFont( const TQFont &fnt )
{
- QScrollView::setFont( fnt );
+ TQScrollView::setFont( fnt );
delete d->mFm;
- d->mFm = new QFontMetrics( fnt );
+ d->mFm = new TQFontMetrics( fnt );
}
int CardView::separatorWidth() const