source: trunk/src/tools/uic/main.cpp@ 173

Last change on this file since 173 was 88, checked in by Dmitry A. Kuminov, 16 years ago

build: Enabled uic; disabled scripttools plugins modules (dependencies are not yet ready).

File size: 7.2 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
5**
6** This file is part of the tools applications of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file. Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
23** In addition, as a special exception, Nokia gives you certain
24** additional rights. These rights are described in the Nokia Qt LGPL
25** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26** package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you are unsure which license is appropriate for your use, please
37** contact the sales department at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#include "uic.h"
43#include "option.h"
44#include "driver.h"
45#include "../../corelib/global/qconfig.cpp"
46#include <QtCore/QFile>
47#include <QtCore/QDir>
48#include <QtCore/QTextStream>
49#include <QtCore/QTextCodec>
50
51QT_BEGIN_NAMESPACE
52
53static const char *error = 0;
54
55void showHelp(const char *appName)
56{
57 fprintf(stderr, "Qt User Interface Compiler version %s\n", QT_VERSION_STR);
58 if (error)
59 fprintf(stderr, "%s: %s\n", appName, error);
60
61 fprintf(stderr, "Usage: %s [options] <uifile>\n\n"
62 " -h, -help display this help and exit\n"
63 " -v, -version display version\n"
64 " -d, -dependencies display the dependencies\n"
65 " -o <file> place the output into <file>\n"
66 " -tr <func> use func() for i18n\n"
67 " -p, -no-protection disable header protection\n"
68 " -n, -no-implicit-includes disable generation of #include-directives\n"
69 " for forms generated by uic3\n"
70 " -g <name> change generator\n"
71 "\n", appName);
72}
73
74int runUic(int argc, char *argv[])
75{
76 Driver driver;
77
78 const char *fileName = 0;
79
80 int arg = 1;
81 while (arg < argc) {
82 QString opt = QString::fromLocal8Bit(argv[arg]);