Results 1 to 4 of 4

Thread: Can't see any text append in UI?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Posts
    32
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Can't see any text append in UI?

    I got a problem to use the QTextEdit with append function.
    Qt Code:
    1. MainWindow::ui->textDumpMessage->append("Before the QStringList fileList line");
    2. QStringList fileList = QFileDialog::getOpenFileNames(this, tr("Open CSV"), QDir::currentPath(), tr("CSV File *.csv"));
    3. if (fileList.isEmpty())
    4. {
    5. return false;
    6. }
    7. MainWindow::ui->textDumpMessage->append("After the QStringList fileList line");
    8. qDebug() << "Load csv";
    To copy to clipboard, switch view to plain text mode 

    the QTextEdit can show first append text but fail to get the second append text. I doubt the problem is on QStringList or QFileDialog. Does any body encounter the same issue?

    I use QT 4.7.2 with mingw32 on windows XP.

  2. #2
    Join Date
    Apr 2011
    Posts
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't see any text append in UI?

    Hi, try inserting a new append inside the isEmpty() check, so that you can know whether the execution gets there: i.e:

    Qt Code:
    1. MainWindow::ui->textDumpMessage->append("Before the QStringList fileList line");
    2. QStringList fileList = QFileDialog::getOpenFileNames(this, tr("Open CSV"), QDir::currentPath(), tr("CSV File *.csv"));
    3. if (fileList.isEmpty())
    4. {
    5. MainWindow::ui->textDumpMessage->append("File is Empty");
    6. return false;
    7. }
    8. MainWindow::ui->textDumpMessage->append("After the QStringList fileList line");
    9. qDebug() << "Load csv";
    To copy to clipboard, switch view to plain text mode 

    Notice the new line I have added before return false;.
    Now tell us what happens then.

Similar Threads

  1. QTextEdit doesn't append text
    By Luc4 in forum Qt Programming
    Replies: 7
    Last Post: 13th June 2010, 22:45
  2. Append to a XML Document
    By Goldmmbr in forum Qt Programming
    Replies: 0
    Last Post: 16th November 2009, 15:03
  3. how to append text in label
    By wagmare in forum Qt Programming
    Replies: 3
    Last Post: 12th March 2009, 11:06
  4. Cannot append to QFile using QIODevice::Append
    By philwinder in forum Qt Programming
    Replies: 4
    Last Post: 17th November 2008, 09:09
  5. QVector - Append
    By krishbhala in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2007, 10:50

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.