Project

General

Profile

Bug #5390

Calendar widget shows up after calling WDateEdit::setHidden(false)

Added by Alan Finley about 5 years ago. Updated about 5 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
Target version:
Start date:
11/01/2016
Due date:
% Done:

0%

Estimated time:

Description

An example:

#include <Wt/WCheckBox>
#include <Wt/WDateEdit>
#include <Wt/WText>

using namespace Wt;

void toggle_date_edit(WCheckBox *cb, WDateEdit *de, WText *t)
{
    de->setHidden(!cb->isChecked());
    t->setHidden(cb->isChecked());
}

Wt::WApplication* createApplication(const Wt::WEnvironment& env)
{
    WApplication *app = new WApplication(env);
    WCheckBox *cb = new WCheckBox("Show WDateEdit", app->root());

    WContainerWidget *cont = new WContainerWidget(app->root());
    WDateEdit *de = new WDateEdit(cont);
    WText *t = new WText("some text", cont);

    de->hide();
    t->show();

    cb->changed().connect(boost::bind(&toggle_date_edit, cb, de, t));

    return app;
}

After I check the "Show WDateEdit" checkbox on, a calendar widget shows up along with WDateEdit itself.

Also available in: Atom PDF