QUndoView doesn't show text
-
Hi folks,
I'm using
QUndoCommand::setText()
to set the text of my undo command. However, while myQUndoView
displays the items it doesn't show the text - it's simply a blank text in the list. Clicking an item in theQUndoView
properly performs the undo command but the text is never shown.
I tried many things: Using thesetText()
method in theundo()
andredo()
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?
-
Hi,
Do you have several QUndoStacks ?
-
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. -
Which version of Qt are you using ?
-
Does the example work for you?
-
Using Qt 5.8.0 with MinGW 5.4.0 32-Bit.
The example works well using exactly the same Qt version and compiler. -
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!