+Add method to get mdi view by view provider, add method to get flag widgets
This commit is contained in:
parent
61bb8ea931
commit
ef6978e9df
|
@ -1111,6 +1111,19 @@ MDIView* Document::getActiveView(void) const
|
|||
return active;
|
||||
}
|
||||
|
||||
Gui::MDIView* Document::getViewOfViewProvider(Gui::ViewProvider* vp) const
|
||||
{
|
||||
std::list<MDIView*> mdis = getMDIViews();
|
||||
for (std::list<MDIView*>::const_iterator it = mdis.begin(); it != mdis.end(); ++it) {
|
||||
if ((*it)->getTypeId().isDerivedFrom(View3DInventor::getClassTypeId())) {
|
||||
View3DInventor* view = static_cast<View3DInventor*>(*it);
|
||||
if (view->getViewer()->hasViewProvider(vp))
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// UNDO REDO transaction handling
|
||||
|
|
|
@ -135,6 +135,7 @@ public:
|
|||
//@{
|
||||
/// Getter for the active view
|
||||
Gui::MDIView* getActiveView(void) const;
|
||||
Gui::MDIView* getViewOfViewProvider(Gui::ViewProvider*) const;
|
||||
/// Creat a new view
|
||||
void createView(const char* sType);
|
||||
/** send messages to the active view
|
||||
|
|
|
@ -503,6 +503,24 @@ void GLFlagWindow::removeFlag(Flag* item)
|
|||
}
|
||||
}
|
||||
|
||||
Flag* GLFlagWindow::getFlag(int index) const
|
||||
{
|
||||
if (_flagLayout) {
|
||||
QWidget* flag = _flagLayout->itemAt(index)->widget();
|
||||
return qobject_cast<Flag*>(flag);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GLFlagWindow::countFlags() const
|
||||
{
|
||||
if (_flagLayout) {
|
||||
return _flagLayout->count();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GLFlagWindow::paintGL()
|
||||
{
|
||||
// draw lines for the flags
|
||||
|
|
|
@ -150,6 +150,8 @@ public:
|
|||
void addFlag(Flag* item, FlagLayout::Position pos);
|
||||
void removeFlag(Flag* item);
|
||||
void deleteFlags();
|
||||
Flag* getFlag(int) const;
|
||||
int countFlags() const;
|
||||
|
||||
void paintGL();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user