playing with the inputpanel example to get the virtual keyboard running
This commit is contained in:
parent
478f2828e4
commit
f3ebc74f44
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,5 +5,6 @@ moc
|
||||
rcc
|
||||
lib
|
||||
bin
|
||||
plugins
|
||||
qvg
|
||||
*.swp
|
||||
|
@ -8,9 +8,6 @@
|
||||
#include <QskWindow.h>
|
||||
#include <QskSetup.h>
|
||||
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <qpa/qplatformintegration.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlContext>
|
||||
#include <QQmlEngine>
|
||||
|
@ -1,31 +1,35 @@
|
||||
SQUIEK_ROOT = $${PWD}/..
|
||||
SQUIEK_OUT_ROOT = $${OUT_PWD}/..
|
||||
QSK_ROOT = $${PWD}/..
|
||||
QSK_OUT_ROOT = $${OUT_PWD}/..
|
||||
|
||||
include( $${SQUIEK_ROOT}/qskconfig.pri )
|
||||
include( $${QSK_ROOT}/qskconfig.pri )
|
||||
|
||||
TEMPLATE = lib
|
||||
TARGET = skinnyinputcontext
|
||||
TARGET = qskinputcontext
|
||||
|
||||
QT += quick gui-private
|
||||
CONFIG += no_private_qt_headers_warning
|
||||
|
||||
SQUIEK_DIRS = \
|
||||
$${SQUIEK_ROOT}/src/common \
|
||||
$${SQUIEK_ROOT}/src/nodes \
|
||||
$${SQUIEK_ROOT}/src/graphic \
|
||||
$${SQUIEK_ROOT}/src/controls \
|
||||
$${SQUIEK_ROOT}/src/layouts \
|
||||
$${SQUIEK_ROOT}/src/dialogs
|
||||
QSK_SUBDIRS = \
|
||||
$${QSK_ROOT}/src/common \
|
||||
$${QSK_ROOT}/src/nodes \
|
||||
$${QSK_ROOT}/src/graphic \
|
||||
$${QSK_ROOT}/src/controls \
|
||||
$${QSK_ROOT}/src/layouts \
|
||||
$${QSK_ROOT}/src/dialogs
|
||||
|
||||
INCLUDEPATH *= $${SQUIEK_DIRS}
|
||||
DEPENDPATH += $${SQUIEK_DIRS}
|
||||
INCLUDEPATH *= $${QSK_SUBDIRS}
|
||||
DEPENDPATH += $${QSK_SUBDIRS}
|
||||
|
||||
DESTDIR = $${SQUIEK_OUT_ROOT}/examples/bin/platforminputcontexts
|
||||
DESTDIR = $${QSK_OUT_ROOT}/plugins/platforminputcontexts
|
||||
|
||||
QMAKE_RPATHDIR *= $${SQUIEK_OUT_ROOT}/lib
|
||||
LIBS *= -L$${SQUIEK_OUT_ROOT}/lib -lqskinny
|
||||
QMAKE_RPATHDIR *= $${QSK_OUT_ROOT}/lib
|
||||
LIBS *= -L$${QSK_OUT_ROOT}/lib -lqskinny
|
||||
|
||||
win32: contains(SQUIEK_CONFIG, SquiekDll): DEFINES += QT_DLL QSK_DLL SQUIEK_DLL
|
||||
win32 {
|
||||
contains(QSK_CONFIG, QskDll) {
|
||||
DEFINES += QT_DLL QSK_DLL
|
||||
}
|
||||
}
|
||||
|
||||
SOURCES += \
|
||||
QskInputContext.cpp \
|
||||
@ -40,4 +44,4 @@ HEADERS += \
|
||||
QskPinyinCompositionModel.h \
|
||||
pinyin/zh.h
|
||||
|
||||
OTHER_FILES += metadata.json qml/ANSPInputPanel.qml
|
||||
OTHER_FILES += metadata.json
|
||||
|
@ -1,9 +1,11 @@
|
||||
include( $${PWD}/../playground.pri )
|
||||
|
||||
TARGET = lineedit
|
||||
TARGET = inputpanel
|
||||
|
||||
DEFINES += PLUGIN_PATH=$$clean_path( $$QSK_OUT_ROOT/plugins )
|
||||
|
||||
RESOURCES += \
|
||||
qml.qrc
|
||||
inputpanel.qrc
|
||||
|
||||
HEADERS += \
|
||||
LineEditSkinlet.h \
|
42
playground/inputpanel/inputpanel.qml
Normal file
42
playground/inputpanel/inputpanel.qml
Normal file
@ -0,0 +1,42 @@
|
||||
import QtQuick 2.5
|
||||
import Skinny 1.0
|
||||
import LineEdit 1.0
|
||||
|
||||
Main
|
||||
{
|
||||
id: main
|
||||
inputPanel: embeddedInputPanel
|
||||
|
||||
Window
|
||||
{
|
||||
id: window
|
||||
|
||||
visible: true
|
||||
color: "Gainsboro"
|
||||
|
||||
width: 800
|
||||
height: 400
|
||||
|
||||
LinearBox
|
||||
{
|
||||
orientation: Qt.Vertical
|
||||
defaultAlignment: Qt.AlignHCenter | Qt.AlignTop
|
||||
|
||||
margins: 10
|
||||
spacing: 10
|
||||
|
||||
LineEdit
|
||||
{
|
||||
sizePolicy: [ SizePolicy.Maximum ]
|
||||
|
||||
text: "I am a line edit. Edit me."
|
||||
}
|
||||
|
||||
InputPanel
|
||||
{
|
||||
id: embeddedInputPanel
|
||||
//visible: Qt.inputMethod.visible
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/qml">
|
||||
<file>lineedit.qml</file>
|
||||
<file>inputpanel.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -14,12 +14,18 @@
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QGuiApplication>
|
||||
|
||||
#define STRINGIFY(x) #x
|
||||
#define STRING(x) STRINGIFY(x)
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
#ifdef ITEM_STATISTICS
|
||||
QskObjectCounter counter( true );
|
||||
#endif
|
||||
|
||||
qputenv( "QT_IM_MODULE", "skinny" );
|
||||
qputenv( "QT_PLUGIN_PATH", STRING( PLUGIN_PATH ) );
|
||||
|
||||
QskModule::registerTypes();
|
||||
qmlRegisterType< LineEdit >( "LineEdit", 1, 0, "LineEdit" );
|
||||
|
||||
@ -29,7 +35,7 @@ int main( int argc, char* argv[] )
|
||||
SkinnyShortcut::enable( SkinnyShortcut::Quit |
|
||||
SkinnyShortcut::DebugShortcuts );
|
||||
|
||||
QQmlApplicationEngine engine( QUrl( QStringLiteral( "qrc:/qml/lineedit.qml" ) ) );
|
||||
QQmlApplicationEngine engine( QUrl( QStringLiteral( "qrc:/qml/inputpanel.qml" ) ) );
|
||||
|
||||
return app.exec();
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
import QtQuick 2.5
|
||||
import Skinny 1.0
|
||||
import LineEdit 1.0
|
||||
|
||||
Main
|
||||
{
|
||||
// inputPanel: embeddedInputPanel
|
||||
|
||||
Window
|
||||
{
|
||||
id: window
|
||||
|
||||
visible: true
|
||||
|
||||
width: 600
|
||||
height: 600
|
||||
|
||||
LinearBox
|
||||
{
|
||||
defaultAlignment: Qt.AlignCenter
|
||||
|
||||
LineEdit
|
||||
{
|
||||
sizePolicy: [ SizePolicy.Fixed, SizePolicy.Fixed ]
|
||||
|
||||
text: "I am a line edit. Edit me."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -29,7 +29,7 @@ LIBS *= -L$${QSK_OUT_ROOT}/lib -lqsktestsupport -lqskinny
|
||||
|
||||
win32 {
|
||||
contains(QSK_CONFIG, QskDll) {
|
||||
DEFINES += QT_DLL QSK_DLL QSK_DLL
|
||||
DEFINES += QT_DLL QSK_DLL
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,5 +4,5 @@ TEMPLATE = subdirs
|
||||
|
||||
# qml
|
||||
SUBDIRS += \
|
||||
lineedit \
|
||||
inputpanel \
|
||||
images
|
||||
|
Loading…
x
Reference in New Issue
Block a user