Posted inInformation Technology / Raspberry Pi

How Far We’ve Come – Pt. 17

On the desktop most of the application looks like this:

main screen image
Main screen
import file chooser image
Import File Chooser
entry screen image
Entry Screen
all drawings report image
All Drawings Report

One of the many things which is nice about widget based projects and the designer is that we get some really good widgets and can (usually) see what things will look like before we compile. That file chooser is all built in and the calendar select widget is already there for us to use.

 

void MainWindow::importAction()
{
    QString fileName = QFileDialog::getOpenFileName(this, tr("Lotto Data to Import"), QDir::current().dirName(),
                                                    tr("Text Files (*.txt *.csv)"));

    if (fileName.length() > 0)
    {
        showImportFields(true);

        dbIO.importData(fileName);
    }
}

That one line in bold is all I needed to toss up the fully functional dialog. For those unfamiliar with tr(), Qt has an awful lot of language translation capabilities built in. You are encouraged to use tr() around strings whenever your shop hasn’t moved to translation IDs. I’m really bad about not using tr() in my own stuff. In truth it is because so many projects wait until the end.

Why not? You need to have a final full code review anyway. Unless you are allowing for user selected language rather than OS or environment variable selection it’s a small thing. On one project, when we got to the bug fixing stage, one of the developers wrote a quick shell script which searched through the files for anything in double quotes and dumped it into a spreadsheet file along with source file name, line number and other info and we fed it to the translation team.

A few weeks later we received the first cut from translation and that same person spent one hour integrating the translations. The QA team found the spots where the same thing should have been translated two different ways due to context and we went from there.

As soon as I get some more time I will return to the 6-core AMD and see what else I need to install to cross compile this application for my Raspberry Pi. I’m torn between showing you the way you will probably try on your own and the “recommended” way.

The cheat method many try is to install the precompiled version from the Raspbian repos on both. Since I have a shiny new SD card, I will most likely start clean via the recommended way. Still haven’t decided. As I said near the beginning of this I typically join a project once system setup has been both decided and documented. On FDA regulated projects it is mandatory to have a cookie cutter configuration document.

EDIT:

Ooops, thanks for the reminder. Here is the source.

lottoTracker

Sorry about forgetting to post it.

<Previous-part Next-part>

Related Posts:

QT Database book

AGILE book

Where Did My QDebug Output Go?

MOC Parse Error at “std”

KDE Neon – Distcc and Qt

CopperSpice Experiments

QtCreator – No qmlScene installed

So You Can’t Get Your Models to Work with QML?

Roland Hughes started his IT career in the early 1980s. He quickly became a consultant and president of Logikal Solutions, a software consulting firm specializing in OpenVMS application and C++/Qt touchscreen/embedded Linux development. Early in his career he became involved in what is now called cross platform development. Given the dearth of useful books on the subject he ventured into the world of professional author in 1995 writing the first of the "Zinc It!" book series for John Gordon Burke Publisher, Inc.

A decade later he released a massive (nearly 800 pages) tome "The Minimum You Need to Know to Be an OpenVMS Application Developer" which tried to encapsulate the essential skills gained over what was nearly a 20 year career at that point. From there "The Minimum You Need to Know" book series was born.

Three years later he wrote his first novel "Infinite Exposure" which got much notice from people involved in the banking and financial security worlds. Some of the attacks predicted in that book have since come to pass. While it was not originally intended to be a trilogy, it became the first book of "The Earth That Was" trilogy:
Infinite Exposure
Lesedi - The Greatest Lie Ever Told
John Smith - Last Known Survivor of the Microsoft Wars

When he is not consulting Roland Hughes posts about technology and sometimes politics on his blog. He also has regularly scheduled Sunday posts appearing on the Interesting Authors blog.