Im trying to show a flash animation in my QT application, I'm doing it by a QWebView. This is my code:
webpage = new QWebPage(this->window);
webpage->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
webpage->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
webview->setGeometry(QRect(0,0,480,800));
webview->move(QPoint(0,0));
webview->load(QUrl(flash->file));
webview->show();
So, Im able to show regular pages, but the pages that got a Flash animation doesnt appears. I receive a blank page and a symbol from adobe, like "Get flashplayer".
I already have it, those pages load ok in Firefox and Chrome. I have put the NPSWF32.dll e my project folder and in others standar paths, but it Didnt work. So I do not really know what to do now. Hope you guys can helpme, I couldnt find the plugin file in Firefox or Chrome folders, so I downloaded another NPSWF32 to put in the project folder, maybe is that? Thanks in advance!
look here where Qt expects to find plugin:
http://doc.trolltech.com/latest/qtwebkit.html#netscape-plugin-support
Your plugin (NPSWF32) seems to be right
Related
I am working on a template generated from VS 2017 Community for Python/Django web application.
I can't seem to get the CSS to work.
I looked at the page source and it is referencing the correct style sheet.I
adding a class (class="test") to to h4 in the .html file so that I can target it through the CSS
in the site.css I have .test{
`color: red;'
}
background, I started by trying to add a "tooltip" to this sheet. When that didn't work I went back to a simple manipulation just to see if I could get that to work.
Please let me know if you need other code snippets!
other aspects of the code work as expected it's just styling that is giving me fits.
Pretty new at this so please be just a little forgiving! :)
I wonder if maybe classes and id's from a template are not influenced by site.cs?
Turns out, there is a difference between hitting refresh in the browser and ctrl + "r". Ctrl + "r" refreshed the page (without cache i'm guessing) and the changes I made were displayed.
I added a custom.css file to the "content" folder under "app" folder.
I then added a link to that sheet in the "layout.html" file
I can see my changes now.
Might be a beginner mistake but at least I can move forward now.
I was able to resolve this. "control" + "r" helped.
all my CSS seems to be working now.
Thanks fo responding Arturo.
I have developed display template and using it in Content search web part.
For displaying result on page i am using JQuery datatable/JQuery Tabs in display template.
Everything works fine, but sometime while loading page i am getting error like ("Object doesn't support property or method 'dataTable' (OnPostRender: )" and for tabs error is "Object doesn't support property or method 'tabs' (OnPostRender: )").
And if i refresh page many times then error will go and result is display as code.
I have register JQuery, JS and CSS using $includeScript.
I have also tried with RegisterSod for JQuery and JS file but still issue is same.
Thanks in Advance.
Can be:
This error usually occurs when an html element id has the same id as some variable in the javascript function, try change the name.
If you put the code I'll be able to help you better.
test = button.attr('test'); // Object doesnt support this method
$test= button.attr('test'); // works fine
Or debbug your code with and discover your problem. Enable script debugging IE:
In Internet Explorer, choose Internet Options from the Tools menu.
In the Internet Options dialog box, click the Advanced tab.
On the Advanced tab, under Browsing, clear Disable Script Debugging.
Click OK.
If you have IE 8+ click here
Tutorial Using jQuery dataTables: link here
Right now I am using one webview to show data from my aplicationDatadirectory, here everything is working fine, I get content when user click next back respectively. Now what I am doing is in onload of webview I register "touchevent" and "touchmove" in webview's html like this :-
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchstart", function mytouch(){Ti.App.fireEvent("touch", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchmove", function mymove(){Ti.App.fireEvent("move", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
on the basis of this I find swipe event. I get correct html in webview(I can see images). But I am unable to get touchstart and move call. I dont know what is the problem here. I set data in webview using url here.
Now when I set data in webview using html(I used data of my html file(given below) in one var) now I am unable to see images it just shows me one black border(empty) but here my touchstart and touchmove events are firing also my swipe is also working as expected. I am checking this functionality in iPhone.
Can any one find the issue what is going wrong here? Thanks.
I think that this depends on the time when you apply
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchstart", function mytouch(){Ti.App.fireEvent("touch", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchmove", function mymove(){Ti.App.fireEvent("move", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
If you use the html property data is loaded immediately and you can use the code exactly after setting html content. If you use the url (even if it is located locally, which might be difficult for android) then you need to wait a short time until the page is loaded. There is also an event listener for that (web view-event load) but i can't say if that works for local resources but i don't think so.
In this case you should apply your javascript snippet into your html resources (if they are locally) instead of manually adding it using evalJS.
Please note that there is an issue on android that you can't use local images (resources folder) in your webview when you provide the content via html property.
I made it swipe working in iOS(in android it was working).
I did not expect this thing to be a reason but I do not know logic behind it. I was accessing .xhtml files from application data directory and it was working without any issue in android but in iOS it was not.
I just change(rename in my code) .xhtml file to .html and now it is working. :)
Hope this can help someone who is looking for the same.(or just for his interest)
Thanks.
I'm working on a project that collects data from the project then displays it using xfdf to populate a .pdf file. Now when I use Chrome or Firefox it opens in a new tab which is exactly what I want, but some of my clients will be using IE, which opens it in the same window and causes some confusion. What area of the code should I be looking at in order to tackle and solve this problem?
I can show code examples, just let me know what I need to show.
Thanks,
Steve
Edit: When I click 'Print Application' button, it asks me to save or open the file. When they click open, it opens in the same tab, I want it to appear in a new tab.
In my experience, the best way to accomplish this is to alter your template linking to the PDF. For example:
Clicky!
This should work in all browsers.
Is there any way to capture an image of a web page using a C++ CGI? I've been searching high and low, and while I've found a number of implementations in everything from Perl to C#, haven't been able to find any implementations in C++.
The idea is for a user visiting a site to be able to specify a URL. The script would then take a picture of the URL's website, and then show load it to the C++ CGI website I am building.
Any help on this would be much appreciated!
Thanks!
Example in Perl:
Webthumb
You need to render the webpage in order to create a snapshot. To render the page in C++ you need to include a browser engine. You can do this easily using Qt (a toolkit for c++).
This is taken from the documentation of Qt and is all you need to show a webpage.
QWebView *view = new QWebView(ui->centralWidget);
view->load(QUrl("http://qt.nokia.com/"));
view->show();
The view object has a loadFinished signal. You could connect some code to this signal. When the page is rendered you tak a snapshot as described here.
It boils down to:
QPixmap::grabWindow(mainwindow->winId())
When you have got the screenshot you can return the bytes on stdout from your cgi and your done.