Wyszukiwanie i zamiana przy użyciu wyrażeń regularnych
Wyszukiwanie i zamiana w wielu plikach przy użyciu wyrażeń regularnych w widoku „ Search Results ”.
Wyrażenia regularne używane w „ Qt Creator ” są wzorowane na wyrażeniach regularnych języka Perl. Więcej informacji na temat korzystania z wyrażeń regularnych można znaleźć na stronie QRegularExpression.
Na przykład, aby zastąpić sprawdzanie równości (foo == bar) funkcją (foo.equals(bar)):
- Zapisz zmiany w systemie kontroli wersji, ponieważ nie można cofnąć operacji zamiany.
- Naciśnij klawisze Ctrl+Shift+F lub przejdź do Edit > Find/Replace > Advanced Find > Open Advanced Find, aby otworzyć stronę Search Results.

- W sekcji „ Scope ” wybierz opcję odpowiednią dla Twojego wyszukiwania.
- Wybierz opcję „ Use regular expressions ”.
- W polu „ Search for ” wprowadź następujący tekst:
if \((.*) == (.*)\)
- Wybierz opcję „ Search & Replace ”, aby wyświetlić listę wyników wyszukiwania.

- W polu „ Replace with ” wprowadź następujący tekst:
if (\1.strictlyEquals(\2))
- Wybierz opcję „ Replace ”, aby zastąpić wszystkie wystąpienia tego tekstu.
Zobacz także : Jak: Edytować kod, Jak: Wyszukiwać oraz Edytowanie kodu.
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.