Suggestions for Multiple QGraphicsView in QMainWindow
Hello,
I am designing a module which takes 8 images. Images needs to be drawn over different QGraphicsView on the mainwindow meaning 8 images on main window. I should be able to zoom/pan/draw do operations on the active image.
My approach is to derive a class from QGraphicsView. Create 8 of those and add to QGridLayout. This case i need to store the information of the image which is active for operations to perform and also need to let know the user with some different color which view/image is active.
Any suggestions to approach this is a better way ?
Regards
Sri
Re: Suggestions for Multiple QGraphicsView in QMainWindow
I guess what you wanted to ask is, how to keep track of the active QGraphicsView
Re: Suggestions for Multiple QGraphicsView in QMainWindow
Re: Suggestions for Multiple QGraphicsView in QMainWindow
You could set a QMdiArea as the central widget of your QMainWindow. You can then add any number of QGraphicsView as the sub windows to the QMdiArea.
QMdiArea will then act as a window manager for these sub windows (QGraphicsView) and will keep track of the active window.
Re: Suggestions for Multiple QGraphicsView in QMainWindow
Quote:
Originally Posted by
Sri
Yes. How do I do that ?
You can monitor the QApplication::focusChanged() signal to see which of your graphics views had the keyboard focus last.