How to save an open, editable file in QWebView? - qt

I have a page open in QWebView which is editable with the contenteditable attribute. When a user clicks a save button, I would like to save the content in the file which is already open in the QWebView. Is it possible?

You can obtain the QWebPage with QWebView::page and the QWebFrame with QWebPage::mainFrame. You can then get the content of the page with QWebFrame::toHtml and save it to a temporary file

Related

How to pass user activation to iframe to open file chooser dialog

Trying to open an upload file dialog(through file input element) embedded in an iframe upon click of a button in the parent window. Instead, this error is thrown "File chooser dialog can only be shown with a user activation.". Parent window and iframe source are hosted in different domains.
Is there any way to transfer user activation to iframe?

How can I find the popped up QFiledialog when I click file input in the QWebView?

QApplication.postEvent(object, press)
I want to simulate the keypress and mousepress in the select file dialog, which is popped up by clicking file input in the QWebView. I don't know what the object is. Any ideas on how to obtain it?
Make a stock QFileDialog in another project, and dump its Object Tree.
http://doc.qt.io/qt-5/qobject.html#dumpObjectTree
http://doc.qt.io/qt-5/objecttrees.html
Hope that helps.

How to show modal dialog or popup of FMElfinderBundle integrated with TrsteelCkeditorBundle?

I want to use FMElfinderBundle on modal dialog. Now when i click on Browse server botton on Ckeditor new tab on my browser opened and I should work on it to upload image or select one image that is existing on server directory.
As i know current version of CKEditor doesn't support modal/iframe based calls, you can use TinyMCE, that opens filebrowser in iframe.

Vaadin : Upload button listener

How can I get the upload button listener of component upload? This is because I want to validate other fields upon clicking the upload button. I've tried adding...
upload.addListener(new Upload.StartedListener() {});
It only works if there is already a chosen file but if the file is blank, it didn't.
Try to hide the submit button of Upload with CSS and create a button that calls:
upload.submitUpload();
No need to hide the 'Upload' Button with CSS.
Another simple way to hide:
Upload upload = new Upload("Caption", receiver);
upload.setButtonCaption(null);//will hide the Upload Button

opening file upload window using javascript

I have a button or link button. I want to open a window for file uploading by clicking the button or link button. Actually at that time I won't have any file upload control there.
can any one tell me how to do it by using JavaScript?
<button onclick="window.open('the_page_containing_the_upload_form.html', 'Upload form')">Upload</button>
I think you are asking that you want to open up the file upload dialog with a click of something other than the input element itself.
You can not just open up the file upload dialog since that is sort of a thing we call a security issue. You can style the input field to make it look like something else

Resources