Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94227173
skviewerscreen.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Dec 4, 22:24
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Dec 6, 22:24 (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
22763811
Attached To
rSYMKIT symkit
skviewerscreen.cpp
View Options
#include "skviewerscreen.h"
#include <QStackedLayout>
#include "skviewerpanel.h"
SKViewerScreen::SKViewerScreen(QWidget *parent)
: QStackedWidget(parent), initialized(false)
{
}
SKViewerScreen::~SKViewerScreen()
{
}
/*void SKViewerScreen::initializePriorities()
{
if (initialized)
return;
for (auto p : initPriorityList)
{
p->repaint();
}
initialized = true;
}
void SKViewerScreen::addInitPriority(QWidget *widget)
{
initPriorityList.push_back(widget);
}*/
void SKViewerScreen::updatePanels()
{
/* Update recursively all panels */
for (auto panel : panels)
panel->updatePanel();
}
void SKViewerScreen::addViewerPanel(SKViewerPanel* panel)
{
// give this as parent reference
panel->setParent(this);
// add panel to the layout
addWidget(panel);
// add panel to the update list
panels.push_back(panel);
}
void SKViewerScreen::rmViewerPanel(SKViewerPanel* panel, bool del)
{
// remove parent reference
panel->setParent(0);
// remove from layout reference
removeWidget(panel);
// remove from update list
panels.remove(panel);
/*
* Warning, this may cause segmentation faults if bad used
* That's why it is not applicated by default
*/
if (del)
delete panel;
}
void SKViewerScreen::clear(bool del)
{
for (auto panel : panels)
{
panel->setParent(0);
removeWidget(panel);
if (del)
delete panel;
}
panels.clear();
}
void SKViewerScreen::setCurrentPanel(SKViewerPanel *panel)
{
setCurrentWidget(panel);
}
SKViewerPanel * SKViewerScreen::getCurrentPanel()
{
return static_cast<SKViewerPanel*>(currentWidget());
}
Event Timeline
Log In to Comment