QWebElement information where on page it is rendered? - qt

Looks like access to DOM and rendering details of HTML tags are not availabel in qt 4.5.x .
Current snapshot QWebElement looks like proper class to be used there
Anybody can give me info if is it possible to get from QWebElement information where on page it was rendered ?
Or there are other ways to get that information ?
TIA, regards

In Qt 4.5, you need to write that as a JavaScript expression and evaluate that with QWebFrame::evaluateJaveScript().

Just for reference's sake: for 4.6 and up, QWebElement.geometry() is the best way to do this. Otherwise, user134841's answer about calling into JavaScript is really the only alternative.

Related

iPad Split View App - DetailViewController Methods Never Called

I'm using a fresh iPad split-view template application in Xcode. I've added a sample data array and the data shows up just fine in the Popover view. However, when it's tapped, it doesn't call any methods from DetailViewController.m (setDetailItem in particular) like I'd expect it to.
Am I missing something here?
(I'm not sure what code I should post for this particular question, so I'll wait on you guys to ask for it.)
Thanks SO much in advance!
To troubleshoot this issue, you should check the method called didSelectRowAtIndexPath in the delegate for the table view. I remember that was called RootViewController by default and exists in the RootViewController.m file.
It should call the setDetailItem method. Check if it does so.
Posting the didSelectRowAtIndexPath method body here will help better.

jQuery syntax while using master Page

I am using master page where i need to move value of one listbox to the other with the help of jQuery I tried many ways but wasn't able to hit the nail.
The methods I tried are as follows:
$("[id$='ModuleMasterListBox option:[#selected]']").appendTo($("[id$='ModuleSelectListBox']"));
$("[id$='ModuleMasterListBox option:#selected]'").appendTo($("[id$='ModuleSelectListBox']"));
var module = $("[id$='ModuleMasterListBox']").val();
module.appendTo($("[id$='ModuleSelectListBox']"));
These are the methods I tried which failed - please help me out....
You should be able to do it like this:
$("[id$='ModuleMasterListBox'] :selected").appendTo("[id$='ModuleSelectListBox']");
From your markup and the # sign it looks like you're using an outdated version of jQuery, you may want to consider upgrading. In the above we're using the attribute-ends-with selector to get the <select> the using :selected to grab the selected <option> before moving it.
Keep in mind since it looks like you're using ASP.Net this will by default throw validation errors on the server-side, you'll have to disable page validation for it to allow items it didn't bind.

identify client web browser in flex

How do we identify the user's web browser in flex ? Based on the browser I have to display some text in my flex application.
Any help would be appreciated.
Thanks
Short answer is to use ExternalInterface to call JavaScript code.
I would take a look at these pages from the documentation for more in depth information:
http://livedocs.adobe.com/flex/3/html/help.html?content=18_Client_System_Environment_7.html
http://livedocs.adobe.com/flex/3/html/19_External_Interface_04.html
http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html
Yes, Javascript code gives you access to Navigator object, which inturn can give you the browser details.
Here's an example I obtained on Googling
http://www.tharas.in/2009/12/getting-client-browser-environment-in-flex/
From ActionScript,
var result:String = ExternalInterface.call("eval", "navigator.userAgent");
which gets the value for the browser name, stores it in result.

take a snapshop of a qgraphicsview

I am using Qt 4.5 and a qgraphicsscene/view to show video to the user.
I would like to provide a "take a snapshop" button and I am sure that there is a pretty straightforward way much simpler of everything I am thinking about.
How can I do this elegantly?
BTW, the code is here :
http://gitorious.org/handy
You can use the method QWidget::grab(). This method renders the given widget to a pixmap and returns that pixmap. Then you can do whatever you like with that, like saving to a file using QPixmap::save().
See QScreen::grabWindow() and QWidget::grab().
With grabWindow you can even capture a window outside of your application, e.g. the screenshot example program:
http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html

Sizzle Selector Engine Error

I'm attempting to use jQuery and ASP.NET. I am pasting the server control "ClientID" into a jQuery selector and I'm getting an error (with no error text) from the Sizzle selector engine.
My selector looks like this...
$('#ctl00_ContentPlaceHolder1__phProfileHeader__filProfileImage')
Is it the length that might be causing the problem? I've re-checked the control ID several times in the client code and everything seems fine. So what's the deal? I use the same strategy in several other places and they work fine.
That's pretty strange. Something that I have seen used when dealing with those long ASP.NET generated IDs is jQuery's content filters. For example, this one will look for element's who's id attribute ends with "filProfileImage":
$("[id$=filProfileImage]")
Try that and see if it helps.
http://docs.jquery.com/Selectors/attributeEndsWith#attributevalue
Are you sure the error is happening in Sizzle?
I would check to see what you get with
document.getElementBy('ctl00_ContentPlaceHolder1__phProfileHeader__filProfileImage');
just to make sure the dom is available. Not that sizzle should care, but...
Please post your error message.
Cheers
I don't get any errors. I don't think is jQuery related. Can you pass the error?
$(document).ready( function(){
console.log( $('#ctl00_ContentPlaceHolder1__phProfileHeader__filProfileImage'));
});
Returns the div.

Resources