summaryrefslogtreecommitdiffstats
path: root/kaddressbook/imagewidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kaddressbook/imagewidget.cpp')
-rw-r--r--kaddressbook/imagewidget.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp
index ad0fad55e..ddacc2cd1 100644
--- a/kaddressbook/imagewidget.cpp
+++ b/kaddressbook/imagewidget.cpp
@@ -34,35 +34,35 @@
#include <kurldrag.h>
#include <libkdepim/kpixmapregionselectordialog.h>
-#include <qapplication.h>
-#include <qdragobject.h>
-#include <qeventloop.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qpopupmenu.h>
+#include <tqapplication.h>
+#include <tqdragobject.h>
+#include <tqeventloop.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpixmap.h>
+#include <tqpopupmenu.h>
#include <unistd.h>
#include "imagewidget.h"
-ImageLoader::ImageLoader( QWidget *parent )
- : QObject( 0, "ImageLoader" ), mParent( parent )
+ImageLoader::ImageLoader( TQWidget *parent )
+ : TQObject( 0, "ImageLoader" ), mParent( parent )
{
}
KABC::Picture ImageLoader::loadPicture( const KURL &url, bool *ok )
{
KABC::Picture picture;
- QString tempFile;
+ TQString tempFile;
if ( url.isEmpty() )
return picture;
(*ok) = false;
- QImage image;
+ TQImage image;
if ( url.isLocalFile() ) {
image.load( url.path() );
picture.setData( image );
@@ -80,9 +80,9 @@ KABC::Picture ImageLoader::loadPicture( const KURL &url, bool *ok )
return picture;
}
- QPixmap pixmap = picture.data();
+ TQPixmap pixmap = picture.data();
- QPixmap selectedPixmap = KPIM::KPixmapRegionSelectorDialog::getSelectedImage( pixmap, 100, 140, mParent );
+ TQPixmap selectedPixmap = KPIM::KPixmapRegionSelectorDialog::getSelectedImage( pixmap, 100, 140, mParent );
if ( selectedPixmap.isNull() ) {
(*ok) = false;
return picture;
@@ -103,13 +103,13 @@ KABC::Picture ImageLoader::loadPicture( const KURL &url, bool *ok )
}
-ImageButton::ImageButton( const QString &title, QWidget *parent )
- : QPushButton( title, parent ),
+ImageButton::ImageButton( const TQString &title, TQWidget *parent )
+ : TQPushButton( title, parent ),
mReadOnly( false ), mImageLoader( 0 )
{
setAcceptDrops( true );
- connect( this, SIGNAL( clicked() ), SLOT( load() ) );
+ connect( this, TQT_SIGNAL( clicked() ), TQT_SLOT( load() ) );
}
void ImageButton::setReadOnly( bool readOnly )
@@ -136,7 +136,7 @@ void ImageButton::setImageLoader( ImageLoader *loader )
void ImageButton::startDrag()
{
if ( !mPicture.data().isNull() ) {
- QImageDrag *drag = new QImageDrag( mPicture.data(), this );
+ TQImageDrag *drag = new TQImageDrag( mPicture.data(), this );
drag->dragCopy();
}
}
@@ -149,35 +149,35 @@ void ImageButton::updateGUI()
setPixmap( mPicture.data() );
}
-void ImageButton::dragEnterEvent( QDragEnterEvent *event )
+void ImageButton::dragEnterEvent( TQDragEnterEvent *event )
{
bool accepted = false;
- if ( QImageDrag::canDecode( event ) )
+ if ( TQImageDrag::canDecode( event ) )
accepted = true;
- if ( QUriDrag::canDecode( event ) )
+ if ( TQUriDrag::canDecode( event ) )
accepted = true;
event->accept( accepted );
}
-void ImageButton::dropEvent( QDropEvent *event )
+void ImageButton::dropEvent( TQDropEvent *event )
{
if ( mReadOnly )
return;
- if ( QImageDrag::canDecode( event ) ) {
- QPixmap pm;
+ if ( TQImageDrag::canDecode( event ) ) {
+ TQPixmap pm;
- if ( QImageDrag::decode( event, pm ) ) {
+ if ( TQImageDrag::decode( event, pm ) ) {
mPicture.setData( pm.convertToImage() );
updateGUI();
emit changed();
}
}
- if ( QUriDrag::canDecode( event ) ) {
+ if ( TQUriDrag::canDecode( event ) ) {
KURL::List urls;
if ( KURLDrag::decode( event, urls ) ) {
if ( urls.isEmpty() ) { // oops, no data
@@ -198,13 +198,13 @@ void ImageButton::dropEvent( QDropEvent *event )
}
}
-void ImageButton::mousePressEvent( QMouseEvent *event )
+void ImageButton::mousePressEvent( TQMouseEvent *event )
{
mDragStartPos = event->pos();
- QPushButton::mousePressEvent( event );
+ TQPushButton::mousePressEvent( event );
}
-void ImageButton::mouseMoveEvent( QMouseEvent *event )
+void ImageButton::mouseMoveEvent( TQMouseEvent *event )
{
if ( (event->state() & LeftButton) &&
(event->pos() - mDragStartPos).manhattanLength() >
@@ -213,16 +213,16 @@ void ImageButton::mouseMoveEvent( QMouseEvent *event )
}
}
-void ImageButton::contextMenuEvent( QContextMenuEvent *event )
+void ImageButton::contextMenuEvent( TQContextMenuEvent *event )
{
- QPopupMenu menu( this );
- menu.insertItem( i18n( "Reset" ), this, SLOT( clear() ) );
+ TQPopupMenu menu( this );
+ menu.insertItem( i18n( "Reset" ), this, TQT_SLOT( clear() ) );
menu.exec( event->globalPos() );
}
void ImageButton::load()
{
- KURL url = KFileDialog::getOpenURL( QString(), KImageIO::pattern(), this );
+ KURL url = KFileDialog::getOpenURL( TQString(), KImageIO::pattern(), this );
if ( url.isValid() ) {
if ( mImageLoader ) {
bool ok = false;
@@ -244,16 +244,16 @@ void ImageButton::clear()
emit changed();
}
-ImageBaseWidget::ImageBaseWidget( const QString &title,
- QWidget *parent, const char *name )
- : QWidget( parent, name ), mReadOnly( false )
+ImageBaseWidget::ImageBaseWidget( const TQString &title,
+ TQWidget *parent, const char *name )
+ : TQWidget( parent, name ), mReadOnly( false )
{
mImageLoader = new ImageLoader( this );
- QVBoxLayout *topLayout = new QVBoxLayout( this, KDialog::marginHint(),
+ TQVBoxLayout *topLayout = new TQVBoxLayout( this, KDialog::marginHint(),
KDialog::spacingHint() );
- QGroupBox *box = new QGroupBox( 0, Qt::Vertical, title, this );
- QVBoxLayout *layout = new QVBoxLayout( box->layout(), KDialog::spacingHint() );
+ TQGroupBox *box = new TQGroupBox( 0, Qt::Vertical, title, this );
+ TQVBoxLayout *layout = new TQVBoxLayout( box->layout(), KDialog::spacingHint() );
mImageButton = new ImageButton( i18n( "Picture" ), box );
mImageButton->setFixedSize( 100, 140 );
@@ -262,7 +262,7 @@ ImageBaseWidget::ImageBaseWidget( const QString &title,
topLayout->addWidget( box );
- connect( mImageButton, SIGNAL( changed() ), SIGNAL( changed() ) );
+ connect( mImageButton, TQT_SIGNAL( changed() ), TQT_SIGNAL( changed() ) );
}
ImageBaseWidget::~ImageBaseWidget()
@@ -288,10 +288,10 @@ KABC::Picture ImageBaseWidget::image() const
}
-ImageWidget::ImageWidget( KABC::AddressBook *ab, QWidget *parent, const char *name )
+ImageWidget::ImageWidget( KABC::AddressBook *ab, TQWidget *parent, const char *name )
: KAB::ContactEditorWidget( ab, parent, name )
{
- QHBoxLayout *layout = new QHBoxLayout( this, KDialog::marginHint(),
+ TQHBoxLayout *layout = new TQHBoxLayout( this, KDialog::marginHint(),
KDialog::spacingHint() );
mPhotoWidget = new ImageBaseWidget( KABC::Addressee::photoLabel(), this );
@@ -300,8 +300,8 @@ ImageWidget::ImageWidget( KABC::AddressBook *ab, QWidget *parent, const char *na
mLogoWidget = new ImageBaseWidget( KABC::Addressee::logoLabel(), this );
layout->addWidget( mLogoWidget );
- connect( mPhotoWidget, SIGNAL( changed() ), SLOT( setModified() ) );
- connect( mLogoWidget, SIGNAL( changed() ), SLOT( setModified() ) );
+ connect( mPhotoWidget, TQT_SIGNAL( changed() ), TQT_SLOT( setModified() ) );
+ connect( mLogoWidget, TQT_SIGNAL( changed() ), TQT_SLOT( setModified() ) );
}
void ImageWidget::loadContact( KABC::Addressee *addr )