本文整理汇总了C++中QWindow::contentOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ QWindow::contentOrientation方法的具体用法?C++ QWindow::contentOrientation怎么用?C++ QWindow::contentOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWindow
的用法示例。
在下文中一共展示了QWindow::contentOrientation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setFocusObject
void QMaliitPlatformInputContext::setFocusObject(QObject *object)
{
if (!d->valid)
return;
QWindow *window = qGuiApp->focusWindow();
if (window != d->window.data()) {
if (d->window)
disconnect(d->window.data(), SIGNAL(contentOrientationChanged(Qt::ScreenOrientation)),
this, SLOT(updateServerWindowOrientation(Qt::ScreenOrientation)));
d->window = window;
if (d->window)
connect(d->window.data(), SIGNAL(contentOrientationChanged(Qt::ScreenOrientation)),
this, SLOT(updateServerWindowOrientation(Qt::ScreenOrientation)));
}
d->imState["focusState"] = (object != 0);
if (inputMethodAccepted()) {
if (window)
d->imState["winId"] = static_cast<qulonglong>(window->winId());
if (!d->active) {
d->active = true;
d->server->activateContext();
if (window)
d->server->appOrientationChanged(orientationAngle(window->contentOrientation()));
}
}
d->sendStateUpdate(/*focusChanged*/true);
if (inputMethodAccepted() && window && d->visibility == InputPanelShowRequested)
showInputPanel();
}
示例2: setFocusObject
void MInputContext::setFocusObject(QObject *focused)
{
if (debug) qDebug() << InputContextName << "in" << __PRETTY_FUNCTION__ << focused;
updateInputMethodExtensions();
QWindow *newFocusWindow = qGuiApp->focusWindow();
if (newFocusWindow != window.data()) {
if (window) {
disconnect(window.data(), SIGNAL(contentOrientationChanged(Qt::ScreenOrientation)),
this, SLOT(updateServerOrientation(Qt::ScreenOrientation)));
}
window = newFocusWindow;
if (window) {
connect(window.data(), SIGNAL(contentOrientationChanged(Qt::ScreenOrientation)),
this, SLOT(updateServerOrientation(Qt::ScreenOrientation)));
updateServerOrientation(window->contentOrientation());
}
}
bool oldAcceptInput = currentFocusAcceptsInput;
currentFocusAcceptsInput = inputMethodAccepted();
if (!active && currentFocusAcceptsInput) {
imServer->activateContext();
active = true;
updateServerOrientation(newFocusWindow->contentOrientation());
}
if (active && (currentFocusAcceptsInput || oldAcceptInput)) {
const QMap<QString, QVariant> stateInformation = getStateInformation();
imServer->updateWidgetInformation(stateInformation, true);
}
if (inputPanelState == InputPanelShowPending && currentFocusAcceptsInput) {
sipHideTimer.stop();
imServer->showInputMethod();
inputPanelState = InputPanelShown;
}
}