Support #1084
closedWFileUpload signal using in a WTabWidget : signal 's36' not exposed
0%
Description
Hi all
I have this problem using a WFileUpload in a WTabWidget:"Wt: decodeSignal(): signal 's36' not exposed" and I don't know why.
With the version 3.1.11, I didn't have this problem but with the last version version ...
A part of my source code:
//// MY TAB/////////
WContainerWidget *containerWidget2 = new WContainerWidget();
// create a WFileUpload
upload = new WFileUpload();
upload->setFileTextSize(30);
// Provide a Button
WPushButton *uploadButton = new WPushButton("Upload");
//Provide a progress Bar
upload->setProgressBar(progressBar = new WProgressBar(containerWidget2));
// VBox Layout
layout = new WVBoxLayout();
layout->addWidget(upload);
layout->addWidget(progressBar);
layout->addWidget(uploadButton);
containerWidget2->setLayout(layout);
// Upload when the Button is clicked.
uploadButton->clicked().connect(upload, &WFileUpload::upload);
uploadButton->clicked().connect(uploadButton, &WPushButton::disable);
// React to a succesfull upload.
upload->uploaded().connect(this, &widgetsContainer::eventFileUploading);
/////////MY TABWIDGET/////////////
WTabWidget *tabWidget = new WTabWidget(this);
tabWidget->addTab(containerWidget2,"WFileUpload, WProgressBar and WMessageBox");
/////////MY SLOT//////////////
void widgetsContainer::eventFileUploading(){
this->addWidget(new WText("hola"));
std::cout << "test"<< std::endl;
std::ifstream infile;
WString spoolFileName = upload->spoolFileName();
// We convert into string the spoolFileName and we open the file
infile.open (spoolFileName.toUTF8().c_str() , std::ifstream::in);
char c;
// Look over all characters and display it
while (infile.good() && !infile.eof()){
//std::cout << (char) infile.get();
// we read one character to one character
c = infile.get();
// if we arrive at the end of file
if (infile.eof()) break;
// copy it in string and print it then
std::string str(1,c);
//new WText(str);
layout->addWidget(new WText(str));
}
// we close the file
infile.close();
}
Thanks to help me =)
Cheers,
Bart
Updated by Koen Deforche about 13 years ago
- Status changed from New to Resolved
- Assignee set to Koen Deforche
- Target version set to 3.2.1
Hey,
There is indeed a problem with WFileUpload, that is caused by hiding it (it hides itself during upload() if there is a progress bar for example).
We added a new constraint in 3.2.0 for verifying that an event is exposed which checks that it belongs to a widget that is currently visible. This is however to aggressive, so I am reverting that (we may want to reconsider a better criterium in the future).
You can easily fix this in your copy of Wt, comment the following:
bool WApplication::isExposed(WWidget *w) const
{
// if (!w->isVisible())
// return false;
...
}
Regards,
koen