Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTextEdit doesnt display text
Forum Updated to NodeBB v4.3 + New Features

QTextEdit doesnt display text

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 809 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qnoobish
    wrote on last edited by
    #1

    Hello,

    I am using the following constructor in a class named LogArea which inherits from QTextEdit.

    @LogArea::LogArea(QWidget* Parent)
    : QTextEdit( Parent)
    {
    append("TEXT!!");
    }@

    Then somewhere else I am placing a LogArea object to a QDockWidget, and then adding the DockWidget to my QMainWindow object.

       @QDockWidget *dock = new QDockWidget(this);     //where this is my QMainWindow object. 
    

    m_poLogArea = new LogArea(dock);
    dock->setWidget(m_poLogArea);
    addDockWidget (Qt::BottomDockWidgetArea, dock);@

    Then when I run this I can see my QTextEdit widget displayed inside a QDockWidget which I can move and dock at will.

    But...in my QTextEdit Widget I am not able to append or insert any text. All I see is an empty(as in all blank) QTextEdit widget with no cursor nor text.

    I've checked the signal textChanged of QTextEdit and this signal is emitted when I click my QTextEdit widget and type characters, but still I am not able to see any text on it.

    Also I've changed the text color and font but still no success. And also if I try to this same approach with a different widget like QLabel, all its member functions work like a charm, but I am not able to to the same with QTextEdit for some reason :|

    Any ideas??

    Thanks in advance.

    In short, software is eating the world.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved