Basic Qt5 Slots, Signals and Menus Example

In case the reader is an aspiring programmer, but yet a hobbyist, one of the facts which he or she will already know is that, in order to design applications which have a Graphical User Interface, some predefined GUI Library is commonly used, and one example of a GUI Library which can be used is Qt 5. Therefore, in order to become proficient at using this library, like me, the reader might want a working example of:

  • Signals and Slots – The way in which Qt connects user-actions on the GUI, to actions which should be triggered from the actual program,
  • The use of the ‘QLabel’ class to display an image instead of more-common text,
  • The design of a very basic command-menu and a keyboard shortcut,
  • A QRC Resource Script.

Even though this example was created with ‘Qt Creator’ and Qt version 5.7, one of the main features of Qt Creator, its GUI Layout Designer, has been cut from the project, so that the means by which such mechanisms can be set up entirely via code, can be explored better. Also, while Qt5 maintains backwards-compatibility with Qt4 -style Signals and Slots, that are based on macros, this project makes use of the newer Qt5 semantics, that are based on function pointers, for the sake of favouring new features over old.

I can say that on my Debian 9 / Stretch computer, the example works. However, the Qt Library is designed to be cross-platform, and so the example should also work under Windows. What some people have suggested is that, in order to get such code to work under OS/X, ‘ccmake’ should be used with the ‘Unix Makefiles’ generator. This will assume that ‘XCode’ is already installed. (:1)

The Link where the compressed files, containing only source code, can be found (along some other compressed files that also contain precompiled binaries, belonging to other projects) is here:

https://dirkmittler.homeip.net/binaries/

In that Gopher-Hole, the files of interest would be ‘Creator_Test2.tar.gz‘ or ‘Creator_Test2.zip‘.

Continue reading Basic Qt5 Slots, Signals and Menus Example

Maintaining My Ability to View VRML 2.0 on the Web

What some modern readers may not realize, is that even before the Shockwave Flash plug-in allowed it, and before WebGL inherited the responsibility of displaying 3D content in a Web-browser, there existed A more-straightforward way to display 3D scenes within our Web-browser, which was referred to as “VRML”.

Most browsers today lack the ability to display this format of content, but I usually make sure to custom-compile a version of the plug-in which does this, which is named “FreeWRL”.

When doing so, I need to set up the configuration of the source-tree with the following line:

 


./configure --enable-plugin --with-plugindir=/usr/lib/mozilla/plugins --with-target=motif --with-imageconvert=/usr/bin/convert --with-unzip=/usr/bin/unzip --enable-libeai --enable-docs --with-wget=/usr/bin/wget


 

And, even if I give this command, often, the Firefox plug-in will not be built, because an additional dependency which I may not have installed, would be

‘npapi-sdk-dev’

This build-dependency gives our computers the header files necessary, to compile old-fashion plug-ins, which ‘Netscape’ and ‘Firefox’ allowed as add-ons, to view additional content-types embedded within the browser. And, Mozilla recently gave notice, that they would be dropping support for this plug-in API shortly. However, ‘firefox-esr’, available under Linux, still supports this plug-in API.

What I find additionally, is that even if I get the most-recent versions of ‘FreeWRL’ to compile, the resulting program does not work correctly, and that I need to compile an older version instead.

Well on the box which I name ‘Plato’, I just recently compiled and tested v2.3.3 of ‘FreeWRL’ and found that it still works. What I was also reminded of, was that support for VRML 1.0 was dropped a long time ago, and that only VRML97 / VRML 2.0 is still supported for on-line viewing. Thus, VRML 2.0 was already defined, in 1997.

Content can still be found on the Web, even though the examples are sparse. Other examples, not linked to here, such as the NASA examples, were simply hosted on a non-NASA computer, and then abandoned, which means that most NASA VRML-links are broken links. Further, some graphics students will display their VRML-worlds, as proof that they’ve achieved some level of competency in graphics in general, but will fail to publish a URL.

screenshot_20180525_130723

 

Continue reading Maintaining My Ability to View VRML 2.0 on the Web