Search and replace across source and ui files
-
I noticed some widgets in a ui file are not named correctly, and wanted to correct that. Since the current names are already used in source files, the safest way seemed to be the Advanced Search & Replace feature of Qt Creator (2.4.1)
However, it seems that while the .ui file is displayed in the list of search results, the replace does not affect the ui file.
How can I make the Search & Replace affect the ui file also?
-
The ui file is officially only editable through the designer. If you want to change strings in those as well, you'll have to either rename the files for this purpose, or do the replace using sed or awk or any other program that doesn't care about the actual contents of the file.
-
Then I guess "Rename symbol under cursor" won't work, either.
-
Please consider "filing a bug report":http://bugreports.qt-project.org/ .
-
[quote author="Andre" date="1331026838"]Sometimes it is annoying that the files are only editable through designer, as some things are easier to do directly in the file. And of course because Designer creates files that cause warnings by uic during compilation...[/quote]
Just right-click on the ui file in the project tree and select "Open with..." and then "Plain Text Editor".
PS:
If you double click on a .ui file it opens in designer mode by default. If you don't close it with ctrl-w, but just hit ESC, you're in a plain text editor with the XML too. -
Posted a bug report:
https://bugreports.qt-project.org/browse/QTCREATORBUG-7044
PS:
bq. If you double click on a .ui file it opens in designer mode by default. If you don’t close it with ctrl-w, but just hit ESC, you’re in a plain text editor with the XML too.
Not an editor. Just a viewer. I can't change anything there.