Highlight the area
-
DO you mean "this one":http://harmattan-dev.nokia.com/docs/library/html/qt4/widgets-scribble.html?
Nevertheless i don't believe that there is any simple solution to what you want to do. There are too much open question how the solution should behave in various cases to find the best solution in first place. -
-
[quote author="mythili" date="1366717290"]Please find the attached link.
and whats your underlying "base" widget now?
-
I never tried to get into the Scribble's source code but I tried to implement this problem months ago.
Get the initial point via mousePressEvent and the other point via mouseReleaseEvent. Take note that there might be an offset in the resulting points since point(0,0) is on the top-left of the widget/window, so subtract if needed (e.g. margin is present). Get a QRect using the 2 points you obtained and implement your goal (e.g. cropping, drawing a rectangle on that region, etc.)
-
raven-worx
My underlying base widget is QScrollArea.
Code_ReaQtor : Robot Herder
1) How to draw a dotted line rectangle. 2) How to highlight the area under the text.
-
[quote author="mythili" date="1366776687"]
Code_ReaQtor : Robot Herder1) How to draw a dotted line rectangle. 2) How to highlight the area under the text.
[/quote]
- If you are going to use QPainter, just specify the PenStyle using QPainter::setPen()
- Sorry, I can't help you with that. :( I never tried to implement that.
-
[quote author="mythili" date="1366776687"]
My underlying base widget is QScrollArea.
[/quote]whats inside your scrollarea...or to make it clear: what widget holds your text?
-
I am having QWidget inside scrollarea.. I am writing in that area. After writing, i want to highlight some area with yellow color.
I am retrieving the start point and end point. Drawing a QRect . How to fill that area under the text.
-
so you have a basic QWidget (inside the scroll area) and do the painting of the text yourself?
-
I am painitng in that area. But i will select an area over the painted area, so that , the region should be highlighted with different color under the painted part.