Skip to content

CopperSpice Journal

CopperSpice Journal

Welcome to the CopperSpice Journal

Posted on December 20, 2021December 4, 2022 By Barbara Geller Featured

The purpose of this journal is to show a series of short examples which will provide C++ developers with a general understanding about how to use the open source CopperSpice libraries.

Article summaries are displayed with the newest one listed first. Our initial article shows how to set up your working environment and then build or install CopperSpice.   [ more . . . ]

Uncategorized

Moving to C++20

Posted on February 5, 2025April 1, 2025 By Barbara Geller

The CopperSpice libraries are migrating to C++20 to leverage new and enhanced functionality in the core language. The build files for all projects which link with CopperSpice 2.0 or newer must be modified to specify which standard to use when compiling.

The build file for all prior examples in this Journal require one minor change as explained in this article.

Uncategorized

Source Code  (Gui Example 47)

Posted on September 16, 2024September 20, 2024 By Barbara Geller

The QDir class can be used to retrieve information about a given path, delete or rename a file, query if a given path exists, and more. This example will explain the difference between a QDir absolute path and a canonical path.

Uncategorized

Source Code  (Gui Example 46)

Posted on July 26, 2024August 4, 2024 By Barbara Geller

Text is often displayed using a QLabel or QTextEdit widget. If you want more control over how the text is drawn to the screen or the printer, consider using QPainter in a custom widget.

Uncategorized

Source Code  (Gui Example 45)

Posted on May 31, 2024June 9, 2024 By Barbara Geller

A widget which provides a defined list of values is referred to as a combo box and contains a line edit field and a drop down list. The idea of a combo box is to provide a graphical interface for users to select an item from a restricted set of options. The purpose of this example is to explain how to display a subset of the values based on some criteria.

Uncategorized

Console Output (Example 44)

Posted on April 30, 2024May 6, 2024 By Barbara Geller

Debug and warning messages can be sent to a separate window which is independent of the application main window. This is normally used for testing or debugging purposes. The information in this post explains how to enable the console output for a CopperSpice application.

Uncategorized

Source Code  (Gui Example 43)

Posted on March 29, 2024April 1, 2024 By Barbara Geller

Expanding upon the prior example, let’s look at how to receive and parse user command line arguments. This application will show how to use a GUI window to display the auto generated help text or the program version number, based on the passed arguments from the user.

Uncategorized

Source Code  (Gui Example 42)

Posted on February 29, 2024March 27, 2024 By Barbara Geller

In this example the command line is retrieved and the arguments passed by the user are displayed. Two extra positional arguments are added by the program to demonstrate the QCommandLineParser class.

Uncategorized

Source Code  (Gui Example 41)

Posted on January 31, 2024February 8, 2024 By Barbara Geller

This example demonstrates how to find the operating system name and version where the application is currently running. Macros are used to isolate the platform specific source code.

Uncategorized

Source Code  (Gui Example 40)

Posted on June 8, 2023January 11, 2024 By Barbara Geller

Countries and various areas around the world have different formatting conventions for fields like dates, times, numbers, and currency. The set of rules used in a particular region or associated with a specific language is called a locale. The QLocale class is used to format data based on the combination of a given language or country.

Uncategorized

Source Code  (Gui Example 39)

Posted on May 11, 2023May 25, 2023 By Barbara Geller

A regular expression is a sequence of characters which defines a search pattern. It is used to search, extract, or replace text in an existing string. This example contains a few different ways to use the QRegularExpression class.

Uncategorized

Source Code  (Gui Example 38)

Posted on April 14, 2023April 16, 2023 By Barbara Geller

The QStringParser class provides a variety of methods to process strings of text. This example will show how to use split() and formatArg().

Uncategorized

Source Code  (Gui Example 37)

Posted on February 24, 2023February 27, 2023 By Barbara Geller

Although English is one of the most common languages, a well designed user interface should be shown using the language most appropriate for the user. CopperSpice provides built in support for text translations. This example will show how to switch between English and German text at run time by using an external translation file.

Uncategorized

Source Code  (Gui Example 36)

Posted on February 3, 2023February 7, 2023 By Barbara Geller

A GUI layout will typically contain multiple widgets which have a fixed position and a fixed size. The QSplitter class adds functionality for the user to modify the size of any child widgets, by dragging the boundary located between the controls.

Uncategorized

Source Code  (Gui Example 35)

Posted on December 27, 2022December 31, 2022 By Barbara Geller

This example shows how to create a resource file which contains a list of various file names which will be embedded in your application. When the executable is created the files listed in the resource file are bundled into the executable. The original files, which are now embedded, do not need to be distributed with the binary. The most common type of files include images, text, icons, and translation files.

Uncategorized

Source Code  (Gui Example 34)

Posted on November 29, 2022December 12, 2022 By Barbara Geller

The program for this example displays a plain TextEdit widget which contains source code. Portions of the text are highlighted in various colors using the GUI syntax highlighting class.

Uncategorized

Posts navigation

1 2 … 4 Next
  • CopperSpice Journal Homepage
    • Table of Contents
    • Example Source Code
    • Discussion Forum
  • CopperSpice Homepage
  • Github Repository
  • Videos About C++

Copyright © 2021-2025 CopperSpice