summaryrefslogtreecommitdiffstats
path: root/kalarm/lib/colourcombo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kalarm/lib/colourcombo.cpp')
-rw-r--r--kalarm/lib/colourcombo.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kalarm/lib/colourcombo.cpp b/kalarm/lib/colourcombo.cpp
index d5fa052a..9cf09ce1 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);
}