Project

General

Profile

Actions

Support #1084

closed

WFileUpload signal using in a WTabWidget : signal 's36' not exposed

Added by Arribe Barthelemy almost 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
12/05/2011
Due date:
% Done:

0%

Estimated time:

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

Actions #1

Updated by Koen Deforche almost 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

Actions #2

Updated by Koen Deforche over 12 years ago

  • Status changed from Resolved to Closed

Fixed in 3.2.1

Actions

Also available in: Atom PDF