Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8d3db6c2 authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

Avancement dans les threads. La barre s'affichent mais ne fait rien ^^

parent c1af4595
No related branches found
No related tags found
No related merge requests found
......@@ -10,12 +10,15 @@ void Progress_bar_thread::run() {
_interface_console->get_progress_dialog()->setRange(0, _file_size);
int loaded = 0;
while(1) {
//show_widget_avancement();
std::cout << loaded << " on " << _file_size << std::endl;
loaded += _parser->get_size_loaded();
msleep(500); // We wait 500 ms
emit _interface_console->get_progress_dialog()->setValue(1400);
std::cout << _interface_console->get_progress_dialog()->minimum() << " " << _interface_console->get_progress_dialog()->maximum() << " " << _interface_console->get_progress_dialog()->labelText().toStdString() << std::endl;
emit _interface_console->get_progress_dialog()->setValue(loaded);
//QApplication::processEvents();
//std::cout << _interface_console->get_progress_dialog()->minimum() << " " << _interface_console->get_progress_dialog()->maximum() << std::endl;
}
}
......@@ -112,7 +112,8 @@ bool Interface_console::draw_trace(const string & filename, const int format){
_progress_dialog = new QProgressDialog(_main_window);
_progress_dialog->setLabelText("Parsing");
_progress_dialog->show();
QApplication::processEvents();
thread.start();
try{
......@@ -120,15 +121,14 @@ bool Interface_console::draw_trace(const string & filename, const int format){
}
catch (const string &error){
thread.terminate();
_progress_dialog->hide();
*Message::get_instance() << "Reason : " << error << Message::ende;
QApplication::restoreOverrideCursor();
delete _progress_dialog;
return false;
}
_progress_dialog->hide();
thread.terminate();
//cout << _progress_dialog->value() << " " << _progress_dialog->maximum()<< endl;
delete _progress_dialog;
drawing_ogl.build(_render_opengl, &trace);
_render_opengl->build();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment