forked from qt-creator/qt-creator
Merge remote branch 'origin/1.3'
Conflicts: src/libs/cplusplus/CheckUndefinedSymbols.cpp src/plugins/qmleditor/qmlcodecompletion.cpp
This commit is contained in:
@@ -51,6 +51,7 @@ void CheckUndefinedSymbols::setGlobalNamespaceBinding(NamespaceBindingPtr global
|
||||
{
|
||||
_globalNamespaceBinding = globalNamespaceBinding;
|
||||
_types.clear();
|
||||
_protocols.clear();
|
||||
|
||||
if (_globalNamespaceBinding) {
|
||||
QSet<NamespaceBinding *> processed;
|
||||
@@ -130,6 +131,20 @@ void CheckUndefinedSymbols::addType(Name *name)
|
||||
_types.insert(QByteArray(id->chars(), id->size()));
|
||||
}
|
||||
|
||||
void CheckUndefinedSymbols::addProtocol(Name *name)
|
||||
{
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
if (Identifier *id = name->identifier())
|
||||
_protocols.insert(QByteArray(id->chars(), id->size()));
|
||||
}
|
||||
|
||||
bool CheckUndefinedSymbols::isProtocol(const QByteArray &name) const
|
||||
{
|
||||
return _protocols.contains(name);
|
||||
}
|
||||
|
||||
void CheckUndefinedSymbols::buildTypeMap(Class *klass)
|
||||
{
|
||||
addType(klass->name());
|
||||
@@ -186,9 +201,9 @@ void CheckUndefinedSymbols::buildTypeMap(NamespaceBinding *binding, QSet<Namespa
|
||||
for (unsigned i = 0; i < klass->memberCount(); ++i)
|
||||
buildMemberTypeMap(klass->memberAt(i));
|
||||
} else if (ObjCForwardProtocolDeclaration *fProto = member->asObjCForwardProtocolDeclaration()) {
|
||||
addType(fProto->name());
|
||||
addProtocol(fProto->name());
|
||||
} else if (ObjCProtocol *proto = member->asObjCProtocol()) {
|
||||
addType(proto->name());
|
||||
addProtocol(proto->name());
|
||||
|
||||
for (unsigned i = 0; i < proto->memberCount(); ++i)
|
||||
buildMemberTypeMap(proto->memberAt(i));
|
||||
@@ -466,3 +481,53 @@ bool CheckUndefinedSymbols::visit(SizeofExpressionAST *ast)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckUndefinedSymbols::visit(ObjCClassDeclarationAST *ast)
|
||||
{
|
||||
if (NameAST *nameAST = ast->superclass) {
|
||||
bool resolvedSuperClassName = false;
|
||||
|
||||
if (Name *name = nameAST->name) {
|
||||
Identifier *id = name->identifier();
|
||||
const QByteArray spell = QByteArray::fromRawData(id->chars(), id->size());
|
||||
if (isType(spell))
|
||||
resolvedSuperClassName = true;
|
||||
}
|
||||
|
||||
if (! resolvedSuperClassName) {
|
||||
translationUnit()->warning(nameAST->firstToken(),
|
||||
"expected class-name after ':' token");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckUndefinedSymbols::visit(ObjCProtocolRefsAST *ast)
|
||||
{
|
||||
for (IdentifierListAST *iter = ast->identifier_list; iter; iter = iter->next) {
|
||||
if (NameAST *nameAST = iter->name) {
|
||||
bool resolvedProtocolName = false;
|
||||
|
||||
if (Name *name = nameAST->name) {
|
||||
Identifier *id = name->identifier();
|
||||
const QByteArray spell = QByteArray::fromRawData(id->chars(), id->size());
|
||||
if (isProtocol(spell))
|
||||
resolvedProtocolName = true;
|
||||
}
|
||||
|
||||
if (!resolvedProtocolName) {
|
||||
char after;
|
||||
|
||||
if (iter == ast->identifier_list)
|
||||
after = '<';
|
||||
else
|
||||
after = ',';
|
||||
|
||||
translationUnit()->warning(nameAST->firstToken(), "expected protocol name after '%c' token", after);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,8 @@ protected:
|
||||
void buildTypeMap(Class *klass);
|
||||
void buildMemberTypeMap(Symbol *member);
|
||||
void buildTypeMap(NamespaceBinding *binding, QSet<NamespaceBinding *> *processed);
|
||||
void addProtocol(Name *name);
|
||||
bool isProtocol(const QByteArray &name) const;
|
||||
|
||||
FunctionDeclaratorAST *currentFunctionDeclarator() const;
|
||||
CompoundStatementAST *compoundStatement() const;
|
||||
@@ -92,6 +94,9 @@ protected:
|
||||
virtual bool visit(CastExpressionAST *ast);
|
||||
virtual bool visit(SizeofExpressionAST *ast);
|
||||
|
||||
virtual bool visit(ObjCClassDeclarationAST *ast);
|
||||
virtual bool visit(ObjCProtocolRefsAST *ast);
|
||||
|
||||
private:
|
||||
Document::Ptr _doc;
|
||||
NamespaceBindingPtr _globalNamespaceBinding;
|
||||
@@ -100,6 +105,7 @@ private:
|
||||
QList<TemplateDeclarationAST *> _templateDeclarationStack;
|
||||
QList<CompoundStatementAST *> _compoundStatementStack;
|
||||
QSet<QByteArray> _types;
|
||||
QSet<QByteArray> _protocols;
|
||||
QSet<QByteArray> _namespaceNames;
|
||||
};
|
||||
|
||||
|
||||
@@ -104,21 +104,43 @@ QString MatchingText::insertMatchingBrace(const QTextCursor &cursor, const QStri
|
||||
const QChar &la, int *skippedChars) const
|
||||
{
|
||||
QTextCursor tc = cursor;
|
||||
QTextDocument *doc = tc.document();
|
||||
QString text = textToProcess;
|
||||
|
||||
const QString blockText = tc.block().text().mid(tc.columnNumber());
|
||||
const int length = qMin(blockText.length(), textToProcess.length());
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
const QChar ch1 = blockText.at(i);
|
||||
const QChar ch2 = textToProcess.at(i);
|
||||
const QChar previousChar = doc->characterAt(tc.selectionEnd() - 1);
|
||||
|
||||
if (ch1 != ch2)
|
||||
break;
|
||||
else if (! shouldOverrideChar(ch1))
|
||||
break;
|
||||
bool escape = false;
|
||||
|
||||
++*skippedChars;
|
||||
if (! text.isEmpty() && (text.at(0) == QLatin1Char('"') ||
|
||||
text.at(0) == QLatin1Char('\''))) {
|
||||
if (previousChar == QLatin1Char('\\')) {
|
||||
int escapeCount = 0;
|
||||
int index = tc.selectionEnd() - 1;
|
||||
do {
|
||||
++escapeCount;
|
||||
--index;
|
||||
} while (doc->characterAt(index) == QLatin1Char('\\'));
|
||||
|
||||
if ((escapeCount % 2) != 0)
|
||||
escape = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (! escape) {
|
||||
for (int i = 0; i < length; ++i) {
|
||||
const QChar ch1 = blockText.at(i);
|
||||
const QChar ch2 = textToProcess.at(i);
|
||||
|
||||
if (ch1 != ch2)
|
||||
break;
|
||||
else if (! shouldOverrideChar(ch1))
|
||||
break;
|
||||
|
||||
++*skippedChars;
|
||||
}
|
||||
}
|
||||
|
||||
if (*skippedChars != 0) {
|
||||
@@ -142,6 +164,8 @@ QString MatchingText::insertMatchingBrace(const QTextCursor &cursor, const QStri
|
||||
if (isCompleteStringLiteral(tk, index - 1))
|
||||
return QLatin1String("\"");
|
||||
|
||||
qDebug() << "*** here";
|
||||
|
||||
return QString();
|
||||
} else if (text.at(0) == QLatin1Char('\'') && (token.is(T_CHAR_LITERAL) || token.is(T_WIDE_CHAR_LITERAL))) {
|
||||
if (text.length() != 1)
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT AbstractProcess
|
||||
@@ -75,7 +74,6 @@ private:
|
||||
};
|
||||
|
||||
} //namespace Utils
|
||||
} //namespace Core
|
||||
|
||||
#endif // ABSTRACTPROCESS_H
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
QStringList AbstractProcess::fixWinEnvironment(const QStringList &env)
|
||||
@@ -114,4 +113,3 @@ QByteArray AbstractProcess::createWinEnvironment(const QStringList &env)
|
||||
}
|
||||
|
||||
} //namespace Utils
|
||||
} //namespace Core
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
enum { debug = 0 };
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct BaseValidatingLineEditPrivate {
|
||||
@@ -156,4 +155,3 @@ void BaseValidatingLineEdit::triggerChanged()
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QtGui/QLineEdit>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct BaseValidatingLineEditPrivate;
|
||||
@@ -98,6 +97,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // BASEVALIDATINGLINEEDIT_H
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct CheckableMessageBoxPrivate {
|
||||
@@ -147,4 +146,3 @@ QMessageBox::StandardButton CheckableMessageBox::dialogButtonBoxToMessageBoxButt
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct CheckableMessageBoxPrivate;
|
||||
@@ -72,6 +71,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // CHECKABLEMESSAGEBOX_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Core::Utils::CheckableMessageBox</class>
|
||||
<widget class="QDialog" name="Core::Utils::CheckableMessageBox">
|
||||
<class>Utils::CheckableMessageBox</class>
|
||||
<widget class="QDialog" name="Utils::CheckableMessageBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -121,7 +121,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Core::Utils::CheckableMessageBox</receiver>
|
||||
<receiver>Utils::CheckableMessageBox</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
@@ -137,7 +137,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Core::Utils::CheckableMessageBox</receiver>
|
||||
<receiver>Utils::CheckableMessageBox</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QRegExp>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct ClassNameValidatingLineEditPrivate {
|
||||
@@ -58,7 +57,7 @@ ClassNameValidatingLineEditPrivate:: ClassNameValidatingLineEditPrivate() :
|
||||
|
||||
// --------------------- ClassNameValidatingLineEdit
|
||||
ClassNameValidatingLineEdit::ClassNameValidatingLineEdit(QWidget *parent) :
|
||||
Core::Utils::BaseValidatingLineEdit(parent),
|
||||
Utils::BaseValidatingLineEdit(parent),
|
||||
m_d(new ClassNameValidatingLineEditPrivate)
|
||||
{
|
||||
}
|
||||
@@ -98,7 +97,7 @@ bool ClassNameValidatingLineEdit::validate(const QString &value, QString *errorM
|
||||
|
||||
void ClassNameValidatingLineEdit::slotChanged(const QString &t)
|
||||
{
|
||||
Core::Utils::BaseValidatingLineEdit::slotChanged(t);
|
||||
Utils::BaseValidatingLineEdit::slotChanged(t);
|
||||
if (isValid()) {
|
||||
// Suggest file names, strip namespaces
|
||||
QString fileName = m_d->m_lowerCaseFileName ? t.toLower() : t;
|
||||
@@ -148,4 +147,3 @@ void ClassNameValidatingLineEdit::setLowerCaseFileName(bool v)
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "utils_global.h"
|
||||
#include "basevalidatinglineedit.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct ClassNameValidatingLineEditPrivate;
|
||||
@@ -42,7 +41,7 @@ struct ClassNameValidatingLineEditPrivate;
|
||||
* to derive suggested file names from it. */
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT ClassNameValidatingLineEdit
|
||||
: public Core::Utils::BaseValidatingLineEdit
|
||||
: public Utils::BaseValidatingLineEdit
|
||||
{
|
||||
Q_DISABLE_COPY(ClassNameValidatingLineEdit)
|
||||
Q_PROPERTY(bool namespacesEnabled READ namespacesEnabled WRITE setNamespacesEnabled DESIGNABLE true)
|
||||
@@ -76,6 +75,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // CLASSNAMEVALIDATINGLINEEDIT_H
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
static QString toAlphaNum(const QString &s)
|
||||
@@ -101,4 +100,3 @@ void writeClosingNameSpaces(const QStringList &l, const QString &indent,
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -38,7 +38,6 @@ class QTextStream;
|
||||
class QStringList;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QString headerGuard(const QString &file);
|
||||
@@ -62,6 +61,5 @@ void writeClosingNameSpaces(const QStringList &namespaces,
|
||||
QTextStream &str);
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // CODEGENERATION_H
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "consoleprocess.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
QString ConsoleProcess::modeOption(Mode m)
|
||||
@@ -83,4 +82,3 @@ QString ConsoleProcess::msgCannotExecute(const QString & p, const QString &why)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ class QSettings;
|
||||
class QTemporaryFile;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT ConsoleProcess : public QObject, public AbstractProcess
|
||||
@@ -138,6 +137,5 @@ private:
|
||||
};
|
||||
|
||||
} //namespace Utils
|
||||
} //namespace Core
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
|
||||
ConsoleProcess::ConsoleProcess(QObject *parent) :
|
||||
QObject(parent),
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
|
||||
ConsoleProcess::ConsoleProcess(QObject *parent) :
|
||||
QObject(parent),
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
|
||||
enum { margin = 6 };
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
static inline QString sideToStyleSheetString(FancyLineEdit::Side side)
|
||||
@@ -311,4 +310,3 @@ QString FancyLineEdit::typedText() const
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QtGui/QLineEdit>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class FancyLineEditPrivate;
|
||||
@@ -107,6 +106,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // FANCYLINEEDIT_H
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
|
||||
FancyMainWindow::FancyMainWindow(QWidget *parent)
|
||||
: QMainWindow(parent),
|
||||
|
||||
@@ -41,7 +41,6 @@ QT_BEGIN_NAMESPACE
|
||||
class QSettings;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT FancyMainWindow : public QMainWindow
|
||||
@@ -85,6 +84,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // FANCYMAINWINDOW_H
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
#define WINDOWS_DEVICES "CON|AUX|PRN|COM1|COM2|LPT1|LPT2|NUL"
|
||||
@@ -133,4 +132,3 @@ bool FileNameValidatingLineEdit::validate(const QString &value, QString *errorM
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "basevalidatinglineedit.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
/**
|
||||
@@ -67,6 +66,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // FILENAMEVALIDATINGLINEEDIT_H
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
|
||||
#include <qtconcurrent/runextensions.h>
|
||||
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
|
||||
static inline QString msgCanceled(const QString &searchTerm, int numMatches, int numFilesSearched)
|
||||
{
|
||||
return QCoreApplication::translate("Core::Utils::FileSearch",
|
||||
return QCoreApplication::translate("Utils::FileSearch",
|
||||
"%1: canceled. %n occurrences found in %2 files.",
|
||||
0, QCoreApplication::CodecForTr, numMatches).
|
||||
arg(searchTerm).arg(numFilesSearched);
|
||||
@@ -52,7 +52,7 @@ static inline QString msgCanceled(const QString &searchTerm, int numMatches, int
|
||||
|
||||
static inline QString msgFound(const QString &searchTerm, int numMatches, int numFilesSearched)
|
||||
{
|
||||
return QCoreApplication::translate("Core::Utils::FileSearch",
|
||||
return QCoreApplication::translate("Utils::FileSearch",
|
||||
"%1: %n occurrences found in %2 files.",
|
||||
0, QCoreApplication::CodecForTr, numMatches).
|
||||
arg(searchTerm).arg(numFilesSearched);
|
||||
@@ -60,7 +60,7 @@ static inline QString msgFound(const QString &searchTerm, int numMatches, int nu
|
||||
|
||||
static inline QString msgFound(const QString &searchTerm, int numMatches, int numFilesSearched, int filesSize)
|
||||
{
|
||||
return QCoreApplication::translate("Core::Utils::FileSearch",
|
||||
return QCoreApplication::translate("Utils::FileSearch",
|
||||
"%1: %n occurrences found in %2 of %3 files.",
|
||||
0, QCoreApplication::CodecForTr, numMatches).
|
||||
arg(searchTerm).arg(numFilesSearched).arg(filesSize);
|
||||
@@ -246,14 +246,14 @@ void runFileSearchRegExp(QFutureInterface<FileSearchResult> &future,
|
||||
} // namespace
|
||||
|
||||
|
||||
QFuture<FileSearchResult> Core::Utils::findInFiles(const QString &searchTerm, const QStringList &files,
|
||||
QFuture<FileSearchResult> Utils::findInFiles(const QString &searchTerm, const QStringList &files,
|
||||
QTextDocument::FindFlags flags, QMap<QString, QString> fileToContentsMap)
|
||||
{
|
||||
return QtConcurrent::run<FileSearchResult, QString, QStringList, QTextDocument::FindFlags, QMap<QString, QString> >
|
||||
(runFileSearch, searchTerm, files, flags, fileToContentsMap);
|
||||
}
|
||||
|
||||
QFuture<FileSearchResult> Core::Utils::findInFilesRegExp(const QString &searchTerm, const QStringList &files,
|
||||
QFuture<FileSearchResult> Utils::findInFilesRegExp(const QString &searchTerm, const QStringList &files,
|
||||
QTextDocument::FindFlags flags, QMap<QString, QString> fileToContentsMap)
|
||||
{
|
||||
return QtConcurrent::run<FileSearchResult, QString, QStringList, QTextDocument::FindFlags, QMap<QString, QString> >
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <QtCore/QMap>
|
||||
#include <QtGui/QTextDocument>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT FileSearchResult
|
||||
@@ -62,6 +61,5 @@ QTCREATOR_UTILS_EXPORT QFuture<FileSearchResult> findInFilesRegExp(const QString
|
||||
QTextDocument::FindFlags flags, QMap<QString, QString> fileToContentsMap = QMap<QString, QString>());
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // FILESEARCH_H
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include <QtGui/QAbstractButton>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
FileWizardDialog::FileWizardDialog(QWidget *parent) :
|
||||
@@ -69,4 +68,3 @@ void FileWizardDialog::setName(const QString &name)
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QtGui/QWizard>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class FileWizardPage;
|
||||
@@ -62,6 +61,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // FILEWIZARDDIALOG_H
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "filewizardpage.h"
|
||||
#include "ui_filewizardpage.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct FileWizardPagePrivate
|
||||
@@ -130,4 +129,3 @@ bool FileWizardPage::validateBaseName(const QString &name, QString *errorMessage
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QtGui/QWizardPage>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct FileWizardPagePrivate;
|
||||
@@ -87,6 +86,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // FILEWIZARDPAGE_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Core::Utils::WizardPage</class>
|
||||
<widget class="QWizardPage" name="Core::Utils::WizardPage">
|
||||
<class>Utils::WizardPage</class>
|
||||
<widget class="QWizardPage" name="Utils::WizardPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -22,7 +22,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Core::Utils::FileNameValidatingLineEdit" name="nameLineEdit"/>
|
||||
<widget class="Utils::FileNameValidatingLineEdit" name="nameLineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="pathLabel">
|
||||
@@ -32,19 +32,19 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Core::Utils::PathChooser" name="pathChooser" native="true"/>
|
||||
<widget class="Utils::PathChooser" name="pathChooser" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Core::Utils::PathChooser</class>
|
||||
<class>Utils::PathChooser</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pathchooser.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Core::Utils::FileNameValidatingLineEdit</class>
|
||||
<class>Utils::FileNameValidatingLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>filenamevalidatinglineedit.h</header>
|
||||
</customwidget>
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "linecolumnlabel.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
LineColumnLabel::LineColumnLabel(QWidget *parent)
|
||||
@@ -62,4 +61,3 @@ void LineColumnLabel::setMaxText(const QString &maxText)
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "utils_global.h"
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
/* A label suitable for displaying cursor positions, etc. with a fixed
|
||||
@@ -61,6 +60,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // LINECOLUMNLABEL_H
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include <QtCore/QList>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
template <class T1, class T2>
|
||||
@@ -46,6 +45,5 @@ QList<T1> qwConvertList(const QList<T2> &list)
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // LISTUTILS_H
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
enum { debugNewClassWidget = 0 };
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct NewClassWidgetPrivate {
|
||||
@@ -485,4 +484,3 @@ QStringList NewClassWidget::files() const
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -38,7 +38,6 @@ QT_BEGIN_NAMESPACE
|
||||
class QStringList;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct NewClassWidgetPrivate;
|
||||
@@ -157,6 +156,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // NEWCLASSWIDGET_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Core::Utils::NewClassWidget</class>
|
||||
<widget class="QWidget" name="Core::Utils::NewClassWidget">
|
||||
<class>Utils::NewClassWidget</class>
|
||||
<widget class="QWidget" name="Utils::NewClassWidget">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
@@ -17,7 +17,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Core::Utils::ClassNameValidatingLineEdit" name="classLineEdit"/>
|
||||
<widget class="Utils::ClassNameValidatingLineEdit" name="classLineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="baseClassLabel">
|
||||
@@ -76,7 +76,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="Core::Utils::FileNameValidatingLineEdit" name="headerFileLineEdit"/>
|
||||
<widget class="Utils::FileNameValidatingLineEdit" name="headerFileLineEdit"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="sourceLabel">
|
||||
@@ -86,7 +86,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="Core::Utils::FileNameValidatingLineEdit" name="sourceFileLineEdit"/>
|
||||
<widget class="Utils::FileNameValidatingLineEdit" name="sourceFileLineEdit"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="generateFormLabel">
|
||||
@@ -103,7 +103,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="Core::Utils::FileNameValidatingLineEdit" name="formFileLineEdit"/>
|
||||
<widget class="Utils::FileNameValidatingLineEdit" name="formFileLineEdit"/>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="pathLabel">
|
||||
@@ -113,7 +113,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="Core::Utils::PathChooser" name="pathChooser" native="true"/>
|
||||
<widget class="Utils::PathChooser" name="pathChooser" native="true"/>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="generateFormCheckBox">
|
||||
@@ -126,18 +126,18 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Core::Utils::PathChooser</class>
|
||||
<class>Utils::PathChooser</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">pathchooser.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Core::Utils::ClassNameValidatingLineEdit</class>
|
||||
<class>Utils::ClassNameValidatingLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>classnamevalidatinglineedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Core::Utils::FileNameValidatingLineEdit</class>
|
||||
<class>Utils::FileNameValidatingLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header location="global">utils/filenamevalidatinglineedit.h</header>
|
||||
</customwidget>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "parameteraction.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
ParameterAction::ParameterAction(const QString &emptyText,
|
||||
@@ -57,5 +56,3 @@ void ParameterAction::setParameter(const QString &p)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QtGui/QAction>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
/* ParameterAction: Intended for actions that act on a 'current',
|
||||
@@ -79,7 +78,6 @@ private:
|
||||
EnablingMode m_enablingMode;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PARAMETERACTION_H
|
||||
|
||||
@@ -44,14 +44,13 @@
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
/*static*/ const char * const Core::Utils::PathChooser::browseButtonLabel =
|
||||
/*static*/ const char * const Utils::PathChooser::browseButtonLabel =
|
||||
#ifdef Q_WS_MAC
|
||||
QT_TRANSLATE_NOOP("Core::Utils::PathChooser", "Choose...");
|
||||
QT_TRANSLATE_NOOP("Utils::PathChooser", "Choose...");
|
||||
#else
|
||||
QT_TRANSLATE_NOOP("Core::Utils::PathChooser", "Browse...");
|
||||
QT_TRANSLATE_NOOP("Utils::PathChooser", "Browse...");
|
||||
#endif
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
// ------------------ PathValidatingLineEdit
|
||||
@@ -324,4 +323,3 @@ QString PathChooser::makeDialogTitle(const QString &title)
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QAbstractButton>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct PathChooserPrivate;
|
||||
@@ -117,6 +116,6 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
|
||||
#endif // PATHCHOOSER_H
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
// ------------ PathListPlainTextEdit:
|
||||
@@ -310,4 +309,3 @@ void PathListEditor::deletePathAtCursor()
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -39,7 +39,6 @@ QT_BEGIN_NAMESPACE
|
||||
class QAction;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct PathListEditorPrivate;
|
||||
@@ -105,6 +104,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // PATHLISTEDITOR_H
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct ProjectIntroPagePrivate
|
||||
@@ -210,4 +209,3 @@ void ProjectIntroPage::hideStatusLabel()
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QtGui/QWizardPage>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct ProjectIntroPagePrivate;
|
||||
@@ -101,6 +100,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // PROJECTINTROPAGE_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Core::Utils::ProjectIntroPage</class>
|
||||
<widget class="QWizardPage" name="Core::Utils::ProjectIntroPage">
|
||||
<class>Utils::ProjectIntroPage</class>
|
||||
<widget class="QWizardPage" name="Utils::ProjectIntroPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -59,7 +59,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Core::Utils::ProjectNameValidatingLineEdit" name="nameLineEdit"/>
|
||||
<widget class="Utils::ProjectNameValidatingLineEdit" name="nameLineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="pathLabel">
|
||||
@@ -69,7 +69,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Core::Utils::PathChooser" name="pathChooser" native="true"/>
|
||||
<widget class="Utils::PathChooser" name="pathChooser" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -97,13 +97,13 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Core::Utils::PathChooser</class>
|
||||
<class>Utils::PathChooser</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pathchooser.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Core::Utils::ProjectNameValidatingLineEdit</class>
|
||||
<class>Utils::ProjectNameValidatingLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>projectnamevalidatinglineedit.h</header>
|
||||
</customwidget>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "projectnamevalidatinglineedit.h"
|
||||
#include "filenamevalidatinglineedit.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
ProjectNameValidatingLineEdit::ProjectNameValidatingLineEdit(QWidget *parent)
|
||||
@@ -60,4 +59,3 @@ bool ProjectNameValidatingLineEdit::validate(const QString &value, QString *erro
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "basevalidatinglineedit.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT ProjectNameValidatingLineEdit : public BaseValidatingLineEdit
|
||||
@@ -50,6 +49,5 @@ protected:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // PROJECTNAMEVALIDATINGLINEEDIT_H
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <QtGui/QDragEnterEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class QtColorButtonPrivate
|
||||
@@ -283,6 +282,5 @@ void QtColorButton::dropEvent(QDropEvent *event)
|
||||
#endif
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#include "moc_qtcolorbutton.cpp"
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QtGui/QToolButton>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT QtColorButton : public QToolButton
|
||||
@@ -76,6 +75,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // QTCOLORBUTTON_H
|
||||
|
||||
@@ -33,27 +33,26 @@
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDir>
|
||||
|
||||
using namespace Core;
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
|
||||
QTCREATOR_UTILS_EXPORT Core::Utils::ReloadPromptAnswer
|
||||
Core::Utils::reloadPrompt(const QString &fileName, bool modified, QWidget *parent)
|
||||
QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer
|
||||
Utils::reloadPrompt(const QString &fileName, bool modified, QWidget *parent)
|
||||
{
|
||||
|
||||
const QString title = QCoreApplication::translate("Core::Utils::reloadPrompt", "File Changed");
|
||||
const QString title = QCoreApplication::translate("Utils::reloadPrompt", "File Changed");
|
||||
QString msg;
|
||||
|
||||
if (modified)
|
||||
msg = QCoreApplication::translate("Core::Utils::reloadPrompt",
|
||||
msg = QCoreApplication::translate("Utils::reloadPrompt",
|
||||
"The unsaved file %1 has been changed outside Qt Creator. Do you want to reload it and discard your changes?").arg(QDir::toNativeSeparators(fileName));
|
||||
else
|
||||
msg = QCoreApplication::translate("Core::Utils::reloadPrompt",
|
||||
msg = QCoreApplication::translate("Utils::reloadPrompt",
|
||||
"The file %1 has changed outside Qt Creator. Do you want to reload it?").arg(QDir::toNativeSeparators(fileName));
|
||||
return reloadPrompt(title, msg, parent);
|
||||
}
|
||||
|
||||
QTCREATOR_UTILS_EXPORT Core::Utils::ReloadPromptAnswer
|
||||
Core::Utils::reloadPrompt(const QString &title, const QString &prompt, QWidget *parent)
|
||||
QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer
|
||||
Utils::reloadPrompt(const QString &title, const QString &prompt, QWidget *parent)
|
||||
{
|
||||
switch (QMessageBox::question(parent, title, prompt,
|
||||
QMessageBox::Yes|QMessageBox::YesToAll|QMessageBox::No|QMessageBox::NoToAll,
|
||||
|
||||
@@ -37,7 +37,6 @@ class QString;
|
||||
class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
enum ReloadPromptAnswer { ReloadCurrent, ReloadAll, ReloadSkipCurrent, ReloadNone };
|
||||
@@ -46,6 +45,5 @@ QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &fileName,
|
||||
QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title, const QString &prompt, QWidget *parent);
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // RELOADPROMPTUTILS_H
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <QtGui/QSpinBox>
|
||||
|
||||
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -54,7 +54,7 @@ using namespace Core::Utils;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*!
|
||||
\class Core::Utils::SavedAction
|
||||
\class Utils::SavedAction
|
||||
|
||||
\brief The SavedAction class is a helper class for actions with persistent
|
||||
state.
|
||||
|
||||
@@ -42,8 +42,6 @@ QT_BEGIN_NAMESPACE
|
||||
class QSettings;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
enum ApplyMode { ImmediateApply, DeferedApply };
|
||||
@@ -122,6 +120,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // SAVED_ACTION_H
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
#include <QtCore/QString>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QString settingsKey(const QString &category)
|
||||
@@ -48,4 +47,3 @@ QTCREATOR_UTILS_EXPORT QString settingsKey(const QString &category)
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
// Create a usable settings key from a category,
|
||||
@@ -40,6 +39,5 @@ namespace Utils {
|
||||
QTCREATOR_UTILS_EXPORT QString settingsKey(const QString &category);
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // SETTINGSTUTILS_H
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <QtGui/QStyle>
|
||||
#include <QtGui/QStyleOption>
|
||||
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
|
||||
StyledBar::StyledBar(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT StyledBar : public QWidget
|
||||
@@ -56,6 +55,5 @@ protected:
|
||||
};
|
||||
|
||||
} // Utils
|
||||
} // Core
|
||||
|
||||
#endif // STYLEDBAR_H
|
||||
|
||||
@@ -52,6 +52,8 @@ static int range(float x, int min, int max)
|
||||
}
|
||||
*/
|
||||
|
||||
namespace Utils {
|
||||
|
||||
QColor StyleHelper::mergedColors(const QColor &colorA, const QColor &colorB, int factor)
|
||||
{
|
||||
const int maxFactor = 100;
|
||||
@@ -231,3 +233,5 @@ void StyleHelper::menuGradient(QPainter *painter, const QRect &spanRect, const Q
|
||||
QPixmapCache::insert(key, pixmap);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
@@ -42,6 +42,7 @@ QT_END_NAMESPACE
|
||||
|
||||
// Helper class holding all custom color values
|
||||
|
||||
namespace Utils {
|
||||
class QTCREATOR_UTILS_EXPORT StyleHelper
|
||||
{
|
||||
public:
|
||||
@@ -74,4 +75,5 @@ private:
|
||||
static QColor m_baseColor;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
#endif // STYLEHELPER_H
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
enum { debug = 0 };
|
||||
enum { defaultLineWidth = 72 };
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
// QActionPushButton: A push button tied to an action
|
||||
@@ -505,6 +504,5 @@ void SubmitEditorWidget::editorCustomContextMenuRequested(const QPoint &pos)
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#include "submiteditorwidget.moc"
|
||||
|
||||
@@ -44,7 +44,6 @@ class QModelIndex;
|
||||
class QLineEdit;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
class SubmitFieldWidget;
|
||||
@@ -144,6 +143,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // SUBMITEDITORWIDGET_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Core::Utils::SubmitEditorWidget</class>
|
||||
<widget class="QWidget" name="Core::Utils::SubmitEditorWidget">
|
||||
<class>Utils::SubmitEditorWidget</class>
|
||||
<widget class="QWidget" name="Utils::SubmitEditorWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
||||
@@ -22,8 +22,7 @@ static void inline setComboBlocked(QComboBox *cb, int index)
|
||||
cb->blockSignals(blocked);
|
||||
}
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
namespace Utils {
|
||||
|
||||
// Field/Row entry
|
||||
struct FieldEntry {
|
||||
@@ -341,4 +340,3 @@ void SubmitFieldWidget::slotBrowseButtonClicked()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,7 @@ QT_BEGIN_NAMESPACE
|
||||
class QCompleter;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
namespace Utils {
|
||||
|
||||
struct SubmitFieldWidgetPrivate;
|
||||
|
||||
@@ -65,7 +64,6 @@ private:
|
||||
SubmitFieldWidgetPrivate *m_d;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SUBMITFIELDWIDGET_H
|
||||
|
||||
@@ -44,7 +44,6 @@ enum { debug = 0 };
|
||||
|
||||
enum { defaultMaxHangTimerCount = 10 };
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
// ----------- SynchronousProcessResponse
|
||||
@@ -492,6 +491,4 @@ QChar SynchronousProcess::pathSeparator()
|
||||
return QLatin1Char(':');
|
||||
}
|
||||
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -42,7 +42,6 @@ class QDebug;
|
||||
class QByteArray;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
struct SynchronousProcessPrivate;
|
||||
@@ -146,6 +145,5 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <QtGui/QTreeWidget>
|
||||
#include <QtGui/QHideEvent>
|
||||
#include <QtGui/QHeaderView>
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
|
||||
TreeWidgetColumnStretcher::TreeWidgetColumnStretcher(QTreeWidget *treeWidget, int columnToStretch)
|
||||
: QObject(treeWidget->header()), m_columnToStretch(columnToStretch)
|
||||
|
||||
@@ -37,7 +37,6 @@ QT_BEGIN_NAMESPACE
|
||||
class QTreeWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
/*
|
||||
@@ -58,6 +57,5 @@ public:
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
#endif // TREEWIDGETCOLUMNSTRETCHER_H
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <QtGui/QTextBlock>
|
||||
#include <QtGui/QTextDocument>
|
||||
|
||||
void Core::Utils::unCommentSelection(QPlainTextEdit *edit)
|
||||
void Utils::unCommentSelection(QPlainTextEdit *edit)
|
||||
{
|
||||
QTextCursor cursor = edit->textCursor();
|
||||
QTextDocument *doc = cursor.document();
|
||||
|
||||
@@ -36,12 +36,10 @@ QT_BEGIN_NAMESPACE
|
||||
class QPlainTextEdit;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
QTCREATOR_UTILS_EXPORT void unCommentSelection(QPlainTextEdit *edit);
|
||||
|
||||
} // end of namespace Utils
|
||||
} // end of namespace Core
|
||||
|
||||
#endif // UNCOMMENTSELECTION_H
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
#include <QtGui/QBoxLayout>
|
||||
#include <QtGui/QHeaderView>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
namespace Utils {
|
||||
|
||||
void WelcomeModeLabel::setStyledText(const QString &text)
|
||||
{
|
||||
@@ -115,4 +114,3 @@ void WelcomeModeTreeWidget::slotItemClicked(QTreeWidgetItem *item)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
#include <QtGui/QTreeWidget>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
namespace Utils {
|
||||
|
||||
struct WelcomeModeTreeWidgetPrivate;
|
||||
struct WelcomeModeLabelPrivate;
|
||||
@@ -76,7 +75,6 @@ private:
|
||||
WelcomeModeTreeWidgetPrivate *m_d;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // WELCOMEMODETREEWIDGET_H
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include <QtCore/QString>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QString winErrorMessage(unsigned long error)
|
||||
@@ -53,4 +52,3 @@ QTCREATOR_UTILS_EXPORT QString winErrorMessage(unsigned long error)
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
|
||||
@@ -36,7 +36,6 @@ QT_BEGIN_NAMESPACE
|
||||
class QString;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
// Helper to format a Windows error message, taking the
|
||||
@@ -44,5 +43,4 @@ namespace Utils {
|
||||
QTCREATOR_UTILS_EXPORT QString winErrorMessage(unsigned long error);
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Core
|
||||
#endif // WINUTILS_H
|
||||
|
||||
@@ -271,17 +271,17 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (Core::Utils::reloadPrompt(fileName, isModified(), Core::ICore::instance()->mainWindow())) {
|
||||
case Core::Utils::ReloadCurrent:
|
||||
switch (Utils::reloadPrompt(fileName, isModified(), Core::ICore::instance()->mainWindow())) {
|
||||
case Utils::ReloadCurrent:
|
||||
open(fileName);
|
||||
break;
|
||||
case Core::Utils::ReloadAll:
|
||||
case Utils::ReloadAll:
|
||||
open(fileName);
|
||||
*behavior = Core::IFile::ReloadAll;
|
||||
break;
|
||||
case Core::Utils::ReloadSkipCurrent:
|
||||
case Utils::ReloadSkipCurrent:
|
||||
break;
|
||||
case Core::Utils::ReloadNone:
|
||||
case Utils::ReloadNone:
|
||||
*behavior = Core::IFile::ReloadNone;
|
||||
break;
|
||||
}
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
m_file = new BinEditorFile(parent);
|
||||
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
|
||||
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||
m_cursorPositionLabel = new Core::Utils::LineColumnLabel;
|
||||
m_cursorPositionLabel = new Utils::LineColumnLabel;
|
||||
|
||||
QHBoxLayout *l = new QHBoxLayout;
|
||||
QWidget *w = new QWidget;
|
||||
@@ -362,7 +362,7 @@ private:
|
||||
BinEditorFile *m_file;
|
||||
QList<int> m_context;
|
||||
QToolBar *m_toolBar;
|
||||
Core::Utils::LineColumnLabel *m_cursorPositionLabel;
|
||||
Utils::LineColumnLabel *m_cursorPositionLabel;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ ShadowBuildPage::ShadowBuildPage(CMakeOpenProjectWizard *cmakeWizard, bool chang
|
||||
"This ensures that the source directory remains clean and enables multiple builds "
|
||||
"with different settings."));
|
||||
fl->addWidget(label);
|
||||
m_pc = new Core::Utils::PathChooser(this);
|
||||
m_pc = new Utils::PathChooser(this);
|
||||
m_pc->setPath(m_cmakeWizard->buildDirectory());
|
||||
connect(m_pc, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
|
||||
fl->addRow(tr("Build directory:"), m_pc);
|
||||
@@ -284,8 +284,8 @@ void CMakeRunPage::initWidgets()
|
||||
|
||||
fl->addRow(new QLabel(text, this));
|
||||
// Show a field for the user to enter
|
||||
m_cmakeExecutable = new Core::Utils::PathChooser(this);
|
||||
m_cmakeExecutable->setExpectedKind(Core::Utils::PathChooser::Command);
|
||||
m_cmakeExecutable = new Utils::PathChooser(this);
|
||||
m_cmakeExecutable->setExpectedKind(Utils::PathChooser::Command);
|
||||
fl->addRow("CMake Executable", m_cmakeExecutable);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,10 +40,8 @@
|
||||
#include <QtGui/QWizard>
|
||||
#include <QtGui/QPlainTextEdit>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
class PathChooser;
|
||||
}
|
||||
namespace Utils {
|
||||
class PathChooser;
|
||||
}
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
@@ -115,7 +113,7 @@ private slots:
|
||||
void buildDirectoryChanged();
|
||||
private:
|
||||
CMakeOpenProjectWizard *m_cmakeWizard;
|
||||
Core::Utils::PathChooser *m_pc;
|
||||
Utils::PathChooser *m_pc;
|
||||
};
|
||||
|
||||
class CMakeRunPage : public QWizardPage
|
||||
@@ -139,7 +137,7 @@ private:
|
||||
QPushButton *m_runCMake;
|
||||
QProcess *m_cmakeProcess;
|
||||
QLineEdit *m_argumentsLineEdit;
|
||||
Core::Utils::PathChooser *m_cmakeExecutable;
|
||||
Utils::PathChooser *m_cmakeExecutable;
|
||||
QComboBox *m_generatorComboBox;
|
||||
QLabel *m_descriptionLabel;
|
||||
bool m_complete;
|
||||
|
||||
@@ -262,8 +262,8 @@ QWidget *CMakeSettingsPage::createPage(QWidget *parent)
|
||||
{
|
||||
QWidget *w = new QWidget(parent);
|
||||
QFormLayout *fl = new QFormLayout(w);
|
||||
m_pathchooser = new Core::Utils::PathChooser(w);
|
||||
m_pathchooser->setExpectedKind(Core::Utils::PathChooser::Command);
|
||||
m_pathchooser = new Utils::PathChooser(w);
|
||||
m_pathchooser->setExpectedKind(Utils::PathChooser::Command);
|
||||
fl->addRow(tr("CMake executable"), m_pathchooser);
|
||||
m_pathchooser->setPath(cmakeExecutable());
|
||||
return w;
|
||||
|
||||
@@ -107,7 +107,7 @@ private:
|
||||
QString findCmakeExecutable() const;
|
||||
void updateInfo();
|
||||
|
||||
Core::Utils::PathChooser *m_pathchooser;
|
||||
Utils::PathChooser *m_pathchooser;
|
||||
QString m_cmakeExecutable;
|
||||
enum STATE { VALID, INVALID, RUNNING } m_state;
|
||||
QProcess *m_process;
|
||||
|
||||
@@ -246,9 +246,9 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
|
||||
this, SLOT(setArguments(QString)));
|
||||
fl->addRow(tr("Arguments:"), argumentsLineEdit);
|
||||
|
||||
m_workingDirectoryEdit = new Core::Utils::PathChooser();
|
||||
m_workingDirectoryEdit = new Utils::PathChooser();
|
||||
m_workingDirectoryEdit->setPath(m_cmakeRunConfiguration->workingDirectory());
|
||||
m_workingDirectoryEdit->setExpectedKind(Core::Utils::PathChooser::Directory);
|
||||
m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory);
|
||||
m_workingDirectoryEdit->setPromptDialogTitle(tr("Select the working directory"));
|
||||
|
||||
QToolButton *resetButton = new QToolButton();
|
||||
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
void updateSummary();
|
||||
bool m_ignoreChange;
|
||||
CMakeRunConfiguration *m_cmakeRunConfiguration;
|
||||
Core::Utils::PathChooser *m_workingDirectoryEdit;
|
||||
Utils::PathChooser *m_workingDirectoryEdit;
|
||||
QComboBox *m_baseEnvironmentComboBox;
|
||||
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
|
||||
Utils::DetailsWidget *m_detailsContainer;
|
||||
|
||||
@@ -647,7 +647,7 @@ QWizard *StandardFileWizard::createWizardDialog(QWidget *parent,
|
||||
const QString &defaultPath,
|
||||
const WizardPageList &extensionPages) const
|
||||
{
|
||||
Core::Utils::FileWizardDialog *standardWizardDialog = new Core::Utils::FileWizardDialog(parent);
|
||||
Utils::FileWizardDialog *standardWizardDialog = new Utils::FileWizardDialog(parent);
|
||||
standardWizardDialog->setWindowTitle(tr("New %1").arg(name()));
|
||||
setupWizard(standardWizardDialog);
|
||||
standardWizardDialog->setPath(defaultPath);
|
||||
@@ -659,7 +659,7 @@ QWizard *StandardFileWizard::createWizardDialog(QWidget *parent,
|
||||
GeneratedFiles StandardFileWizard::generateFiles(const QWizard *w,
|
||||
QString *errorMessage) const
|
||||
{
|
||||
const Core::Utils::FileWizardDialog *standardWizardDialog = qobject_cast<const Core::Utils::FileWizardDialog *>(w);
|
||||
const Utils::FileWizardDialog *standardWizardDialog = qobject_cast<const Utils::FileWizardDialog *>(w);
|
||||
return generateFilesFromPath(standardWizardDialog->path(),
|
||||
standardWizardDialog->name(),
|
||||
errorMessage);
|
||||
|
||||
@@ -199,7 +199,7 @@ private:
|
||||
};
|
||||
|
||||
// StandardFileWizard convenience class for creating one file. It uses
|
||||
// Core::Utils::FileWizardDialog and introduces a new virtual to generate the
|
||||
// Utils::FileWizardDialog and introduces a new virtual to generate the
|
||||
// files from path and name.
|
||||
|
||||
class CORE_EXPORT StandardFileWizard : public BaseFileWizard
|
||||
@@ -210,7 +210,7 @@ class CORE_EXPORT StandardFileWizard : public BaseFileWizard
|
||||
protected:
|
||||
explicit StandardFileWizard(const BaseFileWizardParameters ¶meters, QObject *parent = 0);
|
||||
|
||||
// Implemented to create a Core::Utils::FileWizardDialog
|
||||
// Implemented to create a Utils::FileWizardDialog
|
||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||
const QString &defaultPath,
|
||||
const WizardPageList &extensionPages) const;
|
||||
|
||||
@@ -113,7 +113,7 @@ QWidget *ShortcutSettings::createPage(QWidget *parent)
|
||||
this, SLOT(commandChanged(QTreeWidgetItem *)));
|
||||
connect(m_page->shortcutEdit, SIGNAL(textChanged(QString)), this, SLOT(keyChanged()));
|
||||
|
||||
new Core::Utils::TreeWidgetColumnStretcher(m_page->commandList, 1);
|
||||
new Utils::TreeWidgetColumnStretcher(m_page->commandList, 1);
|
||||
|
||||
commandChanged(0);
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ Q_DECLARE_METATYPE(Core::IEditor*)
|
||||
|
||||
using namespace Core;
|
||||
using namespace Core::Internal;
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
|
||||
enum { debugEditorManager=0 };
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ EditorView::EditorView(OpenEditorsModel *model, QWidget *parent) :
|
||||
toplayout->addWidget(m_lockButton);
|
||||
toplayout->addWidget(m_closeButton);
|
||||
|
||||
Core::Utils::StyledBar *top = new Core::Utils::StyledBar;
|
||||
Utils::StyledBar *top = new Utils::StyledBar;
|
||||
top->setLayout(toplayout);
|
||||
tl->addWidget(top);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ FancyTabBar::~FancyTabBar()
|
||||
QSize FancyTabBar::tabSizeHint(bool minimum) const
|
||||
{
|
||||
QFont boldFont(font());
|
||||
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
|
||||
boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
|
||||
boldFont.setBold(true);
|
||||
QFontMetrics fm(boldFont);
|
||||
int spacing = 6;
|
||||
@@ -245,13 +245,13 @@ void FancyTabBar::paintTab(QPainter *painter, int tabIndex) const
|
||||
QRect tabTextRect(tabRect(tabIndex));
|
||||
QRect tabIconRect(tabTextRect);
|
||||
QFont boldFont(painter->font());
|
||||
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
|
||||
boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
|
||||
boldFont.setBold(true);
|
||||
painter->setFont(boldFont);
|
||||
painter->setPen(selected ? StyleHelper::panelTextColor() : QColor(30, 30, 30, 80));
|
||||
painter->setPen(selected ? Utils::StyleHelper::panelTextColor() : QColor(30, 30, 30, 80));
|
||||
int textFlags = Qt::AlignCenter | Qt::AlignBottom | Qt::ElideRight | Qt::TextWordWrap;
|
||||
painter->drawText(tabTextRect, textFlags, tabText);
|
||||
painter->setPen(selected ? QColor(60, 60, 60) : StyleHelper::panelTextColor());
|
||||
painter->setPen(selected ? QColor(60, 60, 60) : Utils::StyleHelper::panelTextColor());
|
||||
int textHeight = painter->fontMetrics().boundingRect(QRect(0, 0, width(), height()), Qt::TextWordWrap, tabText).height();
|
||||
tabIconRect.adjust(0, 4, 0, -textHeight);
|
||||
int iconSize = qMin(tabIconRect.width(), tabIconRect.height());
|
||||
@@ -285,7 +285,7 @@ public:
|
||||
void mousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
if (ev->modifiers() & Qt::ShiftModifier)
|
||||
StyleHelper::setBaseColor(QColorDialog::getColor(StyleHelper::baseColor(), m_parent));
|
||||
Utils::StyleHelper::setBaseColor(QColorDialog::getColor(Utils::StyleHelper::baseColor(), m_parent));
|
||||
}
|
||||
private:
|
||||
QWidget *m_parent;
|
||||
@@ -305,7 +305,7 @@ FancyTabWidget::FancyTabWidget(QWidget *parent)
|
||||
selectionLayout->setSpacing(0);
|
||||
selectionLayout->setMargin(0);
|
||||
|
||||
Core::Utils::StyledBar *bar = new Core::Utils::StyledBar;
|
||||
Utils::StyledBar *bar = new Utils::StyledBar;
|
||||
QHBoxLayout *layout = new QHBoxLayout(bar);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(0);
|
||||
@@ -377,8 +377,8 @@ void FancyTabWidget::paintEvent(QPaintEvent *event)
|
||||
|
||||
QRect rect = m_selectionWidget->rect().adjusted(0, 0, 1, 0);
|
||||
rect = style()->visualRect(layoutDirection(), geometry(), rect);
|
||||
StyleHelper::verticalGradient(&p, rect, rect);
|
||||
p.setPen(StyleHelper::borderColor());
|
||||
Utils::StyleHelper::verticalGradient(&p, rect, rect);
|
||||
p.setPen(Utils::StyleHelper::borderColor());
|
||||
p.drawLine(rect.topRight(), rect.bottomRight());
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
#include "ui_generalsettings.h"
|
||||
|
||||
using namespace Core::Utils;
|
||||
using namespace Utils;
|
||||
using namespace Core::Internal;
|
||||
|
||||
GeneralSettings::GeneralSettings():
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Core::Utils::QtColorButton" name="colorButton">
|
||||
<widget class="Utils::QtColorButton" name="colorButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -228,7 +228,7 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Core::Utils::QtColorButton</class>
|
||||
<class>Utils::QtColorButton</class>
|
||||
<extends>QToolButton</extends>
|
||||
<header location="global">utils/qtcolorbutton.h</header>
|
||||
</customwidget>
|
||||
|
||||
@@ -863,7 +863,7 @@ QStringList MainWindow::showNewItemDialog(const QString &title,
|
||||
if (defaultDir.isEmpty() && !m_coreImpl->fileManager()->currentFile().isEmpty())
|
||||
defaultDir = QFileInfo(m_coreImpl->fileManager()->currentFile()).absolutePath();
|
||||
if (defaultDir.isEmpty())
|
||||
defaultDir = Core::Utils::PathChooser::homePath();
|
||||
defaultDir = Utils::PathChooser::homePath();
|
||||
|
||||
// Scan for wizards matching the filter and pick one. Don't show
|
||||
// dialog if there is only one.
|
||||
@@ -1101,7 +1101,7 @@ void MainWindow::readSettings()
|
||||
{
|
||||
m_settings->beginGroup(QLatin1String(settingsGroup));
|
||||
|
||||
StyleHelper::setBaseColor(m_settings->value(QLatin1String(colorKey)).value<QColor>());
|
||||
Utils::StyleHelper::setBaseColor(m_settings->value(QLatin1String(colorKey)).value<QColor>());
|
||||
|
||||
const QVariant geom = m_settings->value(QLatin1String(geometryKey));
|
||||
if (geom.isValid()) {
|
||||
@@ -1124,7 +1124,7 @@ void MainWindow::writeSettings()
|
||||
{
|
||||
m_settings->beginGroup(QLatin1String(settingsGroup));
|
||||
|
||||
m_settings->setValue(QLatin1String(colorKey), StyleHelper::baseColor());
|
||||
m_settings->setValue(QLatin1String(colorKey), Utils::StyleHelper::baseColor());
|
||||
|
||||
if (windowState() & (Qt::WindowMaximized | Qt::WindowFullScreen)) {
|
||||
m_settings->setValue(QLatin1String(maxKey), (bool) (windowState() & Qt::WindowMaximized));
|
||||
|
||||
@@ -35,11 +35,6 @@
|
||||
#include "eventfilteringmainwindow.h"
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QPointer>
|
||||
#include <QtGui/QPrinter>
|
||||
#include <QtGui/QToolButton>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QSettings;
|
||||
|
||||
@@ -287,7 +287,7 @@ void ManhattanStyle::unpolish(QApplication *app)
|
||||
|
||||
QPalette panelPalette(const QPalette &oldPalette)
|
||||
{
|
||||
QColor color = StyleHelper::panelTextColor();
|
||||
QColor color = Utils::StyleHelper::panelTextColor();
|
||||
QPalette pal = oldPalette;
|
||||
pal.setBrush(QPalette::All, QPalette::WindowText, color);
|
||||
pal.setBrush(QPalette::All, QPalette::ButtonText, color);
|
||||
@@ -312,20 +312,20 @@ void ManhattanStyle::polish(QWidget *widget)
|
||||
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
|
||||
if (qobject_cast<QToolButton*>(widget)) {
|
||||
widget->setAttribute(Qt::WA_Hover);
|
||||
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
|
||||
widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
|
||||
}
|
||||
else if (qobject_cast<QLineEdit*>(widget)) {
|
||||
widget->setAttribute(Qt::WA_Hover);
|
||||
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
|
||||
widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
|
||||
}
|
||||
else if (qobject_cast<QLabel*>(widget))
|
||||
widget->setPalette(panelPalette(widget->palette()));
|
||||
else if (qobject_cast<QToolBar*>(widget) || widget->property("panelwidget_singlerow").toBool())
|
||||
widget->setFixedHeight(StyleHelper::navigationWidgetHeight());
|
||||
widget->setFixedHeight(Utils::StyleHelper::navigationWidgetHeight());
|
||||
else if (qobject_cast<QStatusBar*>(widget))
|
||||
widget->setFixedHeight(StyleHelper::navigationWidgetHeight() + 2);
|
||||
widget->setFixedHeight(Utils::StyleHelper::navigationWidgetHeight() + 2);
|
||||
else if (qobject_cast<QComboBox*>(widget)) {
|
||||
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
|
||||
widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
|
||||
widget->setAttribute(Qt::WA_Hover);
|
||||
}
|
||||
}
|
||||
@@ -486,7 +486,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
||||
drawCornerImage(d->lineeditImage_disabled, painter, option->rect, 2, 2, 2, 2);
|
||||
|
||||
if (option->state & State_HasFocus || option->state & State_MouseOver) {
|
||||
QColor hover = StyleHelper::baseColor();
|
||||
QColor hover = Utils::StyleHelper::baseColor();
|
||||
if (state & State_HasFocus)
|
||||
hover.setAlpha(100);
|
||||
else
|
||||
@@ -533,15 +533,15 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
||||
{
|
||||
painter->save();
|
||||
QLinearGradient grad(option->rect.topLeft(), QPoint(rect.center().x(), rect.bottom()));
|
||||
QColor startColor = StyleHelper::shadowColor().darker(164);
|
||||
QColor endColor = StyleHelper::baseColor().darker(130);
|
||||
QColor startColor = Utils::StyleHelper::shadowColor().darker(164);
|
||||
QColor endColor = Utils::StyleHelper::baseColor().darker(130);
|
||||
grad.setColorAt(0, startColor);
|
||||
grad.setColorAt(1, endColor);
|
||||
painter->fillRect(option->rect, grad);
|
||||
painter->setPen(QColor(255, 255, 255, 60));
|
||||
painter->drawLine(rect.topLeft() + QPoint(0,1),
|
||||
rect.topRight()+ QPoint(0,1));
|
||||
painter->setPen(StyleHelper::borderColor().darker(110));
|
||||
painter->setPen(Utils::StyleHelper::borderColor().darker(110));
|
||||
painter->drawLine(rect.topLeft(), rect.topRight());
|
||||
painter->restore();
|
||||
}
|
||||
@@ -549,7 +549,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
||||
|
||||
case PE_IndicatorToolBarSeparator:
|
||||
{
|
||||
QColor separatorColor = StyleHelper::borderColor();
|
||||
QColor separatorColor = Utils::StyleHelper::borderColor();
|
||||
separatorColor.setAlpha(100);
|
||||
painter->setPen(separatorColor);
|
||||
const int margin = 6;
|
||||
@@ -593,10 +593,10 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
||||
}
|
||||
|
||||
painter->setPen(Qt::NoPen);
|
||||
QColor dark = StyleHelper::borderColor();
|
||||
QColor dark = Utils::StyleHelper::borderColor();
|
||||
dark.setAlphaF(0.4);
|
||||
|
||||
QColor light = StyleHelper::baseColor();
|
||||
QColor light = Utils::StyleHelper::baseColor();
|
||||
light.setAlphaF(0.4);
|
||||
|
||||
painter->fillPath(path, light);
|
||||
@@ -709,10 +709,10 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
case CE_MenuBarItem:
|
||||
painter->save();
|
||||
if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
|
||||
QColor highlightOutline = StyleHelper::borderColor().lighter(120);
|
||||
QColor highlightOutline = Utils::StyleHelper::borderColor().lighter(120);
|
||||
bool act = mbi->state & State_Selected && mbi->state & State_Sunken;
|
||||
bool dis = !(mbi->state & State_Enabled);
|
||||
StyleHelper::menuGradient(painter, option->rect, option->rect);
|
||||
Utils::StyleHelper::menuGradient(painter, option->rect, option->rect);
|
||||
QStyleOptionMenuItem item = *mbi;
|
||||
item.rect = mbi->rect;
|
||||
QPalette pal = mbi->palette;
|
||||
@@ -723,7 +723,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
|
||||
if (act) {
|
||||
// Fill|
|
||||
QColor baseColor = StyleHelper::baseColor();
|
||||
QColor baseColor = Utils::StyleHelper::baseColor();
|
||||
QLinearGradient grad(option->rect.topLeft(), option->rect.bottomLeft());
|
||||
grad.setColorAt(0, baseColor.lighter(120));
|
||||
grad.setColorAt(1, baseColor.lighter(130));
|
||||
@@ -786,7 +786,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
drawItemText(painter, editRect.translated(0, 1),
|
||||
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
|
||||
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
|
||||
customPal.setBrush(QPalette::All, QPalette::ButtonText, StyleHelper::panelTextColor());
|
||||
customPal.setBrush(QPalette::All, QPalette::ButtonText, Utils::StyleHelper::panelTextColor());
|
||||
drawItemText(painter, editRect,
|
||||
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
|
||||
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
|
||||
@@ -830,9 +830,9 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
break;
|
||||
|
||||
case CE_MenuBarEmptyArea: {
|
||||
StyleHelper::menuGradient(painter, option->rect, option->rect);
|
||||
Utils::StyleHelper::menuGradient(painter, option->rect, option->rect);
|
||||
painter->save();
|
||||
painter->setPen(StyleHelper::borderColor());
|
||||
painter->setPen(Utils::StyleHelper::borderColor());
|
||||
painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight());
|
||||
painter->restore();
|
||||
}
|
||||
@@ -841,12 +841,12 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
case CE_ToolBar:
|
||||
{
|
||||
QString key;
|
||||
key.sprintf("mh_toolbar %d %d %d", option->rect.width(), option->rect.height(), StyleHelper::baseColor().rgb());;
|
||||
key.sprintf("mh_toolbar %d %d %d", option->rect.width(), option->rect.height(), Utils::StyleHelper::baseColor().rgb());;
|
||||
|
||||
QPixmap pixmap;
|
||||
QPainter *p = painter;
|
||||
QRect rect = option->rect;
|
||||
if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) {
|
||||
if (Utils::StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) {
|
||||
pixmap = QPixmap(option->rect.size());
|
||||
p = new QPainter(&pixmap);
|
||||
rect = QRect(0, 0, option->rect.width(), option->rect.height());
|
||||
@@ -861,11 +861,11 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
gradientSpan = QRect(offset, widget->window()->size());
|
||||
}
|
||||
if (horizontal)
|
||||
StyleHelper::horizontalGradient(p, gradientSpan, rect);
|
||||
Utils::StyleHelper::horizontalGradient(p, gradientSpan, rect);
|
||||
else
|
||||
StyleHelper::verticalGradient(p, gradientSpan, rect);
|
||||
Utils::StyleHelper::verticalGradient(p, gradientSpan, rect);
|
||||
|
||||
painter->setPen(StyleHelper::borderColor());
|
||||
painter->setPen(Utils::StyleHelper::borderColor());
|
||||
|
||||
if (horizontal) {
|
||||
// Note: This is a hack to determine if the
|
||||
@@ -886,7 +886,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
p->drawLine(rect.topRight(), rect.bottomRight());
|
||||
}
|
||||
|
||||
if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) {
|
||||
if (Utils::StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) {
|
||||
painter->drawPixmap(rect.topLeft(), pixmap);
|
||||
p->end();
|
||||
delete p;
|
||||
@@ -946,7 +946,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
||||
fr.rect.adjust(0, 0, -pixelMetric(QStyle::PM_MenuButtonIndicator,
|
||||
toolbutton, widget), 0);
|
||||
QPen oldPen = painter->pen();
|
||||
QColor focusColor = StyleHelper::panelTextColor();
|
||||
QColor focusColor = Utils::StyleHelper::panelTextColor();
|
||||
focusColor.setAlpha(120);
|
||||
QPen outline(focusColor, 1);
|
||||
outline.setStyle(Qt::DotLine);
|
||||
|
||||
@@ -71,7 +71,7 @@ void MiniSplitterHandle::resizeEvent(QResizeEvent *event)
|
||||
void MiniSplitterHandle::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.fillRect(event->rect(), StyleHelper::borderColor());
|
||||
painter.fillRect(event->rect(), Utils::StyleHelper::borderColor());
|
||||
}
|
||||
|
||||
QSplitterHandle *MiniSplitter::createHandle()
|
||||
|
||||
@@ -369,7 +369,7 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget)
|
||||
m_navigationComboBox->setMinimumContentsLength(0);
|
||||
m_navigationWidget = 0;
|
||||
|
||||
m_toolBar = new Core::Utils::StyledBar(this);
|
||||
m_toolBar = new Utils::StyledBar(this);
|
||||
QHBoxLayout *toolBarLayout = new QHBoxLayout;
|
||||
toolBarLayout->setMargin(0);
|
||||
toolBarLayout->setSpacing(0);
|
||||
|
||||
@@ -40,10 +40,11 @@ class QShortcut;
|
||||
class QToolButton;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
class StyledBar;
|
||||
}
|
||||
|
||||
namespace Core {
|
||||
class INavigationWidgetFactory;
|
||||
class IMode;
|
||||
class Command;
|
||||
@@ -147,7 +148,7 @@ private:
|
||||
NavigationWidget *m_parentWidget;
|
||||
QComboBox *m_navigationComboBox;
|
||||
QWidget *m_navigationWidget;
|
||||
Core::Utils::StyledBar *m_toolBar;
|
||||
Utils::StyledBar *m_toolBar;
|
||||
QList<QToolButton *> m_additionalToolBarWidgets;
|
||||
};
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
|
||||
QVBoxLayout *mainlayout = new QVBoxLayout;
|
||||
mainlayout->setSpacing(0);
|
||||
mainlayout->setMargin(0);
|
||||
m_toolBar = new Core::Utils::StyledBar;
|
||||
m_toolBar = new Utils::StyledBar;
|
||||
QHBoxLayout *toolLayout = new QHBoxLayout(m_toolBar);
|
||||
toolLayout->setMargin(0);
|
||||
toolLayout->setSpacing(0);
|
||||
|
||||
@@ -125,8 +125,8 @@ void ProgressBar::mouseMoveEvent(QMouseEvent *)
|
||||
|
||||
void ProgressBar::paintEvent(QPaintEvent *)
|
||||
{
|
||||
// TODO move font into stylehelper
|
||||
// TODO use stylehelper white
|
||||
// TODO move font into Utils::StyleHelper
|
||||
// TODO use Utils::StyleHelper white
|
||||
|
||||
double range = maximum() - minimum();
|
||||
double percent = 0.50;
|
||||
@@ -139,7 +139,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
|
||||
QPainter p(this);
|
||||
QFont boldFont(p.font());
|
||||
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
|
||||
boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
|
||||
boldFont.setBold(true);
|
||||
p.setFont(boldFont);
|
||||
QFontMetrics fm(boldFont);
|
||||
@@ -158,7 +158,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
p.setPen(QColor(30, 30, 30, 80));
|
||||
p.drawText(textRect, Qt::AlignHCenter | Qt::AlignBottom, m_title);
|
||||
p.translate(0, -1);
|
||||
p.setPen(StyleHelper::panelTextColor());
|
||||
p.setPen(Utils::StyleHelper::panelTextColor());
|
||||
p.drawText(textRect, Qt::AlignHCenter | Qt::AlignBottom, m_title);
|
||||
p.translate(0, 1);
|
||||
|
||||
@@ -166,11 +166,11 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
m_progressHeight += ((m_progressHeight % 2) + 1) % 2; // make odd
|
||||
// draw outer rect
|
||||
QRect rect(INDENT - 1, h+6, size().width()-2*INDENT, m_progressHeight-1);
|
||||
p.setPen(StyleHelper::panelTextColor());
|
||||
p.setPen(Utils::StyleHelper::panelTextColor());
|
||||
p.drawRect(rect);
|
||||
|
||||
// draw inner rect
|
||||
QColor c = StyleHelper::panelTextColor();
|
||||
QColor c = Utils::StyleHelper::panelTextColor();
|
||||
c.setAlpha(180);
|
||||
p.setPen(Qt::NoPen);
|
||||
|
||||
@@ -196,7 +196,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
p.drawRect(inner);
|
||||
|
||||
if (value() < maximum() && !m_error) {
|
||||
QColor cancelOutline = StyleHelper::panelTextColor();
|
||||
QColor cancelOutline = Utils::StyleHelper::panelTextColor();
|
||||
p.setPen(cancelOutline);
|
||||
QRect cancelRect(rect.right() - m_progressHeight + 2, rect.top(), m_progressHeight-1, rect.height());
|
||||
if (cancelRect.contains(mapFromGlobal(QCursor::pos())))
|
||||
@@ -210,7 +210,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
p.drawLine(cancelRect.center()+QPoint(-1,-1), cancelRect.center()+QPoint(+3,+3));
|
||||
p.drawLine(cancelRect.center()+QPoint(+3,-1), cancelRect.center()+QPoint(-1,+3));
|
||||
|
||||
p.setPen(StyleHelper::panelTextColor());
|
||||
p.setPen(Utils::StyleHelper::panelTextColor());
|
||||
p.drawLine(cancelRect.center()+QPoint(-1,-1), cancelRect.center()+QPoint(+3,+3));
|
||||
p.drawLine(cancelRect.center()+QPoint(+3,-1), cancelRect.center()+QPoint(-1,+3));
|
||||
}
|
||||
|
||||
@@ -288,9 +288,9 @@ void SideBarWidget::setCurrentItem(const QString &title)
|
||||
int idx = m_comboBox->findText(title);
|
||||
if (idx < 0)
|
||||
idx = 0;
|
||||
m_comboBox->blockSignals(true);
|
||||
bool blocked = m_comboBox->blockSignals(true);
|
||||
m_comboBox->setCurrentIndex(idx);
|
||||
m_comboBox->blockSignals(false);
|
||||
m_comboBox->blockSignals(blocked);
|
||||
}
|
||||
|
||||
SideBarItem *item = m_sideBar->item(title);
|
||||
@@ -307,7 +307,7 @@ void SideBarWidget::setCurrentItem(const QString &title)
|
||||
|
||||
void SideBarWidget::updateAvailableItems()
|
||||
{
|
||||
m_comboBox->blockSignals(true);
|
||||
bool blocked = m_comboBox->blockSignals(true);
|
||||
QString current = m_comboBox->currentText();
|
||||
m_comboBox->clear();
|
||||
QStringList itms = m_sideBar->availableItems();
|
||||
@@ -320,7 +320,7 @@ void SideBarWidget::updateAvailableItems()
|
||||
idx = 0;
|
||||
m_comboBox->setCurrentIndex(idx);
|
||||
m_splitButton->setEnabled(itms.count() > 1);
|
||||
m_comboBox->blockSignals(false);
|
||||
m_comboBox->blockSignals(blocked);
|
||||
}
|
||||
|
||||
void SideBarWidget::removeCurrentItem()
|
||||
|
||||
@@ -63,7 +63,7 @@ ClassNamePage::ClassNamePage(QWidget *parent) :
|
||||
setTitle(tr("Enter class name"));
|
||||
setSubTitle(tr("The header and source file names will be derived from the class name"));
|
||||
|
||||
m_newClassWidget = new Core::Utils::NewClassWidget;
|
||||
m_newClassWidget = new Utils::NewClassWidget;
|
||||
// Order, set extensions first before suggested name is derived
|
||||
m_newClassWidget->setBaseClassInputVisible(true);
|
||||
m_newClassWidget->setBaseClassChoices(QStringList() << QString()
|
||||
@@ -148,7 +148,7 @@ void CppClassWizardDialog::setPath(const QString &path)
|
||||
CppClassWizardParameters CppClassWizardDialog::parameters() const
|
||||
{
|
||||
CppClassWizardParameters rc;
|
||||
const Core::Utils::NewClassWidget *ncw = m_classNamePage->newClassWidget();
|
||||
const Utils::NewClassWidget *ncw = m_classNamePage->newClassWidget();
|
||||
rc.className = ncw->className();
|
||||
rc.headerFile = ncw->headerFileName();
|
||||
rc.sourceFile = ncw->sourceFileName();
|
||||
@@ -216,7 +216,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
|
||||
{
|
||||
// TODO:
|
||||
// Quite a bit of this code has been copied from FormClassWizardParameters::generateCpp.
|
||||
// Maybe more of it could be merged into Core::Utils.
|
||||
// Maybe more of it could be merged into Utils.
|
||||
|
||||
const QString indent = QString(4, QLatin1Char(' '));
|
||||
|
||||
@@ -228,7 +228,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
|
||||
const QString license = CppTools::AbstractEditorSupport::licenseTemplate();
|
||||
|
||||
const QString unqualifiedClassName = namespaceList.takeLast();
|
||||
const QString guard = Core::Utils::headerGuard(params.headerFile);
|
||||
const QString guard = Utils::headerGuard(params.headerFile);
|
||||
|
||||
// == Header file ==
|
||||
QTextStream headerStr(header);
|
||||
@@ -240,10 +240,10 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
|
||||
const bool superIsQtClass = qtClassExpr.exactMatch(params.baseClass);
|
||||
if (superIsQtClass) {
|
||||
headerStr << '\n';
|
||||
Core::Utils::writeIncludeFileDirective(params.baseClass, true, headerStr);
|
||||
Utils::writeIncludeFileDirective(params.baseClass, true, headerStr);
|
||||
}
|
||||
|
||||
const QString namespaceIndent = Core::Utils::writeOpeningNameSpaces(namespaceList, QString(), headerStr);
|
||||
const QString namespaceIndent = Utils::writeOpeningNameSpaces(namespaceList, QString(), headerStr);
|
||||
|
||||
// Class declaration
|
||||
headerStr << '\n';
|
||||
@@ -257,7 +257,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
|
||||
<< namespaceIndent << indent << unqualifiedClassName << "();\n";
|
||||
headerStr << namespaceIndent << "};\n";
|
||||
|
||||
Core::Utils::writeClosingNameSpaces(namespaceList, QString(), headerStr);
|
||||
Utils::writeClosingNameSpaces(namespaceList, QString(), headerStr);
|
||||
|
||||
headerStr << '\n';
|
||||
headerStr << "#endif // "<< guard << '\n';
|
||||
@@ -266,13 +266,13 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
|
||||
// == Source file ==
|
||||
QTextStream sourceStr(source);
|
||||
sourceStr << license;
|
||||
Core::Utils::writeIncludeFileDirective(params.headerFile, false, sourceStr);
|
||||
Core::Utils::writeOpeningNameSpaces(namespaceList, QString(), sourceStr);
|
||||
Utils::writeIncludeFileDirective(params.headerFile, false, sourceStr);
|
||||
Utils::writeOpeningNameSpaces(namespaceList, QString(), sourceStr);
|
||||
|
||||
// Constructor
|
||||
sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::" << unqualifiedClassName << "()\n";
|
||||
sourceStr << namespaceIndent << "{\n" << namespaceIndent << "}\n";
|
||||
|
||||
Core::Utils::writeClosingNameSpaces(namespaceList, QString(), sourceStr);
|
||||
Utils::writeClosingNameSpaces(namespaceList, QString(), sourceStr);
|
||||
return true;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user