summaryrefslogtreecommitdiffstats
path: root/krita/plugins/tools/defaulttools/kis_tool_text.cc
diff options
context:
space:
mode:
Diffstat (limited to 'krita/plugins/tools/defaulttools/kis_tool_text.cc')
-rw-r--r--krita/plugins/tools/defaulttools/kis_tool_text.cc90
1 files changed, 45 insertions, 45 deletions
diff --git a/krita/plugins/tools/defaulttools/kis_tool_text.cc b/krita/plugins/tools/defaulttools/kis_tool_text.cc
index b75f1b1b..853ff322 100644
--- a/krita/plugins/tools/defaulttools/kis_tool_text.cc
+++ b/krita/plugins/tools/defaulttools/kis_tool_text.cc
@@ -16,17 +16,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qfont.h>
-#include <qrect.h>
-#include <qimage.h>
-#include <qlayout.h>
-#include <qwidget.h>
-#include <qstring.h>
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qpushbutton.h>
-#include <qfontmetrics.h>
-#include <qhbox.h>
+#include <tqfont.h>
+#include <tqrect.h>
+#include <tqimage.h>
+#include <tqlayout.h>
+#include <tqwidget.h>
+#include <tqstring.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqpushbutton.h>
+#include <tqfontmetrics.h>
+#include <tqhbox.h>
#include <kaction.h>
#include <kinputdialog.h>
@@ -34,7 +34,7 @@
#include <kfontdialog.h>
#include <ksqueezedtextlabel.h>
-#include <qcolor.h>
+#include <tqcolor.h>
#include "kis_point.h"
#include "kis_image.h"
@@ -72,7 +72,7 @@ void KisToolText::update(KisCanvasSubject *subject)
void KisToolText::buttonPress(KisButtonPressEvent *e)
{
- if (m_subject && e->button() == QMouseEvent::LeftButton) {
+ if (m_subject && e->button() == TQMouseEvent::LeftButton) {
m_wasPressed = true;
}
}
@@ -81,15 +81,15 @@ void KisToolText::buttonRelease(KisButtonReleaseEvent *e)
{
if ( m_windowIsBeingShown ) return;
- if (m_subject && e->button() == QMouseEvent::LeftButton) {
+ if (m_subject && e->button() == TQMouseEvent::LeftButton) {
if(!m_wasPressed) return;
m_wasPressed = false;
KisImageSP img = m_subject->currentImg();
m_windowIsBeingShown = true;
bool ok;
- QString text = KInputDialog::getText(i18n("Font Tool"), i18n("Enter text:"),
- QString::null, &ok);
+ TQString text = KInputDialog::getText(i18n("Font Tool"), i18n("Enter text:"),
+ TQString(), &ok);
if (!ok) {
m_windowIsBeingShown = false;
return;
@@ -100,37 +100,37 @@ void KisToolText::buttonRelease(KisButtonReleaseEvent *e)
undoAdapter->beginMacro(i18n("Text"));
}
- QFontMetrics metrics(m_font);
- QRect boundingRect = metrics.boundingRect(text).normalize();
+ TQFontMetrics metrics(m_font);
+ TQRect boundingRect = metrics.boundingRect(text).normalize();
int xB = - boundingRect.x();
int yB = - boundingRect.y();
if (boundingRect.x() < 0 || boundingRect.y() < 0)
boundingRect.moveBy(- boundingRect.x(), - boundingRect.y());
- QPixmap pixels(boundingRect.width(), boundingRect.height());
+ TQPixmap pixels(boundingRect.width(), boundingRect.height());
{
- QPainter paint(&pixels);
- paint.fillRect(boundingRect, Qt::white);
+ TQPainter paint(&pixels);
+ paint.fillRect(boundingRect, TQt::white);
paint.setFont(m_font);
- paint.setBrush(QBrush(Qt::black));
+ paint.setBrush(TQBrush(TQt::black));
paint.drawText(xB, yB, text);
}
- QImage image = pixels.convertToImage();
+ TQImage image = pixels.convertToImage();
- Q_INT32 height = boundingRect.height();
- Q_INT32 width = boundingRect.width();
+ TQ_INT32 height = boundingRect.height();
+ TQ_INT32 width = boundingRect.width();
KisPaintLayer *layer = new KisPaintLayer(img, '"' + text + '"', OPACITY_OPAQUE);
- KisGroupLayerSP parent = img->rootLayer();
+ KisGroupLayerSP tqparent = img->rootLayer();
if (img->activeLayer())
- parent = img->activeLayer()->parent();
- img->addLayer(layer, parent, img->activeLayer());
+ tqparent = img->activeLayer()->tqparent();
+ img->addLayer(layer, tqparent, img->activeLayer());
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
- QRgb pixel = image.pixel(x, y);
+ TQRgb pixel = image.pixel(x, y);
// use the 'blackness' as alpha :)
- Q_UINT8 alpha = 255 - qRed(pixel) * OPACITY_OPAQUE / 255;
- QColor c = m_subject->fgColor().toQColor();
+ TQ_UINT8 alpha = 255 - tqRed(pixel) * OPACITY_OPAQUE / 255;
+ TQColor c = m_subject->fgColor().toTQColor();
layer->paintDevice()->setPixel(x, y, c, alpha);
}
}
@@ -139,8 +139,8 @@ void KisToolText::buttonRelease(KisButtonReleaseEvent *e)
layer->setCompositeOp(m_compositeOp);
layer->setVisible(false);
- Q_INT32 x = QMAX(0, static_cast<int>(e->x() - width/2));
- Q_INT32 y = QMAX(0, static_cast<int>(e->y() - height/2));
+ TQ_INT32 x = TQMAX(0, static_cast<int>(e->x() - width/2));
+ TQ_INT32 y = TQMAX(0, static_cast<int>(e->y() - height/2));
layer->setX(x);
layer->setY(y);
layer->setVisible(true);
@@ -155,22 +155,22 @@ void KisToolText::buttonRelease(KisButtonReleaseEvent *e)
}
void KisToolText::setFont() {
- KFontDialog::getFont( m_font, false/*, QWidget* parent! */ );
- m_lbFontName->setText(QString(m_font.family() + ", %1").arg(m_font.pointSize()));
+ KFontDialog::getFont( m_font, false/*, TQWidget* tqparent! */ );
+ m_lbFontName->setText(TQString(m_font.family() + ", %1").tqarg(m_font.pointSize()));
}
-QWidget* KisToolText::createOptionWidget(QWidget* parent)
+TQWidget* KisToolText::createOptionWidget(TQWidget* tqparent)
{
- QWidget *widget = super::createOptionWidget(parent);
+ TQWidget *widget = super::createOptionWidget(tqparent);
- m_lbFont = new QLabel(i18n("Font: "), widget);
+ m_lbFont = new TQLabel(i18n("Font: "), widget);
- QHBox *fontBox = new QHBox(widget);
- m_lbFontName = new KSqueezedTextLabel(QString(m_font.family() + ", %1")
- .arg(m_font.pointSize()), fontBox);
- m_btnMoreFonts = new QPushButton("...", fontBox);
+ TQHBox *fontBox = new TQHBox(widget);
+ m_lbFontName = new KSqueezedTextLabel(TQString(m_font.family() + ", %1")
+ .tqarg(m_font.pointSize()), fontBox);
+ m_btnMoreFonts = new TQPushButton("...", fontBox);
- connect(m_btnMoreFonts, SIGNAL(released()), this, SLOT(setFont()));
+ connect(m_btnMoreFonts, TQT_SIGNAL(released()), this, TQT_SLOT(setFont()));
addOptionWidgetOption(fontBox, m_lbFont);
@@ -184,9 +184,9 @@ void KisToolText::setup(KActionCollection *collection)
if (m_action == 0) {
m_action = new KRadioAction(i18n("T&ext"),
"tool_text",
- Qt::SHIFT+Qt::Key_T,
+ TQt::SHIFT+TQt::Key_T,
this,
- SLOT(activate()),
+ TQT_SLOT(activate()),
collection,
name());
m_action->setExclusiveGroup("tools");