Add program to display actual Qt im module information
This commit is contained in:
parent
47bd8f2e3e
commit
40c80056a6
|
@ -1,2 +1,6 @@
|
|||
add_subdirectory(dbusaddons)
|
||||
add_subdirectory(inputcontext)
|
||||
|
||||
if(NOT BUILD_ONLY_PLUGIN)
|
||||
add_subdirectory(immodule-probing)
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
add_executable(fcitx5-qt4-immodule-probing main.cpp)
|
||||
target_link_libraries(fcitx5-qt4-immodule-probing Qt4::QtGui)
|
||||
|
||||
install(TARGETS fcitx5-qt4-immodule-probing DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023~2023 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*
|
||||
*/
|
||||
#include <QApplication>
|
||||
#include <QInputContext>
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QApplication app(argc, argv);
|
||||
auto *inputContext = app.inputContext();
|
||||
std::cout << "QT_IM_MODULE=";
|
||||
if (inputContext) {
|
||||
std::cout << inputContext->identifierName().toUtf8().constData();
|
||||
}
|
||||
std::cout << std::endl;
|
||||
return 0;
|
||||
}
|
|
@ -5,4 +5,5 @@ if(NOT BUILD_ONLY_PLUGIN)
|
|||
add_subdirectory(guiwrapper)
|
||||
add_subdirectory(widgetsaddons)
|
||||
add_subdirectory(quickphrase-editor)
|
||||
add_subdirectory(immodule-probing)
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
add_executable(fcitx5-qt5-immodule-probing main.cpp)
|
||||
target_include_directories(fcitx5-qt5-immodule-probing PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
||||
target_link_libraries(fcitx5-qt5-immodule-probing Qt5::Gui)
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023~2023 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*
|
||||
*/
|
||||
#include <QGuiApplication>
|
||||
#include <iostream>
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <qpa/qplatforminputcontext.h>
|
||||
#include <qpa/qplatforminputcontextfactory_p.h>
|
||||
#include <qpa/qplatformintegration.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QGuiApplication app(argc, argv);
|
||||
std::cout << "QT_QPA_PLATFORM=" << app.platformName().toStdString()
|
||||
<< std::endl;
|
||||
std::cout << "QT_IM_MODULE="
|
||||
<< QPlatformInputContextFactory::requested().toStdString()
|
||||
<< std::endl;
|
||||
auto inputContext =
|
||||
QGuiApplicationPrivate::platformIntegration()->inputContext();
|
||||
std::cout << "IM_MODULE_CLASSNAME=";
|
||||
if (inputContext) {
|
||||
std::cout << inputContext->metaObject()->className();
|
||||
}
|
||||
std::cout << std::endl;
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
||||
|
||||
set(FCITX5_QT_EXTRA_PLUGIN_NAME "")
|
||||
if (WITH_FCITX_PLUGIN_NAME)
|
||||
set(FCITX5_QT_EXTRA_PLUGIN_NAME "\"fcitx\",")
|
||||
|
@ -24,7 +22,7 @@ add_library(fcitx5platforminputcontextplugin ${PLUGIN_LIBRARY_TYPE} ${plugin_SRC
|
|||
set_target_properties(fcitx5platforminputcontextplugin PROPERTIES
|
||||
AUTOMOC TRUE
|
||||
)
|
||||
target_include_directories(fcitx5platforminputcontextplugin PRIVATE "${PROJECT_SOURCE_DIR}/common")
|
||||
target_include_directories(fcitx5platforminputcontextplugin PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS} "${PROJECT_SOURCE_DIR}/common")
|
||||
if (BUILD_ONLY_PLUGIN AND BUILD_STATIC_PLUGIN)
|
||||
target_compile_definitions(fcitx5platforminputcontextplugin PRIVATE "-DQT_STATICPLUGIN")
|
||||
endif()
|
||||
|
|
|
@ -1,2 +1,6 @@
|
|||
add_subdirectory(dbusaddons)
|
||||
add_subdirectory(platforminputcontext)
|
||||
|
||||
if(NOT BUILD_ONLY_PLUGIN)
|
||||
add_subdirectory(immodule-probing)
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
add_executable(fcitx5-qt6-immodule-probing main.cpp)
|
||||
target_include_directories(fcitx5-qt6-immodule-probing PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
|
||||
target_link_libraries(fcitx5-qt6-immodule-probing Qt6::Gui)
|
||||
|
||||
install(TARGETS fcitx5-qt6-immodule-probing DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023~2023 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*
|
||||
*/
|
||||
#include <QGuiApplication>
|
||||
#include <iostream>
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <qpa/qplatforminputcontext.h>
|
||||
#include <qpa/qplatforminputcontextfactory_p.h>
|
||||
#include <qpa/qplatformintegration.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QGuiApplication app(argc, argv);
|
||||
std::cout << "QT_QPA_PLATFORM=" << app.platformName().toStdString()
|
||||
<< std::endl;
|
||||
std::cout << "QT_IM_MODULE="
|
||||
<< QPlatformInputContextFactory::requested().toStdString()
|
||||
<< std::endl;
|
||||
auto inputContext =
|
||||
QGuiApplicationPrivate::platformIntegration()->inputContext();
|
||||
std::cout << "IM_MODULE_CLASSNAME=";
|
||||
if (inputContext) {
|
||||
std::cout << inputContext->metaObject()->className();
|
||||
}
|
||||
std::cout << std::endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue