summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/pixmapchooser.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/pixmapchooser.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/pixmapchooser.cpp')
-rw-r--r--kdevdesigner/designer/pixmapchooser.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/kdevdesigner/designer/pixmapchooser.cpp b/kdevdesigner/designer/pixmapchooser.cpp
index 28912c62..4d6ad2ed 100644
--- a/kdevdesigner/designer/pixmapchooser.cpp
+++ b/kdevdesigner/designer/pixmapchooser.cpp
@@ -1,15 +1,15 @@
/**********************************************************************
** Copyright (C) 2000-2001 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.
@@ -56,8 +56,8 @@
static ImageIconProvider *imageIconProvider = 0;
#endif
-PixmapView::PixmapView( TQWidget *parent )
- : TQScrollView( parent )
+PixmapView::PixmapView( TQWidget *tqparent )
+ : TQScrollView( tqparent )
{
viewport()->setBackgroundMode( PaletteBase );
}
@@ -66,12 +66,12 @@ void PixmapView::setPixmap( const TQPixmap &pix )
{
pixmap = pix;
resizeContents( pixmap.size().width(), pixmap.size().height() );
- viewport()->repaint( FALSE );
+ viewport()->tqrepaint( FALSE );
}
void PixmapView::drawContents( TQPainter *p, int cx, int cy, int cw, int ch )
{
- p->fillRect( cx, cy, cw, ch, colorGroup().brush( TQColorGroup::Base ) );
+ p->fillRect( cx, cy, cw, ch, tqcolorGroup().brush( TQColorGroup::Base ) );
p->drawPixmap( 0, 0, pixmap );
}
@@ -89,7 +89,7 @@ void PixmapView::previewUrl( const TQUrl &u )
static void buildImageFormatList( TQString &filter, TQString &all )
{
- all = qApp->translate( "qChoosePixmap", "All Pixmaps (" );
+ all = tqApp->translate( "qChoosePixmap", "All Pixmaps (" );
for ( uint i = 0; i < TQImageIO::outputFormats().count(); i++ ) {
TQString outputFormat = TQImageIO::outputFormats().at( i );
TQString outputExtension;
@@ -97,15 +97,15 @@ static void buildImageFormatList( TQString &filter, TQString &all )
outputExtension = outputFormat.lower();
else
outputExtension = "jpg;*.jpeg";
- filter += qApp->translate( "qChoosePixmap", "%1-Pixmaps (%2)\n" ).
- arg( outputFormat ).arg( "*." + outputExtension);
+ filter += TQString(tqApp->translate( "qChoosePixmap", "%1-Pixmaps (%2)\n" )).
+ tqarg( outputFormat ).tqarg( "*." + outputExtension);
all += "*." + outputExtension + ";";
}
- filter.prepend( all + qApp->translate( "qChoosePixmap", ")\n" ) );
- filter += qApp->translate( "qChoosePixmap", "All Files (*)" );
+ filter.prepend( all + tqApp->translate( "qChoosePixmap", ")\n" ) );
+ filter += tqApp->translate( "qChoosePixmap", "All Files (*)" );
}
-TQStringList qChoosePixmaps( TQWidget *parent )
+TQStringList qChoosePixmaps( TQWidget *tqparent )
{
/* if ( !imageIconProvider && !TQFileDialog::iconProvider() )
TQFileDialog::setIconProvider( ( imageIconProvider = new ImageIconProvider ) );
@@ -114,21 +114,21 @@ TQStringList qChoosePixmaps( TQWidget *parent )
TQString all;
buildImageFormatList( filter, all );
- TQFileDialog fd( TQString::null, filter, parent, 0, TRUE );
+ TQFileDialog fd( TQString(), filter, tqparent, 0, TRUE );
fd.setMode( TQFileDialog::ExistingFiles );
fd.setContentsPreviewEnabled( TRUE );
PixmapView *pw = new PixmapView( &fd );
fd.setContentsPreview( pw, pw );
fd.setViewMode( TQFileDialog::List );
fd.setPreviewMode( TQFileDialog::Contents );
- fd.setCaption( qApp->translate( "qChoosePixmap", "Choose Images..." ) );
+ fd.setCaption( tqApp->translate( "qChoosePixmap", "Choose Images..." ) );
if ( fd.exec() == TQDialog::Accepted )
return fd.selectedFiles();
return TQStringList();*/
TQStringList mimetypes = KImageIO::mimeTypes( KImageIO::Reading );
- KFileDialog dlg(TQString::null, mimetypes.join(" "), parent, "filedialog", true);
+ KFileDialog dlg(TQString(), mimetypes.join(" "), tqparent, "filedialog", true);
dlg.setOperationMode( KFileDialog::Opening );
- dlg.setCaption( qApp->translate( "qChoosePixmap", "Choose Images..." ) );
+ dlg.setCaption( tqApp->translate( "qChoosePixmap", "Choose Images..." ) );
dlg.setMode( KFile::Files );
KImageFilePreview *ip = new KImageFilePreview( &dlg );
dlg.setPreviewWidget( ip );
@@ -137,7 +137,7 @@ TQStringList qChoosePixmaps( TQWidget *parent )
return TQStringList();
}
-TQPixmap qChoosePixmap( TQWidget *parent, FormWindow *fw, const TQPixmap &old, TQString *fn )
+TQPixmap qChoosePixmap( TQWidget *tqparent, FormWindow *fw, const TQPixmap &old, TQString *fn )
{
#if defined(DESIGNER)
if ( !fw || fw->savePixmapInline() ) {
@@ -148,13 +148,13 @@ TQPixmap qChoosePixmap( TQWidget *parent, FormWindow *fw, const TQPixmap &old, T
TQString all;
buildImageFormatList( filter, all );
- TQFileDialog fd( TQString::null, filter, parent, 0, TRUE );
+ TQFileDialog fd( TQString(), filter, tqparent, 0, TRUE );
fd.setContentsPreviewEnabled( TRUE );
PixmapView *pw = new PixmapView( &fd );
fd.setContentsPreview( pw, pw );
fd.setViewMode( TQFileDialog::List );
fd.setPreviewMode( TQFileDialog::Contents );
- fd.setCaption( qApp->translate( "qChoosePixmap", "Choose Pixmap" ) );
+ fd.setCaption( tqApp->translate( "qChoosePixmap", "Choose Pixmap" ) );
if ( fd.exec() == TQDialog::Accepted ) {
TQPixmap pix( fd.selectedFile() );
if ( fn )
@@ -163,9 +163,9 @@ TQPixmap qChoosePixmap( TQWidget *parent, FormWindow *fw, const TQPixmap &old, T
return pix;
}*/
TQStringList mimetypes = KImageIO::mimeTypes( KImageIO::Reading );
- KFileDialog dlg(TQString::null, mimetypes.join(" "), parent, "filedialog", true);
+ KFileDialog dlg(TQString(), mimetypes.join(" "), tqparent, "filedialog", true);
dlg.setOperationMode( KFileDialog::Opening );
- dlg.setCaption( qApp->translate( "qChoosePixmap", "Choose Pixmap" ) );
+ dlg.setCaption( tqApp->translate( "qChoosePixmap", "Choose Pixmap" ) );
dlg.setMode( KFile::File );
KImageFilePreview *ip = new KImageFilePreview( &dlg );
dlg.setPreviewWidget( ip );
@@ -174,44 +174,44 @@ TQPixmap qChoosePixmap( TQWidget *parent, FormWindow *fw, const TQPixmap &old, T
TQPixmap pix( dlg.selectedURL().path() );
if ( fn )
*fn = dlg.selectedURL().path();
- MetaDataBase::setPixmapArgument( fw, pix.serialNumber(), dlg.selectedURL().path() );
+ MetaDataBase::setPixmapArgument( TQT_TQOBJECT(fw), pix.serialNumber(), dlg.selectedURL().path() );
return pix;
}
} else if ( fw && fw->savePixmapInProject() ) {
- PixmapCollectionEditor dia( parent, 0, TRUE );
+ PixmapCollectionEditor dia( tqparent, 0, TRUE );
dia.setProject( fw->project() );
dia.setChooserMode( TRUE );
- dia.setCurrentItem( MetaDataBase::pixmapKey( fw, old.serialNumber() ) );
+ dia.setCurrentItem( MetaDataBase::pixmapKey( TQT_TQOBJECT(fw), old.serialNumber() ) );
if ( dia.exec() == TQDialog::Accepted ) {
TQPixmap pix( fw->project()->pixmapCollection()->pixmap( dia.viewPixmaps->currentItem()->text() ) );
- MetaDataBase::setPixmapKey( fw, pix.serialNumber(), dia.viewPixmaps->currentItem()->text() );
+ MetaDataBase::setPixmapKey( TQT_TQOBJECT(fw), pix.serialNumber(), dia.viewPixmaps->currentItem()->text() );
return pix;
}
} else {
- PixmapFunction dia( parent, 0, TRUE );
+ PixmapFunction dia( tqparent, 0, TRUE );
TQObject::connect( dia.helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
dia.labelFunction->setText( fw->pixmapLoaderFunction() + "(" );
- dia.editArguments->setText( MetaDataBase::pixmapArgument( fw, old.serialNumber() ) );
+ dia.editArguments->setText( MetaDataBase::pixmapArgument( TQT_TQOBJECT(fw), old.serialNumber() ) );
dia.editArguments->setFocus();
if ( dia.exec() == TQDialog::Accepted ) {
TQPixmap pix;
// we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that
pix.convertFromImage( BarIcon( "designer_image.png", KDevDesignerPartFactory::instance() ).convertToImage() );
- MetaDataBase::setPixmapArgument( fw, pix.serialNumber(), dia.editArguments->text() );
+ MetaDataBase::setPixmapArgument( TQT_TQOBJECT(fw), pix.serialNumber(), dia.editArguments->text() );
return pix;
}
}
#else
- Q_UNUSED( parent );
+ Q_UNUSED( tqparent );
Q_UNUSED( fw );
Q_UNUSED( old );
#endif
return TQPixmap();
}
-ImageIconProvider::ImageIconProvider( TQWidget *parent, const char *name )
- : TQFileIconProvider( parent, name ), imagepm( BarIcon( "designer_image.png", KDevDesignerPartFactory::instance() ) )
+ImageIconProvider::ImageIconProvider( TQWidget *tqparent, const char *name )
+ : TQFileIconProvider( TQT_TQOBJECT(tqparent), name ), imagepm( BarIcon( "designer_image.png", KDevDesignerPartFactory::instance() ) )
{
fmts = TQImage::inputFormats();
}
@@ -223,7 +223,7 @@ ImageIconProvider::~ImageIconProvider()
const TQPixmap * ImageIconProvider::pixmap( const TQFileInfo &fi )
{
TQString ext = fi.extension().upper();
- if ( fmts.contains( ext ) ) {
+ if ( fmts.tqcontains( ext ) ) {
return &imagepm;
} else {
return TQFileIconProvider::pixmap( fi );