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. QText2DEntity disappears when I change the text.
Forum Updated to NodeBB v4.3 + New Features

QText2DEntity disappears when I change the text.

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt3dqt5.12.xqtext2dentity
2 Posts 1 Posters 603 Views 2 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.
  • A Offline
    A Offline
    Alain38 0
    wrote on 26 Dec 2019, 11:07 last edited by Alain38 0
    #1

    HI,
    I have a scene with several QText2DEntity. At the creation, all entities display the text "???". When I click on a given button, the text of one entity is supposed to change. But, in fact, no text is displayed ("???" disappear). When I call text() on the entity, the return value is as expected. If I set the new text as the initial one, it is displayed. If, when I'm creating the scene, I call setText() twice (one with "???", the second eon with another value), the latest value is displayed.

    So, my problem comes from the fact I'm changing the text from an entity that is already displayed. Any idea to force it display the new text?

    @Update: When I replace the string "???" by "??L", the two first '?' are displayed. And the L is missing.

    A 1 Reply Last reply 26 Dec 2019, 13:42
    0
    • A Alain38 0
      26 Dec 2019, 11:07

      HI,
      I have a scene with several QText2DEntity. At the creation, all entities display the text "???". When I click on a given button, the text of one entity is supposed to change. But, in fact, no text is displayed ("???" disappear). When I call text() on the entity, the return value is as expected. If I set the new text as the initial one, it is displayed. If, when I'm creating the scene, I call setText() twice (one with "???", the second eon with another value), the latest value is displayed.

      So, my problem comes from the fact I'm changing the text from an entity that is already displayed. Any idea to force it display the new text?

      @Update: When I replace the string "???" by "??L", the two first '?' are displayed. And the L is missing.

      A Offline
      A Offline
      Alain38 0
      wrote on 26 Dec 2019, 13:42 last edited by Alain38 0
      #2

      @Alain38-0 OK. Now I have found a way to always have a displayed text. For this, in the initial setText (when scene is not yet rendered) I'm putting all the characters that can appear in the strings that will be displayed. Then, I have something displayed. But it is often wrong. To be more explicit I'm doing this:

      void createScene()
      {
           ...
          myTextEntity->setText("?CLRT0123456789");
          ...
      }
      
      void pageDisplayed()
      {
          ...
         myTextEntity->setText("???");
      ...
      }
      
      void onButtonCLicked()
      {
          myTextEntity->setText("C23");
      }
      

      setText("C23") displays another string of three characters (like "2R7"). But, at least strings have a coherency (all 'L' are replaced by '0', and so on).

      1 Reply Last reply
      0

      1/2

      26 Dec 2019, 11:07

      • Login

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