本文整理汇总了C++中WLineEdit::text方法的典型用法代码示例。如果您正苦于以下问题:C++ WLineEdit::text方法的具体用法?C++ WLineEdit::text怎么用?C++ WLineEdit::text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WLineEdit
的用法示例。
在下文中一共展示了WLineEdit::text方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleFinish
void handleFinish(DialogCode result)
{
if (result == WDialog::Accepted) {
/*
* Update the model with data from the edit widgets.
*
* You will want to do some validation here...
*
* Note that we directly update the source model to avoid
* problems caused by the dynamic sorting of the proxy model,
* which reorders row numbers, and would cause us to switch to editing
* the wrong data.
*/
WAbstractItemModel *m = model_;
int modelRow = item_.row();
WAbstractProxyModel *proxyModel = dynamic_cast<WAbstractProxyModel *>(m);
if (proxyModel) {
m = proxyModel->sourceModel();
modelRow = proxyModel->mapToSource(item_).row();
}
m->setData(modelRow, 1, boost::any(nameEdit_->text()));
m->setData(modelRow, 2, boost::any(typeEdit_->currentText()));
m->setData(modelRow, 3, boost::any(boost::lexical_cast<int>
(sizeEdit_->text().toUTF8())));
m->setData(modelRow, 4, boost::any(createdPicker_->date()));
m->setData(modelRow, 5, boost::any(modifiedPicker_->date()));
}
delete this;
}
示例2: run_alg
void HelloApplication::run_alg()
{
sim_params params;
params.pop_size = WLocale::currentLocale().toInt(pop_size_edit->text());
params.num_epochs = WLocale::currentLocale().toInt(num_epochs_edit->text());
enableUpdates(true); // TODO: Right place? And where to disable?
ga_thread.swap(boost::shared_ptr< boost::thread >(new boost::thread(run_fn, this, db_cp, params)));//sessionId())));
}
示例3: enterdata
void MyApp::enterdata()
{
{
dbo::Transaction transaction(session);
Ball *blog = new Ball();
blog->username = usernameedit->text().toUTF8();
blog->password = passwordedit->text().toUTF8();
dbo::ptr<Ball> blogPtr = session.add(blog);
transaction.commit();
}}
示例4: loadGitModel
/*! \brief Change repository and/or revision
*/
void loadGitModel() {
sourceView_->setIndex(WModelIndex());
repositoryError_->setText("");
revisionError_->setText("");
try {
gitModel_->setRepositoryPath(repositoryEdit_->text().toUTF8());
try {
gitModel_->loadRevision(revisionEdit_->text().toUTF8());
} catch (const Git::Exception& e) {
revisionError_->setText(e.what());
}
} catch (const Git::Exception& e) {
repositoryError_->setText(e.what());
}
}
示例5: greet
void HelloApplication::greet()
{
/*
* Update the text, using text input into the nameEdit_ field.
*/
greeting_->setText("Hello there, " + nameEdit_->text());
}
示例6: reportEdit
void DensityApp::reportEdit() {
cmd_ = codeEdit_->text().toUTF8(); // get text written in box, as UTF-8, assigned to string
std::string rng = "y <- " + cmd_ + ";";
R_.parseEvalQ(rng); // evaluates expression, assigns to 'y'
Yvec_ = R_["y"]; // cache the y vector
plot();
}
示例7: editState
boost::any WItemDelegate::editState(WWidget *editor) const
{
WContainerWidget *w = dynamic_cast<WContainerWidget *>(editor);
WLineEdit *lineEdit = dynamic_cast<WLineEdit *>(w->widget(0));
return boost::any(lineEdit->text());
}
示例8: eventKeyWentUp
void WebGLDemo::eventKeyWentUp(const WKeyEvent& event){
lightColor.assign(getVal(lightColR->text().toUTF8()),
getVal(lightColG->text().toUTF8()),
getVal(lightColB->text().toUTF8()) );
lightDirection.assign(getVal(lightDirX->text().toUTF8()),
getVal(lightDirY->text().toUTF8()),
getVal(lightDirZ->text().toUTF8()) );
ambientColor.assign(getVal(ambLightColR->text().toUTF8()),
getVal(ambLightColG->text().toUTF8()),
getVal(ambLightColB->text().toUTF8()) );
drawGLWidget_->updateLights(ambientColor,lightDirection,lightColor);
drawGLWidget_->repaintGL(DrawGLWidget::PAINT_GL);
}
示例9: novoAnuncio
void AdsEditor::novoAnuncio() {
AdsApplication *app = AdsApplication::adsApplication();
cppdb::session &db = app->db_;
Wt::WDialog dialog("novo Anuncio");
Wt::WPushButton *ok = new WPushButton("Ok");
ok->setStyleClass("btn btn-primary");
ok->clicked().connect(&dialog, &Wt::WDialog::accept);
Wt::WPushButton *cancel = new WPushButton("Cancela");
cancel->setStyleClass("btn");
cancel->clicked().connect(&dialog, &Wt::WDialog::reject);
WLineEdit *lTitulo = new WLineEdit();
WLineEdit *lURL = new WLineEdit();
WLineEdit *lTexto = new WLineEdit();
WTemplate *t = new WTemplate(dialog.contents());
t->setTemplateText("<form>"
" <fieldset>"
" <legend>Dados do anuncio</legend>"
" <table border=0>"
" <tr><td>Titulo</td> <td>${titulo}</td></tr>"
" <tr><td>URL</td> <td>${url}</td></tr>"
" <tr><td>Texto</td> <td>${texto}</td></tr>"
" </table>"
" </fieldset>"
" ${ok}${cancel}"
"</form>"
, XHTMLUnsafeText);
t->bindWidget("titulo", lTitulo);
t->bindWidget("url", lURL);
t->bindWidget("texto", lTexto);
t->bindWidget("ok", ok);
t->bindWidget("cancel", cancel);
if (dialog.exec() == Wt::WDialog::Accepted) {
db << "insert into anuncio (id, titulo, url, texto, imagem) values "
"(NULL, ?,?,?, '/img/cabure.png')"
<< lTitulo->text().narrow() << lURL->text().narrow()
<< lTexto->text().narrow() << cppdb::exec;
}
renderUI();
}
示例10: WContainerWidget
//.........这里部分代码省略.........
legendAlignment->setCurrentIndex(3); break;
case AlignMiddle:
legendAlignment->setCurrentIndex(4); break;
case AlignBottom:
legendAlignment->setCurrentIndex(5); break;
default:
break;
}
WCheckBox *enableGridLines = new WCheckBox(this);
template_->bindWidget("gridlines", enableGridLines);
WLineEdit *widgetWidth = new WLineEdit(Wt::asString(chart_->width().value()), this);
widgetWidth->setValidator(new Wt::WIntValidator(1, 2000));
WLineEdit *widgetHeight = new WLineEdit(Wt::asString(chart_->height().value()), this);
widgetHeight->setValidator(new Wt::WIntValidator(1, 2000));
template_->bindWidget("width", widgetWidth);
template_->bindWidget("height", widgetHeight);
WLineEdit *xAxisTitle = new WLineEdit(chart_->axis(XAxis_3D).title(), this);
WLineEdit *yAxisTitle = new WLineEdit(chart_->axis(YAxis_3D).title(), this);
WLineEdit *zAxisTitle = new WLineEdit(chart_->axis(ZAxis_3D).title(), this);
template_->bindWidget("xTitle", xAxisTitle);
template_->bindWidget("yTitle", yAxisTitle);
template_->bindWidget("zTitle", zAxisTitle);
// hook it up
autoRangeX_->checked().connect(std::bind([=] () {
chart_->axis(XAxis_3D).setAutoLimits(Chart::MinimumValue
| Chart::MaximumValue);
xMin_->setEnabled(false); xMax_->setEnabled(false);
}));
autoRangeX_->unChecked().connect(std::bind([=] () {
xMin_->setEnabled(true); xMax_->setEnabled(true);
chart_->axis(XAxis_3D).setRange(Wt::asNumber(xMin_->text()),
Wt::asNumber(xMax_->text()));
}));
autoRangeY_->checked().connect(std::bind([=] () {
chart_->axis(YAxis_3D).setAutoLimits(Chart::MinimumValue
| Chart::MaximumValue);
yMin_->setEnabled(false); yMax_->setEnabled(false);
}));
autoRangeY_->unChecked().connect(std::bind([=] () {
yMin_->setEnabled(true); yMax_->setEnabled(true);
chart_->axis(YAxis_3D).setRange(Wt::asNumber(yMin_->text()),
Wt::asNumber(yMax_->text()));
}));
autoRangeZ_->checked().connect(std::bind([=] () {
chart_->axis(ZAxis_3D).setAutoLimits(Chart::MinimumValue
| Chart::MaximumValue);
zMin_->setEnabled(false); zMax_->setEnabled(false);
}));
autoRangeZ_->unChecked().connect(std::bind([=] () {
zMin_->setEnabled(true); zMax_->setEnabled(true);
chart_->axis(ZAxis_3D).setRange(Wt::asNumber(zMin_->text()),
Wt::asNumber(zMax_->text()));
}));
xMin_->changed().connect(std::bind([=] () {
chart_->axis(XAxis_3D).setRange(Wt::asNumber(xMin_->text()),
Wt::asNumber(xMax_->text()));
}));
xMax_->changed().connect(std::bind([=] () {
chart_->axis(XAxis_3D).setRange(Wt::asNumber(xMin_->text()),
Wt::asNumber(xMax_->text()));
}));
yMin_->changed().connect(std::bind([=] () {
示例11: set_pan_to
void Example::set_pan_to() {
double x = boost::lexical_cast<double>(edit_of_pan_to_lat_->text());
double y = boost::lexical_cast<double>(edit_of_pan_to_lng_->text());
mv_->pan_to(Coordinate(x, y));
}
示例12: set_zoom_to
void Example::set_zoom_to() {
mv_->zoom_to(boost::lexical_cast<int>(edit_of_zoom_to_->text()));
}