* demo/viewer/viewer.cc: Clean vectors when load new picture.
---
scribo/ChangeLog | 6 ++++++
scribo/demo/viewer/viewer.cc | 12 +++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index db348b0..42d9e2f 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,11 @@
2010-07-21 Arthur Crepin-Leblond <crepin(a)ptaouchnok.lrde.epita.fr>
+ Fix Segfault bug in Qt interface.
+
+ * demo/viewer/viewer.cc: Clean vectors when load new picture.
+
+2010-07-21 Arthur Crepin-Leblond <crepin(a)ptaouchnok.lrde.epita.fr>
+
Small changes in xml_transform.
* scribo/sandbox/arthur/xml_transform/README
diff --git a/scribo/demo/viewer/viewer.cc b/scribo/demo/viewer/viewer.cc
index 10c1a43..36b8d82 100644
--- a/scribo/demo/viewer/viewer.cc
+++ b/scribo/demo/viewer/viewer.cc
@@ -331,18 +331,17 @@ Viewer::add_region(QDomNode father, QString attr_id)
void
Viewer::load_xml(QString filename)
{
- text_vector_.clear();
- image_vector_.clear();
-
app_->setOverrideCursor(QCursor(Qt::WaitCursor));
emit fill_xml(filename);
if (image_ && image_->scene() && image_->scene() == scene_)
scene_->removeItem(image_);
+ text_vector_.clear();
+ image_vector_.clear();
scene_->clear();
- if (!base64_ && use_image_)
+ if (!base64_ && use_image_ && image_)
scene_->addItem(image_);
scene_->update();
@@ -470,7 +469,7 @@ Viewer::load_xml(QString filename)
region = region.nextSibling();
}
- emit updated();
+ //emit updated();
scene_->update();
key_wgt_->update_all();
@@ -483,8 +482,11 @@ Viewer::load(QString filename, bool b)
app_->setOverrideCursor(QCursor(Qt::WaitCursor));
scene_->clear();
+ text_vector_.clear();
+ image_vector_.clear();
scene_->update();
image_ = 0;
+ xml_file_ = QString::Null();
// Load the image in a pixmap that is directly shown on screen.
// This is very slow when used with the normal rendering system.
--
1.5.6.5
Show replies by date