Qt 4.8
Classes | Macros | Functions | Variables
qtcore_eval.cpp File Reference
#include <qcoreevent.h>
#include <qdatetime.h>
#include <qlibraryinfo.h>
#include <qobject.h>
#include <qcoreapplication.h>
#include "stdio.h"
#include "stdlib.h"
#include "qconfig_eval.cpp"

Go to the source code of this file.

Classes

class  QCoreFuriCuri
 

Macros

#define KILL_DELAY   60 * 1000 * 1
 
#define WARN_TIMEOUT   60 * 1000 * 119
 

Functions

static int qt_eval_days_left ()
 
static int qt_eval_is_supported ()
 
static QString qt_eval_string ()
 

Variables

static const char boilerplate_expired []
 
static const char boilerplate_supported []
 
static const char boilerplate_unsuported []
 
static const char will_shutdown_1min []
 
static const char will_shutdown_now []
 

Macro Definition Documentation

◆ KILL_DELAY

#define KILL_DELAY   60 * 1000 * 1

Definition at line 147 of file qtcore_eval.cpp.

Referenced by QCoreFuriCuri::timerEvent().

◆ WARN_TIMEOUT

#define WARN_TIMEOUT   60 * 1000 * 119

Definition at line 146 of file qtcore_eval.cpp.

Referenced by QCoreFuriCuri::QCoreFuriCuri().

Function Documentation

◆ qt_eval_days_left()

static int qt_eval_days_left ( )
static

Definition at line 115 of file qtcore_eval.cpp.

Referenced by qt_eval_string(), and QCoreFuriCuri::timerEvent().

116 {
117  if (qt_eval_is_supported() < 0)
118  return -2;
119 
120  QDate today = QDate::currentDate();
121  QDate build = QLibraryInfo::buildDate();
122  return qMax(-1, today.daysTo(build) + 30);
123 }
int daysTo(const QDate &) const
Returns the number of days from this date to d (which is negative if d is earlier than this date)...
Definition: qdatetime.cpp:1111
The QDate class provides date functions.
Definition: qdatetime.h:55
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
static int qt_eval_is_supported()
Definition: qtcore_eval.cpp:91
static QDate currentDate()
Returns the current date, as reported by the system clock.
Definition: qdatetime.cpp:3115
static QDate buildDate()
Returns the installation date for this build of Qt.

◆ qt_eval_is_supported()

static int qt_eval_is_supported ( )
static

Definition at line 91 of file qtcore_eval.cpp.

Referenced by QCoreFuriCuri::QCoreFuriCuri(), qt_eval_days_left(), and qt_eval_string().

92 {
93  const volatile char *const license_key = qt_eval_key_data + 12;
94 
95  // fast fail
96  if (!qt_eval_key_data[0] || !*license_key)
97  return -1;
98 
99  // is this an unsupported evaluation?
100  const volatile char *typecode = license_key;
101  int field = 2;
102  for ( ; field && *typecode; ++typecode)
103  if (*typecode == '-')
104  --field;
105 
106  if (!field && typecode[1] == '4' && typecode[2] == 'M') {
107  if (typecode[0] == 'Q')
108  return 0;
109  else if (typecode[0] == 'R' || typecode[0] == 'Z')
110  return 1;
111  }
112  return -1;
113 }

◆ qt_eval_string()

static QString qt_eval_string ( )
static

Definition at line 125 of file qtcore_eval.cpp.

Referenced by QCoreFuriCuri::timerEvent().

126 {
127  const char *msg;
128  switch (qt_eval_is_supported()) {
129  case 0:
131  break;
132  case 1:
133  msg = boilerplate_supported;
134  break;
135  default:
136  return QString();
137  msg = 0;
138  }
139 
140  return QString::fromLatin1(msg)
144 }
static QString licensee()
Returns the person to whom this build of Qt is licensed.
static int qt_eval_days_left()
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
static int qt_eval_is_supported()
Definition: qtcore_eval.cpp:91
#define QT_VERSION_STR
This macro expands to a string that specifies Qt&#39;s version number (for example, "4.
Definition: qglobal.h:47
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
static const char boilerplate_unsuported[]
Definition: qtcore_eval.cpp:55
static const char boilerplate_supported[]
Definition: qtcore_eval.cpp:66

Variable Documentation

◆ boilerplate_expired

const char boilerplate_expired[]
static
Initial value:
=
"This software is using the trial version of the Qt GUI toolkit.\n"
"The trial period has expired. If you need more time to\n"
"evaluate Qt, or if you have any questions about Qt, contact us\n"
"at: http://qt.nokia.com/about/contact-us.\n\n"

Definition at line 76 of file qtcore_eval.cpp.

Referenced by QCoreFuriCuri::timerEvent().

◆ boilerplate_supported

const char boilerplate_supported[]
static
Initial value:
=
"\nQt %1 Evaluation License\n"
"Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).\n"
"All rights reserved.\n\n"
"This trial version may only be used for evaluation purposes\n"
"Registered to:\n"
" Licensee: %2\n\n"
"The evaluation expires in %4 days\n\n"
"Contact http://qt.nokia.com/about/contact-us for pricing and purchasing information.\n"

Definition at line 66 of file qtcore_eval.cpp.

Referenced by qt_eval_string().

◆ boilerplate_unsuported

const char boilerplate_unsuported[]
static
Initial value:
=
"\nQt %1 Evaluation License\n"
"Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).\n"
"All rights reserved.\n\n"
"This trial version may only be used for evaluation purposes\n"
"and will shut down after 120 minutes.\n"
"Registered to:\n"
" Licensee: %2\n\n"
"The evaluation expires in %4 days\n\n"
"Contact http://qt.nokia.com/about/contact-us for pricing and purchasing information.\n"

Definition at line 55 of file qtcore_eval.cpp.

Referenced by qt_eval_string().

◆ will_shutdown_1min

const char will_shutdown_1min[]
static
Initial value:
=
"\nThe evaluation of Qt will SHUT DOWN in 1 minute.\n"
"Contact http://qt.nokia.com/about/contact-us for pricing and purchasing information.\n"

Definition at line 82 of file qtcore_eval.cpp.

Referenced by QCoreFuriCuri::timerEvent().

◆ will_shutdown_now

const char will_shutdown_now[]
static
Initial value:
=
"\nThe evaluation of Qt has now reached its automatic\n"
"timeout and will shut down.\n"
"Contact http://qt.nokia.com/about/contact-us for pricing and purchasing information.\n"

Definition at line 86 of file qtcore_eval.cpp.

Referenced by QCoreFuriCuri::timerEvent().