mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
various cleanups
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
deff95c0f9
commit
4a1b89df05
9 changed files with 9 additions and 91 deletions
|
@ -1018,7 +1018,6 @@ public:
|
|||
LastCursor = DragLinkCursor,
|
||||
BitmapCursor = 24,
|
||||
CustomCursor = 25
|
||||
|
||||
};
|
||||
|
||||
enum TextFormat {
|
||||
|
|
|
@ -245,9 +245,7 @@ void QInputDialogPrivate::ensureLineEdit()
|
|||
Q_Q(QInputDialog);
|
||||
if (!lineEdit) {
|
||||
lineEdit = new QLineEdit(q);
|
||||
#ifndef QT_NO_IM
|
||||
qt_widget_private(lineEdit)->inheritsInputMethodHints = 1;
|
||||
#endif
|
||||
|
||||
lineEdit->hide();
|
||||
QObject::connect(lineEdit, SIGNAL(textChanged(QString)),
|
||||
q, SLOT(_q_textChanged(QString)));
|
||||
|
@ -259,9 +257,6 @@ void QInputDialogPrivate::ensureComboBox()
|
|||
Q_Q(QInputDialog);
|
||||
if (!comboBox) {
|
||||
comboBox = new QComboBox(q);
|
||||
#ifndef QT_NO_IM
|
||||
qt_widget_private(comboBox)->inheritsInputMethodHints = 1;
|
||||
#endif
|
||||
comboBox->hide();
|
||||
QObject::connect(comboBox, SIGNAL(editTextChanged(QString)),
|
||||
q, SLOT(_q_textChanged(QString)));
|
||||
|
|
|
@ -372,48 +372,6 @@ protected:
|
|||
};
|
||||
#endif // QT_NO_CONTEXTMENU
|
||||
|
||||
#ifndef QT_NO_INPUTMETHOD
|
||||
class Q_GUI_EXPORT QInputMethodEvent : public QEvent
|
||||
{
|
||||
public:
|
||||
enum AttributeType {
|
||||
TextFormat,
|
||||
Cursor,
|
||||
Language,
|
||||
Ruby,
|
||||
Selection
|
||||
};
|
||||
class Attribute {
|
||||
public:
|
||||
Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {}
|
||||
AttributeType type;
|
||||
|
||||
int start;
|
||||
int length;
|
||||
QVariant value;
|
||||
};
|
||||
QInputMethodEvent();
|
||||
QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
|
||||
void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
|
||||
|
||||
inline const QList<Attribute> &attributes() const { return attrs; }
|
||||
inline const QString &preeditString() const { return preedit; }
|
||||
|
||||
inline const QString &commitString() const { return commit; }
|
||||
inline int replacementStart() const { return replace_from; }
|
||||
inline int replacementLength() const { return replace_length; }
|
||||
|
||||
QInputMethodEvent(const QInputMethodEvent &other);
|
||||
|
||||
private:
|
||||
QString preedit;
|
||||
QList<Attribute> attrs;
|
||||
QString commit;
|
||||
int replace_from;
|
||||
int replace_length;
|
||||
};
|
||||
#endif // QT_NO_INPUTMETHOD
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
class QMimeData;
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include <qlist.h>
|
||||
#include <qlocale.h>
|
||||
#include <qevent.h>
|
||||
#include <qhash.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -72,7 +71,7 @@ public:
|
|||
|
||||
static QKeyMapper *instance();
|
||||
static void changeKeyboard();
|
||||
static bool sendKeyEvent(QWidget *widget, bool grab,
|
||||
static bool sendKeyEvent(QWidget *widget,
|
||||
QEvent::Type type, int code, Qt::KeyboardModifiers modifiers,
|
||||
const QString &text, bool autorepeat, int count,
|
||||
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers);
|
||||
|
|
|
@ -1228,7 +1228,7 @@ static Bool qt_keyrelease_scanner(Display *, XEvent *event, XPointer arg)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool QKeyMapperPrivate::translateKeyEvent(QWidget *keyWidget, const XEvent *event, bool grab)
|
||||
bool QKeyMapperPrivate::translateKeyEvent(QWidget *keyWidget, const XEvent *event)
|
||||
{
|
||||
int code = -1;
|
||||
int count = 0;
|
||||
|
@ -1337,14 +1337,8 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *keyWidget, const XEvent *even
|
|||
}
|
||||
}
|
||||
|
||||
// autorepeat compression makes sense for all widgets (Windows
|
||||
// does it automatically ....)
|
||||
if (event->type == XKeyPress && text.length() <= 1
|
||||
#ifndef QT_NO_IM
|
||||
// input methods need discrete key events
|
||||
&& !qic
|
||||
#endif// QT_NO_IM
|
||||
) {
|
||||
// autorepeat compression makes sense for all widgets
|
||||
if (event->type == XKeyPress && text.length() <= 1) {
|
||||
XEvent dummy;
|
||||
|
||||
for (;;) {
|
||||
|
@ -1363,12 +1357,12 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *keyWidget, const XEvent *even
|
|||
}
|
||||
}
|
||||
|
||||
return QKeyMapper::sendKeyEvent(keyWidget, grab, type, code, modifiers, text, autor,
|
||||
return QKeyMapper::sendKeyEvent(keyWidget, type, code, modifiers, text, autor,
|
||||
qMax(qMax(count,1), int(text.length())),
|
||||
event->xkey.keycode, keysym, event->xkey.state);
|
||||
}
|
||||
|
||||
bool QKeyMapper::sendKeyEvent(QWidget *keyWidget, bool grab,
|
||||
bool QKeyMapper::sendKeyEvent(QWidget *keyWidget,
|
||||
QEvent::Type type, int code, Qt::KeyboardModifiers modifiers,
|
||||
const QString &text, bool autorepeat, int count,
|
||||
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers)
|
||||
|
@ -1391,7 +1385,6 @@ bool QKeyMapper::sendKeyEvent(QWidget *keyWidget, bool grab,
|
|||
return true;
|
||||
}
|
||||
|
||||
Q_UNUSED(grab);
|
||||
QKeyEvent e(type, code, modifiers,
|
||||
nativeScanCode, nativeVirtualKey, nativeModifiers,
|
||||
text, autorepeat, qMax(qMax(count,1), int(text.length())));
|
||||
|
|
|
@ -636,9 +636,6 @@ public:
|
|||
uint isMoved : 1;
|
||||
uint isGLWidget : 1;
|
||||
uint usesDoubleBufferedGLContext : 1;
|
||||
#ifndef QT_NO_IM
|
||||
uint inheritsInputMethodHints : 1;
|
||||
#endif
|
||||
uint inSetParent : 1;
|
||||
|
||||
// *************************** Platform specific ************************************
|
||||
|
|
|
@ -1662,13 +1662,6 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
|
|||
if (cursor.position() != oldCursorPos)
|
||||
emit q->cursorPositionChanged();
|
||||
_q_updateCurrentCharFormatAndSelection();
|
||||
#ifndef QT_NO_IM
|
||||
if (contextWidget) {
|
||||
if (QInputContext *ic = inputContext()) {
|
||||
ic->update();
|
||||
}
|
||||
}
|
||||
#endif //QT_NO_IM
|
||||
} else {
|
||||
//emit q->visibilityRequest(QRectF(mousePos, QSizeF(1, 1)));
|
||||
if (cursor.position() != oldCursorPos) {
|
||||
|
@ -2982,16 +2975,6 @@ void QTextControlPrivate::_q_copyLink()
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifndef QT_NO_IM
|
||||
QInputContext *QTextControlPrivate::inputContext()
|
||||
{
|
||||
QInputContext *ctx = contextWidget->inputContext();
|
||||
if (!ctx && contextWidget->parentWidget())
|
||||
ctx = contextWidget->parentWidget()->inputContext();
|
||||
return ctx;
|
||||
}
|
||||
#endif
|
||||
|
||||
int QTextControl::hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const
|
||||
{
|
||||
Q_D(const QTextControl);
|
||||
|
|
|
@ -2572,7 +2572,7 @@ int QTextCursor::columnNumber() const
|
|||
if (layout->lineCount() == 0)
|
||||
return relativePos;
|
||||
|
||||
QTextLine line = layout->lineForTextPosition(relativePos);
|
||||
const QTextLine line = layout->lineForTextPosition(relativePos);
|
||||
if (!line.isValid())
|
||||
return 0;
|
||||
return relativePos - line.textStart();
|
||||
|
@ -2586,7 +2586,7 @@ QTextDocument *QTextCursor::document() const
|
|||
{
|
||||
if (d->priv)
|
||||
return d->priv->document();
|
||||
return 0; // document went away
|
||||
return Q_NULLPTR; // document went away
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -267,12 +267,6 @@ public:
|
|||
moveCursor(nextMaskBlank(0));
|
||||
}
|
||||
|
||||
// input methods
|
||||
#ifndef QT_NO_IM
|
||||
bool composeMode() const { return !m_textLayout.preeditAreaText().isEmpty(); }
|
||||
void setPreeditArea(int cursor, const QString &text) { m_textLayout.setPreeditArea(cursor, text); }
|
||||
#endif
|
||||
|
||||
QString preeditAreaText() const { return m_textLayout.preeditAreaText(); }
|
||||
|
||||
void updatePasswordEchoEditing(bool editing);
|
||||
|
|
Loading…
Add table
Reference in a new issue