Results 1 to 6 of 6

Thread: How to change keyboard layout

  1. #1
    Join Date
    May 2010
    Posts
    39
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default How to change keyboard layout

    I need to change keyboard layout when focus are on some QLineEdit.
    It is possible on windows?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to change keyboard layout

    I don't know any feature in Qt to directly do that (but I might be wrong).
    Is it even possible to set a different keyboard layout for a single program in windows, let alone for a single widget?

    If so, I guess you need to use some windows api's

  3. #3
    Join Date
    Sep 2008
    Location
    Munich
    Posts
    32
    Thanked 8 Times in 6 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to change keyboard layout

    The only thing I can think about is Qt::InputMethodHint, which you can set on a widget QWidget::setInputMethodHints(). Please let us know if this works. Thanks

  4. #4
    Join Date
    May 2010
    Posts
    39
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default Re: How to change keyboard layout

    this is not work.
    This methods are for formating input text (for example only number), but it can't change keyboard layout.

  5. #5
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to change keyboard layout

    ActivateKeyboardLayout( (HKL)HKL_NEXT, 0 );

  6. #6
    Join Date
    May 2010
    Posts
    39
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default Re: How to change keyboard layout

    Is there any way without winapi?

Similar Threads

  1. DockWidgetArea change and layout direction change
    By mstegehu in forum Qt Programming
    Replies: 1
    Last Post: 21st February 2012, 21:24
  2. How to change the QModelIndex with keyboard
    By aekilic in forum Qt Programming
    Replies: 6
    Last Post: 1st March 2010, 22:02
  3. QKeyEvent problem with different keyboard layout
    By minimoog in forum Qt Programming
    Replies: 3
    Last Post: 12th February 2010, 06:45
  4. change layout dynamicly
    By stella1016 in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2009, 16:40
  5. Keyboard layout
    By alisami in forum Qt Programming
    Replies: 2
    Last Post: 20th October 2009, 07:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.