diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kopainter/ko_cmyk_widget.cc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kopainter/ko_cmyk_widget.cc')
-rw-r--r-- | lib/kopainter/ko_cmyk_widget.cc | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/lib/kopainter/ko_cmyk_widget.cc b/lib/kopainter/ko_cmyk_widget.cc index 86b20ad9..5dee7ec5 100644 --- a/lib/kopainter/ko_cmyk_widget.cc +++ b/lib/kopainter/ko_cmyk_widget.cc @@ -22,12 +22,12 @@ #include "ko_cmyk_widget.h" -#include <qlayout.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qspinbox.h> -#include <qtooltip.h> -#include <qcolor.h> +#include <tqlayout.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqspinbox.h> +#include <tqtooltip.h> +#include <tqcolor.h> #include <kdebug.h> #include <kglobal.h> @@ -38,73 +38,73 @@ #include <kcolordialog.h> #include <kdualcolorbutton.h> -KoCMYKWidget::KoCMYKWidget(QWidget *parent, const char *name) : super(parent, name) +KoCMYKWidget::KoCMYKWidget(TQWidget *tqparent, const char *name) : super(tqparent, name) { m_ColorButton = new KDualColorButton(this); - m_ColorButton -> setFixedSize(m_ColorButton->sizeHint()); - QGridLayout *mGrid = new QGridLayout(this, 4, 5, 5, 2); + m_ColorButton -> setFixedSize(m_ColorButton->tqsizeHint()); + TQGridLayout *mGrid = new TQGridLayout(this, 4, 5, 5, 2); /* setup color sliders */ mCSlider = new KoColorSlider(this); mCSlider->setMaximumHeight(20); mCSlider->slotSetRange(0, 255); - mCSlider->setFocusPolicy( QWidget::ClickFocus ); + mCSlider->setFocusPolicy( TQ_ClickFocus ); mMSlider = new KoColorSlider(this); mMSlider->setMaximumHeight(20); mMSlider->slotSetRange(0, 255); - mMSlider->setFocusPolicy( QWidget::ClickFocus ); + mMSlider->setFocusPolicy( TQ_ClickFocus ); mYSlider = new KoColorSlider(this); mYSlider->setMaximumHeight(20); mYSlider->slotSetRange(0, 255); - mYSlider->setFocusPolicy( QWidget::ClickFocus ); + mYSlider->setFocusPolicy( TQ_ClickFocus ); mKSlider = new KoColorSlider(this); mKSlider->setMaximumHeight(20); mKSlider->slotSetRange(0, 255); - mKSlider->setFocusPolicy( QWidget::ClickFocus ); + mKSlider->setFocusPolicy( TQ_ClickFocus ); /* setup slider labels */ - mCLabel = new QLabel("C", this); + mCLabel = new TQLabel("C", this); mCLabel->setFixedWidth(12); mCLabel->setFixedHeight(20); - mMLabel = new QLabel("M", this); + mMLabel = new TQLabel("M", this); mMLabel->setFixedWidth(12); mMLabel->setFixedHeight(20); - mYLabel = new QLabel("Y", this); + mYLabel = new TQLabel("Y", this); mYLabel->setFixedWidth(12); mYLabel->setFixedHeight(20); - mKLabel = new QLabel("K", this); + mKLabel = new TQLabel("K", this); mKLabel->setFixedWidth(12); mKLabel->setFixedHeight(20); /* setup spin box */ - mCIn = new QSpinBox(0, 255, 1, this); + mCIn = new TQSpinBox(0, 255, 1, this); mCIn->setFixedWidth(50); mCIn->setFixedHeight(20); - mCIn->setFocusPolicy( QWidget::ClickFocus ); - QToolTip::add( mCIn, i18n( "Cyan" ) ); + mCIn->setFocusPolicy( TQ_ClickFocus ); + TQToolTip::add( mCIn, i18n( "Cyan" ) ); - mMIn = new QSpinBox(0, 255, 1, this); + mMIn = new TQSpinBox(0, 255, 1, this); mMIn->setFixedWidth(50); mMIn->setFixedHeight(20); - mMIn->setFocusPolicy( QWidget::ClickFocus ); - QToolTip::add( mMIn, i18n( "Magenta" ) ); + mMIn->setFocusPolicy( TQ_ClickFocus ); + TQToolTip::add( mMIn, i18n( "Magenta" ) ); - mYIn = new QSpinBox(0, 255, 1, this); + mYIn = new TQSpinBox(0, 255, 1, this); mYIn->setFixedWidth(50); mYIn->setFixedHeight(20); - mYIn->setFocusPolicy( QWidget::ClickFocus ); - QToolTip::add( mYIn, i18n( "Yellow" ) ); + mYIn->setFocusPolicy( TQ_ClickFocus ); + TQToolTip::add( mYIn, i18n( "Yellow" ) ); - mKIn = new QSpinBox(0, 255, 1, this); + mKIn = new TQSpinBox(0, 255, 1, this); mKIn->setFixedWidth(50); mKIn->setFixedHeight(20); - mKIn->setFocusPolicy( QWidget::ClickFocus ); - QToolTip::add( mKIn, i18n( "Black" ) ); + mKIn->setFocusPolicy( TQ_ClickFocus ); + TQToolTip::add( mKIn, i18n( "Black" ) ); - mGrid->addMultiCellWidget(m_ColorButton, 0, 4, 0, 0, Qt::AlignTop); + mGrid->addMultiCellWidget(m_ColorButton, 0, 4, 0, 0, TQt::AlignTop); mGrid->addWidget(mCLabel, 0, 1); mGrid->addWidget(mMLabel, 1, 1); mGrid->addWidget(mYLabel, 2, 1); @@ -118,20 +118,20 @@ KoCMYKWidget::KoCMYKWidget(QWidget *parent, const char *name) : super(parent, na mGrid->addWidget(mYIn, 2, 4); mGrid->addWidget(mKIn, 3, 4); - connect(m_ColorButton, SIGNAL(fgChanged(const QColor &)), this, SLOT(slotFGColorSelected(const QColor &))); - connect(m_ColorButton, SIGNAL(bgChanged(const QColor &)), this, SLOT(slotBGColorSelected(const QColor &))); + connect(m_ColorButton, TQT_SIGNAL(fgChanged(const TQColor &)), this, TQT_SLOT(slotFGColorSelected(const TQColor &))); + connect(m_ColorButton, TQT_SIGNAL(bgChanged(const TQColor &)), this, TQT_SLOT(slotBGColorSelected(const TQColor &))); /* connect color sliders */ - connect(mCSlider, SIGNAL(valueChanged(int)), this, SLOT(slotCChanged(int))); - connect(mMSlider, SIGNAL(valueChanged(int)), this, SLOT(slotMChanged(int))); - connect(mYSlider, SIGNAL(valueChanged(int)), this, SLOT(slotYChanged(int))); - connect(mKSlider, SIGNAL(valueChanged(int)), this, SLOT(slotKChanged(int))); + connect(mCSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotCChanged(int))); + connect(mMSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotMChanged(int))); + connect(mYSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotYChanged(int))); + connect(mKSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotKChanged(int))); /* connect spin box */ - connect(mCIn, SIGNAL(valueChanged(int)), this, SLOT(slotCChanged(int))); - connect(mMIn, SIGNAL(valueChanged(int)), this, SLOT(slotMChanged(int))); - connect(mYIn, SIGNAL(valueChanged(int)), this, SLOT(slotYChanged(int))); - connect(mKIn, SIGNAL(valueChanged(int)), this, SLOT(slotKChanged(int))); + connect(mCIn, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotCChanged(int))); + connect(mMIn, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotMChanged(int))); + connect(mYIn, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotYChanged(int))); + connect(mKIn, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotKChanged(int))); } void KoCMYKWidget::slotCChanged(int c) @@ -206,33 +206,33 @@ void KoCMYKWidget::slotKChanged(int k) } } -void KoCMYKWidget::setFgColor(const QColor & c) +void KoCMYKWidget::setFgColor(const TQColor & c) { update(c, m_bgColor); } -void KoCMYKWidget::setBgColor(const QColor & c) +void KoCMYKWidget::setBgColor(const TQColor & c) { update(m_fgColor, c); } -void KoCMYKWidget::update(const QColor fgColor, const QColor bgColor) +void KoCMYKWidget::update(const TQColor fgColor, const TQColor bgColor) { m_fgColor = fgColor; m_bgColor = bgColor; - QColor color = (m_ColorButton->current() == KDualColorButton::Foreground)? m_fgColor : m_bgColor; + TQColor color = (m_ColorButton->current() == KDualColorButton::Foreground)? m_fgColor : m_bgColor; CMYKColor col = RgbToCmyk(color); - disconnect(m_ColorButton, SIGNAL(fgChanged(const QColor &)), this, SLOT(slotFGColorSelected(const QColor &))); - disconnect(m_ColorButton, SIGNAL(bgChanged(const QColor &)), this, SLOT(slotBGColorSelected(const QColor &))); + disconnect(m_ColorButton, TQT_SIGNAL(fgChanged(const TQColor &)), this, TQT_SLOT(slotFGColorSelected(const TQColor &))); + disconnect(m_ColorButton, TQT_SIGNAL(bgChanged(const TQColor &)), this, TQT_SLOT(slotBGColorSelected(const TQColor &))); m_ColorButton->setForeground( m_fgColor ); m_ColorButton->setBackground( m_bgColor ); - connect(m_ColorButton, SIGNAL(fgChanged(const QColor &)), this, SLOT(slotFGColorSelected(const QColor &))); - connect(m_ColorButton, SIGNAL(bgChanged(const QColor &)), this, SLOT(slotBGColorSelected(const QColor &))); + connect(m_ColorButton, TQT_SIGNAL(fgChanged(const TQColor &)), this, TQT_SLOT(slotFGColorSelected(const TQColor &))); + connect(m_ColorButton, TQT_SIGNAL(bgChanged(const TQColor &)), this, TQT_SLOT(slotBGColorSelected(const TQColor &))); mCSlider->blockSignals(true); mCIn->blockSignals(true); @@ -293,19 +293,19 @@ void KoCMYKWidget::update(const QColor fgColor, const QColor bgColor) mKIn->blockSignals(false); } -void KoCMYKWidget::slotFGColorSelected(const QColor& c) +void KoCMYKWidget::slotFGColorSelected(const TQColor& c) { - m_fgColor = QColor(c); + m_fgColor = TQColor(c); emit sigFgColorChanged(m_fgColor); } -void KoCMYKWidget::slotBGColorSelected(const QColor& c) +void KoCMYKWidget::slotBGColorSelected(const TQColor& c) { - m_bgColor = QColor(c); + m_bgColor = TQColor(c); emit sigBgColorChanged(m_bgColor); } -CMYKColor KoCMYKWidget::RgbToCmyk(const QColor& col) +CMYKColor KoCMYKWidget::RgbToCmyk(const TQColor& col) { kdDebug() << "--[ KoCMYKWidget::RgbToCmyk ]--------------------------------------" << endl; kdDebug() << endl; @@ -382,7 +382,7 @@ CMYKColor KoCMYKWidget::RgbToCmyk(const QColor& col) return color; } -QColor KoCMYKWidget::CmykToRgb(const CMYKColor& c) +TQColor KoCMYKWidget::CmykToRgb(const CMYKColor& c) { // CMYK to CMY float ac = kMin(1.0, c.C * (1.0 - c.K) + c.K); @@ -394,7 +394,7 @@ QColor KoCMYKWidget::CmykToRgb(const CMYKColor& c) int g = int((1.0 - am) * 255.0); int b = int((1.0 - ay) * 255.0); - QColor color; + TQColor color; color.setRgb(r,g,b); return color; |