git-svn-id: svn://db.shs.com.ru/libs@422 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2018-09-11 11:32:58 +00:00
parent b6bad7a921
commit f42a8b86c2
4 changed files with 23 additions and 0 deletions

View File

@@ -13,6 +13,16 @@ void SessionManager::setFile(const QString & file) {
}
void SessionManager::removeMainWidget(QWidget * e) {
for (int i = 0; i < widgets.size(); ++i) {
if (widgets[i].first == e->objectName()) {
widgets.remove(i);
--i;
}
}
}
void SessionManager::save() {
if (file_.isEmpty()) return;
QPIConfig sr(file_);

View File

@@ -36,6 +36,7 @@ public:
void addEntry(QAbstractButton * e) {buttons.push_back(QPair<QString, QAbstractButton * >(e->objectName(), e));}
void addEntry(QStackedWidget * e) {stacks.push_back(QPair<QString, QStackedWidget * >(e->objectName(), e));}
void addMainWidget(QWidget * e) {widgets.push_back(QPair<QString, QWidget * >(e->objectName(), e));}
void removeMainWidget(QWidget * e);
void addEntry(const QString & name, QMainWindow * e) {mwindows.push_back(QPair<QString, QMainWindow * >(name, e));}
void addEntry(const QString & name, QCheckBox * e) {checks.push_back(QPair<QString, QCheckBox * >(name, e));}

View File

@@ -171,6 +171,7 @@ void QGLView::drawBackground(QPainter * painter, const QRectF & rect) {
painter_ = painter;
painter_->beginNativePainting();
if (is_first_draw) {
//connect(context(), SIGNAL(aboutToBeDestroyed()), this, SLOT(glCleanup()));
resizeGL(viewport()->width(), viewport()->height());
initializeGL();
}
@@ -731,3 +732,13 @@ bool QGLView::setupViewport() {
setViewport(_w);
return true;
}
void QGLView::glCleanup() {
//qDebug() << "cleanup";
/*disconnect(context(), SIGNAL(aboutToBeDestroyed()), this, SLOT(glCleanup()));
is_first_draw = true;
textures_manager = GLTextureManager();
currentQGLView = 0;
currentGLTextureManager = 0;*/
}

View File

@@ -307,6 +307,7 @@ public slots:
void reloadShaders() {if (renderer_ != 0) renderer_->reloadShaders(); reloadThisShaders();}
void deselect() {sel_obj = 0;}
void glCleanup();
signals:
void glBeforePaint();