Results 1 to 17 of 17

Thread: simple questions. qt3 to qt4

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: simple questions. qt3 to qt4

    Thanks, please forget all that has gone before, QTextStreams, QTextEdit widgets, Undos, redos, my rantings and ravings etc.

    All I need is the code to put in my program for a user to be able to change the word "sunny" to "raining" in the QString k. "It is sunny today".

    In Qt3 where "myTextEdit" is an instance of the QTextEdit widget.
    "myTextEdit->setText( k );"
    "k = myTextEdit->text();".

    Please, what is the code to do that in Qt4? (Text in, text out.)

  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: simple questions. qt3 to qt4

    Quote Originally Posted by impeteperry
    All I need is the code to put in my program for a user to be able to change the word "sunny" to "raining" in the QString k. "It is sunny today".
    QString::replace()
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    impeteperry (3rd April 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: simple questions. qt3 to qt4

    I feel like an idiot. What I have been looking for from the beginning is:

    QString QTextEdit::toPlainText () const

    This line of code solves all my problems. I don't know how I missed it.
    I thank you for your efforts, they are very much appreciated.

    pete perry.

  5. #4
    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: simple questions. qt3 to qt4

    Ahh, I didn't realize that the issue was about retrieving the contents of the text edit..
    J-P Nurmi

  6. #5
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: simple questions. qt3 to qt4

    Quote Originally Posted by jpn
    Ahh, I didn't realize that the issue was about retrieving the contents of the text edit..
    Ain't communication fun!

    I'm going to the Linux World conference in Boston tomorrow. Do you ever get to the US?. I've been to Denmark & Sweden, but not Finland. Again Thanks.

  7. #6
    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: simple questions. qt3 to qt4

    Quote Originally Posted by impeteperry
    Ain't communication fun!

    I'm going to the Linux World conference in Boston tomorrow. Do you ever get to the US?. I've been to Denmark & Sweden, but not Finland. Again Thanks.
    Not that I have plans or anything, but who knows, maybe some day.. No problem at all.
    J-P Nurmi

Similar Threads

  1. very simple and basic FAM/Gamin wrapper for qt
    By momesana in forum Qt-based Software
    Replies: 0
    Last Post: 8th April 2008, 12:46
  2. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12
  3. Memory management questions (im new to Qt)
    By scarvenger in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2007, 07:41
  4. [QT4] Trivial question(s)
    By agent007se in forum Newbie
    Replies: 1
    Last Post: 27th June 2006, 14:59
  5. Qt related questions and thoughts about getting job
    By AlexKiriukha in forum General Discussion
    Replies: 4
    Last Post: 26th January 2006, 12:25

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.