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. Mac qplaintextedit navigation keys
Qt 6.11 is out! See what's new in the release blog

Mac qplaintextedit navigation keys

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.1k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    marksibly
    wrote on last edited by
    #1

    Hi,

    Is there anyway to make a QPlainTextEdit on the Mac use 'windows keys' for navigation, the way qtcreator does?

    For example, I currently have to use ctrl-a/ctrl-e to go to start/end of line on the Mac. I would prefer to be able to use home/end as on pc/qtcreator. Ditto for top of document, end of document etc.

    I'm using qt4.8

    Bye!
    Mark

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rondog
      wrote on last edited by
      #2

      The only way I can think of implementing this would be to subclass QPlainTextEdit and override the keypress events.

      You can monitor for specific keys or key combinations and then use QApplication::postEvent() when you find something you want to use. All events captured in the derived class should be passed back to the base class otherwise it won't work as a text editor.

      I am not sure if this is a good idea. You shouldn't use 'windows keys' on a Mac or, for that matter, OS X short cuts in Windows. OS X has it's own key shortcuts that can be used or changed if you don't like them; if your program creates it's own shortcut keys it will add confusion.

      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