Results 1 to 2 of 2

Thread: QTextEdit and Form Feed character

  1. #1

    Default QTextEdit and Form Feed character

    Is there a way to input a form feed character (0x0C) into a QTextEdit? I have tried <CTRL>+L and it doesn't work, even though <CTRL> seems to work for other control characters, such as <CTRL>+I.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTextEdit and Form Feed character

    Did you try inserting the character by hand? Does it get rendered as you want? Not that QTextEdit would support all of them, but I suppose that shortcut is not even listed in the list of standard shortcuts. I guess you could map a set of custom shortcuts even without subclassing QTextEdit like this:
    Qt Code:
    1. QSignalMapper* mapper = new QSignalMapper(textEdit);
    2. QShortcut* shortcut = new QShortcut(QKeySequence("Ctrl+L"), textEdit);
    3. mapper->setMapping(shortcut, QChar(0x09));
    4. connect(shortcut, SIGNAL(activated()), mapper, SLOT(map()));
    5. connect(mapper, SIGNAL(mapped(QString)), textEdit, SLOT(insertPlainText(QString)));
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

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.