summaryrefslogtreecommitdiffstats
path: root/konversation/src/viewtreeitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'konversation/src/viewtreeitem.cpp')
-rw-r--r--konversation/src/viewtreeitem.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/konversation/src/viewtreeitem.cpp b/konversation/src/viewtreeitem.cpp
index c53699c..819176b 100644
--- a/konversation/src/viewtreeitem.cpp
+++ b/konversation/src/viewtreeitem.cpp
@@ -16,10 +16,10 @@
#include "images.h"
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qimage.h>
-#include <qtimer.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqimage.h>
+#include <tqtimer.h>
#include <kdebug.h>
#include <kglobalsettings.h>
@@ -28,8 +28,8 @@
int ViewTreeItem::s_availableSortIndex = 0;
-ViewTreeItem::ViewTreeItem(QListView* parent, const QString& name, ChatWindow* view)
- : QListViewItem(parent, name)
+ViewTreeItem::ViewTreeItem(TQListView* parent, const TQString& name, ChatWindow* view)
+ : TQListViewItem(parent, name)
{
m_sortIndex = s_availableSortIndex;
s_availableSortIndex++;
@@ -52,8 +52,8 @@ ViewTreeItem::ViewTreeItem(QListView* parent, const QString& name, ChatWindow* v
m_closeButtonEnabled = false;
}
-ViewTreeItem::ViewTreeItem(QListViewItem* parent, const QString& name, ChatWindow* view, int sortIndex)
- : QListViewItem(parent, name)
+ViewTreeItem::ViewTreeItem(TQListViewItem* parent, const TQString& name, ChatWindow* view, int sortIndex)
+ : TQListViewItem(parent, name)
{
if (sortIndex != -1)
setSortIndex(sortIndex);
@@ -82,8 +82,8 @@ ViewTreeItem::ViewTreeItem(QListViewItem* parent, const QString& name, ChatWindo
m_closeButtonEnabled = false;
}
-ViewTreeItem::ViewTreeItem(QListViewItem* parent, QListViewItem* afterItem, const QString& name, ChatWindow* view)
- : QListViewItem(parent, afterItem, name)
+ViewTreeItem::ViewTreeItem(TQListViewItem* parent, TQListViewItem* afterItem, const TQString& name, ChatWindow* view)
+ : TQListViewItem(parent, afterItem, name)
{
m_sortIndex = s_availableSortIndex;
s_availableSortIndex++;
@@ -107,7 +107,7 @@ ViewTreeItem::ViewTreeItem(QListViewItem* parent, QListViewItem* afterItem, cons
m_closeButtonEnabled = false;
}
-ViewTreeItem::ViewTreeItem(QListView* parent) : QListViewItem(parent)
+ViewTreeItem::ViewTreeItem(TQListView* parent) : TQListViewItem(parent)
{
setView(0);
setOpen(true);
@@ -132,12 +132,12 @@ int ViewTreeItem::getSortIndex() const
return m_sortIndex;
}
-void ViewTreeItem::setName(const QString& name)
+void ViewTreeItem::setName(const TQString& name)
{
setText(0, name);
}
-QString ViewTreeItem::getName() const
+TQString ViewTreeItem::getName() const
{
return text(0);
}
@@ -167,7 +167,7 @@ ChatWindow::WindowType ViewTreeItem::getViewType() const
return m_viewType;
}
-void ViewTreeItem::setColor(QColor color)
+void ViewTreeItem::setColor(TQColor color)
{
if (color != m_color)
{
@@ -177,7 +177,7 @@ void ViewTreeItem::setColor(QColor color)
}
}
-QColor ViewTreeItem::getColor() const
+TQColor ViewTreeItem::getColor() const
{
if (!m_customColorSet)
{
@@ -190,7 +190,7 @@ QColor ViewTreeItem::getColor() const
return m_color;
}
-void ViewTreeItem::setIcon(const QPixmap& pm)
+void ViewTreeItem::setIcon(const TQPixmap& pm)
{
m_oldPixmap = pm;
if (!m_closeButtonShown) setPixmap(0, pm);
@@ -269,7 +269,7 @@ bool ViewTreeItem::isSeparator() const
return m_isSeparator;
}
-int ViewTreeItem::compare(QListViewItem *i, int /* col */, bool /* ascending */) const
+int ViewTreeItem::compare(TQListViewItem *i, int /* col */, bool /* ascending */) const
{
ViewTreeItem* item = static_cast<ViewTreeItem*>(i);
@@ -304,7 +304,7 @@ void ViewTreeItem::setup()
int LED_ICON_SIZE = 14;
int MARGIN = 2;
- QRect textRect = listView()->fontMetrics().boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::ShowPrefix, text(/*column=*/0));
+ TQRect textRect = listView()->fontMetrics().boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::ShowPrefix, text(/*column=*/0));
int height = MARGIN + kMax(LED_ICON_SIZE, textRect.height()) + MARGIN;
setHeight(height);
}
@@ -312,22 +312,22 @@ void ViewTreeItem::setup()
setHeight(11);
}
-QColor ViewTreeItem::mixColor(const QColor &color1, const QColor &color2)
+TQColor ViewTreeItem::mixColor(const TQColor &color1, const TQColor &color2)
{
- QColor mixedColor;
+ TQColor mixedColor;
mixedColor.setRgb( (color1.red() + color2.red()) / 2,
(color1.green() + color2.green()) / 2,
(color1.blue() + color2.blue()) / 2 );
return mixedColor;
}
-void ViewTreeItem::paintFocus(QPainter* /* p */, const QColorGroup& /* cg */, const QRect& /* r */)
+void ViewTreeItem::paintFocus(TQPainter* /* p */, const TQColorGroup& /* cg */, const TQRect& /* r */)
{
// Do nothing.
return;
}
-void ViewTreeItem::paintCell(QPainter* p, const QColorGroup& /* cg */, int /* column */, int width, int /* align */)
+void ViewTreeItem::paintCell(TQPainter* p, const TQColorGroup& /* cg */, int /* column */, int width, int /* align */)
{
// Workaround a Qt bug:
// When the splitter is moved to hide the tree view and then the application is restarted,
@@ -338,20 +338,20 @@ void ViewTreeItem::paintCell(QPainter* p, const QColorGroup& /* cg */, int /* co
int MARGIN = 2;
// Bufferize the drawing of items.
- QPixmap buffer(width, height());
- QPainter painter(&buffer);
+ TQPixmap buffer(width, height());
+ TQPainter painter(&buffer);
- QColor textColor = isSelected() ? KGlobalSettings::highlightedTextColor() : getColor();
- QColor background = isSelected() ? KGlobalSettings::highlightColor() : listView()->paletteBackgroundColor();
+ TQColor textColor = isSelected() ? KGlobalSettings::highlightedTextColor() : getColor();
+ TQColor background = isSelected() ? KGlobalSettings::highlightColor() : listView()->paletteBackgroundColor();
if (m_isHighlighted) background = Preferences::inputFieldsBackgroundColor()
? Preferences::color(Preferences::AlternateBackground) : KGlobalSettings::alternateBackgroundColor();
// Fill in background.
painter.fillRect(0, 0, width, height(), background);
- QColor bgColor = listView()->paletteBackgroundColor();
- QColor selColor = m_isHighlighted ? background : KGlobalSettings::highlightColor();
- QColor midColor = mixColor(bgColor, selColor);
+ TQColor bgColor = listView()->paletteBackgroundColor();
+ TQColor selColor = m_isHighlighted ? background : KGlobalSettings::highlightColor();
+ TQColor midColor = mixColor(bgColor, selColor);
int iconWidth = pixmap(0) ? LED_ICON_SIZE : 0;
int textWidth = width - MARGIN - iconWidth - MARGIN - MARGIN;
@@ -359,7 +359,7 @@ void ViewTreeItem::paintCell(QPainter* p, const QColorGroup& /* cg */, int /* co
if (!m_isSeparator)
{
// Draw the rounded rectangle.
- QRect textRect = listView()->fontMetrics().boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::ShowPrefix, text(/*column=*/0));
+ TQRect textRect = listView()->fontMetrics().boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::ShowPrefix, text(/*column=*/0));
int xRound = MARGIN;
int yRound = MARGIN;
int hRound = height() - 2 * MARGIN;
@@ -367,10 +367,10 @@ void ViewTreeItem::paintCell(QPainter* p, const QColorGroup& /* cg */, int /* co
if (wRound > 0)
{
- QPixmap buffer(wRound * 2, hRound * 2);
+ TQPixmap buffer(wRound * 2, hRound * 2);
buffer.fill(background);
- QPainter pBuffer(&buffer);
- QColor colorRound = background;
+ TQPainter pBuffer(&buffer);
+ TQColor colorRound = background;
pBuffer.setPen(colorRound);
pBuffer.setBrush(colorRound);
@@ -385,8 +385,8 @@ void ViewTreeItem::paintCell(QPainter* p, const QColorGroup& /* cg */, int /* co
pBuffer.drawEllipse(0, 0, wRound * 2, hRound * 2);
pBuffer.end();
- QImage imageToScale = buffer.convertToImage();
- QPixmap pmScaled;
+ TQImage imageToScale = buffer.convertToImage();
+ TQPixmap pmScaled;
pmScaled.convertFromImage(imageToScale.smoothScale(wRound, hRound));
painter.drawPixmap(xRound, yRound, pmScaled);
textWidth -= hRound/2;
@@ -461,7 +461,7 @@ void ViewTreeItem::paintCell(QPainter* p, const QColorGroup& /* cg */, int /* co
if (pixmap(0))
xText = MARGIN + LED_ICON_SIZE + MARGIN;
- QString text = getName();
+ TQString text = getName();
if (p->fontMetrics().width(text) > textWidth)
{
@@ -478,7 +478,7 @@ void ViewTreeItem::paintCell(QPainter* p, const QColorGroup& /* cg */, int /* co
}
else
{
- QColor lineColor = Preferences::inputFieldsBackgroundColor()
+ TQColor lineColor = Preferences::inputFieldsBackgroundColor()
? Preferences::color(Preferences::AlternateBackground) : KGlobalSettings::alternateBackgroundColor();
painter.setPen(lineColor);
painter.drawLine(0, 5, width, 5);