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

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

Source Code  (Gui Example 33)

Posted on October 20, 2022November 3, 2022 By Barbara Geller

This example shows how to use low level drawing methods to create an ellipse, rounded rectangle, or a path shape and then set the pen to draw the border and the brush for the fill characteristics.

Uncategorized

Source Code  (Gui Example 32)

Posted on October 14, 2022November 3, 2022 By Barbara Geller

This example demonstrates how to use low level drawing methods to create a polygon shape and then set the pen to draw the border and the brush for the fill characteristics.

Uncategorized

Source Code  (Gui Example 31)

Posted on August 22, 2022August 29, 2022 By Barbara Geller

A common practice in a GUI application is the ability to press the tab key and move from one widget to another in some logical sequence. The tab ordering is initially set to mimic the order widgets are created. However, this might not match the tab order users expect. Let’s look at how we can create several widgets and then adjust the tab sequence, without rearranging the widget constructors.

Uncategorized

Source Code  (Gui Example 30)

Posted on August 5, 2022August 13, 2022 By Barbara Geller

A status message can be displayed on the bottom of a GUI main window. If the message is designated as “temporary” or only intended to be shown for a given time interval, it is displayed on the left side of the status bar. If the message is “permanent”, like showing the current line and column number in a document, this will be shown on the right side of the status bar and always visible.

Uncategorized

Source Code  (Gui Example 29)

Posted on July 21, 2022August 13, 2022 By Barbara Geller

The “What’s This” feature can be used to provide additional information about a menu option, push buttons or other widgets. This example adds “What’s This” help and also shows how to add a special question mark icon to a menu item and the tool bar for easy access to this feature.

Uncategorized

Source Code  (Gui Example 28)

Posted on July 11, 2022July 21, 2022 By Barbara Geller

A tool tip provides a hint or relevant additional information about the current object. In this example tool tips are added for several actions and the push buttons located on the central window. The hint will be displayed when the user hovers the mouse over the corresponding toolbar item or push button.

Uncategorized

Source Code  (Gui Example 27)

Posted on June 29, 2022July 4, 2022 By Barbara Geller

In this example a tool bar is added to a user application. A tool bar typically contains the most commonly used menu items. The same actions and icons used for the menu will be used on the tool bar.

Uncategorized

Source Code  (Gui Example 26)

Posted on June 20, 2022July 3, 2022 By Barbara Geller

This example will show how to create a user application which contains a top level menu. Adding a menu bar with icons and shortcuts is the next step in creating a graphical application.

Uncategorized

Source Code  (Gui Example 25)

Posted on June 7, 2022June 8, 2022 By Barbara Geller

This example uses a QTreeView with the QFileSystemModel to display the structure of a file system.

Uncategorized

Source Code  (Gui Example 24)

Posted on May 30, 2022May 31, 2022 By Barbara Geller

A QTreeView arranges a group of data elements based on a parent-child relationship. Top level items can be empty or have child items. Items which do have children can be expanded or collapsed and the child elements will be displayed or hidden. The QStandardItemModel will be used to store the data.

Uncategorized

Source Code  (Gui Example 23)

Posted on May 23, 2022May 30, 2022 By Barbara Geller

The QTableView class is used to display multiple rows and columns of data. This view makes sense when the data resides in a multi-dimensional container or a database. Since our data is stored in an SQL table we will use the QSqlTableModel to populate the view.

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-2022 CopperSpice