Using Qt in a pre-existing x-platform project? - windows

I have an existing cross platform project that runs on Mac, Linux and Windows.
Now, I want to add a 'native' UI to it - the ability to show some popup windows (to request user credentials) and perhaps FileOpen dialogs. By native I mean I want to use the systems build in file-open dialog - so on the Mac the mac file finder is shown and on Windows the shells file open window is shown.
Qt seems a good fit - its samples show that it can show the correct dialog on all platforms.
However, all the available Qt samples start at the very base level - assuming the entire project is developed in Qt. Is it possible to initialize and use Qt in a more ad-hoc fashion :- i want to keep all my Qt UI code in a seperate dll/dylib/so file with some simple exports (think ShowLoginPopup).

I think that the easiest approach would be to do it the other way around - having the Qt GUI drive the rest of the application. Qt is event based and does rely on its event loop, so you need to keep that running.

Related

What do I convert a Delphi Win32 resource DLL to for a Delphi macOS app?

I have a resource DLL for a Windows Delphi app. I want to port this to macOS, and eventually to iOS (for iPad only, not iPhone). I have yet to dip my toes into developing outside of the VCL (I don't even own a Mac yet, though I know I will need one eventually). The FireMonkey stuff, no problem (yet). I just wonder what approach to take to port a Windows resource DLL to other platforms.
For Firemonkey, you can user the dialog box in menu "Project / Resource and images".
This help page will give you code sample to use it in your program :
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Resource_Files_Support

GTK3 + OpenGL for windows: multiple GtkGLArea (ie. OpenGL contexts)

I am developing a GTK3 based application with OpenGL windows created using the GtkGLArea widget, to build the application on windows I use the msys2 64 bits system.
No problem to build the application, it works just with a single OpenGL window.
However my program is designed to handle multiple projects, and hence GtkGLarea, one for each project. This works perfectly for Linux.
However on window, it works with one GtkGLArea, but as soon as more than one are used only a single one (the first to be created) remains active, and no information is displayed in the other windows. If I click on any of the other windows then the content of the first window is updated with what should appear in the window I am interacting with ...
I noticed that I could open as many instances of my program each with one GtkGLAera working just fine, and therefore that the number of OpenGL context is not a problem, only the interaction / dialog / management within the same occurrence of my program is.
Is there any way to correct this behavior and how ?
Looks like it's a known GDK Win32 bug that has been fixed.
Bugzilla bug #789213
You should use wglMakeCurrent() analog to set current context, and after usage you should call wglMakeCurrent(NULL, NULL) to release context so the other widget will be able to use OpenGL.

How can I use Go to make a GUI window?

I am in need to make a simple window in Go to display some text,
there is no need for a real GUI like interface.
How can I make a window like this using Go?
walk is the most common library used for basic GUI development.
You can import the package using:
go get github.com/lxn/walk
I assume you are working at windows OS so create an exe and run it.
More Information about this can be gathered from its source.
Visit https://github.com/lxn/walk
A nice-looking cross-platform UI can be created using HTML5/CSS/JS. You may open a native window with a full-screen browser engine (webview) in it showing your UI.
There is a tiny wrapper library for webviews on Windows, MacOS and Linux - https://github.com/zserge/webview
You can connectyour UI and the core app parts using Go-to-JS bindings (webview library provides those) or a websocket.

Where can I start creating a Windows application?

I want to create an application to run on a Windows 7 PC with a touch screen that is a sort of toolbox with large icons optimized for touch screens.
I need it to include a file browser with a hard coded path. That way I can auto launch the application and they will be taken to the folder right away. I would also like a section where I can put "Useful Applications" shortcuts so that they do not have to go through the start menu or the desktop.
Can someone guide me where I can start learning how I can do this? I would most likely code in C#
Get started with Windows Runtime apps. You can write a Windows Runtime app in a variety of languages, such as C# or C++ with XAML, C++ with DirectX, and JavaScript with HTML/CSS. Now you can easily create apps for Windows devices and Windows Phone from a single project.
https://dev.windows.com/en-us/getstarted

Qt 4.8.5 Mac Handle file dropping on dock icon

I'm porting some Qt apps to Mac OS. And have some questions because I have no experience in developing apps for Mac OS.
Where Applications usually save there settings in Mac OS?
How to handle file dropping on icon in dock?
Mac OS X applications typically save their settings in ~/Library/Preferences/ using an XML document called a Property List. If you use the QCoreApplication::setOrganization(..) et all methods, just use QSettings and your code will remain cross platform and do the right thing.
Handling file dropping on the application icon is a little more involved but there is already a pretty good answer and also a Qt Quarterly dealing with this problem. It will basically involve:
Setting up the Info.plist in the application bundle to identify what files types are handled by your application.
Subclassing QApplication to handle QEvent::FileOpen.

Resources