本文整理汇总了C++中WLineEdit::valueText方法的典型用法代码示例。如果您正苦于以下问题:C++ WLineEdit::valueText方法的具体用法?C++ WLineEdit::valueText怎么用?C++ WLineEdit::valueText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WLineEdit
的用法示例。
在下文中一共展示了WLineEdit::valueText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addBook
void BasePage::addBook(){
WContainerWidget *container = new WContainerWidget();
Wt::WTemplate *t = new Wt::WTemplate(Wt::WString::tr("addBookForm"));
WLineEdit *editTitle = new WLineEdit(container);
editTitle->setPlaceholderText("title");
t->bindWidget("title", editTitle);
WLineEdit *editAuthor = new WLineEdit(container);
editAuthor->setPlaceholderText("author");
t->bindWidget("author", editAuthor);
WLineEdit *editAuthorYears = new WLineEdit(container);
editAuthorYears->setPlaceholderText("years of life");
t->bindWidget("years", editAuthorYears);
WLineEdit *editGenre = new WLineEdit(container);
editGenre->setPlaceholderText("genre");
t->bindWidget("genre", editGenre);
WLineEdit *editYear = new WLineEdit(container);
editYear->setPlaceholderText("year");
t->bindWidget("year", editYear);
WLineEdit *editSeria = new WLineEdit(container);
editSeria->setPlaceholderText("seria");
t->bindWidget("seria", editSeria);
WLineEdit *editNumOfBooks = new WLineEdit(container);
editNumOfBooks->setPlaceholderText("num of books");
t->bindWidget("numOfBooks", editNumOfBooks);
WLineEdit *editNumInSeria = new WLineEdit(container);
editNumInSeria->setPlaceholderText("number in seria");
t->bindWidget("numInSeria", editNumInSeria);
WLineEdit *editMark = new WLineEdit(container);
editMark->setPlaceholderText("mark");
editMark->setValidator(new Wt::WIntValidator(1, 10));
t->bindWidget("mark", editMark);
WPushButton *button = new WPushButton("Add book", container);
button->setMargin(10, Top | Bottom);
button->clicked().connect(std::bind([=] () {BookManager bm; bm.addBook(editTitle->valueText().toUTF8(),
editAuthor->valueText().toUTF8(),
editAuthorYears->valueText().toUTF8(),
editGenre->valueText().toUTF8(),
intoInt(editYear),
editSeria->valueText().toUTF8(),
intoInt(editNumOfBooks),
intoInt(editNumInSeria),
intoInt(editMark)); }));
t->bindWidget("button", button);
_pagecontent->addWidget(t);
}