diff options
Diffstat (limited to 'kicker-applets/kolourpicker')
-rw-r--r-- | kicker-applets/kolourpicker/kolourpicker.cpp | 48 | ||||
-rw-r--r-- | kicker-applets/kolourpicker/kolourpicker.h | 3 | ||||
-rw-r--r-- | kicker-applets/kolourpicker/simplebutton.cpp | 36 | ||||
-rw-r--r-- | kicker-applets/kolourpicker/simplebutton.h | 20 |
4 files changed, 55 insertions, 52 deletions
diff --git a/kicker-applets/kolourpicker/kolourpicker.cpp b/kicker-applets/kolourpicker/kolourpicker.cpp index cadbb2d..b415032 100644 --- a/kicker-applets/kolourpicker/kolourpicker.cpp +++ b/kicker-applets/kolourpicker/kolourpicker.cpp @@ -48,18 +48,18 @@ $Id$ // Applet initialization function extern "C" { - KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile) + KDE_EXPORT KPanelApplet* init(TQWidget *tqparent, const TQString& configFile) { KGlobal::locale()->insertCatalogue("kolourpicker"); return new KolourPicker(configFile, KPanelApplet::Normal, KPanelApplet::About, - parent, "kolourpicker"); + tqparent, "kolourpicker"); } } KolourPicker::KolourPicker(const TQString& configFile, Type type, - int actions, TQWidget *parent, const char *name) - : KPanelApplet(configFile, type, actions, parent, name), + int actions, TQWidget *tqparent, const char *name) + : KPanelApplet(configFile, type, actions, tqparent, name), m_picking(0) { KAboutData *about = new KAboutData("kolourpicker", @@ -140,7 +140,7 @@ void KolourPicker::slotHistory() TQPopupMenu *sub = copyPopup(*it, false); subMenus.append(sub); popup.insertItem(colorPixmap(*it), - TQString("%1, %2, %3").arg((*it).red()).arg((*it).green()).arg((*it).blue()), + TQString("%1, %2, %3").tqarg((*it).red()).tqarg((*it).green()).tqarg((*it).blue()), sub); } popup.insertSeparator(); @@ -157,7 +157,7 @@ void KolourPicker::slotHistory() conf->sync(); } else if (id != -1) - setClipboard(popup.findItem(id)->text()); + setClipboard(popup.tqfindItem(id)->text()); } void KolourPicker::mouseReleaseEvent(TQMouseEvent *e) @@ -167,14 +167,14 @@ void KolourPicker::mouseReleaseEvent(TQMouseEvent *e) m_picking = false; releaseMouse(); releaseKeyboard(); - TQWidget *desktop = TQApplication::desktop(); + TQWidget *desktop = TQT_TQWIDGET(TQApplication::desktop()); TQPixmap pm = TQPixmap::grabWindow(desktop->winId(), e->globalPos().x(), e->globalPos().y(), 1, 1); TQImage img = pm.convertToImage(); TQColor color(img.pixel(0, 0)); // eventually remove a dupe - TQValueListIterator<TQColor> dupe = m_history.find(color); + TQValueListIterator<TQColor> dupe = m_history.tqfind(color); if (dupe != m_history.end()) m_history.remove(dupe); @@ -198,7 +198,7 @@ void KolourPicker::mouseReleaseEvent(TQMouseEvent *e) TQPopupMenu *popup = copyPopup(color, true); int id = popup->exec(e->globalPos()); if (id != -1) - setClipboard( popup->findItem(id)->text() ); + setClipboard( popup->tqfindItem(id)->text() ); delete popup; } else @@ -208,7 +208,7 @@ void KolourPicker::mouseReleaseEvent(TQMouseEvent *e) // set both clipboard and selection void KolourPicker::setClipboard(const TQString& text) { - QClipboard *clip = TQApplication::clipboard(); + TQClipboard *clip = TQApplication::tqclipboard(); bool oldMode = clip->selectionModeEnabled(); clip->setSelectionMode(true); clip->setText(text); @@ -242,19 +242,19 @@ void KolourPicker::arrangeButtons() { int h, w, p; - if (orientation() == Horizontal) + if (orientation() ==Qt::Horizontal) { h = height(); if (h > 40) { - // vertical layout + // vertical tqlayout p = (h - 40)/3; m_colourButton->setGeometry(2, p, 20, 20); m_historyButton->setGeometry(2, 2*p+20, 20, 20); } else { - // horizontal layout + // horizontal tqlayout p = (h - 20)/2; m_colourButton->setGeometry(2, p, 20, 20); m_historyButton->setGeometry(24, p, 20, 20); @@ -265,14 +265,14 @@ void KolourPicker::arrangeButtons() w = width(); if (w > 40) { - // horizontal layout + // horizontal tqlayout p = (w - 40)/3; m_colourButton->setGeometry(p, 2, 20, 20); m_historyButton->setGeometry(2*p+20, 2, 20, 20); } else { - // vertical layout + // vertical tqlayout p = (w - 20)/2; m_colourButton->setGeometry(p, 2, 20, 20); m_historyButton->setGeometry(p, 24, 20, 20); @@ -294,7 +294,7 @@ TQPopupMenu *KolourPicker::copyPopup(const TQColor &c, bool title) const // HTML, lower case hex chars value.sprintf("#%.2x%.2x%.2x", c.red(), c.green(), c.blue()); popup->insertItem(SmallIcon("html"), value); - if (value.find(TQRegExp("[a-f]")) >= 0) + if (value.tqfind(TQRegExp("[a-f]")) >= 0) { // HTML, upper case hex chars value.sprintf("#%.2X%.2X%.2X", c.red(), c.green(), c.blue()); @@ -303,7 +303,7 @@ TQPopupMenu *KolourPicker::copyPopup(const TQColor &c, bool title) const // lower case hex chars value.sprintf( "%.2x%.2x%.2x", c.red(), c.green(), c.blue() ); popup->insertItem( SmallIcon( "html" ), value ); - if ( value.find( TQRegExp( "[a-f]" ) ) >= 0 ) + if ( value.tqfind( TQRegExp( "[a-f]" ) ) >= 0 ) { // upper case hex chars value.sprintf( "%.2X%.2X%.2X", c.red(), c.green(), c.blue() ); @@ -336,19 +336,19 @@ TQPixmap KolourPicker::colorPixmap(const TQColor &c) const if (d < (36 * AAFACTOR * AAFACTOR)) img.setPixel(x, y, c.pixel()); else if (d < (56.25 * AAFACTOR * AAFACTOR)) - img.setPixel(x, y, qRgba(128, 128, 128, 255)); + img.setPixel(x, y, tqRgba(128, 128, 128, 255)); } - TQBitmap mask(16, 16); - mask.fill(Qt::color0); - TQPainter p(&mask); - p.setPen(Qt::NoPen); - p.setBrush(Qt::color1); + TQBitmap tqmask(16, 16); + tqmask.fill(TQt::color0); + TQPainter p(&tqmask); + p.setPen(TQt::NoPen); + p.setBrush(TQt::color1); p.drawEllipse(0, 0, 15, 15); p.end(); TQPixmap pm = TQPixmap(img.smoothScale(16, 16)); - pm.setMask(mask); + pm.setMask(tqmask); return pm; } diff --git a/kicker-applets/kolourpicker/kolourpicker.h b/kicker-applets/kolourpicker/kolourpicker.h index 8340d2d..c223339 100644 --- a/kicker-applets/kolourpicker/kolourpicker.h +++ b/kicker-applets/kolourpicker/kolourpicker.h @@ -34,9 +34,10 @@ class TQPopupMenu; class KolourPicker : public KPanelApplet { Q_OBJECT + TQ_OBJECT public: KolourPicker(const TQString& configFile, Type t = Normal, int actions = 0, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); ~KolourPicker(); virtual int heightForWidth(int) const; virtual int widthForHeight(int) const; diff --git a/kicker-applets/kolourpicker/simplebutton.cpp b/kicker-applets/kolourpicker/simplebutton.cpp index 478ca2d..8e6c8ec 100644 --- a/kicker-applets/kolourpicker/simplebutton.cpp +++ b/kicker-applets/kolourpicker/simplebutton.cpp @@ -32,8 +32,8 @@ #include <kipc.h> #include <kstandarddirs.h> -SimpleButton::SimpleButton(TQWidget *parent, const char *name) - : TQButton(parent, name), +SimpleButton::SimpleButton(TQWidget *tqparent, const char *name) + : TQButton(tqparent, name), m_highlight(false), m_orientation(Qt::Horizontal) { @@ -63,22 +63,22 @@ void SimpleButton::setOrientation(Qt::Orientation orientation) update(); } -TQSize SimpleButton::sizeHint() const +TQSize SimpleButton::tqsizeHint() const { const TQPixmap* pm = pixmap(); if (!pm) - return TQButton::sizeHint(); + return TQButton::tqsizeHint(); else return TQSize(pm->width() + KDialog::spacingHint(), pm->height() + KDialog::spacingHint()); } -TQSize SimpleButton::minimumSizeHint() const +TQSize SimpleButton::tqminimumSizeHint() const { const TQPixmap* pm = pixmap(); if (!pm) - return TQButton::minimumSizeHint(); + return TQButton::tqminimumSizeHint(); else return TQSize(pm->width(), pm->height()); } @@ -174,7 +174,7 @@ void SimpleButton::enterEvent( TQEvent *e ) { m_highlight = true; - repaint( false ); + tqrepaint( false ); TQButton::enterEvent( e ); } @@ -182,7 +182,7 @@ void SimpleButton::leaveEvent( TQEvent *e ) { m_highlight = false; - repaint( false ); + tqrepaint( false ); TQButton::enterEvent( e ); } @@ -192,20 +192,20 @@ void SimpleButton::resizeEvent( TQResizeEvent * ) } -SimpleArrowButton::SimpleArrowButton(TQWidget *parent, Qt::ArrowType arrow, const char *name) - : SimpleButton(parent, name) +SimpleArrowButton::SimpleArrowButton(TQWidget *tqparent, TQt::ArrowType arrow, const char *name) + : SimpleButton(tqparent, name) { setBackgroundOrigin(AncestorOrigin); _arrow = arrow; _inside = false; } -TQSize SimpleArrowButton::sizeHint() const +TQSize SimpleArrowButton::tqsizeHint() const { return TQSize( 12, 12 ); } -void SimpleArrowButton::setArrowType(Qt::ArrowType a) +void SimpleArrowButton::setArrowType(TQt::ArrowType a) { if (_arrow != a) { @@ -214,7 +214,7 @@ void SimpleArrowButton::setArrowType(Qt::ArrowType a) } } -Qt::ArrowType SimpleArrowButton::arrowType() const +TQt::ArrowType SimpleArrowButton::arrowType() const { return _arrow; } @@ -226,15 +226,15 @@ void SimpleArrowButton::drawButton( TQPainter *p ) TQStyle::PrimitiveElement pe = TQStyle::PE_ArrowLeft; switch (_arrow) { - case Qt::LeftArrow: pe = TQStyle::PE_ArrowLeft; break; - case Qt::RightArrow: pe = TQStyle::PE_ArrowRight; break; - case Qt::UpArrow: pe = TQStyle::PE_ArrowUp; break; - case Qt::DownArrow: pe = TQStyle::PE_ArrowDown; break; + case TQt::LeftArrow: pe = TQStyle::PE_ArrowLeft; break; + case TQt::RightArrow: pe = TQStyle::PE_ArrowRight; break; + case TQt::UpArrow: pe = TQStyle::PE_ArrowUp; break; + case TQt::DownArrow: pe = TQStyle::PE_ArrowDown; break; } int flags = TQStyle::Style_Default | TQStyle::Style_Enabled; if (isDown() || isOn()) flags |= TQStyle::Style_Down; - style().drawPrimitive(pe, p, r, colorGroup(), flags); + tqstyle().tqdrawPrimitive(pe, p, r, tqcolorGroup(), flags); } void SimpleArrowButton::enterEvent( TQEvent *e ) diff --git a/kicker-applets/kolourpicker/simplebutton.h b/kicker-applets/kolourpicker/simplebutton.h index 1ea5c7a..9b4e231 100644 --- a/kicker-applets/kolourpicker/simplebutton.h +++ b/kicker-applets/kolourpicker/simplebutton.h @@ -26,16 +26,17 @@ #include <kdemacros.h> -class KDE_EXPORT SimpleButton : public QButton +class KDE_EXPORT SimpleButton : public TQButton { Q_OBJECT + TQ_OBJECT public: - SimpleButton(TQWidget *parent, const char *name = 0); + SimpleButton(TQWidget *tqparent, const char *name = 0); void setPixmap(const TQPixmap &pix); void setOrientation(Qt::Orientation orientaton); - TQSize sizeHint() const; - TQSize minimumSizeHint() const; + TQSize tqsizeHint() const; + TQSize tqminimumSizeHint() const; protected: void drawButton( TQPainter *p ); @@ -63,23 +64,24 @@ class KDE_EXPORT SimpleButton : public QButton class KDE_EXPORT SimpleArrowButton: public SimpleButton { Q_OBJECT + TQ_OBJECT public: - SimpleArrowButton(TQWidget *parent = 0, Qt::ArrowType arrow = Qt::UpArrow, const char *name = 0); + SimpleArrowButton(TQWidget *tqparent = 0, TQt::ArrowType arrow = TQt::UpArrow, const char *name = 0); virtual ~SimpleArrowButton() {}; - TQSize sizeHint() const; + TQSize tqsizeHint() const; protected: virtual void enterEvent( TQEvent *e ); virtual void leaveEvent( TQEvent *e ); virtual void drawButton(TQPainter *p); - Qt::ArrowType arrowType() const; + TQt::ArrowType arrowType() const; public slots: - void setArrowType(Qt::ArrowType a); + void setArrowType(TQt::ArrowType a); private: - Qt::ArrowType _arrow; + TQt::ArrowType _arrow; bool _inside; }; |