Results 1 to 2 of 2

Thread: How do i write to Text Edit?

  1. #1
    Join Date
    Oct 2009
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default How do i write to Text Edit?

    Hi, i have created a project(Gui project) and in the main.cpp file i have some sql queries that gets data from a remote sever liekt this;
    if(!query.exec("SELECT..........")){
    qDebug()<<"FAIL";
    }
    while(query.next()){
    QString name = query.value(0).toString();
    qDebug() << name;
    }
    it works well and i have the results printed out like "abdnsh"
    Now in my .ui i have Text Edit. How can i append the sql reults to the Text Edit in my .ui?
    I'm a beginner, please i will appreciate

  2. #2
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: How do i write to Text Edit?

    If the name of your label is m_lblMyLabel;

    Qt Code:
    1. ui.m_lblMylabel.setText("mytext");
    To copy to clipboard, switch view to plain text mode 

    It does not appear in QtAssistant as function because is a propertie.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Character encoding in text edit and llne edit
    By greenvirag in forum Qt Programming
    Replies: 3
    Last Post: 20th January 2009, 08:45
  3. Replies: 1
    Last Post: 15th January 2009, 10:34
  4. how to read from text edit in QT4
    By iamjayanth in forum Qt Programming
    Replies: 3
    Last Post: 17th October 2008, 12:51
  5. Replies: 8
    Last Post: 15th May 2007, 09:21

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.