Renamed some of the methods in the QInputPanel

Change-Id: Ida03ef170e664f79708149c11a00772ee78a984b
Reviewed-on: http://codereview.qt-project.org/4399
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Vesa Rantanen <vesa.rantanen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Lars Knoll 2011-09-07 18:17:24 +02:00
parent 4beac1add9
commit 842c44cb07
5 changed files with 32 additions and 31 deletions

View File

@ -86,10 +86,11 @@ void QInputPanel::setInputItemTranform(const QTransform &transform)
{
Q_D(QInputPanel);
d->inputItemTransform = transform;
emit cursorRectChanged();
emit cursorRectangleChanged();
emit keyboardRectangleChanged();
}
QRectF QInputPanel::cursorRect() const
QRectF QInputPanel::cursorRectangle() const
{
QInputMethodQueryEvent query(Qt::ImMicroFocus);
QGuiApplication::sendEvent(inputItem(), &query);
@ -101,7 +102,7 @@ QRectF QInputPanel::cursorRect() const
return d->inputItemTransform.mapRect(r);
}
QRectF QInputPanel::keyboardRect()
QRectF QInputPanel::keyboardRectangle()
{
QPlatformInputContext *ic = QGuiApplicationPrivate::platformIntegration()->inputContext();
if (ic)
@ -109,31 +110,31 @@ QRectF QInputPanel::keyboardRect()
return QRectF();
}
void QInputPanel::open()
void QInputPanel::show()
{
setOpen(true);
setVisible(true);
}
void QInputPanel::close()
void QInputPanel::hide()
{
setOpen(false);
setVisible(false);
}
bool QInputPanel::isOpen() const
bool QInputPanel::visible() const
{
Q_D(const QInputPanel);
return d->open;
return d->visible;
}
void QInputPanel::setOpen(bool open)
void QInputPanel::setVisible(bool visible)
{
Q_D(QInputPanel);
if (d->open == open)
if (d->visible == visible)
return;
d->open = open;
emit openChanged();
d->visible = visible;
emit visibleChanged();
}
bool QInputPanel::isAnimating() const
@ -152,7 +153,7 @@ void QInputPanel::update(Qt::InputMethodQueries queries)
ic->update(queries);
if (queries & Qt::ImMicroFocus)
emit cursorRectChanged();
emit cursorRectangleChanged();
}
void QInputPanel::reset()

View File

@ -60,9 +60,9 @@ class Q_GUI_EXPORT QInputPanel : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QInputPanel)
Q_PROPERTY(QObject *inputItem READ inputItem WRITE setInputItem NOTIFY inputItemChanged)
Q_PROPERTY(QRectF cursorRect READ cursorRect NOTIFY cursorRectChanged)
Q_PROPERTY(QRectF keyboardRect READ keyboardRect NOTIFY keyboardRectChanged)
Q_PROPERTY(bool open READ isOpen WRITE setOpen NOTIFY openChanged)
Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged)
Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged)
public:
@ -76,24 +76,24 @@ public:
void setInputItemTranform(const QTransform &transform);
// in window coordinates
QRectF cursorRect() const; // ### what if we have rotations for the item?
QRectF cursorRectangle() const; // ### what if we have rotations for the item?
// keyboard geometry in window coords
QRectF keyboardRect();
QRectF keyboardRectangle();
enum Action {
Click,
ContextMenu
};
bool isOpen() const;
void setOpen(bool open);
bool visible() const;
void setVisible(bool visible);
bool isAnimating() const;
public Q_SLOTS:
void open();
void close();
void show();
void hide();
void update(Qt::InputMethodQueries queries);
void reset();
@ -102,9 +102,9 @@ public Q_SLOTS:
Q_SIGNALS:
void inputItemChanged();
void cursorRectChanged();
void keyboardRectChanged();
void openChanged();
void cursorRectangleChanged();
void keyboardRectangleChanged();
void visibleChanged();
void animatingChanged();
private:

View File

@ -54,11 +54,11 @@ class QInputPanelPrivate : public QObjectPrivate
{
public:
inline QInputPanelPrivate()
: open(false)
: visible(false)
{}
QTransform inputItemTransform;
QWeakPointer<QObject> inputItem;
bool open;
bool visible;
};
QT_END_NAMESPACE

View File

@ -75,7 +75,7 @@ QRectF QPlatformInputContext::keyboardRect() const
void QPlatformInputContext::emitKeyboardRectChanged() const
{
emit qApp->inputPanel()->keyboardRectChanged();
emit qApp->inputPanel()->keyboardRectangleChanged();
}
bool QPlatformInputContext::isAnimating()

View File

@ -4110,10 +4110,10 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
break;
}
case QEvent::RequestSoftwareInputPanel:
inputPanel()->open();
inputPanel()->show();
break;
case QEvent::CloseSoftwareInputPanel:
inputPanel()->close();
inputPanel()->hide();
break;
#ifndef QT_NO_GESTURES