diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:33:07 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:33:07 -0600 |
commit | 805c2821ceaddada48b346c6d11bd0dc1351a539 (patch) | |
tree | f4f34d4fae6b86d1b1058f396da4729906edbadb /src/kvirc/ui/kvi_input.cpp | |
parent | 918c3ff07736f0c343cb190d3f0df99e4cb8dab8 (diff) | |
download | kvirc-805c2821ceaddada48b346c6d11bd0dc1351a539.tar.gz kvirc-805c2821ceaddada48b346c6d11bd0dc1351a539.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'src/kvirc/ui/kvi_input.cpp')
-rw-r--r-- | src/kvirc/ui/kvi_input.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/src/kvirc/ui/kvi_input.cpp b/src/kvirc/ui/kvi_input.cpp index 5258577..b8dd492 100644 --- a/src/kvirc/ui/kvi_input.cpp +++ b/src/kvirc/ui/kvi_input.cpp @@ -61,14 +61,14 @@ #include <tqfiledialog.h> #include "kvi_tal_popupmenu.h" #include <tqpainter.h> -#include <tqclipboard.h> +#include <clipboard.h> #include <tqstringlist.h> #include "kvi_pointerlist.h" #include <tqapplication.h> -#include <tqclipboard.h> +#include <clipboard.h> #include <tqmessagebox.h> #include "kvi_tal_hbox.h" -#include <tqlayout.h> +#include <layout.h> #include <tqstyle.h> #include <tqevent.h> @@ -299,10 +299,10 @@ void KviInputEditor::dropEvent(TQDropEvent *e) int KviInputEditor::heightHint() const { - return tqsizeHint().height(); + return sizeHint().height(); } -TQSize KviInputEditor::tqsizeHint() const +TQSize KviInputEditor::sizeHint() const { //grabbed from qlineedit.cpp constPolish(); @@ -454,7 +454,7 @@ void KviInputEditor::drawContents(TQPainter *p) { pa.setPen(KVI_OPTION_COLOR(KviOption_colorInputControl)); - TQString s = getSubstituteChar(m_szTextBuffer[charIdx].tqunicode()); + TQString s = getSubstituteChar(m_szTextBuffer[charIdx].unicode()); // the block width is 4 pixels more than the actual character @@ -523,9 +523,9 @@ void KviInputEditor::drawContents(TQPainter *p) { TQChar c = m_szTextBuffer.at(m_iBlockLen); #ifdef COMPILE_USE_QT4 - m_iLastCursorXPosition+= c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c); + m_iLastCursorXPosition+= c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c); #else - m_iLastCursorXPosition+= (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c); + m_iLastCursorXPosition+= (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); #endif m_iBlockLen++; } @@ -626,7 +626,7 @@ void KviInputEditor::extractNextBlock(int idx,TQFontMetrics & fm,int curXPos,int TQChar c = m_szTextBuffer[idx]; - if((c.tqunicode() > 32) || + if((c.unicode() > 32) || ((c != TQChar(KVI_TEXT_COLOR)) && (c != TQChar(KVI_TEXT_BOLD)) && (c != TQChar(KVI_TEXT_UNDERLINE)) && (c != TQChar(KVI_TEXT_RESET)) && (c != TQChar(KVI_TEXT_REVERSE)) && @@ -637,7 +637,7 @@ void KviInputEditor::extractNextBlock(int idx,TQFontMetrics & fm,int curXPos,int while((idx < ((int)(m_szTextBuffer.length()))) && (curXPos < maxXPos)) { c = m_szTextBuffer[idx]; - if((c.tqunicode() > 32) || + if((c.unicode() > 32) || ((c != TQChar(KVI_TEXT_COLOR)) && (c != TQChar(KVI_TEXT_BOLD)) && (c != TQChar(KVI_TEXT_UNDERLINE)) && (c != TQChar(KVI_TEXT_RESET)) && (c != TQChar(KVI_TEXT_REVERSE)) && (c != TQChar(KVI_TEXT_CRYPTESCAPE)) && @@ -645,9 +645,9 @@ void KviInputEditor::extractNextBlock(int idx,TQFontMetrics & fm,int curXPos,int { m_iBlockLen++; #ifdef COMPILE_USE_QT4 - int xxx = c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);; + int xxx = c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; #else - int xxx = (c.tqunicode() < 256 ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c)); + int xxx = (c.unicode() < 256 ? g_iInputFontCharWidth[c.unicode()] : fm.width(c)); #endif m_iBlockWidth +=xxx; curXPos +=xxx; @@ -658,9 +658,9 @@ void KviInputEditor::extractNextBlock(int idx,TQFontMetrics & fm,int curXPos,int } else { m_bControlBlock = true; m_iBlockLen = 1; - m_iBlockWidth = g_iInputFontCharWidth[c.tqunicode()]; + m_iBlockWidth = g_iInputFontCharWidth[c.unicode()]; //Control code - switch(c.tqunicode()) + switch(c.unicode()) { case KVI_TEXT_BOLD: m_bCurBold = ! m_bCurBold; @@ -716,7 +716,7 @@ void KviInputEditor::runUpToTheFirstVisibleChar() register int idx = 0; while(idx < m_iFirstVisibleChar) { - unsigned short c = m_szTextBuffer[idx].tqunicode(); + unsigned short c = m_szTextBuffer[idx].unicode(); if(c < 32) { switch(c) @@ -789,7 +789,7 @@ void KviInputEditor::mousePressEvent(TQMouseEvent *e) TQString szClip; - TQClipboard * c = TQApplication::tqclipboard(); + TQClipboard * c = TQApplication::clipboard(); if(c) { szClip = c->text(TQClipboard::Clipboard); @@ -918,7 +918,7 @@ bool KviInputEditor::hasSelection() void KviInputEditor::copyToClipboard() { if(!hasSelection())return; - TQClipboard * c = TQApplication::tqclipboard(); + TQClipboard * c = TQApplication::clipboard(); if(!c)return; TQString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1); c->setText(szTxt,TQClipboard::Clipboard); @@ -928,7 +928,7 @@ void KviInputEditor::copyToClipboard() void KviInputEditor::copyToSelection(bool bDonNotCopyToClipboard) { if(!hasSelection())return; - TQClipboard * c = TQApplication::tqclipboard(); + TQClipboard * c = TQApplication::clipboard(); if(!c)return; TQString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1); if(c->supportsSelection()) @@ -969,7 +969,7 @@ void KviInputEditor::removeSelected() void KviInputEditor::cut() { if(!hasSelection())return; - TQClipboard * c = TQApplication::tqclipboard(); + TQClipboard * c = TQApplication::clipboard(); if(!c)return; c->setText(m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1),TQClipboard::Clipboard); m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1); @@ -1042,7 +1042,7 @@ int KviInputEditor::replaceSegment(int start, int length, const TQString &text) void KviInputEditor::pasteClipboardWithConfirmation() { - TQClipboard * c = TQApplication::tqclipboard(); + TQClipboard * c = TQApplication::clipboard(); if(!c)return; TQString szText = c->text(TQClipboard::Clipboard); @@ -1057,7 +1057,7 @@ void KviInputEditor::pasteClipboardWithConfirmation() void KviInputEditor::pasteSelectionWithConfirmation() { - TQClipboard * c = TQApplication::tqclipboard(); + TQClipboard * c = TQApplication::clipboard(); if(!c)return; TQString szText = c->text(c->supportsSelection() ? TQClipboard::Selection : TQClipboard::Clipboard); @@ -1325,7 +1325,7 @@ void KviInputEditor::imComposeEvent(TQIMEvent *e) #endif - // tqrepaint + // repaint m_bUpdatesEnabled = true; repaintWithCursorOn(); e->accept(); @@ -1347,7 +1347,7 @@ void KviInputEditor::imEndEvent(TQIMEvent *e) // move cursor to after the IM result text moveCursorTo(m_iIMStart + m_iIMLength); - // tqrepaint + // repaint m_bUpdatesEnabled = true; repaintWithCursorOn(); @@ -1819,7 +1819,7 @@ void KviInputEditor::completion(bool bShift) bool bIsDir = false; bool bIsNick = false; - unsigned short uc = word[0].tqunicode(); + unsigned short uc = word[0].unicode(); if(uc == '/') { @@ -1845,7 +1845,7 @@ void KviInputEditor::completion(bool bShift) { if(m_pKviWindow) { - if( (word.length()==1) && (m_pKviWindow->windowName()[0].tqunicode()==uc)) + if( (word.length()==1) && (m_pKviWindow->windowName()[0].unicode()==uc)) { match=m_pKviWindow->windowName(); match.append(" "); @@ -1911,8 +1911,8 @@ void KviInputEditor::completion(bool bShift) const TQChar * b2 = KviTQString::nullTerminatedArray(match) + wLen; const TQChar * c1 = b1; const TQChar * c2 = b2; - if(bIsDir)while(c1->tqunicode() && (c1->tqunicode() == c2->tqunicode()))c1++,c2++; - else while(c1->tqunicode() && (c1->lower().tqunicode() == c2->lower().tqunicode()))c1++,c2++; + if(bIsDir)while(c1->unicode() && (c1->unicode() == c2->unicode()))c1++,c2++; + else while(c1->unicode() && (c1->lower().unicode() == c2->lower().unicode()))c1++,c2++; int len = wLen + (c1 - b1); if(len < ((int)(match.length())))match.remove(len,match.length() - len); if(!all.isEmpty())all.append(", "); @@ -2084,17 +2084,17 @@ void KviInputEditor::moveRightFirstVisibleCharToShowCursor() TQChar c = m_szTextBuffer.at(m_iCursorPosition); #ifdef COMPILE_USE_QT4 - m_iLastCursorXPosition += c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);; + m_iLastCursorXPosition += c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; #else - m_iLastCursorXPosition += (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c); + m_iLastCursorXPosition += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); #endif while(m_iLastCursorXPosition >= contentsRect().width()-2*KVI_INPUT_MARGIN) { c = m_szTextBuffer.at(m_iFirstVisibleChar); #ifdef COMPILE_USE_QT4 - m_iLastCursorXPosition -= c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);; + m_iLastCursorXPosition -= c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; #else - m_iLastCursorXPosition -= (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c); + m_iLastCursorXPosition -= (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); #endif m_iFirstVisibleChar++; } @@ -2127,9 +2127,9 @@ int KviInputEditor::charIndexFromXPosition(int xPos) { TQChar c = m_szTextBuffer.at(curChar); #ifdef COMPILE_USE_QT4 - int widthCh = c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);; + int widthCh = c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; #else - int widthCh = (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c); + int widthCh = (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); #endif if(xPos < (curXPos+(widthCh/2)))return curChar; else if(xPos < (curXPos+widthCh))return (curChar+1); @@ -2150,9 +2150,9 @@ int KviInputEditor::xPositionFromCharIndex(TQFontMetrics& fm,int chIdx,bool bCo { TQChar c = m_szTextBuffer.at(curChar); #ifdef COMPILE_USE_QT4 - curXPos += c.tqunicode() < 32 ? fm.width(getSubstituteChar(c.tqunicode())) + 3 : fm.width(c);; + curXPos += c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; #else - curXPos += (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : fm.width(c); + curXPos += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); #endif curChar++; } @@ -2170,9 +2170,9 @@ int KviInputEditor::xPositionFromCharIndex(int chIdx,bool bContentsCoords) { TQChar c = m_szTextBuffer.at(curChar); #ifdef COMPILE_USE_QT4 - curXPos += c.tqunicode() < 32 ? g_pLastFontMetrics->width(getSubstituteChar(c.tqunicode())) + 3 : g_pLastFontMetrics->width(c); + curXPos += c.unicode() < 32 ? g_pLastFontMetrics->width(getSubstituteChar(c.unicode())) + 3 : g_pLastFontMetrics->width(c); #else - curXPos += (c.tqunicode() < 256) ? g_iInputFontCharWidth[c.tqunicode()] : g_pLastFontMetrics->width(c); + curXPos += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : g_pLastFontMetrics->width(c); #endif curChar++; } @@ -2335,9 +2335,9 @@ KviInput::KviInput(KviWindow *par,KviUserListView * view) m_pButtonContainer->setSpacing(0); #ifdef COMPILE_USE_QT4 - m_pButtonContainer->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Preferred)); -// if(m_pButtonContainer->tqlayout()) -// m_pButtonContainer->tqlayout()->setSizeConstraint(TQLayout::SetMinimumSize); + m_pButtonContainer->setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Preferred)); +// if(m_pButtonContainer->layout()) +// m_pButtonContainer->layout()->setSizeConstraint(TQLayout::SetMinimumSize); #endif m_pHistoryButton = new KviStyledToolButton(m_pButtonContainer,"historybutton"); @@ -2396,9 +2396,9 @@ KviInput::KviInput(KviWindow *par,KviUserListView * view) m_pInputEditor = new KviInputEditor(this,par,view); connect(m_pInputEditor,TQT_SIGNAL(enterPressed()),this,TQT_SLOT(inputEditorEnterPressed())); #ifdef COMPILE_USE_QT4 - m_pInputEditor->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Ignored)); + m_pInputEditor->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Ignored)); #else - m_pInputEditor->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Ignored,TQSizePolicy::Ignored)); + m_pInputEditor->setSizePolicy(TQSizePolicy(TQSizePolicy::Ignored,TQSizePolicy::Ignored)); #endif @@ -2497,7 +2497,7 @@ void KviInput::keyPressEvent(TQKeyEvent *e) "here to prevent you from accidentally sending<br>" \ "a really large message just because you didn't edit it<br>" \ "properly after pasting text from the clipboard.<br><br>" \ - "Do you want the message to be sent?").tqarg(nLines), + "Do you want the message to be sent?").arg(nLines), __tr2qs("Yes, always"), __tr2qs("Yes"), __tr2qs("No"), @@ -2543,7 +2543,7 @@ void KviInput::multilineEditorButtonToggled(bool bOn) KviScriptEditor::destroyInstance(m_pMultiLineEditor); m_pMultiLineEditor = 0; m_pInputEditor->show(); - m_pWindow->tqchildrenTreeChanged(0); + m_pWindow->childrenTreeChanged(0); m_pInputEditor->setFocus(); m_pMultiEditorButton->setOn(false); } else { @@ -2556,7 +2556,7 @@ void KviInput::multilineEditorButtonToggled(bool bOn) m_pMultiLineEditor->setFindLineeditReadOnly(true); m_pInputEditor->hide(); m_pMultiLineEditor->show(); - m_pWindow->tqchildrenTreeChanged(m_pMultiLineEditor); + m_pWindow->childrenTreeChanged(m_pMultiLineEditor); m_pMultiLineEditor->setFocus(); m_pMultiEditorButton->setOn(true); } @@ -2596,14 +2596,14 @@ void KviInput::historyButtonClicked() void KviInput::setFocus() { - // redirect setFocus() to the right tqchildren + // redirect setFocus() to the right children if(m_pMultiLineEditor)m_pMultiLineEditor->setFocus(); else m_pInputEditor->setFocus(); } void KviInput::focusInEvent(TQFocusEvent * e) { - // if we get a focus in event , redirect the focus to the tqchildren + // if we get a focus in event , redirect the focus to the children if(m_pMultiLineEditor)m_pMultiLineEditor->setFocus(); else m_pInputEditor->setFocus(); } |