1 // Status and progress bars as provided by Qt.
2 // Copyright © 2010 The University of Chicago
4 // Based on the setStatusBar1, etc methods from LinguisticaMainWindow.
7 #include <QProgressBar>
10 #include "ui/Status.h"
13 namespace linguistica
{ namespace ui
{
16 typedef qt::status_interface status
;
19 // XXX. Processing blocks normal repaint events.
20 void status::label::update() { w
.repaint(); }
21 void status::label::clear() { w
.clear(); update(); }
22 status::label
& status::label::operator=(const QString
& str
)
23 { w
.setText(str
); update(); return *this; }
25 // XXX. Processing blocks normal repaint events, but
26 // we do not force a repaint for historical raisons.
27 void status::progressbar::update() { }
28 void status::progressbar::clear() { w
.reset(); update(); }
30 void status::progressbar::set_denominator(int denom
)
31 { incr
= std::max(denom
/ 20, 1); w
.setRange(0, denom
); }
33 status::progressbar
& status::progressbar::assign(int n
)
40 } } // namespace linguistica::ui