Using Qt QWebPage in a Windows QtService - qt

I am using QtService to write a web page thumbnail rendering service. Is it possible to include sufficient of the Gui libraries to keep QtWebKit happy without running into the restriction on interactive services?
I have the websnap sample from websnap.cpp and this somehow convinces the QWebPage component that a Gui is available without actually displaying the widget. When I try to duplicate the environment in the service it complains that there in no gui for the widget.
I strongly suspect that QtService and QWebPage are fundamentally incompatible but have not yet given up hope that there is a workaround.
I am not even sure what it is that the websnap sample does that keeps QWebPage happy (is it just because its linked with the Gui library?)
I am very new to the Qt library so the answer may be obvious to someone with more experience.
Thanks,
Andy

Althought QtWebKit can work in headless environment (without any visible widgets), it still requires graphics libraries etc to be present and functional. Otherwise, how would it compute font metrics, render the text, and so on? Thus, you always need QtGui.
PS: I wrote the websnap example :)

Related

Qt: How receive keyboard events when my application doesn't have focus in Qt5 specifically?

I have the exact same problem of this post: I want to make a software which, once executed, will monitor for a specific key event (press of F12) and will do something (do repeated mouse clicks: an auto clicker). But I'ld like, if possible, to use Qt himself to do the trick instead of calling Windows's functions (especially because it may well be eventually used in Linux, so a cross-platform solution is desired)
Well my problem isn't anything new including for Qt users as the link above shows. Moreover, a decent answer was already posted in this post, but it involves the use of Qt eXTension in a Qt 4 context, and that is outdated. In fact, it's so outdated that when I tried to access the eXTension link, my Chrome browser warned me of being an insecure website! So what I would like to know specifically is if there is any Qt 5, specifically, solution to this problem, given that eXTension is out of question, or if I'll have to do a OS key hook after all. A Qt5 free library will also be acceptable.

Which parts of Windows does Qt rely on?

I believe Qt uses GDI(+) and you start with a QObject. Does it call ActiveX components, COM etc?
For example, putting WebKit in a form is there anything happening there that uses the Windows bits and pieces for painting?
I'm just a beginner trying to work out how much of WINAPI, COM, and ActiveX is used/wrapped by Qt.
In general Qt only implements a feature if there is a sensible(/compatible) metaphor for that feature on all* supported platforms. It makes use of a lot of different Microsoft and non-Microsoft components on Windows, not just the one's you have mentioned.
I've not found a document which summarises what you're asking before because it's not something I've ever needed or found useful as the document would be immense. The way I tend to work with Qt is read the excellent documentation and believe it until I find something which does what I didn't expect it to. Then delve into what it does under the bonnet(/hood) for that specific platform. Remember, the source code is freely available.
* Note: there are some features which are platform specific in the framework but these are usually clearly identified as such.

VT500 terminal emulation Flex component

Does anybody know of an existing Flex component that does VT500 terminal emulation?
We are gradually replacing terminal-based user interfaces with an AIR-based GUI.
We would like to have a terminal emulator embedded in that new AIR GUI, in order to give our users an integrated user experience when navigating between our old and new software.
Emulation of other VT-series terminals than the VT500 could also be usefull.
Btw, I'm not interested in writing it myself (nor having it written for me) because it would only be a nice-to-have in our software architecture.
Thanks,
Pieter
Isn't the whole point of using Air and upgrading the technology is that you DON'T need to use a terminal anymore? Seems a bit redundant.
I don't think you'll find anyone that has already created the emulator, but it can't be that hard to implement if you really need the functionality. I know I've seen an AJAX implementation of it (anyterm.org) that uses the ROTE library for the virtual emulator. You might want to look into that.

Qt serial port library

I want to make an app using Qt that communicates with serial port.
The problem is that I cant find a library that works and does this thing.
I need a non General Public License library I think.
Actually I am not sure cause I don't know if I can use a General Public License library for a closed source program.
I found qextserialport but I am unable to build it using Qt 4.7.3. I added all the needed headers but it fails on some functions.
Can anyone help me here?
If you want to go closed source and distribute your application, you can't use GPL. You can use LGPL when linking either dynamically or statically. For the latter, you need to provide object files for all of your code, so that they can be statically re-linked with Qt.
Conercerning your base issue, Qt 5 includes a serial port module. On Qt 4, you'll need a platform-specific solution. Reducing the scope might help to point you to something. I suggest that if you don't target portability, you should add relevant tags and comments. Otherwise, saying that you need a portable solution is a good thing too.
As far as I know, on most paltforms, accessing to serial port requires higher privileges, so be ready for that in your deployment.
Concerning qtextserialport, license is BSD so it would work for your clsoed source application. If you post a compilation issue on where it fails, maybe people will be able to help you
I tried to compile it using VC2010 and Qt 4.7.2 and head of project (I just cloned it) compiles flawlessly: I got a nice qextserialport1.dll (that I admit I didn't try using).
There is a QtSerialPort add-on nowadays that can be used for such tasks. I am one of the maintainers behind it. That is the "official" Qt add-on nowadays, so I would suggest switching to it. It will also support Qt 4.
It is properly useful for commercial code (closed source) as I have also been doing that. If we do not yet have an exception for static linking, I would even accept that if legally possible.
My opinion about licenses is somewhere in-between LGPLv2 and MIT, i.e. LGPLv2 + static linking.
Here you can find my blog post about it. It also works fine with Qt 4 as we have had put some effort into that support, too.
http://lpapp.blogspot.co.uk/2013/02/qtserialport-in-qt-51.html

Any really modern, good-looking desktop apps that are developed with PyQt/PySide?

I have started using Python for web development recently, it's kinda cool;
I have seen programs that are developed in QT/C++, which is good enough in terms of esthetics;
I have just noticed the new PySide project (which brings LGPL Qt license to Python and it doesn't support Windows yet).
In view of the above, I see the possibility of using Python + PyQt/PySide to develop cross platform apps in the future :) but I have several doubts right now:
Can PyQty/PySide be used to develop really complex/modern UI? Can somebody give me some points to have a look at some nice-looking screenshots of apps that are developed in Python+QT?
What about the performance of using Python + QT for a desktop app?
Thanks in advance!
Can PyQty/PySide be used to develop really complex/modern UI?
Desktop applications come in all sorts of varieties -- some nicely laid out, some extremely customized with virtually no semblance to a standard application for that OS. The same can be done with Qt/PyQt/PySide. As Alex said, there should be no visible difference between an application written with PyQt/PySide versus one written with Qt in C++. Any program written with Qt4 (using bindings or not) will, by default, look like a standard modern application.
Of course, there are features of recent Windows releases (and likely some on Mac OS X) that aren't supported immediately and by default in Qt, but you can almost always write some custom platform specific code for those situations where said features are truly important.
Can somebody give me some points to have a look at some nice-looking screenshots of apps that are developed in Python+QT?
The best and most open source program that I know of and which is written with PyQt, is Eric -- a Python based IDE.
What about the performance of using Python + QT for a desktop app?
For most applications the performance difference between a C++ Qt application and a PyQt application are not noticible. But if you really need performance, you can write certain parts of the application in C++ and make bindings available in Python so you can integrate the two.
TortoiseHg was re-designed using Qt and PyQt for its 2.0 release.
Here is one of several posted screenshots:
There is no aesthetic difference between the look and feel of C++ based Qt, and the PyQt and PySide wrappers on top of it. I use basically no desktop GUI apps so I couldn't point you to any implemented with any of these language/toolkit combos, but if you like the former, you'll be hard put to distinguish it in any way from the latter.
A bit late but for the record, apps such as Skype, GoogleEarth or the recent versions of VLC (media player & more) used the Qt libs.

Resources