Fix a runtime error on Linux.
Hiroyuki Komatsu
3 years ago
42 | 42 |
namespace gui {
|
43 | 43 |
|
44 | 44 |
// static
|
45 | |
std::unique_ptr<QApplication> Util::InitQt(int argc, char *argv[]) {
|
|
45 |
std::unique_ptr<QApplication> Util::InitQt(int &argc, char *argv[]) {
|
46 | 46 |
QApplication::setStyle(QStyleFactory::create("fusion"));
|
47 | 47 |
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
48 | 48 |
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
49 | 49 |
#endif
|
50 | 50 |
|
|
51 |
// QApplication takes argc as a reference.
|
51 | 52 |
auto app = absl::make_unique<QApplication>(argc, argv);
|
52 | 53 |
#ifdef __APPLE__
|
53 | 54 |
app->setFont(QFont("Hiragino Sans"));
|
40 | 40 |
class Util {
|
41 | 41 |
public:
|
42 | 42 |
// Initializes the common Qt cofiguration such as High DPI, font, and theme.
|
43 | |
static std::unique_ptr<QApplication> InitQt(int argc, char *argv[]);
|
|
43 |
// The type of argc is a reference.
|
|
44 |
static std::unique_ptr<QApplication> InitQt(int &argc, char *argv[]);
|
44 | 45 |
|
45 | 46 |
// Returns the product name.
|
46 | 47 |
static const QString ProductName();
|