Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clickable text #7

Open
ghost opened this issue Jul 14, 2016 · 2 comments
Open

clickable text #7

ghost opened this issue Jul 14, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 14, 2016

whether kdreport can take action to click on a particular section of text, so that we could listen on signal handler to trigger another form report view?

thanks

@dfaure
Copy link

dfaure commented Jul 18, 2016

You can use KDReports::HtmlElement to insert a <a href="...."> link, for instance to an HTTP URL, which will be opened with QDesktopServices::openUrl. You can see an example in the "ReferenceReport" example.

Links to anchors, i.e. other sections of the same document aren't supported.

It sounds like you want to catch this before it's sent to QDesktopServices though. At first sight, it looks like this would require a change in Qt (adding setOpenExternalLinks(bool) and a linkActivated() signal in QTextDocument, on top of the internal QTextControl which has this logic) and in KDReports (to call that API). This isn't on my immediate todo list for KDReports, but I can be hired to implement it :). Otherwise I'll be happy to review patches.

@ghost
Copy link
Author

ghost commented Jul 19, 2016

Yeah may be like that, but my point was looked like what fast-report already did here https://www.fast-report.com/en/documentation/frx3progr/Working%20with%20TfrxReport%20component/Interactive%20reports.htm, when user click some text in preview dialog he could show messagebox or popping up another view report section. Hence, QTextDocument information would be lost, if I'm not wrong because QPrintPreviewWidget drawing stack was using qpainter drawXXX. Im not sure if re-implementing QPrintPreviewWidget using Graphicsview framework would be good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant