diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-12-26 21:13:18 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2015-07-14 20:01:11 (GMT) |
commit | 333c7c44f1aa3c62f9401b190e45eaff15056d5c (patch) | |
tree | 254eee541a9f98d560667a05a3222d2f0a921e3e /addon | |
parent | c33e03f3cb9f0ae1c00b7e785964c915f4085fe0 (diff) | |
download | Doxygen-333c7c44f1aa3c62f9401b190e45eaff15056d5c.zip Doxygen-333c7c44f1aa3c62f9401b190e45eaff15056d5c.tar.gz Doxygen-333c7c44f1aa3c62f9401b190e45eaff15056d5c.tar.bz2 |
Make doxywizard compatible with Qt5
Diffstat (limited to 'addon')
-rw-r--r-- | addon/doxywizard/CMakeLists.txt | 46 | ||||
-rw-r--r-- | addon/doxywizard/config_doxyw.l | 71 | ||||
-rw-r--r-- | addon/doxywizard/doxywizard.cpp | 97 | ||||
-rw-r--r-- | addon/doxywizard/expert.cpp | 73 | ||||
-rw-r--r-- | addon/doxywizard/inputbool.cpp | 20 | ||||
-rw-r--r-- | addon/doxywizard/inputint.cpp | 9 | ||||
-rw-r--r-- | addon/doxywizard/inputstring.cpp | 25 | ||||
-rw-r--r-- | addon/doxywizard/inputstrlist.cpp | 29 | ||||
-rw-r--r-- | addon/doxywizard/wizard.cpp | 118 |
9 files changed, 302 insertions, 186 deletions
diff --git a/addon/doxywizard/CMakeLists.txt b/addon/doxywizard/CMakeLists.txt index d81d2e0..eb97388 100644 --- a/addon/doxywizard/CMakeLists.txt +++ b/addon/doxywizard/CMakeLists.txt @@ -1,5 +1,40 @@ if (build_wizard) +# search for Qt5 +if (NOT force_qt4) + find_package(Qt5Core QUIET) + if (Qt5Core_FOUND) + message(STATUS "Using Qt5") + find_package(Qt5 COMPONENTS Widgets Gui Xml) + macro(qt_use_modules) + qt5_use_modules(${ARGN}) + endmacro() + macro(qt_wrap_cpp) + qt5_wrap_cpp(${ARGN}) + endmacro() + macro(qt_add_resources) + qt5_add_resources(${ARGN}) + endmacro() + endif() +endif() +# fallback to Qt4 +if (NOT Qt5Core_FOUND) + if (NOT force_qt4) + message(STATUS "Qt5 not found, searching for Qt4 instead...") + else() + message(STATUS "Using Qt4") + endif() + find_package(Qt4 REQUIRED COMPONENTS QtCore QtXml QtGui) + macro(qt_use_modules) + endmacro() + macro(qt_wrap_cpp) + qt4_wrap_cpp(${ARGN}) + endmacro() + macro(qt_add_resources) + qt4_add_resources(${ARGN}) + endmacro() +endif() + include_directories( . ${CMAKE_SOURCE_DIR}/src @@ -11,9 +46,9 @@ set(GENERATED_SRC_WIZARD ${GENERATED_SRC}/doxywizard) file(MAKE_DIRECTORY ${GENERATED_SRC_WIZARD}) add_definitions(-DQT_ARCH_X86_64 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DUNICODE) -set(QT_USE_QTXML TRUE) -find_package(Qt4 REQUIRED) -include(${QT_USE_FILE}) +if (NOT Qt5Core_FOUND) + include(${QT_USE_FILE}) +endif() # generate settings.h file(GENERATE OUTPUT ${GENERATED_SRC_WIZARD}/settings.h @@ -43,7 +78,7 @@ set_source_files_properties(${GENERATED_SRC_WIZARD}/configdoc.cpp PROPERTIES GEN FLEX_TARGET(config_doxyw config_doxyw.l ${GENERATED_SRC_WIZARD}/config_doxyw.cpp COMPILE_FLAGS "-Pconfig_doxywYY") -QT4_WRAP_CPP(doxywizard_MOC +qt_wrap_cpp(doxywizard_MOC doxywizard.h expert.h helplabel.h @@ -54,7 +89,7 @@ inputstrlist.h wizard.h ) -QT4_ADD_RESOURCES(doxywizard_RESOURCES_RCC doxywizard.qrc) +qt_add_resources(doxywizard_RESOURCES_RCC doxywizard.qrc) add_executable(doxywizard WIN32 doxywizard.cpp @@ -71,6 +106,7 @@ ${GENERATED_SRC_WIZARD}/configdoc.cpp ${doxywizard_MOC} ${doxywizard_RESOURCES_RCC} ) +qt_use_modules(doxywizard Core Gui Widgets Xml) target_link_libraries(doxywizard ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ) diff --git a/addon/doxywizard/config_doxyw.l b/addon/doxywizard/config_doxyw.l index 829f807..90bd09e 100644 --- a/addon/doxywizard/config_doxyw.l +++ b/addon/doxywizard/config_doxyw.l @@ -20,7 +20,16 @@ */ #include "config.h" #include "input.h" -#include <QtCore> + +#include <QString> +#include <QVariant> +#include <QStack> +#include <QTextCodec> +#include <QByteArray> +#include <QFileInfo> +#include <QStringList> +#include <QRegExp> +#include <QTextStream> #define YY_NO_UNISTD_H 1 @@ -52,7 +61,7 @@ static QVariant *g_arg; static Input *g_curOption=0; static QString g_elemStr; static QTextCodec *g_codec = QTextCodec::codecForName("UTF-8"); -static QString g_codecName = QString::fromAscii("UTF-8"); +static QString g_codecName = QString::fromLatin1("UTF-8"); static int g_lastState; static QByteArray g_tmpString; @@ -74,13 +83,13 @@ static int yyread(char *buf,int maxSize) } } -static QString warning_str = QString::fromAscii("warning: "); -static QString error_str = QString::fromAscii("error: "); +static QString warning_str = QString::fromLatin1("warning: "); +static QString error_str = QString::fromLatin1("error: "); void config_err(const char *fmt, ...) { QString msg = error_str; - msg.append(QString::fromAscii(fmt)); + msg.append(QString::fromLatin1(fmt)); va_list args; va_start(args, fmt); vfprintf(stderr, qPrintable(msg), args); @@ -89,7 +98,7 @@ void config_err(const char *fmt, ...) void config_warn(const char *fmt, ...) { QString msg = warning_str; - msg.append(QString::fromAscii(fmt)); + msg.append(QString::fromLatin1(fmt)); va_list args; va_start(args, fmt); vfprintf(stderr, qPrintable(msg), args); @@ -101,10 +110,10 @@ static void substEnvVarsInString(QString &s); static void checkEncoding() { - Input *option = g_options->value(QString::fromAscii("DOXYFILE_ENCODING")); + Input *option = g_options->value(QString::fromLatin1("DOXYFILE_ENCODING")); if (option && option->value().toString()!=g_codecName) { - QTextCodec *newCodec = QTextCodec::codecForName(option->value().toString().toAscii()); + QTextCodec *newCodec = QTextCodec::codecForName(option->value().toString().toLatin1()); if (newCodec) { g_codec = newCodec; @@ -115,7 +124,7 @@ static void checkEncoding() static FILE *tryPath(const QString &path,const QString &fileName) { - QString absName=!path.isEmpty() ? path+QString::fromAscii("/")+fileName : fileName; + QString absName=!path.isEmpty() ? path+QString::fromLatin1("/")+fileName : fileName; QFileInfo fi(absName); if (fi.exists() && fi.isFile()) { @@ -144,7 +153,7 @@ static FILE *findFile(const QString &fileName) if (f) return f; } // try cwd if g_includePathList fails - return tryPath(QString::fromAscii("."),fileName); + return tryPath(QString::fromLatin1("."),fileName); } static void readIncludeFile(const QString &incName) @@ -160,8 +169,8 @@ static void readIncludeFile(const QString &incName) substEnvVarsInString(inc); inc = inc.trimmed(); uint incLen = inc.length(); - if (inc.at(0)==QChar::fromAscii('"') && - inc.at(incLen-1)==QChar::fromAscii('"')) // strip quotes + if (inc.at(0)==QChar::fromLatin1('"') && + inc.at(incLen-1)==QChar::fromLatin1('"')) // strip quotes { inc=inc.mid(1,incLen-2); } @@ -383,7 +392,7 @@ static void readIncludeFile(const QString &incName) static void substEnvVarsInString(QString &s) { - static QRegExp re(QString::fromAscii("\\$\\([a-z_A-Z0-9]+\\)")); + static QRegExp re(QString::fromLatin1("\\$\\([a-z_A-Z0-9]+\\)")); if (s.isEmpty()) return; int p=0; int i,l; @@ -409,8 +418,8 @@ static void substEnvVarsInStrList(QStringList &sl) foreach (QString result, sl) { // an argument with quotes will have an extra space at the end, so wasQuoted will be TRUE. - bool wasQuoted = (result.indexOf(QChar::fromAscii(' '))!=-1) || - (result.indexOf(QChar::fromAscii('\t'))!=-1); + bool wasQuoted = (result.indexOf(QChar::fromLatin1(' '))!=-1) || + (result.indexOf(QChar::fromLatin1('\t'))!=-1); // here we strip the quote again substEnvVarsInString(result); @@ -430,33 +439,33 @@ static void substEnvVarsInStrList(QStringList &sl) { QChar c=0; // skip until start of new word - while (i<l && ((c=result.at(i))==QChar::fromAscii(' ') || c==QChar::fromAscii('\t'))) i++; + while (i<l && ((c=result.at(i))==QChar::fromLatin1(' ') || c==QChar::fromLatin1('\t'))) i++; p=i; // p marks the start index of the word // skip until end of a word - while (i<l && ((c=result.at(i))!=QChar::fromAscii(' ') && - c!=QChar::fromAscii('\t') && - c!=QChar::fromAscii('"'))) i++; + while (i<l && ((c=result.at(i))!=QChar::fromLatin1(' ') && + c!=QChar::fromLatin1('\t') && + c!=QChar::fromLatin1('"'))) i++; if (i<l) // not at the end of the string { - if (c==QChar::fromAscii('"')) // word within quotes + if (c==QChar::fromLatin1('"')) // word within quotes { p=i+1; for (i++;i<l;i++) { c=result.at(i); - if (c==QChar::fromAscii('"')) // end quote + if (c==QChar::fromLatin1('"')) // end quote { out += result.mid(p,i-p); p=i+1; break; } - else if (c==QChar::fromAscii('\\')) // skip escaped stuff + else if (c==QChar::fromLatin1('\\')) // skip escaped stuff { i++; } } } - else if (c==QChar::fromAscii(' ') || c==QChar::fromAscii('\t')) // separator + else if (c==QChar::fromLatin1(' ') || c==QChar::fromLatin1('\t')) // separator { out += result.mid(p,i-p); p=i+1; @@ -529,7 +538,7 @@ bool parseConfig( void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s) { QChar c; - bool needsEscaping=FALSE; + bool needsEscaping=false; // convert the string back to it original encoding //QByteArray se = codec->fromUnicode(s); t.setCodec(codec); @@ -538,10 +547,10 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s) { while (!(c=*p++).isNull() && !needsEscaping) { - needsEscaping = (c==QChar::fromAscii(' ') || - c==QChar::fromAscii('\n') || - c==QChar::fromAscii('\t') || - c==QChar::fromAscii('"')); + needsEscaping = (c==QChar::fromLatin1(' ') || + c==QChar::fromLatin1('\n') || + c==QChar::fromLatin1('\t') || + c==QChar::fromLatin1('"')); } if (needsEscaping) { @@ -549,9 +558,9 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s) p=s.data(); while (!p->isNull()) { - if (*p ==QChar::fromAscii(' ') && - *(p+1)==QChar::fromAscii('\0')) break; // skip inserted space at the end - if (*p ==QChar::fromAscii('"')) t << "\\"; // escape quotes + if (*p ==QChar::fromLatin1(' ') && + *(p+1)==QChar::fromLatin1('\0')) break; // skip inserted space at the end + if (*p ==QChar::fromLatin1('"')) t << "\\"; // escape quotes t << *p++; } t << "\""; diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index 4c577cd..e292d0c 100644 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -1,9 +1,28 @@ -#include <QtGui> #include "doxywizard.h" #include "version.h" #include "expert.h" #include "wizard.h" +#include <QMenu> +#include <QMenuBar> +#include <QPushButton> +#include <QMessageBox> +#include <QVBoxLayout> +#include <QLineEdit> +#include <QLabel> +#include <QTextEdit> +#include <QStatusBar> +#include <QProcess> +#include <QTimer> +#include <QCloseEvent> +#include <QApplication> +#include <QDir> +#include <QFileDialog> +#include <QDesktopServices> +#include <QUrl> +#include <QTextStream> +#include <QDebug> + #ifdef WIN32 #include <windows.h> #endif @@ -19,7 +38,7 @@ MainWindow &MainWindow::instance() } MainWindow::MainWindow() - : m_settings(QString::fromAscii("Doxygen.org"), QString::fromAscii("Doxywizard")) + : m_settings(QString::fromLatin1("Doxygen.org"), QString::fromLatin1("Doxywizard")) { QMenu *file = menuBar()->addMenu(tr("File")); file->addAction(tr("Open..."), @@ -84,7 +103,7 @@ MainWindow::MainWindow() QGridLayout *grid = new QGridLayout; m_outputLog = new QTextEdit; m_outputLog->setReadOnly(true); - m_outputLog->setFontFamily(QString::fromAscii("courier")); + m_outputLog->setFontFamily(QString::fromLatin1("courier")); m_outputLog->setMinimumWidth(600); grid->addWidget(m_outputLog,0,0); grid->setColumnStretch(0,1); @@ -183,16 +202,16 @@ void MainWindow::updateWorkingDir() void MainWindow::manual() { - QDesktopServices::openUrl(QUrl(QString::fromAscii("http://www.doxygen.org/manual.html"))); + QDesktopServices::openUrl(QUrl(QString::fromLatin1("http://www.doxygen.org/manual.html"))); } void MainWindow::about() { QString msg; QTextStream t(&msg,QIODevice::WriteOnly); - t << QString::fromAscii("<qt><center>A tool to configure and run doxygen version ")+ - QString::fromAscii(versionString)+ - QString::fromAscii(" on your source files.</center><p><br>" + t << QString::fromLatin1("<qt><center>A tool to configure and run doxygen version ")+ + QString::fromLatin1(versionString)+ + QString::fromLatin1(" on your source files.</center><p><br>" "<center>Written by<br> Dimitri van Heesch<br>© 2000-2015</center><p>" "</qt>"); QMessageBox::about(this,tr("Doxygen GUI"),msg); @@ -273,7 +292,7 @@ bool MainWindow::saveConfig() bool MainWindow::saveConfigAs() { QString fileName = QFileDialog::getSaveFileName(this, QString(), - m_workingDir->text()+QString::fromAscii("/Doxyfile")); + m_workingDir->text()+QString::fromLatin1("/Doxyfile")); if (fileName.isEmpty()) return false; saveConfig(fileName); return true; @@ -289,7 +308,7 @@ void MainWindow::makeDefaults() { //printf("MainWindow:makeDefaults()\n"); m_expert->saveSettings(&m_settings); - m_settings.setValue(QString::fromAscii("wizard/loadsettings"), true); + m_settings.setValue(QString::fromLatin1("wizard/loadsettings"), true); m_settings.sync(); } } @@ -306,7 +325,7 @@ void MainWindow::clearRecent() m_recentFiles.clear(); for (int i=0;i<MAX_RECENT_FILES;i++) { - m_settings.setValue(QString().sprintf("recent/config%d",i++),QString::fromAscii("")); + m_settings.setValue(QString().sprintf("recent/config%d",i++),QString::fromLatin1("")); } m_settings.sync(); } @@ -323,7 +342,7 @@ void MainWindow::resetToDefaults() { //printf("MainWindow:resetToDefaults()\n"); m_expert->resetToDefaults(); - m_settings.setValue(QString::fromAscii("wizard/loadsettings"), false); + m_settings.setValue(QString::fromLatin1("wizard/loadsettings"), false); m_settings.sync(); m_wizard->refresh(); } @@ -331,11 +350,11 @@ void MainWindow::resetToDefaults() void MainWindow::loadSettings() { - QVariant geometry = m_settings.value(QString::fromAscii("main/geometry"), QVariant::Invalid); - QVariant state = m_settings.value(QString::fromAscii("main/state"), QVariant::Invalid); - QVariant wizState = m_settings.value(QString::fromAscii("wizard/state"), QVariant::Invalid); - QVariant loadSettings = m_settings.value(QString::fromAscii("wizard/loadsettings"), QVariant::Invalid); - QVariant workingDir = m_settings.value(QString::fromAscii("wizard/workingdir"), QVariant::Invalid); + QVariant geometry = m_settings.value(QString::fromLatin1("main/geometry"), QVariant::Invalid); + QVariant state = m_settings.value(QString::fromLatin1("main/state"), QVariant::Invalid); + QVariant wizState = m_settings.value(QString::fromLatin1("wizard/state"), QVariant::Invalid); + QVariant loadSettings = m_settings.value(QString::fromLatin1("wizard/loadsettings"), QVariant::Invalid); + QVariant workingDir = m_settings.value(QString::fromLatin1("wizard/workingdir"), QVariant::Invalid); if (geometry !=QVariant::Invalid) restoreGeometry(geometry.toByteArray()); if (state !=QVariant::Invalid) restoreState (state.toByteArray()); @@ -362,12 +381,12 @@ void MainWindow::loadSettings() void MainWindow::saveSettings() { - QSettings settings(QString::fromAscii("Doxygen.org"), QString::fromAscii("Doxywizard")); + QSettings settings(QString::fromLatin1("Doxygen.org"), QString::fromLatin1("Doxywizard")); - m_settings.setValue(QString::fromAscii("main/geometry"), saveGeometry()); - m_settings.setValue(QString::fromAscii("main/state"), saveState()); - m_settings.setValue(QString::fromAscii("wizard/state"), m_wizard->saveState()); - m_settings.setValue(QString::fromAscii("wizard/workingdir"), m_workingDir->text()); + m_settings.setValue(QString::fromLatin1("main/geometry"), saveGeometry()); + m_settings.setValue(QString::fromLatin1("main/state"), saveState()); + m_settings.setValue(QString::fromLatin1("wizard/state"), m_wizard->saveState()); + m_settings.setValue(QString::fromLatin1("wizard/workingdir"), m_workingDir->text()); } void MainWindow::selectTab(int id) @@ -405,7 +424,7 @@ void MainWindow::addRecentFile(const QString &fileName) } for (;i<MAX_RECENT_FILES;i++) { - m_settings.setValue(QString().sprintf("recent/config%d",i++),QString::fromAscii("")); + m_settings.setValue(QString().sprintf("recent/config%d",i++),QString::fromLatin1("")); } } @@ -423,19 +442,19 @@ void MainWindow::runDoxygen() { QString doxygenPath; #if defined(Q_OS_MACX) - doxygenPath = qApp->applicationDirPath()+QString::fromAscii("/../Resources/"); + doxygenPath = qApp->applicationDirPath()+QString::fromLatin1("/../Resources/"); qDebug() << tr("Doxygen path: ") << doxygenPath; - if ( !QFile(doxygenPath + QString::fromAscii("doxygen")).exists() ) + if ( !QFile(doxygenPath + QString::fromLatin1("doxygen")).exists() ) { // No Doxygen binary in the resources, if there is a system Doxygen binary, use that instead - if ( QFile(QString::fromAscii("/usr/local/bin/doxygen")).exists() ) + if ( QFile(QString::fromLatin1("/usr/local/bin/doxygen")).exists() ) { - doxygenPath = QString::fromAscii("/usr/local/bin/"); + doxygenPath = QString::fromLatin1("/usr/local/bin/"); } else { qDebug() << tr("Can't find the doxygen command, make sure it's in your $$PATH"); - doxygenPath = QString::fromAscii(""); + doxygenPath = QString::fromLatin1(""); } } qDebug() << tr("Getting doxygen from: ") << doxygenPath; @@ -446,20 +465,20 @@ void MainWindow::runDoxygen() m_runProcess->setWorkingDirectory(m_workingDir->text()); QStringList env=QProcess::systemEnvironment(); // set PWD environment variable to m_workingDir - env.replaceInStrings(QRegExp(QString::fromAscii("^PWD=(.*)"),Qt::CaseInsensitive), - QString::fromAscii("PWD=")+m_workingDir->text()); + env.replaceInStrings(QRegExp(QString::fromLatin1("^PWD=(.*)"),Qt::CaseInsensitive), + QString::fromLatin1("PWD=")+m_workingDir->text()); m_runProcess->setEnvironment(env); QStringList args; - args << QString::fromAscii("-b"); // make stdout unbuffered - args << QString::fromAscii("-"); // read config from stdin + args << QString::fromLatin1("-b"); // make stdout unbuffered + args << QString::fromLatin1("-"); // read config from stdin m_outputLog->clear(); - m_runProcess->start(doxygenPath + QString::fromAscii("doxygen"), args); + m_runProcess->start(doxygenPath + QString::fromLatin1("doxygen"), args); if (!m_runProcess->waitForStarted()) { - m_outputLog->append(QString::fromAscii("*** Failed to run doxygen\n")); + m_outputLog->append(QString::fromLatin1("*** Failed to run doxygen\n")); return; } QTextStream t(m_runProcess); @@ -468,7 +487,7 @@ void MainWindow::runDoxygen() if (m_runProcess->state() == QProcess::NotRunning) { - m_outputLog->append(QString::fromAscii("*** Failed to run doxygen\n")); + m_outputLog->append(QString::fromLatin1("*** Failed to run doxygen\n")); } else { @@ -536,10 +555,10 @@ void MainWindow::showHtmlOutput() QFileInfo fi(indexFile); // TODO: the following doesn't seem to work with IE #ifdef WIN32 - //QString indexUrl(QString::fromAscii("file:///")); + //QString indexUrl(QString::fromLatin1("file:///")); ShellExecute(NULL, L"open", (LPCWSTR)fi.absoluteFilePath().utf16(), NULL, NULL, SW_SHOWNORMAL); #else - QString indexUrl(QString::fromAscii("file://")); + QString indexUrl(QString::fromLatin1("file://")); indexUrl+=fi.absoluteFilePath(); QDesktopServices::openUrl(QUrl(indexUrl)); #endif @@ -549,7 +568,7 @@ void MainWindow::saveLog() { QString fn = QFileDialog::getSaveFileName(this, tr("Save log file"), m_workingDir->text()+ - QString::fromAscii("/doxygen_log.txt")); + QString::fromLatin1("/doxygen_log.txt")); if (!fn.isEmpty()) { QFile f(fn); @@ -589,11 +608,11 @@ void MainWindow::updateTitle() QString title = tr("Doxygen GUI frontend"); if (m_modified) { - title+=QString::fromAscii(" +"); + title+=QString::fromLatin1(" +"); } if (!m_fileName.isEmpty()) { - title+=QString::fromAscii(" (")+m_fileName+QString::fromAscii(")"); + title+=QString::fromLatin1(" (")+m_fileName+QString::fromLatin1(")"); } setWindowTitle(title); } diff --git a/addon/doxywizard/expert.cpp b/addon/doxywizard/expert.cpp index 3a03c69..66a0955 100644 --- a/addon/doxywizard/expert.cpp +++ b/addon/doxywizard/expert.cpp @@ -1,5 +1,3 @@ -#include <QtGui> -#include <QtXml> #include "expert.h" #include "inputbool.h" #include "inputstring.h" @@ -11,7 +9,22 @@ #include "configdoc.h" #include "settings.h" -#define SA(x) QString::fromAscii(x) +#include <QTreeWidget> +#include <QStackedWidget> +#include <QTextBrowser> +#include <QSplitter> +#include <QGridLayout> +#include <QPushButton> +#include <QScrollArea> +#include <QFile> +#include <QMessageBox> +#include <QSettings> +#include <QTextStream> +#include <QTextCodec> +#include <QFileInfo> + +#define SA(x) QString::fromLatin1(x) + static QString convertToComment(const QString &s) { @@ -48,7 +61,7 @@ Expert::Expert() m_treeWidget = new QTreeWidget; m_treeWidget->setColumnCount(1); m_topicStack = new QStackedWidget; - m_inShowHelp = FALSE; + m_inShowHelp = false; QFile file(SA(":/config.xml")); QString err; @@ -69,7 +82,7 @@ Expert::Expert() createTopics(m_rootElement); m_helper = new QTextBrowser; m_helper->setReadOnly(true); - m_helper->setOpenExternalLinks(TRUE); + m_helper->setOpenExternalLinks(true); m_splitter = new QSplitter(Qt::Vertical); m_splitter->addWidget(m_treeWidget); m_splitter->addWidget(m_helper); @@ -471,7 +484,7 @@ QWidget *Expert::createTopicWidget(QDomElement &elem) while (!child.isNull()) { QString setting = child.attribute(SA("setting")); - if (setting.isEmpty() || IS_SUPPORTED(setting.toAscii())) + if (setting.isEmpty() || IS_SUPPORTED(setting.toLatin1())) { QString type = child.attribute(SA("type")); QString docs = getDocsForNode(child); @@ -634,7 +647,7 @@ QWidget *Expert::createTopicWidget(QDomElement &elem) QString dependsOn = child.attribute(SA("depends")); QString id = child.attribute(SA("id")); if (!dependsOn.isEmpty() && - (setting.isEmpty() || IS_SUPPORTED(setting.toAscii()))) + (setting.isEmpty() || IS_SUPPORTED(setting.toLatin1()))) { Input *parentOption = m_options[dependsOn]; if (parentOption==0) @@ -740,7 +753,7 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec, QString setting = childElem.attribute(SA("setting")); QString type = childElem.attribute(SA("type")); QString name = childElem.attribute(SA("id")); - if (setting.isEmpty() || IS_SUPPORTED(setting.toAscii())) + if (setting.isEmpty() || IS_SUPPORTED(setting.toLatin1())) { QHash<QString,Input*>::const_iterator i = m_options.find(name); if (i!=m_options.end()) @@ -774,10 +787,10 @@ bool Expert::writeConfig(QTextStream &t,bool brief) } QTextCodec *codec = 0; - Input *option = m_options[QString::fromAscii("DOXYFILE_ENCODING")]; + Input *option = m_options[QString::fromLatin1("DOXYFILE_ENCODING")]; if (option) { - codec = QTextCodec::codecForName(option->value().toString().toAscii()); + codec = QTextCodec::codecForName(option->value().toString().toLatin1()); if (codec==0) // fallback: use UTF-8 { codec = QTextCodec::codecForName("UTF-8"); @@ -809,16 +822,16 @@ void Expert::showHelp(Input *option) { if (!m_inShowHelp) { - m_inShowHelp = TRUE; + m_inShowHelp = true; m_helper->setText( - QString::fromAscii("<qt><b>")+option->id()+ - QString::fromAscii("</b><br>")+ - QString::fromAscii("<br/>")+ + QString::fromLatin1("<qt><b>")+option->id()+ + QString::fromLatin1("</b><br>")+ + QString::fromLatin1("<br/>")+ option->docs(). - replace(QChar::fromAscii('\n'),QChar::fromAscii(' '))+ - QString::fromAscii("</qt>") + replace(QChar::fromLatin1('\n'),QChar::fromLatin1(' '))+ + QString::fromLatin1("</qt>") ); - m_inShowHelp = FALSE; + m_inShowHelp = false; } } @@ -862,7 +875,7 @@ void Expert::resetToDefaults() static bool stringVariantToBool(const QVariant &v) { QString s = v.toString().toLower(); - return s==QString::fromAscii("yes") || s==QString::fromAscii("true") || s==QString::fromAscii("1"); + return s==QString::fromLatin1("yes") || s==QString::fromLatin1("true") || s==QString::fromLatin1("1"); } static bool getBoolOption( @@ -884,7 +897,7 @@ static QString getStringOption( bool Expert::htmlOutputPresent(const QString &workingDir) const { - bool generateHtml = getBoolOption(m_options,QString::fromAscii("GENERATE_HTML")); + bool generateHtml = getBoolOption(m_options,QString::fromLatin1("GENERATE_HTML")); if (!generateHtml || workingDir.isEmpty()) return false; QString indexFile = getHtmlOutputIndex(workingDir); QFileInfo fi(indexFile); @@ -893,8 +906,8 @@ bool Expert::htmlOutputPresent(const QString &workingDir) const QString Expert::getHtmlOutputIndex(const QString &workingDir) const { - QString outputDir = getStringOption(m_options,QString::fromAscii("OUTPUT_DIRECTORY")); - QString htmlOutputDir = getStringOption(m_options,QString::fromAscii("HTML_OUTPUT")); + QString outputDir = getStringOption(m_options,QString::fromLatin1("OUTPUT_DIRECTORY")); + QString htmlOutputDir = getStringOption(m_options,QString::fromLatin1("HTML_OUTPUT")); //printf("outputDir=%s\n",qPrintable(outputDir)); //printf("htmlOutputDir=%s\n",qPrintable(htmlOutputDir)); QString indexFile = workingDir; @@ -904,7 +917,7 @@ QString Expert::getHtmlOutputIndex(const QString &workingDir) const } else // append { - indexFile += QString::fromAscii("/")+outputDir; + indexFile += QString::fromLatin1("/")+outputDir; } if (QFileInfo(htmlOutputDir).isAbsolute()) // override { @@ -912,27 +925,27 @@ QString Expert::getHtmlOutputIndex(const QString &workingDir) const } else // append { - indexFile += QString::fromAscii("/")+htmlOutputDir; + indexFile += QString::fromLatin1("/")+htmlOutputDir; } - indexFile+=QString::fromAscii("/index.html"); + indexFile+=QString::fromLatin1("/index.html"); return indexFile; } bool Expert::pdfOutputPresent(const QString &workingDir) const { - bool generateLatex = getBoolOption(m_options,QString::fromAscii("GENERATE_LATEX")); - bool pdfLatex = getBoolOption(m_options,QString::fromAscii("USE_PDFLATEX")); + bool generateLatex = getBoolOption(m_options,QString::fromLatin1("GENERATE_LATEX")); + bool pdfLatex = getBoolOption(m_options,QString::fromLatin1("USE_PDFLATEX")); if (!generateLatex || !pdfLatex) return false; - QString latexOutput = getStringOption(m_options,QString::fromAscii("LATEX_OUTPUT")); + QString latexOutput = getStringOption(m_options,QString::fromLatin1("LATEX_OUTPUT")); QString indexFile; if (QFileInfo(latexOutput).isAbsolute()) { - indexFile = latexOutput+QString::fromAscii("/refman.pdf"); + indexFile = latexOutput+QString::fromLatin1("/refman.pdf"); } else { - indexFile = workingDir+QString::fromAscii("/")+ - latexOutput+QString::fromAscii("/refman.pdf"); + indexFile = workingDir+QString::fromLatin1("/")+ + latexOutput+QString::fromLatin1("/refman.pdf"); } QFileInfo fi(indexFile); return fi.exists() && fi.isFile(); diff --git a/addon/doxywizard/inputbool.cpp b/addon/doxywizard/inputbool.cpp index ec2035a..ef71dd9 100644 --- a/addon/doxywizard/inputbool.cpp +++ b/addon/doxywizard/inputbool.cpp @@ -14,7 +14,11 @@ #include "inputbool.h" #include "helplabel.h" -#include <QtGui> + +#include <QCheckBox> +#include <QTextStream> +#include <QTextCodec> +#include <QGridLayout> InputBool::InputBool( QGridLayout *layout, int &row, const QString &id, bool checked, @@ -73,11 +77,11 @@ void InputBool::updateDefault() { if (m_state==m_default || !m_lab->isEnabled()) { - m_lab->setText(QString::fromAscii("<qt>")+m_id+QString::fromAscii("</qt")); + m_lab->setText(QString::fromLatin1("<qt>")+m_id+QString::fromLatin1("</qt")); } else { - m_lab->setText(QString::fromAscii("<qt><font color='red'>")+m_id+QString::fromAscii("</font></qt>")); + m_lab->setText(QString::fromLatin1("<qt><font color='red'>")+m_id+QString::fromLatin1("</font></qt>")); } } @@ -89,9 +93,9 @@ QVariant &InputBool::value() void InputBool::update() { QString v = m_value.toString().toLower(); - m_state = (v==QString::fromAscii("yes") || - v==QString::fromAscii("true") || - v==QString::fromAscii("1")); + m_state = (v==QString::fromLatin1("yes") || + v==QString::fromLatin1("true") || + v==QString::fromLatin1("1")); m_cb->setChecked( m_state ); updateDefault(); updateDependencies(); @@ -105,8 +109,8 @@ void InputBool::reset() void InputBool::writeValue(QTextStream &t,QTextCodec *codec) { if (m_state) - t << codec->fromUnicode(QString::fromAscii("YES")); + t << codec->fromUnicode(QString::fromLatin1("YES")); else - t << codec->fromUnicode(QString::fromAscii("NO")); + t << codec->fromUnicode(QString::fromLatin1("NO")); } diff --git a/addon/doxywizard/inputint.cpp b/addon/doxywizard/inputint.cpp index 8fa46e8..a57e7f4 100644 --- a/addon/doxywizard/inputint.cpp +++ b/addon/doxywizard/inputint.cpp @@ -15,7 +15,10 @@ #include "inputint.h" #include "helplabel.h" -#include <QtGui> +#include <QSpinBox> +#include <QGridLayout> +#include <QWheelEvent> +#include <QTextStream> class NoWheelSpinBox : public QSpinBox { @@ -74,11 +77,11 @@ void InputInt::updateDefault() { if (m_val==m_default || !m_lab->isEnabled()) { - m_lab->setText(QString::fromAscii("<qt>")+m_id+QString::fromAscii("</qt")); + m_lab->setText(QString::fromLatin1("<qt>")+m_id+QString::fromLatin1("</qt")); } else { - m_lab->setText(QString::fromAscii("<qt><font color='red'>")+m_id+QString::fromAscii("</font></qt>")); + m_lab->setText(QString::fromLatin1("<qt><font color='red'>")+m_id+QString::fromLatin1("</font></qt>")); } emit changed(); } diff --git a/addon/doxywizard/inputstring.cpp b/addon/doxywizard/inputstring.cpp index 75de0b5..7fb6ec3 100644 --- a/addon/doxywizard/inputstring.cpp +++ b/addon/doxywizard/inputstring.cpp @@ -17,7 +17,14 @@ #include "doxywizard.h" #include "config.h" -#include <QtGui> +#include <QComboBox> +#include <QLineEdit> +#include <QGridLayout> +#include <QWheelEvent> +#include <QToolBar> +#include <QFileInfo> +#include <QFileDialog> +#include <QTextCodec> class NoWheelComboBox : public QComboBox { @@ -34,7 +41,7 @@ InputString::InputString( QGridLayout *layout,int &row, StringMode m, const QString &docs, const QString &absPath ) : m_default(s), m_sm(m), m_index(0), m_docs(docs), m_id(id), - m_absPath(absPath==QString::fromAscii("1")) + m_absPath(absPath==QString::fromLatin1("1")) { m_lab = new HelpLabel(id); if (m==StringFixed) @@ -61,7 +68,7 @@ InputString::InputString( QGridLayout *layout,int &row, m_br->setIconSize(QSize(24,24)); if (m==StringFile || m==StringImage) { - QAction *file = m_br->addAction(QIcon(QString::fromAscii(":/images/file.png")),QString(),this,SLOT(browse())); + QAction *file = m_br->addAction(QIcon(QString::fromLatin1(":/images/file.png")),QString(),this,SLOT(browse())); file->setToolTip(tr("Browse to a file")); layout->addWidget( m_br,row,2 ); if (m==StringImage) @@ -75,7 +82,7 @@ InputString::InputString( QGridLayout *layout,int &row, } else { - QAction *dir = m_br->addAction(QIcon(QString::fromAscii(":/images/folder.png")),QString(),this,SLOT(browse())); + QAction *dir = m_br->addAction(QIcon(QString::fromLatin1(":/images/folder.png")),QString(),this,SLOT(browse())); dir->setToolTip(tr("Browse to a folder")); layout->addWidget( m_br,row,2 ); } @@ -94,7 +101,7 @@ InputString::InputString( QGridLayout *layout,int &row, this, SLOT(setValue(const QString&)) ); if (m_com) connect( m_com, SIGNAL(activated(const QString &)), this, SLOT(setValue(const QString &)) ); - m_str = s+QChar::fromAscii('!'); // force update + m_str = s+QChar::fromLatin1('!'); // force update setValue(s); connect( m_lab, SIGNAL(enter()), SLOT(help()) ); connect( m_lab, SIGNAL(reset()), SLOT(reset()) ); @@ -125,11 +132,11 @@ void InputString::updateDefault() { if (m_str==m_default || !m_lab->isEnabled()) { - m_lab->setText(QString::fromAscii("<qt>")+m_id+QString::fromAscii("</qt")); + m_lab->setText(QString::fromLatin1("<qt>")+m_id+QString::fromLatin1("</qt")); } else { - m_lab->setText(QString::fromAscii("<qt><font color='red'>")+m_id+QString::fromAscii("</font></qt>")); + m_lab->setText(QString::fromLatin1("<qt><font color='red'>")+m_id+QString::fromLatin1("</font></qt>")); } if (m_im) { @@ -142,7 +149,7 @@ void InputString::updateDefault() QFile Fout(m_str); if(!Fout.exists()) { - m_im->setText(tr("Sorry, cannot find file(")+m_str+QString::fromAscii(");")); + m_im->setText(tr("Sorry, cannot find file(")+m_str+QString::fromLatin1(");")); } else { @@ -153,7 +160,7 @@ void InputString::updateDefault() } else { - m_im->setText(tr("Sorry, no preview available (")+m_str+QString::fromAscii(");")); + m_im->setText(tr("Sorry, no preview available (")+m_str+QString::fromLatin1(");")); } } } diff --git a/addon/doxywizard/inputstrlist.cpp b/addon/doxywizard/inputstrlist.cpp index 777af6a..660ce40 100644 --- a/addon/doxywizard/inputstrlist.cpp +++ b/addon/doxywizard/inputstrlist.cpp @@ -17,7 +17,14 @@ #include "doxywizard.h" #include "config.h" -#include <QtGui> +#include <QToolBar> +#include <QGridLayout> +#include <QLineEdit> +#include <QListWidget> +#include <QFileInfo> +#include <QFileDialog> +#include <QTextStream> +#include <QTextCodec> InputStrList::InputStrList( QGridLayout *layout,int &row, const QString & id, @@ -32,13 +39,13 @@ InputStrList::InputStrList( QGridLayout *layout,int &row, QToolBar *toolBar = new QToolBar; toolBar->setIconSize(QSize(24,24)); - m_add = toolBar->addAction(QIcon(QString::fromAscii(":/images/add.png")),QString(), + m_add = toolBar->addAction(QIcon(QString::fromLatin1(":/images/add.png")),QString(), this,SLOT(addString())); m_add->setToolTip(tr("Add item")); - m_del = toolBar->addAction(QIcon(QString::fromAscii(":/images/del.png")),QString(), + m_del = toolBar->addAction(QIcon(QString::fromLatin1(":/images/del.png")),QString(), this,SLOT(delString())); m_del->setToolTip(tr("Delete selected item")); - m_upd = toolBar->addAction(QIcon(QString::fromAscii(":/images/refresh.png")),QString(), + m_upd = toolBar->addAction(QIcon(QString::fromLatin1(":/images/refresh.png")),QString(), this,SLOT(updateString())); m_upd->setToolTip(tr("Update selected item")); @@ -52,13 +59,13 @@ InputStrList::InputStrList( QGridLayout *layout,int &row, { if (lm&ListFile) { - m_brFile = toolBar->addAction(QIcon(QString::fromAscii(":/images/file.png")),QString(), + m_brFile = toolBar->addAction(QIcon(QString::fromLatin1(":/images/file.png")),QString(), this,SLOT(browseFiles())); m_brFile->setToolTip(tr("Browse to a file")); } if (lm&ListDir) { - m_brDir = toolBar->addAction(QIcon(QString::fromAscii(":/images/folder.png")),QString(), + m_brDir = toolBar->addAction(QIcon(QString::fromLatin1(":/images/folder.png")),QString(), this,SLOT(browseDir())); m_brDir->setToolTip(tr("Browse to a folder")); } @@ -188,7 +195,7 @@ void InputStrList::browseDir() } if (dirName.isEmpty()) { - dirName=QString::fromAscii("."); + dirName=QString::fromLatin1("."); } m_lb->addItem(dirName); m_strList.append(dirName); @@ -225,11 +232,11 @@ void InputStrList::updateDefault() { if (m_strList==m_default || !m_lab->isEnabled()) { - m_lab->setText(QString::fromAscii("<qt>")+m_id+QString::fromAscii("</qt")); + m_lab->setText(QString::fromLatin1("<qt>")+m_id+QString::fromLatin1("</qt")); } else { - m_lab->setText(QString::fromAscii("<qt><font color='red'>")+m_id+QString::fromAscii("</font></qt>")); + m_lab->setText(QString::fromLatin1("<qt><font color='red'>")+m_id+QString::fromLatin1("</font></qt>")); } } @@ -240,7 +247,7 @@ void InputStrList::reset() void InputStrList::writeValue(QTextStream &t,QTextCodec *codec) { - bool first=TRUE; + bool first=true; foreach (QString s, m_strList) { if (!first) @@ -248,7 +255,7 @@ void InputStrList::writeValue(QTextStream &t,QTextCodec *codec) t << " \\" << endl; t << " "; } - first=FALSE; + first=false; writeStringValue(t,codec,s); } } diff --git a/addon/doxywizard/wizard.cpp b/addon/doxywizard/wizard.cpp index a8b7f94..b320aaa 100644 --- a/addon/doxywizard/wizard.cpp +++ b/addon/doxywizard/wizard.cpp @@ -3,46 +3,64 @@ #include "doxywizard.h" #include <math.h> -#include <QtGui> + +#include <QGridLayout> +#include <QImage> +#include <QLabel> +#include <QHBoxLayout> +#include <QPushButton> +#include <QPixmap> +#include <QPainter> +#include <QMouseEvent> +#include <QLineEdit> +#include <QCheckBox> +#include <QFileInfo> +#include <QFileDialog> +#include <QButtonGroup> +#include <QGroupBox> +#include <QRadioButton> +#include <QTreeWidget> +#include <QStackedWidget> +#include <qdrawutil.h> // options configurable via the wizard -#define STR_PROJECT_NAME QString::fromAscii("PROJECT_NAME") -#define STR_PROJECT_LOGO QString::fromAscii("PROJECT_LOGO") -#define STR_PROJECT_BRIEF QString::fromAscii("PROJECT_BRIEF") -#define STR_INPUT QString::fromAscii("INPUT") -#define STR_OUTPUT_DIRECTORY QString::fromAscii("OUTPUT_DIRECTORY") -#define STR_PROJECT_NUMBER QString::fromAscii("PROJECT_NUMBER") -#define STR_RECURSIVE QString::fromAscii("RECURSIVE") -#define STR_OPTIMIZE_OUTPUT_FOR_C QString::fromAscii("OPTIMIZE_OUTPUT_FOR_C") -#define STR_OPTIMIZE_OUTPUT_JAVA QString::fromAscii("OPTIMIZE_OUTPUT_JAVA") -#define STR_OPTIMIZE_FOR_FORTRAN QString::fromAscii("OPTIMIZE_FOR_FORTRAN") -#define STR_OPTIMIZE_OUTPUT_VHDL QString::fromAscii("OPTIMIZE_OUTPUT_VHDL") -#define STR_CPP_CLI_SUPPORT QString::fromAscii("CPP_CLI_SUPPORT") -#define STR_HIDE_SCOPE_NAMES QString::fromAscii("HIDE_SCOPE_NAMES") -#define STR_EXTRACT_ALL QString::fromAscii("EXTRACT_ALL") -#define STR_SOURCE_BROWSER QString::fromAscii("SOURCE_BROWSER") -#define STR_GENERATE_HTML QString::fromAscii("GENERATE_HTML") -#define STR_GENERATE_LATEX QString::fromAscii("GENERATE_LATEX") -#define STR_GENERATE_MAN QString::fromAscii("GENERATE_MAN") -#define STR_GENERATE_RTF QString::fromAscii("GENERATE_RTF") -#define STR_GENERATE_XML QString::fromAscii("GENERATE_XML") -#define STR_GENERATE_HTMLHELP QString::fromAscii("GENERATE_HTMLHELP") -#define STR_GENERATE_TREEVIEW QString::fromAscii("GENERATE_TREEVIEW") -#define STR_USE_PDFLATEX QString::fromAscii("USE_PDFLATEX") -#define STR_PDF_HYPERLINKS QString::fromAscii("PDF_HYPERLINKS") -#define STR_SEARCHENGINE QString::fromAscii("SEARCHENGINE") -#define STR_HAVE_DOT QString::fromAscii("HAVE_DOT") -#define STR_CLASS_DIAGRAMS QString::fromAscii("CLASS_DIAGRAMS") -#define STR_CLASS_GRAPH QString::fromAscii("CLASS_GRAPH") -#define STR_COLLABORATION_GRAPH QString::fromAscii("COLLABORATION_GRAPH") -#define STR_GRAPHICAL_HIERARCHY QString::fromAscii("GRAPHICAL_HIERARCHY") -#define STR_INCLUDE_GRAPH QString::fromAscii("INCLUDE_GRAPH") -#define STR_INCLUDED_BY_GRAPH QString::fromAscii("INCLUDED_BY_GRAPH") -#define STR_CALL_GRAPH QString::fromAscii("CALL_GRAPH") -#define STR_CALLER_GRAPH QString::fromAscii("CALLER_GRAPH") -#define STR_HTML_COLORSTYLE_HUE QString::fromAscii("HTML_COLORSTYLE_HUE") -#define STR_HTML_COLORSTYLE_SAT QString::fromAscii("HTML_COLORSTYLE_SAT") -#define STR_HTML_COLORSTYLE_GAMMA QString::fromAscii("HTML_COLORSTYLE_GAMMA") +#define STR_PROJECT_NAME QString::fromLatin1("PROJECT_NAME") +#define STR_PROJECT_LOGO QString::fromLatin1("PROJECT_LOGO") +#define STR_PROJECT_BRIEF QString::fromLatin1("PROJECT_BRIEF") +#define STR_INPUT QString::fromLatin1("INPUT") +#define STR_OUTPUT_DIRECTORY QString::fromLatin1("OUTPUT_DIRECTORY") +#define STR_PROJECT_NUMBER QString::fromLatin1("PROJECT_NUMBER") +#define STR_RECURSIVE QString::fromLatin1("RECURSIVE") +#define STR_OPTIMIZE_OUTPUT_FOR_C QString::fromLatin1("OPTIMIZE_OUTPUT_FOR_C") +#define STR_OPTIMIZE_OUTPUT_JAVA QString::fromLatin1("OPTIMIZE_OUTPUT_JAVA") +#define STR_OPTIMIZE_FOR_FORTRAN QString::fromLatin1("OPTIMIZE_FOR_FORTRAN") +#define STR_OPTIMIZE_OUTPUT_VHDL QString::fromLatin1("OPTIMIZE_OUTPUT_VHDL") +#define STR_CPP_CLI_SUPPORT QString::fromLatin1("CPP_CLI_SUPPORT") +#define STR_HIDE_SCOPE_NAMES QString::fromLatin1("HIDE_SCOPE_NAMES") +#define STR_EXTRACT_ALL QString::fromLatin1("EXTRACT_ALL") +#define STR_SOURCE_BROWSER QString::fromLatin1("SOURCE_BROWSER") +#define STR_GENERATE_HTML QString::fromLatin1("GENERATE_HTML") +#define STR_GENERATE_LATEX QString::fromLatin1("GENERATE_LATEX") +#define STR_GENERATE_MAN QString::fromLatin1("GENERATE_MAN") +#define STR_GENERATE_RTF QString::fromLatin1("GENERATE_RTF") +#define STR_GENERATE_XML QString::fromLatin1("GENERATE_XML") +#define STR_GENERATE_HTMLHELP QString::fromLatin1("GENERATE_HTMLHELP") +#define STR_GENERATE_TREEVIEW QString::fromLatin1("GENERATE_TREEVIEW") +#define STR_USE_PDFLATEX QString::fromLatin1("USE_PDFLATEX") +#define STR_PDF_HYPERLINKS QString::fromLatin1("PDF_HYPERLINKS") +#define STR_SEARCHENGINE QString::fromLatin1("SEARCHENGINE") +#define STR_HAVE_DOT QString::fromLatin1("HAVE_DOT") +#define STR_CLASS_DIAGRAMS QString::fromLatin1("CLASS_DIAGRAMS") +#define STR_CLASS_GRAPH QString::fromLatin1("CLASS_GRAPH") +#define STR_COLLABORATION_GRAPH QString::fromLatin1("COLLABORATION_GRAPH") +#define STR_GRAPHICAL_HIERARCHY QString::fromLatin1("GRAPHICAL_HIERARCHY") +#define STR_INCLUDE_GRAPH QString::fromLatin1("INCLUDE_GRAPH") +#define STR_INCLUDED_BY_GRAPH QString::fromLatin1("INCLUDED_BY_GRAPH") +#define STR_CALL_GRAPH QString::fromLatin1("CALL_GRAPH") +#define STR_CALLER_GRAPH QString::fromLatin1("CALLER_GRAPH") +#define STR_HTML_COLORSTYLE_HUE QString::fromLatin1("HTML_COLORSTYLE_HUE") +#define STR_HTML_COLORSTYLE_SAT QString::fromLatin1("HTML_COLORSTYLE_SAT") +#define STR_HTML_COLORSTYLE_GAMMA QString::fromLatin1("HTML_COLORSTYLE_GAMMA") static bool g_optimizeMapping[6][6] = { @@ -76,7 +94,7 @@ static QString g_optimizeOptionNames[6] = static bool stringVariantToBool(const QVariant &v) { QString s = v.toString().toLower(); - return s==QString::fromAscii("yes") || s==QString::fromAscii("true") || s==QString::fromAscii("1"); + return s==QString::fromLatin1("yes") || s==QString::fromLatin1("true") || s==QString::fromLatin1("1"); } static bool getBoolOption( @@ -111,7 +129,7 @@ static void updateBoolOption( bool bOld = stringVariantToBool(option->value()); if (bOld!=bNew) { - option->value()=QString::fromAscii(bNew ? "true" : "false"); + option->value()=QString::fromLatin1(bNew ? "true" : "false"); option->update(); } } @@ -124,7 +142,7 @@ static void updateIntOption( int iOld = option->value().toInt(); if (iOld!=iNew) { - option->value()=QString::fromAscii("%1").arg(iNew); + option->value()=QString::fromLatin1("%1").arg(iNew); option->update(); } } @@ -148,7 +166,7 @@ TuneColorDialog::TuneColorDialog(int hue,int sat,int gamma,QWidget *parent) : QD { setWindowTitle(tr("Tune the color of the HTML output")); QGridLayout *layout = new QGridLayout(this); - m_image = new QImage(QString::fromAscii(":/images/tunecolor.png")); + m_image = new QImage(QString::fromLatin1(":/images/tunecolor.png")); m_imageLab = new QLabel; updateImage(hue,sat,gamma); layout->addWidget(new QLabel(tr("Example output: use the sliders on the right to adjust the color")),0,0); @@ -519,7 +537,7 @@ Step1::Step1(Wizard *wizard,const QHash<QString,Input*> &modelData) : m_wizard(w m_recursive = new QCheckBox(this); m_recursive->setText(tr("Scan recursively")); - m_recursive->setChecked(TRUE); + m_recursive->setChecked(true); layout->addWidget(m_recursive); //--------------------------------------------------- @@ -574,7 +592,7 @@ void Step1::selectProjectIcon() QFile Fout(iconName); if(!Fout.exists()) { - m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromAscii(");")); + m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromLatin1(");")); } else { @@ -585,7 +603,7 @@ void Step1::selectProjectIcon() } else { - m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromAscii(");")); + m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromLatin1(");")); } } } @@ -604,7 +622,7 @@ void Step1::selectSourceDir() } if (dirName.isEmpty()) { - dirName=QString::fromAscii("."); + dirName=QString::fromLatin1("."); } m_sourceDir->setText(dirName); } @@ -621,7 +639,7 @@ void Step1::selectDestinationDir() } if (dirName.isEmpty()) { - dirName=QString::fromAscii("."); + dirName=QString::fromLatin1("."); } m_destDir->setText(dirName); } @@ -683,7 +701,7 @@ void Step1::init() QFile Fout(iconName); if(!Fout.exists()) { - m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromAscii(");")); + m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromLatin1(");")); } else { @@ -694,7 +712,7 @@ void Step1::init() } else { - m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromAscii(");")); + m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromLatin1(");")); } } } @@ -1220,7 +1238,7 @@ Wizard::Wizard(const QHash<QString,Input*> &modelData, QWidget *parent) : { m_treeWidget = new QTreeWidget; m_treeWidget->setColumnCount(1); - m_treeWidget->setHeaderLabels(QStringList() << QString::fromAscii("Topics")); + m_treeWidget->setHeaderLabels(QStringList() << QString::fromLatin1("Topics")); QList<QTreeWidgetItem*> items; items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(tr("Project")))); items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(tr("Mode")))); |