Add QWidget.updateMicroFocus() method
This commit is contained in:
parent
47d98500cf
commit
731d186b01
@ -23,4 +23,8 @@ class DLL_EXPORT NWidget : public QWidget, public NodeWidget {
|
||||
}
|
||||
|
||||
virtual void connectSignalsToEventEmitter() { QWIDGET_SIGNALS }
|
||||
|
||||
void _protected_updateMicroFocus(Qt::InputMethodQuery query) {
|
||||
updateMicroFocus(query);
|
||||
}
|
||||
};
|
||||
|
||||
@ -765,6 +765,16 @@
|
||||
Napi::Env env = info.Env(); \
|
||||
int result = this->instance->widthMM(); \
|
||||
return Napi::Number::New(env, result); \
|
||||
} \
|
||||
Napi::Value updateMicroFocus(const Napi::CallbackInfo& info) { \
|
||||
Napi::Env env = info.Env(); \
|
||||
NWidget *nwidget = dynamic_cast<NWidget*>(this->instance.data()); \
|
||||
if (nwidget) { \
|
||||
Qt::InputMethodQuery query = static_cast<Qt::InputMethodQuery>( \
|
||||
info[0].As<Napi::Number>().Int32Value()); \
|
||||
nwidget->_protected_updateMicroFocus(query); \
|
||||
} \
|
||||
return env.Null(); \
|
||||
}
|
||||
|
||||
#endif // QWIDGET_WRAPPED_METHODS_DECLARATION
|
||||
@ -884,7 +894,8 @@
|
||||
InstanceMethod("paintingActive", &WidgetWrapName::paintingActive), \
|
||||
InstanceMethod("physicalDpiX", &WidgetWrapName::physicalDpiX), \
|
||||
InstanceMethod("physicalDpiY", &WidgetWrapName::physicalDpiY), \
|
||||
InstanceMethod("widthMM", &WidgetWrapName::widthMM),
|
||||
InstanceMethod("widthMM", &WidgetWrapName::widthMM), \
|
||||
InstanceMethod("updateMicroFocus", &WidgetWrapName::updateMicroFocus),
|
||||
|
||||
#endif // QWIDGET_WRAPPED_METHODS_EXPORT_DEFINE
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import addon from '../utils/addon';
|
||||
import { QLayout } from './QLayout';
|
||||
import { NativeElement } from '../core/Component';
|
||||
import { FlexLayout } from '../core/FlexLayout';
|
||||
import { WidgetAttribute, WindowType, ContextMenuPolicy, FocusReason, FocusPolicy } from '../QtEnums';
|
||||
import { WidgetAttribute, WindowType, ContextMenuPolicy, FocusReason, FocusPolicy, InputMethodQuery } from '../QtEnums';
|
||||
import { QIcon } from '../QtGui/QIcon';
|
||||
import { QCursor } from '../QtGui/QCursor';
|
||||
import { CursorShape, WindowState } from '../QtEnums';
|
||||
@ -564,6 +564,11 @@ export class QWidget<Signals extends QWidgetSignals = QWidgetSignals> extends Yo
|
||||
updatesEnabled(): boolean {
|
||||
return this.property('updatesEnabled').toBool();
|
||||
}
|
||||
|
||||
updateMicroFocus(query: number = InputMethodQuery.ImQueryAll): void {
|
||||
this.native.updateMicroFocus(query);
|
||||
}
|
||||
|
||||
// TODO: QRegion visibleRegion() const
|
||||
whatsThis(): string {
|
||||
return this.property('whatsThis').toString();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user