@@ -9,31 +9,31 @@ namespace qs::wayland::input_method {
99
1010using namespace impl ;
1111
12- InputMethod::InputMethod (QObject* parent): QObject(parent) { getInput (); }
12+ InputMethod::InputMethod (QObject* parent): QObject(parent) { this -> getInput (); }
1313
1414void InputMethod::sendString (const QString& text) {
15- if (!isActive ()) return ;
15+ if (!this -> isActive ()) return ;
1616
17- handle->commitString (text);
18- handle->commit ();
17+ this -> handle ->commitString (text);
18+ this -> handle ->commit ();
1919}
2020
2121
2222void InputMethod::sendPreeditString (const QString& text, int32_t cursorBegin, int32_t cursorEnd) {
23- if (!isActive ()) return ;
23+ if (!this -> isActive ()) return ;
2424
25- handle->sendPreeditString (text, cursorBegin, cursorEnd);
26- handle->commit ();
25+ this -> handle ->sendPreeditString (text, cursorBegin, cursorEnd);
26+ this -> handle ->commit ();
2727}
2828
2929void InputMethod::deleteText (int before, int after) {
30- if (!isActive ()) return ;
30+ if (!this -> isActive ()) return ;
3131
32- handle->deleteText (before, after);
33- handle->commit ();
32+ this -> handle ->deleteText (before, after);
33+ this -> handle ->commit ();
3434}
3535
36- bool InputMethod::isActive () const { return hasInput () && handle->isActive (); }
36+ bool InputMethod::isActive () const { return this -> hasInput () && this -> handle ->isActive (); }
3737
3838bool InputMethod::keyboardOnActive () const { return this ->mKeyboardOnActive ; }
3939void InputMethod::setKeyboardOnActive (bool value) {
@@ -53,24 +53,24 @@ void InputMethod::setKeyboardComponent(QQmlComponent* keyboardComponent) {
5353 this ->keyboard = nullptr ;
5454 }
5555
56- handleKeyboardActive ();
56+ this -> handleKeyboardActive ();
5757}
5858
5959bool InputMethod::hasInput () const { return handle && handle->isAvailable (); }
6060
6161void InputMethod::getInput () {
62- if (hasInput ()) return ;
62+ if (this -> hasInput ()) return ;
6363
64- handle = InputMethodManager::instance ()->acquireInput ();
64+ this -> handle = InputMethodManager::instance ()->acquireInput ();
6565
6666 QObject::connect (
67- handle.get (),
67+ this -> handle .get (),
6868 &InputMethodHandle::activated,
6969 this ,
7070 &InputMethod::onHandleActiveChanged
7171 );
7272 QObject::connect (
73- handle.get (),
73+ this -> handle .get (),
7474 &InputMethodHandle::deactivated,
7575 this ,
7676 &InputMethod::onHandleActiveChanged
@@ -80,9 +80,9 @@ void InputMethod::getInput() {
8080}
8181
8282void InputMethod::releaseInput () {
83- if (!handle) return ;
84- handle->deleteLater ();
85- handle = nullptr ;
83+ if (!this -> handle ) return ;
84+ this -> handle ->deleteLater ();
85+ this -> handle = nullptr ;
8686 emit hasInputChanged ();
8787}
8888
@@ -92,7 +92,7 @@ bool InputMethod::hasKeyboard() const {
9292}
9393
9494void InputMethod::grabKeyboard () {
95- if (hasKeyboard ()) return ;
95+ if (this -> hasKeyboard ()) return ;
9696 auto * instanceObj =
9797 this ->mKeyboardComponent ->create (QQmlEngine::contextForObject (this ->mKeyboardComponent ));
9898 auto * instance = qobject_cast<Keyboard*>(instanceObj);
@@ -113,7 +113,7 @@ void InputMethod::grabKeyboard() {
113113}
114114
115115void InputMethod::releaseKeyboard () {
116- if (!hasKeyboard ()) return ;
116+ if (!this -> hasKeyboard ()) return ;
117117 this ->keyboard ->deleteLater ();
118118 this ->keyboard = nullptr ;
119119 this ->handle ->releaseKeyboard ();
@@ -123,31 +123,31 @@ void InputMethod::releaseKeyboard() {
123123
124124void InputMethod::handleKeyboardActive () {
125125 if (!this ->mKeyboardComponent ) return ;
126- if (isActive () && this ->mKeyboardOnActive ) {
127- grabKeyboard ();
126+ if (this -> isActive () && this ->mKeyboardOnActive ) {
127+ this -> grabKeyboard ();
128128 } else if (this ->keyboard ) {
129129 this ->releaseKeyboard ();
130130 }
131131}
132132
133133void InputMethod::onHandleActiveChanged () {
134- handleKeyboardActive ();
134+ this -> handleKeyboardActive ();
135135 emit activeChanged ();
136136}
137137
138138Keyboard::Keyboard (QObject* parent): QObject(parent) {}
139139
140140void Keyboard::setKeyboard (QPointer<InputMethodKeyboardGrab> keyboard) {
141- if (mKeyboard == keyboard) return ;
141+ if (this -> mKeyboard == keyboard) return ;
142142 if (keyboard == nullptr ) return ;
143143 this ->mKeyboard = std::move (keyboard);
144144
145- QObject::connect (mKeyboard , &InputMethodKeyboardGrab::keyPress, this , &Keyboard::keyPress);
146- QObject::connect (mKeyboard , &InputMethodKeyboardGrab::escapePress, this , &Keyboard::escapePress);
147- QObject::connect (mKeyboard , &InputMethodKeyboardGrab::returnPress, this , &Keyboard::returnPress);
148- QObject::connect (mKeyboard , &InputMethodKeyboardGrab::directionPress, this , &Keyboard::directionPress);
149- QObject::connect (mKeyboard , &InputMethodKeyboardGrab::backspacePress, this , &Keyboard::backspacePress);
150- QObject::connect (mKeyboard , &InputMethodKeyboardGrab::deletePress, this , &Keyboard::deletePress);
145+ QObject::connect (this -> mKeyboard , &InputMethodKeyboardGrab::keyPress, this , &Keyboard::keyPress);
146+ QObject::connect (this -> mKeyboard , &InputMethodKeyboardGrab::escapePress, this , &Keyboard::escapePress);
147+ QObject::connect (this -> mKeyboard , &InputMethodKeyboardGrab::returnPress, this , &Keyboard::returnPress);
148+ QObject::connect (this -> mKeyboard , &InputMethodKeyboardGrab::directionPress, this , &Keyboard::directionPress);
149+ QObject::connect (this -> mKeyboard , &InputMethodKeyboardGrab::backspacePress, this , &Keyboard::backspacePress);
150+ QObject::connect (this -> mKeyboard , &InputMethodKeyboardGrab::deletePress, this , &Keyboard::deletePress);
151151}
152152
153153} // namespace qs::wayland::input_method
0 commit comments