Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTVK basic example. Desktop vs Embedded
Qt 6.11 is out! See what's new in the release blog

QTVK basic example. Desktop vs Embedded

Scheduled Pinned Locked Moved Solved General and Desktop
1 Posts 1 Posters 226 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Circuits
    wrote on last edited by
    #1

    Alright I need to go back to the basics here because apparently I still don't understand how this works. In basic (virtual keyboard example) the pro file has these lines:

    disable-desktop|android-embedded|!isEmpty(CROSS_COMPILE)|qnx {
        DEFINES += MAIN_QML=\\\"basic-b2qt.qml\\\"
    } else {
        DEFINES += MAIN_QML=\\\"Basic.qml\\\"
    }
    

    from what I understand these lines will detect what platform you are on and based on that will decide if the keyboard should be opening in a dedicated top-level window or embedded within the application, correct?

    So I figured that if I want the keyboard to be embedded within the application then I should simply be able to alter the .pro file like so:

    TEMPLATE = app
    TARGET = basic
    QT += qml quick
    SOURCES += main.cpp
    CONFIG += link_pkgconfig
    static {
        QT += svg
        QTPLUGIN += qtvirtualkeyboardplugin
    }
    
    target.path = $$[QT_INSTALL_EXAMPLES]/virtualkeyboard/basic
    INSTALLS += target
    
    RESOURCES += \
        demo.qrc
    
    OTHER_FILES += \
        Basic.qml \
        basic-b2qt.qml \
        content/AutoScroller.qml \
        content/HandwritingModeButton.qml \
        content/TextArea.qml \
        content/TextField.qml \
    
    #zdisable-xcb {
    #    message("The disable-xcb option has been deprecated. Please use disable-desktop instead.")
    #    CONFIG += disable-desktop
    #}
    
    CONFIG += disable-desktop
    
    disable-desktop|android-embedded|!isEmpty(CROSS_COMPILE)|qnx {
        DEFINES += MAIN_QML=\\\"basic-b2qt.qml\\\"
    } else {
        DEFINES += MAIN_QML=\\\"Basic.qml\\\"
    }
    

    however this doesn't work. So perhaps someone can tell me how I need to alter this .pro file so that the keyboard shows up embedded in the application itself and not as a dedicated top-level window?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved