Chamois | Fluent Assertion Library for C Unit Tests | Functional Testing library
kandi X-RAY | Chamois Summary
kandi X-RAY | Chamois Summary
Chamois is a header-only fluent assertion library for C++11 which is designed to facilitate TDD and BDD through the provision of a natural language syntax. Chamois is inspired by the brilliant [Fluent Assertions] for .NET.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Chamois
Chamois Key Features
Chamois Examples and Code Snippets
Community Discussions
Trending Discussions on Chamois
QUESTION
I would like to implement functionality for being able to search a QPlainTextEdit
for a query string, and display all matched lines in a table. Selecting a row in the table should move the cursor to the correct line in the document.
Below is a working example that finds all matches and displays them in a table. How can I get to the selected line number in the string that the plaintextedit holds? I could instead use the match.capturedEnd()
and match.capturedStart()
to show the matches, but line numbers are a more intuitive thing to think of, rather than the character index matches.
ANSWER
Answered 2021-Mar-13 at 15:14In order to move the cursor to a specified position, it's necessary to use the underlying QTextDocument using document()
.
Through findBlockByLineNumber
you can construct a QTextCursor and use setTextCursor()
to "apply" that cursor (including the actual caret position) to the plain text.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Chamois
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page