[OpendTect_Developers] How to implement scorall bar in OD's 2D viewers

Bruno Chaintreuil bruno.chaintreuil at dgbes.com
Wed Jul 6 17:38:31 CEST 2011


Dear yan gaohan,

As Satyaki said, you can easily put some scrollbars in your GraphicsView 
by using the right QT::ScrollBarPolicy. If you have your own zoom/redraw 
functions, you might need a notifier to detect scrollbar movements. You 
can do that by re-implementing the virtual QT function 
scrollContentsBy() of your GraphicsView. Please have a look at 
http://doc.qt.nokia.com/latest/qabstractscrollarea.html.

In our OpendTect uiGraphicsView this would give:

void uiGraphicsViewBody::scrollContentsBy( int dx, int dy )
{
QGraphicsView::scrollContentsBy(dx,dy);
handle_.scrollBarUsed.trigger(); // scrollBarUsed is a notifier added to 
uiGraphicsViewBase
}


Regarding the Well To Seismic Correlation panel code, if you can wait a 
couple of weeks for OpendTect 4.3. you will get a new multiple Pre-Stack 
2D Viewer in the free uiPreStackView plugin. This viewer is based on a 
similar code design (uiObject embedding in a GraphicsView). And it even 
has scrollbars!


Best Regards,
Bruno




×Ô¼º wrote:
> Hello, everyone:
> Recently, i read some codes about the uiFlatViewer and 
> uiDataPointSetCrossPlot, i found these two 2D viewer was implemented 
> based on Qt's Graphics View Framework, but i found that uiFlatViewer 
> didn't involve scroll bar when its zooming, and 
> uiDataPointSetCrossPlot didn't implement zooming functions. I just 
> wonder why these. If i want to implement the scroll bar function, is 
> anything that i need to notice? Is it feasible that if i implement 
> Zoom in and Zoom Out functions by Qt's Graphics View's own apis(e.g 
> use QGraphicsView's scale and translate functions). In additional, as 
> the 
> http://lists.opendtect.org/pipermail/developers/2010-August/000198.html 
> mentioned, there is a "Well to seismic correlation panel" in OD, but i 
> didn't find any source code about the "Well to seismic correlation 
> panel". could anyone tell me where they are ?
> thanks for your helps, and sorry for my poor english.
> Best wishes for all of you
> yan gaohan
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Developers mailing list
> Developers at opendtect.org
> http://lists.opendtect.org/mailman/listinfo/developers
>   






More information about the Developers mailing list