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. QUndoView doesn't show text
Forum Updated to NodeBB v4.3 + New Features

QUndoView doesn't show text

Scheduled Pinned Locked Moved Solved General and Desktop
qundocommandqundoview
7 Posts 3 Posters 1.6k Views 3 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.
  • J Offline
    J Offline
    Joel Bodenmann
    wrote on 30 Mar 2017, 13:41 last edited by
    #1

    Hi folks,

    I'm using QUndoCommand::setText() to set the text of my undo command. However, while my QUndoView displays the items it doesn't show the text - it's simply a blank text in the list. Clicking an item in the QUndoView properly performs the undo command but the text is never shown.
    I tried many things: Using the setText() method in the undo() and redo() functions, using it in the constructor as well as passing the text directly to the base class constructor - nothing helped!

    Is there any magic to this? I did refer to the undo framework example but I couldn't find anything special - I'm doing exactly the same things. The documentation doesn't seem to mention anything special either.

    Any ideas?

    Industrial process automation software: https://simulton.com
    Embedded Graphics & GUI library: https://ugfx.io

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Mar 2017, 21:34 last edited by
      #2

      Hi,

      Do you have several QUndoStacks ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Joel Bodenmann
        wrote on 31 Mar 2017, 04:59 last edited by
        #3

        No Sir, just one. And I use QUndoView::setStack() to set it.
        As mentioned the stack itself works: I can click on items in the stack view and the undo/redo actions are applied accordingly. Just missing the texts.

        Industrial process automation software: https://simulton.com
        Embedded Graphics & GUI library: https://ugfx.io

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 31 Mar 2017, 09:49 last edited by
          #4

          Which version of Qt are you using ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on 31 Mar 2017, 09:50 last edited by
            #5

            Does the example work for you?

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Joel Bodenmann
              wrote on 31 Mar 2017, 09:52 last edited by
              #6

              Using Qt 5.8.0 with MinGW 5.4.0 32-Bit.
              The example works well using exactly the same Qt version and compiler.

              Industrial process automation software: https://simulton.com
              Embedded Graphics & GUI library: https://ugfx.io

              1 Reply Last reply
              0
              • J Offline
                J Offline
                Joel Bodenmann
                wrote on 31 Mar 2017, 09:55 last edited by
                #7

                Interesting, a clean build later it works fine. That's unexpected.
                Still silly of me not to try that first - my bad. Sorry guys! Thanks for your help though, much appreciated!

                Industrial process automation software: https://simulton.com
                Embedded Graphics & GUI library: https://ugfx.io

                1 Reply Last reply
                1

                5/7

                31 Mar 2017, 09:50

                • Login

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