Git Product home page Git Product logo

qt4softkeyboard's Introduction

Qt4SoftKeyboard

SoftKeyBoardContext类继承自QInputContext,处理与输入控件的联系,更新键盘位置等 SoftKeyBoard继承自QWidget,每一个按键都是button,但是button的focus属性都需要清除掉 使用,将上述两个类的.cpp和.h还有SoftKeyBoard.ui加到项目中,把FontLibrary.txt加入到项目的rc中,然后在main.cpp中:

#include "SoftKeyBoardContext.h"
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    SoftKeyBoardContext * ic = new SoftKeyBoardContext();
    a.setInputContext(ic);        //就这两三句就好
    w.show();
    return a.exec();
}

如果是QDialog则需要在QDialog构造函数中加上:

    ui->setupUi(this);
    //QDialog使用软键盘的关键设置
    setWindowModality(Qt::WindowModal);

中文处理的比较简单,只能输入单字,也没有联想功能啥的。。。嵌入式也可以使用

qt4softkeyboard's People

Contributors

yangyang0312 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.