Hello,
I'm using the Wt git version. The attached program causes a segmentation
fault when the button is pressed. The segmentation fault happens in
WTableView::setColumnWidth(). It seems the table widget must be first
added to a container and then removed to trigger the segmentation fault.
Is this a bug in Wt or am I doing something incorrectly?
#include <Wt/WApplication>
#include <Wt/WPushButton>
#include <Wt/WStandardItemModel>
#include <Wt/WTableView>
static void insertColumn(Wt::WContainerWidget* root,
Wt::WStandardItemModel* model, Wt::WTableView* view)
{
root->removeWidget(view);
model->insertColumns(0, 1);
view->setColumnWidth(0, 100);
}
static Wt::WApplication *createApplication(Wt::WEnvironment const& environment)
{
Wt::WApplication *application = new Wt::WApplication(environment);
Wt::WStandardItemModel* model = new Wt::WStandardItemModel(application);
Wt::WTableView* view = new Wt::WTableView();
Wt::WPushButton* button = new Wt::WPushButton("Test");
view->setModel(model);
Wt::WContainerWidget* root = application->root();
root->addWidget(view);
root->addWidget(button);
button->clicked().connect(boost::bind(insertColumn, root, model, view));
return application;
}
int main(int argc, char* argv[])
{
return Wt::WRun(argc, argv, &createApplication);
}
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest