Results 1 to 5 of 5

Thread: TextEdit with one line

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows
    Thanks
    75
    Thanked 24 Times in 21 Posts

    Default TextEdit with one line

    how to make TextEdit to get just one line. (Don't allow to user enter new line) ???

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    29
    Thanked 50 Times in 47 Posts

    Default Re: TextEdit with one line

    Use QLineEdit instead.
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  3. #3
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows
    Thanks
    75
    Thanked 24 Times in 21 Posts

    Default Re: TextEdit with one line

    This is Qml not Qt!

  4. #4
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    29
    Thanked 50 Times in 47 Posts

    Default Re: TextEdit with one line

    Use Qt Qml bindings. You can use qt elements in qml.
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  5. #5
    Join Date
    May 2009
    Location
    Canada
    Posts
    163
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android
    Thanks
    7
    Thanked 20 Times in 20 Posts

    Default Re: TextEdit with one line

    You could use a TextEdit, and in onTextChanged check if the text ends with newline, and if so, set the text to a trimmed version of itself. Always screw with your user!

  6. The following user says thank you to Urthas for this useful post:

    alizadeh91 (5th November 2012)

Similar Threads

  1. QtXml parse error at line 1 column line 1
    By vinod sharma in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 8th September 2012, 06:02
  2. Replies: 9
    Last Post: 13th October 2011, 21:43
  3. Replies: 3
    Last Post: 13th August 2010, 12:50
  4. Insert line to textedit
    By wirasto in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2009, 16:59
  5. How can I paint a line in TextEdit on QT-4.3.2?
    By cslijy in forum Qt Programming
    Replies: 2
    Last Post: 23rd November 2007, 09:08

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
  •  
Qt is a trademark of The Qt Company.