Mercurial > octave
comparison libgui/src/qt-application.cc @ 31613:c6683fcc5c33
allow qt_application ctor to set Qt organization, application, and version
* qt-application.h, qt-application.cc (qt_application::qt_application):
New constructor that accepts organization and application names and
version string. Set values in QtCoreApplication object.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 02 Dec 2022 08:57:06 -0500 |
parents | 796f54d4ddbf |
children | 59c9da7c43d6 |
comparison
equal
deleted
inserted
replaced
31612:351a4c8e92c3 | 31613:c6683fcc5c33 |
---|---|
40 #include "octave.h" | 40 #include "octave.h" |
41 #include "sysdep.h" | 41 #include "sysdep.h" |
42 | 42 |
43 namespace octave | 43 namespace octave |
44 { | 44 { |
45 qt_application::qt_application (const std::string& organization_name, | |
46 const std::string& application_name, | |
47 const std::string& application_version, | |
48 int argc, char **argv) | |
49 : application (argc, argv) | |
50 { | |
51 if (! organization_name.empty ()) | |
52 QCoreApplication::setOrganizationName | |
53 (QString::fromStdString (organization_name)); | |
54 | |
55 if (! application_name.empty ()) | |
56 QCoreApplication::setApplicationName | |
57 (QString::fromStdString (application_name)); | |
58 | |
59 if (! application_version.empty ()) | |
60 QCoreApplication::setApplicationVersion | |
61 (QString::fromStdString (application_version)); | |
62 | |
63 // This should probably happen early. | |
64 sysdep_init (); | |
65 } | |
66 | |
45 qt_application::qt_application (int argc, char **argv) | 67 qt_application::qt_application (int argc, char **argv) |
46 : application (argc, argv) | 68 : application (argc, argv) |
47 { | 69 { |
48 // This should probably happen early. | 70 // This should probably happen early. |
49 sysdep_init (); | 71 sysdep_init (); |