summaryrefslogtreecommitdiffstats
path: root/ksirc/ahistlineedit.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /ksirc/ahistlineedit.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/ahistlineedit.cpp')
-rw-r--r--ksirc/ahistlineedit.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/ksirc/ahistlineedit.cpp b/ksirc/ahistlineedit.cpp
index 72e6da35..2455047d 100644
--- a/ksirc/ahistlineedit.cpp
+++ b/ksirc/ahistlineedit.cpp
@@ -34,7 +34,7 @@
focusOutEvent: ditto
Variables:
- QStrList: current list of history items.
+ TQStrList: current list of history items.
current: what I think is the current list item.
*************************************************************************/
@@ -43,31 +43,31 @@
#include "ahistlineedit.h"
#include "colorpicker.h"
#include "ksopts.h"
-#include <qtextedit.h>
-#include <qlayout.h>
-#include <qapplication.h>
-#include <qclipboard.h>
-#include <qpen.h>
-#include <qpainter.h>
+#include <tqtextedit.h>
+#include <tqlayout.h>
+#include <tqapplication.h>
+#include <tqclipboard.h>
+#include <tqpen.h>
+#include <tqpainter.h>
#include <kdebug.h>
#include <kstdaction.h>
#include <kstdaccel.h>
#include <kshortcut.h>
-aHistLineEdit::aHistLineEdit(QWidget *parent, const char *name)
- : QTextEdit(parent, name)
+aHistLineEdit::aHistLineEdit(TQWidget *parent, const char *name)
+ : TQTextEdit(parent, name)
{
m_drawrect = false;
m_height = 0;
- current = hist.append(QString::null); // Set the current as blank
- setWrapPolicy(QTextEdit::AtWordOrDocumentBoundary);
+ current = hist.append(TQString::null); // Set the current as blank
+ setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary);
setVScrollBarMode( AlwaysOff );
setHScrollBarMode( AlwaysOff );
-// connect( this, SIGNAL( returnPressed () ), this, SLOT( slotReturn() ) );
- connect( this, SIGNAL( textChanged () ), this, SLOT( slotMaybeResize() ) );
+// connect( this, TQT_SIGNAL( returnPressed () ), this, TQT_SLOT( slotReturn() ) );
+ connect( this, TQT_SIGNAL( textChanged () ), this, TQT_SLOT( slotMaybeResize() ) );
setTabChangesFocus(true);
setTextFormat(PlainText);
@@ -80,20 +80,20 @@ aHistLineEdit::aHistLineEdit(QWidget *parent, const char *name)
void aHistLineEdit::setCursorPosition ( int index )
{
- QTextEdit::setCursorPosition(0, index);
+ TQTextEdit::setCursorPosition(0, index);
}
int aHistLineEdit::cursorPosition() const
{
int par, index;
- QTextEdit::getCursorPosition(&par, &index);
+ TQTextEdit::getCursorPosition(&par, &index);
return index;
}
void aHistLineEdit::slotMaybeResize()
{
/*
- if(QTextEdit::text().contains("\n")){
+ if(TQTextEdit::text().contains("\n")){
setText(text());
setCursorPosition(text().length());
}
@@ -112,7 +112,7 @@ void aHistLineEdit::slotMaybeResize()
}
}
- QFontMetrics metrics( currentFont() );
+ TQFontMetrics metrics( currentFont() );
// int h = metrics.height() * lines();
int h = metrics.lineSpacing() * lines()+8;
// only grow if we are less than 1/4 the size of the toplevel
@@ -127,11 +127,11 @@ void aHistLineEdit::slotMaybeResize()
}
if(h != m_height){
m_height = h;
- QSize s = size();
+ TQSize s = size();
s.setHeight(h);
resize(s);
setFixedHeight( h );
- QLayout *l = topLevelWidget()->layout();
+ TQLayout *l = topLevelWidget()->layout();
if(l){
l->invalidate();
l->activate();
@@ -140,7 +140,7 @@ void aHistLineEdit::slotMaybeResize()
}
}
-void aHistLineEdit::keyPressEvent( QKeyEvent *e )
+void aHistLineEdit::keyPressEvent( TQKeyEvent *e )
{
bool accept = true;
bool ignore = false;
@@ -155,7 +155,7 @@ void aHistLineEdit::keyPressEvent( QKeyEvent *e )
// those keycodes correspond to the ones in ksirc.pl in sub hook_fixcolours
if ( e->state() == ControlButton ) {
- QString s = text();
+ TQString s = text();
int curPos = cursorPosition();
switch ( e->key() ) {
case Key_K:
@@ -221,7 +221,7 @@ void aHistLineEdit::keyPressEvent( QKeyEvent *e )
callKeyPressEvent = true;
}
}
- // QLineEdit falsely converts Alt+C to the character 'c', so to work around
+ // TQLineEdit falsely converts Alt+C to the character 'c', so to work around
// this, we just don't pass any Alt+? key on to the keyPressEvent() method.
else if (e->state() == AltButton) {
switch(e->key()){
@@ -293,13 +293,13 @@ void aHistLineEdit::keyPressEvent( QKeyEvent *e )
}
else {
if ( callKeyPressEvent ) {
- QTextEdit::keyPressEvent(e);
+ TQTextEdit::keyPressEvent(e);
}
}
}
}
-bool aHistLineEdit::processKeyEvent( QKeyEvent *e )
+bool aHistLineEdit::processKeyEvent( TQKeyEvent *e )
{
/*
* Only put key sequences in here you
@@ -322,13 +322,13 @@ bool aHistLineEdit::processKeyEvent( QKeyEvent *e )
void aHistLineEdit::ColourPickerPopUp()
{
ColorPicker picker( this );
- if ( picker.exec() == QDialog::Accepted )
+ if ( picker.exec() == TQDialog::Accepted )
{
- QString s = text();
+ TQString s = text();
// int curPos = cursorPosition();
int curPos, p;
getCursorPosition(&p, &curPos);
- QString colString = picker.colorString();
+ TQString colString = picker.colorString();
colString.prepend( 0x03 );
s.insert( curPos, colString );
setText( s );
@@ -336,42 +336,42 @@ void aHistLineEdit::ColourPickerPopUp()
}
}
-void aHistLineEdit::focusInEvent(QFocusEvent *e)
+void aHistLineEdit::focusInEvent(TQFocusEvent *e)
{
- QTextEdit::focusInEvent(e);
+ TQTextEdit::focusInEvent(e);
emit gotFocus();
}
-void aHistLineEdit::focusOutEvent(QFocusEvent *e)
+void aHistLineEdit::focusOutEvent(TQFocusEvent *e)
{
- QTextEdit::focusOutEvent(e);
+ TQTextEdit::focusOutEvent(e);
emit lostFocus();
}
#if 0
-void aHistLineEdit::mousePressEvent ( QMouseEvent *e )
+void aHistLineEdit::mousePressEvent ( TQMouseEvent *e )
{
if(e->button() == MidButton){
/*
- * emit pasteText(QApplication::clipboard()->text(QClipboard::Selection));
+ * emit pasteText(TQApplication::clipboard()->text(QClipboard::Selection));
*/
}
else{
- QTextEdit::mousePressEvent(e);
+ TQTextEdit::mousePressEvent(e);
}
}
#endif
-bool aHistLineEdit::eventFilter( QObject *o, QEvent *e )
+bool aHistLineEdit::eventFilter( TQObject *o, TQEvent *e )
{
- if ( o == this && e->type() == QEvent::AccelOverride )
- if(processKeyEvent( static_cast<QKeyEvent*>( e ) ) == true)
+ if ( o == this && e->type() == TQEvent::AccelOverride )
+ if(processKeyEvent( static_cast<TQKeyEvent*>( e ) ) == true)
return true;
- return QTextEdit::eventFilter( o, e );
+ return TQTextEdit::eventFilter( o, e );
}
-QString aHistLineEdit::text() const
+TQString aHistLineEdit::text() const
{
- QString s = QTextEdit::text();
+ TQString s = TQTextEdit::text();
s.remove("\n");
return s;
}
@@ -381,27 +381,27 @@ void aHistLineEdit::paste()
{
/* we let the top level take it */
if(ksopts->oneLineEntry) {
- emit pasteText(QApplication::clipboard()->text(QClipboard::Selection));
+ emit pasteText(TQApplication::clipboard()->text(QClipboard::Selection));
}
else {
- QString paste = QApplication::clipboard()->text(QClipboard::Selection);
+ TQString paste = TQApplication::clipboard()->text(QClipboard::Selection);
paste.replace("\n", " ~ ");
insert(paste);
}
}
-void aHistLineEdit::paintEvent ( QPaintEvent *p )
+void aHistLineEdit::paintEvent ( TQPaintEvent *p )
{
- QTextEdit::paintEvent(p);
+ TQTextEdit::paintEvent(p);
if(m_drawrect == true){
- QPainter paint(this);
- QPen pen = paint.pen();
+ TQPainter paint(this);
+ TQPen pen = paint.pen();
pen.setWidth(5);
pen.setStyle(Qt::SolidLine);
pen.setColor(palette().active().highlight());
paint.setPen(pen);
- QRect r = frameRect();
+ TQRect r = frameRect();
paint.drawRect(r);
}
@@ -414,7 +414,7 @@ void aHistLineEdit::doEnterKey()
if (!text().isEmpty()) {
// text() has something -> store it in current and add a new empty one
*current = text();
- hist.append(QString::null); // always add empty line at end
+ hist.append(TQString::null); // always add empty line at end
if (hist.count() >= 256) { // if appended check if it will go beyond the max number of entries
hist.remove(hist.begin()); // if so then delete the first entry
}
@@ -424,7 +424,7 @@ void aHistLineEdit::doEnterKey()
// both !isEmpty() and != -> append at end
current = hist.fromLast(); // goto last entry which is empty
*current = text(); // change content to text()
- hist.append(QString::null); // always add empty line at end
+ hist.append(TQString::null); // always add empty line at end
if (hist.count() >= 256) { // if appended check if it will go beyond the max number of entries
hist.remove(hist.begin()); // if so then delete the first entry
}