summaryrefslogtreecommitdiffstats
path: root/kommander/editor/pixmapchooser.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /kommander/editor/pixmapchooser.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/pixmapchooser.cpp')
-rw-r--r--kommander/editor/pixmapchooser.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/kommander/editor/pixmapchooser.cpp b/kommander/editor/pixmapchooser.cpp
index 92512c68..f0e8ab3a 100644
--- a/kommander/editor/pixmapchooser.cpp
+++ b/kommander/editor/pixmapchooser.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
** 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
@@ -50,8 +50,8 @@
#if defined(DESIGNER)
#include "pics/images.h"
-#ifdef Q_WS_MACX
-//logo is 40x40 on the mac, if it changes - please notify the Qt/Mac team
+#ifdef TQ_WS_MACX
+//logo is 40x40 on the mac, if it changes - please notify the TQt/Mac team
static const char * const logo_xpm[] = {
"40 40 543 2",
" c None",
@@ -876,8 +876,8 @@ static ImageIconProvider *imageIconProvider = 0;
static PixmapChooser *pixmapChooser = 0;
#endif
-PixmapView::PixmapView( TQWidget *parent )
- : TQScrollView( parent )
+PixmapView::PixmapView( TQWidget *tqparent )
+ : TQScrollView( tqparent )
{
viewport()->setBackgroundMode( PaletteBase );
}
@@ -886,12 +886,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 );
}
@@ -907,36 +907,36 @@ void PixmapView::previewUrl( const TQUrl &u )
}
}
-TQStringList qChoosePixmaps( TQWidget *parent )
+TQStringList qChoosePixmaps( TQWidget *tqparent )
{
if ( !imageIconProvider && !TQFileDialog::iconProvider() )
TQFileDialog::setIconProvider( ( imageIconProvider = new ImageIconProvider ) );
TQString filter;
- TQString all = qApp->translate( "qChoosePixmap", "All Pixmaps (" );
+ TQString all = tqApp->translate( "qChoosePixmap", "All Pixmaps (" );
for ( uint i = 0; i < TQImageIO::outputFormats().count(); i++ ) {
- filter += qApp->translate( "qChoosePixmap", "%1-Pixmaps (%2)\n" ).
+ filter += tqApp->translate( "qChoosePixmap", "%1-Pixmaps (%2)\n" ).
arg( TQImageIO::outputFormats().at( i ) ).
arg( "*." + TQString( TQImageIO::outputFormats().at( i ) ).lower() );
all += "*." + TQString( TQImageIO::outputFormats().at( i ) ).lower() + ";";
}
- 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 (*)" );
- 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();
}
-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() ) {
@@ -955,7 +955,7 @@ TQPixmap qChoosePixmap( TQWidget *parent, FormWindow *fw, const TQPixmap &old, T
filter.prepend( all + ")\n" );
filter += i18n( "All Files (*)" );
- 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 );
@@ -966,13 +966,13 @@ TQPixmap qChoosePixmap( TQWidget *parent, FormWindow *fw, const TQPixmap &old, T
TQPixmap pix( fd.selectedFile() );
if ( fn )
*fn = fd.selectedFile();
- MetaDataBase::setPixmapArgument( fw, pix.serialNumber(), fd.selectedFile() );
+ MetaDataBase::setPixmapArgument( TQT_TQOBJECT(fw), pix.serialNumber(), fd.selectedFile() );
return pix;
}
}
#ifndef KOMMANDER
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() ) );
@@ -984,27 +984,27 @@ TQPixmap qChoosePixmap( TQWidget *parent, FormWindow *fw, const TQPixmap &old, T
}
#endif
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( PixmapChooser::loadPixmap( "image.xpm" ) );
- 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( PixmapChooser::loadPixmap( "image.xpm", PixmapChooser::Mini ) )
+ImageIconProvider::ImageIconProvider( TQWidget *tqparent, const char *name )
+ : TQFileIconProvider( TQT_TQOBJECT(tqparent), name ), imagepm( PixmapChooser::loadPixmap( "image.xpm", PixmapChooser::Mini ) )
{
fmts = TQImage::inputFormats();
}
@@ -1016,7 +1016,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 );