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. [SOLVED] QTextEdit not appending from within timer slot.
QtWS25 Last Chance

[SOLVED] QTextEdit not appending from within timer slot.

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.3k Views
  • 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.
  • G Offline
    G Offline
    great88
    wrote on last edited by
    #1

    Very strange ... i have a text edit box and , in my timer slot , i try to enter text into the box :
    textBox->append("my text") . But nothing happens . Any ideas ?

    I must be missing something really easy but I am just not seeing it .

    The text box works fine from the class constructor but not within the timer slot .
    I am pretty sure I have updated the gui from a timer slot before so ... or is it not possible ?

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

      Hi great88.
      Did you check, is your timer works?
      Put some debug message in body of your timer slot:
      @qDebug()<<"timer slot";@

      if timer not works recheck your code or show us so we can say something.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        great88
        wrote on last edited by
        #3

        The timer works . The slot runs on timeout . For some reason nothing happens on textBox->append(“my text”) . All other code in the slot runs but nothing is appended to the text box .

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          Try "Clean all" , "Run qmake", "Rebuild all".
          If not helps can you post your code or minimal compilable project?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            great88
            wrote on last edited by
            #5

            Looks like it has to do with where I initialized my text box . I was initializing it inside the resize event of the window .

            I moved the initialization ( textBox = new QTextEdit(this); ) to the constructor and now textBox->append(“my text”) in the timer slot works .

            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