Can't give to an element a name used in the past and then removed
-
I am adding a menu to a
QMainWindow
, I added a submenu item and gave to it theobjectName
of "actionCrNew", then I decided to have that submenu item under a different menu.
I deleted the previous submenu item and created a new one under the other menu and tired to assign to it theobjectName
"actionCrNew", but it is automatically renamed to "actionCrNew_2".
I could understand that if I didn't remove the previous item, but it doesn't exist anymore, I deleted it, why can't I use again that name if no other element has it? I even tried to close and open Design Studio again, but nothing changed, that name can't be used anymore.
Any idea about what is happening? What should I do to be able to use again that name? -
@Alhazred
You have posted this into Qt Design Studio sub-forum. But I don't think that is what you are using, are you just using Qt Creator which includes Qt Designer (different from Design Studio) where you create widgets interactively?Assuming so, all of your work is saved in a
.ui
file. That is an XML file, so you can view/edit it in a text editor. Go search it for the symbol you say is deleted and want to re-use, to see what is going on. If you are careful you can remove or maybe rename it.I'm not at all sure, but because it was a menu there may be either a
QMenu
or aQAction
left lying around which still uses that name.If you are indeed using Design Studio then I don't know how that works.
-
Thank you for your reply.
I am developing the application using Visual Studio Community 2022 and I am using Qt Design Studio 4.6 (4.6.2) to interactively create the UI.
By the way, manually removing the elements from the .ui file did help. No clue why Design Studio doesn't do that by itself when deleting elements from it. -
-
@Alhazred
OK, I didn't know whether Design Studio functions similarly to Designer. It looks like it too just uses a.ui
file to save everything the user designs.I have to say that looking back at your past posts they seem to be to do with widgets and code etc. For which Designer would have seemed enough. I don't know why you have elected to use Design Studio, which as I understand it is for advanced, specialized graphics, and is used to generate QML not widgets code. But you may know more than I.
-
@Alhazred please create a report https://bugreports.qt.io/secure/CreateIssue!default.jspa