Commit d02c4391 authored by Eckhart Wörner's avatar Eckhart Wörner

krazy: Check for Qt classes that should not be used (4 issues)

* QTextEdit[KTextEdit]

svn path=/trunk/KDE/kdeedu/kmplot/; revision=902694
parent 763e9a7f
...@@ -15,7 +15,7 @@ void EquationEditWidget::setClearSelectionOnFocusOut(bool doIt) { ...@@ -15,7 +15,7 @@ void EquationEditWidget::setClearSelectionOnFocusOut(bool doIt) {
EquationEditWidget::EquationEditWidget(EquationEdit* parent) EquationEditWidget::EquationEditWidget(EquationEdit* parent)
: QTextEdit(parent) : KTextEdit(parent)
{ {
m_clearSelectionOnFocusOut = true; m_clearSelectionOnFocusOut = true;
m_parent = parent; m_parent = parent;
...@@ -40,7 +40,7 @@ void EquationEditWidget::recalculateGeometry() { ...@@ -40,7 +40,7 @@ void EquationEditWidget::recalculateGeometry() {
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setWordWrapMode(QTextOption::NoWrap); setWordWrapMode(QTextOption::NoWrap);
setLineWrapMode(QTextEdit::NoWrap); setLineWrapMode(KTextEdit::NoWrap);
setTabChangesFocus(true); setTabChangesFocus(true);
} }
...@@ -56,20 +56,20 @@ void EquationEditWidget::keyPressEvent(QKeyEvent* e) { ...@@ -56,20 +56,20 @@ void EquationEditWidget::keyPressEvent(QKeyEvent* e) {
emit m_parent->editingFinished(); emit m_parent->editingFinished();
emit m_parent->returnPressed(); emit m_parent->returnPressed();
} else { } else {
// Still pass these keys to QTextEdit, in case the user has to scroll // Still pass these keys to KTextEdit, in case the user has to scroll
// up/down the text // up/down the text
if (e->key() == Qt::Key_Up) if (e->key() == Qt::Key_Up)
emit m_parent->upPressed(); emit m_parent->upPressed();
else if (e->key() == Qt::Key_Down) else if (e->key() == Qt::Key_Down)
emit m_parent->downPressed(); emit m_parent->downPressed();
QTextEdit::keyPressEvent(e); KTextEdit::keyPressEvent(e);
} }
} }
void EquationEditWidget::focusOutEvent(QFocusEvent* e) { void EquationEditWidget::focusOutEvent(QFocusEvent* e) {
QTextEdit::focusOutEvent(e); KTextEdit::focusOutEvent(e);
if (m_clearSelectionOnFocusOut) if (m_clearSelectionOnFocusOut)
clearSelection(); clearSelection();
...@@ -80,7 +80,7 @@ void EquationEditWidget::focusOutEvent(QFocusEvent* e) { ...@@ -80,7 +80,7 @@ void EquationEditWidget::focusOutEvent(QFocusEvent* e) {
void EquationEditWidget::focusInEvent(QFocusEvent* e) { void EquationEditWidget::focusInEvent(QFocusEvent* e) {
QTextEdit::focusOutEvent(e); KTextEdit::focusOutEvent(e);
m_parent->reHighlight(); m_parent->reHighlight();
if (e->reason() == Qt::TabFocusReason) if (e->reason() == Qt::TabFocusReason)
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#ifndef EQUATIONEDITWIDGET_H #ifndef EQUATIONEDITWIDGET_H
#define EQUATIONEDITWIDGET_H #define EQUATIONEDITWIDGET_H
#include <QtGui/QTextEdit> #include <KTextEdit>
class EquationEdit; class EquationEdit;
...@@ -33,7 +33,7 @@ class EquationEdit; ...@@ -33,7 +33,7 @@ class EquationEdit;
/** /**
* The actual line edit. * The actual line edit.
*/ */
class EquationEditWidget : public QTextEdit class EquationEditWidget : public KTextEdit
{ {
public: public:
EquationEditWidget(EquationEdit* parent); EquationEditWidget(EquationEdit* parent);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment