diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kalarm/lib/colourcombo.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalarm/lib/colourcombo.cpp')
-rw-r--r-- | kalarm/lib/colourcombo.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/kalarm/lib/colourcombo.cpp b/kalarm/lib/colourcombo.cpp index d5fa052ac..9cf09ce13 100644 --- a/kalarm/lib/colourcombo.cpp +++ b/kalarm/lib/colourcombo.cpp @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include <klocale.h> #include <kcolordialog.h> @@ -30,8 +30,8 @@ #include "colourcombo.moc" -ColourCombo::ColourCombo(QWidget* parent, const char* name, const QColor& defaultColour) - : QComboBox(parent, name), +ColourCombo::ColourCombo(TQWidget* parent, const char* name, const TQColor& defaultColour) + : TQComboBox(parent, name), mColourList(Preferences::messageColours()), mSelectedColour(defaultColour), mCustomColour(255, 255, 255), @@ -39,12 +39,12 @@ ColourCombo::ColourCombo(QWidget* parent, const char* name, const QColor& defaul mDisabled(false) { addColours(); - connect(this, SIGNAL(activated(int)), SLOT(slotActivated(int))); - connect(this, SIGNAL(highlighted(int)), SLOT(slotHighlighted(int))); - Preferences::connect(SIGNAL(preferencesChanged()), this, SLOT(slotPreferencesChanged())); + connect(this, TQT_SIGNAL(activated(int)), TQT_SLOT(slotActivated(int))); + connect(this, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotHighlighted(int))); + Preferences::connect(TQT_SIGNAL(preferencesChanged()), this, TQT_SLOT(slotPreferencesChanged())); } -void ColourCombo::setColour(const QColor& colour) +void ColourCombo::setColour(const TQColor& colour) { mSelectedColour = colour; addColours(); @@ -94,14 +94,14 @@ void ColourCombo::setEnabled(bool enable) if (end > 1) { // Add a dialog background colour item - QPixmap pm = *pixmap(1); + TQPixmap pm = *pixmap(1); pm.fill(paletteBackgroundColor()); insertItem(pm); setCurrentItem(end); } mDisabled = true; } - QComboBox::setEnabled(enable); + TQComboBox::setEnabled(enable); } void ColourCombo::slotActivated(int index) @@ -110,9 +110,9 @@ void ColourCombo::slotActivated(int index) mSelectedColour = mColourList[index - 1]; else { - if (KColorDialog::getColor(mCustomColour, this) == QDialog::Accepted) + if (KColorDialog::getColor(mCustomColour, this) == TQDialog::Accepted) { - QRect rect; + TQRect rect; drawCustomItem(rect, false); } mSelectedColour = mCustomColour; @@ -144,16 +144,16 @@ void ColourCombo::addColours() break; } - QRect rect; + TQRect rect; drawCustomItem(rect, true); - QPainter painter; - QPixmap pixmap(rect.width(), rect.height()); + TQPainter painter; + TQPixmap pixmap(rect.width(), rect.height()); int i = 1; for (ColourList::const_iterator it = mColourList.begin(); it != mColourList.end(); ++i, ++it) { painter.begin(&pixmap); - QBrush brush(*it); + TQBrush brush(*it); painter.fillRect(rect, brush); painter.end(); @@ -165,21 +165,21 @@ void ColourCombo::addColours() } } -void ColourCombo::drawCustomItem(QRect& rect, bool insert) +void ColourCombo::drawCustomItem(TQRect& rect, bool insert) { - QPen pen; + TQPen pen; if (qGray(mCustomColour.rgb()) < 128) pen.setColor(Qt::white); else pen.setColor(Qt::black); - QPainter painter; - QFontMetrics fm = QFontMetrics(painter.font()); + TQPainter painter; + TQFontMetrics fm = TQFontMetrics(painter.font()); rect.setRect(0, 0, width(), fm.height() + 4); - QPixmap pixmap(rect.width(), rect.height()); + TQPixmap pixmap(rect.width(), rect.height()); painter.begin(&pixmap); - QBrush brush(mCustomColour); + TQBrush brush(mCustomColour); painter.fillRect(rect, brush); painter.setPen(pen); painter.drawText(2, fm.ascent() + 2, i18n("Custom...")); @@ -197,13 +197,13 @@ void ColourCombo::setReadOnly(bool ro) mReadOnly = ro; } -void ColourCombo::resizeEvent(QResizeEvent* re) +void ColourCombo::resizeEvent(TQResizeEvent* re) { - QComboBox::resizeEvent(re); + TQComboBox::resizeEvent(re); addColours(); } -void ColourCombo::mousePressEvent(QMouseEvent* e) +void ColourCombo::mousePressEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -211,29 +211,29 @@ void ColourCombo::mousePressEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QComboBox::mousePressEvent(e); + TQComboBox::mousePressEvent(e); } -void ColourCombo::mouseReleaseEvent(QMouseEvent* e) +void ColourCombo::mouseReleaseEvent(TQMouseEvent* e) { if (!mReadOnly) - QComboBox::mouseReleaseEvent(e); + TQComboBox::mouseReleaseEvent(e); } -void ColourCombo::mouseMoveEvent(QMouseEvent* e) +void ColourCombo::mouseMoveEvent(TQMouseEvent* e) { if (!mReadOnly) - QComboBox::mouseMoveEvent(e); + TQComboBox::mouseMoveEvent(e); } -void ColourCombo::keyPressEvent(QKeyEvent* e) +void ColourCombo::keyPressEvent(TQKeyEvent* e) { if (!mReadOnly || e->key() == Qt::Key_Escape) - QComboBox::keyPressEvent(e); + TQComboBox::keyPressEvent(e); } -void ColourCombo::keyReleaseEvent(QKeyEvent* e) +void ColourCombo::keyReleaseEvent(TQKeyEvent* e) { if (!mReadOnly) - QComboBox::keyReleaseEvent(e); + TQComboBox::keyReleaseEvent(e); } |