diff options
Diffstat (limited to 'kexi/plugins/forms/widgets/kexidbimagebox.cpp')
-rw-r--r-- | kexi/plugins/forms/widgets/kexidbimagebox.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/kexi/plugins/forms/widgets/kexidbimagebox.cpp b/kexi/plugins/forms/widgets/kexidbimagebox.cpp index 4165c000..23f079ae 100644 --- a/kexi/plugins/forms/widgets/kexidbimagebox.cpp +++ b/kexi/plugins/forms/widgets/kexidbimagebox.cpp @@ -23,7 +23,7 @@ #include <tqapplication.h> #include <tqpixmap.h> #include <tqstyle.h> -#include <tqclipboard.h> +#include <clipboard.h> #include <tqtooltip.h> #include <tqimage.h> #include <tqbuffer.h> @@ -67,7 +67,7 @@ static TQPixmap* KexiDBImageBox_pmSmall = 0; KexiDBImageBox::KexiDBImageBox( bool designMode, TQWidget *parent, const char *name ) : KexiFrame( parent, name, TQt::WNoAutoErase ) , KexiFormDataItemInterface() - , m_tqalignment(TQt::AlignAuto|TQt::AlignTop) + , m_alignment(TQt::AlignAuto|TQt::AlignTop) , m_designMode(designMode) , m_readOnly(false) , m_scaledContents(false) @@ -80,7 +80,7 @@ KexiDBImageBox::KexiDBImageBox( bool designMode, TQWidget *parent, const char *n , m_insideSetPalette(false) { installEventFilter(this); - tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred); + setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred); //setup popup menu m_popupMenu = new KexiImageContextMenu(this); @@ -176,7 +176,7 @@ void KexiDBImageBox::setValueInternal( const TQVariant& add, bool removeOld, boo m_valueMimeType = TQString(); m_pixmap = TQPixmap(); } - tqrepaint(); + repaint(); } void KexiDBImageBox::setInvalidState( const TQString& displayText ) @@ -242,7 +242,7 @@ void KexiDBImageBox::setPixmapId(uint id) if (m_insideSetData) //avoid recursion return; setData(KexiBLOBBuffer::self()->objectForId( id, /*unstored*/false )); - tqrepaint(); + repaint(); } uint KexiDBImageBox::storedPixmapId() const @@ -257,7 +257,7 @@ uint KexiDBImageBox::storedPixmapId() const void KexiDBImageBox::setStoredPixmapId(uint id) { setData(KexiBLOBBuffer::self()->objectForId( id, /*stored*/true )); - tqrepaint(); + repaint(); } bool KexiDBImageBox::hasScaledContents() const @@ -276,14 +276,14 @@ void KexiDBImageBox::setScaledContents(bool set) { //todo m_pixmapLabel->setScaledContents(set); m_scaledContents = set; - tqrepaint(); + repaint(); } void KexiDBImageBox::setKeepAspectRatio(bool set) { m_keepAspectRatio = set; if (m_scaledContents) - tqrepaint(); + repaint(); } TQWidget* KexiDBImageBox::widget() @@ -331,7 +331,7 @@ void KexiDBImageBox::handleInsertFromFileAction(const KURL& url) if (!h) return; setData(h); - tqrepaint(); + repaint(); } else { //db-aware @@ -401,14 +401,14 @@ void KexiDBImageBox::handleCutAction() void KexiDBImageBox::handleCopyAction() { - tqApp->tqclipboard()->setPixmap(pixmap(), TQClipboard::Clipboard); + tqApp->clipboard()->setPixmap(pixmap(), TQClipboard::Clipboard); } void KexiDBImageBox::handlePasteAction() { if (isReadOnly() || (!m_designMode && !hasFocus())) return; - TQPixmap pm( tqApp->tqclipboard()->pixmap(TQClipboard::Clipboard) ); + TQPixmap pm( tqApp->clipboard()->pixmap(TQClipboard::Clipboard) ); // if (!pm.isNull()) // setValueInternal(pm, true); if (dataSource().isEmpty()) { @@ -429,7 +429,7 @@ void KexiDBImageBox::handlePasteAction() } } - tqrepaint(); + repaint(); if (!dataSource().isEmpty()) { // emit pixmapChanged(); signalValueChanged(); @@ -455,7 +455,7 @@ void KexiDBImageBox::clear() //! @todo emit signal for setting "dirty" flag within the design // m_pixmap = TQPixmap(); //will be loaded on demand - tqrepaint(); + repaint(); if (!dataSource().isEmpty()) { // emit pixmapChanged();//valueChanged(data()); signalValueChanged(); @@ -522,17 +522,17 @@ void KexiDBImageBox::slotToggled(bool on) TQRect screen = tqApp->desktop()->availableGeometry( m_chooser ); TQPoint p; if ( TQApplication::reverseLayout() ) { - if ( (mapToGlobal( m_chooser->rect().bottomLeft() ).y() + m_popupMenu->tqsizeHint().height()) <= screen.height() ) + if ( (mapToGlobal( m_chooser->rect().bottomLeft() ).y() + m_popupMenu->sizeHint().height()) <= screen.height() ) p = m_chooser->mapToGlobal( m_chooser->rect().bottomRight() ); else - p = m_chooser->mapToGlobal( m_chooser->rect().topRight() - TQPoint( 0, m_popupMenu->tqsizeHint().height() ) ); - p.rx() -= m_popupMenu->tqsizeHint().width(); + p = m_chooser->mapToGlobal( m_chooser->rect().topRight() - TQPoint( 0, m_popupMenu->sizeHint().height() ) ); + p.rx() -= m_popupMenu->sizeHint().width(); } else { - if ( (m_chooser->mapToGlobal( m_chooser->rect().bottomLeft() ).y() + m_popupMenu->tqsizeHint().height()) <= screen.height() ) + if ( (m_chooser->mapToGlobal( m_chooser->rect().bottomLeft() ).y() + m_popupMenu->sizeHint().height()) <= screen.height() ) p = m_chooser->mapToGlobal( m_chooser->rect().bottomLeft() ); else - p = m_chooser->mapToGlobal( m_chooser->rect().topLeft() - TQPoint( 0, m_popupMenu->tqsizeHint().height() ) ); + p = m_chooser->mapToGlobal( m_chooser->rect().topLeft() - TQPoint( 0, m_popupMenu->sizeHint().height() ) ); } if (!m_popupMenu->isVisible() && on) { m_popupMenu->exec( p, -1 ); @@ -573,7 +573,7 @@ void KexiDBImageBox::updateActionStrings() (see doc/dev/settings.txt) */ beautifiedImageBoxName = beautifiedImageBoxName[0].upper() + beautifiedImageBoxName.mid(1); } - TQToolTip::add(m_chooser, i18n("Click to show actions for \"%1\" image box").tqarg(beautifiedImageBoxName)); + TQToolTip::add(m_chooser, i18n("Click to show actions for \"%1\" image box").arg(beautifiedImageBoxName)); } } } @@ -610,11 +610,11 @@ void KexiDBImageBox::setDataSource( const TQString &ds ) } if (!m_paletteBackgroundColorChanged && parentWidget()) { KexiFrame::setPaletteBackgroundColor( - dataSource().isEmpty() ? parentWidget()->paletteBackgroundColor() : tqpalette().active().base() ); + dataSource().isEmpty() ? parentWidget()->paletteBackgroundColor() : palette().active().base() ); } } -TQSize KexiDBImageBox::tqsizeHint() const +TQSize KexiDBImageBox::sizeHint() const { if (pixmap().isNull()) return TQSize(80, 80); @@ -640,7 +640,7 @@ void KexiDBImageBox::paintEvent( TQPaintEvent *pe ) if (m_designMode && pixmap().isNull()) { TQPixmap pm(size()-TQSize(m, m)); TQPainter p2; - p2.tqbegin(TQT_TQPAINTDEVICE(&pm), this); + p2.begin(TQT_TQPAINTDEVICE(&pm), this); p2.fillRect(0,0,width(),height(), bg); updatePixmap(); @@ -665,7 +665,7 @@ void KexiDBImageBox::paintEvent( TQPaintEvent *pe ) p2.setPen( KexiUtils::contrastColor( bg ) ); p2.drawText(pm.rect(), TQt::AlignCenter, dataSource().isEmpty() - ? TQString::tqfromLatin1(name())+"\n"+i18n("Unbound Image Box", "(unbound)") //i18n("No Image") + ? TQString::fromLatin1(name())+"\n"+i18n("Unbound Image Box", "(unbound)") //i18n("No Image") : dataSource()); p2.end(); bitBlt(this, m, m, &pm); @@ -678,7 +678,7 @@ void KexiDBImageBox::paintEvent( TQPaintEvent *pe ) //clearing needed here because we may need to draw a pixmap with transparency p.fillRect(0,0,width(),height(), bg); - KexiUtils::drawPixmap( p, m, TQRect(TQPoint(0,0), internalSize), pixmap(), m_tqalignment, + KexiUtils::drawPixmap( p, m, TQRect(TQPoint(0,0), internalSize), pixmap(), m_alignment, m_scaledContents, m_keepAspectRatio ); } KexiFrame::drawFrame( &p ); @@ -687,7 +687,7 @@ void KexiDBImageBox::paintEvent( TQPaintEvent *pe ) if (!m_designMode && !dataSource().isEmpty() && hasFocus() && (!m_chooser || !m_chooser->isVisible())) { tqstyle().tqdrawPrimitive( TQStyle::PE_FocusRect, &p, tqstyle().subRect(TQStyle::SR_PushButtonContents, this), - tqpalette().active() ); + palette().active() ); } } @@ -697,7 +697,7 @@ void KexiDBImageBox::paintEvent( TQPaintEvent *pe ) if (oldPalette.active().background()!=palette().active().background()) { delete KexiDBImageBox_pm; KexiDBImageBox_pm = 0; - tqrepaint(); + repaint(); } }*/ @@ -715,11 +715,11 @@ void KexiDBImageBox::updatePixmap() } } -void KexiDBImageBox::tqsetAlignment(int tqalignment) +void KexiDBImageBox::setAlignment(int alignment) { - m_tqalignment = tqalignment; + m_alignment = alignment; if (!m_scaledContents || m_keepAspectRatio) - tqrepaint(); + repaint(); } void KexiDBImageBox::setData(const KexiBLOBBuffer::Handle& handle) @@ -737,7 +737,7 @@ void KexiDBImageBox::resizeEvent( TQResizeEvent * e ) { KexiFrame::resizeEvent(e); if (m_chooser) { - TQSize s( m_chooser->tqsizeHint() ); + TQSize s( m_chooser->sizeHint() ); TQSize margin( realLineWidth(), realLineWidth() ); s.setHeight( height() - 2*margin.height() ); s = s.boundedTo( size()-2*margin ); @@ -839,7 +839,7 @@ bool KexiDBImageBox::eventFilter( TQObject * watched, TQEvent * e ) { if (TQT_BASE_OBJECT(watched)==TQT_BASE_OBJECT(this) || TQT_BASE_OBJECT(watched)==TQT_BASE_OBJECT(m_chooser)) { //we're watching chooser as well because it's a focus proxy even if invisible if (e->type()==TQEvent::FocusIn || e->type()==TQEvent::FocusOut || e->type()==TQEvent::MouseButtonPress) { - update(); //to tqrepaint focus rect + update(); //to repaint focus rect } } // hide popup menu as soon as it loses focus |