void NumberEdit::texttChanged(const QString& text) { QString in=text; if (!suffix.isEmpty()) { if (text.endsWith(suffix)) { in=in.remove(text.size()-suffix.size(), suffix.size()); } } double d=extractVal(text); setViewOK(); if ((checkMax) && (d>max)) { d=max; setViewError(); }//setValue(d);} if ((checkMin) && (d<min)) { d=min; setViewError(); }//setValue(d); } //std::cout<<d<<std::endl; //QMessageBox::information(this, "", QString("value is %1").arg(d)); else emit valueChanged(d); if ((!suffix.isEmpty()) && (!text.contains(suffix))) { int cp=cursorPosition(); setText(text+suffix); setCursorPosition(cp); } }
void LoginPresenter::loggedOut(const void *sender, Poco::EventArgs &args) { // The user has logged out, so tell the view to appear logged out. m_view->showStatus(Mvp::View::AbstractLoginView::LoggedOut); // Check if it has been logged out due to an error. setViewError(); // Emit poco signal so the state can do it's work to remove other states. logoutSucceeded(this, args); }