New WebKit with old Qt. Is it worth trying? - c++

I have a project built with Qt 3.2.3. It's a little outdated piece of code, but it works fine except for its' embedded browser. This thing is plain old. So I want to take fresh nightly built WebKit and try to adopt it somehow. The question is - is it even possible? I am new with Qt, but had a little experience with WebKit in the recent past. It was very easy linking it to C# project, but I really don't know about Qt and C++.
Maybe there is some better solution for updating a Qt browser without touching the whole Qt?

Honestly saying I think it's easier to port an application from 3.* to latest 4/5 then compiling latest WebKit into 3.*.. there are some core differences which will be really hard to solve. Although such experiment can be possible but I just not sure it's worth it.

WebKit from SVN won't even build against Qt from a couple months ago, so I can't imagine it would be easy to get it to build against Qt 3. I would highly recommend just porting to the current version of Qt and QtWebKit.

Related

Free alternative to QTCreator for QT/C++ development

Let me preface this by stating I have vision problems so I have to magnify my screen upwards of 400% minimum to read most things including code - even when I am using a dark theme as I do when I code.
QTCreator has an issue where it moves the view on me with most keystrokes & actions - usually to the top left corner by the project file listing. I've posed questions to QT Support and even cloned the source for QT Creator looking to see if I could identify a relatively easy fix - to no avail. So now I'm trying to find a free (as in no financial cost) alternative to QT Creator so I can keep programming using QT Creator in C++.
I've tried Visual Studio Community Edition (2017 and 2019) and had problems getting things to build. It seemed like I had to rebuild the entire framework libraries for MSVC or else it wouldn't work. Additionally it seems it finds compilation errors in even the framework source - which doesn't even look wrong to me or I'd try to repair it.
I tried Eclipse (as I'm a Java engineer for my job so I'm familiar with Eclipse for Java and it does not have the problem that QT Creator has. The QT plugin - when I try to put a simple line of #include - It claims "QApplication" is unresolved. I've looked for this and all the answers say about Project->Properties->Paths and Symbols but as of 2019-12 and 2020-03, there are no options in settings for paths and symbols unfortunately.
A colleague suggested CLion from JetBrains but unfortunately it appears you have to pay for that. I have no intention of paying for a compiler or IDE.
Any thoughts on how I can get around this view changing problem or an alternative to QTCreator that doesn't cost money? If there's a setting in one of the applications I may have missed, suggest it with the version of the appication and I'll look for it and reply if it doesn't exist for whatever reason or accept your answer if it does and fixes the problem.
Thank you!
If you are familiar with Eclipse but have issues with the plugins and you intend using it for C++ I recommend checking out Cevelop (https://www.cevelop.com/) it's basically Eclipse but only for C++ and has some optimizations.
If that doesn't work for you technically you should be able to use any code editor like VSCode or Atom, but I do not know how well that works with the Qt library.
CLion is free for students but I think that doesn't apply for you.
NetBeans (https://netbeans.org/) is also free and cross-platform.
(https://netbeans.org/kb/74/cnd/qt-applications.html)
It should be possible to use Qt within the IDE.

Chromium Embed in Qt

I am making an application which needs to have a browser inside an application. I was previously going with JavaFX and its WebView.
But since I prefer Chromium, and since Qt can natively run on Linux without installing anything else, I am leaning to use Qt, since it changed its default web engine to Chromium last year.
Anyways there isn't good documentation on how to use it. So it would be great help if anyone who might have experience with it can point me in the right direction.
This will be available no earlier than Qt 5.3, so you need to wait a bit. Qt 5.2 still uses webkit.

is GTK 3.x a real cross-platform solution?

I have tasted both Qt 4.x/5.x and GTKmm 3.x and I really like GTKmm over Qt.
Now I have just discovered that GTKmm 3.x doesn't offer a Windows porting, they also do not offer a Mac porting, basically I can't find nothing but libraries/sources/binaries for Linux.
Apparently the Windows support ( I'm not sure about the situation for the Mac OS stuff ) was dropped in the 2.x era and it's still not-existing today.
I have planned to use GTK 3.x for specific reasons, especially for some new features introduced by the 3.x branch, so using GTK 2.x is an option off the table.
Now I ask: there is something new for the Windows and/or Mac support for GTK 3.x ? There is something ? even experimental projects ?
No it isn't - at least when you want to be on the safe side for the future. The MacOSX and GTK ports are less then perfect and completely voluntarily which means by a program of this complexity and size they are not not active developed. And nobody cares that old features are implemented before new are added.
Almost 2 years since GTK3 released and there is still no official Windows binary distribution. And on one of the GNOME conferences there was an open discussion if GTK4 should be made Linux only. Well i guess they mean Linux/BSD - but Wayland is pure Linux at the moment and BSD do have a lack of developer for Desktop stuff.
This should be enough to scare any person with a serious program which requires real world investment away.
Also i strongly belive that cross platform GUI toolkits are a thing from the past. Abstract the GUI of your app and develop for every platform. With the success of the AppStores you will be forced more and more to use the native platform style. Your app will already be rejected by Apples AppStore if it looks to different. Windows is now enforcing WinRT. Be prepared that this will just be more important in the future.
So the way to go is WxWidgets which uses native widget sets. Skip GTK
2018-12-18 Update:
GTK+ 3 on Windows has been supported through MSYS2 for years.
Old answer:
GTK for Windows is currently provided "as-is". What it means, basically, is that there are no GTK maintainer that use Windows, and those using Linux have enough work maintaining the Linux builds.
This means that any contribution for GTK 3 on Windows is welcome, some people are using it, but that's not ready for the masses because nobody steps up to do the work, which won't be done by magic overnight. So it's usable, but don't expect reactive maintenance.
As for the build, there's a french dude providing an (unofficial) GTK 3 installer for Windows.
As of right now, no.
Like Frédéric Hamidi said, see Where can I download precompiled GTK+ 3 binaries or windows installer? for more info.
GTK on Mac has worked well for a long time and continues to work into the 3.x series:
https://live.gnome.org/GTK%2B/OSX/Building
You can also install GTK 3.x using MacPorts, but I don't know how well that works.

GUI Programming C++ for Mac OS X Lion

I'm probably going to get abuse for this question but here goes. Oh but before you tear into me and tell to crawl back under a rock etc. I have looked high and low and nothing has helped me so far either the software libs are out of date and for some reason wont work on lion.
Ok other than Qt is there any other lightweight opensource GUI library for C++ on mac? I have tried this wxWidgets doesn't work for some reason. Apple don't seem to offer that carbon crap anymore or can I use openGL to create GUI's? I just want a simple nicely documented GUI lib without having to switch to windows to develop. or will I have to spend some money on one or resort to Qt.
Hope someone can help and thanks!
Why not use Cocoa (the native way to develop OSX GUIs) in the first place? You must use the Objective-C calls to create windows for example, but you can mix this code with C++ code in the same file - this is then called Objective-C++ and it is supported by clang and the gcc.
To build completely native-looking OSX Applications, you need Cocoa. Every other toolkit that can create those native GUIs calls Cocoa (at least to my knowledge).
Just as a pointer: have you tried SDL?
FLTK is simple and very stable GUI library. Runs on Windows, OS X and Linux.
Non-native look though.
Here is a screenshot of an app I built with it a few years ago, and that still runs great on Lion.
I'd take a look at both GLUT and GLUI as simple extensions to OpenGL that provide basic widgets. They can be used together to some degree, but I personally have run into a couple issues in that department. Either one in isolation is pretty simple to use if you're familiar with OpenGL though.
EDIT: Also, X11 can run in OS X, although I'm not familiar enough with the system to know how to get started with that.

Transition from MFC to QT

Currently all our GUI components are written in MFC. Our build environment is:
VC 6
Windows XP
I have no idea whether:
1) We can replace all MFC components with Qt, without changing build environment ?
2) Qt will work with VC6 as any other library?
You answers will help me in getting started, In the mean time I have installed Qt 4 and am trying to build some samples.
If we can replace all MFC components with QT, without changing build environment ?
Yes, you even get a MFC/Qt migration framework cf qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinmigrate/
Will Qt work with VC6 as any other library ?
VC6 is more than 10 years old!
Qt supports VC6 until version 4.5
The next release (4.6) will drop VC6 support cf qt.nokia.com/doc/4.6-snapshot/qt4-6-intro.html#performance-optimizations
You probably shouldn’t use VC6 with Qt 4.5. (see doc)
Apart from that: If your project compiles with Qt, you can easily* switch to Qt components. Qt uses its own componentens anyway, so there’s no other dependencies involved.
However, to set up the Qt environment, you might need to do a few changes to your build system, unless you’re not working with QObjects. (Think of the moc pre-processor.)
*: easily in the sense of being able to start using Qt components. The amount of work needed to actually migrate MFC components to those of Qt is something I don’t know anything about.
Replacing MFC to QT requires a big work to do. First of all you should think whether you need that. Second, Qt could be integrated with Visual Studio.
I learned something very useful when trying to port one client's MFC application to Qt.
I do a lot of refactoring. That doesn't scare me at all. However, I am usually incrementally changing things. That makes a huge difference.
I started porting the MFC application to Qt just after the LGPL version of Qt was released, but before the LGPL release of 'qtwinmigrate' (get it at ftp://ftp.qt.nokia.com/qt/solutions/lgpl/). At the time, I thought Qt was going to hold on to the MFC migration stuff as an incentive for the commercial license.
I had to convert a good number of files before ever being able to compile the project. Once the very basics were up and running, I slowly re-added dialogs until the functionality matched the original version. This was much harder than being able to keep your existing MFC app running as is and slowly replacing dialogs.
So, the point is... USE QTWINMIGRATE!
Oh yeah... and don't use VC6. Upgrade to something more recent.