Results 1 to 6 of 6

Thread: QPlainTextEdit shortcut

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Location
    Zamość, Poland
    Posts
    13
    Thanks
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Symbian S60

    Default QPlainTextEdit shortcut

    Hi.
    I writing app (text editor), where I need to commit changes by clicking a return/enter key.
    To edit text I using QPlainTextEdit, but my shortcut not working.
    I don't need to have new lines in text.
    I tried to replace QPlainTextEdit with QLineEdit, but QLineEdit don't have line wrapping.
    How can I implement this shortcut or how can I get line wrapping in QLineEdit.

    Sorry for my bad english.

    Code for shortcut and QLineEdit:

    Qt Code:
    1. QShortcut* shortcut = new QShortcut(QKeySequence("Return"), ui->lineEdit);
    2. connect(shortcut, SIGNAL(activated()), this, SLOT(confirm()));
    To copy to clipboard, switch view to plain text mode 
    Last edited by Sölve; 10th May 2011 at 15:52. Reason: spelling corrections

Similar Threads

  1. QPlainTextEdit
    By deeee in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2010, 01:05
  2. QplainTextEdit
    By deeee in forum Qt Programming
    Replies: 6
    Last Post: 27th May 2010, 00:14
  3. QPlainTextEdit
    By Carlsberg in forum Qt Programming
    Replies: 4
    Last Post: 13th June 2009, 06:12
  4. Shortcut
    By Voldemort in forum Qt Programming
    Replies: 16
    Last Post: 2nd May 2007, 20:51
  5. Trying to set shortcut
    By mikro in forum Newbie
    Replies: 2
    Last Post: 30th November 2006, 09:55

Tags for this Thread

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.