\n";
@@ -1693,7 +1758,8 @@ void HtmlGenerator::generateNavigationBar(const NavigationBar& bar,
}
#endif
-QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, CodeMarker *marker)
+QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner,
+ CodeMarker *marker)
{
QList sections;
QList::ConstIterator s;
@@ -1744,7 +1810,8 @@ QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner,
if (status == CodeMarker::Compat) {
title = "Qt 3 Support Members for " + inner->name();
fileName = fileBase(inner) + "-qt3." + fileExtension(inner);
- } else {
+ }
+ else {
title = "Obsolete Members for " + inner->name();
fileName = fileBase(inner) + "-obsolete." + fileExtension(inner);
}
@@ -1758,10 +1825,11 @@ QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner,
"Qt 3 support layer. "
"They are provided to help you port old code to Qt 4. We advise against "
"using them in new code.
\n";
- } else {
- out() << "
The following class members are obsolete. They are provided to keep "
- "old source code working. We strongly advise against using them in new "
- "code.
\n";
+ }
+ else {
+ out() << "
The following class members are obsolete. "
+ << "They are provided to keep old source code working. "
+ << "We strongly advise against using them in new code.
";
+}
+
+/*!
+ Output the "Inherits" line for the QML element,
+ if there should be one.
+ */
+void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn,
+ CodeMarker* marker)
+{
+ if (cn && !cn->links().empty()) {
+ if (cn->links().contains(Node::InheritsLink)) {
+ QPair linkPair;
+ linkPair = cn->links()[Node::InheritsLink];
+ QStringList strList(linkPair.first);
+ const Node* n = tre->findNode(strList,Node::Fake);
+ if (n && n->subType() == Node::QmlClass) {
+ const QmlClassNode* qcn = static_cast(n);
+ out() << "
";
+ Text text;
+ text << "[Inherits ";
+ text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
+ text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
+ text << Atom(Atom::String, linkPair.second);
+ text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
+ text << "]";
+ generateText(text, cn, marker);
+ out() << "
";
+ }
+// else
+// qDebug() << "generateQmlInherits(): "
+// << "Inherited element not documented -->"
+// << linkPair.first;
+ }
+ }
+}
+
+/*!
+ Output the "[Xxx instantiates the C++ class QFxXxx]"
+ line for the QML element, if there should be one.
+
+ If there is no class node, or if the class node status
+ is set to Node::Internal, do nothing.
+ */
+void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn,
+ CodeMarker* marker)
+{
+ const ClassNode* cn = qcn->classNode();
+ if (cn && (cn->status() != Node::Internal)) {
+ out() << "
";
+ Text text;
+ text << "[";
+ text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
+ text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
+ text << Atom(Atom::String, qcn->name());
+ text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
+ text << " instantiates the C++ class ";
+ text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
+ text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
+ text << Atom(Atom::String, cn->name());
+ text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
+ text << "]";
+ generateText(text, qcn, marker);
+ out() << "
";
+ }
+}
+
+/*!
+ Output the "[QFxXxx is instantiated by QML element Xxx]"
+ line for the class, if there should be one.
+
+ If there is no QML element, or if the class node status
+ is set to Node::Internal, do nothing.
+ */
+void HtmlGenerator::generateInstantiatedBy(const ClassNode* cn,
+ CodeMarker* marker)
+{
+ if (cn && cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) {
+ const Node* n = tre->root()->findNode(cn->qmlElement(),Node::Fake);
+ if (n && n->subType() == Node::QmlClass) {
+ out() << "
";
+ Text text;
+ text << "[";
+ text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
+ text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
+ text << Atom(Atom::String, cn->name());
+ text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
+ text << " is instantiated by QML element ";
+ text << Atom(Atom::LinkNode,CodeMarker::stringForNode(n));
+ text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
+ text << Atom(Atom::String, n->name());
+ text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
+ text << "]";
+ generateText(text, cn, marker);
+ out() << "
";
+ }
+ }
+}
+
+#endif
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index a7632cd..180c307 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -145,6 +145,21 @@ class HtmlGenerator : public PageGenerator
const Node *relative,
CodeMarker *marker,
CodeMarker::SynopsisStyle style);
+#ifdef QDOC_QML
+ void generateQmlSummary(const Section& section,
+ const Node *relative,
+ CodeMarker *marker);
+ void generateQmlItem(const Node *node,
+ const Node *relative,
+ CodeMarker *marker,
+ bool summary);
+ void generateDetailedQmlMember(const Node *node,
+ const InnerNode *relative,
+ CodeMarker *marker);
+ void generateQmlInherits(const QmlClassNode* cn, CodeMarker* marker);
+ void generateQmlInstantiates(const QmlClassNode* qcn, CodeMarker* marker);
+ void generateInstantiatedBy(const ClassNode* cn, CodeMarker* marker);
+#endif
#ifdef QDOC_NAME_ALIGNMENT
void generateSection(const NodeList& nl,
const Node *relative,
@@ -180,8 +195,12 @@ class HtmlGenerator : public PageGenerator
const Node *relative,
CodeMarker *marker,
const Node *actualNode = 0);
- void generateDetailedMember(const Node *node, const InnerNode *relative, CodeMarker *marker);
- void generateLink(const Atom *atom, const Node *relative, CodeMarker *marker);
+ void generateDetailedMember(const Node *node,
+ const InnerNode *relative,
+ CodeMarker *marker);
+ void generateLink(const Atom *atom,
+ const Node *relative,
+ CodeMarker *marker);
void generateStatus(const Node *node, CodeMarker *marker);
QString registerRef(const QString& ref);
diff --git a/tools/qdoc3/jambiapiparser.cpp b/tools/qdoc3/jambiapiparser.cpp
index f981e6d..70e9260 100644
--- a/tools/qdoc3/jambiapiparser.cpp
+++ b/tools/qdoc3/jambiapiparser.cpp
@@ -234,8 +234,9 @@ void JambiApiParser::doneParsingSourceFiles(Tree * /* tree */)
foreach (Node *cppNode, cppTre->root()->childNodes()) {
if (cppNode->type() == Node::Fake) {
FakeNode *cppFake = static_cast(cppNode);
- if (cppFake->subType() == FakeNode::Page) {
- FakeNode *javaFake = new FakeNode(javaTre->root(), cppFake->name(),
+ if (cppFake->subType() == Node::Page) {
+ FakeNode *javaFake = new FakeNode(javaTre->root(),
+ cppFake->name(),
cppFake->subType());
javaFake->setModuleName("com.trolltech.qt"); // ### hard-coded
javaFake->setTitle(cppFake->title());
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index b2e53ab..610249d 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -43,6 +43,7 @@
node.cpp
*/
+#include
#include "node.h"
QT_BEGIN_NAMESPACE
@@ -113,6 +114,9 @@ void Node::setRelates(InnerNode *pseudoParent)
}
/*!
+ This function creates a pair that describes a link.
+ The pair is composed from \a link and \a desc. The
+ \a linkType is the map index the pair is filed under.
*/
void Node::setLink(LinkType linkType, const QString &link, const QString &desc)
{
@@ -623,7 +627,7 @@ void InnerNode::removeRelated(Node *pseudoChild)
*/
/*!
- Returns false because this is an InnerNode.
+ Returns false because this is a LeafNode.
*/
bool LeafNode::isInnerNode() const
{
@@ -713,9 +717,11 @@ void ClassNode::fixBaseClasses()
*/
/*!
+ The type of a FakeNode is Fake, and it has a \a subtype,
+ which specifies the type of FakeNode.
*/
-FakeNode::FakeNode(InnerNode *parent, const QString& name, SubType subType)
- : InnerNode(Fake, parent, name), sub(subType)
+FakeNode::FakeNode(InnerNode *parent, const QString& name, SubType subtype)
+ : InnerNode(Fake, parent, name), sub(subtype)
{
}
@@ -1033,4 +1039,98 @@ bool TargetNode::isInnerNode() const
return false;
}
+#ifdef QDOC_QML
+/*!
+ Constructor for the Qml class node.
+ */
+QmlClassNode::QmlClassNode(InnerNode *parent,
+ const QString& name,
+ const ClassNode* cn)
+ : FakeNode(parent, name, QmlClass), cnode(cn)
+{
+ setTitle("QML " + name + " Element Reference");
+}
+
+/*!
+ The base file name for this kind of node has "qml_"
+ prepended to it.
+
+ But not yet. Still testing.
+ */
+QString QmlClassNode::fileBase() const
+{
+#if 0
+ if (Node::fileBase() == "item")
+ qDebug() << "FILEBASE: qmlitem" << name();
+ return "qml_" + Node::fileBase();
+#endif
+ return Node::fileBase();
+}
+
+/*!
+ Constructor for the Qml property group node. \a parent is
+ always a QmlClassNode.
+ */
+QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name)
+ : FakeNode(parent, name, QmlPropertyGroup), isdefault(false)
+{
+ // nothing.
+}
+
+/*!
+ Constructor for the QML property node.
+ */
+QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent,
+ const QString& name,
+ const QString& type)
+ : LeafNode(QmlProperty, parent, name),
+ dt(type),
+ sto(Trool_Default),
+ des(Trool_Default)
+{
+ // nothing.
+}
+
+/*!
+ I don't know what this is.
+ */
+QmlPropertyNode::Trool QmlPropertyNode::toTrool(bool boolean)
+{
+ return boolean ? Trool_True : Trool_False;
+}
+
+/*!
+ I don't know what this is either.
+ */
+bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue)
+{
+ switch (troolean) {
+ case Trool_True:
+ return true;
+ case Trool_False:
+ return false;
+ default:
+ return defaultValue;
+ }
+}
+
+/*!
+ Constructor for the QML signal node.
+ */
+QmlSignalNode::QmlSignalNode(QmlClassNode *parent, const QString& name)
+ : LeafNode(QmlSignal, parent, name)
+{
+ // nothing.
+}
+
+/*!
+ Constructor for the QML method node.
+ */
+QmlMethodNode::QmlMethodNode(QmlClassNode *parent, const QString& name)
+ : LeafNode(QmlMethod, parent, name)
+{
+ // nothing.
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index a35bc17..17ec447 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -72,7 +72,31 @@ class Node
Function,
Property,
Variable,
+#ifdef QDOC_QML
+ Target,
+ QmlProperty,
+ QmlSignal,
+ QmlMethod
+#else
Target
+#endif
+ };
+
+ enum SubType {
+ NoSubType,
+ Example,
+ HeaderFile,
+ File,
+ Group,
+ Module,
+ Page,
+#ifdef QDOC_QML
+ ExternalPage,
+ QmlClass,
+ QmlPropertyGroup
+#else
+ ExternalPage
+#endif
};
enum Access { Public, Protected, Private };
@@ -99,7 +123,8 @@ class Node
NextLink,
PreviousLink,
ContentsLink,
- IndexLink /*,
+ IndexLink,
+ InheritsLink /*,
GlossaryLink,
CopyrightLink,
ChapterLink,
@@ -125,6 +150,7 @@ class Node
virtual bool isInnerNode() const = 0;
virtual bool isReimp() const { return false; }
Type type() const { return typ; }
+ virtual SubType subType() const { return NoSubType; }
InnerNode *parent() const { return par; }
InnerNode *relates() const { return rel; }
const QString& name() const { return nam; }
@@ -144,7 +170,7 @@ class Node
void clearRelated() { rel = 0; }
- QString fileBase() const;
+ virtual QString fileBase() const;
protected:
Node(Type type, InnerNode *parent, const QString& name);
@@ -181,7 +207,7 @@ typedef QList NodeList;
class InnerNode : public Node
{
public:
- ~InnerNode();
+ virtual ~InnerNode();
Node *findNode(const QString& name);
Node *findNode(const QString& name, Type type);
@@ -203,6 +229,7 @@ class InnerNode : public Node
const EnumNode *findEnumNodeForValue(const QString &enumValue) const;
const NodeList & childNodes() const { return children; }
const NodeList & relatedNodes() const { return related; }
+ int count() const { return children.size(); }
int overloadNumber(const FunctionNode *func) const;
int numOverloads(const QString& funcName) const;
NodeList overloads(const QString &funcName) const;
@@ -232,17 +259,19 @@ class LeafNode : public Node
{
public:
LeafNode();
+ virtual ~LeafNode() { }
virtual bool isInnerNode() const;
protected:
- LeafNode(Type type, InnerNode *parent, const QString& name);
+ LeafNode(Type type, InnerNode* parent, const QString& name);
};
class NamespaceNode : public InnerNode
{
public:
NamespaceNode(InnerNode *parent, const QString& name);
+ virtual ~NamespaceNode() { }
};
class ClassNode;
@@ -266,6 +295,7 @@ class ClassNode : public InnerNode
{
public:
ClassNode(InnerNode *parent, const QString& name);
+ virtual ~ClassNode() { }
void addBaseClass(Access access,
ClassNode *node,
@@ -280,29 +310,23 @@ class ClassNode : public InnerNode
QString serviceName() const { return sname; }
void setServiceName(const QString& value) { sname = value; }
+ QString qmlElement() const { return qmlelement; }
+ void setQmlElement(const QString& value) { qmlelement = value; }
private:
QList bas;
QList der;
bool hidden;
QString sname;
+ QString qmlelement;
};
class FakeNode : public InnerNode
{
public:
- enum SubType {
- Example,
- HeaderFile,
- File,
- Group,
- Module,
- Page,
- ExternalPage,
- QmlClass
- };
FakeNode(InnerNode *parent, const QString& name, SubType subType);
+ virtual ~FakeNode() { }
void setTitle(const QString &title) { tle = title; }
void setSubTitle(const QString &subTitle) { stle = subTitle; }
@@ -321,18 +345,85 @@ class FakeNode : public InnerNode
NodeList gr;
};
-class QmlNode : public FakeNode
+#ifdef QDOC_QML
+class QmlClassNode : public FakeNode
{
public:
- QmlNode(InnerNode *parent, const QString& name, const ClassNode* cn)
- : FakeNode(parent, name, QmlClass), cnode(cn) { }
+ QmlClassNode(InnerNode *parent,
+ const QString& name,
+ const ClassNode* cn);
+ virtual ~QmlClassNode() { }
const ClassNode* classNode() const { return cnode; }
+ virtual QString fileBase() const;
private:
const ClassNode* cnode;
};
+class QmlPropGroupNode : public FakeNode
+{
+ public:
+ QmlPropGroupNode(QmlClassNode* parent, const QString& name);
+ virtual ~QmlPropGroupNode() { }
+
+ const QString& element() const { return name(); }
+ void setDefault() { isdefault = true; }
+ bool isDefault() const { return isdefault; }
+
+ private:
+ bool isdefault;
+};
+
+class QmlPropertyNode : public LeafNode
+{
+ public:
+ QmlPropertyNode(QmlPropGroupNode* parent,
+ const QString& name,
+ const QString& type);
+ virtual ~QmlPropertyNode() { }
+
+ void setDataType(const QString& dataType) { dt = dataType; }
+ void setStored(bool stored) { sto = toTrool(stored); }
+ void setDesignable(bool designable) { des = toTrool(designable); }
+
+ const QString &dataType() const { return dt; }
+ QString qualifiedDataType() const { return dt; }
+ bool isStored() const { return fromTrool(sto,true); }
+ bool isDesignable() const { return fromTrool(des,false); }
+
+ const QString& element() const { return parent()->name(); }
+
+ private:
+ enum Trool { Trool_True, Trool_False, Trool_Default };
+
+ static Trool toTrool(bool boolean);
+ static bool fromTrool(Trool troolean, bool defaultValue);
+
+ QString dt;
+ Trool sto;
+ Trool des;
+};
+
+class QmlSignalNode : public LeafNode
+{
+ public:
+ QmlSignalNode(QmlClassNode* parent, const QString& name);
+ virtual ~QmlSignalNode() { }
+
+ const QString& element() const { return parent()->name(); }
+};
+
+class QmlMethodNode : public LeafNode
+{
+ public:
+ QmlMethodNode(QmlClassNode* parent, const QString& name);
+ virtual ~QmlMethodNode() { }
+
+ const QString& element() const { return parent()->name(); }
+};
+#endif
+
class EnumItem
{
public:
@@ -358,6 +449,7 @@ class EnumNode : public LeafNode
{
public:
EnumNode(InnerNode *parent, const QString& name);
+ virtual ~EnumNode() { }
void addItem(const EnumItem& item);
void setFlagsType(TypedefNode *typedeff);
@@ -378,6 +470,7 @@ class TypedefNode : public LeafNode
{
public:
TypedefNode(InnerNode *parent, const QString& name);
+ virtual ~TypedefNode() { }
const EnumNode *associatedEnum() const { return ae; }
@@ -438,6 +531,7 @@ class FunctionNode : public LeafNode
enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual };
FunctionNode(InnerNode *parent, const QString &name);
+ virtual ~FunctionNode() { }
void setReturnType(const QString& returnType) { rt = returnType; }
void setMetaness(Metaness metaness) { met = metaness; }
@@ -500,6 +594,7 @@ class PropertyNode : public LeafNode
enum { NumFunctionRoles = Resetter + 1 };
PropertyNode(InnerNode *parent, const QString& name);
+ virtual ~PropertyNode() { }
void setDataType(const QString& dataType) { dt = dataType; }
void addFunction(FunctionNode *function, FunctionRole role);
@@ -557,6 +652,7 @@ class VariableNode : public LeafNode
{
public:
VariableNode(InnerNode *parent, const QString &name);
+ virtual ~VariableNode() { }
void setLeftType(const QString &leftType) { lt = leftType; }
void setRightType(const QString &rightType) { rt = rightType; }
@@ -582,6 +678,7 @@ class TargetNode : public LeafNode
{
public:
TargetNode(InnerNode *parent, const QString& name);
+ virtual ~TargetNode() { }
virtual bool isInnerNode() const;
};
diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp
index 06ff398..8715f4a 100644
--- a/tools/qdoc3/pagegenerator.cpp
+++ b/tools/qdoc3/pagegenerator.cpp
@@ -81,30 +81,50 @@ QString PageGenerator::fileBase(const Node *node)
{
if (node->relates())
node = node->relates();
- else if (!node->isInnerNode())
+ else if (!node->isInnerNode()) {
node = node->parent();
+#ifdef QDOC_QML
+ if (node->subType() == Node::QmlPropertyGroup) {
+ node = node->parent();
+ }
+#endif
+ }
QString base = node->doc().baseName();
if (!base.isEmpty())
return base;
- const Node *p = node;
-
- forever {
- base.prepend(p->name());
+ const Node *p = node;
+
+ forever {
+ base.prepend(p->name());
+#ifdef QDOC_QML
+ /*
+ To avoid file name conflicts in the html directory,
+ we prepend "qml-" to the file name of QML element doc
+ files.
+ */
+ if ((p->subType() == Node::QmlClass) ||
+ (p->subType() == Node::QmlPropertyGroup))
+ base.prepend("qml-");
+ else if ((p->type() == Node::QmlProperty) ||
+ (p->type() == Node::QmlSignal) ||
+ (p->type() == Node::QmlMethod))
+ base.prepend("qml-");
+#endif
const Node *pp = p->parent();
if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake)
- break;
+ break;
base.prepend(QLatin1Char('-'));
p = pp;
- }
-
- if (node->type() == Node::Fake) {
+ }
+
+ if (node->type() == Node::Fake) {
#ifdef QDOC2_COMPAT
- if (base.endsWith(".html"))
- base.truncate(base.length() - 5);
+ if (base.endsWith(".html"))
+ base.truncate(base.length() - 5);
#endif
- }
+ }
// the code below is effectively equivalent to:
// base.replace(QRegExp("[^A-Za-z0-9]+"), " ");
@@ -126,7 +146,8 @@ QString PageGenerator::fileBase(const Node *node)
if ((u >= 'a' && u <= 'z') || (u >= '0' && u <= '9')) {
res += QLatin1Char(u);
begun = true;
- } else if (begun) {
+ }
+ else if (begun) {
res += QLatin1Char('-');
begun = false;
}
@@ -187,8 +208,12 @@ void PageGenerator::generateInnerNode(const InnerNode *node,
if (node->type() == Node::Fake) {
const FakeNode *fakeNode = static_cast(node);
- if (fakeNode->subType() == FakeNode::ExternalPage)
+ if (fakeNode->subType() == Node::ExternalPage)
+ return;
+#ifdef QDOC_QML
+ if (fakeNode->subType() == Node::QmlPropertyGroup)
return;
+#endif
}
if (node->parent() != 0) {
@@ -197,12 +222,6 @@ void PageGenerator::generateInnerNode(const InnerNode *node,
generateClassLikeNode(node, marker);
}
else if (node->type() == Node::Fake) {
- const FakeNode* fakeNode = static_cast(node);
-#ifdef QDOC_QML
- if (fakeNode->subType() == FakeNode::QmlClass) {
- //qDebug() << "FILENAME:" << fileName(node);
- }
-#endif
generateFakeNode(static_cast(node), marker);
}
endSubPage();
diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css
index 3816164..4225a1b 100644
--- a/tools/qdoc3/test/classic.css
+++ b/tools/qdoc3/test/classic.css
@@ -225,3 +225,52 @@ span.string,span.char
{
font-size: 0.65em
}
+
+.qmlitem {
+ padding: 0;
+}
+
+.qmlname {
+ white-space: nowrap;
+ font-weight: bold;
+ font-size: 125%;
+}
+
+.qmltype {
+ font-weight: bold;
+ font-size: 125%;
+}
+
+.qmlproto, .qmldoc {
+ // border-top: 1px solid #84b0c7;
+}
+
+.qmlproto {
+ padding: 0;
+ //background-color: #e4e4e4;//#d5e1e8;
+ //font-weight: bold;
+ //-webkit-border-top-left-radius: 8px;
+ //-webkit-border-top-right-radius: 8px;
+ //-moz-border-radius-topleft: 8px;
+ //-moz-border-radius-topright: 8px;
+}
+
+.qmldoc {
+ border-top: 1px solid #e4e4e4;
+ //padding: 2px 5px;
+ //background-color: #eef3f5;
+ //border-top-width: 0;
+ //-webkit-border-bottom-left-radius: 8px;
+ //-webkit-border-bottom-right-radius: 8px;
+ //-moz-border-radius-bottomleft: 8px;
+ //-moz-border-radius-bottomright: 8px;
+}
+
+.qmldoc p, .qmldoc dl, .qmldoc ul {
+ //margin: 6px 0;
+}
+
+*.qmlitem p {
+ //margin-top: 0px;
+ //margin-bottom: 0px;
+}
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index 308ba0e..e6dd084 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -176,6 +176,8 @@ const Node *Tree::findNode(const QStringList &path,
}
/*!
+ Find the node with the specified \a path name of the
+ specified \a type.
*/
Node *Tree::findNode(const QStringList &path,
Node::Type type,
@@ -189,6 +191,8 @@ Node *Tree::findNode(const QStringList &path,
}
/*!
+ Find the node with the specified \a path name of the
+ specified \a type.
*/
const Node *Tree::findNode(const QStringList &path,
Node::Type type,
@@ -208,7 +212,9 @@ FunctionNode *Tree::findFunctionNode(const QStringList& path,
int findFlags)
{
return const_cast(
- const_cast(this)->findFunctionNode(path, relative, findFlags));
+ const_cast(this)->findFunctionNode(path,
+ relative,
+ findFlags));
}
/*!
@@ -233,7 +239,8 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path,
else
next = ((InnerNode *) node)->findNode(path.at(i));
- if (!next && node->type() == Node::Class && (findFlags & SearchBaseClasses)) {
+ if (!next && node->type() == Node::Class &&
+ (findFlags & SearchBaseClasses)) {
NodeList baseClasses = allBaseClasses(static_cast(node));
foreach (const Node *baseClass, baseClasses) {
if (i == path.size() - 1)
@@ -563,7 +570,7 @@ void Tree::resolveGroups()
FakeNode *fake =
static_cast(findNode(QStringList(i.key()),Node::Fake));
- if (fake && fake->subType() == FakeNode::Group) {
+ if (fake && fake->subType() == Node::Group) {
fake->addGroupMember(i.value());
}
else {
@@ -770,21 +777,21 @@ void Tree::readIndexSection(const QDomElement &element,
}
else if (element.nodeName() == "page") {
- FakeNode::SubType subtype;
+ Node::SubType subtype;
if (element.attribute("subtype") == "example")
- subtype = FakeNode::Example;
+ subtype = Node::Example;
else if (element.attribute("subtype") == "header")
- subtype = FakeNode::HeaderFile;
+ subtype = Node::HeaderFile;
else if (element.attribute("subtype") == "file")
- subtype = FakeNode::File;
+ subtype = Node::File;
else if (element.attribute("subtype") == "group")
- subtype = FakeNode::Group;
+ subtype = Node::Group;
else if (element.attribute("subtype") == "module")
- subtype = FakeNode::Module;
+ subtype = Node::Module;
else if (element.attribute("subtype") == "page")
- subtype = FakeNode::Page;
+ subtype = Node::Page;
else if (element.attribute("subtype") == "externalpage")
- subtype = FakeNode::ExternalPage;
+ subtype = Node::ExternalPage;
else
return;
@@ -1226,25 +1233,25 @@ bool Tree::generateIndexSection(QXmlStreamWriter &writer,
const FakeNode *fakeNode = static_cast(node);
switch (fakeNode->subType()) {
- case FakeNode::Example:
+ case Node::Example:
writer.writeAttribute("subtype", "example");
break;
- case FakeNode::HeaderFile:
+ case Node::HeaderFile:
writer.writeAttribute("subtype", "header");
break;
- case FakeNode::File:
+ case Node::File:
writer.writeAttribute("subtype", "file");
break;
- case FakeNode::Group:
+ case Node::Group:
writer.writeAttribute("subtype", "group");
break;
- case FakeNode::Module:
+ case Node::Module:
writer.writeAttribute("subtype", "module");
break;
- case FakeNode::Page:
+ case Node::Page:
writer.writeAttribute("subtype", "page");
break;
- case FakeNode::ExternalPage:
+ case Node::ExternalPage:
writer.writeAttribute("subtype", "externalpage");
break;
default:
@@ -1383,7 +1390,7 @@ bool Tree::generateIndexSection(QXmlStreamWriter &writer,
bool external = false;
if (inner->type() == Node::Fake) {
const FakeNode *fakeNode = static_cast(inner);
- if (fakeNode->subType() == FakeNode::ExternalPage)
+ if (fakeNode->subType() == Node::ExternalPage)
external = true;
}
@@ -1863,7 +1870,7 @@ void Tree::generateTagFile(const QString &fileName) const
*/
void Tree::addExternalLink(const QString &url, const Node *relative)
{
- FakeNode *fakeNode = new FakeNode(root(), url, FakeNode::ExternalPage);
+ FakeNode *fakeNode = new FakeNode(root(), url, Node::ExternalPage);
fakeNode->setAccess(Node::Public);
// Create some content for the node.
@@ -1898,6 +1905,11 @@ QString Tree::fullDocumentLocation(const Node *node) const
return "";
}
else if (node->type() == Node::Fake) {
+#ifdef QDOC_QML
+ if (node->subType() == Node::QmlClass)
+ return "qml-" + node->fileBase() + ".html";
+ else
+#endif
parentName = node->fileBase() + ".html";
}
else if (node->fileBase().isEmpty())
diff --git a/tools/qdoc3/webxmlgenerator.cpp b/tools/qdoc3/webxmlgenerator.cpp
index c5209b8..e87e812 100644
--- a/tools/qdoc3/webxmlgenerator.cpp
+++ b/tools/qdoc3/webxmlgenerator.cpp
@@ -191,7 +191,7 @@ void WebXMLGenerator::generateIndexSections(QXmlStreamWriter &writer,
generateRelations(writer, node, marker);
- if (fake->subType() == FakeNode::Module) {
+ if (fake->subType() == Node::Module) {
writer.writeStartElement("generatedlist");
writer.writeAttribute("contents", "classesbymodule");
@@ -264,7 +264,7 @@ void WebXMLGenerator::generateInnerNode(const InnerNode *node, CodeMarker *marke
if (node->type() == Node::Fake) {
const FakeNode *fakeNode = static_cast(node);
- if (fakeNode->subType() == FakeNode::ExternalPage)
+ if (fakeNode->subType() == Node::ExternalPage)
return;
}
--
cgit v0.12
From 78f079016e0dd9b455d74c6a84cfbdb859fd1094 Mon Sep 17 00:00:00 2001
From: Tom Cooksey
Date: Tue, 28 Jul 2009 11:35:59 +0200
Subject: Move uninit & readonly into a flags member of QX11PixmapData
Also add 2 new flags and a new member to store any GL bound pixmap
surface (GLXPixmap or EGLPixmapSurface).
Reviewed-By: Samuel
---
src/gui/image/qpixmap.cpp | 4 ++--
src/gui/image/qpixmap_x11.cpp | 23 +++++++++++------------
src/gui/image/qpixmap_x11_p.h | 12 ++++++++++--
src/gui/painting/qwindowsurface_x11.cpp | 4 ++--
4 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 2674cac..82835d5 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -649,7 +649,7 @@ void QPixmap::resize_helper(const QSize &s)
QX11PixmapData *x11Data = data->classId() == QPixmapData::X11Class ? static_cast(data) : 0;
if (x11Data) {
pm.x11SetScreen(x11Data->xinfo.screen());
- uninit = x11Data->uninit;
+ uninit = x11Data->flags & QX11PixmapData::Uninitialized;
}
#elif defined(Q_WS_MAC)
QMacPixmapData *macData = data->classId() == QPixmapData::MacClass ? static_cast(data) : 0;
@@ -1936,7 +1936,7 @@ void QPixmap::detach()
#if defined(Q_WS_X11)
if (data->classId() == QPixmapData::X11Class) {
QX11PixmapData *d = static_cast(data);
- d->uninit = false;
+ d->flags &= ~QX11PixmapData::Uninitialized;
// reset the cache data
if (d->hd2) {
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 86cf515..be3d070 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -313,7 +313,7 @@ int Q_GUI_EXPORT qt_x11_preferred_pixmap_depth = 0;
QX11PixmapData::QX11PixmapData(PixelType type)
: QPixmapData(type, X11Class), hd(0),
- uninit(true), read_only(false), x11_mask(0), picture(0), mask_picture(0), hd2(0),
+ flags(Uninitialized), x11_mask(0), picture(0), mask_picture(0), hd2(0), gl_surface(0),
share_mode(QPixmap::ImplicitlyShared), pengine(0)
{
}
@@ -1217,7 +1217,7 @@ void QX11PixmapData::release()
XFreePixmap(xinfo.display(), hd2);
hd2 = 0;
}
- if (!read_only)
+ if (!(flags & Readonly))
XFreePixmap(xinfo.display(), hd);
hd = 0;
}
@@ -1876,7 +1876,7 @@ QPixmap QX11PixmapData::transformed(const QTransform &transform,
} else { // color pixmap
QPixmap pm;
QX11PixmapData *x11Data = static_cast(pm.data);
- x11Data->uninit = false;
+ x11Data->flags &= ~QX11PixmapData::Uninitialized;
x11Data->xinfo = xinfo;
x11Data->d = d;
x11Data->w = w;
@@ -2018,7 +2018,7 @@ QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
QPixmap pm(data);
- data->uninit = false;
+ data->flags &= ~QX11PixmapData::Uninitialized;
pm.x11SetScreen(scr);
GC gc = XCreateGC(dpy, pm.handle(), 0, 0);
@@ -2060,7 +2060,7 @@ QPaintEngine* QX11PixmapData::paintEngine() const
{
QX11PixmapData *that = const_cast(this);
- if (read_only && share_mode == QPixmap::ImplicitlyShared) {
+ if ((flags & Readonly) && share_mode == QPixmap::ImplicitlyShared) {
// if someone wants to draw onto us, copy the shared contents
// and turn it into a fully fledged QPixmap
::Pixmap hd_copy = XCreatePixmap(X11->display, RootWindow(X11->display, xinfo.screen()),
@@ -2082,7 +2082,7 @@ QPaintEngine* QX11PixmapData::paintEngine() const
XFreeGC(X11->display, gc);
}
that->hd = hd_copy;
- that->read_only = false;
+ that->flags &= ~QX11PixmapData::Readonly;
}
if (!that->pengine)
@@ -2133,7 +2133,7 @@ void QX11PixmapData::copy(const QPixmapData *data, const QRect &rect)
setSerialNumber(++qt_pixmap_serial);
- uninit = false;
+ flags &= ~Uninitialized;
xinfo = x11Data->xinfo;
d = x11Data->d;
w = rect.width();
@@ -2201,7 +2201,7 @@ void QX11PixmapData::convertToARGB32(bool preserveContents)
return;
// Q_ASSERT(count == 1);
- if (read_only && share_mode == QPixmap::ExplicitlyShared)
+ if ((flags & Readonly) && share_mode == QPixmap::ExplicitlyShared)
return;
Pixmap pm = XCreatePixmap(X11->display, RootWindow(X11->display, xinfo.screen()),
@@ -2211,10 +2211,10 @@ void QX11PixmapData::convertToARGB32(bool preserveContents)
if (picture) {
if (preserveContents)
XRenderComposite(X11->display, PictOpSrc, picture, 0, p, 0, 0, 0, 0, 0, 0, w, h);
- if (!read_only)
+ if (!(flags & Readonly))
XRenderFreePicture(X11->display, picture);
}
- if (hd && !read_only)
+ if (hd && !(flags & Readonly))
XFreePixmap(X11->display, hd);
if (x11_mask) {
XFreePixmap(X11->display, x11_mask);
@@ -2252,9 +2252,8 @@ QPixmap QPixmap::fromX11Pixmap(Qt::HANDLE pixmap, QPixmap::ShareMode mode)
QX11PixmapData *data = new QX11PixmapData(depth == 1 ? QPixmapData::BitmapType : QPixmapData::PixmapType);
data->setSerialNumber(++qt_pixmap_serial);
- data->read_only = true;
+ data->flags = QX11PixmapData::Readonly;
data->share_mode = mode;
- data->uninit = false;
data->w = width;
data->h = height;
data->is_null = (width <= 0 || height <= 0);
diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h
index 3de9a0f..835fea4 100644
--- a/src/gui/image/qpixmap_x11_p.h
+++ b/src/gui/image/qpixmap_x11_p.h
@@ -99,6 +99,7 @@ private:
friend class QX11PaintEngine;
friend class QX11WindowSurface;
friend class QRasterWindowSurface;
+ friend class QGLContextPrivate; // Needs to access xinfo, gl_surface & flags
void release();
@@ -108,14 +109,21 @@ private:
Qt::HANDLE hd;
- uint uninit : 1;
- uint read_only : 1;
+ enum Flag {
+ NoFlags = 0x0,
+ Uninitialized = 0x1,
+ Readonly = 0x2,
+ InvertedWhenBoundToTexture = 0x4,
+ GlSurfaceCreatedWithAlpha = 0x8
+ };
+ uint flags;
QX11Info xinfo;
Qt::HANDLE x11_mask;
Qt::HANDLE picture;
Qt::HANDLE mask_picture;
Qt::HANDLE hd2; // sorted in the default display depth
+ Qt::HANDLE gl_surface;
#ifndef QT_NO_XRENDER
void convertToARGB32(bool preserveContents = true);
#endif
diff --git a/src/gui/painting/qwindowsurface_x11.cpp b/src/gui/painting/qwindowsurface_x11.cpp
index d8b0d9e..95f6ce3 100644
--- a/src/gui/painting/qwindowsurface_x11.cpp
+++ b/src/gui/painting/qwindowsurface_x11.cpp
@@ -154,7 +154,7 @@ void QX11WindowSurface::setGeometry(const QRect &rect)
QX11PixmapData *oldData = static_cast(d_ptr->device.pixmapData());
Q_ASSERT(oldData);
- if (!oldData->uninit && hasStaticContents()) {
+ if (!(oldData->flags & QX11PixmapData::Uninitialized) && hasStaticContents()) {
// Copy the content of the old pixmap into the new one.
QX11PixmapData *newData = new QX11PixmapData(QPixmapData::PixmapType);
newData->resize(size.width(), size.height());
@@ -175,7 +175,7 @@ void QX11WindowSurface::setGeometry(const QRect &rect)
dx, dy, qMin(boundingRect.width(), size.width()),
qMin(boundingRect.height(), size.height()), dx, dy);
XFreeGC(X11->display, tmpGc);
- newData->uninit = false;
+ newData->flags &= ~QX11PixmapData::Uninitialized;
d_ptr->device = QPixmap(newData);
} else {
--
cgit v0.12
From 65702aa6b44568946b8c3924a45b9362401d893c Mon Sep 17 00:00:00 2001
From: Tom Cooksey
Date: Tue, 28 Jul 2009 15:57:36 +0200
Subject: Refactor texture_from_pixmap to not re-create the gl surface each
bind
Make a clear seperation between the GL texture and the GLX pixmap. A
GLXPixmap is valid in any GL context and thus does not need to be
re-created every time the pixmap has changed.
Reviewed-By: Samuel
---
src/gui/image/qpixmapdata_p.h | 1 +
src/opengl/qgl.cpp | 24 ++++--
src/opengl/qgl_p.h | 11 ++-
src/opengl/qgl_x11.cpp | 194 ++++++++++++++++++++++++++----------------
src/opengl/qgl_x11egl.cpp | 10 ++-
5 files changed, 152 insertions(+), 88 deletions(-)
diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h
index 29dafaf..32b419e 100644
--- a/src/gui/image/qpixmapdata_p.h
+++ b/src/gui/image/qpixmapdata_p.h
@@ -116,6 +116,7 @@ private:
friend class QPixmap;
friend class QGLContextPrivate;
friend class QX11PixmapData;
+ friend class QGLTextureCache; //Needs to check the reference count
QAtomicInt ref;
int detach_no;
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 8bb72d5..a8d1797 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1488,12 +1488,18 @@ void QGLTextureCache::imageCleanupHook(qint64 cacheKey)
void QGLTextureCache::pixmapCleanupHook(QPixmap* pixmap)
{
// ### remove when the GL texture cache becomes thread-safe
- if (qApp->thread() != QThread::currentThread())
- return;
- const qint64 cacheKey = pixmap->cacheKey();
- QGLTexture *texture = instance()->getTexture(cacheKey);
- if (texture && texture->clean)
- instance()->remove(cacheKey);
+ if (qApp->thread() == QThread::currentThread()) {
+ const qint64 cacheKey = pixmap->cacheKey();
+ QGLTexture *texture = instance()->getTexture(cacheKey);
+ if (texture && texture->clean)
+ instance()->remove(cacheKey);
+ }
+#if defined(Q_WS_X11)
+ QPixmapData *pd = pixmap->data_ptr();
+ // Only need to delete the gl surface if the pixmap is about to be deleted
+ if (pd->ref == 0)
+ QGLContextPrivate::destroyGlSurfaceForPixmap(pd);
+#endif
}
void QGLTextureCache::deleteIfEmpty()
@@ -2036,11 +2042,11 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
#if defined(Q_WS_X11)
// Try to use texture_from_pixmap
if (pd->classId() == QPixmapData::X11Class) {
- QPixmap *thatPixmap = const_cast(&pixmap);
- texture = bindTextureFromNativePixmap(thatPixmap, key, canInvert);
+ texture = bindTextureFromNativePixmap(pd, key, canInvert);
if (texture) {
texture->clean = clean;
- boundPixmaps.insert(thatPixmap->data_ptr(), QPixmap(pixmap));
+ texture->boundPixmap = pd;
+ boundPixmaps.insert(pd, QPixmap(pixmap));
}
}
#endif
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index a83cc63..f21ab93 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -241,7 +241,9 @@ public:
quint32 gpm;
int screen;
QHash boundPixmaps;
- QGLTexture *bindTextureFromNativePixmap(QPixmap *pm, const qint64 key, bool internal);
+ QGLTexture *bindTextureFromNativePixmap(QPixmapData*, const qint64 key, bool canInvert);
+ static void destroyGlSurfaceForPixmap(QPixmapData*);
+ static void unbindPixmapFromTexture(QPixmapData*);
#endif
#if defined(Q_WS_MAC)
bool update;
@@ -423,7 +425,8 @@ public:
// is a current context - the context the pixmap was bound to a texture in.
// Otherwise the release doesn't do anything and you get BadDrawable errors
// when you come to delete the context.
- deleteBoundPixmap();
+ if (boundPixmap)
+ QGLContextPrivate::unbindPixmapFromTexture(boundPixmap);
#endif
glDeleteTextures(1, &id);
if (switch_context && current)
@@ -437,9 +440,9 @@ public:
bool clean;
bool yInverted; // NOTE: Y-Inverted textures are for internal use only!
#if defined(Q_WS_X11)
- Qt::HANDLE boundPixmap;
- void deleteBoundPixmap(); // in qgl_x11.cpp/qgl_x11egl.cpp
+ QPixmapData* boundPixmap;
#endif
+
};
class QGLTextureCache {
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 6381bc2..34e9d38 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1536,38 +1536,26 @@ void QGLExtensions::init()
}
}
-#if !defined(glXBindTexImageEXT)
+// Solaris defines glXBindTexImageEXT as part of the GL library
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) && !defined(glXBindTexImageEXT)
typedef void (*qt_glXBindTexImageEXT)(Display*, GLXDrawable, int, const int*);
-static qt_glXBindTexImageEXT glXBindTexImageEXT = 0;
-#endif
-#if !defined(glXReleaseTexImageEXT)
typedef void (*qt_glXReleaseTexImageEXT)(Display*, GLXDrawable, int);
+static qt_glXBindTexImageEXT glXBindTexImageEXT = 0;
static qt_glXReleaseTexImageEXT glXReleaseTexImageEXT = 0;
-#endif
-static bool qt_resolved_texture_from_pixmap = false;
-QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmap *pm, const qint64 key, bool canInvert)
+bool qt_resolveTextureFromPixmap()
{
-#if !defined(Q_OS_LINUX)
- return 0;
-#else
- Q_Q(QGLContext);
-
- if (pm->data_ptr()->classId() != QPixmapData::X11Class)
- return 0;
- QX11PixmapData *pixmapData = static_cast(pm->data_ptr());
- const QX11Info *x11Info = qt_x11Info(pm);
-
-
- // Check to see if we have NPOT texture support
- // TODO: Use GLX_TEXTURE_RECTANGLE_EXT texture target on systems without npot textures
- if ( !(QGLExtensions::glExtensions & QGLExtensions::NPOTTextures) &&
- !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0))
- return 0;
+ static bool resolvedTextureFromPixmap = false;
+ if (!resolvedTextureFromPixmap) {
+ resolvedTextureFromPixmap = true;
- if (!qt_resolved_texture_from_pixmap) {
- qt_resolved_texture_from_pixmap = true;
+ // Check to see if we have NPOT texture support
+ if ( !(QGLExtensions::glExtensions & QGLExtensions::NPOTTextures) &&
+ !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0))
+ {
+ return false; // Can't use TFP without NPOT
+ }
QString glxExt = QLatin1String(glXGetClientString(QX11Info::display(), GLX_EXTENSIONS));
if (glxExt.contains(QLatin1String("GLX_EXT_texture_from_pixmap"))) {
@@ -1589,81 +1577,141 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmap *pm, const qi
}
}
- if (!glXBindTexImageEXT)
- return 0;
+ return glXBindTexImageEXT && glXReleaseTexImageEXT;
+}
+#endif //defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) && !defined(glXBindTexImageEXT)
+
+QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, const qint64 key, bool canInvert)
+{
#if !defined(GLX_VERSION_1_3) || defined(Q_OS_HPUX)
return 0;
#else
- GLXFBConfig *configList = 0;
- GLXFBConfig glxPixmapConfig;
- int configCount = 0;
- bool hasAlpha = pixmapData->hasAlphaChannel();
-
- int configAttribs[] = {
- hasAlpha ? GLX_BIND_TO_TEXTURE_RGBA_EXT : GLX_BIND_TO_TEXTURE_RGB_EXT, True,
- GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
- GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT,
- // QGLContext::bindTexture() can't return an inverted texture, but QPainter::drawPixmap() can:
- GLX_Y_INVERTED_EXT, canInvert ? GLX_DONT_CARE : False,
- XNone
-// GLX_BIND_TO_MIPMAP_TEXTURE_EXT, False,
-// GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_1D_BIT_EXT or GLX_TEXTURE_2D_BIT_EXT or GLX_TEXTURE_RECTANGLE_BIT_EXT
- };
- configList = glXChooseFBConfig(x11Info->display(), x11Info->screen(), configAttribs, &configCount);
- if (!configList)
- return 0;
- glxPixmapConfig = configList[0];
- XFree(configList);
-
- GLXPixmap glxPixmap;
- int pixmapAttribs[] = {
- GLX_TEXTURE_FORMAT_EXT, hasAlpha ? GLX_TEXTURE_FORMAT_RGBA_EXT : GLX_TEXTURE_FORMAT_RGB_EXT,
- GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT,
- GLX_MIPMAP_TEXTURE_EXT, False,
- XNone
-// GLX_TEXTURE_FORMAT_EXT, GLX_TEXTURE_FORMAT_RGBA_EXT or GLX_TEXTURE_FORMAT_RGB_EXT or GLX_TEXTURE_FORMAT_NONE_EXT,
-// GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT or GLX_TEXTURE_RECTANGLE_EXT,
-// GLX_MIPMAP_TEXTURE_EXT, True or False,
- };
+ Q_Q(QGLContext);
- // Wrap the X Pixmap into a GLXPixmap:
- glxPixmap = glXCreatePixmap(x11Info->display(), glxPixmapConfig, pixmapData->handle(), pixmapAttribs);
+ Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
- if (!glxPixmap)
+#if !defined(glXBindTexImageEXT)
+ if (!qt_resolveTextureFromPixmap())
return 0;
+#endif
- int yInverted;
- glXGetFBConfigAttrib(x11Info->display(), glxPixmapConfig, GLX_Y_INVERTED_EXT, &yInverted);
+ QX11PixmapData *pixmapData = static_cast(pmd);
+ const QX11Info &x11Info = pixmapData->xinfo;
+
+ // Store the configs (Can be static because configs aren't dependent on current context)
+ static GLXFBConfig glxRGBPixmapConfig = 0;
+ static bool RGBConfigInverted = false;
+ static GLXFBConfig glxRGBAPixmapConfig = 0;
+ static bool RGBAConfigInverted = false;
+
+ bool hasAlpha = pixmapData->hasAlphaChannel();
+
+ // Check to see if we need a config
+ if ( (hasAlpha && !glxRGBAPixmapConfig) || (!hasAlpha && !glxRGBPixmapConfig) ) {
+ GLXFBConfig *configList = 0;
+ int configCount = 0;
+
+ int configAttribs[] = {
+ hasAlpha ? GLX_BIND_TO_TEXTURE_RGBA_EXT : GLX_BIND_TO_TEXTURE_RGB_EXT, True,
+ GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
+ GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT,
+ // QGLContext::bindTexture() can't return an inverted texture, but QPainter::drawPixmap() can:
+ GLX_Y_INVERTED_EXT, canInvert ? GLX_DONT_CARE : False,
+ XNone
+ };
+ configList = glXChooseFBConfig(x11Info.display(), x11Info.screen(), configAttribs, &configCount);
+ if (!configList)
+ return 0;
+
+ int yInv;
+ glXGetFBConfigAttrib(x11Info.display(), configList[0], GLX_Y_INVERTED_EXT, &yInv);
+
+ if (hasAlpha) {
+ glxRGBAPixmapConfig = configList[0];
+ RGBAConfigInverted = yInv;
+ }
+ else {
+ glxRGBPixmapConfig = configList[0];
+ RGBConfigInverted = yInv;
+ }
+
+ XFree(configList);
+ }
+
+ // Check to see if the surface is still valid
+ if (pixmapData->gl_surface &&
+ hasAlpha != (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha))
+ {
+ // Surface is invalid!
+ destroyGlSurfaceForPixmap(pixmapData);
+ }
+
+ // Check to see if we need a surface
+ if (!pixmapData->gl_surface) {
+ GLXPixmap glxPixmap;
+ int pixmapAttribs[] = {
+ GLX_TEXTURE_FORMAT_EXT, hasAlpha ? GLX_TEXTURE_FORMAT_RGBA_EXT : GLX_TEXTURE_FORMAT_RGB_EXT,
+ GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT,
+ GLX_MIPMAP_TEXTURE_EXT, False, // Maybe needs to be don't care
+ XNone
+ };
+
+ // Wrap the X Pixmap into a GLXPixmap:
+ glxPixmap = glXCreatePixmap(x11Info.display(),
+ hasAlpha ? glxRGBAPixmapConfig : glxRGBPixmapConfig,
+ pixmapData->handle(), pixmapAttribs);
+
+ if (!glxPixmap)
+ return 0;
+
+ pixmapData->gl_surface = (Qt::HANDLE)glxPixmap;
+
+ // Make sure the cleanup hook gets called so we can delete the glx pixmap
+ pixmapData->is_cached = true;
+ }
GLuint textureId;
glGenTextures(1, &textureId);
glBindTexture(GL_TEXTURE_2D, textureId);
- glXBindTexImageEXT(x11Info->display(), glxPixmap, GLX_FRONT_LEFT_EXT, 0);
+ glXBindTexImageEXT(x11Info.display(), (GLXPixmap)pixmapData->gl_surface, GLX_FRONT_LEFT_EXT, 0);
glBindTexture(GL_TEXTURE_2D, textureId);
- QGLTexture *texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, canInvert, yInverted);
- texture->boundPixmap = glxPixmap;
+ QGLTexture *texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, canInvert, false);
+ texture->yInverted = (hasAlpha && RGBAConfigInverted) || (!hasAlpha && RGBConfigInverted);
+ if (texture->yInverted)
+ pixmapData->flags |= QX11PixmapData::InvertedWhenBoundToTexture;
// We assume the cost of bound pixmaps is zero
QGLTextureCache::instance()->insert(q, key, texture, 0);
return texture;
#endif //!defined(GLX_VERSION_1_3) || defined(Q_OS_HPUX)
-#endif //!defined(Q_OS_LINUX
}
-void QGLTexture::deleteBoundPixmap()
+
+void QGLContextPrivate::destroyGlSurfaceForPixmap(QPixmapData* pmd)
{
-#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) && defined(Q_OS_LINUX)
- if (boundPixmap) {
- glXReleaseTexImageEXT(QX11Info::display(), boundPixmap, GLX_FRONT_LEFT_EXT);
- glXDestroyPixmap(QX11Info::display(), boundPixmap);
- boundPixmap = 0;
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
+ Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
+ QX11PixmapData *pixmapData = static_cast(pmd);
+ if (pixmapData->gl_surface) {
+ glXDestroyPixmap(QX11Info::display(), (GLXPixmap)pixmapData->gl_surface);
+ pixmapData->gl_surface = 0;
}
#endif
}
+void QGLContextPrivate::unbindPixmapFromTexture(QPixmapData* pmd)
+{
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
+ Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
+ Q_ASSERT(QGLContext::currentContext());
+ QX11PixmapData *pixmapData = static_cast(pmd);
+ if (pixmapData->gl_surface)
+ glXReleaseTexImageEXT(QX11Info::display(), (GLXPixmap)pixmapData->gl_surface, GLX_FRONT_LEFT_EXT);
+#endif
+}
QT_END_NAMESPACE
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index c6904fe..6b90a4f 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -486,13 +486,19 @@ void QGLWidgetPrivate::recreateEglSurface(bool force)
}
}
-QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmap *pm, const qint64 key, bool canInvert)
+
+QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData*, const qint64 key, bool canInvert)
{
// TODO
return 0;
}
-void QGLTexture::deleteBoundPixmap()
+void QGLContextPrivate::destroyGlSurfaceForPixmap(QPixmapData*)
+{
+ //TODO
+}
+
+void QGLContextPrivate::unbindPixmapFromTexture(QPixmapData*)
{
//TODO
}
--
cgit v0.12
From fd0cd53a24459e0314360d70d8499b491c06a8e4 Mon Sep 17 00:00:00 2001
From: Tom Cooksey
Date: Fri, 24 Jul 2009 18:44:45 +0200
Subject: Add a getter to QEglContext for the EGL extension string
Reviewed-By: Rhys Weatherley
---
src/gui/egl/qegl.cpp | 11 +++++++++++
src/gui/egl/qegl_p.h | 3 +++
2 files changed, 14 insertions(+)
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index 89d9d1b..ebdac9a 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -400,4 +400,15 @@ void QEglContext::dumpAllConfigs()
delete [] configs;
}
+QString QEglContext::extensions()
+{
+ const char* exts = eglQueryString(dpy, EGL_EXTENSIONS);
+ return QString(QLatin1String(exts));
+}
+
+bool QEglContext::hasExtension(const char* extensionName)
+{
+ return extensions().contains(QLatin1String(extensionName));
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h
index ddf7d27..3ae1489 100644
--- a/src/gui/egl/qegl_p.h
+++ b/src/gui/egl/qegl_p.h
@@ -122,6 +122,9 @@ public:
void dumpAllConfigs();
+ QString extensions();
+ bool hasExtension(const char* extensionName);
+
private:
QEgl::API apiType;
EGLDisplay dpy;
--
cgit v0.12
From e71c1a89f4747c8f94e19113d1fcbc3c51450f3e Mon Sep 17 00:00:00 2001
From: Tom Cooksey
Date: Fri, 24 Jul 2009 18:46:29 +0200
Subject: Support EGL_NOKIA_texture_from_pixmap on Harmattan
Added QGLContextPrivate::bindTextureFromNativePixmap() implementation
for X11/EGL.
---
src/opengl/qgl_x11egl.cpp | 171 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 163 insertions(+), 8 deletions(-)
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 6b90a4f..5ab3647 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -41,15 +41,16 @@
#include "qgl.h"
#include
+#include
#include
#include
#include "qgl_egl_p.h"
#include "qcolormap.h"
+#include
QT_BEGIN_NAMESPACE
-
bool QGLFormat::hasOpenGL()
{
return true;
@@ -487,20 +488,174 @@ void QGLWidgetPrivate::recreateEglSurface(bool force)
}
-QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData*, const qint64 key, bool canInvert)
+QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, const qint64 key, bool canInvert)
{
- // TODO
- return 0;
+ Q_Q(QGLContext);
+
+ Q_ASSERT(pd->classId() == QPixmapData::X11Class);
+
+ static bool checkedForTFP = false;
+ static bool haveTFP = false;
+
+ if (!checkedForTFP) {
+ // Check for texture_from_pixmap egl extension
+ checkedForTFP = true;
+ if (eglContext->hasExtension("EGL_NOKIA_texture_from_pixmap") ||
+ eglContext->hasExtension("EGL_EXT_texture_from_pixmap"))
+ {
+ qDebug("Found texture_from_pixmap EGL extension!");
+ haveTFP = true;
+ }
+ }
+
+ if (!haveTFP)
+ return 0;
+
+ QX11PixmapData *pixmapData = static_cast(pd);
+
+ bool hasAlpha = pixmapData->hasAlphaChannel();
+
+ // Check to see if the surface is still valid
+ if (pixmapData->gl_surface &&
+ hasAlpha != (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha))
+ {
+ // Surface is invalid!
+ destroyGlSurfaceForPixmap(pixmapData);
+ }
+
+ EGLint pixmapAttribs[] = {
+ EGL_TEXTURE_TARGET, EGL_TEXTURE_2D,
+ EGL_TEXTURE_FORMAT, hasAlpha ? EGL_TEXTURE_RGBA : EGL_TEXTURE_RGB,
+ EGL_NONE
+ };
+ Q_ASSERT(sizeof(Qt::HANDLE) >= sizeof(EGLSurface)); // Just to make totally sure!
+ if (pixmapData->gl_surface == 0)
+ pixmapData->gl_surface = (Qt::HANDLE)EGL_NO_SURFACE;
+ EGLSurface pixmapSurface = (EGLSurface)pixmapData->gl_surface;
+ static EGLConfig pixmapRGBConfig = 0;
+ static EGLConfig pixmapRGBAConfig = 0;
+
+ // Check to see if we need to find a config
+ if ((hasAlpha && !pixmapRGBAConfig) || (!hasAlpha && !pixmapRGBConfig) ) {
+ const EGLint configAttribs[] = {
+ EGL_SURFACE_TYPE, EGL_PIXMAP_BIT,
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+ EGL_DEPTH_SIZE, 0,
+ hasAlpha ? EGL_BIND_TO_TEXTURE_RGBA : EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE,
+ EGL_NONE
+ };
+
+ EGLint configCount = 0;
+ eglChooseConfig(eglContext->display(), configAttribs, 0, 256, &configCount);
+ if (configCount == 0) {
+ haveTFP = false;
+ qWarning("bindTextureFromNativePixmap() - Couldn't find a suitable config");
+ return 0;
+ }
+
+ EGLConfig *configList = new EGLConfig[configCount];
+ eglChooseConfig(eglContext->display(), configAttribs, configList, configCount, &configCount);
+ Q_ASSERT(configCount);
+
+ // Try to create a pixmap surface for each config until one works
+ for (int i = 0; i < configCount; ++i) {
+ pixmapSurface = eglCreatePixmapSurface(eglContext->display(), configList[i],
+ (EGLNativePixmapType) pixmapData->handle(),
+ pixmapAttribs);
+ if (pixmapSurface != EGL_NO_SURFACE) {
+ // Got one!
+ qDebug() << "Found an" << (hasAlpha ? "ARGB" : "RGB")
+ << "config (" << int(configList[i]) << ") to create a pixmap surface";
+ if (hasAlpha)
+ pixmapRGBAConfig = configList[i];
+ else
+ pixmapRGBConfig = configList[i];
+ pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface;
+ break;
+ }
+ }
+ delete configList;
+
+ if ((hasAlpha && !pixmapRGBAConfig) || (!hasAlpha && !pixmapRGBConfig) ) {
+ qDebug("Couldn't create a pixmap surface with any of the provided configs");
+ haveTFP = false;
+ return 0;
+ }
+ }
+
+ if (pixmapSurface == EGL_NO_SURFACE) {
+ pixmapSurface = eglCreatePixmapSurface(eglContext->display(),
+ hasAlpha? pixmapRGBAConfig : pixmapRGBConfig,
+ (EGLNativePixmapType) pixmapData->handle(),
+ pixmapAttribs);
+ if (pixmapSurface == EGL_NO_SURFACE) {
+ qWarning("Failed to create a pixmap surface using config %d",
+ (int)(hasAlpha? pixmapRGBAConfig : pixmapRGBConfig));
+ haveTFP = false;
+ return 0;
+ }
+ pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface;
+ }
+
+ // Make sure the cleanup hook gets called so we can delete the glx pixmap
+ pixmapData->is_cached = true;
+ Q_ASSERT(pixmapData->gl_surface);
+
+ GLuint textureId;
+ glGenTextures(1, &textureId);
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, textureId);
+
+ // bind the egl pixmap surface to a texture
+ EGLBoolean success;
+ success = eglBindTexImage(eglContext->display(), pixmapSurface, EGL_BACK_BUFFER);
+ if (success == EGL_FALSE) {
+ qWarning() << "eglBindTexImage() failed:" << eglContext->errorString(eglGetError());
+ eglDestroySurface(eglContext->display(), pixmapSurface);
+ pixmapData->gl_surface = (Qt::HANDLE)EGL_NO_SURFACE;
+ haveTFP = false;
+ return 0;
+ }
+
+ QGLTexture *texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, canInvert, true);
+ pixmapData->flags |= QX11PixmapData::InvertedWhenBoundToTexture;
+
+ // We assume the cost of bound pixmaps is zero
+ QGLTextureCache::instance()->insert(q, key, texture, 0);
+
+ glBindTexture(GL_TEXTURE_2D, textureId);
+ return texture;
}
-void QGLContextPrivate::destroyGlSurfaceForPixmap(QPixmapData*)
+void QGLContextPrivate::destroyGlSurfaceForPixmap(QPixmapData* pmd)
{
- //TODO
+ Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
+ QX11PixmapData *pixmapData = static_cast(pmd);
+ if (pixmapData->gl_surface) {
+ EGLBoolean success;
+ success = eglDestroySurface(QEglContext::defaultDisplay(0), (EGLSurface)pixmapData->gl_surface);
+ if (success == EGL_FALSE) {
+ qWarning() << "destroyGlSurfaceForPixmap() - Error deleting surface: "
+ << QEglContext::errorString(eglGetError());
+ }
+ pixmapData->gl_surface = 0;
+ }
}
-void QGLContextPrivate::unbindPixmapFromTexture(QPixmapData*)
+void QGLContextPrivate::unbindPixmapFromTexture(QPixmapData* pmd)
{
- //TODO
+ Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
+ QX11PixmapData *pixmapData = static_cast(pmd);
+ if (pixmapData->gl_surface) {
+ EGLBoolean success;
+ success = eglReleaseTexImage(QEglContext::defaultDisplay(0),
+ (EGLSurface)pixmapData->gl_surface,
+ EGL_BACK_BUFFER);
+ if (success == EGL_FALSE) {
+ qWarning() << "unbindPixmapFromTexture() - Unable to release bound texture: "
+ << QEglContext::errorString(eglGetError());
+ }
+ }
}
QT_END_NAMESPACE
--
cgit v0.12
From 0ff4c453bf3d549e8344ab18f643f61a8b6174ef Mon Sep 17 00:00:00 2001
From: Tom Cooksey
Date: Wed, 29 Jul 2009 14:50:06 +0200
Subject: Fix build on Solaris x86 with old Mesa glx headers
---
src/opengl/qgl_x11.cpp | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 34e9d38..642c7c1 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -58,11 +58,16 @@
#include
#endif
+// We always define GLX_EXT_texture_from_pixmap ourselves because
+// we can't trust system headers to do it properly
+#define GLX_EXT_texture_from_pixmap 1
+
#define INT8 dummy_INT8
#define INT32 dummy_INT32
#include
#undef INT8
#undef INT32
+
#include
#include
#include
@@ -82,7 +87,7 @@ extern const QX11Info *qt_x11Info(const QPaintDevice *pd);
#define GLX_SAMPLES_ARB 100001
#endif
-#ifndef GLX_EXT_texture_from_pixmap
+#ifndef GLX_TEXTURE_2D_BIT_EXT
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
@@ -1537,7 +1542,7 @@ void QGLExtensions::init()
}
// Solaris defines glXBindTexImageEXT as part of the GL library
-#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) && !defined(glXBindTexImageEXT)
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
typedef void (*qt_glXBindTexImageEXT)(Display*, GLXDrawable, int, const int*);
typedef void (*qt_glXReleaseTexImageEXT)(Display*, GLXDrawable, int);
static qt_glXBindTexImageEXT glXBindTexImageEXT = 0;
@@ -1579,7 +1584,7 @@ bool qt_resolveTextureFromPixmap()
return glXBindTexImageEXT && glXReleaseTexImageEXT;
}
-#endif //defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) && !defined(glXBindTexImageEXT)
+#endif //defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, const qint64 key, bool canInvert)
@@ -1591,10 +1596,8 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, con
Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
-#if !defined(glXBindTexImageEXT)
if (!qt_resolveTextureFromPixmap())
return 0;
-#endif
QX11PixmapData *pixmapData = static_cast(pmd);
const QX11Info &x11Info = pixmapData->xinfo;
--
cgit v0.12
From 13a76f28e11d85353f799f31d2e0b75ffe2f7956 Mon Sep 17 00:00:00 2001
From: Kent Hansen
Date: Wed, 29 Jul 2009 15:22:44 +0200
Subject: test that vars are stored in custom global object
---
tests/auto/qscriptengine/tst_qscriptengine.cpp | 29 ++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index ab398e9..830cfc7 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -893,6 +893,35 @@ void tst_QScriptEngine::getSetGlobalObject()
QVERIFY(eng.globalObject().strictlyEquals(obj));
QVERIFY(eng.currentContext()->thisObject().strictlyEquals(obj));
QVERIFY(eng.currentContext()->activationObject().strictlyEquals(obj));
+
+ QVERIFY(!obj.property("foo").isValid());
+ eng.evaluate("var foo = 123");
+ {
+ QScriptValue ret = obj.property("foo");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toInt32(), 123);
+ }
+
+ QVERIFY(!obj.property("bar").isValid());
+ eng.evaluate("bar = 456");
+ {
+ QScriptValue ret = obj.property("bar");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toInt32(), 456);
+ }
+
+ QVERIFY(!obj.property("baz").isValid());
+ eng.evaluate("this['baz'] = 789");
+ {
+ QScriptValue ret = obj.property("baz");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toInt32(), 789);
+ }
+
+ {
+ QScriptValue ret = eng.evaluate("(function() { return this; })()");
+ QVERIFY(ret.strictlyEquals(obj));
+ }
}
void tst_QScriptEngine::checkSyntax_data()
--
cgit v0.12
From d63f08018b0952eb917e090f214a1dbe24e2a767 Mon Sep 17 00:00:00 2001
From: Kavindra Devi Palaraja
Date: Wed, 29 Jul 2009 17:17:12 +0200
Subject: Doc - Renamed the cursor's images to illustrate splitV and splitH
properly
Task: 258895
Reviewed-By: Jens Bache-Wiig
---
doc/src/images/cursor-hsplit.png | Bin 161 -> 155 bytes
doc/src/images/cursor-vsplit.png | Bin 155 -> 161 bytes
src/gui/kernel/qcursor.cpp | 4 ++--
3 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/src/images/cursor-hsplit.png b/doc/src/images/cursor-hsplit.png
index 1beda25..a5667e3 100644
Binary files a/doc/src/images/cursor-hsplit.png and b/doc/src/images/cursor-hsplit.png differ
diff --git a/doc/src/images/cursor-vsplit.png b/doc/src/images/cursor-vsplit.png
index a5667e3..1beda25 100644
Binary files a/doc/src/images/cursor-vsplit.png and b/doc/src/images/cursor-vsplit.png differ
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index 6fb5f5a..c48a781 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -127,11 +127,11 @@ QT_BEGIN_NAMESPACE
\o Qt::SizeAllCursor \o \c size_all
\row \o \inlineimage cursor-busy.png
\o Qt::BusyCursor \o \c left_ptr_watch
- \o \inlineimage cursor-hsplit.png
+ \o \inlineimage cursor-vsplit.png
\o Qt::SplitVCursor \o \c split_v
\row \o \inlineimage cursor-forbidden.png
\o Qt::ForbiddenCursor \o \c forbidden
- \o \inlineimage cursor-vsplit.png
+ \o \inlineimage cursor-hsplit.png
\o Qt::SplitHCursor \o \c split_h
\row \o \inlineimage cursor-hand.png
\o Qt::PointingHandCursor \o \c pointing_hand
--
cgit v0.12
From b2b626a936d778b89f8fbf33ac914d99876ec4b3 Mon Sep 17 00:00:00 2001
From: Thiago Macieira
Date: Wed, 29 Jul 2009 17:59:03 +0200
Subject: Autotest: fix the regressions in the DOM test caused by one
whitespace being removed.
Reviewed-by: Volker Hilsheimer
---
tests/auto/qdom/tst_qdom.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp
index ea3b64e..5b4787f 100644
--- a/tests/auto/qdom/tst_qdom.cpp
+++ b/tests/auto/qdom/tst_qdom.cpp
@@ -1386,7 +1386,7 @@ void tst_QDom::roundTripAttributes() const
doc.save(stream, 0);
stream.flush();
- const QByteArray expected("\n");
+ const QByteArray expected("\n");
QCOMPARE(QString::fromLatin1(serialized.constData()), QString::fromLatin1(expected.constData()));
}
@@ -1671,7 +1671,7 @@ void tst_QDom::appendDocumentNode() const
doc.appendChild(elem);
Q_ASSERT(!xml.isNull());
- const QString expected(QLatin1String("\n\n\n"));
+ const QString expected(QLatin1String("\n\n\n"));
elem.appendChild(xml);
QCOMPARE(doc.childNodes().count(), 1);
@@ -1788,8 +1788,8 @@ void tst_QDom::doubleNamespaceDeclarations() const
QXmlInputSource source(&file);
QVERIFY(doc.setContent(&source, &reader));
- QVERIFY(doc.toString(0) == QString::fromLatin1("\n\n\n") ||
- doc.toString(0) == QString::fromLatin1("\n\n\n"));
+ QVERIFY(doc.toString(0) == QString::fromLatin1("\n\n\n") ||
+ doc.toString(0) == QString::fromLatin1("\n\n\n"));
}
void tst_QDom::setContentQXmlReaderOverload() const
--
cgit v0.12
From f21a36efaab400e086a8c1e87f91da595e4a4443 Mon Sep 17 00:00:00 2001
From: kh
Date: Wed, 29 Jul 2009 18:31:36 +0200
Subject: Disable for the time being until we have fixed collection files.
---
tests/auto/auto.pro | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index b4a6600..6f10922 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -159,9 +159,9 @@ SUBDIRS += _networkselftest \
qhash \
qheaderview \
qhelpcontentmodel \
- qhelpenginecore \
+# qhelpenginecore \
qhelpgenerator \
- qhelpindexmodel \
+# qhelpindexmodel \
qhelpprojectdata \
qhostaddress \
qhostinfo \
--
cgit v0.12
From 1d3dabe27730a33da35239c39c69b18d4ce9d725 Mon Sep 17 00:00:00 2001
From: Thiago Macieira
Date: Wed, 29 Jul 2009 19:47:00 +0200
Subject: Fix compilation: #include was missing.
Reviewed-by: Trust Me
---
src/network/access/qnetworkcookiejar.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/network/access/qnetworkcookiejar.h b/src/network/access/qnetworkcookiejar.h
index b2cdf12..6ff201e 100644
--- a/src/network/access/qnetworkcookiejar.h
+++ b/src/network/access/qnetworkcookiejar.h
@@ -43,6 +43,7 @@
#define QNETWORKCOOKIEJAR_H
#include
+#include
QT_BEGIN_HEADER
--
cgit v0.12
From 529b30b96435491fc6994515862f44d24efc754f Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer
Date: Wed, 29 Jul 2009 20:58:11 +0200
Subject: Doc: The layout documentation is not a list of classes.
---
doc/src/designer-manual.qdoc | 2 +-
doc/src/groups.qdoc | 2 +-
doc/src/layout.qdoc | 3 +--
doc/src/tutorials/addressbook-fr.qdoc | 2 +-
doc/src/tutorials/addressbook.qdoc | 4 ++--
src/gui/kernel/qboxlayout.cpp | 6 +++---
src/gui/kernel/qgridlayout.cpp | 2 +-
src/gui/kernel/qlayout.cpp | 4 ++--
src/gui/kernel/qwidget.cpp | 6 +++---
9 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc
index c67865d..ab33185 100644
--- a/doc/src/designer-manual.qdoc
+++ b/doc/src/designer-manual.qdoc
@@ -402,7 +402,7 @@
while setting as few widget size constraints as possible.
For a more technical perspective on Qt's layout classes, refer to the
- \l{Layout Classes} document.
+ \l{Layout Management} documentation.
*/
diff --git a/doc/src/groups.qdoc b/doc/src/groups.qdoc
index 2733853..1ec106e 100644
--- a/doc/src/groups.qdoc
+++ b/doc/src/groups.qdoc
@@ -241,7 +241,7 @@
/*!
\group geomanagement
- \title Layout Management
+ \title Layout Classes
\ingroup groups
\brief Classes handling automatic resizing and moving of widgets, for
diff --git a/doc/src/layout.qdoc b/doc/src/layout.qdoc
index ec88089..9350aa8 100644
--- a/doc/src/layout.qdoc
+++ b/doc/src/layout.qdoc
@@ -42,9 +42,8 @@
/*!
\page layout.html
- \title Layout Classes
+ \title Layout Management
\ingroup architecture
- \ingroup classlists
\brief A tour of the standard layout managers and an introduction to custom
layouts.
diff --git a/doc/src/tutorials/addressbook-fr.qdoc b/doc/src/tutorials/addressbook-fr.qdoc
index 78f6821..739f047 100644
--- a/doc/src/tutorials/addressbook-fr.qdoc
+++ b/doc/src/tutorials/addressbook-fr.qdoc
@@ -220,7 +220,7 @@
On remarque que le label \c AddressLabel est positionné en utilisant Qt::AlignTop
comme argument optionnel. Ceci est destiné à assurer qu'il ne sera pas centré
verticalement dans la cellule (1,0). Pour un aperçu rapide des layouts de Qt,
- consultez la section \l{Layout Classes}.
+ consultez la section \l{Layout Management}.
Afin d'installer l'objet layout dans un widget, il faut appeler la méthode
\l{QWidget::setLayout()}{setLayout()} du widget en question:
diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc
index 95394eb..fd08bfe 100644
--- a/doc/src/tutorials/addressbook.qdoc
+++ b/doc/src/tutorials/addressbook.qdoc
@@ -222,8 +222,8 @@
Notice that \c addressLabel is positioned using Qt::AlignTop as an
additional argument. This is to make sure it is not vertically centered in
- cell (1,0). For a basic overview on Qt Layouts, refer to the \l{Layout Classes}
- document.
+ cell (1,0). For a basic overview on Qt Layouts, refer to the
+ \l{Layout Management} documentation.
In order to install the layout object onto the widget, we have to invoke
the widget's \l{QWidget::setLayout()}{setLayout()} function:
diff --git a/src/gui/kernel/qboxlayout.cpp b/src/gui/kernel/qboxlayout.cpp
index 770f5bb..23d20ff 100644
--- a/src/gui/kernel/qboxlayout.cpp
+++ b/src/gui/kernel/qboxlayout.cpp
@@ -527,7 +527,7 @@ void QBoxLayoutPrivate::calcHfw(int w)
You will almost always want to use QVBoxLayout and QHBoxLayout
rather than QBoxLayout because of their convenient constructors.
- \sa QGridLayout, QStackedLayout, {Layout Classes}
+ \sa QGridLayout, QStackedLayout, {Layout Management}
*/
/*!
@@ -1295,7 +1295,7 @@ QBoxLayout::Direction QBoxLayout::direction() const
\image qhboxlayout-with-5-children.png Horizontal box layout with five child widgets
- \sa QVBoxLayout, QGridLayout, QStackedLayout, {Layout Classes}, {Basic Layouts Example}
+ \sa QVBoxLayout, QGridLayout, QStackedLayout, {Layout Management}, {Basic Layouts Example}
*/
@@ -1413,7 +1413,7 @@ QHBoxLayout::~QHBoxLayout()
\image qvboxlayout-with-5-children.png Horizontal box layout with five child widgets
- \sa QHBoxLayout, QGridLayout, QStackedLayout, {Layout Classes}, {Basic Layouts Example}
+ \sa QHBoxLayout, QGridLayout, QStackedLayout, {Layout Management}, {Basic Layouts Example}
*/
/*!
diff --git a/src/gui/kernel/qgridlayout.cpp b/src/gui/kernel/qgridlayout.cpp
index 7ac874e..558f570 100644
--- a/src/gui/kernel/qgridlayout.cpp
+++ b/src/gui/kernel/qgridlayout.cpp
@@ -1046,7 +1046,7 @@ QRect QGridLayoutPrivate::cellRect(int row, int col) const
the margin width for a top-level layout, or to the same as the
parent layout.
- \sa QBoxLayout, QStackedLayout, {Layout Classes}, {Basic Layouts Example}
+ \sa QBoxLayout, QStackedLayout, {Layout Management}, {Basic Layouts Example}
*/
diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp
index e750088..941db8f 100644
--- a/src/gui/kernel/qlayout.cpp
+++ b/src/gui/kernel/qlayout.cpp
@@ -83,7 +83,7 @@ static int menuBarHeightForWidth(QWidget *menubar, int w)
For users of QLayout subclasses or of QMainWindow there is seldom
any need to use the basic functions provided by QLayout, such as
- setSizeConstraint() or setMenuBar(). See \l{Layout Classes}
+ setSizeConstraint() or setMenuBar(). See \l{Layout Management}
for more information.
To make your own layout manager, implement the functions
@@ -98,7 +98,7 @@ static int menuBarHeightForWidth(QWidget *menubar, int w)
Geometry management stops when the layout manager is deleted.
- \sa QLayoutItem, {Layout Classes}, {Basic Layouts Example},
+ \sa QLayoutItem, {Layout Management}, {Basic Layouts Example},
{Border Layout Example}, {Flow Layout Example}
*/
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 7026525..bca607c 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -505,7 +505,7 @@ void QWidget::setAutoFillBackground(bool enabled)
been outlined to indicate their full sizes.
If you want to use a QWidget to hold child widgets you will usually want to
- add a layout to the parent QWidget. See \l{Layout Classes} for more
+ add a layout to the parent QWidget. See \l{Layout Management} for more
information.
@@ -8854,7 +8854,7 @@ QRegion QWidget::mask() const
The layout manager sets the geometry of the widget's children
that have been added to the layout.
- \sa setLayout(), sizePolicy(), {Layout Classes}
+ \sa setLayout(), sizePolicy(), {Layout Management}
*/
QLayout *QWidget::layout() const
{
@@ -8884,7 +8884,7 @@ QLayout *QWidget::layout() const
The QWidget will take ownership of \a layout.
- \sa layout(), {Layout Classes}
+ \sa layout(), {Layout Management}
*/
void QWidget::setLayout(QLayout *l)
--
cgit v0.12
From b5363896f44a70f04129be359e101e66d03f8609 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer
Date: Wed, 29 Jul 2009 20:58:27 +0200
Subject: Doc: Fix incorrect merge.
---
doc/src/platform-notes.qdoc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/doc/src/platform-notes.qdoc b/doc/src/platform-notes.qdoc
index 7c97f65..4738928 100644
--- a/doc/src/platform-notes.qdoc
+++ b/doc/src/platform-notes.qdoc
@@ -378,9 +378,6 @@
improve support for this feature.
*/
- \row \o \l{QNX} \o Intel 32-bit, PowerPC \o unsupported/qnx--g++ \o QNX 6.4 GCC
- \row \o VxWorks \o Intel 32-bit, PowerPC \o unsupported/vxworks--g++ \o VxWorks 6.7 GCC
-
/*!
\page platform-notes-windows-ce.html
\title Platform Notes - Windows CE
--
cgit v0.12
From 474675505b24535f8b2779557c9079942b0fa406 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer
Date: Wed, 29 Jul 2009 20:31:07 +0200
Subject: Remove old and obsolete files.
---
.../images/mainwindow-docks-example.png | Bin 14427 -> 0 bytes
doc/src/tech-preview/images/mainwindow-docks.png | Bin 10168 -> 0 bytes
doc/src/tech-preview/images/plaintext-layout.png | Bin 40981 -> 0 bytes
doc/src/tech-preview/known-issues.html | 110 ---------------------
4 files changed, 110 deletions(-)
delete mode 100644 doc/src/tech-preview/images/mainwindow-docks-example.png
delete mode 100644 doc/src/tech-preview/images/mainwindow-docks.png
delete mode 100644 doc/src/tech-preview/images/plaintext-layout.png
delete mode 100644 doc/src/tech-preview/known-issues.html
diff --git a/doc/src/tech-preview/images/mainwindow-docks-example.png b/doc/src/tech-preview/images/mainwindow-docks-example.png
deleted file mode 100644
index a5641fd..0000000
Binary files a/doc/src/tech-preview/images/mainwindow-docks-example.png and /dev/null differ
diff --git a/doc/src/tech-preview/images/mainwindow-docks.png b/doc/src/tech-preview/images/mainwindow-docks.png
deleted file mode 100644
index 96dafc3..0000000
Binary files a/doc/src/tech-preview/images/mainwindow-docks.png and /dev/null differ
diff --git a/doc/src/tech-preview/images/plaintext-layout.png b/doc/src/tech-preview/images/plaintext-layout.png
deleted file mode 100644
index 9a0f9c1..0000000
Binary files a/doc/src/tech-preview/images/plaintext-layout.png and /dev/null differ
diff --git a/doc/src/tech-preview/known-issues.html b/doc/src/tech-preview/known-issues.html
deleted file mode 100644
index 885104e..0000000
--- a/doc/src/tech-preview/known-issues.html
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-Known issues
-
-
-
-
-
-
-
-
-
Known Issues: Qt 4.0.0 Technology Preview 1
-
- This is the list of known and reported issues for the Qt 4.0.0
- Technology Preview 1. This list is updated daily.
-
Building a static build on mac will fail the first time.
-
Run qmake a second time.
-
-
QTDIR
-
Some applications(e.g. uic3) need QTDIR set and QTDIR/bin in the path to work.
-
Set QTDIR and PATH as described in INSTALL.
-
-
ODBC driver on Windows
-
Problems compiling the ODBC driver.
-
Change the include from qapplication.h to qcoreapplication.h
-
-
QtGui does not link because of accessibility errors
-
undefined reference to QAccessible::setRootObject(QObject*)
-
Rerun configure and rebuild, if that does not help, add the contents of $QTDIR/.qt.config to $QTDIR/.qmake.cache
-
-
-
-
-
General
-
-
No connection to Oracle
-
I cannot connect to my Oracle server
-
Use the Oracle >= 9 client libraries, currently there is no workaround for OCI 8
-
-
QSqlModel
-
Only the first 16 rows from a database result are displayed
-
You are using a database driver which does not report back the size of a result set and incremental fetching is not yet implemented in the itemviews. You can either use another database like MySQL or increase the QSQL_PREFETCH in qsqlmodel.cpp
-
-
-
-
-
Demos
-
-
-
-
-
-
-
-
Windows specific
-
-
Qt Assistant
-
Problems with zooming and laying out text. Sometimes the text overlaps.
-
-
GDI handle leak
-
Setting fonts through QPainter::setFont() leaks GDI
- handles on windows. This is for instance visible in the OpenGL
- part of the Arthur demo. The issue will be fixed before the next
- preview.
-
-
-
-
X11 specific
-
-
-
-
-
-
-
-
Mac specific
-
-
QComboBox
-
Does not have the native Mac look and feel yet. It is rendered in a Windows-like style.
-
-
Clicking on widgets
-
Jaguar 10.2 only: Clicking on widgets that has a focusrect may fail.
-
-
--
cgit v0.12
From 067ffcb46ebcf2b9350bfd0f466736c2c44277a9 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer
Date: Wed, 29 Jul 2009 22:46:40 +0200
Subject: Doc: remove obsolete content.
---
doc/src/groups.qdoc | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/doc/src/groups.qdoc b/doc/src/groups.qdoc
index 1ec106e..2aba09c 100644
--- a/doc/src/groups.qdoc
+++ b/doc/src/groups.qdoc
@@ -49,12 +49,6 @@
\generatelist{related}
- \omit
- \row
- \o \l{Component Model}
- \o Interfaces and helper classes for the Qt Component Model.
- \endomit
-
*/
/*!
@@ -147,12 +141,6 @@
*/
-/* \group componentmodel
- \title Component Model
-
- These classes and interfaces form the basis of the \l{Qt Component Model}.
-
-*/
/*!
\group database
--
cgit v0.12
From a5f0c51b3c9156011e8f051729b386e61fdf7851 Mon Sep 17 00:00:00 2001
From: Simon Hausmann
Date: Wed, 29 Jul 2009 22:42:46 +0200
Subject: Fix compilation and source compatibility.
Source code that includes implicitly includes
QNetworkCookie in Qt 4.5. Restore this and keep Qt compiling after
the split up by including qnetworkcookie.h from qnetworkcookiejar.h
Reviewed-by: Trust me
---
src/network/access/qnetworkcookiejar.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/network/access/qnetworkcookiejar.h b/src/network/access/qnetworkcookiejar.h
index 6ff201e..fae0857 100644
--- a/src/network/access/qnetworkcookiejar.h
+++ b/src/network/access/qnetworkcookiejar.h
@@ -45,14 +45,15 @@
#include
#include
+// ### Qt5 remove this include
+#include "qnetworkcookie.h"
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Network)
-class QNetworkCookie;
-
class QNetworkCookieJarPrivate;
class Q_NETWORK_EXPORT QNetworkCookieJar: public QObject
{
--
cgit v0.12
From 96eab09cbb7b97ab04dea9fe5515454ef35b3119 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer
Date: Wed, 29 Jul 2009 22:24:50 +0200
Subject: Doc cleanup: Move list-generating pages together into classes.qdoc
---
doc/src/annotated.qdoc | 62 --------------------------------------
doc/src/classes.qdoc | 72 ++++++++++++++++++++++++++++++++++++++++++++
doc/src/functions.qdoc | 63 --------------------------------------
doc/src/groups.qdoc | 12 --------
doc/src/hierarchy.qdoc | 52 --------------------------------
doc/src/mainclasses.qdoc | 51 -------------------------------
doc/src/obsoleteclasses.qdoc | 59 ------------------------------------
7 files changed, 72 insertions(+), 299 deletions(-)
delete mode 100644 doc/src/annotated.qdoc
delete mode 100644 doc/src/functions.qdoc
delete mode 100644 doc/src/hierarchy.qdoc
delete mode 100644 doc/src/mainclasses.qdoc
delete mode 100644 doc/src/obsoleteclasses.qdoc
diff --git a/doc/src/annotated.qdoc b/doc/src/annotated.qdoc
deleted file mode 100644
index a817df6..0000000
--- a/doc/src/annotated.qdoc
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/****************************************************************************
-**
-** Documentation for class overview.
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt GUI Toolkit.
-** EDITIONS: FREE, PROFESSIONAL, ENTERPRISE
-**
-****************************************************************************/
-
-/*!
- \page annotated.html
- \title Annotated Class Index
- \ingroup classlists
-
- Qt's classes with brief descriptions:
-
- \generatelist annotatedclasses
-*/
diff --git a/doc/src/classes.qdoc b/doc/src/classes.qdoc
index 9a5d3ec..4845f84 100644
--- a/doc/src/classes.qdoc
+++ b/doc/src/classes.qdoc
@@ -40,6 +40,18 @@
****************************************************************************/
/*!
+ \group groups
+ \title Grouped Classes
+ \ingroup classlists
+
+ This page provides a way of navigating Qt's classes by grouping
+ related classes together. Some classes may appear in more than one group.
+
+ \generatelist{related}
+
+*/
+
+/*!
\page classes.html
\title Qt's Classes
\ingroup classlists
@@ -65,3 +77,63 @@
\generatelist{namespaces}
*/
+
+/*!
+ \page obsoleteclasses.html
+ \title Obsolete Classes
+ \ingroup classlists
+
+
+ This is a list of Qt classes that are obsolete (deprecated). These
+ classes are provided to keep old source code working but they are
+ no longer maintained. We strongly advise against using these
+ classes in new code.
+
+ \generatelist obsoleteclasses
+
+ \sa {Qt's Classes}, {Qt's Modules}
+*/
+
+/*!
+ \page annotated.html
+ \title Annotated Class Index
+ \ingroup classlists
+
+ Qt's classes with brief descriptions:
+
+ \generatelist annotatedclasses
+*/
+
+/*!
+ \page functions.html
+ \title Member Function Index
+ \ingroup classlists
+
+ Here is the list of all the documented member functions in the Qt
+ API with links to the class documentation for each function.
+
+ \generatelist functionindex
+*/
+
+/*!
+ \page hierarchy.html
+
+ \title Class Inheritance Hierarchy
+ \ingroup classlists
+
+ This list shows the C++ class inheritance relations between the
+ classes in the Qt API.
+
+ \generatelist classhierarchy
+*/
+
+/*!
+ \page mainclasses.html
+ \title Qt's Main Classes
+ \ingroup classlists
+
+ These are the most frequently used Qt classes. For the complete
+ list see \link classes.html Qt's Classes \endlink.
+
+ \generatelist mainclasses
+*/
diff --git a/doc/src/functions.qdoc b/doc/src/functions.qdoc
deleted file mode 100644
index e4c8c57..0000000
--- a/doc/src/functions.qdoc
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/****************************************************************************
-**
-** Documentation for class overview.
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt GUI Toolkit.
-** EDITIONS: FREE, PROFESSIONAL, ENTERPRISE
-**
-****************************************************************************/
-
-/*!
- \page functions.html
- \title Member Function Index
- \ingroup classlists
-
- Here is the list of all the documented member functions in the Qt
- API with links to the class documentation for each function.
-
- \generatelist functionindex
-*/
diff --git a/doc/src/groups.qdoc b/doc/src/groups.qdoc
index 2aba09c..731ac58 100644
--- a/doc/src/groups.qdoc
+++ b/doc/src/groups.qdoc
@@ -40,18 +40,6 @@
****************************************************************************/
/*!
- \group groups
- \title Grouped Classes
- \ingroup classlists
-
- This page provides a way of navigating Qt's classes by grouping
- related classes together. Some classes may appear in more than one group.
-
- \generatelist{related}
-
-*/
-
-/*!
\group advanced
\title Advanced Widgets
\ingroup groups
diff --git a/doc/src/hierarchy.qdoc b/doc/src/hierarchy.qdoc
deleted file mode 100644
index 4a278dc..0000000
--- a/doc/src/hierarchy.qdoc
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page hierarchy.html
-
- \title Class Inheritance Hierarchy
- \ingroup classlists
-
- This list shows the C++ class inheritance relations between the
- classes in the Qt API.
-
- \generatelist classhierarchy
-*/
diff --git a/doc/src/mainclasses.qdoc b/doc/src/mainclasses.qdoc
deleted file mode 100644
index 33bb91a..0000000
--- a/doc/src/mainclasses.qdoc
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page mainclasses.html
- \title Qt's Main Classes
- \ingroup classlists
-
- These are the most frequently used Qt classes. For the complete
- list see \link classes.html Qt's Classes \endlink.
-
- \generatelist mainclasses
-*/
diff --git a/doc/src/obsoleteclasses.qdoc b/doc/src/obsoleteclasses.qdoc
deleted file mode 100644
index 3658dfc..0000000
--- a/doc/src/obsoleteclasses.qdoc
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page obsoleteclasses.html
- \group obsolete
- \title Obsolete Classes
- \ingroup classlists
- \ingroup groups
-
- \brief Qt classes that are obsolete (deprecated).
-
- This is a list of Qt classes that are obsolete (deprecated). These
- classes are provided to keep old source code working but they are
- no longer maintained. We strongly advise against using these
- classes in new code.
-
- \generatelist obsoleteclasses
-
- \sa {Qt's Classes}, {Qt's Modules}
-*/
--
cgit v0.12
From d18c722a081c6fa2a8bedba563ecaf9763b60faa Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer
Date: Wed, 29 Jul 2009 22:38:38 +0200
Subject: Doc: Move legalese files into a separate directory.
---
doc/src/3rdparty.qdoc | 300 --------------------
doc/src/commercialeditions.qdoc | 135 ---------
doc/src/editions.qdoc | 76 ------
doc/src/gpl.qdoc | 84 ------
doc/src/legal/3rdparty.qdoc | 300 ++++++++++++++++++++
doc/src/legal/commercialeditions.qdoc | 135 +++++++++
doc/src/legal/editions.qdoc | 76 ++++++
doc/src/legal/gpl.qdoc | 84 ++++++
doc/src/legal/licenses.qdoc | 496 ++++++++++++++++++++++++++++++++++
doc/src/legal/opensourceedition.qdoc | 91 +++++++
doc/src/legal/trademarks.qdoc | 75 +++++
doc/src/licenses.qdoc | 483 ---------------------------------
doc/src/opensourceedition.qdoc | 91 -------
doc/src/topics.qdoc | 12 -
doc/src/trademarks.qdoc | 75 -----
15 files changed, 1257 insertions(+), 1256 deletions(-)
delete mode 100644 doc/src/3rdparty.qdoc
delete mode 100644 doc/src/commercialeditions.qdoc
delete mode 100644 doc/src/editions.qdoc
delete mode 100644 doc/src/gpl.qdoc
create mode 100644 doc/src/legal/3rdparty.qdoc
create mode 100644 doc/src/legal/commercialeditions.qdoc
create mode 100644 doc/src/legal/editions.qdoc
create mode 100644 doc/src/legal/gpl.qdoc
create mode 100644 doc/src/legal/licenses.qdoc
create mode 100644 doc/src/legal/opensourceedition.qdoc
create mode 100644 doc/src/legal/trademarks.qdoc
delete mode 100644 doc/src/licenses.qdoc
delete mode 100644 doc/src/opensourceedition.qdoc
delete mode 100644 doc/src/trademarks.qdoc
diff --git a/doc/src/3rdparty.qdoc b/doc/src/3rdparty.qdoc
deleted file mode 100644
index 0d86ab3..0000000
--- a/doc/src/3rdparty.qdoc
+++ /dev/null
@@ -1,300 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page 3rdparty.html
-
- \title Third-Party Licenses Used in Qt
- \ingroup licensing
- \brief License information for third-party libraries supplied with Qt.
-
- Qt includes a number of third-party libraries that are used to provide
- certain features. Unlike the code described in the
- \l{Other Licenses Used in Qt}{code used in Qt} document, these
- libraries are supplied alongside the Qt modules.
-
- Third Party Software may impose additional restrictions and it is the
- user's responsibility to ensure that they have met the licensing
- requirements of the GPL, LGPL, or Qt Commercial license and the relevant
- license of the Third Party Software they are using.
-
- Run \c{configure -help} to see any options that may be available for
- controlling the use of these libraries.
-
- \tableofcontents
-
- \section1 DES (\c des.cpp)
-
- \e{Implementation of DES encryption for NTLM\br
- Copyright 1997-2005 Simon Tatham.\br
- This software is released under the MIT license.}
-
- See \c src/3rdparty/des/des.cpp for more information about the terms and
- conditions under which the code is supplied.
-
- \section1 FreeType 2 (\c freetype) version 2.3.6
-
- \e{The FreeType project is a team of volunteers who develop free, portable
- and high-quality software solutions for digital typography. We specifically
- target embedded systems and focus on bringing small, efficient and
- ubiquitous products.} -- quoted from \c 3rdparty/freetype/docs/freetype2.html.
-
- See \c src/3rdparty/freetype/docs/FTL.txt and \c
- src/3rdparty/freetype/docs/GPL.txt for license details.
-
- See also the files in \c src/3rdparty/harfbuzz, which are used by
- FreeType.
-
- Parts of the FreeType projects have been modified and put into Qt
- for use in the painting subsystem. These files are ftraster.h,
- ftraster.c, ftgrays.h and ftgrays.c. The following modifications
- has been made to these files:
-
- \list
- \i Renamed FT_ and ft_ symbols to QT_FT_ and qt_ft_ to avoid name
- conflicts.
- \i Removed parts of code not relevant when compiled with
- _STANDALONE_ defined.
- \i Changed behavior in ftraster.c to follow X polygon filling
- rules.
- \i Implemented support in ftraster.c for winding / odd even
- polygon fill rules.
- \i Replaced bitmap generation with span generation in ftraster.c
- \i Renamed: ftraster.h to qblackraster_p.h
- \i Renamed: ftraster.c to qblackraster.c
- \i Renamed: ftgrays.h to qgrayraster_p.h
- \i Renamed: ftgrays.c to qgrayraster.c
- \endlist
-
- \section1 HarfBuzz (\c harfbuzz)
-
- \e{This is HarfBuzz, an OpenType Layout engine.}
-
- \e{It was derived originally from the OpenType code in FreeType-1.x, ported to
- FreeType2. (This code has been abandoned for FreeType2, but until something
- better comes along, should serve our purposes.) In addition to porting to
- FreeType-2, it has been modified in various other ways.} -- quoted from
- \c src/3rdparty/harfbuzz/README.
-
- See \c src/3rdparty/harfbuzz/COPYING.FTL and src/3rdparty/harfbuzz/COPYING.GPL
- for license details.
-
- \section1 The Independent JPEG Group's JPEG Software (\c libjpeg) version 6b
-
- \e{This package contains C software to implement JPEG image compression and
- decompression. JPEG (pronounced "jay-peg") is a standardized compression
- method for full-color and gray-scale images. JPEG is intended for compressing
- "real-world" scenes; line drawings, cartoons and other non-realistic images
- are not its strong suit. JPEG is lossy, meaning that the output image is not
- exactly identical to the input image.} -- quoted from \c
- src/3rdparty/libjpeg/README.
-
- See \c src/3rdparty/libjpeg/README for license details.
-
- \section1 MD4 (\c md4.cpp and \c md4.h)
-
- \e{MD4 (RFC-1320) message digest.\br
- Modified from MD5 code by Andrey Panin \br\br
- Written by Solar Designer in 2001, and placed in\br
- the public domain. There's absolutely no warranty.}
-
- See \c src/3rdparty/md4/md4.cpp and \c src/3rdparty/md4/md4.h for more
- information about the terms and conditions under which the code is
- supplied.
-
- \section1 MD5 (\c md5.cpp and \c md5.h)
-
- \e{This code implements the MD5 message-digest algorithm.
- The algorithm is due to Ron Rivest. This code was
- written by Colin Plumb in 1993, no copyright is claimed.
- This code is in the public domain; do with it what you wish.} -- quoted from
- \c src/3rdparty/md5/md5.h
-
- See \c src/3rdparty/md5/md5.cpp and \c src/3rdparty/md5/md5.h for more
- information about the terms and conditions under which the code is
- supplied.
-
- \section1 MNG Library (\c libmng) version 1.0.10
-
- \e{The libmng library supports decoding, displaying, encoding, and various
- other manipulations of the Multiple-image Network Graphics (MNG) format
- image files. It uses the zlib compression library, and optionally the
- JPEG library by the Independant JPEG Group (IJG) and/or
- lcms (little cms), a color-management library by Marti Maria Saguer.}
- -- quoted from \c src/3rdparty/libmng/doc/libmng.txt
-
- See \c src/3rdparty/libmng/LICENSE for license details.
-
- \section1 PNG Reference Library (\c libpng) version 1.2.29
-
- \e{Libpng was written as a companion to the PNG specification, as a way
- of reducing the amount of time and effort it takes to support the PNG
- file format in application programs.} -- quoted from \c
- src/3rdparty/libpng/libpng.txt.
-
- See \c src/3rdparty/libpng/LICENSE for license details.
-
- \section1 The ptmalloc memory allocator (\c ptmalloc3) version 1.8
-
- \e ptmcalloc3 is a scalable concurrent memory allocator suitable
- for use in multi-threaded programs.
-
- \hr
-
- Copyright (c) 2001-2006 Wolfram Gloger
-
- Permission to use, copy, modify, distribute, and sell this software
- and its documentation for any purpose is hereby granted without fee,
- provided that (i) the above copyright notices and this permission
- notice appear in all copies of the software and related documentation,
- and (ii) the name of Wolfram Gloger may not be used in any advertising
- or publicity relating to the software.
-
- THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
- IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
- INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
- DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
- OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-
- \hr
-
- See \c src/3rdparty/ptmalloc/COPYRIGHT for license details.
-
- \section1 SHA-1 (\c sha1.cpp)
-
- \e{Based on the public domain implementation of the SHA-1 algorithm\br
- Copyright (C) Dominik Reichl }
-
- See \c src/3rdparty/sha1/sha1.cpp for more information about the terms and
- conditions under which the code is supplied.
-
- \section1 SQLite (\c sqlite) version 3.5.9
-
- \e{SQLite is a small C library that implements a
- self-contained, embeddable, zero-configuration SQL database engine.}
- -- quoted from \l{http://www.sqlite.org/}{www.sqlite.org}.
-
- According to the comments in the source files, the code is in the public
- domain. See the
- \l{http://www.sqlite.org/copyright.html}{SQLite Copyright} page on the
- SQLite web site for further information.
-
- \section1 TIFF Software Distribution (\c libtiff) version 3.8.2
-
- \e {libtiff is a set of C functions (a library) that support the
- manipulation of TIFF image files.} -- quoted from \c
- src/libtiff/html/libtiff.html
-
- \hr
-
- Copyright (c) 1988-1997 Sam Leffler\br
- Copyright (c) 1991-1997 Silicon Graphics, Inc.\br
- Copyright (C) 2004, Andrey Kiselev \br
- Copyright (c) 1997 Greg Ward Larson
-
- Permission to use, copy, modify, distribute, and sell this software and
- its documentation for any purpose is hereby granted without fee, provided
- that (i) the above copyright notices and this permission notice appear in
- all copies of the software and related documentation, and (ii) the names of
- Sam Leffler and Silicon Graphics may not be used in any advertising or
- publicity relating to the software without the specific, prior written
- permission of Sam Leffler and Silicon Graphics.
-
- THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
- IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
- ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- OF THIS SOFTWARE.
-
- \hr
-
- Copyright (c) 1996-1997 Sam Leffler\br
- Copyright (c) 1996 Pixar
-
- Permission to use, copy, modify, distribute, and sell this software and
- its documentation for any purpose is hereby granted without fee, provided
- that (i) the above copyright notices and this permission notice appear in
- all copies of the software and related documentation, and (ii) the names of
- Pixar, Sam Leffler and Silicon Graphics may not be used in any advertising or
- publicity relating to the software without the specific, prior written
- permission of Pixar, Sam Leffler and Silicon Graphics.
-
- THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
- IN NO EVENT SHALL PIXAR, SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
- ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
- OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
- LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- OF THIS SOFTWARE.
-
- \hr
-
- See \c src/3rdparty/libtiff/COPYRIGHT for license details.
-
- \section1 Wintab API (\c wintab)
-
- Wintab is a de facto API for pointing devices on Windows. The
- wintab code is from \l{http://www.pointing.com/WINTAB.HTM}.
-
- See \c src/3rdparty/wintab/wintab.h for license details.
-
- \section1 Data Compression Library (\c zlib) version 1.2.3
-
- \e{zlib is a general purpose data compression library. All the code
- is thread safe. The data format used by the zlib library is described
- by RFCs (Request for Comments) 1950 to 1952} -- quoted from \c
- src/3rdparty/zlib/README.
-
- See \c src/3rdparty/zlib/README for license details.
-*/
diff --git a/doc/src/commercialeditions.qdoc b/doc/src/commercialeditions.qdoc
deleted file mode 100644
index b6d80c2..0000000
--- a/doc/src/commercialeditions.qdoc
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page commercialeditions.html
- \title Qt Commercial Editions
- \ingroup licensing
- \brief Information about the license and features of the Commercial Edition.
-
- \keyword Qt Full Framework Edition
- \keyword Qt GUI Framework Edition
-
- Two editions of Qt are available under a commercial license:
- Qt GUI Framework Edition, and Qt Full Framework Edition.
-
- If you want to develop Free or Open Source software for release using a recognized
- Open Source license, you can use the \l{Open Source Versions of Qt}.
-
- The table below summarizes the differences between the three
- commercial editions:
-
- \table 75%
- \header \o{1,2} Features \o{2,1} Editions
- \header \o Qt GUI Framework \o Qt Full Framework
- \row \o \l{QtCore}{Qt Core classes (QtCore)} \o \bold{X} \o \bold{X}
- \row \o \l{QtGui}{Qt GUI classes (QtGui)} \o \bold{(X)} \o \bold{X}
- \row \o \l{Graphics View Classes} (part of QtGui) \o \o \bold{X}
- \row \o \l{QtNetwork}{Networking (QtNetwork)} \o \o \bold{X}
- \row \o \l{QtOpenGL}{OpenGL (QtOpenGL)} \o \o \bold{X}
- \row \o \l{QtScript}{Scripting (QtScript)} \o \o \bold{X}
- \row \o \l{QtScriptTools}{Script Debugging (QtScriptTools)}\o \o \bold{X}
- \row \o \l{QtSql}{Database/SQL (QtSql)} \o \o \bold{X}
- \row \o \l{QtSvg}{SVG (QtSvg)} \o \o \bold{X}
- \row \o \l{QtWebKit}{WebKit integration (QtWebKit)} \o \o \bold{X}
- \row \o \l{QtXml}{XML (QtXml)} \o \o \bold{X}
- \row \o \l{QtXmlPatterns}{XQuery and XPath (QtXmlPatterns)}\o \o \bold{X}
- \row \o \l{Qt3Support}{Qt 3 Support (Qt3Support)} \o \bold{(X)} \o \bold{X}
- \row \o \l{QtHelp}{Help system (QtHelp)} \o \o \bold{X}
- \row \o \l{QtDBus}{D-Bus IPC support (QtDBus)} \o \bold{X} \o \bold{X}
- \row \o \l{QtDesigner}{\QD extension classes (QtDesigner)} \o \o \bold{X}
- \row \o \l{QtTest}{Unit testing framework (QtTest)} \o \bold{X} \o \bold{X}
- \row \o \l{QtUiTools}{Run-time form handling (QtUiTools)} \o \o \bold{X}
- \row \o \l{Phonon Module}{Phonon Multimedia Framework} \o \o \bold{X}
- \row \o \l{ActiveQt} \o \o \bold{}
- \endtable
-
- \bold{(X)} The Qt GUI Framework Edition contains selected classes from the QtGui and
- Qt3Support modules corresponding to the functionality available in the Qt 3 Professional
- Edition.
-
- \bold{} The ActiveQt module is only available on Windows.
-
- Lists of the classes available in each edition are available on the
- following pages:
-
- \list
- \o \l{Qt GUI Framework Edition Classes}
- \o \l{Qt Full Framework Edition Classes}
- \endlist
-
- Please see the \l{Supported Platforms}{list of supported
- platforms} for up-to-date information about the various platforms
- and compilers that Qt supports.
-
- On the Qt web site, you can find a
- \l{Qt Licensing Overview} and information on \l{Qt License Pricing}
- for commercial editions of Qt and other Qt-related products.
-
- To purchase, please visit the \l{How to Order}{online order
- form}.
-
- For further information and assistance, please contact Qt
- sales.
-
- Web: http://www.qtsoftware.com/contact.
-
- Phone, U.S. office (for North America): \bold{1-650-813-1676}.
-
- Phone, Norway office (for the rest of the world): \bold{+47 21 60
- 48 00}.
-*/
-
-/*!
- \page full-framework-edition-classes.html
- \title Qt Full Framework Edition Classes
- \ingroup classlists
-
- \generatelist{classesbyedition Desktop}
-*/
-
-/*!
- \page gui-framework-edition-classes.html
- \title Qt GUI Framework Edition Classes
- \ingroup classlists
-
- \generatelist{classesbyedition DesktopLight}
-*/
diff --git a/doc/src/editions.qdoc b/doc/src/editions.qdoc
deleted file mode 100644
index 9ed4c9c..0000000
--- a/doc/src/editions.qdoc
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/****************************************************************************
-**
-** Documentation of Qt editions.
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt GUI Toolkit.
-** EDITIONS: FREE, PROFESSIONAL, ENTERPRISE
-**
-****************************************************************************/
-
-/*!
- \page editions.html
- \title Qt Editions
- \ingroup licensing
- \brief Information about the different editions of Qt.
-
- Qt can be used to create both commercial and non-commercial
- software for a wide range of different deployment environments,
- and is supplied in a number of different forms to suit the needs
- of different kinds of developers.
-
- In terms of license conditions, there are two main forms of Qt:
-
- \list
- \o The \l{Qt Commercial Editions} are the commercial
- versions of \l{About Qt}{Qt}.
- \o The \l{Open Source Versions of Qt} are freely available for download.
- \endlist
-
- On the Qt web site, you can find a
- \l{Qt Licensing Overview} and information on \l{Qt License Pricing}
- for commercial editions of Qt and other Qt-related products.
-*/
diff --git a/doc/src/gpl.qdoc b/doc/src/gpl.qdoc
deleted file mode 100644
index 97959e8..0000000
--- a/doc/src/gpl.qdoc
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*! \page gpl.html
-\title GNU General Public License (GPL)
-\ingroup licensing
-\brief About the GPL license used for Qt.
-
-The Qt GUI Toolkit is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\br
-Contact: Nokia Corporation (qt-info@nokia.com)
-
-Qt is available under the GPL.
-
-\section1 The GNU General Public License (Version 3)
-
-Reference: \l{GNU General Public License}
-
-\snippet doc/src/snippets/code/doc_src_gpl.qdoc GPL v3
-*/
-
-/*! \page lgpl.html
-\title GNU Lesser General Public License (LGPL)
-\ingroup licensing
-\brief About the LGPL license used for Qt.
-
-The Qt GUI Toolkit is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\br
-Contact: Nokia Corporation (qt-info@nokia.com)
-
-Qt is available under the LGPL.
-
-\section1 The GNU Lesser General Public License (Version 2.1)
-
-Reference: \l{GNU Lesser General Public License, version 2.1}
-
-\snippet doc/src/snippets/code/doc_src_lgpl.qdoc LGPL v2.1
-
-\section1 Nokia Qt LGPL Exception version 1.0
-
-As a special exception to the GNU Lesser General Public License version 2.1,
-the object code form of a "work that uses the Library" may incorporate material
-from a header file that is part of the Library. You may distribute such object
-code under terms of your choice, provided that the incorporated material
-(i) does not exceed more than 5% of the total size of the Library; and
-(ii) is limited to numerical parameters, data structure layouts, accessors,
-macros, inline functions and templates.
-*/
diff --git a/doc/src/legal/3rdparty.qdoc b/doc/src/legal/3rdparty.qdoc
new file mode 100644
index 0000000..0d86ab3
--- /dev/null
+++ b/doc/src/legal/3rdparty.qdoc
@@ -0,0 +1,300 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page 3rdparty.html
+
+ \title Third-Party Licenses Used in Qt
+ \ingroup licensing
+ \brief License information for third-party libraries supplied with Qt.
+
+ Qt includes a number of third-party libraries that are used to provide
+ certain features. Unlike the code described in the
+ \l{Other Licenses Used in Qt}{code used in Qt} document, these
+ libraries are supplied alongside the Qt modules.
+
+ Third Party Software may impose additional restrictions and it is the
+ user's responsibility to ensure that they have met the licensing
+ requirements of the GPL, LGPL, or Qt Commercial license and the relevant
+ license of the Third Party Software they are using.
+
+ Run \c{configure -help} to see any options that may be available for
+ controlling the use of these libraries.
+
+ \tableofcontents
+
+ \section1 DES (\c des.cpp)
+
+ \e{Implementation of DES encryption for NTLM\br
+ Copyright 1997-2005 Simon Tatham.\br
+ This software is released under the MIT license.}
+
+ See \c src/3rdparty/des/des.cpp for more information about the terms and
+ conditions under which the code is supplied.
+
+ \section1 FreeType 2 (\c freetype) version 2.3.6
+
+ \e{The FreeType project is a team of volunteers who develop free, portable
+ and high-quality software solutions for digital typography. We specifically
+ target embedded systems and focus on bringing small, efficient and
+ ubiquitous products.} -- quoted from \c 3rdparty/freetype/docs/freetype2.html.
+
+ See \c src/3rdparty/freetype/docs/FTL.txt and \c
+ src/3rdparty/freetype/docs/GPL.txt for license details.
+
+ See also the files in \c src/3rdparty/harfbuzz, which are used by
+ FreeType.
+
+ Parts of the FreeType projects have been modified and put into Qt
+ for use in the painting subsystem. These files are ftraster.h,
+ ftraster.c, ftgrays.h and ftgrays.c. The following modifications
+ has been made to these files:
+
+ \list
+ \i Renamed FT_ and ft_ symbols to QT_FT_ and qt_ft_ to avoid name
+ conflicts.
+ \i Removed parts of code not relevant when compiled with
+ _STANDALONE_ defined.
+ \i Changed behavior in ftraster.c to follow X polygon filling
+ rules.
+ \i Implemented support in ftraster.c for winding / odd even
+ polygon fill rules.
+ \i Replaced bitmap generation with span generation in ftraster.c
+ \i Renamed: ftraster.h to qblackraster_p.h
+ \i Renamed: ftraster.c to qblackraster.c
+ \i Renamed: ftgrays.h to qgrayraster_p.h
+ \i Renamed: ftgrays.c to qgrayraster.c
+ \endlist
+
+ \section1 HarfBuzz (\c harfbuzz)
+
+ \e{This is HarfBuzz, an OpenType Layout engine.}
+
+ \e{It was derived originally from the OpenType code in FreeType-1.x, ported to
+ FreeType2. (This code has been abandoned for FreeType2, but until something
+ better comes along, should serve our purposes.) In addition to porting to
+ FreeType-2, it has been modified in various other ways.} -- quoted from
+ \c src/3rdparty/harfbuzz/README.
+
+ See \c src/3rdparty/harfbuzz/COPYING.FTL and src/3rdparty/harfbuzz/COPYING.GPL
+ for license details.
+
+ \section1 The Independent JPEG Group's JPEG Software (\c libjpeg) version 6b
+
+ \e{This package contains C software to implement JPEG image compression and
+ decompression. JPEG (pronounced "jay-peg") is a standardized compression
+ method for full-color and gray-scale images. JPEG is intended for compressing
+ "real-world" scenes; line drawings, cartoons and other non-realistic images
+ are not its strong suit. JPEG is lossy, meaning that the output image is not
+ exactly identical to the input image.} -- quoted from \c
+ src/3rdparty/libjpeg/README.
+
+ See \c src/3rdparty/libjpeg/README for license details.
+
+ \section1 MD4 (\c md4.cpp and \c md4.h)
+
+ \e{MD4 (RFC-1320) message digest.\br
+ Modified from MD5 code by Andrey Panin \br\br
+ Written by Solar Designer in 2001, and placed in\br
+ the public domain. There's absolutely no warranty.}
+
+ See \c src/3rdparty/md4/md4.cpp and \c src/3rdparty/md4/md4.h for more
+ information about the terms and conditions under which the code is
+ supplied.
+
+ \section1 MD5 (\c md5.cpp and \c md5.h)
+
+ \e{This code implements the MD5 message-digest algorithm.
+ The algorithm is due to Ron Rivest. This code was
+ written by Colin Plumb in 1993, no copyright is claimed.
+ This code is in the public domain; do with it what you wish.} -- quoted from
+ \c src/3rdparty/md5/md5.h
+
+ See \c src/3rdparty/md5/md5.cpp and \c src/3rdparty/md5/md5.h for more
+ information about the terms and conditions under which the code is
+ supplied.
+
+ \section1 MNG Library (\c libmng) version 1.0.10
+
+ \e{The libmng library supports decoding, displaying, encoding, and various
+ other manipulations of the Multiple-image Network Graphics (MNG) format
+ image files. It uses the zlib compression library, and optionally the
+ JPEG library by the Independant JPEG Group (IJG) and/or
+ lcms (little cms), a color-management library by Marti Maria Saguer.}
+ -- quoted from \c src/3rdparty/libmng/doc/libmng.txt
+
+ See \c src/3rdparty/libmng/LICENSE for license details.
+
+ \section1 PNG Reference Library (\c libpng) version 1.2.29
+
+ \e{Libpng was written as a companion to the PNG specification, as a way
+ of reducing the amount of time and effort it takes to support the PNG
+ file format in application programs.} -- quoted from \c
+ src/3rdparty/libpng/libpng.txt.
+
+ See \c src/3rdparty/libpng/LICENSE for license details.
+
+ \section1 The ptmalloc memory allocator (\c ptmalloc3) version 1.8
+
+ \e ptmcalloc3 is a scalable concurrent memory allocator suitable
+ for use in multi-threaded programs.
+
+ \hr
+
+ Copyright (c) 2001-2006 Wolfram Gloger
+
+ Permission to use, copy, modify, distribute, and sell this software
+ and its documentation for any purpose is hereby granted without fee,
+ provided that (i) the above copyright notices and this permission
+ notice appear in all copies of the software and related documentation,
+ and (ii) the name of Wolfram Gloger may not be used in any advertising
+ or publicity relating to the software.
+
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+ IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
+ INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
+ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
+ OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ PERFORMANCE OF THIS SOFTWARE.
+
+ \hr
+
+ See \c src/3rdparty/ptmalloc/COPYRIGHT for license details.
+
+ \section1 SHA-1 (\c sha1.cpp)
+
+ \e{Based on the public domain implementation of the SHA-1 algorithm\br
+ Copyright (C) Dominik Reichl }
+
+ See \c src/3rdparty/sha1/sha1.cpp for more information about the terms and
+ conditions under which the code is supplied.
+
+ \section1 SQLite (\c sqlite) version 3.5.9
+
+ \e{SQLite is a small C library that implements a
+ self-contained, embeddable, zero-configuration SQL database engine.}
+ -- quoted from \l{http://www.sqlite.org/}{www.sqlite.org}.
+
+ According to the comments in the source files, the code is in the public
+ domain. See the
+ \l{http://www.sqlite.org/copyright.html}{SQLite Copyright} page on the
+ SQLite web site for further information.
+
+ \section1 TIFF Software Distribution (\c libtiff) version 3.8.2
+
+ \e {libtiff is a set of C functions (a library) that support the
+ manipulation of TIFF image files.} -- quoted from \c
+ src/libtiff/html/libtiff.html
+
+ \hr
+
+ Copyright (c) 1988-1997 Sam Leffler\br
+ Copyright (c) 1991-1997 Silicon Graphics, Inc.\br
+ Copyright (C) 2004, Andrey Kiselev \br
+ Copyright (c) 1997 Greg Ward Larson
+
+ Permission to use, copy, modify, distribute, and sell this software and
+ its documentation for any purpose is hereby granted without fee, provided
+ that (i) the above copyright notices and this permission notice appear in
+ all copies of the software and related documentation, and (ii) the names of
+ Sam Leffler and Silicon Graphics may not be used in any advertising or
+ publicity relating to the software without the specific, prior written
+ permission of Sam Leffler and Silicon Graphics.
+
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+ IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ OF THIS SOFTWARE.
+
+ \hr
+
+ Copyright (c) 1996-1997 Sam Leffler\br
+ Copyright (c) 1996 Pixar
+
+ Permission to use, copy, modify, distribute, and sell this software and
+ its documentation for any purpose is hereby granted without fee, provided
+ that (i) the above copyright notices and this permission notice appear in
+ all copies of the software and related documentation, and (ii) the names of
+ Pixar, Sam Leffler and Silicon Graphics may not be used in any advertising or
+ publicity relating to the software without the specific, prior written
+ permission of Pixar, Sam Leffler and Silicon Graphics.
+
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+ IN NO EVENT SHALL PIXAR, SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ OF THIS SOFTWARE.
+
+ \hr
+
+ See \c src/3rdparty/libtiff/COPYRIGHT for license details.
+
+ \section1 Wintab API (\c wintab)
+
+ Wintab is a de facto API for pointing devices on Windows. The
+ wintab code is from \l{http://www.pointing.com/WINTAB.HTM}.
+
+ See \c src/3rdparty/wintab/wintab.h for license details.
+
+ \section1 Data Compression Library (\c zlib) version 1.2.3
+
+ \e{zlib is a general purpose data compression library. All the code
+ is thread safe. The data format used by the zlib library is described
+ by RFCs (Request for Comments) 1950 to 1952} -- quoted from \c
+ src/3rdparty/zlib/README.
+
+ See \c src/3rdparty/zlib/README for license details.
+*/
diff --git a/doc/src/legal/commercialeditions.qdoc b/doc/src/legal/commercialeditions.qdoc
new file mode 100644
index 0000000..b6d80c2
--- /dev/null
+++ b/doc/src/legal/commercialeditions.qdoc
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page commercialeditions.html
+ \title Qt Commercial Editions
+ \ingroup licensing
+ \brief Information about the license and features of the Commercial Edition.
+
+ \keyword Qt Full Framework Edition
+ \keyword Qt GUI Framework Edition
+
+ Two editions of Qt are available under a commercial license:
+ Qt GUI Framework Edition, and Qt Full Framework Edition.
+
+ If you want to develop Free or Open Source software for release using a recognized
+ Open Source license, you can use the \l{Open Source Versions of Qt}.
+
+ The table below summarizes the differences between the three
+ commercial editions:
+
+ \table 75%
+ \header \o{1,2} Features \o{2,1} Editions
+ \header \o Qt GUI Framework \o Qt Full Framework
+ \row \o \l{QtCore}{Qt Core classes (QtCore)} \o \bold{X} \o \bold{X}
+ \row \o \l{QtGui}{Qt GUI classes (QtGui)} \o \bold{(X)} \o \bold{X}
+ \row \o \l{Graphics View Classes} (part of QtGui) \o \o \bold{X}
+ \row \o \l{QtNetwork}{Networking (QtNetwork)} \o \o \bold{X}
+ \row \o \l{QtOpenGL}{OpenGL (QtOpenGL)} \o \o \bold{X}
+ \row \o \l{QtScript}{Scripting (QtScript)} \o \o \bold{X}
+ \row \o \l{QtScriptTools}{Script Debugging (QtScriptTools)}\o \o \bold{X}
+ \row \o \l{QtSql}{Database/SQL (QtSql)} \o \o \bold{X}
+ \row \o \l{QtSvg}{SVG (QtSvg)} \o \o \bold{X}
+ \row \o \l{QtWebKit}{WebKit integration (QtWebKit)} \o \o \bold{X}
+ \row \o \l{QtXml}{XML (QtXml)} \o \o \bold{X}
+ \row \o \l{QtXmlPatterns}{XQuery and XPath (QtXmlPatterns)}\o \o \bold{X}
+ \row \o \l{Qt3Support}{Qt 3 Support (Qt3Support)} \o \bold{(X)} \o \bold{X}
+ \row \o \l{QtHelp}{Help system (QtHelp)} \o \o \bold{X}
+ \row \o \l{QtDBus}{D-Bus IPC support (QtDBus)} \o \bold{X} \o \bold{X}
+ \row \o \l{QtDesigner}{\QD extension classes (QtDesigner)} \o \o \bold{X}
+ \row \o \l{QtTest}{Unit testing framework (QtTest)} \o \bold{X} \o \bold{X}
+ \row \o \l{QtUiTools}{Run-time form handling (QtUiTools)} \o \o \bold{X}
+ \row \o \l{Phonon Module}{Phonon Multimedia Framework} \o \o \bold{X}
+ \row \o \l{ActiveQt} \o \o \bold{}
+ \endtable
+
+ \bold{(X)} The Qt GUI Framework Edition contains selected classes from the QtGui and
+ Qt3Support modules corresponding to the functionality available in the Qt 3 Professional
+ Edition.
+
+ \bold{} The ActiveQt module is only available on Windows.
+
+ Lists of the classes available in each edition are available on the
+ following pages:
+
+ \list
+ \o \l{Qt GUI Framework Edition Classes}
+ \o \l{Qt Full Framework Edition Classes}
+ \endlist
+
+ Please see the \l{Supported Platforms}{list of supported
+ platforms} for up-to-date information about the various platforms
+ and compilers that Qt supports.
+
+ On the Qt web site, you can find a
+ \l{Qt Licensing Overview} and information on \l{Qt License Pricing}
+ for commercial editions of Qt and other Qt-related products.
+
+ To purchase, please visit the \l{How to Order}{online order
+ form}.
+
+ For further information and assistance, please contact Qt
+ sales.
+
+ Web: http://www.qtsoftware.com/contact.
+
+ Phone, U.S. office (for North America): \bold{1-650-813-1676}.
+
+ Phone, Norway office (for the rest of the world): \bold{+47 21 60
+ 48 00}.
+*/
+
+/*!
+ \page full-framework-edition-classes.html
+ \title Qt Full Framework Edition Classes
+ \ingroup classlists
+
+ \generatelist{classesbyedition Desktop}
+*/
+
+/*!
+ \page gui-framework-edition-classes.html
+ \title Qt GUI Framework Edition Classes
+ \ingroup classlists
+
+ \generatelist{classesbyedition DesktopLight}
+*/
diff --git a/doc/src/legal/editions.qdoc b/doc/src/legal/editions.qdoc
new file mode 100644
index 0000000..9ed4c9c
--- /dev/null
+++ b/doc/src/legal/editions.qdoc
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/****************************************************************************
+**
+** Documentation of Qt editions.
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt GUI Toolkit.
+** EDITIONS: FREE, PROFESSIONAL, ENTERPRISE
+**
+****************************************************************************/
+
+/*!
+ \page editions.html
+ \title Qt Editions
+ \ingroup licensing
+ \brief Information about the different editions of Qt.
+
+ Qt can be used to create both commercial and non-commercial
+ software for a wide range of different deployment environments,
+ and is supplied in a number of different forms to suit the needs
+ of different kinds of developers.
+
+ In terms of license conditions, there are two main forms of Qt:
+
+ \list
+ \o The \l{Qt Commercial Editions} are the commercial
+ versions of \l{About Qt}{Qt}.
+ \o The \l{Open Source Versions of Qt} are freely available for download.
+ \endlist
+
+ On the Qt web site, you can find a
+ \l{Qt Licensing Overview} and information on \l{Qt License Pricing}
+ for commercial editions of Qt and other Qt-related products.
+*/
diff --git a/doc/src/legal/gpl.qdoc b/doc/src/legal/gpl.qdoc
new file mode 100644
index 0000000..97959e8
--- /dev/null
+++ b/doc/src/legal/gpl.qdoc
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*! \page gpl.html
+\title GNU General Public License (GPL)
+\ingroup licensing
+\brief About the GPL license used for Qt.
+
+The Qt GUI Toolkit is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\br
+Contact: Nokia Corporation (qt-info@nokia.com)
+
+Qt is available under the GPL.
+
+\section1 The GNU General Public License (Version 3)
+
+Reference: \l{GNU General Public License}
+
+\snippet doc/src/snippets/code/doc_src_gpl.qdoc GPL v3
+*/
+
+/*! \page lgpl.html
+\title GNU Lesser General Public License (LGPL)
+\ingroup licensing
+\brief About the LGPL license used for Qt.
+
+The Qt GUI Toolkit is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\br
+Contact: Nokia Corporation (qt-info@nokia.com)
+
+Qt is available under the LGPL.
+
+\section1 The GNU Lesser General Public License (Version 2.1)
+
+Reference: \l{GNU Lesser General Public License, version 2.1}
+
+\snippet doc/src/snippets/code/doc_src_lgpl.qdoc LGPL v2.1
+
+\section1 Nokia Qt LGPL Exception version 1.0
+
+As a special exception to the GNU Lesser General Public License version 2.1,
+the object code form of a "work that uses the Library" may incorporate material
+from a header file that is part of the Library. You may distribute such object
+code under terms of your choice, provided that the incorporated material
+(i) does not exceed more than 5% of the total size of the Library; and
+(ii) is limited to numerical parameters, data structure layouts, accessors,
+macros, inline functions and templates.
+*/
diff --git a/doc/src/legal/licenses.qdoc b/doc/src/legal/licenses.qdoc
new file mode 100644
index 0000000..4689114
--- /dev/null
+++ b/doc/src/legal/licenses.qdoc
@@ -0,0 +1,496 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \group licensing
+ \title Licensing Information
+ \ingroup topics
+ \brief Information about licenses and licensing issues.
+
+ These documents include information about Qt's licenses and the licenses
+ of third party components used in Qt.
+
+ \generatelist{related}
+*/
+
+
+/*!
+ \page licenses.html
+ \title Other Licenses Used in Qt
+ \ingroup licensing
+ \brief Information about other licenses used for Qt components and third-party code.
+
+ Qt contains some code that is not provided under the
+ \l{GNU General Public License (GPL)},
+ \l{GNU Lesser General Public License (LGPL)} or the
+ \l{Qt Commercial Editions}{Qt Commercial License Agreement}, but rather under
+ specific licenses from the original authors. Some pieces of code were developed
+ by Nokia and others originated from third parties.
+ This page lists the licenses used, names the authors, and links
+ to the places where it is used.
+
+ Nokia gratefully acknowledges these and other contributions
+ to Qt. We recommend that programs that use Qt also acknowledge
+ these contributions, and quote these license statements in an
+ appendix to the documentation.
+
+ See also: \l{Licenses for Fonts Used in Qt for Embedded Linux}
+
+ \generatelist legalese
+
+ \hr
+
+ Copyright (C) 2000-2004, International Business Machines\br
+ Corporation and others. All Rights Reserved.\br
+ Copyright (C) 2007 Apple Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ software and associated documentation files (the "Software"), to deal in the Software
+ without restriction, including without limitation the rights to use, copy, modify,
+ merge, publish, distribute, and/or sell copies of the Software, and to permit persons
+ to whom the Software is furnished to do so, provided that the above copyright notice(s)
+ and this permission notice appear in all copies of the Software and that both the above
+ copyright notice(s) and this permission notice appear in supporting documentation.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
+ OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
+ CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright holder shall not be used in
+ advertising or otherwise to promote the sale, use or other dealings in this Software
+ without prior written authorization of the copyright holder.
+
+ \list
+ \o Parts of WebKit used by the QtWebKit module
+ \endlist
+
+ \hr
+
+ Copyright (c) 1998 by Bjorn Reese
+
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
+
+ \list
+ \o Parts of the QCrashHandler class
+ \endlist
+
+ \hr
+
+ Parts of the FreeType projects have been modified and put into Qt
+ for use in the painting subsystem. These files are ftraster.h,
+ ftraster.c, ftgrays.h and ftgrays.c. The following modifications
+ has been made to these files:
+
+ \list
+ \i Renamed FT_ and ft_ symbols to QT_FT_ and qt_ft_ to avoid name
+ conflicts in \c{qrasterdefs_p.h}.
+ \i Removed parts of code not relevant when compiled with
+ _STANDALONE_ defined.
+ \i Changed behavior in \c{ftraster.c} to follow X polygon filling
+ rules.
+ \i Implemented support in \c{ftraster.c} for winding / odd even
+ polygon fill rules.
+ \i Replaced bitmap generation with span generation in \c{ftraster.c}.
+ \i Renamed \c{ftraster.h} as \c{qblackraster_p.h}.
+ \i Renamed \c{ftraster.c} as \c{qblackraster.c}.
+ \i Renamed \c{ftgrays.h} as \c{qgrayraster_p.h}.
+ \i Renamed \c{ftgrays.c} as \c{qgrayraster.c}.
+ \endlist
+
+ See \c src/3rdparty/freetype/docs/FTL.txt and \c
+ src/3rdparty/freetype/docs/GPL.txt for license details.
+
+ \hr
+
+ Copyright (c) 1985, 1986, 1987 X Consortium
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of the X Consortium shall
+ not be used in advertising or otherwise to promote the sale, use or
+ other dealings in this Software without prior written authorization
+ from the X Consortium.
+
+ \list
+ \o Parts of the Q3PolygonScanner class used in Qt for Embedded Linux
+ \endlist
+
+ \hr
+
+ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Digital not be
+ used in advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ SOFTWARE.
+
+ \list
+ \o Parts of the Q3PolygonScanner class used in Qt for Embedded Linux
+ \endlist
+
+ \hr
+
+ Copyright 1985, 1987, 1998 The Open Group
+
+ Permission to use, copy, modify, distribute, and sell this software and its
+ documentation for any purpose is hereby granted without fee, provided that
+ the above copyright notice appear in all copies and that both that
+ copyright notice and this permission notice appear in supporting
+ documentation.
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of The Open Group shall not be
+ used in advertising or otherwise to promote the sale, use or other dealings
+ in this Software without prior written authorization from The Open Group.
+
+ \list
+ \o Parts of the internal QKeyMapper class on X11 platforms
+ \endlist
+
+ \hr
+
+ pnmscale.c - read a portable anymap and scale it
+
+ Copyright (C) 1989, 1991 by Jef Poskanzer.
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted, provided
+ that the above copyright notice appear in all copies and that both that
+ copyright notice and this permission notice appear in supporting
+ documentation. This software is provided "as is" without express or
+ implied warranty.
+
+ \list
+ \o Parts of the internal QImageSmoothScaler::scale() function use code
+ based on pnmscale.c by Jef Poskanzer.
+ \endlist
+
+ \hr
+
+ jQuery JavaScript Library v1.3.2
+ http://jquery.com/
+
+ Copyright (c) 2009 John Resig
+ Dual licensed under the MIT and GPL licenses.
+ http://docs.jquery.com/License
+
+ Sizzle CSS Selector Engine - v0.9.3
+ Copyright 2009, The Dojo Foundation
+ Released under the MIT, BSD, and GPL Licenses.
+ More information: http://sizzlejs.com/
+
+ \list
+ \o examples/webkit/fancybrowser/jquery.min.js
+ \endlist
+*/
+
+/*!
+ \page licenses-fonts.html
+ \title Licenses for Fonts Used in Qt for Embedded Linux
+ \ingroup qt-embedded-linux
+ \ingroup licensing
+ \brief Information about the licenses of fonts supplied with Qt for Embedded Linux.
+
+ The fonts supplied with Qt for Embedded Linux have been obtained under a
+ variety of different licenses listed below.
+
+ \tableofcontents
+
+ See also: \l{Other Licenses Used in Qt}
+
+ \section1 Adobe Helvetica
+
+ Copyright 1984-1989, 1994 Adobe Systems Incorporated.
+ Copyright 1988, 1994 Digital Equipment Corporation.
+
+ Adobe is a trademark of Adobe Systems Incorporated which may be
+ registered in certain jurisdictions.
+ Permission to use these trademarks is hereby granted only in
+ association with the images described in this file.
+
+ Permission to use, copy, modify, distribute and sell this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notices appear in all
+ copies and that both those copyright notices and this permission
+ notice appear in supporting documentation, and that the names of
+ Adobe Systems and Digital Equipment Corporation not be used in
+ advertising or publicity pertaining to distribution of the software
+ without specific, written prior permission. Adobe Systems and
+ Digital Equipment Corporation make no representations about the
+ suitability of this software for any purpose. It is provided "as
+ is" without express or implied warranty.
+
+ \section1 Adobe Utopia
+
+ Permission to use, reproduce, display and distribute the listed
+ typefaces is hereby granted, provided that the Adobe Copyright notice
+ appears in all whole and partial copies of the software and that the
+ following trademark symbol and attribution appear in all unmodified
+ copies of the software:
+
+ Copyright (c) 1989 Adobe Systems Incorporated
+ Utopia (R)
+ Utopia is a registered trademark of Adobe Systems Incorporated
+
+ The Utopia font
+ Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights
+ Reserved.Utopia is a registered trademark of Adobe Systems
+ Incorporated.
+
+ \section1 Babelfish
+
+ \snippet doc/src/snippets/code/doc_src_licenses.qdoc 1
+
+ \section1 Bigelow & Holmes Luxi
+
+ Luxi fonts copyright (c) 2001 by Bigelow & Holmes Inc. Luxi font
+ instruction code copyright (c) 2001 by URW++ GmbH. All Rights
+ Reserved. Luxi is a registered trademark of Bigelow & Holmes Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of these Fonts and associated documentation files (the "Font
+ Software"), to deal in the Font Software, including without
+ limitation the rights to use, copy, merge, publish, distribute,
+ sublicense, and/or sell copies of the Font Software, and to permit
+ persons to whom the Font Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright and trademark notices and this permission notice
+ shall be included in all copies of one or more of the Font Software.
+
+ The Font Software may not be modified, altered, or added to, and in
+ particular the designs of glyphs or characters in the Fonts may not
+ be modified nor may additional glyphs or characters be added to the
+ Fonts. This License becomes null and void when the Fonts or Font
+ Software have been modified.
+
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
+ BIGELOW & HOLMES INC. OR URW++ GMBH. BE LIABLE FOR ANY CLAIM, DAMAGES
+ OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT,
+ INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR
+ INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT
+ SOFTWARE.
+
+ Except as contained in this notice, the names of Bigelow & Holmes
+ Inc. and URW++ GmbH. shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Font Software without
+ prior written authorization from Bigelow & Holmes Inc. and URW++ GmbH.
+
+ For further information, contact:
+
+ info@urwpp.de
+ or
+ design@bigelowandholmes.com
+
+ \section1 Bitstream Charter and Courier
+
+ (c) Copyright 1989-1992, Bitstream Inc., Cambridge, MA.
+
+ You are hereby granted permission under all Bitstream propriety rights
+ to use, copy, modify, sublicense, sell, and redistribute the 4 Bitstream
+ Charter (r) Type 1 outline fonts and the 4 Courier Type 1 outline fonts
+ for any purpose and without restriction; provided, that this notice is
+ left intact on all copies of such fonts and that Bitstream's trademark
+ is acknowledged as shown below on all unmodified copies of the 4 Charter
+ Type 1 fonts.
+
+ BITSTREAM CHARTER is a registered trademark of Bitstream Inc.
+
+ \section1 Bitstream Vera
+
+ Copyright (c) 2003 by Bitstream, Inc.
+
+ All Rights Reserved.
+
+ Bitstream Vera is a trademark of Bitstream, Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of the fonts accompanying this license ("Fonts") and associated
+ documentation files (the "Font Software"), to reproduce and distribute
+ the Font Software, including without limitation the rights to use,
+ copy, merge, publish, distribute, and/or sell copies of the Font
+ Software, and to permit persons to whom the Font Software is furnished
+ to do so, subject to the following conditions:
+
+ The above copyright and trademark notices and this permission notice
+ shall be included in all copies of one or more of the Font Software
+ typefaces.
+
+ The Font Software may be modified, altered, or added to, and in
+ particular the designs of glyphs or characters in the Fonts may be
+ modified and additional glyphs or characters may be added to the
+ Fonts, only if the fonts are renamed to names not containing either
+ the words "Bitstream" or the word "Vera".
+
+ This License becomes null and void to the extent applicable to Fonts
+ or Font Software that has been modified and is distributed under the
+ "Bitstream Vera" names.
+
+ The Font Software may be sold as part of a larger software package but
+ no copy of one or more of the Font Software typefaces may be sold by
+ itself.
+
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
+ BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
+ OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
+ SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
+
+ Except as contained in this notice, the names of Gnome, the Gnome
+ Foundation, and Bitstream Inc., shall not be used in advertising or
+ otherwise to promote the sale, use or other dealings in this Font
+ Software without prior written authorization from the Gnome Foundation
+ or Bitstream Inc., respectively. For further information, contact:
+ fonts at gnome dot org.
+
+ \omit
+ http://www.gnome.org/fonts/#Final_Bitstream_Vera_Fonts
+ \endomit
+
+ See also:
+ \l{http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html}{Vera Open Source Fonts}
+
+ \section1 Cursor
+
+ The Cursor font is distributed with the following declaration:
+
+ \e{Copyright (c) 2000 XFree86, Inc.}
+
+ \section1 DejaVu Fonts
+
+ DejaVu fonts come with the following copyright statement:
+
+ Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below)
+
+ \snippet doc/src/snippets/code/doc_src_licenses.qdoc 2
+
+ \section1 Fixed Fonts
+
+ The 5x7 and 6x13 fonts each contain the following copyright notice:
+
+ \e{Public domain font. Share and enjoy.}
+
+ \section1 IBM Courier
+
+ IBM Courier - Copyright (c) IBM Corporation 1990, 1991
+
+ You are hereby granted permission under the terms of the IBM/MIT X Consortium
+ Courier Typefont agreement to execute, reproduce, distribute, display, market,
+ sell and otherwise transfer copies of the IBM Courier font to third parties.
+
+ The font is provided "AS IS" without charge. NO WARRANTIES OR INDEMNIFICATION
+ ARE GIVEN, WHETHER EXPRESS OR IMPLIED INCLUDING, BUT LIMITED TO THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+ \section1 Micro
+
+ The Micro font contains the following copyright notice:
+
+ \e{Public domain font. Share and enjoy.}
+
+ \section1 Unifont
+
+ The Unifont font was originally obtained from
+ \l{http://www.czyborra.com/}{Roman Czyborra} under the following license:
+
+ \e{All of my works you find here are freeware. You may freely copy, use, quote,
+ modify or redistribute them as long as you properly attribute my contribution
+ and have given a quick thought about whether Roman might perhaps be interested
+ to read what you did with his stuff. Horizontal rules don't apply.}
+*/
diff --git a/doc/src/legal/opensourceedition.qdoc b/doc/src/legal/opensourceedition.qdoc
new file mode 100644
index 0000000..e7bb26a
--- /dev/null
+++ b/doc/src/legal/opensourceedition.qdoc
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page opensourceedition.html
+
+ \title Open Source Versions of Qt
+ \ingroup licensing
+ \brief Information about the license and features of the Open Source Edition.
+
+ Free (or open source) software is software that comes with a license
+ that gives users certain rights. In particular the right to use the
+ software, to modify it, to obtain its source, and to pass it on (under
+ the same terms). Notice that the term "free" is about rights, not
+ money. The Free Software Foundation (creators of the GNU GPL) speaks
+ of free in this context as in "free speech", not as in "no cost".
+
+ Nokia supports the free software concept by providing the Qt Open Source
+ Edition, which is licensed under the \l{GNU General Public License (GPL)}
+ (version 3) and the \l{GNU Lesser General Public License (LGPL)} (version 2.1).
+ You can use this edition of Qt to create and distribute software with licenses
+ that are compatible to these free software licenses.
+
+ The support of open source with the Open Source Versions of Qt has enabled large
+ successful software projects like KDE to thrive, with thousands of developers
+ around the world using open source versions of Qt at no cost to themselves. With
+ the release of Qt 4, open source versions of Qt became available for Unix/X11,
+ Mac OS X, and Windows platforms.
+
+ The Open Source Edition can be downloaded from the \l{Downloads}{Qt website}.
+
+ Please refer to the online \l{License FAQ} for answers to frequently asked
+ questions on open source licensing and its implications.
+
+ More information on Free and Open Source software is available online:
+
+ \list
+ \o GNU GPL: \l http://www.gnu.org/.
+ \o Open Source licensing: \l http://www.opensource.org/.
+ \endlist
+
+ See \l{Licensing Information} for a collection of documents about licenses
+ used in Qt.
+
+ Information about Qt Commercial License Agreements is available
+ in the \l{Qt Licensing Overview} on the Qt website or by contacting
+ the sales department at http://www.qtsoftware.com/contact.
+
+ If you are in doubt what edition of Qt is right for your project,
+ please contact
+ \l{mailto:qt-info@nokia.com}{qt-info@nokia.com}.
+
+*/
diff --git a/doc/src/legal/trademarks.qdoc b/doc/src/legal/trademarks.qdoc
new file mode 100644
index 0000000..0e659d2
--- /dev/null
+++ b/doc/src/legal/trademarks.qdoc
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page trademarks.html
+
+ \title Trademarks
+ \ingroup licensing
+ \brief Information about trademarks owned by Nokia and other organisations.
+
+ Nokia, the Nokia logo, Qt, and the Qt logo are trademarks of Nokia
+ Corporation and/or its subsidiaries in Finland and other countries.
+
+ \list
+ \o Intel, Intel Inside (logos), MMX and Pentium are \reg trademarks of
+ Intel Corporation in the United States, other countries, or both.
+ \o Java and all Java-based trademarks are trademarks of Sun Microsystems,
+ Inc. in the United States, other countries, or both.
+ \o Linux is a \reg trademark of Linus Torvalds in the United States, other
+ countries or both.
+ \o Mac, Mac OS and Macintosh are \reg trademarks of Apple Computer, Inc.,
+ registered in the U.S. and other countries.
+ \o Microsoft, Windows, Windows NT, XP, Visual Studio and the Windows logo
+ are \reg trademarks of Microsoft Corporation in the United States, other
+ countries, or both.
+ \o Motif is a registered trademark of The Open Group in the United States,
+ other countries, or both.
+ \o OpenGL is a \reg trademark of Silicon Graphics, Inc. in the United States
+ and other countries.
+ \o UNIX is a registered trademark of The Open Group in the United States
+ and other countries.
+ \o All other company, product, or service names may be trademarks or
+ service marks of others and are the property of their respective owners.
+ The use of the word partner does not imply a partnership relationship
+ between Nokia and any other company.
+ \endlist
+*/
diff --git a/doc/src/licenses.qdoc b/doc/src/licenses.qdoc
deleted file mode 100644
index 7597e7f..0000000
--- a/doc/src/licenses.qdoc
+++ /dev/null
@@ -1,483 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page licenses.html
- \title Other Licenses Used in Qt
- \ingroup licensing
- \brief Information about other licenses used for Qt components and third-party code.
-
- Qt contains some code that is not provided under the
- \l{GNU General Public License (GPL)},
- \l{GNU Lesser General Public License (LGPL)} or the
- \l{Qt Commercial Editions}{Qt Commercial License Agreement}, but rather under
- specific licenses from the original authors. Some pieces of code were developed
- by Nokia and others originated from third parties.
- This page lists the licenses used, names the authors, and links
- to the places where it is used.
-
- Nokia gratefully acknowledges these and other contributions
- to Qt. We recommend that programs that use Qt also acknowledge
- these contributions, and quote these license statements in an
- appendix to the documentation.
-
- See also: \l{Licenses for Fonts Used in Qt for Embedded Linux}
-
- \generatelist legalese
-
- \hr
-
- Copyright (C) 2000-2004, International Business Machines\br
- Corporation and others. All Rights Reserved.\br
- Copyright (C) 2007 Apple Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this
- software and associated documentation files (the "Software"), to deal in the Software
- without restriction, including without limitation the rights to use, copy, modify,
- merge, publish, distribute, and/or sell copies of the Software, and to permit persons
- to whom the Software is furnished to do so, provided that the above copyright notice(s)
- and this permission notice appear in all copies of the Software and that both the above
- copyright notice(s) and this permission notice appear in supporting documentation.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
- OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
- CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- Except as contained in this notice, the name of a copyright holder shall not be used in
- advertising or otherwise to promote the sale, use or other dealings in this Software
- without prior written authorization of the copyright holder.
-
- \list
- \o Parts of WebKit used by the QtWebKit module
- \endlist
-
- \hr
-
- Copyright (c) 1998 by Bjorn Reese
-
- Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
- CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
-
- \list
- \o Parts of the QCrashHandler class
- \endlist
-
- \hr
-
- Parts of the FreeType projects have been modified and put into Qt
- for use in the painting subsystem. These files are ftraster.h,
- ftraster.c, ftgrays.h and ftgrays.c. The following modifications
- has been made to these files:
-
- \list
- \i Renamed FT_ and ft_ symbols to QT_FT_ and qt_ft_ to avoid name
- conflicts in \c{qrasterdefs_p.h}.
- \i Removed parts of code not relevant when compiled with
- _STANDALONE_ defined.
- \i Changed behavior in \c{ftraster.c} to follow X polygon filling
- rules.
- \i Implemented support in \c{ftraster.c} for winding / odd even
- polygon fill rules.
- \i Replaced bitmap generation with span generation in \c{ftraster.c}.
- \i Renamed \c{ftraster.h} as \c{qblackraster_p.h}.
- \i Renamed \c{ftraster.c} as \c{qblackraster.c}.
- \i Renamed \c{ftgrays.h} as \c{qgrayraster_p.h}.
- \i Renamed \c{ftgrays.c} as \c{qgrayraster.c}.
- \endlist
-
- See \c src/3rdparty/freetype/docs/FTL.txt and \c
- src/3rdparty/freetype/docs/GPL.txt for license details.
-
- \hr
-
- Copyright (c) 1985, 1986, 1987 X Consortium
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name of the X Consortium shall
- not be used in advertising or otherwise to promote the sale, use or
- other dealings in this Software without prior written authorization
- from the X Consortium.
-
- \list
- \o Parts of the Q3PolygonScanner class used in Qt for Embedded Linux
- \endlist
-
- \hr
-
- Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
- Permission to use, copy, modify, and distribute this software and its
- documentation for any purpose and without fee is hereby granted,
- provided that the above copyright notice appear in all copies and that
- both that copyright notice and this permission notice appear in
- supporting documentation, and that the name of Digital not be
- used in advertising or publicity pertaining to distribution of the
- software without specific, written prior permission.
-
- DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- SOFTWARE.
-
- \list
- \o Parts of the Q3PolygonScanner class used in Qt for Embedded Linux
- \endlist
-
- \hr
-
- Copyright 1985, 1987, 1998 The Open Group
-
- Permission to use, copy, modify, distribute, and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation.
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name of The Open Group shall not be
- used in advertising or otherwise to promote the sale, use or other dealings
- in this Software without prior written authorization from The Open Group.
-
- \list
- \o Parts of the internal QKeyMapper class on X11 platforms
- \endlist
-
- \hr
-
- pnmscale.c - read a portable anymap and scale it
-
- Copyright (C) 1989, 1991 by Jef Poskanzer.
-
- Permission to use, copy, modify, and distribute this software and its
- documentation for any purpose and without fee is hereby granted, provided
- that the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation. This software is provided "as is" without express or
- implied warranty.
-
- \list
- \o Parts of the internal QImageSmoothScaler::scale() function use code
- based on pnmscale.c by Jef Poskanzer.
- \endlist
-
- \hr
-
- jQuery JavaScript Library v1.3.2
- http://jquery.com/
-
- Copyright (c) 2009 John Resig
- Dual licensed under the MIT and GPL licenses.
- http://docs.jquery.com/License
-
- Sizzle CSS Selector Engine - v0.9.3
- Copyright 2009, The Dojo Foundation
- Released under the MIT, BSD, and GPL Licenses.
- More information: http://sizzlejs.com/
-
- \list
- \o examples/webkit/fancybrowser/jquery.min.js
- \endlist
-*/
-
-/*!
- \page licenses-fonts.html
- \title Licenses for Fonts Used in Qt for Embedded Linux
- \ingroup qt-embedded-linux
- \ingroup licensing
- \brief Information about the licenses of fonts supplied with Qt for Embedded Linux.
-
- The fonts supplied with Qt for Embedded Linux have been obtained under a
- variety of different licenses listed below.
-
- \tableofcontents
-
- See also: \l{Other Licenses Used in Qt}
-
- \section1 Adobe Helvetica
-
- Copyright 1984-1989, 1994 Adobe Systems Incorporated.
- Copyright 1988, 1994 Digital Equipment Corporation.
-
- Adobe is a trademark of Adobe Systems Incorporated which may be
- registered in certain jurisdictions.
- Permission to use these trademarks is hereby granted only in
- association with the images described in this file.
-
- Permission to use, copy, modify, distribute and sell this software
- and its documentation for any purpose and without fee is hereby
- granted, provided that the above copyright notices appear in all
- copies and that both those copyright notices and this permission
- notice appear in supporting documentation, and that the names of
- Adobe Systems and Digital Equipment Corporation not be used in
- advertising or publicity pertaining to distribution of the software
- without specific, written prior permission. Adobe Systems and
- Digital Equipment Corporation make no representations about the
- suitability of this software for any purpose. It is provided "as
- is" without express or implied warranty.
-
- \section1 Adobe Utopia
-
- Permission to use, reproduce, display and distribute the listed
- typefaces is hereby granted, provided that the Adobe Copyright notice
- appears in all whole and partial copies of the software and that the
- following trademark symbol and attribution appear in all unmodified
- copies of the software:
-
- Copyright (c) 1989 Adobe Systems Incorporated
- Utopia (R)
- Utopia is a registered trademark of Adobe Systems Incorporated
-
- The Utopia font
- Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights
- Reserved.Utopia is a registered trademark of Adobe Systems
- Incorporated.
-
- \section1 Babelfish
-
- \snippet doc/src/snippets/code/doc_src_licenses.qdoc 1
-
- \section1 Bigelow & Holmes Luxi
-
- Luxi fonts copyright (c) 2001 by Bigelow & Holmes Inc. Luxi font
- instruction code copyright (c) 2001 by URW++ GmbH. All Rights
- Reserved. Luxi is a registered trademark of Bigelow & Holmes Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of these Fonts and associated documentation files (the "Font
- Software"), to deal in the Font Software, including without
- limitation the rights to use, copy, merge, publish, distribute,
- sublicense, and/or sell copies of the Font Software, and to permit
- persons to whom the Font Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright and trademark notices and this permission notice
- shall be included in all copies of one or more of the Font Software.
-
- The Font Software may not be modified, altered, or added to, and in
- particular the designs of glyphs or characters in the Fonts may not
- be modified nor may additional glyphs or characters be added to the
- Fonts. This License becomes null and void when the Fonts or Font
- Software have been modified.
-
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
- BIGELOW & HOLMES INC. OR URW++ GMBH. BE LIABLE FOR ANY CLAIM, DAMAGES
- OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT,
- INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
- CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR
- INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT
- SOFTWARE.
-
- Except as contained in this notice, the names of Bigelow & Holmes
- Inc. and URW++ GmbH. shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Font Software without
- prior written authorization from Bigelow & Holmes Inc. and URW++ GmbH.
-
- For further information, contact:
-
- info@urwpp.de
- or
- design@bigelowandholmes.com
-
- \section1 Bitstream Charter and Courier
-
- (c) Copyright 1989-1992, Bitstream Inc., Cambridge, MA.
-
- You are hereby granted permission under all Bitstream propriety rights
- to use, copy, modify, sublicense, sell, and redistribute the 4 Bitstream
- Charter (r) Type 1 outline fonts and the 4 Courier Type 1 outline fonts
- for any purpose and without restriction; provided, that this notice is
- left intact on all copies of such fonts and that Bitstream's trademark
- is acknowledged as shown below on all unmodified copies of the 4 Charter
- Type 1 fonts.
-
- BITSTREAM CHARTER is a registered trademark of Bitstream Inc.
-
- \section1 Bitstream Vera
-
- Copyright (c) 2003 by Bitstream, Inc.
-
- All Rights Reserved.
-
- Bitstream Vera is a trademark of Bitstream, Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of the fonts accompanying this license ("Fonts") and associated
- documentation files (the "Font Software"), to reproduce and distribute
- the Font Software, including without limitation the rights to use,
- copy, merge, publish, distribute, and/or sell copies of the Font
- Software, and to permit persons to whom the Font Software is furnished
- to do so, subject to the following conditions:
-
- The above copyright and trademark notices and this permission notice
- shall be included in all copies of one or more of the Font Software
- typefaces.
-
- The Font Software may be modified, altered, or added to, and in
- particular the designs of glyphs or characters in the Fonts may be
- modified and additional glyphs or characters may be added to the
- Fonts, only if the fonts are renamed to names not containing either
- the words "Bitstream" or the word "Vera".
-
- This License becomes null and void to the extent applicable to Fonts
- or Font Software that has been modified and is distributed under the
- "Bitstream Vera" names.
-
- The Font Software may be sold as part of a larger software package but
- no copy of one or more of the Font Software typefaces may be sold by
- itself.
-
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
- BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
- OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
- SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
-
- Except as contained in this notice, the names of Gnome, the Gnome
- Foundation, and Bitstream Inc., shall not be used in advertising or
- otherwise to promote the sale, use or other dealings in this Font
- Software without prior written authorization from the Gnome Foundation
- or Bitstream Inc., respectively. For further information, contact:
- fonts at gnome dot org.
-
- \omit
- http://www.gnome.org/fonts/#Final_Bitstream_Vera_Fonts
- \endomit
-
- See also:
- \l{http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html}{Vera Open Source Fonts}
-
- \section1 Cursor
-
- The Cursor font is distributed with the following declaration:
-
- \e{Copyright (c) 2000 XFree86, Inc.}
-
- \section1 DejaVu Fonts
-
- DejaVu fonts come with the following copyright statement:
-
- Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below)
-
- \snippet doc/src/snippets/code/doc_src_licenses.qdoc 2
-
- \section1 Fixed Fonts
-
- The 5x7 and 6x13 fonts each contain the following copyright notice:
-
- \e{Public domain font. Share and enjoy.}
-
- \section1 IBM Courier
-
- IBM Courier - Copyright (c) IBM Corporation 1990, 1991
-
- You are hereby granted permission under the terms of the IBM/MIT X Consortium
- Courier Typefont agreement to execute, reproduce, distribute, display, market,
- sell and otherwise transfer copies of the IBM Courier font to third parties.
-
- The font is provided "AS IS" without charge. NO WARRANTIES OR INDEMNIFICATION
- ARE GIVEN, WHETHER EXPRESS OR IMPLIED INCLUDING, BUT LIMITED TO THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
- \section1 Micro
-
- The Micro font contains the following copyright notice:
-
- \e{Public domain font. Share and enjoy.}
-
- \section1 Unifont
-
- The Unifont font was originally obtained from
- \l{http://www.czyborra.com/}{Roman Czyborra} under the following license:
-
- \e{All of my works you find here are freeware. You may freely copy, use, quote,
- modify or redistribute them as long as you properly attribute my contribution
- and have given a quick thought about whether Roman might perhaps be interested
- to read what you did with his stuff. Horizontal rules don't apply.}
-*/
diff --git a/doc/src/opensourceedition.qdoc b/doc/src/opensourceedition.qdoc
deleted file mode 100644
index e7bb26a..0000000
--- a/doc/src/opensourceedition.qdoc
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page opensourceedition.html
-
- \title Open Source Versions of Qt
- \ingroup licensing
- \brief Information about the license and features of the Open Source Edition.
-
- Free (or open source) software is software that comes with a license
- that gives users certain rights. In particular the right to use the
- software, to modify it, to obtain its source, and to pass it on (under
- the same terms). Notice that the term "free" is about rights, not
- money. The Free Software Foundation (creators of the GNU GPL) speaks
- of free in this context as in "free speech", not as in "no cost".
-
- Nokia supports the free software concept by providing the Qt Open Source
- Edition, which is licensed under the \l{GNU General Public License (GPL)}
- (version 3) and the \l{GNU Lesser General Public License (LGPL)} (version 2.1).
- You can use this edition of Qt to create and distribute software with licenses
- that are compatible to these free software licenses.
-
- The support of open source with the Open Source Versions of Qt has enabled large
- successful software projects like KDE to thrive, with thousands of developers
- around the world using open source versions of Qt at no cost to themselves. With
- the release of Qt 4, open source versions of Qt became available for Unix/X11,
- Mac OS X, and Windows platforms.
-
- The Open Source Edition can be downloaded from the \l{Downloads}{Qt website}.
-
- Please refer to the online \l{License FAQ} for answers to frequently asked
- questions on open source licensing and its implications.
-
- More information on Free and Open Source software is available online:
-
- \list
- \o GNU GPL: \l http://www.gnu.org/.
- \o Open Source licensing: \l http://www.opensource.org/.
- \endlist
-
- See \l{Licensing Information} for a collection of documents about licenses
- used in Qt.
-
- Information about Qt Commercial License Agreements is available
- in the \l{Qt Licensing Overview} on the Qt website or by contacting
- the sales department at http://www.qtsoftware.com/contact.
-
- If you are in doubt what edition of Qt is right for your project,
- please contact
- \l{mailto:qt-info@nokia.com}{qt-info@nokia.com}.
-
-*/
diff --git a/doc/src/topics.qdoc b/doc/src/topics.qdoc
index 7f832ab..15be0ade 100644
--- a/doc/src/topics.qdoc
+++ b/doc/src/topics.qdoc
@@ -150,18 +150,6 @@ These guides provide specific help about specific Qt-related topics.
*/
/*!
-\group licensing
-\title Licensing Information
-\ingroup topics
-\brief Information about licenses and licensing issues.
-
-These documents include information about Qt's licenses and the licenses
-of third party components used in Qt.
-
-\generatelist{related}
-*/
-
-/*!
\group platform-notes
\title Platform-Specific Notes
\ingroup topics
diff --git a/doc/src/trademarks.qdoc b/doc/src/trademarks.qdoc
deleted file mode 100644
index 0e659d2..0000000
--- a/doc/src/trademarks.qdoc
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page trademarks.html
-
- \title Trademarks
- \ingroup licensing
- \brief Information about trademarks owned by Nokia and other organisations.
-
- Nokia, the Nokia logo, Qt, and the Qt logo are trademarks of Nokia
- Corporation and/or its subsidiaries in Finland and other countries.
-
- \list
- \o Intel, Intel Inside (logos), MMX and Pentium are \reg trademarks of
- Intel Corporation in the United States, other countries, or both.
- \o Java and all Java-based trademarks are trademarks of Sun Microsystems,
- Inc. in the United States, other countries, or both.
- \o Linux is a \reg trademark of Linus Torvalds in the United States, other
- countries or both.
- \o Mac, Mac OS and Macintosh are \reg trademarks of Apple Computer, Inc.,
- registered in the U.S. and other countries.
- \o Microsoft, Windows, Windows NT, XP, Visual Studio and the Windows logo
- are \reg trademarks of Microsoft Corporation in the United States, other
- countries, or both.
- \o Motif is a registered trademark of The Open Group in the United States,
- other countries, or both.
- \o OpenGL is a \reg trademark of Silicon Graphics, Inc. in the United States
- and other countries.
- \o UNIX is a registered trademark of The Open Group in the United States
- and other countries.
- \o All other company, product, or service names may be trademarks or
- service marks of others and are the property of their respective owners.
- The use of the word partner does not imply a partnership relationship
- between Nokia and any other company.
- \endlist
-*/
--
cgit v0.12
From ed436d4e6e1bffa4a9dd6032ef9f745a735fc8fd Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer
Date: Wed, 29 Jul 2009 22:57:57 +0200
Subject: Doc: Another classlist.
---
doc/src/classes.qdoc | 14 ++++++++++++
doc/src/compatclasses.qdoc | 54 ----------------------------------------------
2 files changed, 14 insertions(+), 54 deletions(-)
delete mode 100644 doc/src/compatclasses.qdoc
diff --git a/doc/src/classes.qdoc b/doc/src/classes.qdoc
index 4845f84..e955a5a 100644
--- a/doc/src/classes.qdoc
+++ b/doc/src/classes.qdoc
@@ -137,3 +137,17 @@
\generatelist mainclasses
*/
+
+/*!
+ \page compatclasses.html
+ \title Qt 3 Compatibility Classes
+ \ingroup classlists
+
+ This is a list of the classes that Qt provides for compatibility
+ with Qt 3. The vast majority of these are provided by the
+ Qt3Support module.
+
+ \generatelist compatclasses
+
+ \sa {Qt's Classes}, {Qt's Modules}
+*/
diff --git a/doc/src/compatclasses.qdoc b/doc/src/compatclasses.qdoc
deleted file mode 100644
index cb6d7dd..0000000
--- a/doc/src/compatclasses.qdoc
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page compatclasses.html
- \title Qt 3 Compatibility Classes
- \ingroup classlists
-
- This is a list of the classes that Qt provides for compatibility
- with Qt 3. The vast majority of these are provided by the
- Qt3Support module.
-
- \generatelist compatclasses
-
- \sa {Qt's Classes}, {Qt's Modules}
-*/
--
cgit v0.12
From b2c0b95d38b75035c60a20fdc6bfa5f47371f801 Mon Sep 17 00:00:00 2001
From: Rhys Weatherley
Date: Thu, 30 Jul 2009 09:42:25 +1000
Subject: Add math3d unit tests for QObject properties and metatypes
Reviewed-by: trustme
---
tests/auto/math3d/qmatrixnxn/tst_qmatrixnxn.cpp | 47 +++++++++++
tests/auto/math3d/qquaternion/tst_qquaternion.cpp | 52 ++++++++++++
tests/auto/math3d/qvectornd/tst_qvectornd.cpp | 96 +++++++++++++++++++++++
3 files changed, 195 insertions(+)
diff --git a/tests/auto/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index d799c1b..fe1d0db 100644
--- a/tests/auto/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -170,6 +170,9 @@ private slots:
void mapRect_data();
void mapRect();
+ void properties();
+ void metaTypes();
+
private:
static void setMatrix(QMatrix2x2& m, const qreal *values);
static void setMatrixDirect(QMatrix2x2& m, const qreal *values);
@@ -3331,6 +3334,50 @@ void tst_QMatrix::mapRect()
QVERIFY(mri == tri);
}
+class tst_QMatrix4x4Properties : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix)
+public:
+ tst_QMatrix4x4Properties(QObject *parent = 0) : QObject(parent) {}
+
+ QMatrix4x4 matrix() const { return m; }
+ void setMatrix(const QMatrix4x4& value) { m = value; }
+
+private:
+ QMatrix4x4 m;
+};
+
+// Test getting and setting matrix properties via the metaobject system.
+void tst_QMatrix::properties()
+{
+ tst_QMatrix4x4Properties obj;
+
+ QMatrix4x4 m1(uniqueValues4);
+ obj.setMatrix(m1);
+
+ QMatrix4x4 m2 = qVariantValue(obj.property("matrix"));
+ QVERIFY(isSame(m2, uniqueValues4));
+
+ QMatrix4x4 m3(transposedValues4);
+ obj.setProperty("matrix", qVariantFromValue(m3));
+
+ m2 = qVariantValue(obj.property("matrix"));
+ QVERIFY(isSame(m2, transposedValues4));
+}
+
+void tst_QMatrix::metaTypes()
+{
+ QVERIFY(QMetaType::type("QMatrix4x4") == QMetaType::QMatrix4x4);
+
+ QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QMatrix4x4)),
+ QByteArray("QMatrix4x4"));
+
+ QVERIFY(QMetaType::isRegistered(QMetaType::QMatrix4x4));
+
+ QVERIFY(qMetaTypeId() == QMetaType::QMatrix4x4);
+}
+
QTEST_APPLESS_MAIN(tst_QMatrix)
#include "tst_qmatrixnxn.moc"
diff --git a/tests/auto/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/math3d/qquaternion/tst_qquaternion.cpp
index 16b87a1..369f5ac 100644
--- a/tests/auto/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/math3d/qquaternion/tst_qquaternion.cpp
@@ -93,6 +93,9 @@ private slots:
void nlerp_data();
void nlerp();
+
+ void properties();
+ void metaTypes();
};
// qFuzzyCompare isn't always "fuzzy" enough to handle conversion
@@ -825,6 +828,55 @@ void tst_QQuaternion::nlerp()
QVERIFY(fuzzyCompare(result.scalar(), q3.scalar()));
}
+class tst_QQuaternionProperties : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQuaternion quaternion READ quaternion WRITE setQuaternion)
+public:
+ tst_QQuaternionProperties(QObject *parent = 0) : QObject(parent) {}
+
+ QQuaternion quaternion() const { return q; }
+ void setQuaternion(const QQuaternion& value) { q = value; }
+
+private:
+ QQuaternion q;
+};
+
+// Test getting and setting quaternion properties via the metaobject system.
+void tst_QQuaternion::properties()
+{
+ tst_QQuaternionProperties obj;
+
+ obj.setQuaternion(QQuaternion(6.0f, 7.0f, 8.0f, 9.0f));
+
+ QQuaternion q = qVariantValue(obj.property("quaternion"));
+ QCOMPARE(q.scalar(), (qreal)6.0f);
+ QCOMPARE(q.x(), (qreal)7.0f);
+ QCOMPARE(q.y(), (qreal)8.0f);
+ QCOMPARE(q.z(), (qreal)9.0f);
+
+ obj.setProperty("quaternion",
+ qVariantFromValue(QQuaternion(-6.0f, -7.0f, -8.0f, -9.0f)));
+
+ q = qVariantValue(obj.property("quaternion"));
+ QCOMPARE(q.scalar(), (qreal)-6.0f);
+ QCOMPARE(q.x(), (qreal)-7.0f);
+ QCOMPARE(q.y(), (qreal)-8.0f);
+ QCOMPARE(q.z(), (qreal)-9.0f);
+}
+
+void tst_QQuaternion::metaTypes()
+{
+ QVERIFY(QMetaType::type("QQuaternion") == QMetaType::QQuaternion);
+
+ QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QQuaternion)),
+ QByteArray("QQuaternion"));
+
+ QVERIFY(QMetaType::isRegistered(QMetaType::QQuaternion));
+
+ QVERIFY(qMetaTypeId() == QMetaType::QQuaternion);
+}
+
QTEST_APPLESS_MAIN(tst_QQuaternion)
#include "tst_qquaternion.moc"
diff --git a/tests/auto/math3d/qvectornd/tst_qvectornd.cpp b/tests/auto/math3d/qvectornd/tst_qvectornd.cpp
index 9c1ea83..6368874 100644
--- a/tests/auto/math3d/qvectornd/tst_qvectornd.cpp
+++ b/tests/auto/math3d/qvectornd/tst_qvectornd.cpp
@@ -137,6 +137,9 @@ private slots:
void dotProduct3();
void dotProduct4_data();
void dotProduct4();
+
+ void properties();
+ void metaTypes();
};
// qFuzzyCompare isn't always "fuzzy" enough to handle conversion
@@ -2040,6 +2043,99 @@ void tst_QVector::dotProduct4()
QCOMPARE(QVector4D::dotProduct(v1, v2), d);
}
+class tst_QVectorProperties : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QVector2D vector2D READ vector2D WRITE setVector2D)
+ Q_PROPERTY(QVector3D vector3D READ vector3D WRITE setVector3D)
+ Q_PROPERTY(QVector4D vector4D READ vector4D WRITE setVector4D)
+public:
+ tst_QVectorProperties(QObject *parent = 0) : QObject(parent) {}
+
+ QVector2D vector2D() const { return v2; }
+ void setVector2D(const QVector2D& value) { v2 = value; }
+
+ QVector3D vector3D() const { return v3; }
+ void setVector3D(const QVector3D& value) { v3 = value; }
+
+ QVector4D vector4D() const { return v4; }
+ void setVector4D(const QVector4D& value) { v4 = value; }
+
+private:
+ QVector2D v2;
+ QVector3D v3;
+ QVector4D v4;
+};
+
+// Test getting and setting vector properties via the metaobject system.
+void tst_QVector::properties()
+{
+ tst_QVectorProperties obj;
+
+ obj.setVector2D(QVector2D(1.0f, 2.0f));
+ obj.setVector3D(QVector3D(3.0f, 4.0f, 5.0f));
+ obj.setVector4D(QVector4D(6.0f, 7.0f, 8.0f, 9.0f));
+
+ QVector2D v2 = qVariantValue(obj.property("vector2D"));
+ QCOMPARE(v2.x(), (qreal)1.0f);
+ QCOMPARE(v2.y(), (qreal)2.0f);
+
+ QVector3D v3 = qVariantValue(obj.property("vector3D"));
+ QCOMPARE(v3.x(), (qreal)3.0f);
+ QCOMPARE(v3.y(), (qreal)4.0f);
+ QCOMPARE(v3.z(), (qreal)5.0f);
+
+ QVector4D v4 = qVariantValue(obj.property("vector4D"));
+ QCOMPARE(v4.x(), (qreal)6.0f);
+ QCOMPARE(v4.y(), (qreal)7.0f);
+ QCOMPARE(v4.z(), (qreal)8.0f);
+ QCOMPARE(v4.w(), (qreal)9.0f);
+
+ obj.setProperty("vector2D",
+ qVariantFromValue(QVector2D(-1.0f, -2.0f)));
+ obj.setProperty("vector3D",
+ qVariantFromValue(QVector3D(-3.0f, -4.0f, -5.0f)));
+ obj.setProperty("vector4D",
+ qVariantFromValue(QVector4D(-6.0f, -7.0f, -8.0f, -9.0f)));
+
+ v2 = qVariantValue(obj.property("vector2D"));
+ QCOMPARE(v2.x(), (qreal)-1.0f);
+ QCOMPARE(v2.y(), (qreal)-2.0f);
+
+ v3 = qVariantValue(obj.property("vector3D"));
+ QCOMPARE(v3.x(), (qreal)-3.0f);
+ QCOMPARE(v3.y(), (qreal)-4.0f);
+ QCOMPARE(v3.z(), (qreal)-5.0f);
+
+ v4 = qVariantValue(obj.property("vector4D"));
+ QCOMPARE(v4.x(), (qreal)-6.0f);
+ QCOMPARE(v4.y(), (qreal)-7.0f);
+ QCOMPARE(v4.z(), (qreal)-8.0f);
+ QCOMPARE(v4.w(), (qreal)-9.0f);
+}
+
+void tst_QVector::metaTypes()
+{
+ QVERIFY(QMetaType::type("QVector2D") == QMetaType::QVector2D);
+ QVERIFY(QMetaType::type("QVector3D") == QMetaType::QVector3D);
+ QVERIFY(QMetaType::type("QVector4D") == QMetaType::QVector4D);
+
+ QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QVector2D)),
+ QByteArray("QVector2D"));
+ QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QVector3D)),
+ QByteArray("QVector3D"));
+ QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QVector4D)),
+ QByteArray("QVector4D"));
+
+ QVERIFY(QMetaType::isRegistered(QMetaType::QVector2D));
+ QVERIFY(QMetaType::isRegistered(QMetaType::QVector3D));
+ QVERIFY(QMetaType::isRegistered(QMetaType::QVector4D));
+
+ QVERIFY(qMetaTypeId() == QMetaType::QVector2D);
+ QVERIFY(qMetaTypeId() == QMetaType::QVector3D);
+ QVERIFY(qMetaTypeId() == QMetaType::QVector4D);
+}
+
QTEST_APPLESS_MAIN(tst_QVector)
#include "tst_qvectornd.moc"
--
cgit v0.12
From a78355d08ca8e0ec6b5aee06438e5baa331ce285 Mon Sep 17 00:00:00 2001
From: Rhys Weatherley
Date: Thu, 30 Jul 2009 10:32:38 +1000
Subject: qdoc fix: stencil buffer is enabled by default, not disabled
Stencil buffer has been enabled by default for quite some time
(2 years) but the documentation was still saying disabled.
Reviewed-by: bnilsen
---
src/opengl/qgl.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index edda6b6..f6bfcbe 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -526,7 +526,7 @@ void QGLFormat::setAccum(bool enable)
\fn bool QGLFormat::stencil() const
Returns true if the stencil buffer is enabled; otherwise returns
- false. The stencil buffer is disabled by default.
+ false. The stencil buffer is enabled by default.
\sa setStencil(), setStencilBufferSize()
*/
@@ -535,7 +535,7 @@ void QGLFormat::setAccum(bool enable)
If \a enable is true enables the stencil buffer; otherwise
disables the stencil buffer.
- The stencil buffer is disabled by default.
+ The stencil buffer is enabled by default.
The stencil buffer masks certain parts of the drawing area so that
masked parts are not drawn on.
--
cgit v0.12
From 15ccaa0995da2061009d269fa875e8601da1a3c8 Mon Sep 17 00:00:00 2001
From: Bill King
Date: Thu, 30 Jul 2009 11:18:59 +1000
Subject: Fixes hack around show queries not allowed to be prepared.
Mysql queries other than select can't be prepared, otherwise they fail
to return the necessary meta-information to enable them to be seen as
returning data under certain versions of mysql. This fixes the hack
to work correctly until we stop preparing queries automagically.
---
src/sql/drivers/mysql/qsql_mysql.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index 8f377bd..3295a41 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -1336,8 +1336,8 @@ QSqlIndex QMYSQLDriver::primaryIndex(const QString& tablename) const
if (!isOpen())
return idx;
- prepQ = d->preparedQuerys;
- d->preparedQuerys = false;
+ prepQ = d->preparedQuerysEnabled;
+ d->preparedQuerysEnabled = false;
QSqlQuery i(createResult());
QString stmt(QLatin1String("show index from %1;"));
@@ -1351,7 +1351,7 @@ QSqlIndex QMYSQLDriver::primaryIndex(const QString& tablename) const
}
}
- d->preparedQuerys = prepQ;
+ d->preparedQuerysEnabled = prepQ;
return idx;
}
--
cgit v0.12
From ab5619c395be3fdae70042ca6f6bc93a9a6f2c80 Mon Sep 17 00:00:00 2001
From: Rhys Weatherley
Date: Thu, 30 Jul 2009 12:49:15 +1000
Subject: Increase coverage of QGLFormat unit tests.
Reviewed-by: trustme
---
tests/auto/qgl/tst_qgl.cpp | 209 ++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 190 insertions(+), 19 deletions(-)
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 96f5ddd..6ac1739 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -94,6 +94,11 @@ public:
void setAutoBufferSwap(bool on) { QGLWidget::setAutoBufferSwap(on); }
};
+// Using INT_MIN and INT_MAX will cause failures on systems
+// where "int" is 64-bit, so use the explicit values instead.
+#define TEST_INT_MIN (-2147483647 - 1)
+#define TEST_INT_MAX 2147483647
+
// Testing get/set functions
void tst_QGL::getSetCheck()
{
@@ -103,120 +108,286 @@ void tst_QGL::getSetCheck()
QGLFormat obj1;
// int QGLFormat::depthBufferSize()
// void QGLFormat::setDepthBufferSize(int)
+ QCOMPARE(-1, obj1.depthBufferSize());
obj1.setDepthBufferSize(0);
QCOMPARE(0, obj1.depthBufferSize());
- obj1.setDepthBufferSize(INT_MIN);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setDepthBufferSize: Cannot set negative depth buffer size -2147483648");
+ obj1.setDepthBufferSize(TEST_INT_MIN);
QCOMPARE(0, obj1.depthBufferSize()); // Makes no sense with a negative buffer size
- obj1.setDepthBufferSize(INT_MAX);
- QCOMPARE(INT_MAX, obj1.depthBufferSize());
+ obj1.setDepthBufferSize(3);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setDepthBufferSize: Cannot set negative depth buffer size -1");
+ obj1.setDepthBufferSize(-1);
+ QCOMPARE(3, obj1.depthBufferSize());
+ obj1.setDepthBufferSize(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.depthBufferSize());
// int QGLFormat::accumBufferSize()
// void QGLFormat::setAccumBufferSize(int)
+ QCOMPARE(-1, obj1.accumBufferSize());
obj1.setAccumBufferSize(0);
QCOMPARE(0, obj1.accumBufferSize());
- obj1.setAccumBufferSize(INT_MIN);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setAccumBufferSize: Cannot set negative accumulate buffer size -2147483648");
+ obj1.setAccumBufferSize(TEST_INT_MIN);
QCOMPARE(0, obj1.accumBufferSize()); // Makes no sense with a negative buffer size
- obj1.setAccumBufferSize(INT_MAX);
- QCOMPARE(INT_MAX, obj1.accumBufferSize());
+ obj1.setAccumBufferSize(3);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setAccumBufferSize: Cannot set negative accumulate buffer size -1");
+ obj1.setAccumBufferSize(-1);
+ QCOMPARE(3, obj1.accumBufferSize());
+ obj1.setAccumBufferSize(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.accumBufferSize());
+
+ // int QGLFormat::redBufferSize()
+ // void QGLFormat::setRedBufferSize(int)
+ QCOMPARE(-1, obj1.redBufferSize());
+ obj1.setRedBufferSize(0);
+ QCOMPARE(0, obj1.redBufferSize());
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setRedBufferSize: Cannot set negative red buffer size -2147483648");
+ obj1.setRedBufferSize(TEST_INT_MIN);
+ QCOMPARE(0, obj1.redBufferSize()); // Makes no sense with a negative buffer size
+ obj1.setRedBufferSize(3);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setRedBufferSize: Cannot set negative red buffer size -1");
+ obj1.setRedBufferSize(-1);
+ QCOMPARE(3, obj1.redBufferSize());
+ obj1.setRedBufferSize(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.redBufferSize());
+
+ // int QGLFormat::greenBufferSize()
+ // void QGLFormat::setGreenBufferSize(int)
+ QCOMPARE(-1, obj1.greenBufferSize());
+ obj1.setGreenBufferSize(0);
+ QCOMPARE(0, obj1.greenBufferSize());
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setGreenBufferSize: Cannot set negative green buffer size -2147483648");
+ obj1.setGreenBufferSize(TEST_INT_MIN);
+ QCOMPARE(0, obj1.greenBufferSize()); // Makes no sense with a negative buffer size
+ obj1.setGreenBufferSize(3);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setGreenBufferSize: Cannot set negative green buffer size -1");
+ obj1.setGreenBufferSize(-1);
+ QCOMPARE(3, obj1.greenBufferSize());
+ obj1.setGreenBufferSize(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.greenBufferSize());
+
+ // int QGLFormat::blueBufferSize()
+ // void QGLFormat::setBlueBufferSize(int)
+ QCOMPARE(-1, obj1.blueBufferSize());
+ obj1.setBlueBufferSize(0);
+ QCOMPARE(0, obj1.blueBufferSize());
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setBlueBufferSize: Cannot set negative blue buffer size -2147483648");
+ obj1.setBlueBufferSize(TEST_INT_MIN);
+ QCOMPARE(0, obj1.blueBufferSize()); // Makes no sense with a negative buffer size
+ obj1.setBlueBufferSize(3);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setBlueBufferSize: Cannot set negative blue buffer size -1");
+ obj1.setBlueBufferSize(-1);
+ QCOMPARE(3, obj1.blueBufferSize());
+ obj1.setBlueBufferSize(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.blueBufferSize());
// int QGLFormat::alphaBufferSize()
// void QGLFormat::setAlphaBufferSize(int)
+ QCOMPARE(-1, obj1.alphaBufferSize());
+ QCOMPARE(false, obj1.alpha());
+ QVERIFY(!obj1.testOption(QGL::AlphaChannel));
+ QVERIFY(obj1.testOption(QGL::NoAlphaChannel));
obj1.setAlphaBufferSize(0);
+ QCOMPARE(true, obj1.alpha()); // setAlphaBufferSize() enables alpha.
QCOMPARE(0, obj1.alphaBufferSize());
- obj1.setAlphaBufferSize(INT_MIN);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setAlphaBufferSize: Cannot set negative alpha buffer size -2147483648");
+ obj1.setAlphaBufferSize(TEST_INT_MIN);
QCOMPARE(0, obj1.alphaBufferSize()); // Makes no sense with a negative buffer size
- obj1.setAlphaBufferSize(INT_MAX);
- QCOMPARE(INT_MAX, obj1.alphaBufferSize());
+ obj1.setAlphaBufferSize(3);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setAlphaBufferSize: Cannot set negative alpha buffer size -1");
+ obj1.setAlphaBufferSize(-1);
+ QCOMPARE(3, obj1.alphaBufferSize());
+ obj1.setAlphaBufferSize(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.alphaBufferSize());
// int QGLFormat::stencilBufferSize()
// void QGLFormat::setStencilBufferSize(int)
+ QCOMPARE(-1, obj1.stencilBufferSize());
obj1.setStencilBufferSize(0);
QCOMPARE(0, obj1.stencilBufferSize());
- obj1.setStencilBufferSize(INT_MIN);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setStencilBufferSize: Cannot set negative stencil buffer size -2147483648");
+ obj1.setStencilBufferSize(TEST_INT_MIN);
QCOMPARE(0, obj1.stencilBufferSize()); // Makes no sense with a negative buffer size
- obj1.setStencilBufferSize(INT_MAX);
- QCOMPARE(INT_MAX, obj1.stencilBufferSize());
+ obj1.setStencilBufferSize(3);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setStencilBufferSize: Cannot set negative stencil buffer size -1");
+ obj1.setStencilBufferSize(-1);
+ QCOMPARE(3, obj1.stencilBufferSize());
+ obj1.setStencilBufferSize(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.stencilBufferSize());
// bool QGLFormat::sampleBuffers()
// void QGLFormat::setSampleBuffers(bool)
+ QCOMPARE(false, obj1.sampleBuffers());
+ QVERIFY(!obj1.testOption(QGL::SampleBuffers));
+ QVERIFY(obj1.testOption(QGL::NoSampleBuffers));
obj1.setSampleBuffers(false);
QCOMPARE(false, obj1.sampleBuffers());
+ QVERIFY(obj1.testOption(QGL::NoSampleBuffers));
obj1.setSampleBuffers(true);
QCOMPARE(true, obj1.sampleBuffers());
+ QVERIFY(obj1.testOption(QGL::SampleBuffers));
// int QGLFormat::samples()
// void QGLFormat::setSamples(int)
+ QCOMPARE(-1, obj1.samples());
obj1.setSamples(0);
QCOMPARE(0, obj1.samples());
- obj1.setSamples(INT_MIN);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setSamples: Cannot have negative number of samples per pixel -2147483648");
+ obj1.setSamples(TEST_INT_MIN);
QCOMPARE(0, obj1.samples()); // Makes no sense with a negative sample size
- obj1.setSamples(INT_MAX);
- QCOMPARE(INT_MAX, obj1.samples());
+ obj1.setSamples(3);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setSamples: Cannot have negative number of samples per pixel -1");
+ obj1.setSamples(-1);
+ QCOMPARE(3, obj1.samples());
+ obj1.setSamples(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.samples());
+
+ // int QGLFormat::swapInterval()
+ // void QGLFormat::setSwapInterval(int)
+ QCOMPARE(-1, obj1.swapInterval());
+ obj1.setSwapInterval(0);
+ QCOMPARE(0, obj1.swapInterval());
+ obj1.setSwapInterval(TEST_INT_MIN);
+ QCOMPARE(TEST_INT_MIN, obj1.swapInterval());
+ obj1.setSwapInterval(-1);
+ QCOMPARE(-1, obj1.swapInterval());
+ obj1.setSwapInterval(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.swapInterval());
// bool QGLFormat::doubleBuffer()
// void QGLFormat::setDoubleBuffer(bool)
+ QCOMPARE(true, obj1.doubleBuffer());
+ QVERIFY(obj1.testOption(QGL::DoubleBuffer));
+ QVERIFY(!obj1.testOption(QGL::SingleBuffer));
obj1.setDoubleBuffer(false);
QCOMPARE(false, obj1.doubleBuffer());
+ QVERIFY(!obj1.testOption(QGL::DoubleBuffer));
+ QVERIFY(obj1.testOption(QGL::SingleBuffer));
obj1.setDoubleBuffer(true);
QCOMPARE(true, obj1.doubleBuffer());
+ QVERIFY(obj1.testOption(QGL::DoubleBuffer));
+ QVERIFY(!obj1.testOption(QGL::SingleBuffer));
// bool QGLFormat::depth()
// void QGLFormat::setDepth(bool)
+ QCOMPARE(true, obj1.depth());
+ QVERIFY(obj1.testOption(QGL::DepthBuffer));
+ QVERIFY(!obj1.testOption(QGL::NoDepthBuffer));
obj1.setDepth(false);
QCOMPARE(false, obj1.depth());
+ QVERIFY(!obj1.testOption(QGL::DepthBuffer));
+ QVERIFY(obj1.testOption(QGL::NoDepthBuffer));
obj1.setDepth(true);
QCOMPARE(true, obj1.depth());
+ QVERIFY(obj1.testOption(QGL::DepthBuffer));
+ QVERIFY(!obj1.testOption(QGL::NoDepthBuffer));
// bool QGLFormat::rgba()
// void QGLFormat::setRgba(bool)
+ QCOMPARE(true, obj1.rgba());
+ QVERIFY(obj1.testOption(QGL::Rgba));
+ QVERIFY(!obj1.testOption(QGL::ColorIndex));
obj1.setRgba(false);
QCOMPARE(false, obj1.rgba());
+ QVERIFY(!obj1.testOption(QGL::Rgba));
+ QVERIFY(obj1.testOption(QGL::ColorIndex));
obj1.setRgba(true);
QCOMPARE(true, obj1.rgba());
+ QVERIFY(obj1.testOption(QGL::Rgba));
+ QVERIFY(!obj1.testOption(QGL::ColorIndex));
// bool QGLFormat::alpha()
// void QGLFormat::setAlpha(bool)
+ QVERIFY(obj1.testOption(QGL::AlphaChannel));
+ QVERIFY(!obj1.testOption(QGL::NoAlphaChannel));
obj1.setAlpha(false);
QCOMPARE(false, obj1.alpha());
+ QVERIFY(!obj1.testOption(QGL::AlphaChannel));
+ QVERIFY(obj1.testOption(QGL::NoAlphaChannel));
obj1.setAlpha(true);
QCOMPARE(true, obj1.alpha());
+ QVERIFY(obj1.testOption(QGL::AlphaChannel));
+ QVERIFY(!obj1.testOption(QGL::NoAlphaChannel));
// bool QGLFormat::accum()
// void QGLFormat::setAccum(bool)
+ QCOMPARE(false, obj1.accum());
+ QVERIFY(!obj1.testOption(QGL::AccumBuffer));
+ QVERIFY(obj1.testOption(QGL::NoAccumBuffer));
obj1.setAccum(false);
QCOMPARE(false, obj1.accum());
+ QVERIFY(!obj1.testOption(QGL::AccumBuffer));
+ QVERIFY(obj1.testOption(QGL::NoAccumBuffer));
obj1.setAccum(true);
QCOMPARE(true, obj1.accum());
+ QVERIFY(obj1.testOption(QGL::AccumBuffer));
+ QVERIFY(!obj1.testOption(QGL::NoAccumBuffer));
// bool QGLFormat::stencil()
// void QGLFormat::setStencil(bool)
+ QCOMPARE(true, obj1.stencil());
+ QVERIFY(obj1.testOption(QGL::StencilBuffer));
+ QVERIFY(!obj1.testOption(QGL::NoStencilBuffer));
obj1.setStencil(false);
QCOMPARE(false, obj1.stencil());
+ QVERIFY(!obj1.testOption(QGL::StencilBuffer));
+ QVERIFY(obj1.testOption(QGL::NoStencilBuffer));
obj1.setStencil(true);
QCOMPARE(true, obj1.stencil());
+ QVERIFY(obj1.testOption(QGL::StencilBuffer));
+ QVERIFY(!obj1.testOption(QGL::NoStencilBuffer));
// bool QGLFormat::stereo()
// void QGLFormat::setStereo(bool)
+ QCOMPARE(false, obj1.stereo());
+ QVERIFY(!obj1.testOption(QGL::StereoBuffers));
+ QVERIFY(obj1.testOption(QGL::NoStereoBuffers));
obj1.setStereo(false);
QCOMPARE(false, obj1.stereo());
+ QVERIFY(!obj1.testOption(QGL::StereoBuffers));
+ QVERIFY(obj1.testOption(QGL::NoStereoBuffers));
obj1.setStereo(true);
QCOMPARE(true, obj1.stereo());
+ QVERIFY(obj1.testOption(QGL::StereoBuffers));
+ QVERIFY(!obj1.testOption(QGL::NoStereoBuffers));
// bool QGLFormat::directRendering()
// void QGLFormat::setDirectRendering(bool)
+ QCOMPARE(true, obj1.directRendering());
+ QVERIFY(obj1.testOption(QGL::DirectRendering));
+ QVERIFY(!obj1.testOption(QGL::IndirectRendering));
obj1.setDirectRendering(false);
QCOMPARE(false, obj1.directRendering());
+ QVERIFY(!obj1.testOption(QGL::DirectRendering));
+ QVERIFY(obj1.testOption(QGL::IndirectRendering));
obj1.setDirectRendering(true);
QCOMPARE(true, obj1.directRendering());
+ QVERIFY(obj1.testOption(QGL::DirectRendering));
+ QVERIFY(!obj1.testOption(QGL::IndirectRendering));
+
+ // bool QGLFormat::overlay()
+ // void QGLFormat::setOverlay(bool)
+ QCOMPARE(false, obj1.hasOverlay());
+ QVERIFY(!obj1.testOption(QGL::HasOverlay));
+ QVERIFY(obj1.testOption(QGL::NoOverlay));
+ obj1.setOverlay(false);
+ QCOMPARE(false, obj1.hasOverlay());
+ QVERIFY(!obj1.testOption(QGL::HasOverlay));
+ QVERIFY(obj1.testOption(QGL::NoOverlay));
+ obj1.setOverlay(true);
+ QCOMPARE(true, obj1.hasOverlay());
+ QVERIFY(obj1.testOption(QGL::HasOverlay));
+ QVERIFY(!obj1.testOption(QGL::NoOverlay));
// int QGLFormat::plane()
// void QGLFormat::setPlane(int)
+ QCOMPARE(0, obj1.plane());
obj1.setPlane(0);
QCOMPARE(0, obj1.plane());
- obj1.setPlane(INT_MIN);
- QCOMPARE(INT_MIN, obj1.plane());
- obj1.setPlane(INT_MAX);
- QCOMPARE(INT_MAX, obj1.plane());
+ obj1.setPlane(TEST_INT_MIN);
+ QCOMPARE(TEST_INT_MIN, obj1.plane());
+ obj1.setPlane(TEST_INT_MAX);
+ QCOMPARE(TEST_INT_MAX, obj1.plane());
MyGLContext obj2(obj1);
// bool QGLContext::windowCreated()
--
cgit v0.12
From 5246aeb198ccfd2a3fc94298161c24cb8f57f81f Mon Sep 17 00:00:00 2001
From: Rhys Weatherley
Date: Thu, 30 Jul 2009 14:50:39 +1000
Subject: Unit tests and bug fixes for QGLColormap
QGLColormap::setEntry() was inserting entries instead of
replacing them; QGLColormap::setEntries() had an incorrect
assert and weird behaviour for the "base".
The documentation for QGLColormap::isEmpty() has been updated
to reflect that it will also report empty if the colormap has
not been set on a QGLWidget even if it has entries in it.
This behaviour is required by existing code.
Reviewed-by: Rohan McGovern
---
src/opengl/qglcolormap.cpp | 24 ++++++---
tests/auto/qgl/tst_qgl.cpp | 121 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 138 insertions(+), 7 deletions(-)
diff --git a/src/opengl/qglcolormap.cpp b/src/opengl/qglcolormap.cpp
index 426e090..481089a 100644
--- a/src/opengl/qglcolormap.cpp
+++ b/src/opengl/qglcolormap.cpp
@@ -174,13 +174,14 @@ void QGLColormap::setEntry(int idx, QRgb color)
detach();
if (!d->cells)
d->cells = new QVector(256);
- d->cells->insert(idx, color);
+ d->cells->replace(idx, color);
}
/*!
Set an array of cells in this colormap. \a count is the number of
colors that should be set, \a colors is the array of colors, and
- \a base is the starting index.
+ \a base is the starting index. The first element in \a colors
+ is set at \a base in the colormap.
*/
void QGLColormap::setEntries(int count, const QRgb *colors, int base)
{
@@ -188,10 +189,10 @@ void QGLColormap::setEntries(int count, const QRgb *colors, int base)
if (!d->cells)
d->cells = new QVector(256);
- Q_ASSERT_X(!colors || base >= 0 || base + count < d->cells->size(), "QGLColormap::setEntries",
+ Q_ASSERT_X(colors && base >= 0 && (base + count) <= d->cells->size(), "QGLColormap::setEntries",
"preconditions not met");
- for (int i = base; i < base + count; ++i)
- setEntry(i, colors[i]);
+ for (int i = 0; i < count; ++i)
+ setEntry(base + i, colors[i]);
}
/*!
@@ -227,8 +228,17 @@ QColor QGLColormap::entryColor(int idx) const
}
/*!
- Returns true if the colormap is empty; otherwise returns false. A
- colormap with no color values set is considered to be empty.
+ Returns true if the colormap is empty or it is not in use
+ by a QGLWidget; otherwise returns false.
+
+ A colormap with no color values set is considered to be empty.
+ For historical reasons, a colormap that has color values set
+ but which is not in use by a QGLWidget is also considered empty.
+
+ Compare size() with zero to determine if the colormap is empty
+ regardless of whether it is in use by a QGLWidget or not.
+
+ \sa size()
*/
bool QGLColormap::isEmpty() const
{
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 6ac1739..31c4a3c 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -45,6 +45,7 @@
#include
#include
#include
+#include
#include
#include
@@ -66,6 +67,7 @@ private slots:
void graphicsViewClipping();
void partialGLWidgetUpdates_data();
void partialGLWidgetUpdates();
+ void colormap();
};
tst_QGL::tst_QGL()
@@ -623,5 +625,124 @@ void tst_QGL::partialGLWidgetUpdates()
QCOMPARE(widget.paintEventRegion, QRegion(widget.rect()));
}
+class ColormapExtended : public QGLColormap
+{
+public:
+ ColormapExtended() {}
+
+ Qt::HANDLE handle() { return QGLColormap::handle(); }
+ void setHandle(Qt::HANDLE handle) { QGLColormap::setHandle(handle); }
+};
+
+void tst_QGL::colormap()
+{
+ // Check the properties of the default empty colormap.
+ QGLColormap cmap1;
+ QVERIFY(cmap1.isEmpty());
+ QCOMPARE(cmap1.size(), 0);
+ QVERIFY(cmap1.entryRgb(0) == 0);
+ QVERIFY(cmap1.entryRgb(-1) == 0);
+ QVERIFY(cmap1.entryRgb(100) == 0);
+ QVERIFY(!cmap1.entryColor(0).isValid());
+ QVERIFY(!cmap1.entryColor(-1).isValid());
+ QVERIFY(!cmap1.entryColor(100).isValid());
+ QCOMPARE(cmap1.find(qRgb(255, 0, 0)), -1);
+ QCOMPARE(cmap1.findNearest(qRgb(255, 0, 0)), -1);
+
+ // Set an entry and re-test.
+ cmap1.setEntry(56, qRgb(255, 0, 0));
+ // The colormap is still considered "empty" even though it
+ // has entries in it now. The isEmpty() method is used to
+ // detect when the colormap is in use by a GL widget,
+ // not to detect when it is empty!
+ QVERIFY(cmap1.isEmpty());
+ QCOMPARE(cmap1.size(), 256);
+ QVERIFY(cmap1.entryRgb(0) == 0);
+ QVERIFY(cmap1.entryColor(0) == QColor(0, 0, 0, 255));
+ QVERIFY(cmap1.entryRgb(56) == qRgb(255, 0, 0));
+ QVERIFY(cmap1.entryColor(56) == QColor(255, 0, 0, 255));
+ QCOMPARE(cmap1.find(qRgb(255, 0, 0)), 56);
+ QCOMPARE(cmap1.findNearest(qRgb(255, 0, 0)), 56);
+
+ // Set some more entries.
+ static QRgb const colors[] = {
+ qRgb(255, 0, 0),
+ qRgb(0, 255, 0),
+ qRgb(255, 255, 255),
+ qRgb(0, 0, 255),
+ qRgb(0, 0, 0)
+ };
+ cmap1.setEntry(57, QColor(0, 255, 0));
+ cmap1.setEntries(3, colors + 2, 58);
+ cmap1.setEntries(5, colors, 251);
+ int idx;
+ for (idx = 0; idx < 5; ++idx) {
+ QVERIFY(cmap1.entryRgb(56 + idx) == colors[idx]);
+ QVERIFY(cmap1.entryColor(56 + idx) == QColor(colors[idx]));
+ QVERIFY(cmap1.entryRgb(251 + idx) == colors[idx]);
+ QVERIFY(cmap1.entryColor(251 + idx) == QColor(colors[idx]));
+ }
+ QCOMPARE(cmap1.size(), 256);
+
+ // Perform color lookups.
+ QCOMPARE(cmap1.find(qRgb(255, 0, 0)), 56);
+ QCOMPARE(cmap1.find(qRgb(0, 0, 0)), 60); // Actually finds 0, 0, 0, 255.
+ QCOMPARE(cmap1.find(qRgba(0, 0, 0, 0)), 0);
+ QCOMPARE(cmap1.find(qRgb(0, 255, 0)), 57);
+ QCOMPARE(cmap1.find(qRgb(255, 255, 255)), 58);
+ QCOMPARE(cmap1.find(qRgb(0, 0, 255)), 59);
+ QCOMPARE(cmap1.find(qRgb(140, 0, 0)), -1);
+ QCOMPARE(cmap1.find(qRgb(0, 140, 0)), -1);
+ QCOMPARE(cmap1.find(qRgb(0, 0, 140)), -1);
+ QCOMPARE(cmap1.find(qRgb(64, 0, 0)), -1);
+ QCOMPARE(cmap1.find(qRgb(0, 64, 0)), -1);
+ QCOMPARE(cmap1.find(qRgb(0, 0, 64)), -1);
+ QCOMPARE(cmap1.findNearest(qRgb(255, 0, 0)), 56);
+ QCOMPARE(cmap1.findNearest(qRgb(0, 0, 0)), 60);
+ QCOMPARE(cmap1.findNearest(qRgba(0, 0, 0, 0)), 0);
+ QCOMPARE(cmap1.findNearest(qRgb(0, 255, 0)), 57);
+ QCOMPARE(cmap1.findNearest(qRgb(255, 255, 255)), 58);
+ QCOMPARE(cmap1.findNearest(qRgb(0, 0, 255)), 59);
+ QCOMPARE(cmap1.findNearest(qRgb(140, 0, 0)), 56);
+ QCOMPARE(cmap1.findNearest(qRgb(0, 140, 0)), 57);
+ QCOMPARE(cmap1.findNearest(qRgb(0, 0, 140)), 59);
+ QCOMPARE(cmap1.findNearest(qRgb(64, 0, 0)), 0);
+ QCOMPARE(cmap1.findNearest(qRgb(0, 64, 0)), 0);
+ QCOMPARE(cmap1.findNearest(qRgb(0, 0, 64)), 0);
+
+ // Make some copies of the colormap and check that they are the same.
+ QGLColormap cmap2(cmap1);
+ QGLColormap cmap3;
+ cmap3 = cmap1;
+ QVERIFY(cmap2.isEmpty());
+ QVERIFY(cmap3.isEmpty());
+ QCOMPARE(cmap2.size(), 256);
+ QCOMPARE(cmap3.size(), 256);
+ for (idx = 0; idx < 256; ++idx) {
+ QCOMPARE(cmap1.entryRgb(idx), cmap2.entryRgb(idx));
+ QCOMPARE(cmap1.entryRgb(idx), cmap3.entryRgb(idx));
+ }
+
+ // Modify an entry in one of the copies and recheck the original.
+ cmap2.setEntry(45, qRgb(255, 0, 0));
+ for (idx = 0; idx < 256; ++idx) {
+ if (idx != 45)
+ QCOMPARE(cmap1.entryRgb(idx), cmap2.entryRgb(idx));
+ else
+ QCOMPARE(cmap2.entryRgb(45), qRgb(255, 0, 0));
+ QCOMPARE(cmap1.entryRgb(idx), cmap3.entryRgb(idx));
+ }
+
+ // Check that setting the handle will cause isEmpty() to work right.
+ ColormapExtended cmap4;
+ cmap4.setEntry(56, qRgb(255, 0, 0));
+ QVERIFY(cmap4.isEmpty());
+ QCOMPARE(cmap4.size(), 256);
+ cmap4.setHandle(Qt::HANDLE(42));
+ QVERIFY(cmap4.handle() == Qt::HANDLE(42));
+ QVERIFY(!cmap4.isEmpty());
+ QCOMPARE(cmap4.size(), 256);
+}
+
QTEST_MAIN(tst_QGL)
#include "tst_qgl.moc"
--
cgit v0.12
From a92117be4323e26efe3f13b5c624e5010a7cd26a Mon Sep 17 00:00:00 2001
From: Rohan McGovern
Date: Wed, 29 Jul 2009 17:26:37 +1000
Subject: Allow testlib loggers to dynamically allocate storage for strings.
This enables very long failure messages (e.g. including an entire
build log in a failure message).
This change modifies only the plain test logger to use this feature.
Task: 253861
Reviewed-by: Michael Goddard
---
src/testlib/qabstracttestlogger_p.h | 36 +++++++++++
src/testlib/qplaintestlogger.cpp | 8 ++-
src/testlib/qtest_global.h | 1 +
src/testlib/qtestcase.cpp | 52 ++++++++++++++--
tests/auto/selftests/expected_longstring.txt | 16 +++++
tests/auto/selftests/longstring/longstring.pro | 10 +++
tests/auto/selftests/longstring/tst_longstring.cpp | 72 ++++++++++++++++++++++
tests/auto/selftests/selftests.pro | 2 +-
tests/auto/selftests/selftests.qrc | 1 +
tests/auto/selftests/tst_selftests.cpp | 1 +
10 files changed, 189 insertions(+), 10 deletions(-)
create mode 100644 tests/auto/selftests/expected_longstring.txt
create mode 100644 tests/auto/selftests/longstring/longstring.pro
create mode 100644 tests/auto/selftests/longstring/tst_longstring.cpp
diff --git a/src/testlib/qabstracttestlogger_p.h b/src/testlib/qabstracttestlogger_p.h
index a0e8a1e..588184e 100644
--- a/src/testlib/qabstracttestlogger_p.h
+++ b/src/testlib/qabstracttestlogger_p.h
@@ -99,6 +99,42 @@ public:
static bool isTtyOutput();
};
+struct QTestCharBuffer
+{
+ inline QTestCharBuffer()
+ : buf(0)
+ {}
+
+ inline ~QTestCharBuffer()
+ {
+ delete[] buf;
+ buf = 0;
+ }
+
+ inline operator void*()
+ {
+ return buf;
+ }
+
+ inline operator char*()
+ {
+ return buf;
+ }
+
+ inline operator char**()
+ {
+ return &buf;
+ }
+
+ inline const char* constData() const
+ {
+ return buf;
+ }
+
+private:
+ char* buf;
+};
+
QT_END_NAMESPACE
#endif
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index 071b55e..7bebaa1 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -168,7 +168,7 @@ namespace QTest {
QTEST_ASSERT(type);
QTEST_ASSERT(msg);
- char buf[1024];
+ QTestCharBuffer buf;
const char *fn = QTestResult::currentTestFunction() ? QTestResult::currentTestFunction()
: "UnknownTestFunc";
@@ -178,7 +178,7 @@ namespace QTest {
: "";
const char *filler = (tag[0] && gtag[0]) ? ":" : "";
if (file) {
- QTest::qt_snprintf(buf, sizeof(buf), "%s: %s::%s(%s%s%s)%s%s\n"
+ QTest::qt_asprintf(buf, "%s: %s::%s(%s%s%s)%s%s\n"
#ifdef Q_OS_WIN
"%s(%d) : failure location\n"
#else
@@ -187,10 +187,12 @@ namespace QTest {
, type, QTestResult::currentTestObjectName(), fn, gtag, filler, tag,
msg[0] ? " " : "", msg, file, line);
} else {
- QTest::qt_snprintf(buf, sizeof(buf), "%s: %s::%s(%s%s%s)%s%s\n",
+ QTest::qt_asprintf(buf, "%s: %s::%s(%s%s%s)%s%s\n",
type, QTestResult::currentTestObjectName(), fn, gtag, filler, tag,
msg[0] ? " " : "", msg);
}
+ // In colored mode, printf above stripped our nonprintable control characters.
+ // Put them back.
memcpy(buf, type, strlen(type));
outputMessage(buf);
}
diff --git a/src/testlib/qtest_global.h b/src/testlib/qtest_global.h
index b5b0fc0..c40f0ad 100644
--- a/src/testlib/qtest_global.h
+++ b/src/testlib/qtest_global.h
@@ -82,6 +82,7 @@ namespace QTest
enum TestFailMode { Abort = 1, Continue = 2 };
int Q_TESTLIB_EXPORT qt_snprintf(char *str, int size, const char *format, ...);
+ int qt_asprintf(char **str, const char *format, ...);
}
QT_END_NAMESPACE
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index cb05400..e44be9c 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -808,6 +808,50 @@ namespace QTest
static int eventDelay = -1;
static int keyVerbose = -1;
+void filter_unprintable(char *str)
+{
+ char *idx = str;
+ while (*idx) {
+ if (((*idx < 0x20 && *idx != '\n' && *idx != '\t') || *idx > 0x7e))
+ *idx = '?';
+ ++idx;
+ }
+}
+
+int qt_asprintf(char **str, const char *format, ...)
+{
+ static const int MAXSIZE = 1024*1024*2;
+
+ int size = 32;
+ delete[] *str;
+ *str = new char[size];
+
+ va_list ap;
+ int res = 0;
+
+ for (;;) {
+ va_start(ap, format);
+ res = qvsnprintf(*str, size, format, ap);
+ va_end(ap);
+ (*str)[size - 1] = '\0';
+ if (res < size) {
+ // We succeeded or fatally failed
+ break;
+ }
+ // buffer wasn't big enough, try again
+ size *= 2;
+ if (size > MAXSIZE) {
+ break;
+ }
+ delete[] *str;
+ *str = new char[size];
+ }
+
+ filter_unprintable(*str);
+
+ return res;
+}
+
/*! \internal
*/
int qt_snprintf(char *str, int size, const char *format, ...)
@@ -820,12 +864,8 @@ int qt_snprintf(char *str, int size, const char *format, ...)
va_end(ap);
str[size - 1] = '\0';
- char *idx = str;
- while (*idx) {
- if (((*idx < 0x20 && *idx != '\n' && *idx != '\t') || *idx > 0x7e))
- *idx = '?';
- ++idx;
- }
+ filter_unprintable(str);
+
return res;
}
diff --git a/tests/auto/selftests/expected_longstring.txt b/tests/auto/selftests/expected_longstring.txt
new file mode 100644
index 0000000..4abdb23
--- /dev/null
+++ b/tests/auto/selftests/expected_longstring.txt
@@ -0,0 +1,16 @@
+********* Start testing of tst_LongString *********
+Config: Using QTest library 4.6.0, Qt 4.6.0
+PASS : tst_LongString::initTestCase()
+FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
+
+Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia.
+
+Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi.
+
+Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis.
+
+Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+ Loc: [/home/rmcgover/depot/qt/master/tests/auto/selftests/longstring/tst_longstring.cpp(67)]
+PASS : tst_LongString::cleanupTestCase()
+Totals: 2 passed, 1 failed, 0 skipped
+********* Finished testing of tst_LongString *********
diff --git a/tests/auto/selftests/longstring/longstring.pro b/tests/auto/selftests/longstring/longstring.pro
new file mode 100644
index 0000000..b917481
--- /dev/null
+++ b/tests/auto/selftests/longstring/longstring.pro
@@ -0,0 +1,10 @@
+load(qttest_p4)
+SOURCES += tst_longstring.cpp
+QT = core
+
+mac:CONFIG -= app_bundle
+CONFIG -= debug_and_release_target
+
+
+TARGET = longstring
+
diff --git a/tests/auto/selftests/longstring/tst_longstring.cpp b/tests/auto/selftests/longstring/tst_longstring.cpp
new file mode 100644
index 0000000..a708fa7
--- /dev/null
+++ b/tests/auto/selftests/longstring/tst_longstring.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include
+#include
+
+char const lipsum[] =
+"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.\n\n"
+"Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia.\n\n"
+"Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi.\n\n"
+"Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis.\n\n"
+"Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas."
+;
+
+/*!
+ \internal
+ */
+class tst_LongString: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void failWithLongString() const;
+};
+
+void tst_LongString::failWithLongString() const
+{
+ QFAIL(lipsum);
+}
+
+QTEST_MAIN(tst_LongString)
+
+#include "tst_longstring.moc"
diff --git a/tests/auto/selftests/selftests.pro b/tests/auto/selftests/selftests.pro
index 45de658..d854b5e 100644
--- a/tests/auto/selftests/selftests.pro
+++ b/tests/auto/selftests/selftests.pro
@@ -5,7 +5,7 @@ SUBDIRS = subtest test warnings maxwarnings cmptest globaldata skipglobal skip \
skipinit skipinitdata datetime singleskip assert waitwithoutgui differentexec \
exceptionthrow qexecstringlist datatable commandlinedata\
benchlibwalltime benchlibcallgrind benchlibeventcounter benchlibtickcounter \
- benchliboptions xunit badxml
+ benchliboptions xunit badxml longstring
INSTALLS =
diff --git a/tests/auto/selftests/selftests.qrc b/tests/auto/selftests/selftests.qrc
index 3d78bf5..4b75405 100644
--- a/tests/auto/selftests/selftests.qrc
+++ b/tests/auto/selftests/selftests.qrc
@@ -36,5 +36,6 @@
expected_benchliboptions.txtexpected_benchlibtickcounter.txtexpected_xunit.txt
+ expected_longstring.txt
diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp
index 8eb7fe1..69b84e2 100644
--- a/tests/auto/selftests/tst_selftests.cpp
+++ b/tests/auto/selftests/tst_selftests.cpp
@@ -191,6 +191,7 @@ void tst_Selftests::runSubTest_data()
#endif
QTest::newRow("xunit") << "xunit" << QStringList("-xunitxml");
+ QTest::newRow("longstring") << "longstring" << QStringList();
}
--
cgit v0.12
From 79ed97b8298e3c7e3c7d266c905024affeba7258 Mon Sep 17 00:00:00 2001
From: Rohan McGovern
Date: Thu, 30 Jul 2009 10:53:28 +1000
Subject: Make QTestBasicStreamer use dynamically allocated strings.
This commit contains the bare minimum needed for the API to use dynamic
allocation; some parts of the code still use static buffers and
therefore have constraints on the size of output messages.
Task: 253861
Reviewed-by: Michael Goddard
---
src/testlib/qtestbasicstreamer.cpp | 24 ++++-----
src/testlib/qtestbasicstreamer.h | 10 ++--
src/testlib/qtestlightxmlstreamer.cpp | 42 ++++++++--------
src/testlib/qtestlightxmlstreamer.h | 6 +--
src/testlib/qtestxmlstreamer.cpp | 28 +++++------
src/testlib/qtestxmlstreamer.h | 6 +--
src/testlib/qtestxunitstreamer.cpp | 34 ++++++-------
src/testlib/qtestxunitstreamer.h | 8 +--
src/testlib/qxmltestlogger.cpp | 91 +++++++++++++++++++++++++++--------
src/testlib/qxmltestlogger_p.h | 6 ++-
10 files changed, 153 insertions(+), 102 deletions(-)
diff --git a/src/testlib/qtestbasicstreamer.cpp b/src/testlib/qtestbasicstreamer.cpp
index 5fe9d4d..aac57ba 100644
--- a/src/testlib/qtestbasicstreamer.cpp
+++ b/src/testlib/qtestbasicstreamer.cpp
@@ -68,39 +68,39 @@ QTestBasicStreamer::QTestBasicStreamer()
QTestBasicStreamer::~QTestBasicStreamer()
{}
-void QTestBasicStreamer::formatStart(const QTestElement *element, char *formatted) const
+void QTestBasicStreamer::formatStart(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestBasicStreamer::formatEnd(const QTestElement *element, char *formatted) const
+void QTestBasicStreamer::formatEnd(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestBasicStreamer::formatBeforeAttributes(const QTestElement *element, char *formatted) const
+void QTestBasicStreamer::formatBeforeAttributes(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestBasicStreamer::formatAfterAttributes(const QTestElement *element, char *formatted) const
+void QTestBasicStreamer::formatAfterAttributes(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestBasicStreamer::formatAttributes(const QTestElement *, const QTestElementAttribute *attribute, char *formatted) const
+void QTestBasicStreamer::formatAttributes(const QTestElement *, const QTestElementAttribute *attribute, char **formatted) const
{
if(!attribute || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
void QTestBasicStreamer::output(QTestElement *element) const
@@ -113,7 +113,7 @@ void QTestBasicStreamer::output(QTestElement *element) const
void QTestBasicStreamer::outputElements(QTestElement *element, bool) const
{
- char buf[1024];
+ QTestCharBuffer buf;
bool hasChildren;
/*
Elements are in reverse order of occurrence, so start from the end and work
@@ -148,7 +148,7 @@ void QTestBasicStreamer::outputElements(QTestElement *element, bool) const
void QTestBasicStreamer::outputElementAttributes(const QTestElement* element, QTestElementAttribute *attribute) const
{
- char buf[1024];
+ QTestCharBuffer buf;
while(attribute){
formatAttributes(element, attribute, buf);
outputString(buf);
diff --git a/src/testlib/qtestbasicstreamer.h b/src/testlib/qtestbasicstreamer.h
index 84d1bce..432dd22 100644
--- a/src/testlib/qtestbasicstreamer.h
+++ b/src/testlib/qtestbasicstreamer.h
@@ -71,11 +71,11 @@ class QTestBasicStreamer
const QTestLogger *logger() const;
protected:
- virtual void formatStart(const QTestElement *element = 0, char *formatted = 0) const;
- virtual void formatEnd(const QTestElement *element = 0, char *formatted = 0) const;
- virtual void formatBeforeAttributes(const QTestElement *element = 0, char *formatted = 0) const;
- virtual void formatAfterAttributes(const QTestElement *element = 0, char *formatted = 0) const;
- virtual void formatAttributes(const QTestElement *element = 0, const QTestElementAttribute *attribute = 0, char *formatted = 0) const;
+ virtual void formatStart(const QTestElement *element, char **formatted) const;
+ virtual void formatEnd(const QTestElement *element, char **formatted) const;
+ virtual void formatBeforeAttributes(const QTestElement *element, char **formatted) const;
+ virtual void formatAfterAttributes(const QTestElement *element, char **formatted) const;
+ virtual void formatAttributes(const QTestElement *element, const QTestElementAttribute *attribute, char **formatted) const;
virtual void outputElements(QTestElement *element, bool isChildElement = false) const;
virtual void outputElementAttributes(const QTestElement *element, QTestElementAttribute *attribute) const;
diff --git a/src/testlib/qtestlightxmlstreamer.cpp b/src/testlib/qtestlightxmlstreamer.cpp
index 170938a..a7e205a 100644
--- a/src/testlib/qtestlightxmlstreamer.cpp
+++ b/src/testlib/qtestlightxmlstreamer.cpp
@@ -59,7 +59,7 @@ QTestLightXmlStreamer::QTestLightXmlStreamer()
QTestLightXmlStreamer::~QTestLightXmlStreamer()
{}
-void QTestLightXmlStreamer::formatStart(const QTestElement *element, char *formatted) const
+void QTestLightXmlStreamer::formatStart(const QTestElement *element, char **formatted) const
{
if(!element || !formatted)
return;
@@ -70,7 +70,7 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char *forma
QXmlTestLogger::xmlQuote(quotedTf, element->attributeValue(QTest::AI_Name),
sizeof(quotedTf));
- QTest::qt_snprintf(formatted, 1024, "\n", quotedTf);
+ QTest::qt_asprintf(formatted, "\n", quotedTf);
break;
}
case QTest::LET_Failure: {
@@ -78,7 +78,7 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char *forma
QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description),
sizeof(cdataDesc));
- QTest::qt_snprintf(formatted, 1024, " \n",
+ QTest::qt_asprintf(formatted, " \n",
cdataDesc);
break;
}
@@ -91,7 +91,7 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char *forma
QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description),
sizeof(cdataDesc));
- QTest::qt_snprintf(formatted, 1024, "\n \n\n",
+ QTest::qt_asprintf(formatted, "\n \n\n",
element->attributeValue(QTest::AI_Type),
element->attributeName(QTest::AI_File),
quotedFile,
@@ -109,7 +109,7 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char *forma
QXmlTestLogger::xmlQuote(quotedTag, element->attributeValue(QTest::AI_Tag),
sizeof(quotedTag));
- QTest::qt_snprintf(formatted, 1024, "\n",
+ QTest::qt_asprintf(formatted, "\n",
element->attributeName(QTest::AI_Metric),
quotedMetric,
element->attributeName(QTest::AI_Tag),
@@ -121,61 +121,61 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char *forma
break;
}
default:
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
}
-void QTestLightXmlStreamer::formatEnd(const QTestElement *element, char *formatted) const
+void QTestLightXmlStreamer::formatEnd(const QTestElement *element, char **formatted) const
{
if(!element || !formatted)
return;
if (element->elementType() == QTest::LET_TestCase) {
if( element->attribute(QTest::AI_Result) && element->childElements())
- QTest::qt_snprintf(formatted, 1024, "\n\n");
+ QTest::qt_asprintf(formatted, "\n\n");
else
- QTest::qt_snprintf(formatted, 1024, "\n");
+ QTest::qt_asprintf(formatted, "\n");
}
else
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestLightXmlStreamer::formatBeforeAttributes(const QTestElement *element, char *formatted) const
+void QTestLightXmlStreamer::formatBeforeAttributes(const QTestElement *element, char **formatted) const
{
if(!element || !formatted)
return;
if (element->elementType() == QTest::LET_TestCase && element->attribute(QTest::AI_Result)){
- char buf[900];
+ QTestCharBuffer buf;
char quotedFile[700];
QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File),
sizeof(quotedFile));
- QTest::qt_snprintf(buf, sizeof(buf), "%s=\"%s\" %s=\"%s\"",
+ QTest::qt_asprintf(buf, "%s=\"%s\" %s=\"%s\"",
element->attributeName(QTest::AI_File),
quotedFile,
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line));
if( !element->childElements() )
- QTest::qt_snprintf(formatted, 1024, "\n",
- element->attributeValue(QTest::AI_Result), buf);
+ QTest::qt_asprintf(formatted, "\n",
+ element->attributeValue(QTest::AI_Result), buf.constData());
else
- QTest::qt_snprintf(formatted, 1024, "\n",
- element->attributeValue(QTest::AI_Result), buf);
+ QTest::qt_asprintf(formatted, "\n",
+ element->attributeValue(QTest::AI_Result), buf.constData());
}else{
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
}
void QTestLightXmlStreamer::output(QTestElement *element) const
{
- char buf[1024];
- QTest::qt_snprintf(buf, sizeof(buf), "\n %s\n %s\n",
+ QTestCharBuffer buf;
+ QTest::qt_asprintf(buf, "\n %s\n %s\n",
qVersion(), QTEST_VERSION_STR );
outputString(buf);
- QTest::qt_snprintf(buf, sizeof(buf), "\n");
+ QTest::qt_asprintf(buf, "\n");
outputString(buf);
QTestBasicStreamer::output(element);
diff --git a/src/testlib/qtestlightxmlstreamer.h b/src/testlib/qtestlightxmlstreamer.h
index 5a16327..6dafdcc 100644
--- a/src/testlib/qtestlightxmlstreamer.h
+++ b/src/testlib/qtestlightxmlstreamer.h
@@ -59,9 +59,9 @@ class QTestLightXmlStreamer: public QTestBasicStreamer
QTestLightXmlStreamer();
~QTestLightXmlStreamer();
- void formatStart(const QTestElement *element = 0, char *formatted = 0) const;
- void formatEnd(const QTestElement *element = 0, char *formatted = 0) const;
- void formatBeforeAttributes(const QTestElement *element = 0, char *formatted = 0) const;
+ void formatStart(const QTestElement *element, char **formatted) const;
+ void formatEnd(const QTestElement *element, char **formatted) const;
+ void formatBeforeAttributes(const QTestElement *element, char **formatted) const;
void output(QTestElement *element) const;
};
diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp
index 5172bcd..b9e0a38 100644
--- a/src/testlib/qtestxmlstreamer.cpp
+++ b/src/testlib/qtestxmlstreamer.cpp
@@ -60,7 +60,7 @@ QTestXmlStreamer::QTestXmlStreamer()
QTestXmlStreamer::~QTestXmlStreamer()
{}
-void QTestXmlStreamer::formatStart(const QTestElement *element, char *formatted) const
+void QTestXmlStreamer::formatStart(const QTestElement *element, char **formatted) const
{
if(!element || !formatted)
return;
@@ -71,7 +71,7 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char *formatted)
QXmlTestLogger::xmlQuote(quotedTf, element->attributeValue(QTest::AI_Name),
sizeof(quotedTf));
- QTest::qt_snprintf(formatted, 1024, "\n", quotedTf);
+ QTest::qt_asprintf(formatted, "\n", quotedTf);
break;
}
case QTest::LET_Failure: {
@@ -94,14 +94,14 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char *formatted)
char cdataTag[100];
QXmlTestLogger::xmlCdata(cdataTag, element->attributeValue(QTest::AI_Tag),
sizeof(cdataTag));
- QTest::qt_snprintf(formatted, 1024, "\n"
+ QTest::qt_asprintf(formatted, "\n"
" \n"
" \n"
"\n", element->attributeValue(QTest::AI_Result),
location, cdataTag, cdataDesc);
}
else {
- QTest::qt_snprintf(formatted, 1024, "\n"
+ QTest::qt_asprintf(formatted, "\n"
" \n"
"\n", element->attributeValue(QTest::AI_Result),
location, cdataDesc);
@@ -117,7 +117,7 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char *formatted)
QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description),
sizeof(cdataDesc));
- QTest::qt_snprintf(formatted, 1024, "\n \n\n",
+ QTest::qt_asprintf(formatted, "\n \n\n",
element->attributeValue(QTest::AI_Type),
element->attributeName(QTest::AI_File),
quotedFile,
@@ -135,7 +135,7 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char *formatted)
QXmlTestLogger::xmlQuote(quotedTag, element->attributeValue(QTest::AI_Tag),
sizeof(quotedTag));
- QTest::qt_snprintf(formatted, 1024, "\n",
+ QTest::qt_asprintf(formatted, "\n",
element->attributeName(QTest::AI_Metric),
quotedMetric,
element->attributeName(QTest::AI_Tag),
@@ -147,23 +147,23 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char *formatted)
break;
}
default:
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
}
-void QTestXmlStreamer::formatEnd(const QTestElement *element, char *formatted) const
+void QTestXmlStreamer::formatEnd(const QTestElement *element, char **formatted) const
{
if(!element || !formatted)
return;
if (element->elementType() == QTest::LET_TestCase) {
- QTest::qt_snprintf(formatted, 1024, "\n");
+ QTest::qt_asprintf(formatted, "\n");
}
else
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, char *formatted) const
+void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, char **formatted) const
{
if(!element || !formatted)
return;
@@ -181,14 +181,14 @@ void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, char
element->attributeValue(QTest::AI_Line));
if( !element->childElements() ) {
- QTest::qt_snprintf(formatted, 1024, "\n",
+ QTest::qt_asprintf(formatted, "\n",
element->attributeValue(QTest::AI_Result), buf);
}
else {
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
}else{
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
}
diff --git a/src/testlib/qtestxmlstreamer.h b/src/testlib/qtestxmlstreamer.h
index 3cb1c60..a601f60 100644
--- a/src/testlib/qtestxmlstreamer.h
+++ b/src/testlib/qtestxmlstreamer.h
@@ -59,9 +59,9 @@ class QTestXmlStreamer: public QTestBasicStreamer
QTestXmlStreamer();
~QTestXmlStreamer();
- void formatStart(const QTestElement *element = 0, char *formatted = 0) const;
- void formatEnd(const QTestElement *element = 0, char *formatted = 0) const;
- void formatBeforeAttributes(const QTestElement *element = 0, char *formatted = 0) const;
+ void formatStart(const QTestElement *element, char **formatted) const;
+ void formatEnd(const QTestElement *element, char **formatted) const;
+ void formatBeforeAttributes(const QTestElement *element, char **formatted) const;
void output(QTestElement *element) const;
};
diff --git a/src/testlib/qtestxunitstreamer.cpp b/src/testlib/qtestxunitstreamer.cpp
index 6690cec..f59c0f5 100644
--- a/src/testlib/qtestxunitstreamer.cpp
+++ b/src/testlib/qtestxunitstreamer.cpp
@@ -73,7 +73,7 @@ void QTestXunitStreamer::indentForElement(const QTestElement* element, char* buf
}
}
-void QTestXunitStreamer::formatStart(const QTestElement *element, char *formatted) const
+void QTestXunitStreamer::formatStart(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
@@ -84,34 +84,34 @@ void QTestXunitStreamer::formatStart(const QTestElement *element, char *formatte
// Errors are written as CDATA within system-err, comments elsewhere
if (element->elementType() == QTest::LET_Error) {
if (element->parentElement()->elementType() == QTest::LET_SystemError) {
- QTest::qt_snprintf(formatted, 1024, "elementName());
+ QTest::qt_asprintf(formatted, "%s<%s", indent, element->elementName());
}
-void QTestXunitStreamer::formatEnd(const QTestElement *element, char *formatted) const
+void QTestXunitStreamer::formatEnd(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
if(!element->childElements()){
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
return;
}
char indent[20];
indentForElement(element, indent, sizeof(indent));
- QTest::qt_snprintf(formatted, 1024, "%s%s>\n", indent, element->elementName());
+ QTest::qt_asprintf(formatted, "%s%s>\n", indent, element->elementName());
}
-void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTestElementAttribute *attribute, char *formatted) const
+void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTestElementAttribute *attribute, char **formatted) const
{
if(!attribute || !formatted )
return;
@@ -124,7 +124,7 @@ void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTe
if (attrindex != QTest::AI_Description) return;
- QXmlTestLogger::xmlCdata(formatted, attribute->value(), 1024);
+ QXmlTestLogger::xmlCdata(formatted, attribute->value());
return;
}
@@ -137,14 +137,14 @@ void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTe
if (key) {
char quotedValue[900];
QXmlTestLogger::xmlQuote(quotedValue, attribute->value(), sizeof(quotedValue));
- QTest::qt_snprintf(formatted, 1024, " %s=\"%s\"", key, quotedValue);
+ QTest::qt_asprintf(formatted, " %s=\"%s\"", key, quotedValue);
}
else {
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
}
-void QTestXunitStreamer::formatAfterAttributes(const QTestElement *element, char *formatted) const
+void QTestXunitStreamer::formatAfterAttributes(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
@@ -152,18 +152,18 @@ void QTestXunitStreamer::formatAfterAttributes(const QTestElement *element, char
// Errors are written as CDATA within system-err, comments elsewhere
if (element->elementType() == QTest::LET_Error) {
if (element->parentElement()->elementType() == QTest::LET_SystemError) {
- QTest::qt_snprintf(formatted, 1024, "]]>\n");
+ QTest::qt_asprintf(formatted, "]]>\n");
}
else {
- QTest::qt_snprintf(formatted, 1024, " -->\n");
+ QTest::qt_asprintf(formatted, " -->\n");
}
return;
}
if(!element->childElements())
- QTest::qt_snprintf(formatted, 10, "/>\n");
+ QTest::qt_asprintf(formatted, "/>\n");
else
- QTest::qt_snprintf(formatted, 10, ">\n");
+ QTest::qt_asprintf(formatted, ">\n");
}
void QTestXunitStreamer::output(QTestElement *element) const
@@ -176,7 +176,7 @@ void QTestXunitStreamer::output(QTestElement *element) const
void QTestXunitStreamer::outputElements(QTestElement *element, bool) const
{
- char buf[1024];
+ QTestCharBuffer buf;
bool hasChildren;
/*
Elements are in reverse order of occurrence, so start from the end and work
diff --git a/src/testlib/qtestxunitstreamer.h b/src/testlib/qtestxunitstreamer.h
index 9817fd3..044307f 100644
--- a/src/testlib/qtestxunitstreamer.h
+++ b/src/testlib/qtestxunitstreamer.h
@@ -58,10 +58,10 @@ class QTestXunitStreamer: public QTestBasicStreamer
QTestXunitStreamer();
~QTestXunitStreamer();
- void formatStart(const QTestElement *element = 0, char *formatted = 0) const;
- void formatEnd(const QTestElement *element = 0, char *formatted = 0) const;
- void formatAfterAttributes(const QTestElement *element = 0, char *formatted = 0) const;
- void formatAttributes(const QTestElement *element = 0, const QTestElementAttribute *attribute = 0, char *formatted = 0) const;
+ void formatStart(const QTestElement *element, char **formatted) const;
+ void formatEnd(const QTestElement *element, char **formatted) const;
+ void formatAfterAttributes(const QTestElement *element, char **formatted) const;
+ void formatAttributes(const QTestElement *element, const QTestElementAttribute *attribute, char **formatted) const;
void output(QTestElement *element) const;
void outputElements(QTestElement *element, bool isChildElement = false) const;
diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp
index 85eb0dd..8fc8dd9 100644
--- a/src/testlib/qxmltestlogger.cpp
+++ b/src/testlib/qxmltestlogger.cpp
@@ -294,29 +294,30 @@ void QXmlTestLogger::addMessage(MessageTypes type, const char *message,
XML characters as necessary so that dest is suitable for use in an XML
quoted attribute string.
*/
-void QXmlTestLogger::xmlQuote(char* dest, char const* src, size_t n)
+int QXmlTestLogger::xmlQuote(char* dest, char const* src, size_t n)
{
- if (n == 0) return;
+ if (n == 0) return 0;
*dest = 0;
- if (!src) return;
+ if (!src) return 0;
+ char* begin = dest;
char* end = dest + n;
while (dest < end) {
switch (*src) {
#define MAP_ENTITY(chr, ent) \
- case chr: \
- if (dest + sizeof(ent) < end) { \
- strcpy(dest, ent); \
- dest += sizeof(ent) - 1; \
- } \
- else { \
- *dest = 0; \
- return; \
- } \
- ++src; \
+ case chr: \
+ if (dest + sizeof(ent) < end) { \
+ strcpy(dest, ent); \
+ dest += sizeof(ent) - 1; \
+ } \
+ else { \
+ *dest = 0; \
+ return (dest+sizeof(ent)-begin); \
+ } \
+ ++src; \
break;
MAP_ENTITY('>', ">");
@@ -333,7 +334,7 @@ void QXmlTestLogger::xmlQuote(char* dest, char const* src, size_t n)
case 0:
*dest = 0;
- return;
+ return (dest-begin);
default:
*dest = *src;
@@ -345,29 +346,31 @@ void QXmlTestLogger::xmlQuote(char* dest, char const* src, size_t n)
// If we get here, dest was completely filled (dest == end)
*(dest-1) = 0;
+ return (dest-begin);
}
/*
Copy up to n characters from the src string into dest, escaping any
special strings such that dest is suitable for use in an XML CDATA section.
*/
-void QXmlTestLogger::xmlCdata(char* dest, char const* src, size_t n)
+int QXmlTestLogger::xmlCdata(char* dest, char const* src, size_t n)
{
- if (!n) return;
+ if (!n) return 0;
if (!src || n == 1) {
*dest = 0;
- return;
+ return 0;
}
- char const CDATA_END[] = "]]>";
- char const CDATA_END_ESCAPED[] = "]]]>";
+ static char const CDATA_END[] = "]]>";
+ static char const CDATA_END_ESCAPED[] = "]]]>";
+ char* begin = dest;
char* end = dest + n;
while (dest < end) {
if (!*src) {
*dest = 0;
- return;
+ return (dest-begin);
}
if (!strncmp(src, CDATA_END, sizeof(CDATA_END)-1)) {
@@ -378,7 +381,7 @@ void QXmlTestLogger::xmlCdata(char* dest, char const* src, size_t n)
}
else {
*dest = 0;
- return;
+ return (dest+sizeof(CDATA_END_ESCAPED)-begin);
}
continue;
}
@@ -390,6 +393,52 @@ void QXmlTestLogger::xmlCdata(char* dest, char const* src, size_t n)
// If we get here, dest was completely filled (dest == end)
*(dest-1) = 0;
+ return (dest-begin);
+}
+
+typedef int (*StringFormatFunction)(char*,char const*,size_t);
+
+/*
+ A wrapper for string functions written to work with a fixed size buffer so they can be called
+ with a dynamically allocated buffer.
+*/
+int allocateStringFn(char** str, char const* src, StringFormatFunction func)
+{
+ static const int MAXSIZE = 1024*1024*2;
+
+ int size = 32;
+ delete[] *str;
+ *str = new char[size];
+
+ int res = 0;
+
+ for (;;) {
+ res = func(*str, src, size);
+ (*str)[size - 1] = '\0';
+ if (res < size) {
+ // We succeeded or fatally failed
+ break;
+ }
+ // buffer wasn't big enough, try again
+ size *= 2;
+ if (size > MAXSIZE) {
+ break;
+ }
+ delete[] *str;
+ *str = new char[size];
+ }
+
+ return res;
+}
+
+int QXmlTestLogger::xmlQuote(char** str, char const* src)
+{
+ return allocateStringFn(str, src, QXmlTestLogger::xmlQuote);
+}
+
+int QXmlTestLogger::xmlCdata(char** str, char const* src)
+{
+ return allocateStringFn(str, src, QXmlTestLogger::xmlCdata);
}
QT_END_NAMESPACE
diff --git a/src/testlib/qxmltestlogger_p.h b/src/testlib/qxmltestlogger_p.h
index 526b471..a7cc00a 100644
--- a/src/testlib/qxmltestlogger_p.h
+++ b/src/testlib/qxmltestlogger_p.h
@@ -79,8 +79,10 @@ public:
void addMessage(MessageTypes type, const char *message,
const char *file = 0, int line = 0);
- static void xmlCdata(char* dest, char const* src, size_t n);
- static void xmlQuote(char* dest, char const* src, size_t n);
+ static int xmlCdata(char** dest, char const* src);
+ static int xmlQuote(char** dest, char const* src);
+ static int xmlCdata(char* dest, char const* src, size_t n);
+ static int xmlQuote(char* dest, char const* src, size_t n);
private:
XmlMode xmlmode;
--
cgit v0.12
From c1a90a535206e0a146e13c60d981a855178e69ca Mon Sep 17 00:00:00 2001
From: Rohan McGovern
Date: Thu, 30 Jul 2009 11:15:39 +1000
Subject: Convert all testlib loggers to use dynamically allocated strings.
Most log elements in all loggers can now be of (more or less)
arbitrary length. Selftests pass and are memcheck-clean. The
increase in heap usage seems negligible (it's below the default
minimum threshold of massif).
Task: 253861
Reviewed-by: Michael Goddard
---
src/testlib/qtestlightxmlstreamer.cpp | 49 ++++++++----------
src/testlib/qtestxmlstreamer.cpp | 89 +++++++++++++++-----------------
src/testlib/qtestxunitstreamer.cpp | 10 ++--
src/testlib/qxmltestlogger.cpp | 96 +++++++++++++++++------------------
4 files changed, 112 insertions(+), 132 deletions(-)
diff --git a/src/testlib/qtestlightxmlstreamer.cpp b/src/testlib/qtestlightxmlstreamer.cpp
index a7e205a..e176201 100644
--- a/src/testlib/qtestlightxmlstreamer.cpp
+++ b/src/testlib/qtestlightxmlstreamer.cpp
@@ -66,54 +66,48 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, char **form
switch(element->elementType()){
case QTest::LET_TestCase: {
- char quotedTf[950];
- QXmlTestLogger::xmlQuote(quotedTf, element->attributeValue(QTest::AI_Name),
- sizeof(quotedTf));
+ QTestCharBuffer quotedTf;
+ QXmlTestLogger::xmlQuote(quotedTf, element->attributeValue(QTest::AI_Name));
- QTest::qt_asprintf(formatted, "\n", quotedTf);
+ QTest::qt_asprintf(formatted, "\n", quotedTf.constData());
break;
}
case QTest::LET_Failure: {
- char cdataDesc[900];
- QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description),
- sizeof(cdataDesc));
+ QTestCharBuffer cdataDesc;
+ QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description));
QTest::qt_asprintf(formatted, " \n",
- cdataDesc);
+ cdataDesc.constData());
break;
}
case QTest::LET_Error: {
// assuming type and attribute names don't need quoting
- char quotedFile[128];
- char cdataDesc[700];
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File),
- sizeof(quotedFile));
- QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description),
- sizeof(cdataDesc));
+ QTestCharBuffer quotedFile;
+ QTestCharBuffer cdataDesc;
+ QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
+ QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description));
QTest::qt_asprintf(formatted, "\n \n\n",
element->attributeValue(QTest::AI_Type),
element->attributeName(QTest::AI_File),
- quotedFile,
+ quotedFile.constData(),
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line),
- cdataDesc);
+ cdataDesc.constData());
break;
}
case QTest::LET_Benchmark: {
// assuming value and iterations don't need quoting
- char quotedMetric[256];
- char quotedTag[256];
- QXmlTestLogger::xmlQuote(quotedMetric, element->attributeValue(QTest::AI_Metric),
- sizeof(quotedMetric));
- QXmlTestLogger::xmlQuote(quotedTag, element->attributeValue(QTest::AI_Tag),
- sizeof(quotedTag));
+ QTestCharBuffer quotedMetric;
+ QTestCharBuffer quotedTag;
+ QXmlTestLogger::xmlQuote(quotedMetric, element->attributeValue(QTest::AI_Metric));
+ QXmlTestLogger::xmlQuote(quotedTag, element->attributeValue(QTest::AI_Tag));
QTest::qt_asprintf(formatted, "\n",
element->attributeName(QTest::AI_Metric),
- quotedMetric,
+ quotedMetric.constData(),
element->attributeName(QTest::AI_Tag),
- quotedTag,
+ quotedTag.constData(),
element->attributeName(QTest::AI_Value),
element->attributeValue(QTest::AI_Value),
element->attributeName(QTest::AI_Iterations),
@@ -147,13 +141,12 @@ void QTestLightXmlStreamer::formatBeforeAttributes(const QTestElement *element,
if (element->elementType() == QTest::LET_TestCase && element->attribute(QTest::AI_Result)){
QTestCharBuffer buf;
- char quotedFile[700];
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File),
- sizeof(quotedFile));
+ QTestCharBuffer quotedFile;
+ QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
QTest::qt_asprintf(buf, "%s=\"%s\" %s=\"%s\"",
element->attributeName(QTest::AI_File),
- quotedFile,
+ quotedFile.constData(),
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line));
diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp
index b9e0a38..1b6e674 100644
--- a/src/testlib/qtestxmlstreamer.cpp
+++ b/src/testlib/qtestxmlstreamer.cpp
@@ -67,79 +67,71 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char **formatted
switch(element->elementType()){
case QTest::LET_TestCase: {
- char quotedTf[950];
- QXmlTestLogger::xmlQuote(quotedTf, element->attributeValue(QTest::AI_Name),
- sizeof(quotedTf));
+ QTestCharBuffer quotedTf;
+ QXmlTestLogger::xmlQuote(quotedTf, element->attributeValue(QTest::AI_Name));
- QTest::qt_asprintf(formatted, "\n", quotedTf);
+ QTest::qt_asprintf(formatted, "\n", quotedTf.constData());
break;
}
case QTest::LET_Failure: {
- char cdataDesc[800];
- QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description),
- sizeof(cdataDesc));
+ QTestCharBuffer cdataDesc;
+ QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description));
- char location[100];
- char quotedFile[70];
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File),
- sizeof(quotedFile));
+ QTestCharBuffer location;
+ QTestCharBuffer quotedFile;
+ QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
- QTest::qt_snprintf(location, sizeof(location), "%s=\"%s\" %s=\"%s\"",
+ QTest::qt_asprintf(location, "%s=\"%s\" %s=\"%s\"",
element->attributeName(QTest::AI_File),
- quotedFile,
+ quotedFile.constData(),
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line));
if (element->attribute(QTest::AI_Tag)) {
- char cdataTag[100];
- QXmlTestLogger::xmlCdata(cdataTag, element->attributeValue(QTest::AI_Tag),
- sizeof(cdataTag));
+ QTestCharBuffer cdataTag;
+ QXmlTestLogger::xmlCdata(cdataTag, element->attributeValue(QTest::AI_Tag));
QTest::qt_asprintf(formatted, "\n"
" \n"
" \n"
"\n", element->attributeValue(QTest::AI_Result),
- location, cdataTag, cdataDesc);
+ location.constData(), cdataTag.constData(), cdataDesc.constData());
}
else {
QTest::qt_asprintf(formatted, "\n"
" \n"
"\n", element->attributeValue(QTest::AI_Result),
- location, cdataDesc);
+ location.constData(), cdataDesc.constData());
}
break;
}
case QTest::LET_Error: {
// assuming type and attribute names don't need quoting
- char quotedFile[128];
- char cdataDesc[700];
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File),
- sizeof(quotedFile));
- QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description),
- sizeof(cdataDesc));
+ QTestCharBuffer quotedFile;
+ QTestCharBuffer cdataDesc;
+ QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
+ QXmlTestLogger::xmlCdata(cdataDesc, element->attributeValue(QTest::AI_Description));
QTest::qt_asprintf(formatted, "\n \n\n",
element->attributeValue(QTest::AI_Type),
element->attributeName(QTest::AI_File),
- quotedFile,
+ quotedFile.constData(),
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line),
- cdataDesc);
+ cdataDesc.constData());
break;
}
case QTest::LET_Benchmark: {
// assuming value and iterations don't need quoting
- char quotedMetric[256];
- char quotedTag[256];
- QXmlTestLogger::xmlQuote(quotedMetric, element->attributeValue(QTest::AI_Metric),
- sizeof(quotedMetric));
- QXmlTestLogger::xmlQuote(quotedTag, element->attributeValue(QTest::AI_Tag),
- sizeof(quotedTag));
+ QTestCharBuffer quotedMetric;
+ QTestCharBuffer quotedTag;
+ QXmlTestLogger::xmlQuote(quotedMetric, element->attributeValue(QTest::AI_Metric));
+ QXmlTestLogger::xmlQuote(quotedTag, element->attributeValue(QTest::AI_Tag));
QTest::qt_asprintf(formatted, "\n",
element->attributeName(QTest::AI_Metric),
- quotedMetric,
+ quotedMetric.constData(),
element->attributeName(QTest::AI_Tag),
- quotedTag,
+ quotedTag.constData(),
element->attributeName(QTest::AI_Value),
element->attributeValue(QTest::AI_Value),
element->attributeName(QTest::AI_Iterations),
@@ -169,20 +161,19 @@ void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, char
return;
if (element->elementType() == QTest::LET_TestCase && element->attribute(QTest::AI_Result)){
- char buf[900];
- char quotedFile[700];
- QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File),
- sizeof(quotedFile));
+ QTestCharBuffer buf;
+ QTestCharBuffer quotedFile;
+ QXmlTestLogger::xmlQuote(quotedFile, element->attributeValue(QTest::AI_File));
- QTest::qt_snprintf(buf, sizeof(buf), "%s=\"%s\" %s=\"%s\"",
+ QTest::qt_asprintf(buf, "%s=\"%s\" %s=\"%s\"",
element->attributeName(QTest::AI_File),
- quotedFile,
+ quotedFile.constData(),
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line));
if( !element->childElements() ) {
QTest::qt_asprintf(formatted, "\n",
- element->attributeValue(QTest::AI_Result), buf);
+ element->attributeValue(QTest::AI_Result), buf.constData());
}
else {
QTest::qt_asprintf(formatted, "");
@@ -194,24 +185,24 @@ void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, char
void QTestXmlStreamer::output(QTestElement *element) const
{
- char buf[1024];
- char quotedTc[800];
- QXmlTestLogger::xmlQuote(quotedTc, QTestResult::currentTestObjectName(), sizeof(quotedTc));
+ QTestCharBuffer buf;
+ QTestCharBuffer quotedTc;
+ QXmlTestLogger::xmlQuote(quotedTc, QTestResult::currentTestObjectName());
- QTest::qt_snprintf(buf, sizeof(buf), "\n\n",
- quotedTc);
+ QTest::qt_asprintf(buf, "\n\n",
+ quotedTc.constData());
outputString(buf);
- QTest::qt_snprintf(buf, sizeof(buf), "\n %s\n %s\n",
+ QTest::qt_asprintf(buf, "\n %s\n %s\n",
qVersion(), QTEST_VERSION_STR );
outputString(buf);
- QTest::qt_snprintf(buf, sizeof(buf), "\n");
+ QTest::qt_asprintf(buf, "\n");
outputString(buf);
QTestBasicStreamer::output(element);
- QTest::qt_snprintf(buf, sizeof(buf), "\n");
+ QTest::qt_asprintf(buf, "\n");
outputString(buf);
}
diff --git a/src/testlib/qtestxunitstreamer.cpp b/src/testlib/qtestxunitstreamer.cpp
index f59c0f5..d5d2631 100644
--- a/src/testlib/qtestxunitstreamer.cpp
+++ b/src/testlib/qtestxunitstreamer.cpp
@@ -135,9 +135,9 @@ void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTe
key = attribute->name();
if (key) {
- char quotedValue[900];
- QXmlTestLogger::xmlQuote(quotedValue, attribute->value(), sizeof(quotedValue));
- QTest::qt_asprintf(formatted, " %s=\"%s\"", key, quotedValue);
+ QTestCharBuffer quotedValue;
+ QXmlTestLogger::xmlQuote(quotedValue, attribute->value());
+ QTest::qt_asprintf(formatted, " %s=\"%s\"", key, quotedValue.constData());
}
else {
QTest::qt_asprintf(formatted, "");
@@ -168,9 +168,7 @@ void QTestXunitStreamer::formatAfterAttributes(const QTestElement *element, char
void QTestXunitStreamer::output(QTestElement *element) const
{
- char buf[1024];
- QTest::qt_snprintf(buf, sizeof(buf), "\n");
- outputString(buf);
+ outputString("\n");
QTestBasicStreamer::output(element);
}
diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp
index 8fc8dd9..fca7bfc 100644
--- a/src/testlib/qxmltestlogger.cpp
+++ b/src/testlib/qxmltestlogger.cpp
@@ -104,18 +104,18 @@ QXmlTestLogger::~QXmlTestLogger()
void QXmlTestLogger::startLogging()
{
QAbstractTestLogger::startLogging();
- char buf[1024];
+ QTestCharBuffer buf;
if (xmlmode == QXmlTestLogger::Complete) {
- char quotedTc[900];
- xmlQuote(quotedTc, QTestResult::currentTestObjectName(), sizeof(quotedTc));
- QTest::qt_snprintf(buf, sizeof(buf),
+ QTestCharBuffer quotedTc;
+ xmlQuote(quotedTc, QTestResult::currentTestObjectName());
+ QTest::qt_asprintf(buf,
"\n"
- "\n", quotedTc);
+ "\n", quotedTc.constData());
outputString(buf);
}
- QTest::qt_snprintf(buf, sizeof(buf),
+ QTest::qt_asprintf(buf,
"\n"
" %s\n"
" "QTEST_VERSION_STR"\n"
@@ -134,10 +134,10 @@ void QXmlTestLogger::stopLogging()
void QXmlTestLogger::enterTestFunction(const char *function)
{
- char buf[1024];
- char quotedFunction[950];
- xmlQuote(quotedFunction, function, sizeof(quotedFunction));
- QTest::qt_snprintf(buf, sizeof(buf), "\n", quotedFunction);
+ QTestCharBuffer buf;
+ QTestCharBuffer quotedFunction;
+ xmlQuote(quotedFunction, function);
+ QTest::qt_asprintf(buf, "\n", quotedFunction.constData());
outputString(buf);
}
@@ -208,51 +208,49 @@ static const char *messageFormatString(bool noDescription, bool noTag)
void QXmlTestLogger::addIncident(IncidentTypes type, const char *description,
const char *file, int line)
{
- // buffer must be large enough to hold all quoted/cdata buffers plus the format string itself
- char buf[5000];
+ QTestCharBuffer buf;
const char *tag = QTestResult::currentDataTag();
const char *gtag = QTestResult::currentGlobalDataTag();
const char *filler = (tag && gtag) ? ":" : "";
const bool notag = QTest::isEmpty(tag) && QTest::isEmpty(gtag);
- char quotedFile[1024];
- char cdataGtag[1024];
- char cdataTag[1024];
- char cdataDescription[1024];
+ QTestCharBuffer quotedFile;
+ QTestCharBuffer cdataGtag;
+ QTestCharBuffer cdataTag;
+ QTestCharBuffer cdataDescription;
- xmlQuote(quotedFile, file, sizeof(quotedFile));
- xmlCdata(cdataGtag, gtag, sizeof(cdataGtag));
- xmlCdata(cdataTag, tag, sizeof(cdataTag));
- xmlCdata(cdataDescription, description, sizeof(cdataDescription));
+ xmlQuote(quotedFile, file);
+ xmlCdata(cdataGtag, gtag);
+ xmlCdata(cdataTag, tag);
+ xmlCdata(cdataDescription, description);
- QTest::qt_snprintf(buf, sizeof(buf),
+ QTest::qt_asprintf(buf,
QTest::incidentFormatString(QTest::isEmpty(description), notag),
QTest::xmlIncidentType2String(type),
- quotedFile, line,
- cdataGtag,
+ quotedFile.constData(), line,
+ cdataGtag.constData(),
filler,
- cdataTag,
- cdataDescription);
+ cdataTag.constData(),
+ cdataDescription.constData());
outputString(buf);
}
void QXmlTestLogger::addBenchmarkResult(const QBenchmarkResult &result)
{
- char buf[1536];
- char quotedMetric[64];
- char quotedTag[1024];
+ QTestCharBuffer buf;
+ QTestCharBuffer quotedMetric;
+ QTestCharBuffer quotedTag;
xmlQuote(quotedMetric,
- QBenchmarkGlobalData::current->measurer->metricText().toAscii().constData(),
- sizeof(quotedMetric));
- xmlQuote(quotedTag, result.context.tag.toAscii().constData(), sizeof(quotedTag));
+ QBenchmarkGlobalData::current->measurer->metricText().toAscii().constData());
+ xmlQuote(quotedTag, result.context.tag.toAscii().constData());
- QTest::qt_snprintf(
- buf, sizeof(buf),
+ QTest::qt_asprintf(
+ buf,
QTest::benchmarkResultFormatString(),
- quotedMetric,
- quotedTag,
+ quotedMetric.constData(),
+ quotedTag.constData(),
QByteArray::number(result.value).constData(), //no 64-bit qt_snprintf support
result.iterations);
outputString(buf);
@@ -261,30 +259,30 @@ void QXmlTestLogger::addBenchmarkResult(const QBenchmarkResult &result)
void QXmlTestLogger::addMessage(MessageTypes type, const char *message,
const char *file, int line)
{
- char buf[5000];
+ QTestCharBuffer buf;
const char *tag = QTestResult::currentDataTag();
const char *gtag = QTestResult::currentGlobalDataTag();
const char *filler = (tag && gtag) ? ":" : "";
const bool notag = QTest::isEmpty(tag) && QTest::isEmpty(gtag);
- char quotedFile[1024];
- char cdataGtag[1024];
- char cdataTag[1024];
- char cdataDescription[1024];
+ QTestCharBuffer quotedFile;
+ QTestCharBuffer cdataGtag;
+ QTestCharBuffer cdataTag;
+ QTestCharBuffer cdataDescription;
- xmlQuote(quotedFile, file, sizeof(quotedFile));
- xmlCdata(cdataGtag, gtag, sizeof(cdataGtag));
- xmlCdata(cdataTag, tag, sizeof(cdataTag));
- xmlCdata(cdataDescription, message, sizeof(cdataDescription));
+ xmlQuote(quotedFile, file);
+ xmlCdata(cdataGtag, gtag);
+ xmlCdata(cdataTag, tag);
+ xmlCdata(cdataDescription, message);
- QTest::qt_snprintf(buf, sizeof(buf),
+ QTest::qt_asprintf(buf,
QTest::messageFormatString(QTest::isEmpty(message), notag),
QTest::xmlMessageType2String(type),
- quotedFile, line,
- cdataGtag,
+ quotedFile.constData(), line,
+ cdataGtag.constData(),
filler,
- cdataTag,
- cdataDescription);
+ cdataTag.constData(),
+ cdataDescription.constData());
outputString(buf);
}
--
cgit v0.12
From f752633b878840634ca374fb9c1e8755aa1fd886 Mon Sep 17 00:00:00 2001
From: Richard Moe Gustavsen
Date: Wed, 29 Jul 2009 15:48:46 +0200
Subject: Unable to change focus between two line edits on mac
This is because we try to decide whether the window cocoa tells
us to be active should be active, and if we desagree, we do nothing.
The result is that Qt and Cocoa ends up in different states.
I decided to remove a lot of the logic that went on in this case, and
the resons is:
1. By checking the callplaces to
onApplicationWindowChangedActivation, we know that we always have a
valid widget pointer, and we know that the widget always is a window
(otherwise Cocoa would never tell us that the widget got active).
2. We can never end up doing nothing in this response. The best
we can do is to follow what Cocoa tells us. If this turns out to
break something, it would probably be better to check why we get an
activation call in the first place for a window that should not be
activated (e.g. is canBecomeKeyWindow set correctly?)
Task: 253610
RevBy: msorvig
---
src/gui/kernel/qapplication_mac.mm | 49 ++++++++++----------------------------
1 file changed, 12 insertions(+), 37 deletions(-)
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm
index 0d86c8e..be23949 100644
--- a/src/gui/kernel/qapplication_mac.mm
+++ b/src/gui/kernel/qapplication_mac.mm
@@ -1481,6 +1481,7 @@ QWidget *QApplicationPrivate::tryModalHelper_sys(QWidget *top)
return top;
}
+#ifndef QT_MAC_USE_COCOA
static bool qt_try_modal(QWidget *widget, EventRef event)
{
QWidget * top = 0;
@@ -1514,6 +1515,7 @@ static bool qt_try_modal(QWidget *widget, EventRef event)
#endif
return !block_event;
}
+#endif
OSStatus QApplicationPrivate::tabletProximityCallback(EventHandlerCallRef, EventRef carbonEvent,
void *)
@@ -2894,52 +2896,25 @@ bool QApplicationPrivate::canQuit()
#endif
}
-void onApplicationWindowChangedActivation( QWidget*widget, bool activated )
+void onApplicationWindowChangedActivation(QWidget *widget, bool activated)
{
#if QT_MAC_USE_COCOA
- QApplication *app = qApp;
+ if (!widget)
+ return;
- if ( activated )
- {
- if (QApplicationPrivate::app_style)
- {
+ if (activated) {
+ if (QApplicationPrivate::app_style) {
QEvent ev(QEvent::Style);
qt_sendSpontaneousEvent(QApplicationPrivate::app_style, &ev);
}
-
- if (widget && app_do_modal && !qt_try_modal(widget, NULL))
- return;
-
- if (widget && widget->window()->isVisible())
- {
- QWidget *tlw = widget->window();
-
- if (tlw->isWindow() && !(tlw->windowType() == Qt::Popup)
- && !qt_mac_is_macdrawer(tlw)
- && (!tlw->parentWidget() || tlw->isModal() || !(tlw->windowType() == Qt::Tool))) {
- bool just_send_event = false;
-#if 0
- WindowActivationScope scope;
- if ( GetWindowActivationScope((OSWindowRef)wid, &scope) == noErr &&
- scope == kWindowActivationScopeIndependent)
- {
- if ( GetFrontWindowOfClass(kAllWindowClasses, true) != wid )
- just_send_event = true;
- }
-#endif
- if (just_send_event) {
- QEvent e(QEvent::WindowActivate);
- qt_sendSpontaneousEvent(widget, &e);
- } else {
- app->setActiveWindow(tlw);
- }
- }
- }
+ qApp->setActiveWindow(widget);
} else { // deactivated
- if (widget && QApplicationPrivate::active_window == widget)
- app->setActiveWindow(0);
+ if (QApplicationPrivate::active_window == widget)
+ qApp->setActiveWindow(0);
}
+
QMenuBar::macUpdateMenuBar();
+
#else
Q_UNUSED(widget);
Q_UNUSED(activated);
--
cgit v0.12
From d09fa4a816c6b9ccf306b7e1a887c4a4b1dc2f4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20S=C3=B8rvig?=
Date: Thu, 30 Jul 2009 09:25:10 +0200
Subject: Start implementing Mac accessibility for cocoa.
Rather than having this stuck in a branch somewhere I'm going to
implement it incrementally in main. It's going to be a long haul
before it's done.
This commit implements:
- accessibilityIsIgnored()
- Accessibility role translation
---
src/gui/accessible/accessible.pri | 3 +-
src/gui/accessible/qaccessible_mac_cocoa.mm | 234 ++++++++++++++++++++++++++++
2 files changed, 236 insertions(+), 1 deletion(-)
diff --git a/src/gui/accessible/accessible.pri b/src/gui/accessible/accessible.pri
index 76b6687..ad2fb4c 100644
--- a/src/gui/accessible/accessible.pri
+++ b/src/gui/accessible/accessible.pri
@@ -14,7 +14,8 @@ contains(QT_CONFIG, accessibility) {
mac:!embedded {
HEADERS += accessible/qaccessible_mac_p.h
- OBJECTIVE_SOURCES += accessible/qaccessible_mac.mm
+ OBJECTIVE_SOURCES += accessible/qaccessible_mac.mm \
+ accessible/qaccessible_mac_cocoa.mm
} else:win32 {
SOURCES += accessible/qaccessible_win.cpp
} else {
diff --git a/src/gui/accessible/qaccessible_mac_cocoa.mm b/src/gui/accessible/qaccessible_mac_cocoa.mm
index e69de29..1cb2ffa 100644
--- a/src/gui/accessible/qaccessible_mac_cocoa.mm
+++ b/src/gui/accessible/qaccessible_mac_cocoa.mm
@@ -0,0 +1,234 @@
+
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qaccessible.h"
+#include "qaccessible_mac_p.h"
+#include "qdebug.h"
+#include "qtabwidget.h"
+
+#include
+#include
+#include
+
+
+#ifndef QT_NO_ACCESSIBILITY
+
+#ifdef QT_MAC_USE_COCOA
+
+QT_BEGIN_NAMESPACE
+
+//#define MAC_ACCESSIBILTY_DEVELOPER_MODE
+
+#ifdef MAC_ACCESSIBILTY_DEVELOPER_MODE
+#define MAC_ACCESSIBILTY_DEBUG qDebug
+#else
+#define MAC_ACCESSIBILTY_DEBUG if (0) qDebug
+#endif
+
+typedef QMap QMacAccessibiltyRoleMap;
+Q_GLOBAL_STATIC(QMacAccessibiltyRoleMap, qMacAccessibiltyRoleMap);
+
+static QAInterface interfaceForView(QT_MANGLE_NAMESPACE(QCocoaView) *view)
+{
+ return QAInterface(QAccessible::queryAccessibleInterface([view qt_qwidget]));
+}
+
+/*
+ Set up mappings from Qt accessibilty roles to Mac accessibilty roles.
+*/
+static void populateRoleMap()
+{
+ QMacAccessibiltyRoleMap &roleMap = *qMacAccessibiltyRoleMap();
+ roleMap[QAccessible::MenuItem] = NSAccessibilityMenuItemRole;
+ roleMap[QAccessible::MenuBar] = NSAccessibilityMenuBarRole;
+ roleMap[QAccessible::ScrollBar] = NSAccessibilityScrollBarRole;
+ roleMap[QAccessible::Grip] = NSAccessibilityGrowAreaRole;
+ roleMap[QAccessible::Window] = NSAccessibilityWindowRole;
+ roleMap[QAccessible::Dialog] = NSAccessibilityWindowRole;
+ roleMap[QAccessible::AlertMessage] = NSAccessibilityWindowRole;
+ roleMap[QAccessible::ToolTip] = NSAccessibilityWindowRole;
+ roleMap[QAccessible::HelpBalloon] = NSAccessibilityWindowRole;
+ roleMap[QAccessible::PopupMenu] = NSAccessibilityMenuRole;
+ roleMap[QAccessible::Application] = NSAccessibilityApplicationRole;
+ roleMap[QAccessible::Pane] = NSAccessibilityGroupRole;
+ roleMap[QAccessible::Grouping] = NSAccessibilityGroupRole;
+ roleMap[QAccessible::Separator] = NSAccessibilitySplitterRole;
+ roleMap[QAccessible::ToolBar] = NSAccessibilityToolbarRole;
+ roleMap[QAccessible::PageTab] = NSAccessibilityRadioButtonRole;
+ roleMap[QAccessible::ButtonMenu] = NSAccessibilityMenuButtonRole;
+ roleMap[QAccessible::ButtonDropDown] = NSAccessibilityPopUpButtonRole;
+ roleMap[QAccessible::SpinBox] = NSAccessibilityIncrementorRole;
+ roleMap[QAccessible::Slider] = NSAccessibilitySliderRole;
+ roleMap[QAccessible::ProgressBar] = NSAccessibilityProgressIndicatorRole;
+ roleMap[QAccessible::ComboBox] = NSAccessibilityPopUpButtonRole;
+ roleMap[QAccessible::RadioButton] = NSAccessibilityRadioButtonRole;
+ roleMap[QAccessible::CheckBox] = NSAccessibilityCheckBoxRole;
+ roleMap[QAccessible::StaticText] = NSAccessibilityStaticTextRole;
+ roleMap[QAccessible::Table] = NSAccessibilityTableRole;
+ roleMap[QAccessible::StatusBar] = NSAccessibilityStaticTextRole;
+ roleMap[QAccessible::Column] = NSAccessibilityColumnRole;
+ roleMap[QAccessible::ColumnHeader] = NSAccessibilityColumnRole;
+ roleMap[QAccessible::Row] = NSAccessibilityRowRole;
+ roleMap[QAccessible::RowHeader] = NSAccessibilityRowRole;
+ roleMap[QAccessible::Cell] = NSAccessibilityTextFieldRole;
+ roleMap[QAccessible::PushButton] = NSAccessibilityButtonRole;
+ roleMap[QAccessible::EditableText] = NSAccessibilityTextFieldRole;
+ roleMap[QAccessible::Link] = NSAccessibilityTextFieldRole;
+ roleMap[QAccessible::Indicator] = NSAccessibilityValueIndicatorRole;
+ roleMap[QAccessible::Splitter] = NSAccessibilitySplitGroupRole;
+ roleMap[QAccessible::List] = NSAccessibilityListRole;
+ roleMap[QAccessible::ListItem] = NSAccessibilityStaticTextRole;
+ roleMap[QAccessible::Cell] = NSAccessibilityStaticTextRole;
+}
+
+/*
+ Returns a Mac accessibility role for the given interface, or
+ NSAccessibilityUnknownRole if no role mapping is found.
+*/
+static NSString *macRoleForInterface(QAInterface interface)
+{
+ const QAccessible::Role qtRole = interface.role();
+ QMacAccessibiltyRoleMap &roleMap = *qMacAccessibiltyRoleMap();
+
+ if (roleMap.isEmpty())
+ populateRoleMap();
+
+ MAC_ACCESSIBILTY_DEBUG() << "role for" << interface.object() << "interface role" << hex << qtRole;
+
+ if (roleMap.contains(qtRole)) {
+ MAC_ACCESSIBILTY_DEBUG() << "return" << roleMap[qtRole];
+ return roleMap[qtRole];
+ }
+
+ MAC_ACCESSIBILTY_DEBUG() << "return NSAccessibilityUnknownRole";
+ return NSAccessibilityUnknownRole;
+}
+
+/*
+ Is the interface a QTabBar embedded in a QTabWidget?
+ (as opposed to a stand-alone tab bar)
+*/
+static bool isEmbeddedTabBar(const QAInterface &interface)
+{
+ QObject *object = interface.object();
+ if (interface.role() == QAccessible::PageTabList && object)
+ return (qobject_cast(object->parent()));
+
+ return false;
+}
+
+static bool isInterfaceIgnored(QAInterface interface)
+{
+ // Mac accessibility does not have an attribute that corresponds to the
+ // Invisible/Offscreen state. Use the ignore facility to disable them.
+ const QAccessible::State state = interface.state();
+ if (state & QAccessible::Invisible ||
+ state & QAccessible::Offscreen )
+ return false;
+
+ // Hide QTabBars that has a QTabWidget parent (the QTabWidget handles the accessibility)
+ if (isEmbeddedTabBar(interface))
+ return false;
+
+ if (QObject * const object = interface.object()) {
+ const QString className = QLatin1String(object->metaObject()->className());
+
+ // Prevent VoiceOver from focusing on tool tips by ignoring those
+ // interfaces. Shifting VoiceOver focus to the tool tip is confusing
+ // and the contents of the tool tip is avalible through the description
+ // attribute anyway.
+ if (className == QLatin1String("QTipLabel"))
+ return false;
+ }
+
+ // Hide interfaces with an unknown role. When developing it's often useful to disable
+ // this check to see all interfaces in the hierarchy.
+#ifndef MAC_ACCESSIBILTY_DEVELOPER_MODE
+ return [macRoleForInterface(interface) isEqualToString: NSAccessibilityUnknownRole];
+#else
+ return NO;
+#endif
+}
+
+QT_END_NAMESPACE
+
+@implementation QT_MANGLE_NAMESPACE(QCocoaView) (Accessibility)
+
+- (BOOL)accessibilityIsIgnored
+{
+ QAInterface interface = interfaceForView(self);
+ return isInterfaceIgnored(interface);
+}
+
+- (NSArray *)accessibilityAttributeNames
+{
+ QAInterface interface = interfaceForView(self);
+
+ static NSArray *attributes = nil;
+ if (attributes == nil) {
+ attributes = [super accessibilityAttributeNames];
+
+ }
+ return attributes;
+}
+
+- (id)accessibilityAttributeValue:(NSString *)attribute
+{
+ MAC_ACCESSIBILTY_DEBUG() << "accessibilityAttributeValue" << self << QCFString::toQString(reinterpret_cast(attribute));
+
+ QAInterface interface = interfaceForView(self);
+
+ // Switch on the attribute name and call the appropriate handler function.
+ // Pass the call on to the NSView class for attributes we don't handle.
+ if ([attribute isEqualToString:@"AXRole"]) {
+ return macRoleForInterface(interface);
+ } else {
+ return [super accessibilityAttributeValue:attribute];
+ }
+}
+
+@end
+
+#endif // QT_MAC_USE_COCOA
+
+#endif // QT_NO_ACCESSIBILITY
+
--
cgit v0.12
From 9523b27be4fe00870d19c4ff4caa2d78dcf520e6 Mon Sep 17 00:00:00 2001
From: Olivier Goffart
Date: Thu, 30 Jul 2009 10:11:57 +0200
Subject: parse Q_INVOKABLE explicit constructors
regression introduced in e43eae35 because the code of maybeParseFunction
and parseFunction is not exactly the same.
Reviewed-by: Kent Hansen
---
src/tools/moc/moc.cpp | 2 +-
tests/auto/moc/tst_moc.cpp | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 797595f..0ba7d53 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -429,7 +429,7 @@ bool Moc::parseMaybeFunction(const ClassDef *cdef, FunctionDef *def)
{
def->isVirtual = false;
//skip modifiers and attributes
- while (test(INLINE) || test(STATIC) ||
+ while (test(EXPLICIT) || test(INLINE) || test(STATIC) ||
(test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual
|| testFunctionAttribute(def)) {}
bool tilde = test(TILDE);
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index d66791f..488f068 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -1157,6 +1157,13 @@ void tst_Moc::constructors()
QObject *o3 = mo->newInstance(Q_ARG(QString, str));
QVERIFY(o3 != 0);
QCOMPARE(qobject_cast(o3)->m_str, str);
+
+ {
+ //explicit constructor
+ QObject *o = QObject::staticMetaObject.newInstance();
+ QVERIFY(o);
+ delete o;
+ }
}
#include "task234909.h"
--
cgit v0.12
From 776c4a5b8035b87d011b8e431c3d9e970ad98cd9 Mon Sep 17 00:00:00 2001
From: Kent Hansen
Date: Thu, 30 Jul 2009 10:44:15 +0200
Subject: fix two bugs in the custom script class example
1) fromScriptValue() needs to call qvariant_cast() on the data, in
order to be symmetric with toScriptValue().
2) use the overload of newFunction() that takes a prototype object,
so that the prototype.constructor and constructor.prototype
relationship is set up correctly; otherwise the instanceof operator
won't work.
---
examples/script/customclass/bytearrayclass.cpp | 9 ++++++---
examples/script/customclass/main.cpp | 4 ++++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/examples/script/customclass/bytearrayclass.cpp b/examples/script/customclass/bytearrayclass.cpp
index 81a0b8a..2044a16 100644
--- a/examples/script/customclass/bytearrayclass.cpp
+++ b/examples/script/customclass/bytearrayclass.cpp
@@ -100,7 +100,7 @@ ByteArrayClass::ByteArrayClass(QScriptEngine *engine)
QScriptValue global = engine->globalObject();
proto.setPrototype(global.property("Object").property("prototype"));
- ctor = engine->newFunction(construct);
+ ctor = engine->newFunction(construct, proto);
ctor.setData(qScriptValueFromValue(engine, this));
}
//! [0]
@@ -224,7 +224,10 @@ QScriptValue ByteArrayClass::construct(QScriptContext *ctx, QScriptEngine *)
ByteArrayClass *cls = qscriptvalue_cast(ctx->callee().data());
if (!cls)
return QScriptValue();
- int size = ctx->argument(0).toInt32();
+ QScriptValue arg = ctx->argument(0);
+ if (arg.instanceOf(ctx->callee()))
+ return cls->newInstance(qscriptvalue_cast(arg));
+ int size = arg.toInt32();
return cls->newInstance(size);
}
//! [2]
@@ -240,7 +243,7 @@ QScriptValue ByteArrayClass::toScriptValue(QScriptEngine *eng, const QByteArray
void ByteArrayClass::fromScriptValue(const QScriptValue &obj, QByteArray &ba)
{
- ba = qscriptvalue_cast(obj.data());
+ ba = qvariant_cast(obj.data().toVariant());
}
diff --git a/examples/script/customclass/main.cpp b/examples/script/customclass/main.cpp
index 05aefd5..3b98f5c 100644
--- a/examples/script/customclass/main.cpp
+++ b/examples/script/customclass/main.cpp
@@ -52,6 +52,7 @@ int main(int argc, char **argv)
eng.globalObject().setProperty("ByteArray", baClass->constructor());
qDebug() << "ba = new ByteArray(4):" << eng.evaluate("ba = new ByteArray(4)").toString();
+ qDebug() << "ba instanceof ByteArray:" << eng.evaluate("ba instanceof ByteArray").toBool();
qDebug() << "ba.length:" << eng.evaluate("ba.length").toNumber();
qDebug() << "ba[1] = 123; ba[1]:" << eng.evaluate("ba[1] = 123; ba[1]").toNumber();
qDebug() << "ba[7] = 224; ba.length:" << eng.evaluate("ba[7] = 224; ba.length").toNumber();
@@ -65,6 +66,9 @@ int main(int argc, char **argv)
qDebug() << "ba.toBase64().toLatin1String():" << eng.evaluate("b64.toLatin1String()").toString();
qDebug() << "ba.valueOf():" << eng.evaluate("ba.valueOf()").toString();
qDebug() << "ba.chop(2); ba.length:" << eng.evaluate("ba.chop(2); ba.length").toNumber();
+ qDebug() << "ba2 = new ByteArray(ba):" << eng.evaluate("ba2 = new ByteArray(ba)").toString();
+ qDebug() << "ba2.equals(ba):" << eng.evaluate("ba2.equals(ba)").toBool();
+ qDebug() << "ba2.equals(new ByteArray()):" << eng.evaluate("ba2.equals(new ByteArray())").toBool();
return 0;
}
--
cgit v0.12
From e181f8754bccb13cb59212f279e05c20cb76db62 Mon Sep 17 00:00:00 2001
From: Leonardo Sobral Cunha
Date: Thu, 30 Jul 2009 12:09:16 +0200
Subject: Avoids comparing a pointer (d->layout) after deleted in
qgraphicswidget
Reviewed-by: ogoffart
---
src/gui/graphicsview/qgraphicswidget.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 3ea80ce..cb8336d 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -258,7 +258,6 @@ QGraphicsWidget::~QGraphicsWidget()
//we check if we have a layout previously
if (d->layout) {
- delete d->layout;
foreach (QGraphicsItem * item, childItems()) {
// In case of a custom layout which doesn't remove and delete items, we ensure that
// the parent layout item does not point to the deleted layout. This code is here to
@@ -269,6 +268,7 @@ QGraphicsWidget::~QGraphicsWidget()
widget->setParentLayoutItem(0);
}
}
+ delete d->layout;
}
// Remove this graphics widget from widgetStyles
--
cgit v0.12
From fbe103bd39fcef2b873aae31dcfee9604237a95e Mon Sep 17 00:00:00 2001
From: Leonardo Sobral Cunha
Date: Thu, 30 Jul 2009 12:23:49 +0200
Subject: Revert "Avoids comparing a pointer (d->layout) after deleted in
qgraphicswidget"
This reverts commit e181f8754bccb13cb59212f279e05c20cb76db62.
This code is used for compatibility issues for custom layouts that
dont delete their children, so its a false positive from coverity.
---
src/gui/graphicsview/qgraphicswidget.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index cb8336d..3ea80ce 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -258,6 +258,7 @@ QGraphicsWidget::~QGraphicsWidget()
//we check if we have a layout previously
if (d->layout) {
+ delete d->layout;
foreach (QGraphicsItem * item, childItems()) {
// In case of a custom layout which doesn't remove and delete items, we ensure that
// the parent layout item does not point to the deleted layout. This code is here to
@@ -268,7 +269,6 @@ QGraphicsWidget::~QGraphicsWidget()
widget->setParentLayoutItem(0);
}
}
- delete d->layout;
}
// Remove this graphics widget from widgetStyles
--
cgit v0.12
From 04f7834fcd8db4ecb6a4c53de42ac83f571b37c8 Mon Sep 17 00:00:00 2001
From: Thiago Macieira
Date: Thu, 30 Jul 2009 12:58:06 +0200
Subject: Fix compilation on AIX: -I/usr/include cannot be used.
The reason is that the C++ compiler needs to add -I/usr/vacpp/include
before -I/usr/include, so our adding of -I/usr/include changes the order.
This causes a compilation error in the C++ header xlocinfo.h.
In any case, these checks done in qmake are unnecessary. If the OpenSSL
headers are in one of those include paths, they will be found on their
own already.
Reviewed-By: Bradley T. Hughes
---
config.tests/unix/openssl/openssl.pri | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/config.tests/unix/openssl/openssl.pri b/config.tests/unix/openssl/openssl.pri
index bc95479..f069396 100644
--- a/config.tests/unix/openssl/openssl.pri
+++ b/config.tests/unix/openssl/openssl.pri
@@ -1,9 +1,3 @@
-!cross_compile {
- TRY_INCLUDEPATHS = /include /usr/include /usr/local/include $$QMAKE_INCDIR $$INCLUDEPATH
- # LSB doesn't allow using headers from /include or /usr/include
- linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$INCLUDEPATH
- for(p, TRY_INCLUDEPATHS) {
- pp = $$join(p, "", "", "/openssl")
- exists($$pp):INCLUDEPATH *= $$p
- }
-}
+# Empty file since Qt 4.6
+# I'm too lazy to find all places where this file is included
+
--
cgit v0.12
From 1fa620be2794b46a9b5d867ae6b2d7fa844b610c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20S=C3=B8rvig?=
Date: Thu, 30 Jul 2009 13:41:34 +0200
Subject: Mac: Fix crash in QCoreTextFontEngineMulti when disabling font
kerning.
CFDictionaryAddValue expects a CFNumberRef, not a pointer-to-CFNumberRef.
Reviewed-by: TrustMe
---
src/gui/text/qfontengine_mac.mm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 72e5175..b16fd7e 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -156,7 +156,7 @@ QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const ATSFontFamilyRef &, con
if (!kerning) {
float zero = 0.0;
QCFType noKern = CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &zero);
- CFDictionaryAddValue(attributeDict, kCTKernAttributeName, &noKern);
+ CFDictionaryAddValue(attributeDict, kCTKernAttributeName, noKern);
}
QCoreTextFontEngine *fe = new QCoreTextFontEngine(ctfont, fontDef, this);
--
cgit v0.12
From 9fb11e5c2e8127e2916e1cf9b51f676effc9d31e Mon Sep 17 00:00:00 2001
From: Gunnar Sletta
Date: Thu, 30 Jul 2009 13:55:17 +0200
Subject: Reviewed-by: Thomas H.
Squashed commit of the following:
commit fcf7e8cab339d0cf9f3f2a9756d7754c54c4d934
Author: Gunnar Sletta
Date: Thu Jul 30 13:15:13 2009 +0200
note in the changes file...
commit 2c9c3880215988e6609c290a8e738b228736e601
Author: Gunnar Sletta
Date: Thu Jul 30 12:51:42 2009 +0200
Don't leak native window HRGN handles
commit 6bb30d2075dd1d71a8a600d25f413a38af7f2f2c
Author: Gunnar Sletta
Date: Thu Jul 30 11:09:22 2009 +0200
Moved qregion_wince.cpp -> qregion_win.cpp, platforms are identical now
commit 173fcc5baec73a198167985c6f777987e6015a71
Author: Gunnar Sletta
Date: Thu Jul 30 09:42:06 2009 +0200
win32 calls on QRegion.handle() is no longer supported, use from HRGN
commit d7ddcce4ba29b70ed81f85274208b388a2bb9d4d
Author: Gunnar Sletta
Date: Thu Jul 30 09:41:37 2009 +0200
Added convenience function to convert from HRGN to QRegion
commit 2fc53ac3d59a9c42bb4154fff7557610092b7946
Author: Gunnar Sletta
Date: Wed Jul 29 09:28:10 2009 +0200
Kill qregion_win.cpp and use the unix code instead
---
dist/changes-4.6.0 | 67 ++---
src/gui/painting/painting.pri | 8 +-
src/gui/painting/qregion.cpp | 28 +-
src/gui/painting/qregion.h | 4 +-
src/gui/painting/qregion_win.cpp | 514 ++++---------------------------------
src/gui/painting/qregion_wince.cpp | 119 ---------
src/gui/styles/qwindowsxpstyle.cpp | 18 +-
7 files changed, 109 insertions(+), 649 deletions(-)
delete mode 100644 src/gui/painting/qregion_wince.cpp
diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0
index 383c6b7..7a6decf 100644
--- a/dist/changes-4.6.0
+++ b/dist/changes-4.6.0
@@ -34,9 +34,15 @@ information about a particular change.
- Significant external contribution from Milan Burda for planned removal
of (non-unicode) Windows 9x/ME support.
+ - QRegion is no longer a GDI object by default. This means it is no
+ longer subjuect to gui-thread only nor does it potentially impact
+ the 10.000 GDI object limit per process. By explicitly calling
+ .handle() a GDI object will be created and memory managed by
+ QRegion. The native handle is for reading out only. Any GDI calls
+ made on the HRGN handle will not affect the QRegion.
****************************************************************************
-* Important Behavior Changes *
+* Important Behavior Changes *
****************************************************************************
- The experimental Direct3D paint engine has been removed. The reason for
@@ -71,33 +77,32 @@ information about a particular change.
QGraphicsItem::ItemSendsGeometryChanges (which is enabled by default by
QGraphicsWidget and QGraphicsProxyWidget).
-- QDesktopWidget on X11 no longer emits the resized(int) signal when screens
- are added or removed. This was not done on other platforms. Use the
- screenCountChanged signal instead
-
-- QUrl's parser is more strict when for hostnames in URLs. QUrl now
- enforces STD 3 rules:
-
- * each individual hostname section (between dots) must be at most
- 63 ASCII characters in length;
-
- * only letters, digits, and the hyphen character are allowed in the
- ASCII range; letters outside the ASCII range follow the normal
- IDN rules
-
- That means QUrl no longer accepts some URLs that were invalid
- before, but weren't interpreted as such.
-
-- The Unix configure-time check for STL is stricter now in Qt
- 4.6.0. This means some legacy STL implementations may fail to pass
- the test and, therefore, Qt will automatically disable STL support.
-
- This is a binary-compatible change: existing code will continue to
- work without being recompiled. However, it affects the source code,
- since some STL-compatibility API will not be enabled.
-
- Platforms affected by this change:
- * solaris-cc-* with the default (Cstd) C++ STL library
- recommendation: use -library=stlport4
- See Sun Studio's documentation for the effects of this option
-
+ - QDesktopWidget on X11 no longer emits the resized(int) signal when screens
+ are added or removed. This was not done on other platforms. Use the
+ screenCountChanged signal instead
+
+ - QUrl's parser is more strict when for hostnames in URLs. QUrl now
+ enforces STD 3 rules:
+
+ * each individual hostname section (between dots) must be at most
+ 63 ASCII characters in length;
+
+ * only letters, digits, and the hyphen character are allowed in the
+ ASCII range; letters outside the ASCII range follow the normal
+ IDN rules
+
+ That means QUrl no longer accepts some URLs that were invalid
+ before, but weren't interpreted as such.
+
+ - The Unix configure-time check for STL is stricter now in Qt
+ 4.6.0. This means some legacy STL implementations may fail to pass
+ the test and, therefore, Qt will automatically disable STL support.
+
+ This is a binary-compatible change: existing code will continue to
+ work without being recompiled. However, it affects the source code,
+ since some STL-compatibility API will not be enabled.
+
+ Platforms affected by this change:
+ * solaris-cc-* with the default (Cstd) C++ STL library
+ recommendation: use -library=stlport4
+ See Sun Studio's documentation for the effects of this option
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 34d1779..d226be2 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -100,8 +100,8 @@ win32 {
painting/qcolormap_win.cpp \
painting/qpaintdevice_win.cpp \
painting/qprintengine_win.cpp \
- painting/qprinterinfo_win.cpp \
- painting/qregion_win.cpp
+ painting/qprinterinfo_win.cpp
+
!win32-borland:!wince*:LIBS += -lmsimg32
}
@@ -126,10 +126,6 @@ embedded {
painting/qwindowsurface_raster.cpp \
}
-wince* {
- SOURCES -= painting/qregion_win.cpp
-}
-
unix:x11 {
HEADERS += \
painting/qpaintengine_x11_p.h
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 762e9e0..d59f3ff 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -49,7 +49,7 @@
#include
-#if defined(Q_OS_UNIX) || defined(Q_OS_WINCE)
+#if defined(Q_OS_UNIX) || defined(Q_WS_WIN)
#include "qimage.h"
#include "qbitmap.h"
#include
@@ -545,7 +545,7 @@ QRegion& QRegion::operator|=(const QRegion &r)
\sa intersected()
*/
-#if !defined (Q_OS_UNIX) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_UNIX) && !defined (Q_WS_WIN)
QRegion& QRegion::operator+=(const QRect &r)
{
return operator+=(QRegion(r));
@@ -561,16 +561,14 @@ QRegion& QRegion::operator+=(const QRect &r)
\sa intersected()
*/
-#if !defined(Q_WS_WIN) || defined(Q_OS_WINCE)
QRegion& QRegion::operator&=(const QRegion &r)
{ return *this = *this & r; }
-#endif
/*!
\overload
\since 4.4
*/
-#if defined (Q_OS_UNIX) || defined (Q_OS_WINCE)
+#if defined (Q_OS_UNIX) || defined (Q_WS_WIN)
QRegion& QRegion::operator&=(const QRect &r)
{
return *this = *this & r;
@@ -591,10 +589,8 @@ QRegion& QRegion::operator&=(const QRect &r)
\sa subtracted()
*/
-#if !defined(Q_WS_WIN) || defined(Q_OS_WINCE)
QRegion& QRegion::operator-=(const QRegion &r)
{ return *this = *this - r; }
-#endif
/*!
Applies the xored() function to this region and \a r and
@@ -731,7 +727,7 @@ bool QRegion::intersects(const QRect &rect) const
return false;
}
-#if !defined (Q_OS_UNIX) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_UNIX) && !defined (Q_WS_WIN)
/*!
\overload
\since 4.4
@@ -1086,7 +1082,7 @@ Q_AUTOTEST_EXPORT QPainterPath qt_regionToPath(const QRegion ®ion)
return result;
}
-#if defined(Q_OS_UNIX) || defined(Q_OS_WINCE)
+#if defined(Q_OS_UNIX) || defined(Q_WS_WIN)
//#define QT_REGION_DEBUG
/*
@@ -1627,9 +1623,9 @@ QT_END_INCLUDE_NAMESPACE
QT_BEGIN_INCLUDE_NAMESPACE
# include "qregion_mac.cpp"
QT_END_INCLUDE_NAMESPACE
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_WS_WIN)
QT_BEGIN_INCLUDE_NAMESPACE
-# include "qregion_wince.cpp"
+# include "qregion_win.cpp"
QT_END_INCLUDE_NAMESPACE
#elif defined(Q_WS_QWS)
static QRegionPrivate qrp;
@@ -3829,7 +3825,7 @@ QRegion::QRegion(const QRect &r, RegionType t)
#if defined(Q_WS_X11)
d->rgn = 0;
d->xrectangles = 0;
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_WS_WIN)
d->rgn = 0;
#endif
if (t == Rectangle) {
@@ -3851,7 +3847,7 @@ QRegion::QRegion(const QPolygon &a, Qt::FillRule fillRule)
#if defined(Q_WS_X11)
d->rgn = 0;
d->xrectangles = 0;
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_WS_WIN)
d->rgn = 0;
#endif
d->qt_rgn = PolygonRegion(a.constData(), a.size(),
@@ -3881,7 +3877,7 @@ QRegion::QRegion(const QBitmap &bm)
#if defined(Q_WS_X11)
d->rgn = 0;
d->xrectangles = 0;
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_WS_WIN)
d->rgn = 0;
#endif
d->qt_rgn = qt_bitmapToRegion(bm);
@@ -3896,7 +3892,7 @@ void QRegion::cleanUp(QRegion::QRegionData *x)
XDestroyRegion(x->rgn);
if (x->xrectangles)
free(x->xrectangles);
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_WS_WIN)
if (x->rgn)
qt_win_dispose_rgn(x->rgn);
#endif
@@ -3932,7 +3928,7 @@ QRegion QRegion::copy() const
#if defined(Q_WS_X11)
x->rgn = 0;
x->xrectangles = 0;
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_WS_WIN)
x->rgn = 0;
#endif
if (d->qt_rgn)
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index bfedcb1..1db07a1 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -59,7 +59,7 @@ QT_MODULE(Gui)
template class QVector;
class QVariant;
-#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_WINCE)
+#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN)
struct QRegionPrivate;
#endif
@@ -199,7 +199,7 @@ private:
#elif defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
mutable RgnHandle unused; // Here for binary compatability reasons. ### Qt 5 remove.
#endif
-#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_WINCE)
+#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN)
QRegionPrivate *qt_rgn;
#endif
};
diff --git a/src/gui/painting/qregion_win.cpp b/src/gui/painting/qregion_win.cpp
index 249b1a6..2d5e76b 100644
--- a/src/gui/painting/qregion_win.cpp
+++ b/src/gui/painting/qregion_win.cpp
@@ -39,27 +39,25 @@
**
****************************************************************************/
+#include "qatomic.h"
#include "qbitmap.h"
#include "qbuffer.h"
#include "qimage.h"
#include "qpolygon.h"
#include "qregion.h"
#include "qt_windows.h"
+#include "qpainterpath.h"
+#include "qguifunctions_wince.h"
QT_BEGIN_NAMESPACE
+QRegion::QRegionData QRegion::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0 };
-/*
- In Windows versions before Windows Vista CreateRectRgn - when called in a multi-threaded
- environment - might return an invalid handle. This function works around this limitation
- by verifying the handle with a quick GetRegionData() call and re-creates the region
- if necessary.
-*/
HRGN qt_tryCreateRegion(QRegion::RegionType type, int left, int top, int right, int bottom)
{
const int tries = 10;
for (int i = 0; i < tries; ++i) {
- HRGN region = 0;
+ HRGN region;
switch (type) {
case QRegion::Rectangle:
region = CreateRectRgn(left, top, right, bottom);
@@ -80,497 +78,73 @@ HRGN qt_tryCreateRegion(QRegion::RegionType type, int left, int top, int right,
return 0;
}
-#ifndef Q_OS_WINCE
-HRGN qt_tryCreatePolygonRegion(const QPolygon &a, Qt::FillRule fillRule)
-{
- const int tries = 10;
- for (int i = 0; i < tries; ++i) {
- HRGN region = CreatePolygonRgn(reinterpret_cast(a.data()), a.size(),
- fillRule == Qt::OddEvenFill ? ALTERNATE : WINDING);
- if (region) {
- if (GetRegionData(region, 0, 0))
- return region;
- else
- DeleteObject(region);
- }
- }
- return 0;
-}
-#endif
-
-QRegion::QRegionData QRegion::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1), 0 };
-
-QRegion::QRegion()
- : d(&shared_empty)
-{
- d->ref.ref();
-}
-
-#ifndef Q_OS_WINCE //implementation for WindowsCE in qregion_wce.cpp
-QRegion::QRegion(const QRect &r, RegionType t)
-{
- if (r.isEmpty()) {
- d = &shared_empty;
- d->ref.ref();
- } else {
- d = new QRegionData;
- d->ref = 1;
- if (t == Rectangle)
- d->rgn = qt_tryCreateRegion(t, r.left(), r.top(), r.x() + r.width(), r.y() + r.height());
- else if (t == Ellipse) {
- // need to add 1 to width/height for the ellipse to have correct boundingrect.
- d->rgn = qt_tryCreateRegion(t, r.x(), r.y(), r.x() + r.width() + 1, r.y() + r.height() + 1);
- }
- }
-}
-#endif
-
-#ifndef Q_OS_WINCE //implementation for WindowsCE in qregion_wce.cpp
-QRegion::QRegion(const QPolygon &a, Qt::FillRule fillRule)
-{
- if (a.size() < 3) {
- d = &shared_empty;
- d->ref.ref();
- } else {
- d = new QRegionData;
- d->ref = 1;
- d->rgn = qt_tryCreatePolygonRegion(a, fillRule);
- }
-}
-#endif
-
-QRegion::QRegion(const QRegion &r)
-{
- d = r.d;
- d->ref.ref();
-}
-
-HRGN qt_win_bitmapToRegion(const QBitmap& bitmap)
-{
- HRGN region=0;
- QImage image = bitmap.toImage();
- const int MAXRECT = 256;
- struct RData {
- RGNDATAHEADER header;
- RECT rect[MAXRECT];
- };
- RData data;
-
-#define FlushSpans \
- { \
- data.header.dwSize = sizeof(RGNDATAHEADER); \
- data.header.iType = RDH_RECTANGLES; \
- data.header.nCount = n; \
- data.header.nRgnSize = 0; \
- data.header.rcBound.bottom = y; \
- HRGN r = ExtCreateRegion(0, \
- sizeof(RGNDATAHEADER)+n*sizeof(RECT),(RGNDATA*)&data); \
- if (region) { \
- CombineRgn(region, region, r, RGN_OR); \
- DeleteObject(r); \
- } else { \
- region = r; \
- } \
- data.header.rcBound.top = y; \
- }
-
-#define AddSpan \
- { \
- data.rect[n].left=prev1; \
- data.rect[n].top=y; \
- data.rect[n].right=x-1+1; \
- data.rect[n].bottom=y+1; \
- n++; \
- if (n == MAXRECT) { \
- FlushSpans \
- n=0; \
- } \
- }
-
- data.header.rcBound.top = 0;
- data.header.rcBound.left = 0;
- data.header.rcBound.right = image.width()-1;
- int n = 0;
-
- int zero = 0x00;
-
- int x, y;
- for (y = 0; y < image.height(); ++y) {
- uchar *line = image.scanLine(y);
- int w = image.width();
- uchar all=zero;
- int prev1 = -1;
- for (x = 0; x < w;) {
- uchar byte = line[x/8];
- if (x > w - 8 || byte != all) {
- for (int b = 8; b > 0 && x < w; --b) {
- if (!(byte & 0x01) == !all) {
- // More of the same
- } else {
- // A change.
- if (all != zero) {
- AddSpan;
- all = zero;
- } else {
- prev1 = x;
- all = ~zero;
- }
- }
- byte >>= 1;
- ++x;
- }
- } else {
- x += 8;
- }
- }
- if (all != zero) {
- AddSpan;
- }
- }
- if (n) {
- FlushSpans;
- }
-
- if (!region) {
- // Surely there is some better way.
- region = qt_tryCreateRegion(QRegion::Rectangle, 0,0,1,1);
- CombineRgn(region, region, region, RGN_XOR);
- }
- return region;
-}
-
-#ifndef Q_OS_WINCE //implementation for WindowsCE in qregion_wce.cpp
-QRegion::QRegion(const QBitmap &bm)
-{
- if (bm.isNull()) {
- d = &shared_empty;
- d->ref.ref();
- } else {
- d = new QRegionData;
- d->ref = 1;
- d->rgn = qt_win_bitmapToRegion(bm);
- }
-}
-#endif
-
-void QRegion::cleanUp(QRegion::QRegionData *x)
-{
- if (x->rgn)
- DeleteObject(x->rgn);
- delete x;
-}
-
-QRegion::~QRegion()
-{
- if (!d->ref.deref())
- cleanUp(d);
-}
-
-QRegion &QRegion::operator=(const QRegion &r)
-{
- r.d->ref.ref();
- if (!d->ref.deref())
- cleanUp(d);
- d = r.d;
- return *this;
-}
-
-
-QRegion QRegion::copy() const
-{
- QRegion r;
- QRegionData *x = new QRegionData;
- x->ref = 1;
- if (d->rgn) {
- x->rgn = qt_tryCreateRegion(QRegion::Rectangle, 0, 0, 2, 2);
- CombineRgn(x->rgn, d->rgn, 0, RGN_COPY);
- } else {
- x->rgn = 0;
- }
- if (!r.d->ref.deref())
- cleanUp(r.d);
- r.d = x;
- return r;
-}
-
-bool QRegion::isEmpty() const
-{
- return (d == &shared_empty || boundingRect().isEmpty());
-}
-
-
-bool QRegion::contains(const QPoint &p) const
-{
- return d->rgn ? PtInRegion(d->rgn, p.x(), p.y()) : false;
-}
-
-bool QRegion::contains(const QRect &r) const
-{
- if (!d->rgn)
- return false;
- RECT rect;
- SetRect(&rect, r.left(), r.top(), r.right(), r.bottom());
- return RectInRegion(d->rgn, &rect);
-}
-
-
-void QRegion::translate(int dx, int dy)
-{
- if (!d->rgn || (dx == 0 && dy == 0))
- return;
- detach();
- OffsetRgn(d->rgn, dx, dy);
-}
-
-
-#define RGN_NOP -1
-
-// Duplicates of those in qregion.cpp
-#define QRGN_OR 6
-#define QRGN_AND 7
-#define QRGN_SUB 8
-#define QRGN_XOR 9
-
-/*
- Performs the actual OR, AND, SUB and XOR operation between regions.
- Sets the resulting region handle to 0 to indicate an empty region.
-*/
-
-QRegion QRegion::winCombine(const QRegion &r, int op) const
+QRegion qt_region_from_HRGN(HRGN rgn)
{
- int both=RGN_NOP,
- left=RGN_NOP,
- right=RGN_NOP;
- switch (op) {
- case QRGN_OR:
- both = RGN_OR;
- left = right = RGN_COPY;
- break;
- case QRGN_AND:
- both = RGN_AND;
- break;
- case QRGN_SUB:
- both = RGN_DIFF;
- left = RGN_COPY;
- break;
- case QRGN_XOR:
- both = RGN_XOR;
- left = right = RGN_COPY;
- break;
- default:
- qWarning("QRegion: Internal error in winCombine");
- }
-
- int allCombineRgnResults = NULLREGION;
- QRegion result;
- result.detach();
- result.d->rgn = qt_tryCreateRegion(QRegion::Rectangle, 0, 0, 0, 0);
- if (d->rgn && r.d->rgn)
- allCombineRgnResults = CombineRgn(result.d->rgn, d->rgn, r.d->rgn, both);
- else if (d->rgn && left != RGN_NOP)
- allCombineRgnResults = CombineRgn(result.d->rgn, d->rgn, d->rgn, left);
- else if (r.d->rgn && right != RGN_NOP)
- allCombineRgnResults = CombineRgn(result.d->rgn, r.d->rgn, r.d->rgn, right);
-
- if (allCombineRgnResults == NULLREGION || allCombineRgnResults == ERROR)
- result = QRegion();
-
- //##### do not delete this. A null pointer is different from an empty region in SelectClipRgn in qpainter_win! (M)
-// if (allCombineRgnResults == NULLREGION) {
-// if (result.data->rgn)
-// DeleteObject(result.data->rgn);
-// result.data->rgn = 0; // empty region
-// }
- return result;
-}
-
-QRegion QRegion::unite(const QRegion &r) const
-{
- if (!d->rgn)
- return r;
- if (!r.d->rgn)
- return *this;
- return winCombine(r, QRGN_OR);
-}
-
-QRegion QRegion::unite(const QRect &r) const
-{
- return unite(QRegion(r));
-}
-
-QRegion QRegion::intersect(const QRegion &r) const
-{
- if (!r.d->rgn || !d->rgn)
- return QRegion();
- return winCombine(r, QRGN_AND);
-}
-
-QRegion QRegion::subtract(const QRegion &r) const
-{
- if (!r.d->rgn || !d->rgn)
- return *this;
- return winCombine(r, QRGN_SUB);
-}
-
-QRegion QRegion::eor(const QRegion &r) const
-{
- if (!d->rgn)
- return r;
- if (!r.d->rgn)
- return *this;
- return winCombine(r, QRGN_XOR);
-}
-
-
-QRect QRegion::boundingRect() const
-{
- if (!d->rgn)
- return QRect();
- RECT r;
- if (GetRgnBox(d->rgn, &r) == NULLREGION)
- return QRect();
- else
- return QRect(r.left, r.top, r.right - r.left, r.bottom - r.top);
-}
-
-QVector QRegion::rects() const
-{
- if (d->rgn == 0)
- return QVector();
-
- int numBytes = GetRegionData(d->rgn, 0, 0);
+ int numBytes = GetRegionData(rgn, 0, 0);
if (numBytes == 0)
- return QVector();
+ return QRegion();
char *buf = new char[numBytes];
if (buf == 0)
- return QVector();
+ return QRegion();
RGNDATA *rd = reinterpret_cast(buf);
- if (GetRegionData(d->rgn, numBytes, rd) == 0) {
+ if (GetRegionData(rgn, numBytes, rd) == 0) {
delete [] buf;
- return QVector();
+ return QRegion();
}
- QVector a(rd->rdh.nCount);
+ QRegion region;
RECT *r = reinterpret_cast(rd->Buffer);
- for (int i = 0; i < a.size(); ++i) {
- a[i].setCoords(r->left, r->top, r->right - 1, r->bottom - 1);
+ for (int i = 0; i < rd->rdh.nCount; ++i) {
+ QRect rect;
+ rect.setCoords(r->left, r->top, r->right - 1, r->bottom - 1);
++r;
+ region |= rect;
}
delete [] buf;
- return a;
-}
-
-void QRegion::setRects(const QRect *rects, int num)
-{
- *this = QRegion();
- if (!rects || num == 0 || (num == 1 && rects->isEmpty()))
- return;
- for (int i = 0; i < num; ++i)
- *this |= rects[i];
-}
-
-int QRegion::numRects() const
-{
- if (d->rgn == 0)
- return 0;
-
- const int numBytes = GetRegionData(d->rgn, 0, 0);
- if (numBytes == 0)
- return 0;
-
- char *buf = new char[numBytes];
- if (buf == 0)
- return 0;
-
- RGNDATA *rd = reinterpret_cast(buf);
- if (GetRegionData(d->rgn, numBytes, rd) == 0) {
- delete[] buf;
- return 0;
- }
-
- const int n = rd->rdh.nCount;
- delete[] buf;
- return n;
+ return region;
}
-bool QRegion::operator==(const QRegion &r) const
+void qt_win_dispose_rgn(HRGN r)
{
- if (d == r.d)
- return true;
- if ((d->rgn == 0) ^ (r.d->rgn == 0)) // one is empty, not both
- return false;
- return d->rgn == 0 ? true // both empty
- : EqualRgn(d->rgn, r.d->rgn); // both non-empty
+ if (r)
+ DeleteObject(r);
}
-QRegion& QRegion::operator+=(const QRegion &r)
+static void qt_add_rect(HRGN &winRegion, QRect r)
{
- if (!r.d->rgn)
- return *this;
-
- if (!d->rgn) {
- *this = r;
- return *this;
+ HRGN rgn = CreateRectRgn(r.left(), r.top(), r.x() + r.width(), r.y() + r.height());
+ if (rgn) {
+ HRGN dest = CreateRectRgn(0,0,0,0);
+ int result = CombineRgn(dest, winRegion, rgn, RGN_OR);
+ if (result) {
+ DeleteObject(winRegion);
+ winRegion = dest;
+ }
+ DeleteObject(rgn);
}
-
- detach();
-
- int result;
- result = CombineRgn(d->rgn, d->rgn, r.d->rgn, RGN_OR);
- if (result == NULLREGION || result == ERROR)
- *this = QRegion();
-
- return *this;
-}
-
-QRegion& QRegion::operator-=(const QRegion &r)
-{
- if (!r.d->rgn || !d->rgn)
- return *this;
-
- detach();
-
- int result;
- result = CombineRgn(d->rgn, d->rgn, r.d->rgn, RGN_DIFF);
- if (result == NULLREGION || result == ERROR)
- *this = QRegion();
-
- return *this;
}
-QRegion& QRegion::operator&=(const QRegion &r)
+void QRegion::ensureHandle() const
{
- if (!d->rgn)
- return *this;
-
- if (!r.d->rgn) {
- *this = QRegion();
- return *this;
+ if (d->rgn)
+ DeleteObject(d->rgn);
+ d->rgn = CreateRectRgn(0,0,0,0);
+ if (d->qt_rgn) {
+ if (d->qt_rgn->numRects == 1) {
+ QRect r = d->qt_rgn->extents;
+ qt_add_rect(d->rgn, r);
+ return;
+ }
+ for (int i = 0;i < d->qt_rgn->numRects;i++) {
+ QRect r = d->qt_rgn->rects.at(i);
+ qt_add_rect(d->rgn, r);
+ }
}
-
- detach();
-
- int result;
- result = CombineRgn(d->rgn, d->rgn, r.d->rgn, RGN_AND);
- if (result == NULLREGION || result == ERROR)
- *this = QRegion();
-
- return *this;
-}
-
-bool qt_region_strictContains(const QRegion ®ion, const QRect &rect)
-{
- Q_UNUSED(region);
- Q_UNUSED(rect);
- return false;
}
-void QRegion::ensureHandle() const
-{
-}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qregion_wince.cpp b/src/gui/painting/qregion_wince.cpp
deleted file mode 100644
index 9c33123..0000000
--- a/src/gui/painting/qregion_wince.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qatomic.h"
-#include "qbitmap.h"
-#include "qbuffer.h"
-#include "qimage.h"
-#include "qpolygon.h"
-#include "qregion.h"
-#include "qt_windows.h"
-#include "qpainterpath.h"
-#include "qguifunctions_wince.h"
-
-QT_BEGIN_NAMESPACE
-
-QRegion::QRegionData QRegion::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0 };
-
-HRGN qt_tryCreateRegion(QRegion::RegionType type, int left, int top, int right, int bottom)
-{
- const int tries = 10;
- for (int i = 0; i < tries; ++i) {
- HRGN region;
- switch (type) {
- case QRegion::Rectangle:
- region = CreateRectRgn(left, top, right, bottom);
- break;
- case QRegion::Ellipse:
-#ifndef Q_OS_WINCE
- region = CreateEllipticRgn(left, top, right, bottom);
-#endif
- break;
- }
- if (region) {
- if (GetRegionData(region, 0, 0))
- return region;
- else
- DeleteObject(region);
- }
- }
- return 0;
-}
-
-void qt_win_dispose_rgn(HRGN r)
-{
- if (r)
- DeleteObject(r);
-}
-
-static void qt_add_rect(HRGN &winRegion, QRect r)
-{
- HRGN rgn = CreateRectRgn(r.left(), r.top(), r.x() + r.width(), r.y() + r.height());
- if (rgn) {
- HRGN dest = CreateRectRgn(0,0,0,0);
- int result = CombineRgn(dest, winRegion, rgn, RGN_OR);
- if (result) {
- DeleteObject(winRegion);
- winRegion = dest;
- }
- }
-}
-
-void QRegion::ensureHandle() const
-{
- if (d->rgn)
- DeleteObject(d->rgn);
- d->rgn = CreateRectRgn(0,0,0,0);
- if (d->qt_rgn) {
- if (d->qt_rgn->numRects == 1) {
- QRect r = d->qt_rgn->extents;
- qt_add_rect(d->rgn, r);
- return;
- }
- for (int i = 0;i < d->qt_rgn->numRects;i++) {
- QRect r = d->qt_rgn->rects.at(i);
- qt_add_rect(d->rgn, r);
- }
- }
-}
-
-
-QT_END_NAMESPACE
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 9560c4b..ad87354 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -134,6 +134,7 @@ static const int windowsRightBorder = 12; // right border on windows
// External function calls
extern Q_GUI_EXPORT HDC qt_win_display_dc();
+extern QRegion qt_region_from_HRGN(HRGN rgn);
@@ -445,6 +446,7 @@ bool QWindowsXPStylePrivate::isTransparent(XPThemeData &themeData)
themeData.stateId);
}
+
/*! \internal
Returns a QRegion of the region of the part
*/
@@ -456,12 +458,18 @@ QRegion QWindowsXPStylePrivate::region(XPThemeData &themeData)
themeData.stateId, &rect, &hRgn)))
return QRegion();
- QRegion rgn = QRegion(0,0,1,1);
- const bool success = CombineRgn(rgn.handle(), hRgn, 0, RGN_COPY) != ERROR;
- DeleteObject(hRgn);
+ HRGN dest = CreateRectRgn(0, 0, 0, 0);
+ const bool success = CombineRgn(dest, hRgn, 0, RGN_COPY) != ERROR;
+
+ QRegion region;
+
if (success)
- return rgn;
- return QRegion();
+ region = qt_region_from_HRGN(dest);
+
+ DeleteObject(hRgn);
+ DeleteObject(dest);
+
+ return region;
}
/*! \internal
--
cgit v0.12
From 66a3c503e8e99b8cd28c2fef2b0a869f27c7efe7 Mon Sep 17 00:00:00 2001
From: Kavindra Devi Palaraja
Date: Thu, 30 Jul 2009 13:59:57 +0200
Subject: Doc - some cleanups to beautify the paragraphs
Reviewed-By: TrustMe
---
src/gui/kernel/qapplication.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 5181689..109ceb1 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -179,11 +179,11 @@ QApplicationPrivate::~QApplicationPrivate()
QApplication contains the main event loop, where all events from the window
system and other sources are processed and dispatched. It also handles the
- application's initialization and finalization, and provides session
- management. In addition, it handles most system-wide and application-wide
- settings.
+ application's initialization, finalization, and provides session
+ management. In addition, QApplication handles most of the system-wide and
+ application-wide settings.
- For any GUI application using Qt, there is precisely one QApplication
+ For any GUI application using Qt, there is precisely \bold one QApplication
object, no matter whether the application has 0, 1, 2 or more windows at
any given time. For non-GUI Qt applications, use QCoreApplication instead,
as it does not depend on the \l QtGui library.
@@ -239,9 +239,9 @@ QApplicationPrivate::~QApplicationPrivate()
saveState() for details.
\endlist
- The QApplication object does so much initialization. Hence, it \e{must} be
+ Since the QApplication object does so much initialization, it \e{must} be
created before any other objects related to the user interface are created.
- Since QApplication also deals with common command line arguments, it is
+ QApplication also deals with common command line arguments. Hence, it is
usually a good idea to create it \e before any interpretation or
modification of \c argv is done in the application itself.
--
cgit v0.12
From e1851f3246fe307830173573fbbcf013e8a1b1e8 Mon Sep 17 00:00:00 2001
From: Richard Moe Gustavsen
Date: Thu, 30 Jul 2009 14:11:07 +0200
Subject: Remove mem leak / warning in the cocoaport
Remove mem leak / warning in the cocoaport
Reviewed-by: msorvig
---
src/gui/kernel/qwidget_mac.mm | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 0a31a28..8913c89 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -4674,6 +4674,7 @@ void QWidgetPrivate::setModal_sys()
OSWindowRef windowRef = qt_mac_window_for(q);
#ifdef QT_MAC_USE_COCOA
+ QMacCocoaAutoReleasePool pool;
bool alreadySheet = [windowRef styleMask] & NSDocModalWindowMask;
if (windowParent && q->windowModality() == Qt::WindowModal){
--
cgit v0.12
From 26e9f4e077c49d1191835def595e4fb70ee50be2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20S=C3=B8rvig?=
Date: Thu, 30 Jul 2009 14:19:50 +0200
Subject: Mac/Carbon: Fix issue causing update(QRegion) to fail on large
widgets.
HIViewSetNeedsDisplayInRegion fails on large regions with large
coordinates, fall back on updating the entire region in this case.
The task mentions coordinates outside the range of signed short, but
the provided example demonstrates failures in the 10-20K range as well.
---
src/gui/kernel/qwidget_mac.mm | 7 ++++++-
src/gui/painting/qregion.h | 1 +
src/gui/painting/qregion_mac.cpp | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 70eea3a..3bbf5d4 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3100,7 +3100,12 @@ void QWidgetPrivate::update_sys(const QRegion &rgn)
return;
dirtyOnWidget += rgn;
#ifndef QT_MAC_USE_COCOA
- HIViewSetNeedsDisplayInRegion(qt_mac_nativeview_for(q), QMacSmartQuickDrawRegion(rgn.toQDRgn()), true);
+ RgnHandle rgnHandle = rgn.toQDRgnForUpdate_sys();
+ if (rgnHandle)
+ HIViewSetNeedsDisplayInRegion(qt_mac_nativeview_for(q), QMacSmartQuickDrawRegion(rgnHandle), true);
+ else {
+ HIViewSetNeedsDisplay(qt_mac_nativeview_for(q), true); // do a complete repaint on overflow.
+ }
#else
// Cocoa doesn't do regions, it seems more efficient to just update the bounding rect instead of a potential number of message passes for each rect.
const QRect &boundingRect = rgn.boundingRect();
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index bfedcb1..6dfdc83 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -148,6 +148,7 @@ public:
#elif defined(Q_WS_MAC)
#if defined Q_WS_MAC32
RgnHandle toQDRgn() const;
+ RgnHandle toQDRgnForUpdate_sys() const;
static QRegion fromQDRgn(RgnHandle shape);
#endif
#ifdef QT_MAC_USE_COCOA
diff --git a/src/gui/painting/qregion_mac.cpp b/src/gui/painting/qregion_mac.cpp
index b57f234..9b0e99f 100644
--- a/src/gui/painting/qregion_mac.cpp
+++ b/src/gui/painting/qregion_mac.cpp
@@ -155,6 +155,44 @@ RgnHandle QRegion::toQDRgn() const
}
return rgnHandle;
}
+
+/*!
+ \internal
+ Create's a RegionHandle, it's the caller's responsibility to release.
+ Returns 0 if the QRegion overflows.
+*/
+RgnHandle QRegion::toQDRgnForUpdate_sys() const
+{
+ RgnHandle rgnHandle = qt_mac_get_rgn();
+ if(d->qt_rgn && d->qt_rgn->numRects) {
+ RgnHandle tmp_rgn = qt_mac_get_rgn();
+ int n = d->qt_rgn->numRects;
+ const QRect *qt_r = (n == 1) ? &d->qt_rgn->extents : d->qt_rgn->rects.constData();
+ while (n--) {
+
+ // detect overflow. Tested for use with HIViewSetNeedsDisplayInRegion
+ // in QWidgetPrivate::update_sys().
+ enum { HIViewSetNeedsDisplayInRegionOverflow = 10000 }; // empirically determined conservative value
+ qDebug() << qt_r->x() << qt_r->y() << qt_r->right() << qt_r->bottom();
+ if (qt_r->right() > HIViewSetNeedsDisplayInRegionOverflow || qt_r->bottom() > HIViewSetNeedsDisplayInRegionOverflow) {
+ qt_mac_dispose_rgn(tmp_rgn);
+ qt_mac_dispose_rgn(rgnHandle);
+ return 0;
+ }
+
+ SetRectRgn(tmp_rgn,
+ qMax(SHRT_MIN, qt_r->x()),
+ qMax(SHRT_MIN, qt_r->y()),
+ qMin(SHRT_MAX, qt_r->right() + 1),
+ qMin(SHRT_MAX, qt_r->bottom() + 1));
+ UnionRgn(rgnHandle, tmp_rgn, rgnHandle);
+ ++qt_r;
+ }
+ qt_mac_dispose_rgn(tmp_rgn);
+ }
+ return rgnHandle;
+}
+
#endif
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
--
cgit v0.12
From 9939ce88427b4d33f50b45a0da85266f9ee37927 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt
Date: Fri, 5 Jun 2009 16:59:17 +0200
Subject: Don't do two hash lookups in loadGlyphs()
loadGlyphs() has a big impact on text rendering speed on X11. Removing
the uneeded hash lookup makes this function go twice as fast, as it in
the common case (where the glyphs are already cached) the hash lookups are
100% of the running time of the function.
Reviewed-by: Trond
---
src/gui/text/qfontengine_ft.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index a0b6f0c..d210cb4 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -1378,8 +1378,8 @@ bool QFontEngineFT::loadGlyphs(QGlyphSet *gs, glyph_t *glyphs, int num_glyphs, G
FT_Face face = 0;
for (int i = 0; i < num_glyphs; ++i) {
- if (!gs->glyph_data.contains(glyphs[i])
- || gs->glyph_data.value(glyphs[i])->format != format) {
+ Glyph *glyph = gs->glyph_data.value(glyphs[i]);
+ if (glyph == 0 || glyph->format != format) {
if (!face) {
face = lockFace();
FT_Matrix m = matrix;
--
cgit v0.12
From aec91cf6fbfa6abd4a3548690fd22ebeb6237cf6 Mon Sep 17 00:00:00 2001
From: Gunnar Sletta
Date: Wed, 29 Jul 2009 12:15:57 +0200
Subject: updates...
---
.../data/qps/linear_gradients_perspectives_qps.png | Bin 78017 -> 77944 bytes
tests/arthur/data/qps/linear_gradients_qps.png | Bin 82119 -> 162643 bytes
tests/arthur/data/qps/lineconsistency_qps.png | Bin 12500 -> 12388 bytes
tests/arthur/data/qps/linedashes2_aa_qps.png | Bin 28956 -> 28418 bytes
tests/arthur/data/qps/paths_aa_qps.png | Bin 92711 -> 92147 bytes
tests/arthur/data/qps/paths_qps.png | Bin 20637 -> 20392 bytes
.../data/qps/radial_gradients_perspectives_qps.png | Bin 133150 -> 131744 bytes
tests/arthur/data/qps/radial_gradients_qps.png | Bin 156036 -> 161009 bytes
tests/arthur/data/qps/rasterops.qps | 167 +++++++++++----------
tests/arthur/data/qps/rasterops_qps.png | Bin 20400 -> 11059 bytes
tests/arthur/data/qps/text_perspectives_qps.png | Bin 112750 -> 116847 bytes
tests/arthur/data/qps/text_qps.png | Bin 72027 -> 32991 bytes
tests/arthur/lance/interactivewidget.cpp | 2 +-
tests/arthur/lance/lance.pro | 2 +-
tests/arthur/lance/main.cpp | 16 +-
tests/arthur/lance/widgets.h | 151 ++++++++++++++++++-
16 files changed, 234 insertions(+), 104 deletions(-)
diff --git a/tests/arthur/data/qps/linear_gradients_perspectives_qps.png b/tests/arthur/data/qps/linear_gradients_perspectives_qps.png
index 42ba872..3315ebe 100644
Binary files a/tests/arthur/data/qps/linear_gradients_perspectives_qps.png and b/tests/arthur/data/qps/linear_gradients_perspectives_qps.png differ
diff --git a/tests/arthur/data/qps/linear_gradients_qps.png b/tests/arthur/data/qps/linear_gradients_qps.png
index dc5223b..a4cdc43 100644
Binary files a/tests/arthur/data/qps/linear_gradients_qps.png and b/tests/arthur/data/qps/linear_gradients_qps.png differ
diff --git a/tests/arthur/data/qps/lineconsistency_qps.png b/tests/arthur/data/qps/lineconsistency_qps.png
index 48768ef..9d19a5d 100644
Binary files a/tests/arthur/data/qps/lineconsistency_qps.png and b/tests/arthur/data/qps/lineconsistency_qps.png differ
diff --git a/tests/arthur/data/qps/linedashes2_aa_qps.png b/tests/arthur/data/qps/linedashes2_aa_qps.png
index 0cb5b40..54c84b3 100644
Binary files a/tests/arthur/data/qps/linedashes2_aa_qps.png and b/tests/arthur/data/qps/linedashes2_aa_qps.png differ
diff --git a/tests/arthur/data/qps/paths_aa_qps.png b/tests/arthur/data/qps/paths_aa_qps.png
index 45b4b74..e51a4ac 100644
Binary files a/tests/arthur/data/qps/paths_aa_qps.png and b/tests/arthur/data/qps/paths_aa_qps.png differ
diff --git a/tests/arthur/data/qps/paths_qps.png b/tests/arthur/data/qps/paths_qps.png
index a9a8743..094a84f 100644
Binary files a/tests/arthur/data/qps/paths_qps.png and b/tests/arthur/data/qps/paths_qps.png differ
diff --git a/tests/arthur/data/qps/radial_gradients_perspectives_qps.png b/tests/arthur/data/qps/radial_gradients_perspectives_qps.png
index 0e28aae..d833250 100644
Binary files a/tests/arthur/data/qps/radial_gradients_perspectives_qps.png and b/tests/arthur/data/qps/radial_gradients_perspectives_qps.png differ
diff --git a/tests/arthur/data/qps/radial_gradients_qps.png b/tests/arthur/data/qps/radial_gradients_qps.png
index 66fcfc4..11043e8 100644
Binary files a/tests/arthur/data/qps/radial_gradients_qps.png and b/tests/arthur/data/qps/radial_gradients_qps.png differ
diff --git a/tests/arthur/data/qps/rasterops.qps b/tests/arthur/data/qps/rasterops.qps
index b79ec0d..ee3deca 100644
--- a/tests/arthur/data/qps/rasterops.qps
+++ b/tests/arthur/data/qps/rasterops.qps
@@ -1,83 +1,84 @@
-setPen NoPen
-
-setBrush black
-drawRect 10 10 1200 140
-
-setCompositionMode SourceOrDestination
-translate 20 20
-begin_block drawShape
-setBrush 0xffff0000
-drawEllipse 10 10 80 80
-setBrush 0xff00ff00
-drawRect 0 0 50 50
-setBrush 0xff0000ff
-drawRect 50 50 50 50
-end_block
-
-begin_block loop
-setCompositionMode SourceAndDestination
-translate 120 0
-repeat_block drawShape
-
-setCompositionMode SourceXorDestination
-translate 120 0
-repeat_block drawShape
-
-setCompositionMode NotSourceAndNotDestination
-translate 120 0
-repeat_block drawShape
-
-setCompositionMode NotSourceOrNotDestination
-translate 120 0
-repeat_block drawShape
-
-setCompositionMode NotSourceXorDestination
-translate 120 0
-repeat_block drawShape
-
-setCompositionMode NotSource
-translate 120 0
-repeat_block drawShape
-
-setCompositionMode NotSourceAndDestination
-translate 120 0
-repeat_block drawShape
-
-setCompositionMode SourceAndNotDestination
-translate 120 0
-repeat_block drawShape
-end_block
-
-resetMatrix
-setCompositionMode Source
-setBrush white
-drawRect 10 160 1200 140
-translate 20 170
-repeat_block loop
-
-resetMatrix
-setCompositionMode Source
-translate 20 320
-repeat_block loop
-
-resetMatrix
-setPen black
-setCompositionMode SourceOver
-translate 20 470
-drawText 20 0 "Or ROP"
-translate 120 0
-drawText 20 0 "And ROP"
-translate 120 0
-drawText 20 0 "Xor ROP"
-translate 120 0
-drawText 20 0 "Nor ROP"
-translate 120 0
-drawText 20 0 "Nand ROP"
-translate 120 0
-drawText 0 0 "NSrcXorDst ROP"
-translate 120 0
-drawText 20 0 "NSrc ROP"
-translate 120 0
-drawText 0 0 "NSrcAndDst ROP"
-translate 120 0
-drawText 0 0 "SrcAndNDst ROP"
+setPen NoPen
+
+setBrush black
+drawRect 10 10 60 500
+
+setCompositionMode SourceOrDestination
+translate 20 20
+
+begin_block drawShape
+ setBrush 0xffff0000
+ drawEllipse 5 5 30 30
+ setBrush 0xff00ff00
+ drawRect 0 0 20 20
+ setBrush 0xff0000ff
+ drawRect 20 20 20 20
+end_block
+
+begin_block loop
+ setCompositionMode SourceAndDestination
+ translate 0 50
+repeat_block drawShape
+
+setCompositionMode SourceXorDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSourceAndNotDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSourceOrNotDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSourceXorDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSource
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode NotSourceAndDestination
+translate 0 50
+repeat_block drawShape
+
+setCompositionMode SourceAndNotDestination
+translate 0 50
+repeat_block drawShape
+end_block
+
+resetMatrix
+setCompositionMode Source
+setBrush white
+drawRect 100 10 60 500
+translate 110 20
+repeat_block loop
+
+resetMatrix
+setCompositionMode Source
+translate 190 20
+repeat_block loop
+
+resetMatrix
+setPen black
+setCompositionMode SourceOver
+translate 250 45
+drawText 20 0 "Or ROP"
+translate 0 50
+drawText 20 0 "And ROP"
+translate 0 50
+drawText 20 0 "Xor ROP"
+translate 0 50
+drawText 20 0 "Nor ROP"
+translate 0 50
+drawText 20 0 "Nand ROP"
+translate 0 50
+drawText 0 0 "NSrcXorDst ROP"
+translate 0 50
+drawText 20 0 "NSrc ROP"
+translate 0 50
+drawText 0 0 "NSrcAndDst ROP"
+translate 0 50
+drawText 0 0 "SrcAndNDst ROP"
diff --git a/tests/arthur/data/qps/rasterops_qps.png b/tests/arthur/data/qps/rasterops_qps.png
index 80ca8ae..7b93001 100644
Binary files a/tests/arthur/data/qps/rasterops_qps.png and b/tests/arthur/data/qps/rasterops_qps.png differ
diff --git a/tests/arthur/data/qps/text_perspectives_qps.png b/tests/arthur/data/qps/text_perspectives_qps.png
index 483ccc0..183ad6f 100644
Binary files a/tests/arthur/data/qps/text_perspectives_qps.png and b/tests/arthur/data/qps/text_perspectives_qps.png differ
diff --git a/tests/arthur/data/qps/text_qps.png b/tests/arthur/data/qps/text_qps.png
index 2c2ebf2..9a95493 100644
Binary files a/tests/arthur/data/qps/text_qps.png and b/tests/arthur/data/qps/text_qps.png differ
diff --git a/tests/arthur/lance/interactivewidget.cpp b/tests/arthur/lance/interactivewidget.cpp
index 0febbed..0c2c7a6 100644
--- a/tests/arthur/lance/interactivewidget.cpp
+++ b/tests/arthur/lance/interactivewidget.cpp
@@ -43,7 +43,7 @@
InteractiveWidget::InteractiveWidget()
{
- m_onScreenWidget = new OnScreenWidget();
+ m_onScreenWidget = new OnScreenWidget("");
m_onScreenWidget->setMinimumSize(320, 240);
setCentralWidget(m_onScreenWidget);
diff --git a/tests/arthur/lance/lance.pro b/tests/arthur/lance/lance.pro
index 193dbd2..ee9e08b 100644
--- a/tests/arthur/lance/lance.pro
+++ b/tests/arthur/lance/lance.pro
@@ -6,7 +6,7 @@ INCLUDEPATH += .
# Input
HEADERS += widgets.h interactivewidget.h
-SOURCES += interactivewidget.cpp main.cpp
+SOURCES += interactivewidget.cpp main.cpp
RESOURCES += icons.qrc
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
diff --git a/tests/arthur/lance/main.cpp b/tests/arthur/lance/main.cpp
index 07e5180..f95b426 100644
--- a/tests/arthur/lance/main.cpp
+++ b/tests/arthur/lance/main.cpp
@@ -66,7 +66,7 @@ extern bool qt_show_painter_debug_output = false;
//#define CONSOLE_APPLICATION
-static const struct {
+static const struct {
const char *name;
QImage::Format format;
} imageFormats[] = {
@@ -282,7 +282,7 @@ int main(int argc, char **argv)
if (imageFormat == QImage::Format_Invalid) {
printf("Invalid image format. Available formats are:\n");
- for (int ff = 0; ff < formatCount; ++ff)
+ for (int ff = 0; ff < formatCount; ++ff)
printf("\t%s\n", imageFormats[ff].name);
return -1;
}
@@ -403,12 +403,10 @@ int main(int argc, char **argv)
case WidgetType:
{
OnScreenWidget *qWidget =
- new OnScreenWidget;
+ new OnScreenWidget(files.at(j));
qWidget->setVerboseMode(verboseMode);
qWidget->setType(type);
qWidget->setCheckersBackground(checkers_background);
- qWidget->m_filename = files.at(j);
- qWidget->setWindowTitle(fileinfo.filePath());
qWidget->m_commands = content;
qWidget->resize(width, height);
qWidget->show();
@@ -418,12 +416,10 @@ int main(int argc, char **argv)
case ImageWidgetType:
{
- OnScreenWidget *qWidget = new OnScreenWidget;
+ OnScreenWidget *qWidget = new OnScreenWidget(files.at(j));
qWidget->setVerboseMode(verboseMode);
qWidget->setType(type);
qWidget->setCheckersBackground(checkers_background);
- qWidget->m_filename = files.at(j);
- qWidget->setWindowTitle(fileinfo.filePath());
qWidget->m_commands = content;
qWidget->resize(width, height);
qWidget->show();
@@ -452,12 +448,10 @@ int main(int argc, char **argv)
}
case OpenGLType:
{
- OnScreenWidget *qGLWidget = new OnScreenWidget;
+ OnScreenWidget *qGLWidget = new OnScreenWidget(files.at(j));
qGLWidget->setVerboseMode(verboseMode);
qGLWidget->setType(type);
qGLWidget->setCheckersBackground(checkers_background);
- qGLWidget->m_filename = files.at(j);
- qGLWidget->setWindowTitle(fileinfo.filePath());
qGLWidget->m_commands = content;
qGLWidget->resize(width, height);
qGLWidget->show();
diff --git a/tests/arthur/lance/widgets.h b/tests/arthur/lance/widgets.h
index 271c18a..7247608 100644
--- a/tests/arthur/lance/widgets.h
+++ b/tests/arthur/lance/widgets.h
@@ -57,15 +57,47 @@
#include
#include
+#include
+
#include
const int CP_RADIUS = 10;
+class StupidWorkaround : public QObject
+{
+ Q_OBJECT
+public:
+ StupidWorkaround(QWidget *widget, int *value)
+ : QObject(widget), w(widget), mode(value)
+ {
+ }
+
+public slots:
+ void setViewMode(int m) {
+ *mode = m;
+ w->update();
+ }
+
+private:
+ QWidget *w;
+ int *mode;
+};
+
template
class OnScreenWidget : public T
{
public:
- OnScreenWidget(QWidget *parent = 0) : T(parent)
+
+ enum ViewMode {
+ RenderView,
+ BaselineView,
+ DifferenceView
+ };
+
+ OnScreenWidget(const QString &file, QWidget *parent = 0)
+ : T(parent),
+ m_view_mode(RenderView),
+ m_filename(file)
{
QSettings settings("Trolltech", "lance");
for (int i=0; i<10; ++i) {
@@ -78,11 +110,47 @@ public:
m_deviceType = WidgetType;
m_checkersBackground = true;
m_verboseMode = false;
- }
- void setVerboseMode(bool v) { m_verboseMode = v; }
- void setCheckersBackground(bool b) { m_checkersBackground = b; }
- void setType(DeviceType t) { m_deviceType = t; }
+ m_baseline_name = QString(m_filename).replace(".qps", "_qps") + ".png";
+ if (QFileInfo(m_baseline_name).exists()) {
+ m_baseline = QPixmap(m_baseline_name);
+ }
+
+ if (m_baseline.isNull()) {
+ setWindowTitle("Rendering: '" + file + "'. No baseline available");
+ } else {
+ setWindowTitle("Rendering: '" + file + "'. Shortcuts: 1=render, 2=baseline, 3=difference");
+
+ StupidWorkaround *workaround = new StupidWorkaround(this, &m_view_mode);
+
+ QSignalMapper *mapper = new QSignalMapper(this);
+ connect(mapper, SIGNAL(mapped(int)), workaround, SLOT(setViewMode(int)));
+ connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setWindowTitle(QString)));
+
+ QAction *renderViewAction = new QAction("Render View", this);
+ renderViewAction->setShortcut(Qt::Key_1);
+ connect(renderViewAction, SIGNAL(triggered()), mapper, SLOT(map()));
+ mapper->setMapping(renderViewAction, RenderView);
+ mapper->setMapping(renderViewAction, "Render View: " + file);
+ addAction(renderViewAction);
+
+ QAction *baselineAction = new QAction("Baseline", this);
+ baselineAction->setShortcut(Qt::Key_2);
+ connect(baselineAction, SIGNAL(triggered()), mapper, SLOT(map()));
+ mapper->setMapping(baselineAction, BaselineView);
+ mapper->setMapping(baselineAction, "Baseline View: " + file);
+ addAction(baselineAction);
+
+ QAction *differenceAction = new QAction("Differenfe View", this);
+ differenceAction->setShortcut(Qt::Key_3);
+ connect(differenceAction, SIGNAL(triggered()), mapper, SLOT(map()));
+ mapper->setMapping(differenceAction, DifferenceView);
+ mapper->setMapping(differenceAction, "Difference View" + file);
+ addAction(differenceAction);
+
+ }
+
+ }
~OnScreenWidget()
{
@@ -93,12 +161,24 @@ public:
settings.sync();
}
+ void setVerboseMode(bool v) { m_verboseMode = v; }
+ void setCheckersBackground(bool b) { m_checkersBackground = b; }
+ void setType(DeviceType t) { m_deviceType = t; }
+
void resizeEvent(QResizeEvent *e) {
m_image = QImage();
T::resizeEvent(e);
}
- void paintEvent(QPaintEvent *)
+ void paintEvent(QPaintEvent *) {
+ switch (m_view_mode) {
+ case RenderView: paintRenderView(); break;
+ case BaselineView: paintBaselineView(); break;
+ case DifferenceView: paintDifferenceView(); break;
+ }
+ }
+
+ void OnScreenWidget::paintRenderView()
{
QPainter pt;
QPaintDevice *dev = this;
@@ -152,6 +232,57 @@ public:
}
}
+ if (m_render_view.isNull()) {
+ m_render_view = window()->windowSurface()->grabWidget(this);
+ m_render_view.save("renderView.png");
+ }
+ }
+
+ void paintBaselineView() {
+ QPainter p(this);
+
+ if (m_baseline.isNull()) {
+ p.drawText(rect(), Qt::AlignCenter,
+ "No baseline found\n"
+ "file '" + m_baseline_name + "' does not exist...");
+ return;
+ }
+
+ p.drawPixmap(0, 0, m_baseline);
+
+ p.setPen(QColor::fromRgb(0, 0, 0, 0.1));
+ p.setFont(QFont("Arial", 128));
+ p.rotate(45);
+ p.drawText(100, 0, "BASELINE");
+ }
+
+ QPixmap generateDifference()
+ {
+ QImage img(size(), QImage::Format_RGB32);
+ img.fill(0);
+
+ QPainter p(&img);
+ p.drawPixmap(0, 0, m_render_view);
+
+ p.setCompositionMode(QPainter::RasterOp_SourceXorDestination);
+ p.drawPixmap(0, 0, m_baseline);
+
+ p.end();
+
+ return QPixmap::fromImage(img);
+ }
+
+ void paintDifferenceView() {
+ QPainter p(this);
+ if (m_baseline.isNull()) {
+ p.drawText(rect(), Qt::AlignCenter,
+ "No baseline found\n"
+ "file '" + m_baseline_name + "' does not exist...");
+ return;
+ }
+
+ p.fillRect(rect(), Qt::black);
+ p.drawPixmap(0, 0, generateDifference());
}
@@ -190,8 +321,6 @@ public:
T::update();
}
-
-
QSize sizeHint() const { return QSize(800, 800); }
QVector m_controlPoints;
@@ -200,12 +329,18 @@ public:
QStringList m_commands;
QString m_filename;
+ QString m_baseline_name;
bool m_verboseMode;
bool m_checkersBackground;
DeviceType m_deviceType;
+ int m_view_mode;
+
QImage m_image;
+
+ QPixmap m_baseline;
+ QPixmap m_render_view;
};
#endif
--
cgit v0.12
From efc7c605c5f561a75a718f8186e470bd24a18b4e Mon Sep 17 00:00:00 2001
From: Thiago Macieira
Date: Thu, 30 Jul 2009 14:35:07 +0200
Subject: Autotest: add a newline after the user program headers.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If the user forgot to end their headers with a newline, the
compilation would fail because the next line is #include
.
Reviewed-by: Jesper Thomschütz
---
tests/auto/qsharedpointer/externaltests.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/auto/qsharedpointer/externaltests.cpp b/tests/auto/qsharedpointer/externaltests.cpp
index d1618d1..6542350 100644
--- a/tests/auto/qsharedpointer/externaltests.cpp
+++ b/tests/auto/qsharedpointer/externaltests.cpp
@@ -324,6 +324,7 @@ namespace QTest {
sourceCode.reserve(8192);
sourceCode += programHeader;
+ sourceCode += '\n';
// Add Qt header includes
if (qtModules & QExternalTest::QtCore)
--
cgit v0.12
From eb8c2574848da1a418dbcec6f43699b2a2bc7edc Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer
Date: Thu, 30 Jul 2009 14:47:14 +0200
Subject: Doc: Move class and function documentation into a dedicated
directory.
---
doc/src/classes/phonon-api.qdoc | 5023 +++++++++++++++++++++++++++++++++
doc/src/classes/q3asciicache.qdoc | 465 +++
doc/src/classes/q3asciidict.qdoc | 416 +++
doc/src/classes/q3cache.qdoc | 461 +++
doc/src/classes/q3dict.qdoc | 446 +++
doc/src/classes/q3intcache.qdoc | 446 +++
doc/src/classes/q3intdict.qdoc | 390 +++
doc/src/classes/q3memarray.qdoc | 523 ++++
doc/src/classes/q3popupmenu.qdoc | 76 +
doc/src/classes/q3ptrdict.qdoc | 388 +++
doc/src/classes/q3ptrlist.qdoc | 1157 ++++++++
doc/src/classes/q3ptrqueue.qdoc | 230 ++
doc/src/classes/q3ptrstack.qdoc | 217 ++
doc/src/classes/q3ptrvector.qdoc | 427 +++
doc/src/classes/q3sqlfieldinfo.qdoc | 234 ++
doc/src/classes/q3sqlrecordinfo.qdoc | 89 +
doc/src/classes/q3valuelist.qdoc | 569 ++++
doc/src/classes/q3valuestack.qdoc | 149 +
doc/src/classes/q3valuevector.qdoc | 274 ++
doc/src/classes/qalgorithms.qdoc | 651 +++++
doc/src/classes/qcache.qdoc | 244 ++
doc/src/classes/qcolormap.qdoc | 152 +
doc/src/classes/qdesktopwidget.qdoc | 266 ++
doc/src/classes/qiterator.qdoc | 1431 ++++++++++
doc/src/classes/qmacstyle.qdoc | 261 ++
doc/src/classes/qpagesetupdialog.qdoc | 84 +
doc/src/classes/qpaintdevice.qdoc | 289 ++
doc/src/classes/qpair.qdoc | 229 ++
doc/src/classes/qpatternistdummy.cpp | 1010 +++++++
doc/src/classes/qplugin.qdoc | 135 +
doc/src/classes/qprintdialog.qdoc | 72 +
doc/src/classes/qprinterinfo.qdoc | 137 +
doc/src/classes/qset.qdoc | 953 +++++++
doc/src/classes/qsignalspy.qdoc | 98 +
doc/src/classes/qsizepolicy.qdoc | 522 ++++
doc/src/classes/qtdesigner-api.qdoc | 1413 ++++++++++
doc/src/classes/qtendian.qdoc | 168 ++
doc/src/classes/qtestevent.qdoc | 191 ++
doc/src/classes/qvarlengtharray.qdoc | 274 ++
doc/src/classes/qwaitcondition.qdoc | 188 ++
doc/src/phonon-api.qdoc | 5023 ---------------------------------
doc/src/q3asciicache.qdoc | 465 ---
doc/src/q3asciidict.qdoc | 416 ---
doc/src/q3cache.qdoc | 461 ---
doc/src/q3dict.qdoc | 446 ---
doc/src/q3intcache.qdoc | 446 ---
doc/src/q3intdict.qdoc | 390 ---
doc/src/q3memarray.qdoc | 523 ----
doc/src/q3popupmenu.qdoc | 76 -
doc/src/q3ptrdict.qdoc | 388 ---
doc/src/q3ptrlist.qdoc | 1157 --------
doc/src/q3ptrqueue.qdoc | 230 --
doc/src/q3ptrstack.qdoc | 217 --
doc/src/q3ptrvector.qdoc | 427 ---
doc/src/q3sqlfieldinfo.qdoc | 234 --
doc/src/q3sqlrecordinfo.qdoc | 89 -
doc/src/q3valuelist.qdoc | 569 ----
doc/src/q3valuestack.qdoc | 149 -
doc/src/q3valuevector.qdoc | 274 --
doc/src/qalgorithms.qdoc | 651 -----
doc/src/qcache.qdoc | 244 --
doc/src/qcolormap.qdoc | 152 -
doc/src/qdesktopwidget.qdoc | 266 --
doc/src/qiterator.qdoc | 1431 ----------
doc/src/qpagesetupdialog.qdoc | 84 -
doc/src/qpaintdevice.qdoc | 289 --
doc/src/qpair.qdoc | 229 --
doc/src/qpatternistdummy.cpp | 1010 -------
doc/src/qplugin.qdoc | 135 -
doc/src/qprintdialog.qdoc | 72 -
doc/src/qprinterinfo.qdoc | 137 -
doc/src/qset.qdoc | 953 -------
doc/src/qsignalspy.qdoc | 98 -
doc/src/qsizepolicy.qdoc | 522 ----
doc/src/qstyles.qdoc | 261 --
doc/src/qtdesigner.qdoc | 1373 ---------
doc/src/qtendian.qdoc | 168 --
doc/src/qtestevent.qdoc | 191 --
doc/src/qvarlengtharray.qdoc | 274 --
doc/src/qwaitcondition.qdoc | 188 --
80 files changed, 20748 insertions(+), 20708 deletions(-)
create mode 100644 doc/src/classes/phonon-api.qdoc
create mode 100644 doc/src/classes/q3asciicache.qdoc
create mode 100644 doc/src/classes/q3asciidict.qdoc
create mode 100644 doc/src/classes/q3cache.qdoc
create mode 100644 doc/src/classes/q3dict.qdoc
create mode 100644 doc/src/classes/q3intcache.qdoc
create mode 100644 doc/src/classes/q3intdict.qdoc
create mode 100644 doc/src/classes/q3memarray.qdoc
create mode 100644 doc/src/classes/q3popupmenu.qdoc
create mode 100644 doc/src/classes/q3ptrdict.qdoc
create mode 100644 doc/src/classes/q3ptrlist.qdoc
create mode 100644 doc/src/classes/q3ptrqueue.qdoc
create mode 100644 doc/src/classes/q3ptrstack.qdoc
create mode 100644 doc/src/classes/q3ptrvector.qdoc
create mode 100644 doc/src/classes/q3sqlfieldinfo.qdoc
create mode 100644 doc/src/classes/q3sqlrecordinfo.qdoc
create mode 100644 doc/src/classes/q3valuelist.qdoc
create mode 100644 doc/src/classes/q3valuestack.qdoc
create mode 100644 doc/src/classes/q3valuevector.qdoc
create mode 100644 doc/src/classes/qalgorithms.qdoc
create mode 100644 doc/src/classes/qcache.qdoc
create mode 100644 doc/src/classes/qcolormap.qdoc
create mode 100644 doc/src/classes/qdesktopwidget.qdoc
create mode 100644 doc/src/classes/qiterator.qdoc
create mode 100644 doc/src/classes/qmacstyle.qdoc
create mode 100644 doc/src/classes/qpagesetupdialog.qdoc
create mode 100644 doc/src/classes/qpaintdevice.qdoc
create mode 100644 doc/src/classes/qpair.qdoc
create mode 100644 doc/src/classes/qpatternistdummy.cpp
create mode 100644 doc/src/classes/qplugin.qdoc
create mode 100644 doc/src/classes/qprintdialog.qdoc
create mode 100644 doc/src/classes/qprinterinfo.qdoc
create mode 100644 doc/src/classes/qset.qdoc
create mode 100644 doc/src/classes/qsignalspy.qdoc
create mode 100644 doc/src/classes/qsizepolicy.qdoc
create mode 100644 doc/src/classes/qtdesigner-api.qdoc
create mode 100644 doc/src/classes/qtendian.qdoc
create mode 100644 doc/src/classes/qtestevent.qdoc
create mode 100644 doc/src/classes/qvarlengtharray.qdoc
create mode 100644 doc/src/classes/qwaitcondition.qdoc
delete mode 100644 doc/src/phonon-api.qdoc
delete mode 100644 doc/src/q3asciicache.qdoc
delete mode 100644 doc/src/q3asciidict.qdoc
delete mode 100644 doc/src/q3cache.qdoc
delete mode 100644 doc/src/q3dict.qdoc
delete mode 100644 doc/src/q3intcache.qdoc
delete mode 100644 doc/src/q3intdict.qdoc
delete mode 100644 doc/src/q3memarray.qdoc
delete mode 100644 doc/src/q3popupmenu.qdoc
delete mode 100644 doc/src/q3ptrdict.qdoc
delete mode 100644 doc/src/q3ptrlist.qdoc
delete mode 100644 doc/src/q3ptrqueue.qdoc
delete mode 100644 doc/src/q3ptrstack.qdoc
delete mode 100644 doc/src/q3ptrvector.qdoc
delete mode 100644 doc/src/q3sqlfieldinfo.qdoc
delete mode 100644 doc/src/q3sqlrecordinfo.qdoc
delete mode 100644 doc/src/q3valuelist.qdoc
delete mode 100644 doc/src/q3valuestack.qdoc
delete mode 100644 doc/src/q3valuevector.qdoc
delete mode 100644 doc/src/qalgorithms.qdoc
delete mode 100644 doc/src/qcache.qdoc
delete mode 100644 doc/src/qcolormap.qdoc
delete mode 100644 doc/src/qdesktopwidget.qdoc
delete mode 100644 doc/src/qiterator.qdoc
delete mode 100644 doc/src/qpagesetupdialog.qdoc
delete mode 100644 doc/src/qpaintdevice.qdoc
delete mode 100644 doc/src/qpair.qdoc
delete mode 100644 doc/src/qpatternistdummy.cpp
delete mode 100644 doc/src/qplugin.qdoc
delete mode 100644 doc/src/qprintdialog.qdoc
delete mode 100644 doc/src/qprinterinfo.qdoc
delete mode 100644 doc/src/qset.qdoc
delete mode 100644 doc/src/qsignalspy.qdoc
delete mode 100644 doc/src/qsizepolicy.qdoc
delete mode 100644 doc/src/qstyles.qdoc
delete mode 100644 doc/src/qtendian.qdoc
delete mode 100644 doc/src/qtestevent.qdoc
delete mode 100644 doc/src/qvarlengtharray.qdoc
delete mode 100644 doc/src/qwaitcondition.qdoc
diff --git a/doc/src/classes/phonon-api.qdoc b/doc/src/classes/phonon-api.qdoc
new file mode 100644
index 0000000..09274bf
--- /dev/null
+++ b/doc/src/classes/phonon-api.qdoc
@@ -0,0 +1,5023 @@
+/*
+ This file is part of the KDE project
+ Copyright (C) 2005-2007 Matthias Kretz
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ Contact: Nokia Corporation (qt-info@nokia.com)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+
+/*!
+ \enum Phonon::DiscType
+ Enum to identify the media discs supported by MediaObject.
+
+ \value NoDisc
+ No disc was selected. This is only useful as a return value from
+ MediaSource::diskType().
+ \value Cd Identifies Audio CDs.
+ \value Dvd Identifies DVDs (not arbitrary data DVDs, only movie DVDs).
+ \value Vcd Identifies Video CDs.
+
+ \sa MediaSource, MediaObject
+*/
+
+/*!
+ \enum Phonon::MetaData
+
+ Provided as keys for Phonon::MediaObject::metaData(). The enum
+ values matches strings defined in the Ogg Vorbis specification
+
+ \value ArtistMetaData
+ \value AlbumMetaData
+ \value TitleMetaData
+ \value DateMetaData
+ \value GenreMetaData
+ \value TracknumberMetaData
+ \value DescriptionMetaData
+ \value MusicBrainzDiscIdMetaData
+*/
+
+/*!
+ \enum Phonon::State
+ \since 4.4
+
+ The state enum describes the different states a media object can
+ take. Several functions of \l{Phonon::}{MediaObject} are
+ asynchronous, so even if a you have requested a state change
+ through a function call, e.g., through
+ \l{Phonon::MediaObject::}{play()}, you cannot be sure that the
+ change has taken place before you receive the
+ \l{Phonon::MediaObject::}{stateChanged()} signal.
+
+ A media object can at any time change into any state, regardless
+ of the state it previously had. \omit In the
+ \l{Phonon::}{MediaObject} class description explains the typical
+ state changes in the life of a media object. \endomit
+
+ \value LoadingState
+ After construction it might take a while before the media object
+ is ready to \l{Phonon::MediaObject::}{play()}. This state is
+ commonly used by backends to initialize the \l{Phonon
+ Overview}{media graph} and loading the source. When
+ the object leaves the loading state, it will enter the
+ StoppedState unless an error occurred or another state is
+ requested through a function call, e.g.,
+ \l{Phonon::}{MediaObject::play()}.
+
+ \value StoppedState
+ In the stopped state, the media object is ready to play its
+ current media source. The current
+ \l{MediaObject::seek()}{position} in the media stream is then 0.
+
+ \value PlayingState
+ The media object is playing back its media source.
+
+ \value BufferingState
+ The Player is waiting for data to be able to start or continue
+ playing. This state is commonly used to wait for media data over a
+ network connection.
+
+ \value PausedState
+ The media player has currently paused its playback, i.e., it
+ stops playing but keeps the current playback position in the
+ stream.
+
+ \value ErrorState
+ When a media object enters the error state a problem with the
+ playback has occurred. The possible errors are grouped into
+ two categories by Phonon::ErrorType, and the type can be
+ queried through \l{Phonon::MediaObject::}{errorType()}. A
+ \l{Phonon::}{FatalError} implies that the playback
+ cannot continue, but one can still try with a new media
+ source. With a \l{Phonon::}{NormalError} it might
+ be possible to continue playback, and a media object may
+ therefore change state from the ErrorState.
+
+ \sa MediaObject
+*/
+
+/*!
+ \enum Phonon::Category
+
+ Sets the category your program should be listed in in the mixer.
+
+ \value NoCategory
+ Will make use of the default device.
+ \value NotificationCategory
+ If the sounds produced are notifications (ping, beep and such) you
+ should use this category.
+ \value MusicCategory
+ If your application is a music player (like a jukebox or media player
+ playing an audio file).
+ \value VideoCategory
+ If the sound is the audio channel of a video.
+ \value CommunicationCategory
+ If your applications produces sounds from communication with somebody
+ else (VoIP, voice chat).
+ \value GameCategory
+ Sound produced by a computer game should go into this category.
+ \value AccessibilityCategory
+ Sounds produced for accessibility (e.g., Text-To-Speech)
+ \omitvalue LastCategory
+ Holds the largest value of categories.
+ \omitvalue AccessibilityCategory
+
+ A Jukebox will set this to Music, a VoIP program to Communication, a
+ DVD player to video, and so on.
+
+ \note These categories can also become useful for an application that
+ controls the volumes automatically, like turning down the music when a call
+ comes in, or turning down the notifications when the media player knows
+ it's playing classical music.
+*/
+
+/*!
+ \enum Phonon::ErrorType
+
+ This enum describes the severity when an error has occurred during
+ playback.
+
+ After a media object has entered the \l{Phonon::}{ErrorState}, one
+ can query the type of error from
+ \l{Phonon::}{MediaObject::errorType()}. Note that you should query
+ the error when receiving the
+ \l{Phonon::}{MediaObject::stateChanged()} signal, because the
+ error type will be lost if the media object leaves the error
+ state.
+
+ \value NoError No error. MediaObject::errorType() returns this if
+ MediaObject::state() != Phonon::ErrorState.
+
+ \value NormalError An error has occurred with the playback of the current
+ source. It might be possible to continue playback, for instance, if only the
+ audio stream in a video cannot be played back. The media object will then
+ leave the error state again.
+
+ \value FatalError. Something important does not work. Your program cannot continue
+ the playback of the current source, but it might be possible to try another.
+
+ \sa MediaObject::errorType()
+*/
+
+/*!
+ \fn QString Phonon::categoryToString(Category c)
+
+ Returns a (translated) string to show to the user identifying the given
+ Category (\a c).
+*/
+
+/*!
+ \enum Phonon::ObjectDescriptionType
+ \relates Phonon::ObjectDescription
+
+ This enum defines the type of information that is contained in a
+ \l{Phonon::}{ObjectDescription} object.
+
+ \value AudioOutputDeviceType An audio output device (\l{Phonon::}{AudioOutputDevice}).
+ This can be soundcards (with different drivers),
+ sound servers, or other virtual outputs like playback on a different
+ computer on the network.
+
+ \value EffectType An audio effect (\l{Phonon::}{EffectDescription}).
+ \omitvalue SubtitleType
+ \omitvalue AudioCaptureDeviceType
+ \omitvalue AudioChannelType
+*/
+
+/*!
+ \typedef Phonon::AudioOutputDevice
+ \relates Phonon::ObjectDescription
+
+ This typedef of \l{Phonon::}{ObjectDescription} describes an audio output
+ device, such as soundcards (with different drivers), sound servers, or other
+ virtual outputs like playback on a different computer on the network.
+
+ \omit
+ For Hardware devices the backend should use libkaudiodevicelist
+ (AudioDevice and AudioDeviceEnumerator) which will list removable
+ devices even when they are unplugged and provide a unique identifier
+ that can make backends use the same identifiers.
+ \endomit
+
+ A list of available devices is given by the backend with
+ Backendcapabilities::availableAudioOutputDevices()
+
+ \snippet doc/src/snippets/phononobjectdescription.cpp 1
+
+*/
+
+/*!
+ \fn Phonon::phononVersion()
+ \inmodule Phonon
+ \since 4.5
+
+ Returns the Phonon version.
+*/
+
+/*!
+ \class Phonon::ObjectDescription
+ \inmodule Phonon
+ \inheaderfile Phonon/ObjectDescription
+ \since 4.4
+ \brief The ObjectDescription class provides information about Phonon objects.
+
+ Phonon currently uses this class to describe audio effects and
+ audio output devices - using the typedefs AudioOutputDevice and
+ EffectDescription. The type of an ObjectDescription is also
+ described through the \l{Phonon::}{ObjectDescriptionType} enum.
+ Objects of the same \l{Phonon::ObjectDescriptionType}{type} are
+ uniquely identified by an index().
+
+ The class gives a description() and a name() of the object, both
+ of which are strings appropriate for end users of a Phonon
+ application. You can also check whether the device or effect
+ described is \l{isValid()}{valid}. This does not guarantee that
+ the device or effect functions as expected, but that the
+ ObjectDescription describes an existing device or effect.
+
+ Audio output devices and effect descriptions are used to select
+ the audio output device to be used for playback and to create
+ effects; we show examples of this in the snippet below. The
+ available descriptions can be fetched with
+ \l{Phonon::BackendCapabilities::}{availableAudioOutputDevices()}
+ and \l{Phonon::BackendCapabilities::}{availableAudioEffects()}
+ static functions in the Phonon::BackendCapabilities namespace
+
+ \snippet doc/src/snippets/phononobjectdescription.cpp 0
+
+ Other types of ObjectDescriptions might be possible in the future,
+ e.g., descriptions of audio capture devices, such as microphones.
+
+ \omit Not implemented yet.
+ Need a new paragraph on that some descriptions 'belong
+ together', such as chained audio effects.
+
+ Some parts give the end user choices, e.g. what source to capture
+ audio from. These choices are described by the name and
+ description methods of this class and identified with the id
+ method. Subclasses then define additional information like which
+ audio and video choices belong together. \endomit
+
+ \sa Phonon::AudioOutputDevice, Phonon::EffectDescription, {Capabilities Example}, {Phonon Module}
+*/
+
+/*!
+ \fn Phonon::ObjectDescription::ObjectDescription()
+ \brief constructs a new object description.
+ \internal
+*/
+
+/*!
+ \fn Phonon::ObjectDescription::ObjectDescription (int index, const QHash & properties)
+ \internal
+*/
+
+/*!
+ \fn Phonon::ObjectDescription::ObjectDescription(const QExplicitlySharedDataPointer &dd)
+ \internal
+*/
+
+/*!
+ \fn static inline ObjectDescription Phonon::ObjectDescription::fromIndex(int index)
+ \internal
+
+ \omit Currently indices are not unique for all ObjectDescription types, making
+ the behavior of this function undefined. \endomit
+
+ Returns a new description object that describes the
+ device/effect/codec/... with the given \a index.
+*/
+
+/*!
+ \fn inline bool Phonon::ObjectDescription::operator==(const ObjectDescription &otherDescription) const
+
+ Returns \c true if this ObjectDescription describes the same
+ object as \a otherDescription; otherwise, returns \c false.
+*/
+
+/*!
+ \fn inline bool Phonon::ObjectDescription::operator!=(const ObjectDescription &otherDescription) const
+ Returns \c false if this ObjectDescription describes the same
+ as \a otherDescription; otherwise, returns \c true.
+*/
+
+/*!
+ \fn inline QString Phonon::ObjectDescription::name() const
+
+ Returns a string appropriate for a user to select between
+ object descriptions, e.g., from a QComboBox.
+
+ \sa description()
+*/
+
+/*!
+ \fn inline QString Phonon::ObjectDescription::description() const
+
+ Returns a more extensive description than the name() function.
+
+ For example, in the case of \l{Phonon::}{AudioOutputDevice}s, this
+ text should make clear which sound source is described; this is
+ sometimes hard to describe or understand from just the name.
+
+ The text is appropriate to present to an end user in for example
+ tool tips of items, with the name()'s as text, in a QComboBox.
+
+*/
+
+/*!
+ \fn inline QVariant Phonon::ObjectDescription::property(const char *name) const
+
+ Returns the property named \a name. A property can be used for
+ extended information, such as the manufacturer of a sound card. The
+ information will usually be given as text.
+
+ If the property is not set an invalid QVariant is returned.
+
+ Qt's backends do not use properties at the time of this writing.
+
+ \sa propertyNames()
+*/
+
+/*!
+ \fn inline QList Phonon::ObjectDescription::propertyNames() const
+
+ Properties can be used for extended information about a
+ ObjectDescription, e.g., a manufacturer of a sound card. The
+ information will usually be given text.
+
+ This function returns all names that return valid data when
+ property() is called.
+
+ Currently, Qt backends do not use properties for their object
+ descriptions.
+
+ \sa property()
+*/
+
+/*!
+ \fn inline bool Phonon::ObjectDescription::isValid() const
+
+ Returns true if the device or effect described exists.
+
+ An ObjectDescription that is invalid, will also have an
+ index() of -1.
+
+ \sa index()
+*/
+
+/*!
+ \fn inline int Phonon::ObjectDescription::index() const
+
+ Returns a unique identifier for this ObjectDescription. Used
+ internally to distinguish between the descriptions.
+
+ Notice that the identifiers are only unique to the type of
+ description, e.g., \l{Phonon::}{AudioOutputDevice} or
+ \l{Phonon::}{EffectDescription}.
+*/
+
+/*!
+ \class Phonon::ObjectDescriptionPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+
+*/
+
+/*!
+ \class Phonon::StreamInterface
+ \inmodule Phonon
+ \since 4.4
+ \brief Backend interface to handle media streams (AbstractMediaStream).
+ \internal
+*/
+
+/*!
+ \fn virtual Phonon::StreamInterface::~StreamInterface()
+*/
+
+/*!
+ \fn virtual void Phonon::StreamInterface::writeData(const QByteArray &data) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::StreamInterface::endOfData() = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::StreamInterface::setStreamSize(qint64 newSize) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::StreamInterface::setStreamSeekable(bool s) = 0
+ \internal
+*/
+
+/*!
+ \fn void Phonon::StreamInterface::connectToSource(const MediaSource &mediaSource)
+ \internal
+*/
+
+/*!
+ \fn void Phonon::StreamInterface::needData()
+ \internal
+*/
+
+/*!
+ \fn void Phonon::StreamInterface::enoughData()
+ \internal
+*/
+
+/*!
+ \fn void Phonon::StreamInterface::seekStream(qint64)
+ \internal
+*/
+
+/*!
+ \fn void Phonon::StreamInterface::reset()
+ \internal
+*/
+
+/*!
+ \fn Phonon::StreamInterface::StreamInterface()
+ \internal
+ \omit
+ For subclasses.
+ \endomit
+*/
+
+/*!
+ \class StreamInterfacePrivate
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \class Phonon::AbstractVideoOutput
+ \inmodule Phonon
+ \internal
+ \since 4.4
+ \brief The AbstractVideoOutput class is the common base class for all video output classes.
+
+ \sa VideoWidget
+*/
+
+/*!
+ \namespace Phonon::Experimental
+ \internal
+*/
+
+/*!
+ \fn Phonon::AbstractVideoOutput::AbstractVideoOutput(AbstractVideoOutputPrivate &d)
+ \internal
+
+ Constructor that is called from derived classes.
+
+ \param parent Standard QObject parent.
+*/
+
+/*!
+ \class Phonon::AbstractVideoOutputPrivate
+ \inmodule Phonon
+ \internal
+ \since 4.4
+*/
+
+/*!
+ \class Phonon::VolumeFaderEffect
+ \inmodule Phonon
+ \internal
+ \since 4.4
+
+ This effect differs from gradually changing the output volume in that
+ a dedicated effect can change the volume in the smallest possible
+ steps while every other volume control will make more or less
+ noticeable steps.
+
+ \sa AudioOutput::volume()
+*/
+
+/*!
+ \property Phonon::VolumeFaderEffect::volume
+
+ This is the current volume of the output as voltage factor.
+ Setting this property changes the volume immediately.
+
+ 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%
+
+ \sa volumeDecibel
+*/
+
+/*!
+ \property Phonon::VolumeFaderEffect::volumeDecibel
+
+ This is the current volume of the output in decibel.
+ Setting this property changes the volume immediately.
+
+ 0 dB means no change in volume, -6dB means an attenuation of the
+ voltage to 50% and an attenuation of the power to 25%, -inf dB means
+ silence.
+
+ \sa volume
+*/
+
+/*!
+ \property Phonon::VolumeFaderEffect::fadeCurve
+
+ This property holds the fade curve to be used for the fadeIn(), fadeOut()
+ and fadeTo() slots.
+
+ Defaults to Fade3Decibel.
+
+ \sa FadeCurve
+*/
+
+/*!
+ \enum Phonon::VolumeFaderEffect::FadeCurve
+ Determines the curve of the volume change.
+
+ \value Fade3Decibel Crossfade curve/fast fade out.
+ This is the default fade curve.
+ \value Fade6Decibel Linear fade out.
+ \value Fade9Decibel Slow fade out.
+ \value Fade12Decibel A more extreme version of the -9dB fade.
+
+ \bold{Notes:}
+
+ \c Fade3Decibel is often the best fade for a crossfade, as after half
+ of the time the volume reached -3dB. This means that half the
+ possible power (which is proportional to the square of the
+ voltage) is reached. Summed, the maximum power of two audio
+ signals fading with a -3dB curve will always be equal.
+
+ For fading in or out the -3dB curve is too abrupt in the end.
+
+ With a -6dB fade curve, a volume of -6dB is reached after half of
+ the fading time. -6dB is equal to half of the voltage meaning
+ that the voltage multiplier changes linearly from the start
+ of the fade to the end.
+
+ With the \c Fade9Decibel fade, a volume of -9dB is reached after
+ half of the fade time, so the fade is fast in the beginning and
+ slow at the end. This is a good fade for ending music.
+*/
+
+/*!
+ \fn void Phonon::VolumeFaderEffect::fadeIn(int fadeTime)
+
+ Tells the Fader to change the volume from the current volume to 100%
+ in \a fadeTime milliseconds.
+
+ Short for \c fadeTo(1.0, fadeTime).
+
+ \param fadeTime the fade duration in milliseconds
+
+ \sa fadeTo(), volume
+*/
+
+/*!
+ \fn void Phonon::VolumeFaderEffect::fadeOut(int fadeTime)
+
+ Tells the Fader to change the volume from the current volume to 0%
+ in \a fadeTime milliseconds.
+ Short for \c fadeTo(0.0, fadeTime).
+
+ \param fadeTime the fade duration in milliseconds
+
+ \sa fadeTo
+*/
+
+/*!
+ \fn void Phonon::VolumeFaderEffect::fadeTo(float volume, int fadeTime)
+
+ Tells the Fader to change the volume from the current value to
+ \a volume in \a fadeTime milliseconds.
+
+ \sa fadeIn(), fadeOut()
+*/
+
+/*!
+ \class Phonon::VolumeFaderEffectPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::VolumeFaderInterface
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \fn virtual Phonon::VolumeFaderInterface::~VolumeFaderInterface()
+ \internal
+*/
+
+/*!
+ \fn virtual float Phonon::VolumeFaderInterface::volume() const
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::VolumeFaderInterface::setVolume(float)
+ \internal
+*/
+
+/*!
+ \fn virtual Phonon::VolumeFaderEffect::FadeCurve Phonon::VolumeFaderInterface::fadeCurve() const
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::VolumeFaderInterface::setFadeCurve(Phonon::VolumeFaderEffect::FadeCurve)
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::VolumeFaderInterface::fadeTo(float, int)
+ \internal
+*/
+
+/*!
+ \class Phonon::AbstractMediaStream
+ \inmodule Phonon
+ \internal
+ \since 4.4
+ \brief The AbstractMediaStream class is the base class for custom media data streams.
+ \inheaderfile Phonon/AbstractMediaStream
+
+ This class is subclassed to provide custom data streams for
+ \l{Phonon::}{MediaSource}s.
+
+ The \l{Phonon::}{MediaSource} knows how to handle the most common
+ media sources, such as files and CD. If you need to fetch
+ multimedia from other sources, you can reimplement this class,
+ which can be used by a \l{Phonon::}{MediaSource}.
+
+ When a backend needs more data from the stream, needData() will be
+ called. You must then use writeData() to write the data to the
+ backend. You can either write one time and wait for a new
+ needData() call, or continue to write data until you receive an
+ enoughData() call. When the stream is at its end, call endOfData()
+ instead of writeData().
+
+ Before the custom stream is passed to a \l{Phonon::}{MediaSource},
+ setStreamSize() needs to be called, and also setStreamSeekable()
+ (if the stream is seekable). A good place to do this work is in
+ the constructor. A seekable stream must also reimplement
+ seekStream().
+
+ We show two examples. The first writes data repeatedly until it
+ receives the enoughData() call, while the second only writes once
+ and waits for a new needData() call.
+
+ Example where data is written repeatedly.
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 0
+
+ Example where data is written once:
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 1
+
+ \sa Phonon::MediaSource, Phonon::MediaObject
+
+*/
+
+/*!
+ \fn Phonon::AbstractMediaStream::AbstractMediaStream(QObject *parent = 0)
+ \internal
+
+ Constructs an AbstractMediaStream object with the given \a parent.
+
+*/
+
+/*!
+ \fn qint64 Phonon::AbstractMediaStream::streamSize() const
+
+ Returns the stream size that was set with setStreamSize().
+
+ A negative value means that the length of the stream cannot be known.
+
+ Defaults to 0.
+
+ \sa setStreamSize()
+*/
+
+/*!
+ \fn void Phonon::AbstractMediaStream::setStreamSize(qint64 size)
+
+ Sets the \a size of the stream in number of bytes.
+
+ A negative value means that the length of the stream cannot be known.
+
+ Defaults to 0.
+
+ This function has to be called. A backend will not call needData()
+ until the stream size is set.
+
+ \sa streamSize()
+
+*/
+
+/*!
+ \fn bool Phonon::AbstractMediaStream::streamSeekable() const
+
+ Returns whether your data stream is set as seekable.
+
+ Defaults to \c false.
+
+ \sa setStreamSeekable()
+
+*/
+
+/*!
+ \fn void Phonon::AbstractMediaStream::setStreamSeekable(bool s)
+
+ Sets whether your data stream is seekable. \a s should be true if
+ the stream is seekable; otherwise false.
+
+ Defaults to \c false.
+
+ If you set this to \c true you have to implement the seekStream()
+ function.
+
+ \sa streamSeekable()
+*/
+
+/*!
+ \fn void Phonon::AbstractMediaStream::writeData(const QByteArray &data)
+
+ Sends the media \a data to the backend for decoding.
+
+ Use this function to send data to the backend after needData() has
+ been called.
+
+ If your stream is a push stream, data should be written until the
+ enoughData() function is called. For a pull stream, write data
+ once before the call to needData() function returns.
+
+ If the data is depleted, call endOfData() instead of writeData().
+
+ \warning Don't call this function before the first needData() is emitted.
+
+ \sa needData(), endOfData()
+
+*/
+
+/*!
+ \fn void Phonon::AbstractMediaStream::endOfData()
+
+ Tells the backend that the media data stream is at its end.
+
+ \warning Don't call this function before the first needData() is emitted.
+
+ \sa writeData(), needData()
+*/
+
+/*!
+ \fn void Phonon::AbstractMediaStream::error(Phonon::ErrorType errorType, const QString &errorString)
+
+ If an I/O error occurs you should call this function to make
+ MediaObject go into ErrorState. \c errorType classifies the error,
+ while \a errorString is a textual description of the error suitable
+ for users of Phonon applications.
+
+ \sa MediaObject::errorType(), MediaObject::errorString()
+*/
+
+/*!
+ \fn virtual void Phonon::AbstractMediaStream::reset() = 0
+
+ Reimplement this function to reset the stream. Subsequent calls to writeData should start
+ from the first position of the data unless a seek is requested.
+
+ The function is necessary for the case where a non-seekable MediaStream is
+ played more than once. For a seekable stream the implementation can simply call
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 2
+
+ \sa writeData(), needData()
+*/
+
+/*!
+ \fn virtual void Phonon::AbstractMediaStream::needData() = 0
+
+ Reimplement this function to be notified when the backend needs data.
+
+ When this function is called you should write data to the backend
+ (See writeData()).
+
+ \sa writeData(), endOfData(), enoughData()
+*/
+
+/*!
+ \fn virtual void Phonon::AbstractMediaStream::enoughData()
+
+ If your stream is a push stream, reimplement this function to be
+ notified when the backend has enough data and your stream object
+ may take a break.
+
+ This method is important for pushing data to the backend in order
+ to not fill the backend buffer unnecessarily.
+
+ \sa needData()
+*/
+
+/*!
+ \fn virtual void Phonon::AbstractMediaStream::seekStream(qint64 offset)
+
+ Reimplement this function if your stream is seekable.
+
+ When this function is called the next call to writeData has to be at the
+ requested \a offset.
+
+ \warning Do not call the parent implementation.
+
+ \sa setStreamSeekable(), streamSeekable(), needData()
+*/
+
+/*!
+ \class Phonon::BackendInterface
+ \inmodule Phonon
+ \since 4.4
+ \brief Main Backend class interface
+ \internal
+
+ This interface defines the main factory of the backend. The createObject() function creates all the
+ objects needed by the frontend.
+
+ The objectDescriptionIndexes and objectDescriptionProperties functions return information about
+ available devices, effects and codecs.
+
+ An implementation could look like this:
+ \snippet snippets/phonon/samplebackend/main.cpp snippet
+
+*/
+
+/*!
+ \fn virtual Phonon::BackendInterface::~BackendInterface()
+ \internal
+
+ Silence gcc's warning.
+*/
+
+/*!
+ \enum Phonon::BackendInterface::Class
+ \internal
+
+ Classes that the createObject() function has to handle.
+
+ \value MediaObjectClass Request to return a \c MediaObject object.
+ \value VolumeFaderEffectClass Request to return a \c VolumeFaderEffect
+ object.
+ \value AudioOutputClass Request to return an \c AudioOutput object.
+ \value AudioDataOutputClass Request to return an \c AudioDataOutput object.
+ \value VisualizationClass Request to return a \c Visualization object.
+ \value VideoDataOutputClass Request to return a \c VideoDataOutput object.
+ \value EffectClass Request to return a \c Effect object.
+ Takes an additional int that specifies the effect ID.
+ \value VideoWidgetClass Request to return a \c VideoWidget object.
+*/
+
+/*!
+ \fn virtual QObject *Phonon::BackendInterface::createObject(Class c, QObject *parent, const QList &args = QList()) = 0
+ \internal
+
+ Returns a new instance of the requested class.
+
+ \param c The requested class.
+ \param parent The parent object.
+ \param args Additional arguments (documented in Class).
+*/
+
+
+/*!
+ \fn virtual QList Phonon::BackendInterface::objectDescriptionIndexes(ObjectDescriptionType type) const = 0
+ \internal
+
+ Returns the unique identifiers for the devices/effects/codecs of the given \a type.
+
+ \param type see ObjectDescriptionType
+*/
+
+/*!
+ \fn virtual QHash Phonon::BackendInterface::objectDescriptionProperties(ObjectDescriptionType type, int index) const = 0
+ \internal
+
+ Given a unique identifier that was returned from objectDescriptionIndexes this function
+ returns a hash mapping property names to values.
+
+ The property "name" must always be present. All other properties are optional.
+
+ \table
+ \header \o Property \o Description
+ \row \o name \o The name of the device/effect/codec/...
+ \row \o description \o A text explaining what this device/effect/codec/... is/can do
+ \row \o icon \o An icon name (using the freedesktop naming scheme) or a QIcon for this
+ device/effect/codec/...
+ \row \o available \o A bool telling whether the device is present or unplugged.
+ \endtable
+
+ \param type see ObjectDescriptionType
+ \param index The unique identifier that is returned from objectDescriptionIndexes
+*/
+
+/*!
+ \fn virtual bool Phonon::BackendInterface::startConnectionChange(QSet) = 0;
+ \internal
+
+ When this function is called the nodes given in the parameter list should
+ not lose any signal data when connections are changed.
+*/
+
+/*!
+ \fn virtual bool Phonon::BackendInterface::connectNodes(QObject *, QObject *) = 0
+ \internal
+
+ Defines a signal connection between the two given nodes.
+*/
+
+/*!
+ \fn virtual bool Phonon::BackendInterface::disconnectNodes(QObject *, QObject *) = 0
+ \internal
+
+ Cuts a signal connection between the two given nodes.
+*/
+
+/*!
+ \fn virtual bool Phonon::BackendInterface::endConnectionChange(QSet) = 0
+ \internal
+
+ When this function is called the nodes given in the parameter list may lose
+ signal data when a port is not connected.
+*/
+
+/*!
+ \fn virtual QStringList Phonon::BackendInterface::availableMimeTypes() const = 0
+ \internal
+
+ Returns all available MIME types.
+*/
+
+/*!
+ \class Phonon::MediaSource
+ \inmodule Phonon
+ \inheaderfile Phonon/MediaSource
+ \since 4.4
+ \brief The MediaSource class provides multimedia data for media objects.
+
+ The MediaSource class manages a source of multimedia content, such
+ as a music or video file, of which data is given to a
+ \l{Phonon::}{MediaObject}.
+
+ The media source knows how fetch its data from several sources,
+ e.g., from files, a QIODevice, or a CD. The possible source types
+ are described by the \l{MediaSource::}{Type} enum. The type of the
+ source is set by the media source itself, and is dependent on the
+ constructor used to create it. Note that it is possible to provide
+ data from any source by implementing a QIODevice.
+
+ The class has several functions to acquire information about the
+ source it manages, e.g., fileName() and url(). The return from
+ these functions are dependent on the type() of the media source.
+
+ Normally, a programmer does not need to be concerned with media
+ sources. It's constructors are implicit, so one can, for instance,
+ send an URL or filename directly to the constructors of the
+ \l{Phonon::}{MediaObject}.
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 3
+
+ A MediaSource object cannot be reused for another multimedia
+ source. It is possible to play the same source again, and also
+ stop and start a non-seekable media source, such as a radio
+ stream, with the same MediaSource object.
+
+ \section1 Qt Backends
+
+ Currently, Qt's backends support files in local and remote
+ locations. Support for other sources, such as CD/DVD, are planned
+ for the future.
+
+ \sa MediaObject, {Phonon Module}
+*/
+
+/*!
+ \enum Phonon::MediaSource::Type
+
+ Identifies the type of media described by the MediaSource object.
+
+ \value Invalid The MediaSource object does not describe any valid source.
+ \value LocalFile The MediaSource object describes a local file.
+ \value Url The MediaSource object describes an URL, which can be either a
+ local file or a file on the network.
+ \value Disc The MediaSource object describes a disc, e.g., a CD.
+ \value Stream The MediaSource object describes a data stream.
+ This is the type used for \l{QIODevice}s. Note
+ that a stream opened with a QUrl, will still be of the Url type.
+ \value Empty The media source doesn't have a source.
+
+ \sa MediaSource::type()
+*/
+
+/*!
+ \fn Phonon::MediaSource::MediaSource()
+ \internal
+
+ Creates an invalid MediaSource object.
+
+ \sa Invalid
+*/
+
+/*!
+ \fn Phonon::MediaSource::MediaSource(const QString &fileName)
+
+ Creates a MediaSource object for the file specified by \a
+ fileName. You can also use this constructor with \l{The Qt
+ Resource System}{Qt resources}
+
+ \omit
+ \param fileName file name of a local media file or a Qt resource that was compiled in.
+ \endomit
+*/
+
+/*!
+ \fn Phonon::MediaSource::MediaSource(const QUrl &url)
+
+ Creates a MediaSource object for a the URL specified by \a url.
+
+ If the multimedia content you would like to play back is on a
+ remote network location, you should use this constructor; though,
+ it also possible to specify an URL to a local file.
+
+ \sa QUrl
+*/
+
+
+/*!
+ \fn Phonon::MediaSource::MediaSource(Phonon::DiscType discType, const QString &deviceName = QString())
+
+ Creates a MediaSource object for the type of disc specified by \a discType in the named
+ device referred to by \a deviceName.
+
+ \note \a deviceName is a platform dependent device name. It can be useful to specify this
+ if the computer has more than one CD drive. On KDE, it is recommended to use the Solid
+ hardware discovery framework to retrieve the device name in a portable way.
+*/
+
+/*!
+ \fn Phonon::MediaSource::MediaSource(AbstractMediaStream *stream)
+ \internal
+ Creates a MediaSource object for a data stream.
+
+ Your application can provide the media data by subclassing AbstractMediaStream and
+ passing a pointer to that object. Phonon will never delete the \a stream.
+
+ \param stream The AbstractMediaStream subclass to provide the media data.
+
+ \sa setAutoDelete
+*/
+
+/*!
+ \fn Phonon::MediaSource::MediaSource(QIODevice *ioDevice)
+
+ Creates a MediaSource object for the QIODevice specified by \a ioDevice.
+
+ This constructor can be very handy in the combination of
+ QByteArray and QBuffer.
+
+ If you need to fetch multimedia data from a source that is not
+ supported by MediaSource, you should subclass QIODevice and use
+ this MediaSource constructor. It is important that you reimplement
+ QIODevice::isSequential(), as it is used by MediaSource to
+ determine if the media source is seekable.
+
+ \a ioDevice is an arbitrary readable QIODevice subclass. If the device is not opened
+ MediaSource will open it as QIODevice::ReadOnly.
+
+ \note Sequential devices can also be used, but MediaObject::isSeekable() will
+ return false as a result.
+
+ \warning On Windows, we only support \l{QIODevice}s containing the
+ \c avi, \c mp3, or \c mpg formats. Use the constructor that takes
+ a file name to open files (the Qt backend does not use a QFile
+ internally).
+
+ \sa setAutoDelete()
+*/
+
+/*!
+ \fn Phonon::MediaSource::MediaSource(MediaSourcePrivate &)
+ \internal
+*/
+
+/*!
+ \fn Phonon::MediaSource::~MediaSource()
+
+ Destroys the MediaSource object. You should never delete a
+ MediaSource yourself, the MediaObject will handle this.
+
+*/
+
+/*!
+ \fn Phonon::MediaSource::MediaSource(const MediaSource &other)
+
+ Constructs a copy of the \a other media source.
+
+ This constructor is fast thanks to explicit sharing.
+*/
+
+/*!
+ \fn MediaSource &Phonon::MediaSource::operator=(const MediaSource &other)
+
+ Assigns the \a other media source to this media source and returns a
+ reference to it.
+
+ This operation is fast thanks to explicit sharing.
+*/
+
+/*!
+ \fn bool Phonon::MediaSource::operator==(const MediaSource &other) const
+
+ Returns true if this media source is equal to the \a other media source;
+ otherwise returns false.
+*/
+
+/*!
+ \fn void Phonon::MediaSource::setAutoDelete(bool enable)
+
+ If \a enable is true, the media source will take ownership of the
+ object passed in the \l{Phonon::}{MediaSource}'s constructor
+ object that was passed in the constructor; otherwise, the
+ programmer is responsible for deletion of this object.
+
+ This setting is false by default. If you enable it, you should
+ only access the stream or device as long as you keep the media
+ source object around. As long as you keep the media source
+ wrapping the stream or device, the object will not get deleted.
+
+ \sa autoDelete()
+*/
+
+/*!
+ \fn bool Phonon::MediaSource::autoDelete() const
+
+ Returns the setting of the auto-delete option. The default is
+ false.
+
+ \sa setAutoDelete()
+*/
+
+/*!
+ \fn Type Phonon::MediaSource::type() const
+
+ Returns the type of the MediaSource (depends on the constructor
+ that was used).
+
+ \sa Type
+*/
+
+/*!
+ \fn QString Phonon::MediaSource::fileName() const
+
+ Returns the file name of the MediaSource if type() ==
+ LocalFile; otherwise, returns QString().
+
+ \sa type()
+*/
+
+/*!
+ \fn QUrl Phonon::MediaSource::url() const
+ Returns the URL of the MediaSource if type() == URL or type() == LocalFile;
+ otherwise returns QUrl().
+
+ \sa type()
+*/
+
+/*!
+ \fn Phonon::DiscType Phonon::MediaSource::discType() const
+ Returns the disc type of the MediaSource if type() == Disc; otherwise
+ returns NoDisc.
+
+ \sa type()
+*/
+
+/*!
+ \fn QString Phonon::MediaSource::deviceName() const
+
+ Returns the device name of the MediaSource if type() == Disc; otherwise
+ returns QString().
+
+ \sa type()
+*/
+
+/*!
+ \fn AbstractMediaStream *Phonon::MediaSource::stream() const
+ \internal
+ Returns the media stream of the MediaSource if type() == Stream; otherwise
+ returns 0.
+ QIODevices are handled as streams, too.
+*/
+
+/*!
+ \class Phonon::MediaSourcePrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::SeekSlider
+ \inmodule Phonon
+ \inheaderfile Phonon/SeekSlider
+ \since 4.4
+ \brief The SeekSlider class provides a slider for seeking to positions in media streams.
+
+ The SeekSlider connects to a \l{Phonon::}{MediaObject}, and
+ controls the seek position in the object's media stream.
+
+ The slider will connect to the necessary signals to keep track of
+ the sliders maximum, minimum, and current values. It will also
+ disable itself for non-seekable streams, and update the media
+ object when the current value of the slider changes.
+
+ Here follows a typical example of SeekSlider usage:
+
+ \snippet doc/src/snippets/seekslider.cpp 0
+
+ \sa Phonon::VolumeSlider, Phonon::VideoWidget, {Music Player Example}, {Phonon Module}
+
+*/
+
+/*!
+ \property Phonon::SeekSlider::iconVisible
+ \brief whether the icon next to the slider is visible
+
+ By default the icon is visible if the platform provides an icon; else
+ it's hidden.
+
+*/
+
+/*!
+ \property Phonon::SeekSlider::tracking
+ \brief whether slider tracking is enabled
+
+ If tracking is enabled (the default), the media seeks
+ while the slider is being dragged. If tracking is
+ disabled, the media seeks only when the user
+ releases the slider.
+*/
+
+/*!
+ \property Phonon::SeekSlider::pageStep
+ \brief the page step interval
+
+ The larger of two natural steps that a slider provides and
+ typically corresponds to the user pressing PageUp or PageDown.
+
+ Defaults to 5 seconds.
+*/
+
+/*!
+ \property Phonon::SeekSlider::singleStep
+ \brief the single step interval
+
+ The smaller of two natural steps that a slider provides and
+ typically corresponds to the user pressing an arrow key.
+
+ Defaults to 0.5 seconds.
+*/
+
+/*!
+ \property Phonon::SeekSlider::orientation
+ \brief the orientation of the slider
+
+ The orientation must be Qt::Vertical or Qt::Horizontal (the default).
+*/
+
+/*!
+ \property Phonon::SeekSlider::iconSize
+ \brief the icon size used for the mute button/icon.
+
+ The default size is defined by the GUI style.
+*/
+
+/*!
+ \fn explicit Phonon::SeekSlider::SeekSlider(QWidget *parent = 0)
+
+ Constructs a seek slider widget with the given \a parent.
+*/
+
+/*!
+ \fn explicit Phonon::SeekSlider::SeekSlider(MediaObject *media, QWidget *parent = 0)
+
+ Constructs a seek slider widget for the specified \a media with the
+ given \a parent.
+*/
+
+/*!
+ \fn Phonon::SeekSlider::~SeekSlider()
+ Destroys the seek slider.
+*/
+
+/*!
+ \fn Phonon::MediaObject *Phonon::SeekSlider::mediaObject() const
+
+ Return the media object this SeekSlider controls.
+*/
+
+/*!
+ \class Phonon::SeekSliderPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \fn void Phonon::SeekSlider::setMediaObject(MediaObject *media)
+
+ Sets the media object to be controlled by this slider to the \a media specified.
+*/
+
+/*!
+ \class Phonon::VideoPlayer
+ \inmodule Phonon
+ \inheaderfile Phonon/VideoPlayer
+ \since 4.4
+ \brief The VideoPlayer widget is used to perform playback of video.
+
+ With VideoPlayer you can get results quickly and easily. You can
+ do the standard playback tasks like play(), pause(), and stop(),
+ but also set a playback volume and seek - if the media and backend
+ supports seeking.
+
+ VideoPlayer is provided for convenience and removes the need to
+ create a media graph with a \l{Phonon::}{MediaObject},
+ \l{Phonon::}{AudioOutput}, and \l{Phonon::}{VideoWidget}. If
+ you need functionality not supported by the player, you can build
+ this \l{Building Graphs}{graph} yourself.
+
+ Keep in mind that when the VideoPlayer instance is deleted the
+ playback will stop.
+
+ Note also that most of the functions in this class are
+ asynchronous. For instance, a media source may not play
+ immediately after you call the play() function.
+
+ A play and forget code example:
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 4
+
+ \sa {Phonon Module}, MediaObject
+*/
+
+/*!
+ \fn Phonon::VideoPlayer::VideoPlayer(QWidget *parent = 0)
+
+ Constructs a new video widget with a \a parent using
+ Phonon::VideoCategory as its category.
+
+ \param parent The QObject parent.
+*/
+
+/*!
+ \fn Phonon::VideoPlayer::VideoPlayer(Phonon::Category category, QWidget *parent = 0)
+
+ Constructs a new VideoPlayer instance with the specified \a
+ parent.
+
+ \a category is the category used for the audio output device.
+*/
+
+/*!
+ \fn Phonon::VideoPlayer::~VideoPlayer()
+
+ On destruction the playback is stopped, also the audio output is
+ removed so that the desktop mixer will not show the application
+ anymore. If you need a persistent audio output don't use
+ VideoPlayer but MediaObject, VideoPath and VideoOutput.
+*/
+
+/*!
+ \fn qint64 Phonon::VideoPlayer::totalTime() const
+
+ Get the total time (in milliseconds) of the file currently being played.
+*/
+
+/*!
+ \fn qint64 Phonon::VideoPlayer::currentTime() const
+
+ Get the current time (in milliseconds) of the file currently being played.
+*/
+
+/*!
+ \fn float Phonon::VideoPlayer::volume() const
+
+ This is the current volume of the output as voltage factor.
+
+ 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%
+*/
+
+/*!
+ \fn bool Phonon::VideoPlayer::isPlaying() const
+
+ Returns true if it is currently playing; otherwise returns false if it
+ is currently stopped or paused
+*/
+
+/*!
+ \fn bool Phonon::VideoPlayer::isPaused() const
+
+ Returns true if it is currently paused; otherwise returns false if it
+ is currently playing or stopped.
+*/
+
+/*!
+ \fn void Phonon::VideoPlayer::load(const Phonon::MediaSource &source)
+
+ Starts pre-loading the media data from the specified \a source and
+ filling audio buffers in the backend.
+
+ When there's already a media playing (or paused) it will be stopped
+ (the finished signal will not be emitted).
+
+ \sa MediaObject::setCurrentSource()
+*/
+
+/*!
+ \fn void Phonon::VideoPlayer::play(const Phonon::MediaSource &source)
+
+ Plays the media from the given \a source. Starts playback as fast as
+ possible.
+ This can take a considerable time depending on the URL and the
+ backend.
+
+ If you need low latency between calling play() and the sound actually
+ starting to play on your output device you need to use MediaObject
+ and be able to set the URL before calling play(). Note that
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 5
+ doesn't make a difference: the application should be idle between the
+ load and play calls so that the backend can start preloading the
+ media and fill audio buffers.
+*/
+
+/*!
+ \fn void Phonon::VideoPlayer::play()
+
+ Continues playback of paused media. Restarts playback of a stopped
+ (or newly loaded) media.
+
+ \sa MediaObject::play(), play()
+*/
+
+/*!
+ \fn void Phonon::VideoPlayer::pause()
+
+ Pauses the playback.
+
+ \sa MediaObject::pause()
+*/
+
+/*!
+ \fn void Phonon::VideoPlayer::stop()
+
+ Stops the playback.
+
+ \sa MediaObject::stop()
+*/
+
+/*!
+ \fn void Phonon::VideoPlayer::seek(qint64 ms)
+
+ Seeks to the requested time. Note that the backend is free to
+ ignore the seek request if the media source isn't seekable; you
+ can check this by asking the media object of the VideoPlayer.
+
+ \snippet doc/src/snippets/videomedia.cpp 0
+
+ The \a ms parameter is the time in milliseconds from the start of
+ the media.
+
+ The call is asynchronous, so currentTime() can still be the old
+ value right after this method was called. If all you need is a
+ slider that shows the current position and allows the user to
+ seek, use the class SeekSlider.
+
+ \sa MediaObject::seek(), MediaObject::isSeekable(), mediaObject()
+*/
+
+/*!
+ \fn void Phonon::VideoPlayer::setVolume(float volume)
+
+ Sets the \a volume of the output as voltage factor.
+
+ 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%
+*/
+
+/*!
+ \fn MediaObject *Phonon::VideoPlayer::mediaObject() const
+
+ Returns the media object being used by the player.
+
+ The media object can be accessed directly instead of using the
+ \l{VideoPlayer}s convenience functions, e.g., play() and stop().
+ It is also possible to give the object to other Phonon widgets,
+ e.g., a \l{Phonon::}{SeekSlider} or a \l{Phonon::}{VolumeSlider}.
+
+ \sa Phonon::SeekSlider, Phonon::MediaObject
+*/
+
+/*!
+ \fn AudioOutput *Phonon::VideoPlayer::audioOutput() const
+
+ Returns the audio output object being used by the player.
+
+*/
+
+/*!
+ \fn VideoWidget *Phonon::VideoPlayer::videoWidget() const
+
+ Returns the video widget being used by the player.
+*/
+
+/*!
+ \fn void Phonon::VideoPlayer::finished()
+
+ This signal is emitted when the playback finished.
+
+*/
+
+/*!
+ \class Phonon::VideoWidgetPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::MediaObject
+ \inmodule Phonon
+ \inheaderfile Phonon/MediaObject
+ \since 4.4
+ \brief The MediaObject class provides an interface for media playback.
+
+
+ The media object manages a \l{Phonon::}{MediaSource}, which
+ supplies the media object with multimedia content, e.g., from a
+ file. A playback in Phonon is always started by calling the
+ \l{Phonon::MediaObject::}{play()} function.
+
+ The state of play (play, pause, stop, seek) is controlled by the
+ media object, and you can also query the current
+ \l{Phonon::MediaObject::}{state()}. It keeps track of the playback
+ position in the media stream, and emits the
+ \l{Phonon::MediaObject::}{tick()} signal when the current position
+ in the stream changes.
+
+ Notice that most functions of this class are asynchronous, so you
+ cannot rely on that a state is entered after a function call
+ before you receive the \l{Phonon::MediaObject::}{stateChanged()}
+ signal. The description of the \l{Phonon::}{State} enum gives a
+ description of the different states.
+
+ Before play() is called, the media object should be connected to
+ \l{Sinks}{output nodes}, which outputs the media to the
+ underlying hardware. The output nodes required are dependent on
+ the contents of the multimedia file that is played back. Phonon
+ has currently two output nodes: the \l{Phonon::}{AudioOutput} for
+ audio content and \l{Phonon::}{VideoWidget} for video content. If
+ a \l{Phonon::}{MediaSource} contains both audio and video, both
+ nodes need to be connected to the media object.
+
+ \snippet snippets/phonon.cpp 4
+ \snippet snippets/phonon.cpp 5
+
+ The media object can queue sources for playback. When it has
+ finished to play one source, it will start playing the next in the
+ queue; the new source is then removed from the queue. The
+ queue can be altered at any time.
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 7
+
+ You can also make use of the
+ \l{Phonon::MediaObject::}{aboutToFinish()} signal, which is
+ guaranteed to be emitted in time for altering the queue.
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 8
+
+ When playback is finishing, i.e., when a media source has been
+ played to the end and the queue is empty, several signals are
+ emitted. First, the media object will emit aboutToFinish() -
+ shortly before the playback has finished - and then finished().
+ The stateChanged() signal will also be emitted with
+ \l{Phonon::}{PausedState}, which is the state the media object
+ takes when the playback is finished. If you wish to enter another
+ state, you can connect a slot to finished() and set a new state
+ there.
+
+ The media object resolves the meta information, such as title,
+ artist, and album. The meta data is not resolved immediately after
+ a new source is provided, but will be resolved before the object
+ leaves the \l{Phonon::}{LoadingState}. The data is queried by
+ string keys - which should follow the Ogg Vorbis specification
+ \l http://xiph.org/vorbis/doc/v-comment.html - or by using the
+ \l{Phonon::}{MetaData} enum. The data available will depend on the
+ type and content of the individual media files. metaDataChanged()
+ will be emitted when the media object has resolved new meta data.
+
+ Errors encountered during playback and loading of media sources
+ are reported by emitting a state changed signal with
+ \l{Phonon::}{ErrorState}. The severity of the error can be queried
+ by the \l{Phonon::}{ErrorType}. With a \l{Phonon::}{NormalError},
+ it might be possible to continue the playback, for instance, if
+ only audio playback fails for a media source which also has video.
+ A \l{Phonon::}{FatalError} indicates that Phonon cannot continue
+ playback of the current source, but it is possible to try with a
+ different one. A user readable error message is given by
+ errorString().
+
+ \sa Phonon::MediaSource, Phonon::AudioOutput, VideoWidget,
+ {Music Player Example}, {Phonon Overview}, Phonon::VideoPlayer,
+ Phonon::createPlayer(), {Phonon Module}
+
+*/
+
+/*!
+ \property Phonon::MediaObject::transitionTime
+ \brief Defines the time between playback of two media sources
+ in the media queue.
+
+ A positive transition time defines a gap of silence between queued
+ media sources.
+
+ A transition time of 0 ms requests gapless playback (i.e., the
+ next source in the media queue starts immediately after the
+ playback of the current source finishes).
+
+ A negative transition time defines a crossfade between the queued
+ media sources.
+
+ Defaults to 0 (gapless playback).
+
+ \warning This feature might not work reliably with every
+ backend.
+*/
+
+/*!
+ \property Phonon::MediaObject::prefinishMark
+ \brief the time when the prefinishMarkReached signal is emitted before playback ends.
+
+ This property specifies the time in milliseconds the
+ prefinishMarkReached() signal is emitted before the playback
+ finishes. A value of \c 0 disables the signal. The signal is only
+ emitted for the last source in the \l{queue()}{media queue}.
+
+ Defaults to \c 0 (disabled).
+
+ \warning For some media data the total time cannot be determined
+ accurately, therefore the accuracy of the prefinishMarkReached signal
+ can be bad sometimes. Still, it is better to use this method than to
+ look at totalTime() and currentTime() to emulate the behavior
+ because the backend might have more information available than your
+ application does through totalTime() and currentTime().
+
+ \sa prefinishMarkReached()
+*/
+
+/*!
+ \property Phonon::MediaObject::tickInterval
+ \brief The time interval in milliseconds between two ticks.
+
+ The tick() signal is emitted continuously during playback.
+ The tick interval is the time that elapses between the emission of two tick signals.
+ If you set the interval to \c 0 the tick signal gets disabled.
+
+ The tick() signal can, for instance, be used to update widgets
+ that show the current position in the playback of a media source.
+
+ Defaults to \c 0 (disabled).
+
+ \warning The back-end is free to choose a different tick interval close
+ to what you asked for. This means that the following code \c may fail:
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 9
+ On the other hand the following is guaranteed:
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 10
+
+ \sa tick()
+*/
+
+/*!
+ \fn Phonon::MediaObject::~MediaObject()
+
+ Destroys the MediaObject.
+*/
+
+/*!
+ \fn State Phonon::MediaObject::state() const
+
+ Returns the current Phonon::State of the object.
+
+ \sa Phonon::State, stateChanged()
+*/
+
+/*!
+ \fn bool Phonon::MediaObject::hasVideo() const
+
+ Check whether the current media source includes a video stream.
+
+ \warning This information is not resolved immediately after a
+ media object gets a new source. Listen to the hasVideoChanged()
+ signal instead.
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 11
+
+ Returns \c true if the media contains video data; otherwise,
+ returns \c false.
+
+ \sa hasVideoChanged()
+*/
+
+/*!
+ \fn bool Phonon::MediaObject::isSeekable() const
+
+ Check whether it is possible to seek, i.e., change the
+ playback position in the media stream.
+
+ \warning This information is not solved immediately after the
+ media object gets a new media source. The hasVideoChanged() signal
+ is emitted after this information is available.
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 12
+
+ Returns \c true if the current media may be seeked; otherwise,
+ returns \c false.
+
+ \sa seekableChanged()
+*/
+
+/*!
+ \fn QStringList Phonon::MediaObject::metaData(const QString &key) const
+
+ Returns the strings associated with the given \a key.
+
+ Backends should use the keys specified in the Ogg Vorbis
+ documentation: \l http://xiph.org/vorbis/doc/v-comment.html
+
+ Therefore the following should work with every backend:
+
+ Note that meta data is not resolved before the \c
+ metaDataChanged() signal is emitted.
+
+ A typical usage looks like this:
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 13
+*/
+
+/*!
+ \fn QStringList Phonon::MediaObject::metaData(Phonon::MetaData key) const
+
+ Returns the strings associated with the given \a key.
+
+ Same as above except that the keys are defined in the
+ Phonon::MetaData enum.
+
+ \sa metaDataChanged()
+*/
+
+/*!
+ \fn QMultiMap Phonon::MediaObject::metaData() const
+
+ Returns all meta data in a multi map.
+
+ \sa metaDataChanged()
+*/
+
+/*!
+ \fn QString Phonon::MediaObject::errorString() const
+
+ Returns a human-readable description of the last error that occurred.
+ The strings given may vary between backends.
+
+ The error description can be used to give a message to the user -
+ and the developer - when the stateChanged() signal is emitted with
+ \l{Phonon::}{ErrorState}.
+
+ \section1 Qt Backends
+
+ On Windows, Qt fetches its error messages from the DirectShow
+ backend. This usually includes an error number, which can be
+ looked up in the DirectShow documentation:
+ \l{http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx81_c/directx_cpp/htm/errorandsuccesscodes.asp}.
+
+ On Linux and Mac, the error strings are not fetched directly from
+ the backend, but are created in the backend.
+
+ \sa Phonon::ErrorState, stateChanged()
+*/
+
+/*!
+ \fn ErrorType Phonon::MediaObject::errorType() const
+
+ Tells your program what to do about the last error that occurred.
+ Use this function after receiving a stateChanged() signal with
+ \l{Phonon::}{ErrorState}.
+
+ \sa Phonon::ErrorType, Phonon::ErrorState, stateChanged()
+*/
+
+/*!
+ \fn MediaSource Phonon::MediaObject::currentSource() const
+
+ Returns the current media source, i.e., the media source that is
+ being played back. The current source is either set with
+ setCurrentSource() or taken from the media queue() when a media
+ source has finished playing.
+
+ \sa setCurrentSource()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::setCurrentSource(const MediaSource &source)
+
+ Set the media source the MediaObject should use.
+
+ After the media object receives a new source, it will enter the
+ \l{Phonon::}{LoadingState}. When it is ready to play, it
+ enters the \l{Phonon::}{StoppedState} unless another state
+ has been requested, e.g., by calling play().
+
+ \a source is the MediaSource object to the media data. You can
+ just as well use a QUrl or QString (for a local file) here.
+
+ We show an example:
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 14
+
+ \sa currentSource(), MediaSource
+*/
+
+/*!
+ \fn QList Phonon::MediaObject::queue() const
+
+ Returns the queued media sources.
+
+ This does list does not include the current source,
+ returned by currentSource().
+
+ \sa enqueue()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::setQueue(const QList &sources)
+
+ Set the \a sources to play when the current source has finished.
+
+ This function will overwrite the current queue.
+
+ \sa clearQueue(), enqueue()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::setQueue(const QList &urls)
+
+ Set the \a urls to play when the current media has finished.
+
+ This function overwrites the current queue.
+
+ \sa clearQueue(), enqueue()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::enqueue(const MediaSource &source)
+
+ Appends \a source to the queue.
+
+ You can use this function to provide the next source after the
+ aboutToFinish() signal has been emitted.
+
+ \sa aboutToFinish(), setQueue(), clearQueue()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::enqueue(const QList &sources)
+
+ Appends multiple \a sources to the queue.
+
+ \sa setQueue(), clearQueue()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::enqueue(const QList &urls)
+
+ Appends the URLs in \a urls to the media source queue.
+
+ The function will create \l{MediaSource}s from the \l{QUrl}s, and
+ append these to the queue.
+
+ \sa setQueue(), clearQueue()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::clearQueue()
+
+ Clears the queue of media sources.
+
+ \sa queue(), enqueue()
+*/
+
+/*!
+ \fn qint64 Phonon::MediaObject::currentTime() const
+
+ Returns the current time (in milliseconds), i.e., position in the
+ media stream, of the file currently being played.
+
+ \sa tick(), totalTime(), remainingTime()
+*/
+
+/*!
+ \fn qint64 Phonon::MediaObject::totalTime() const
+
+ Get the total time (in milliseconds) of the file currently being played.
+
+ Returns the total time in milliseconds.
+
+ \warning The total time is not defined before the media object
+ enters the \l{Phonon::}{LoadingState}.
+
+ \sa totalTimeChanged()
+*/
+
+/*!
+ \fn qint64 Phonon::MediaObject::remainingTime() const
+
+ Get the remaining time (in milliseconds) of the file currently being played.
+
+ Returns the remaining time in milliseconds.
+
+ \sa totalTime(), currentTime(), totalTimeChanged()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::play()
+
+ Requests playback of the media data to start.
+
+ Playback starts when the stateChanged() signal is emitted with
+ \l{Phonon::}{PlayingState}.
+
+ If the media object is already in a
+ \l{Phonon::}{PlayingState}, nothing happens.
+
+ \sa stop(), pause(), stateChanged()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::pause()
+
+ Requests playback to pause, and the media object to enter the
+ \l{Phonon::}{PausedState}. If it was paused already, nothing
+ changes.
+
+ This function is asynchronous and the media might not be paused
+ immediately.
+
+ \sa play(), stop(), stateChanged()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::stop()
+
+ Requests playback to stop, and the media object to enter the
+ \l{Phonon::}{StoppedState}. If it was stopped before
+ nothing changes.
+
+ This function is asynchronous and the media might not be
+ stopped immediately.
+
+ \sa play(), pause(), stateChanged()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::seek(qint64 time)
+
+ Requests a seek to the \a time indicated, specified in milliseconds.
+
+ You can only seek if state() is PlayingState, BufferingState or PausedState.
+
+ The call is asynchronous, so currentTime can still be the old
+ value right after this method was called. If all you need is a
+ slider that shows the current position and allows the user to
+ seek, use the class SeekSlider.
+
+ If the current source of the media object is not seekable, calls
+ to this functions do nothing.
+
+ \sa SeekSlider, tick()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::clear()
+
+ Stops and removes all playing and enqueued media sources.
+
+ \sa setCurrentSource()
+*/
+
+
+/*!
+ \fn void Phonon::MediaObject::stateChanged(Phonon::State newstate, Phonon::State oldstate)
+
+ This signal is emitted when the state of the MediaObject has changed.
+ The \a oldstate and \a newstate parameters indicate the previous
+ state and current state of the media object.
+
+ If you are only interested in the new state of the media object, you can
+ connect this signal to a slot that accepts only one State argument.
+*/
+
+/*!
+ \fn void Phonon::MediaObject::tick(qint64 time)
+
+ This signal is emitted in intervals defined by the
+ \l{tickInterval} property. The current position of the media
+ object in the stream is given by the \a time parameter. The \a
+ time is specified in milliseconds.
+
+ \sa tickInterval
+*/
+
+/*!
+ \fn void Phonon::MediaObject::metaDataChanged()
+
+ This signal is emitted when the media object has resolved new meta
+ data. This will happen before the media object leaves the
+ \l{Phonon::}{LoadingState} after a new source has been set.
+
+ This signal is not emitted when the media object removes the
+ current data, i.e., when a new source is set or an error has
+ occurred. If you need to know this, you can listen for the
+ \l{Phonon::}{ErrorState}, and connect to the
+ \l{Phonon::MediaObject::}{currentSourceChanged()} signal.
+
+ You can get the new meta data with the metaData methods.
+
+ \sa metaData(), currentSourceChanged(), stateChanged(), Phonon::State
+*/
+
+/*!
+ \fn void Phonon::MediaObject::seekableChanged(bool isSeekable)
+
+ This signal is emitted when the media object's ability to seek in
+ the media stream changes. \a isSeekable is true if it is possible
+ to seek(); otherwise, it is false.
+
+ Change in the ability to seek in the stream usually happens when
+ the current source changes or when an error occurs.
+
+ \omit Emitted whenever the return value of isSeekable()
+ changes. \endomit
+
+ Normally you'll check isSeekable() after setting a new media
+ source, and then let this signal tell you when seeking is
+ possible. That way you don't have to poll isSeekable().
+*/
+
+/*!
+ \fn void Phonon::MediaObject::hasVideoChanged(bool hasVideo)
+
+ Emitted whenever the return value of hasVideo() changes, i.e.,
+ the media source being played back contains video.
+
+ Normally you'll check hasVideo() first and then let this signal
+ tell you whether video is available now or not. That way you
+ don't have to poll hasVideo().
+
+ \a hasVideo is true when the stream contains video and adding a
+ VideoWidget will show a video, and false if there is no video data
+ in the stream and adding a VideoWidget will show an empty (black)
+ VideoWidget.
+*/
+
+/*!
+ \fn void Phonon::MediaObject::bufferStatus(int percentFilled)
+
+ Provides information about the status of the buffer.
+
+ When a MediaObject is in the \l{Phonon::}{BufferingState}, it will
+ send this signal regularly. \a percentFilled is a number between 0
+ and 100 telling you how much the buffer is filled.
+
+ You can use this signal to show a progress bar to the user when
+ in BufferingState:
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 15
+
+ Note that the \l{Phonon::}{BufferingState} is commonly used when
+ waiting for data over a network connection, but this might not be
+ true for all backends.
+*/
+
+/*!
+ \fn void Phonon::MediaObject::finished()
+
+ Emitted when the object has finished playback. It is not emitted
+ if you call stop(), pause() or load(). It is emitted only when the
+ current media source has finished playing and the media queue() is
+ empty, or when a \l{Phonon::FatalError}{fatal error} occurs.
+
+ \warning This signal is not emitted when the current source has
+ finished and there's another source in the queue. It is only
+ emitted when the queue is empty.
+
+ \sa currentSourceChanged(), aboutToFinish(), prefinishMarkReached()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::currentSourceChanged(const Phonon::MediaSource &newSource)
+
+ Emitted when the MediaObject fetches a new MediaSource from the
+ queue() and before it enters the \l{Phonon::}{LoadingState} for
+ the new source. The media object will take a new source from the
+ queue() when it has finished the playback of the
+ \l{currentSource()}{current source}.
+
+ \a newSource is the source that starts to play at the time the
+ signal is emitted.
+*/
+
+/*!
+ \fn void Phonon::MediaObject::aboutToFinish()
+
+ Emitted before the playback of the whole queue ends. When this
+ signal is emitted you still have time to enqueue() a new
+ MediaSource, so that playback continues.
+
+ If you need a signal to be emitted at a specific time before
+ playback is finished, you should use the prefinishMarkReached()
+ signal instead.
+
+ \sa enqueue(), prefinishMark, prefinishMarkReached()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::prefinishMarkReached(qint32 msecToEnd)
+
+ Emitted when there are only \a msecToEnd milliseconds left
+ of playback.
+
+ \warning This signal is not emitted when there is another source
+ in the queue. It is only emitted when the queue is empty.
+
+ \sa setPrefinishMark(), prefinishMark(), aboutToFinish(), finished()
+*/
+
+/*!
+ \fn void Phonon::MediaObject::totalTimeChanged(qint64 newTotalTime)
+
+ This signal is emitted as soon as the total time of the media file is
+ known or has changed. For most non-local media data the total
+ time of the media can only be known after some time. At that time the
+ totalTime function can not return useful information. You have
+ to wait for this signal to know the real total time.
+
+ \a newTotalTime is the length of the media file in milliseconds.
+
+ \sa totalTime()
+*/
+
+/*!
+ \fn MediaObject *Phonon::createPlayer(Phonon::Category category, const MediaSource &source = MediaSource())
+
+ Convenience function to create a MediaObject and AudioOutput
+ connected by a path. The \l{Phonon::}{MediaObject} return will
+ have \a source set as its current source and the specified \a
+ category.
+
+*/
+
+/*!
+ \class Phonon::MediaObjectPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \namespace Phonon::BackendCapabilities
+ \inmodule Phonon
+ \since 4.4
+ \brief The BackendCapabilities namespace contains functions to describe the capabilities of the multimedia backend.
+
+*/
+
+/*!
+ \class Phonon::BackendCapabilitiesPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::BackendCapabilities::Notifier
+ \since 4.4
+ \inmodule Phonon
+ \inheaderfile Phonon/BackendCapabilities
+
+ Notifications about backend capabilities.
+*/
+
+/*!
+ \fn void Phonon::BackendCapabilities::Notifier::capabilitiesChanged()
+
+ This signal is emitted if the capabilities have changed. This can
+ happen if the user has requested a backend change.
+*/
+
+/*!
+ \fn void Phonon::BackendCapabilities::Notifier::availableAudioOutputDevicesChanged()
+
+ This signal is emitted when audio output devices were plugged or
+ unplugged.
+
+ Check BackendCapabilities::availableAudioOutputDevices to get the
+ current list of available devices.
+*/
+
+/*!
+ \fn Notifier *Phonon::BackendCapabilities::notifier()
+
+ Use this function to get a QObject pointer to connect to the capabilitiesChanged signal.
+
+ \return a pointer to a QObject.
+
+ The capabilitiesChanged signal is emitted if the capabilities have changed. This can
+ happen if the user has requested a backend change.
+
+ To connect to this signal do the following:
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 16
+
+ \sa Notifier::capabilitiesChanged()
+*/
+
+/*!
+ \fn QStringList Phonon::BackendCapabilities::availableMimeTypes()
+
+ Returns a list of mime types that the Backend can decode.
+
+ \sa isMimeTypeAvailable()
+*/
+
+/*!
+ \fn bool Phonon::BackendCapabilities::isMimeTypeAvailable(const QString &mimeType)
+
+ Often all you want to know is whether one given MIME type can be
+ decoded by the backend. Use this method in favor of
+ availableMimeTypes() as it can give you a negative answer without
+ having a backend loaded.
+
+ Returns true if the given \a mimeType is supported by the backend;
+ otherwise, returns false.
+
+ \sa availableMimeTypes()
+*/
+
+/*!
+ \fn QList Phonon::BackendCapabilities::availableAudioOutputDevices()
+
+ Returns the audio output devices the backend supports.
+
+ \return A list of AudioOutputDevice objects that give a name and
+ description for every supported audio output device.
+*/
+
+/*!
+ \fn QList Phonon::BackendCapabilities::availableAudioEffects()
+
+ Returns descriptions for the audio effects the backend supports.
+
+ \return A list of AudioEffectDescription objects that give a name and
+ description for every supported audio effect.
+*/
+
+/*!
+ \internal
+ \class ObjectDescriptionModelData
+ \internal
+ \inmodule Phonon
+ \brief Data class for models for ObjectDescription objects.
+*/
+
+/*!
+ \typedef Phonon::EffectDescription
+ \relates Phonon::ObjectDescription
+
+ EffectDescription gives a description of an \l{Processors}{audio
+ effect}. It is a typedef of the \l{Phonon::}{ObjectDescription}
+ class. Please see its class description for details.
+
+ EffectDescription is used to create audio \l{Phonon::}{Effect}s,
+ which can be inserted into a media graph, altering an audio
+ stream.
+
+ \sa Phonon::ObjectDescription, {Capabilities Example}, {Media
+ Player}
+
+*/
+
+/*!
+ \class Phonon::ObjectDescriptionModel
+ \inmodule Phonon
+ \internal
+ \since 4.4
+ \brief The ObjectDescriptionModel class provides a model from
+ a list of ObjectDescription objects.
+
+ ObjectDescriptionModel is a read only model that supplies a list
+ using ObjectDescription::name() for the text and
+ ObjectDescription::description() for the tooltip. If set the properties
+ "icon" and "available" are used to set the decoration and disable the
+ item (disabled only visually, you can still select and drag it).
+
+ It also provides the methods moveUp() and moveDown() to order the list.
+ Additionally drag and drop is possible so that
+ QAbstractItemView::InternalMove can be used.
+ The resulting order of the ObjectDescription::index() values can then be
+ retrieved using tupleIndexOrder().
+
+ An example use case would be to give the user a QComboBox to select
+ the output device:
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 17
+
+ And to retrieve the selected AudioOutputDevice:
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 18
+
+*/
+
+/*!
+ \fn inline int Phonon::ObjectDescriptionModel::rowCount(const QModelIndex &parent = QModelIndex()) const
+
+ Returns the number of rows in the model. This value corresponds
+ to the size of the list passed through setModelData.
+
+ \param parent The optional \a parent argument is used in most models to specify
+ the parent of the rows to be counted. Because this is a list if a
+ valid parent is specified the result will always be 0.
+
+ Reimplemented from QAbstractItemModel.
+
+ \sa QAbstractItemModel::rowCount()
+*/
+
+/*!
+ \fn inline QVariant Phonon::ObjectDescriptionModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const
+
+ Returns data from the item with the given \a index for the specified
+ \a role.
+ If the view requests an invalid index, an invalid variant is
+ returned.
+
+ Reimplemented from QAbstractItemModel.
+
+ \sa QAbstractItemModel::data(), Qt::ItemDataRole
+*/
+
+/*!
+ \fn inline Qt::ItemFlags Phonon::ObjectDescriptionModel::flags(const QModelIndex &index) const
+ \internal
+
+ Reimplemented to show unavailable devices as disabled (but still
+ selectable). The \a index of the model index for which to return
+ flags.
+
+*/
+
+/*!
+ \fn inline QList Phonon::ObjectDescriptionModel::tupleIndexOrder() const
+
+ Returns a list of indexes in the same order as they are in the
+ model. The indexes come from the ObjectDescription::index
+ method.
+
+ This is useful to let the user define a list of preference.
+*/
+
+/*!
+ \fn inline int Phonon::ObjectDescriptionModel::tupleIndexAtPositionIndex(int positionIndex) const
+
+ Returns the ObjectDescription::index for the tuple
+ at the given position \a positionIndex. For example a
+ QComboBox will give you the currentIndex as the
+ position in the list. But to select the according
+ AudioOutputDevice using AudioOutputDevice::fromIndex
+ you can use this method.
+
+ \param positionIndex The position in the list.
+*/
+
+/*!
+ \class Phonon::ObjectDescriptionModelDataPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \fn inline QMimeData *Phonon::ObjectDescriptionModel::mimeData(const QModelIndexList &indexes) const
+ \internal
+
+ Returns the MIME data that dropMimeData() can use to create new
+ items.
+*/
+
+/*!
+ \fn inline void Phonon::ObjectDescriptionModel::moveUp(const QModelIndex &index)
+
+ Moves the item at the given \a index up. In the resulting list
+ the items at index.row() and index.row() - 1 are swapped.
+
+ Connected views are updated automatically.
+*/
+
+/*!
+ \fn inline void Phonon::ObjectDescriptionModel::moveDown(const QModelIndex &index)
+
+ Moves the item at the given \a index down. In the resulting list
+ the items at index.row() and index.row() + 1 are swapped.
+
+ Connected views are updated automatically.
+*/
+
+/*!
+ \fn explicit inline Phonon::ObjectDescriptionModel::ObjectDescriptionModel(QObject *parent = 0)
+
+ Constructs a ObjectDescription model with the
+ given \a parent.
+*/
+
+/*!
+ \fn explicit inline Phonon::ObjectDescriptionModel::ObjectDescriptionModel(const QList > &data, QObject *parent = 0)
+
+ Constructs a ObjectDescription model with the
+ given \a parent and the given \a data.
+*/
+
+/*!
+ \fn inline void Phonon::ObjectDescriptionModel::setModelData(const QList > &data)
+
+ Sets the model data using the list provided by \a data.
+
+ All previous model data is cleared.
+*/
+
+/*!
+ \fn inline QList > Phonon::ObjectDescriptionModel::modelData() const
+
+ Returns the model data.
+
+ As the order of the list might have changed this can be different
+ to what was set using setModelData().
+*/
+
+/*!
+ \fn inline ObjectDescription Phonon::ObjectDescriptionModel::modelData(const QModelIndex &index) const
+
+ Returns one ObjectDescription of the model data for the given \a index.
+*/
+
+/*!
+ \fn inline Qt::DropActions Phonon::ObjectDescriptionModel::supportedDropActions() const
+
+ This model supports drag and drop to copy or move
+ items.
+*/
+
+/*!
+ \fn inline bool Phonon::ObjectDescriptionModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
+
+ Accept drops from other models of the same ObjectDescriptionType.
+
+ The \a data is dropped at the given \a row and \a column; you
+ also receive the \a parent model index.
+
+ If a valid \a parent is given the dropped items will be inserted
+ above that item.
+*/
+
+/*!
+ \fn inline bool Phonon::ObjectDescriptionModel::removeRows(int row, int count, const QModelIndex &parent = QModelIndex())
+
+ Removes count rows starting with the given row.
+
+ If a valid \a parent is given no rows are removed since this is a
+ list model.
+
+ Returns true if the rows were successfully removed; otherwise returns false.
+*/
+
+/*!
+ \fn inline QStringList Phonon::ObjectDescriptionModel::mimeTypes() const
+
+ Returns a list of supported drag and drop MIME types. Currently
+ it only supports one type used internally.
+*/
+
+/*!
+ \class Phonon::EffectInterface
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::Effect
+ \inmodule Phonon
+ \inheaderfile Phonon/Effect
+ \since 4.4
+ \brief The Effect class is used to transform audio streams.
+
+ An effect is a media node which is inserted into a path between a
+ \l{Phonon::}{MediaObject} and an audio output node, for instance,
+ an \l{Phonon::}{AudioOutput}. The Effect transforms the media
+ stream on that path.
+
+ Examples may include simple modifiers, such as fading or pitch
+ shifting, and more complex mathematical transformations. You can
+ query the backend for available effects with
+ BackendCapabilities::availableAudioEffects(). Note that the
+ effects available is dependent on the underlying system
+ (DirectDraw, GStreamer, or QuickTime).
+
+ In order to use an effect, insert it into the path as follows:
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 19
+
+ The effect will immediately begin applying it's transformations on
+ the path. To stop it, remove the Effect from the path.
+
+ To create an effect, you use the \l{Phonon::}{EffectDescription}
+ class, which you get from
+ \l{BackendCapabilities::}{availableAudioEffects()}. We give a code
+ example below.
+
+ \snippet doc/src/snippets/audioeffects.cpp 0
+
+ An effect can have one or more parameters, which let you alter how
+ the effect works, for instance, by specifying the depth of a
+ reverb effect. See the EffectParameter class description for
+ details.
+
+ Phonon also provides EffectWidget, which lets the user modify the
+ parameters of an effect an the fly; e.g., with combo boxes.
+
+ \sa {Phonon Module}, EffectWidget
+*/
+
+/*!
+ \fn explicit Phonon::Effect::Effect(const EffectDescription &description, QObject *parent = 0)
+
+ Constructs a new effect object with the given \a description and \a parent object.
+
+ The EffectDescription object determines the type of the effect.
+
+ \sa {Phonon::BackendCapabilities::availableAudioEffects()}
+*/
+
+/*!
+ \fn Phonon::Effect::Effect(EffectPrivate &dd, QObject *parent)
+ \internal
+*/
+
+/*!
+ \fn Phonon::Effect::~Effect()
+ \internal
+*/
+
+/*!
+ \fn QVariant Phonon::Effect::parameterValue(const EffectParameter ¶meter) const
+
+ Returns the value of the given effect \a parameter. You can fetch
+ the available parameters for an effect with parameters().
+
+ \sa setParameterValue(), EffectParameter
+*/
+
+/*!
+ \fn void Phonon::Effect::setParameterValue(const EffectParameter ¶meter, const QVariant &value)
+
+ Sets the given effect \a parameter to the specified \a value.
+
+ Parameters for an effect are returned by parameters(). You can
+ check which QVariant::Type an EffectParameter takes with the
+ EffectParameter::type() function.
+
+ \sa parameterValue(), EffectParameter
+*/
+
+/*!
+ \fn EffectDescription Phonon::Effect::description() const;
+
+ Returns the description of this effect. This is the same
+ description that was passed to the constructor.
+*/
+
+/*!
+ \fn QList Phonon::Effect::parameters() const;
+
+ Returns a list of parameters that this effect provides to control
+ its behavior.
+
+ \sa EffectParameter, EffectWidget
+*/
+
+/*!
+ \class Phonon::EffectPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::AudioOutput
+ \inmodule Phonon
+ \inheaderfile Phonon/AudioOutput
+ \since 4.4
+ \brief The AudioOutput class is used to send data to audio output devices.
+
+ The AudioOutput class plays sound over a sound device. The audio
+ output needs to be connected to a \l{Phonon::}{MediaObject} using
+ \l{Phonon::}{createPath()}. To start playback, you call
+ \l{Phonon::MediaObject::}{play()} on the media object.
+
+ \snippet snippets/phonon.cpp 2
+
+ The class supports changing the volume(). It is also possible to
+ mute the sound.
+
+ To find out what \l{Phonon::}{AudioOutputDevice}s are available
+ for AudioOutput, you can call
+ BackendCapabilities::availableAudioOutputDevices(). A default device is
+ selected by the backend, but it is possible to set the device to
+ be used with setOutputDevice(). The outputDeviceChanged() signal
+ will be emitted if the device changes.
+
+ If an error occurs with the playback, for instance, if no valid
+ output device is found, the media object will receive a
+ stateChanged() signal with the \l{Phonon::}{ErrorState}.
+
+ Note that the default values of properties are dependent on the
+ backend.
+
+ \sa Phonon::VolumeSlider, {Music Player Example}, BackendCapabilities, {Phonon Module}
+*/
+
+/*!
+ \property Phonon::AudioOutput::name
+
+ This is the name that appears in Mixer applications that control
+ the volume of this output.
+
+*/
+
+/*!
+ \property Phonon::AudioOutput::volume
+
+ This is the current loudness of the output. \omit The volume is a
+ real value between 0.0 (minimum) and 1.0 (maximum). The volume
+ follows the sound device used, with 1.0 being the maximum volume
+ the device can produce. \endomit
+
+ (it is using Stevens' law
+ to calculate the change in voltage internally).
+
+ \sa volumeDecibel
+*/
+
+/*!
+ \property Phonon::AudioOutput::volumeDecibel
+
+ This is the current volume of the output in decibel.
+
+ 0 dB means no change in volume, -6dB means an attenuation of the
+ voltage to 50% and an attenuation of the power to 25%, -inf dB means
+ silence.
+
+ \sa volume
+*/
+
+/*!
+ \property Phonon::AudioOutput::outputDevice
+ This property holds the (hardware) destination for the output.
+
+ The default device is determined by the \l{Phonon::}{Category} and the global
+ configuration for that category. Normally you don't need
+ to override this setting - letting the user change the global
+ configuration is the right choice. You can still override the
+ device though, if you have good reasons to do so.
+
+ \sa outputDeviceChanged()
+*/
+
+/*!
+ \property Phonon::AudioOutput::muted
+ This property tells whether the output is muted.
+
+ Muting the output has the same effect as calling setVolume(0.0).
+*/
+
+/*!
+ \fn explicit Phonon::AudioOutput::AudioOutput(Phonon::Category category, QObject *parent = 0)
+
+ Creates a new AudioOutput with the given \a parent that defines
+ output to a physical device.
+
+ The \a category can be used by mixer applications to group volume
+ controls of applications into categories. That makes it easier for
+ the user to identify the programs.
+ The category is also used for the default output device that is
+ configured centrally. As an example: often users want to have the
+ audio signal of a VoIP application go to their USB headset while
+ all other sounds should go to the internal soundcard.
+
+ \sa Phonon::categoryToString(), outputDevice
+*/
+
+/*!
+ \fn explicit Phonon::AudioOutput::AudioOutput(QObject *parent = 0)
+
+ Creates a new AudioOutput that defines output to the system
+ default device with the \{Phonon::Category::}{NoCategory} category
+
+ \sa Phonon::categoryToString(), outputDevice
+*/
+
+/*!
+ \fn Phonon::Category Phonon::AudioOutput::category() const
+
+ Returns the category of this output.
+
+ \sa Phonon::AudioOutput::AudioOutput()
+*/
+
+/*!
+ \fn void Phonon::AudioOutput::volumeChanged(qreal newVolume)
+
+ This signal is emitted whenever the volume has changed. As the
+ volume can change without a call to setVolume (calls over dbus)
+ this is important to keep a widget showing the current volume up
+ to date.
+
+ \a newVolume is the new volume level.
+
+ \sa setVolume(), volume()
+*/
+
+/*!
+ \fn void Phonon::AudioOutput::mutedChanged(bool muted)
+
+ This signal is emitted when the muted property has changed. The \a muted
+ value passed by the signal indicates the state of the muted property.
+ As this property can change by IPC (DBus) calls a UI element showing
+ the muted property should listen to this signal.
+*/
+
+/*!
+ \fn void Phonon::AudioOutput::outputDeviceChanged(const Phonon::AudioOutputDevice &newAudioOutputDevice)
+
+ This signal is emitted when the (hardware) device for the output
+ has changed. \a newAudioOutputDevice is the new device.
+
+ The change can happen either through setOutputDevice or if the
+ global configuration for the used category has changed.
+
+ \sa outputDevice
+*/
+
+/*!
+ \class Phonon::AudioOutputPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::EffectParameter
+ \inmodule Phonon
+ \inheaderfile Phonon/EffectParameter
+ \since 4.4
+ \brief The EffectParameter class describes one parameter of an effect.
+
+ You fetch the parameters of an \l{Phonon::}{Effect} with
+ \l{Phonon::}{Effect::parameters()}.
+
+ \snippet doc/src/snippets/phononeffectparameter.cpp 0
+
+ To describe itself, an effect parameter gives a name() and
+ possibly description() (depending on the backend used). These are
+ suited to present the effect parameter to the user of a Phonon
+ application.
+
+ Note that effects are created by the backend, and that
+ their name and descriptions may vary.
+
+ The value of an effect parameter is stored in a \l{QVariant},
+ of which type() is usually \c int or \c double.
+
+ The value is retrieved with \l{Phonon::}{Effect::parameterValue()}
+ and set with \l{Phonon::Effect::}{setParameterValue()} - both of
+ which takes the EffectParameter as argument. Note that not all
+ effect parameters support setting of their value.
+
+ You get the values a parameter can take with possibleValues(); an
+ empty list is returned if the values are continuous.
+
+ A parameter may also specify default(), minimum(), and maximum()
+ values. Values are returned as \l{QVariant}s. If the parameter
+ does not have the requested value, an \l{QVariant::Invalid}
+ invalid QVariant is returned from these functions.
+
+ The \l{Phonon::}{EffectWidget} provides a widget with which one
+ can control the parameters of an \l{Phonon::}{Effect}.
+
+ \snippet doc/src/snippets/phononeffectparameter.cpp 1
+
+ \sa Effect, EffectWidget, {Capabilities Example}, {Phonon Module}
+*/
+
+/*!
+ \fn Phonon::EffectParameter::EffectParameter()
+ \internal
+
+ Creates an invalid effect parameter.
+*/
+
+/*!
+ \fn Phonon::EffectParameter::~EffectParameter()
+
+ Destroys the effect parameter.
+*/
+
+/*!
+ \fn Phonon::EffectParameter::EffectParameter(const EffectParameter &other)
+
+ Constructs a copy of the \a other effect parameter.
+*/
+
+/*!
+ \fn const QString &Phonon::EffectParameter::name() const
+
+ The name of the parameter. Can be used as the label.
+
+ \return A label for the parameter.
+*/
+
+/*!
+ \fn const QString &Phonon::EffectParameter::description() const
+
+ The parameter may come with a description (LADSPA doesn't have a
+ field for this, so don't expect many effects to provide a
+ description).
+
+ The description can be used for a tooltip or WhatsThis help.
+
+ \return A text describing the parameter.
+*/
+
+/*!
+ \fn QVariant::Type Phonon::EffectParameter::type() const
+
+ Returns the parameter type.
+
+ Common types are QVariant::Int, QVariant::Double, QVariant::Bool and QVariant::String. When
+ QVariant::String is returned you get the possible values from possibleValues.
+*/
+
+/*!
+ \fn bool Phonon::EffectParameter::isLogarithmicControl() const
+
+ Returns whether the parameter should be
+ displayed using a logarithmic scale. This is particularly useful for
+ frequencies and gains.
+*/
+
+/*!
+ \fn QVariant Phonon::EffectParameter::minimumValue() const
+
+ The minimum value to be used for the control to edit the parameter.
+
+ If the returned QVariant is invalid the value is not bounded from
+ below.
+*/
+
+/*!
+ \fn QVariant Phonon::EffectParameter::maximumValue() const
+
+ The maximum value to be used for the control to edit the parameter.
+
+ If the returned QVariant is invalid the value is not bounded from
+ above.
+*/
+
+/*!
+ \fn QVariant Phonon::EffectParameter::defaultValue() const
+
+ The default value.
+*/
+
+/*!
+ \fn QVariantList Phonon::EffectParameter::possibleValues() const
+
+ The possible values to be used for the control to edit the parameter.
+
+ if the value of this parameter is to be picked from predefined values
+ this returns the list (otherwise it returns an empty QVariantList).
+*/
+
+/*!
+ \fn bool Phonon::EffectParameter::operator<(const EffectParameter &rhs) const
+
+ \internal
+ compares the ids of the parameters
+*/
+
+/*!
+ \fn bool Phonon::EffectParameter::operator>(const EffectParameter &rhs) const
+
+ \internal
+ compares the ids of the parameters
+*/
+
+/*!
+ \fn bool Phonon::EffectParameter::operator==(const EffectParameter &rhs) const
+
+ \internal
+ compares the ids of the parameters
+*/
+
+/*!
+ \fn Phonon::EffectParameter &Phonon::EffectParameter::operator=(const EffectParameter &other)
+
+ Assigns the \a other effect parameter to this parameter and returns
+ a reference to this parameter.
+*/
+
+/*!
+ \enum Phonon::EffectParameter::Hint
+
+ Only for backend developers:
+
+ Flags to set the return values of isToggleControl(),
+ isLogarithmicControl(), isIntegerControl(), isBoundedBelow() and
+ isBoundedAbove(). The values of the flags correspond to the values
+ used for LADSPA effects.
+
+ \value ToggledHint
+ If this hint is set it means that
+ the control has only two states: zero and non-zero
+ (see isToggleControl()).
+
+ \value LogarithmicHint
+ LADSPA's SAMPLE_RATE hint needs to be translated by the backend
+ to normal bounds, as the backend knows the sample rate - and the
+ frontend doesn't (see isLogarithmicControl()).
+
+ \value IntegerHint See isIntegerControl().
+*/
+
+/*!
+ \fn Phonon::EffectParameter::EffectParameter(int parameterId,
+ const QString &name, EffectParameter::Hints hints,
+ const QVariant &defaultValue, const QVariant &min = QVariant(),
+ const QVariant &max = QVariant(), const QVariantList &values = QVariantList(),
+ const QString &description = QString())
+
+ Only to be used by backend implementations:
+
+ Creates a new effect parameter.
+
+ \a parameterId This is a number to uniquely identify the
+ parameter. The id is used for value() and setValue().
+
+ \a name is the name/label for this parameter.
+
+ \a hints sets the hints for the type of parameter.
+
+ \a defaultValue The value that should be used as a default.
+
+ \a min is the minimum value allowed for this parameter. You only
+ need to set this if the BoundedBelowHint is set.
+
+ \a max is the maximum value allowed for this parameter. You only
+ need to set this if the BoundedAboveHint is set.
+
+ The \a values parameter is the values that the effect parameter
+ can take (only applies if non-continuous)
+
+ \a description is a descriptive text for the parameter
+ (explaining what it controls) to be used as a tooltip or
+ WhatsThis help.
+*/
+
+/*!
+ \fn int Phonon::EffectParameter::id() const
+
+ \internal
+
+ Returns the parameter's identifier.
+*/
+
+/*!
+ \typedef Phonon::AudioOutputInterface
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \class Phonon::AudioOutputInterface40
+ \inmodule Phonon
+ \since 4.4
+ \internal
+ \brief Interface for AudioOutput objects
+
+*/
+
+/*!
+ \fn virtual Phonon::AudioOutputInterface40::~AudioOutputInterface40()
+ \internal
+*/
+
+/*!
+ \fn virtual qreal Phonon::AudioOutputInterface40::volume() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::AudioOutputInterface40::setVolume(qreal) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual int Phonon::AudioOutputInterface40::outputDevice() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual bool Phonon::AudioOutputInterface40::setOutputDevice(int) = 0
+ \internal
+*/
+
+/*!
+ \class Phonon::Path
+ \inmodule Phonon
+ \inheaderfile Phonon/Path
+ \since 4.4
+ \brief The Path class describes connections between media nodes.
+
+ In a \l{Building Graphs}{media graph}, \l{Phonon::}{MediaNode}s
+ are connected by Paths. The multimedia travels in streams over
+ these paths.
+
+ You create a path between two media nodes using the static
+ Phonon::createPath() function, which takes two nodes as arguments.
+ The first argument will send the media stream to the second.
+ Please refer to the class description of the individual media
+ nodes and the Phonon \l{Phonon Overview}{overview} to see which
+ nodes can be connected to each other.
+
+ Paths are also used to insert audio \l{Phonon::}{Effect}s between
+ two media nodes. The effect will then alter the stream on the
+ path. Notice that \l{Phonon::}{Effect}s also are media nodes, but
+ that insertEffect() - instead of Phonon::createPath() - is used to
+ insert them into the media graph.
+
+ The following code example shows how to create a path between two
+ media nodes and insert an effect on that path.
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 20
+
+ \sa Phonon::MediaNode, Phonon::MediaObject, Phonon::AudioOutput,
+ Phonon::VideoWidget, {Phonon Module}
+*/
+
+/*!
+ \fn Phonon::Path::~Path();
+
+ Destroys this reference to the Path. If the path was valid the connection is not broken
+ as both the source and the sink MediaNodes still keep a reference to the Path.
+
+ \sa disconnect()
+*/
+
+/*!
+ \fn Phonon::Path::Path();
+
+ Creates an invalid path.
+
+ You can still make it a valid path by calling reconnect. It is
+ recommended to use the Phonon::createPath() function to create
+ paths.
+
+ \sa Phonon::createPath(), isValid()
+*/
+
+/*!
+ \fn Phonon::Path::Path(const Path &path);
+
+ Constructs a copy of the other \a path specified.
+
+ This constructor is fast thanks to explicit sharing.
+*/
+
+/*!
+ \fn bool Phonon::Path::isValid() const;
+
+ A path is considered valid if it is connected to two media nodes,
+ in which case this function returns true. If it is connected to
+ one or no media nodes, it is consider invalid, and this function
+ will then return false.
+*/
+
+/*!
+ \fn Effect *Phonon::Path::insertEffect(const EffectDescription &desc, Effect *insertBefore = 0);
+
+ Creates and inserts an effect into the path.
+
+ You may insert effects of the same class as often as you like,
+ but if you insert the same object, the call will fail.
+
+ \a desc is the EffectDescription object for the effect to be inserted.
+
+ If you already inserted an effect you can
+ tell with \a insertBefore in which order the data gets
+ processed. If this is \c 0 the effect is appended at the end of
+ the processing list. If the effect has not been inserted before
+ the method will do nothing and return \c false.
+
+ Returns a pointer to the effect object if it could be inserted
+ at the specified position. If \c 0 is returned, the effect was not
+ inserted.
+
+ Below is a code example for inserting an effect into a path:
+
+ \snippet doc/src/snippets/audioeffects.cpp 0
+
+ \sa removeEffect(), effects()
+*/
+
+/*!
+ \fn bool Phonon::Path::insertEffect(Effect *effect, Effect *insertBefore = 0);
+
+ Inserts the given \a effect into the path before the effect specified by \a insertBefore
+ and returns true if successful; otherwise returns false.
+
+ If \a insertBefore is zero, the effect is appended to the processing list.
+
+ You may insert effects of the same class as often as you like, but if you insert
+ the same object, the call will fail.
+
+ \a effect will be inserted right before \a insertBefore. If
+ \a insertBefore is \c 0, the effect is appended at the end of the
+ processing list. If the effect has not been inserted before the
+ method will do nothing and return \c false.
+
+ Returns whether the effect could be inserted at the specified
+ position. If \c false is returned the effect was not inserted.
+
+ \sa removeEffect(), effects()
+*/
+
+/*!
+ \fn bool Phonon::Path::removeEffect(Effect *effect);
+
+ Removes the given \a effect from the path and returns true; otherwise returns false.
+
+ Removes an \a effect from the path.
+
+ If the effect is deleted while it is still connected, the effect will be removed
+ automatically.
+
+ \omit
+ \param effect The effect to be removed.
+
+ \return Returns whether the call was successful. If it returns
+ \c false the effect could not be found in the path, meaning it
+ has not been inserted before.
+ \endomit
+
+ \sa insertEffect(), effects()
+*/
+
+/*!
+ \fn QList Phonon::Path::effects() const;
+
+ Returns a list of Effect objects that are currently
+ used as effects. The order in the list determines the order the
+ signal is sent through the effects.
+
+ \return A list with all current effects.
+
+ \sa insertEffect(), removeEffect()
+*/
+
+/*!
+ \fn bool Phonon::Path::reconnect(MediaNode *source, MediaNode *sink);
+
+ Changes the media nodes the path is connected to by connecting the path
+ to the \a source and \a sink nodes specified. Returns true if successful;
+ otherwise returns false.
+
+ If unsuccessful, the path remains connected to the same nodes as before.
+
+ \sa Phonon::createPath(), {Phonon Overview}
+*/
+
+/*!
+ \fn bool Phonon::Path::disconnect();
+
+ Tries to disconnect the path from the MediaNodes it is connected to, returning
+ true if successful or false if unsuccessful.
+
+ If successful, the path is invalidated: isValid() will returns false.
+*/
+
+/*!
+ \fn Path &Phonon::Path::operator=(const Path &p);
+
+ Assigns \a p to this Path and returns a reference to this Path.
+
+ This operation is fast thanks to explicit sharing.
+*/
+
+/*!
+ \fn bool Phonon::Path::operator==(const Path &p) const;
+
+ Returns true if this Path is equal to \a p; otherwise returns false;
+*/
+
+/*!
+ \fn bool Phonon::Path::operator!=(const Path &p) const;
+
+ Returns true if this Path is not equal to \a p; otherwise returns false.
+*/
+
+/*!
+ \fn MediaNode *Phonon::Path::source() const;
+
+ Returns the source MediaNode used by the path.
+*/
+
+/*!
+ \fn MediaNode *Phonon::Path::sink() const;
+
+ Returns the sink MediaNode used by the path.
+*/
+
+/*!
+ \fn Path Phonon::createPath(MediaNode *source, MediaNode *sink);
+
+ \relates Phonon::Path
+ Creates a new Path connecting the two MediaNodes \a source and \a sink.
+
+ The implementation will automatically select the right format and media type. E.g. connecting a
+ MediaObject and AudioOutput will create a Path object connecting the audio. This might be
+ represented as PCM or perhaps even AC3 depending on the AudioOutput object.
+
+ \param source The MediaNode to connect an output from
+ \param sink The MediaNode to connect to.
+*/
+
+/*!
+ \class Phonon::PathPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::MediaObjectInterface
+ \inmodule Phonon
+ \since 4.4
+ \internal
+ \brief Backend interface for media sources.
+
+ The backend implementation has to provide two signals, that are not defined
+ in this interface:
+ \list
+ \o \target phonon_MediaObjectInterface_stateChanged
+ void stateChanged(Phonon::State newstate, Phonon::State oldstate)
+
+ Emitted when the state of the MediaObject has changed.
+ In case you're not interested in the old state you can also
+ connect to a slot that only has one State argument.
+
+ \param newstate The state the Player is in now.
+ \param oldstate The state the Player was in before.
+
+ \o \target phonon_MediaObjectInterface_tick
+ void tick(qint64 time)
+
+ This signal gets emitted every tickInterval milliseconds.
+
+ \param time The position of the media file in milliseconds.
+
+ \sa setTickInterval()
+ \sa tickInterval()
+ \endlist
+
+ \sa MediaObject
+*/
+
+/*!
+ \fn virtual Phonon::MediaObjectInterface::~MediaObjectInterface()
+ \internal
+*/
+
+/*!
+ \fn virtual qint64 Phonon::MediaObjectInterface::remainingTime() const
+ \internal
+*/
+
+/*!
+ \fn virtual qint32 Phonon::MediaObjectInterface::prefinishMark() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::MediaObjectInterface::setPrefinishMark(qint32) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual qint32 Phonon::MediaObjectInterface::transitionTime() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::MediaObjectInterface::setTransitionTime(qint32) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::MediaObjectInterface::play() = 0
+ \internal
+
+ Requests the playback to start.
+
+ This method is only called if the state transition to PlayingState is possible.
+
+ The backend should react immediately
+ by either going into PlayingState or BufferingState if the
+ former is not possible.
+*/
+
+/*!
+ \fn virtual void Phonon::MediaObjectInterface::pause() = 0
+ \internal
+
+ Requests the playback to pause.
+
+ This method is only called if the state transition to PausedState is possible.
+
+ The backend should react as fast as possible. Go to PausedState
+ as soon as playback is paused.
+*/
+
+/*!
+ \fn virtual void Phonon::MediaObjectInterface::stop() = 0
+ \internal
+
+ Requests the playback to be stopped.
+
+ This method is only called if the state transition to StoppedState is possible.
+
+ The backend should react as fast as possible. Go to StoppedState
+ as soon as playback is stopped.
+
+ A subsequent call to play() will start playback at the beginning of
+ the media.
+*/
+
+/*!
+ \fn virtual void Phonon::MediaObjectInterface::seek(qint64 milliseconds) = 0
+ \internal
+
+ Requests the playback to be seeked to the given time.
+
+ The backend does not have to finish seeking while in this function
+ (i.e. the backend does not need to block the thread until the seek is
+ finished; even worse it might lead to deadlocks when using a
+ ByteStream which gets its data from the thread this function would
+ block).
+
+ As soon as the seek is done the currentTime() function and
+ the tick() signal will report it.
+
+ \param milliseconds The time where playback should seek to in
+ milliseconds.
+*/
+
+/*!
+ \fn virtual qint32 Phonon::MediaObjectInterface::tickInterval() const = 0
+ \internal
+
+ Return the time interval in milliseconds between two ticks.
+
+ Returns the tick interval that it was set to (might not
+ be the same as you asked for).
+*/
+
+/*!
+ \fn virtual void Phonon::MediaObjectInterface::setTickInterval(qint32 interval) = 0
+ \internal
+
+ Change the interval the tick signal is emitted. Set \a interval to 0 to
+ disable the signal.
+
+ \a interval tick interval in milliseconds
+
+ Returns the tick interval that it was set to (might not be the same as you
+ asked for).
+
+*/
+
+/*!
+ \fn virtual bool Phonon::MediaObjectInterface::hasVideo() const = 0
+ \internal
+
+ Check whether the media data includes a video stream.
+
+ Returns true if the media contains video data.
+*/
+
+/*!
+ \fn virtual bool Phonon::MediaObjectInterface::isSeekable() const = 0
+ \internal
+
+ If the current media may be seeked this function returns true;
+ otherwise, false.
+
+ Returns whether the current media may be seeked.
+*/
+
+/*!
+ \fn virtual qint64 Phonon::MediaObjectInterface::currentTime() const = 0
+ \internal
+
+ Get the current time (in milliseconds) of the file currently being played.
+*/
+
+/*!
+ \fn virtual Phonon::State Phonon::MediaObjectInterface::state() const = 0
+ \internal
+
+ Get the current state.
+*/
+
+/*!
+ \fn virtual QString Phonon::MediaObjectInterface::errorString() const = 0
+ \internal
+
+ A translated string describing the error.
+*/
+
+/*!
+ \fn virtual Phonon::ErrorType Phonon::MediaObjectInterface::errorType() const = 0
+ \internal
+
+ Tells your program what to do about the error.
+
+ \sa Phonon::ErrorType
+*/
+
+/*!
+ \fn virtual qint64 Phonon::MediaObjectInterface::totalTime() const = 0
+ \internal
+
+ Returns the total time of the media in milliseconds.
+
+ If the total time is not know return -1. Do not block until it is
+ known, instead emit the totalTimeChanged signal as soon as the total
+ time is known or changes.
+*/
+
+/*!
+ \fn virtual MediaSource Phonon::MediaObjectInterface::source() const = 0
+ \internal
+
+ Returns the current source.
+*/
+
+/*!
+ \fn virtual void Phonon::MediaObjectInterface::setSource(const MediaSource &) = 0
+ \internal
+
+ Sets the current source. When this function is called the MediaObject is
+ expected to stop all current activity and start loading the new
+ source (i.e. go into LoadingState).
+
+ It is expected that the
+ backend now starts preloading the media data, filling the audio
+ and video buffers and making all media meta data available. It
+ will also trigger the totalTimeChanged signal.
+
+ If the backend does not know how to handle the source it needs to
+ change state to Phonon::ErrorState. Don't bother about handling KIO
+ URLs. It is enough to handle AbstractMediaStream sources correctly.
+
+ \warning Keep the MediaSource object around as long as the backend
+ uses the AbstractMediaStream returned by the MediaSource. In case
+ that no other reference to the MediaSource exists and it is set to
+ MediaSource::autoDelete, the AbstractMediaStream is deleted when the
+ last MediaSource ref is deleted.
+*/
+
+/*!
+ \fn virtual void Phonon::MediaObjectInterface::setNextSource(const MediaSource &source) = 0
+ \internal
+
+ Sets the next source to be used for transitions. When a next source
+ is set playback should continue with the new source. In that case
+ finished and prefinishMarkReached are not emitted.
+
+ \param source The source to transition to (crossfade/gapless/gap). If
+ \a source is an invalid MediaSource object then the queue is empty
+ and the playback should stop normally.
+
+ \warning Keep the MediaSource object around as long as the backend
+ uses the AbstractMediaStream returned by the MediaSource. In case
+ that no other reference to the MediaSource exists and it is set to
+ MediaSource::autoDelete, the AbstractMediaStream is deleted when the
+ last MediaSource ref is deleted.
+*/
+
+/*!
+ \class Phonon::EffectWidget effectwidget.h Phonon/EffectWidget
+ \inmodule Phonon
+ \inheaderfile Phonon/EffectWidget
+ \since 4.4
+ \brief The EffectWidget class provides a widget to control the parameters of an Effect.
+
+ The EffectWidget class provides a widget, with which an effects
+ parameters can be controlled. The widget does not have an API,
+ and is constructed with the \l{Phonon::}{Effect}, of which
+ parameters should be controlled.
+
+ \snippet doc/src/snippets/audioeffects.cpp 1
+
+ The following image shows an example of an effect widget.
+
+ \image effectwidget.png
+
+ Note that some audio effects do not have parameters, and the
+ widget will then not \l{QWidget::}{show()} at all.
+
+ \sa Effect, BackendCapabilities, EffectDescription, {Phonon Module}
+*/
+
+/*!
+ \class Phonon::AbstractAudioOutput
+ \inmodule Phonon
+ \internal
+ \brief Provides a common base class for all audio outputs.
+
+ \sa AudioOutput
+*/
+
+/*!
+ \fn Phonon::AbstractAudioOutput::~AbstractAudioOutput()
+ \internal
+*/
+
+/*!
+ \class Phonon::AbstractAudioOutputPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class AudioOutputAdaptor
+ \inmodule Phonon
+ \brief Provides an adaptor class for interface org.kde.Phonon.AudioOutput
+ \internal
+*/
+
+/*!
+ \class Phonon::VolumeSlider
+ \inmodule Phonon
+ \inheaderfile Phonon/VolumeSlider
+ \since 4.4
+ \brief The VolumeSlider widget provides a slider that is used to control the volume of an audio output device.
+
+ The slider also displays an icon indicating if the volume of the
+ \l{Phonon::}{AudioOutput} it is connected to is muted. The icon
+ can be removed with setMuteVisible().
+
+ It is possible to set the \l{maximumVolume}{maximum} value of the
+ slider. By default, the minimum and maximum values of the slider
+ are 0.0 (no sound) to 1.0 (the maximum volume the audio output can
+ produce).
+
+ Here follows a code example:
+
+ \snippet doc/src/snippets/volumeslider.cpp 0
+
+ \omit mention how to change the style of the slider. \endomit
+
+ \sa {Phonon Module}
+*/
+
+/*!
+ \property Phonon::VolumeSlider::maximumVolume
+
+ This property holds the maximum volume that can be set with this slider.
+
+ By default the maximum value is 1.0 (100%).
+*/
+
+/*!
+ \property Phonon::VolumeSlider::orientation
+ This property holds the orientation of the slider.
+
+ The orientation must be Qt::Vertical (the default) or Qt::Horizontal.
+*/
+
+/*!
+ \property Phonon::VolumeSlider::tracking
+ This property holds whether slider tracking is enabled.
+
+ If tracking is enabled (the default), the volume changes
+ while the slider is being dragged. If tracking is
+ disabled, the volume changes only when the user
+ releases the slider.
+*/
+
+/*!
+ \property Phonon::VolumeSlider::pageStep
+ This property holds the page step.
+
+ The larger of two natural steps that a slider provides and
+ typically corresponds to the user pressing PageUp or PageDown.
+
+ Defaults to 5 (5% of the voltage).
+*/
+
+/*!
+ \property Phonon::VolumeSlider::singleStep
+ This property holds the single step.
+
+ The smaller of two natural steps that a slider provides and
+ typically corresponds to the user pressing an arrow key.
+
+ Defaults to 1 (1% of the voltage).
+*/
+
+/*!
+ \property Phonon::VolumeSlider::muteVisible
+ This property holds whether the mute button/icon next to the slider is visible.
+
+ By default the mute button/icon is visible.
+*/
+
+/*!
+ \property Phonon::VolumeSlider::iconSize
+ \brief the icon size used for the mute button/icon.
+
+ The default size is defined by the GUI style.
+*/
+
+/*!
+ \fn explicit Phonon::VolumeSlider::VolumeSlider(QWidget *parent = 0)
+ Constructs a new volume slider with the given \a parent.
+*/
+
+/*!
+ \fn explicit Phonon::VolumeSlider::VolumeSlider(AudioOutput *output, QWidget *parent = 0)
+ Constructs a new volume slider with the given \a output object and \a parent.
+*/
+
+/*!
+ \fn Phonon::VolumeSlider::~VolumeSlider()
+*/
+
+/*!
+ \fn AudioOutput *Phonon::VolumeSlider::audioOutput() const
+*/
+
+/*!
+ \fn void Phonon::VolumeSlider::setAudioOutput(Phonon::AudioOutput *output)
+
+ Sets the audio output object to be controlled by this slider to the specified
+ \a output object.
+*/
+
+/*!
+ \class Phonon::VolumeSliderPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::MediaController
+ \inmodule Phonon
+ \inheaderfile Phonon/MediaController
+ \since 4.4
+ \brief The MediaController class controls optional features of a media file/device.
+
+ Some media sources have content that the \l{Phonon::}{MediaObject}
+ does not provide control over, for instance, chapters in a DVD
+ file. The functionality the media controller offers is
+ dependent on the type of media source that is played back.
+ Commonly, the media controller allows you to:
+
+ \list
+ \o Navigate between \bold chapters.
+ \o Navigate between \bold titles.
+ \o Select between \bold angles.
+ \endlist
+
+ The \l{Phonon::MediaController::}{Feature} enum explains these
+ terms in more detail, and their context in playback of CD and DVD.
+
+ The media controller keeps a \l{Phonon::}{MediaObject}, of which
+ \l{Phonon::MediaObject::currentSource()}{media source} is played
+ back. You can still call the media object's functions, e.g.,
+ \l{Phonon::MediaObject::}{stop()}; this is all handled correctly
+ by the media controller. You have the option of letting the media
+ controller play all titles of a source in sequence by setting the
+ \l{autoplayTitles()}{autoplay titles} option.
+
+ To start a playback using a media object, you call
+ \l{Phonon::MediaObject::}{play()} on the media object. To play a
+ specific title, use setCurrentTitle() and then call
+ \l{Phonon::MediaObject::}{play()}.
+
+ \warning The Phonon::MediaController class is not yet supported by
+ Qt backends.
+
+ \sa {Phonon Module}
+*/
+
+/*!
+ \fn int Phonon::MediaController::availableAudioChannels() const
+ \internal
+*/
+
+/*!
+ \fn void Phonon::MediaController::availableAudioChannelsChanged()
+ \internal
+*/
+
+/*!
+ \fn QList Phonon::MediaController::availableSubtitles() const
+ \internal
+*/
+
+/*!
+ \fn void Phonon::MediaController::availableSubtitlesChanged()
+ \internal
+*/
+
+/*!
+ \fn AudioChannelDescription Phonon::MediaController::currentAudioChannel() const
+ \internal
+*/
+
+/*!
+ \fn SubtitleDescription Phonon::MediaController::currentSubtitle() const
+ \internal
+*/
+
+/*!
+ \fn void Phonon::MediaController::setCurrentAudioChannel(const Phonon::AudioChannelDescription &stream)
+ \internal
+*/
+
+/*!
+ \fn void Phonon::MediaController::setCurrentSubtitle(const Phonon::SubtitleDescription &stream)
+ \internal
+*/
+
+/*!
+ \fn Phonon::BackendCapabilities::availableAudioCaptureDevices()
+ \internal
+*/
+
+/*!
+ \fn Phonon::BackendCapabilities::Notifier::availableAudioCaptureDevicesChanged()
+ \internal
+*/
+
+/*!
+ \enum Phonon::MediaController::Feature
+
+ The values of this enum are interpreted differently depending on
+ the type of media source, e.g., DVD or CD. We give examples for
+ these sources.
+
+ \value Angles In the VOB (DVD) format, it is possible to to give
+ several video streams of the same scene, each of which displays
+ the scene from a different angle. The DVD viewer can then change
+ between these angles.
+
+ \value Chapters In the VOB format, chapters are points in a
+ single video stream that can be played and seeked to
+ separately.
+
+ \value Titles On a CD, a title is a separate sound track. On DVD,
+ a title is a separate VOB file.
+
+*/
+
+/*!
+ \fn Phonon::MediaController::MediaController(MediaObject *parent)
+
+ Constructs a new MediaController with the media object (\a parent)
+ to be used by the media controller.
+
+ \sa MediaObject, Feature
+*/
+
+/*!
+ \fn Phonon::MediaController::~MediaController()
+*/
+
+/*!
+ \fn Features Phonon::MediaController::supportedFeatures() const
+*/
+
+/*!
+ \fn int Phonon::MediaController::availableAngles() const
+
+ Returns the available angles that is available for the current
+ media source.
+
+ \sa Feature
+*/
+
+/*!
+ \fn int Phonon::MediaController::currentAngle() const
+
+ Returns the angle that is currently used.
+
+ \sa Feature
+*/
+
+/*!
+ \fn int Phonon::MediaController::availableChapters() const
+
+ Returns the number of chapters the current media source
+ contains.
+
+ \sa Feature
+*/
+
+/*!
+ \fn int Phonon::MediaController::currentChapter() const
+
+ Returns the chapter that is currently being played back.
+
+ \sa Feature
+*/
+
+/*!
+ \fn int Phonon::MediaController::availableTitles() const
+
+ Returns the number of titles that the current media source
+ contains.
+
+ \sa Feature
+*/
+
+/*!
+ \fn int Phonon::MediaController::currentTitle() const
+
+ Returns the title that is currently played back.
+
+ The current title is 0 (the first) by default.
+
+ \sa Feature
+*/
+
+/*!
+ \fn bool Phonon::MediaController::autoplayTitles() const
+
+ Returns true if titles will automatically be played when the media
+ is played; otherwise returns false.
+
+ The media controller will play the titles of the media source in
+ sequence when the media object's \l{Phonon::MediaObject::}{play()}
+ function is called. If the autoplay option is disabled, the media
+ object will play the
+ \l{Phonon::}{MediaController::currentTitle()}{current title} and then
+ finish the playback.
+
+ \sa setAutoplayTitles(), currentTitle()
+*/
+
+/*!
+ \fn void Phonon::MediaController::setAutoplayTitles(bool enable)
+
+ Sets the titles to play automatically when the media is played if
+ \a enable is true; otherwise disables this option.
+
+ The media controller will play the titles of the media source in
+ sequence when the media object's \l{Phonon::MediaObject::}{play()}
+ function is called. If the autoplay option is disabled, the media
+ object will play the
+ \l{Phonon::}{MediaController::currentTitle()}{current title} and then
+ finish the playback.
+
+ \sa autoplayTitles(), currentTitle()
+*/
+
+/*!
+ \fn void Phonon::MediaController::setCurrentAngle(int angleNumber)
+
+ Sets the current angle to the given \a angleNumber if the media
+ file or device supports navigation by angle number.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::setCurrentChapter(int chapterNumber)
+
+ Sets the current chapter to the given \a chapterNumber if the media
+ file or device supports navigation by chapter number.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::setCurrentTitle(int titleNumber)
+
+ Skips to the given title \a titleNumber.
+
+ If it was playing before the title change it will start playback on the new title if
+ autoplayTitles is enabled.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::nextTitle()
+
+ Skips to the next title.
+
+ If it was playing before the title change it will start playback on the next title if
+ autoplayTitles is enabled.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::previousTitle()
+
+ Skips to the previous title.
+
+ If it was playing before the title change it will start playback on the previous title if
+ autoplayTitles is enabled.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::availableAnglesChanged(int availableAngles)
+
+ This signal is emitted whenever the number of available angles changes.
+ The new number of available angles is given by \a availableAngles.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::angleChanged(int angleNumber)
+
+ This signal is emitted whenever the current angle changes.
+ The new angle number is given by \a angleNumber.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::availableChaptersChanged(int availableChapters)
+
+ This signal is emitted whenever the number of available chapters changes.
+ The new number of available chapters is given by \a availableChapters.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::chapterChanged(int chapterNumber)
+
+ This signal is emitted whenever the current chapter changes.
+ The new chapter number is given by \a chapterNumber.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::availableTitlesChanged(int availableTitles)
+
+ This signal is emitted whenever the number of available titles changes.
+ The new number of available titles is given by \a availableTitles.
+
+ \sa Feature
+*/
+
+/*!
+ \fn void Phonon::MediaController::titleChanged(int titleNumber)
+
+ This signal is emitted whenever the current title changes.
+ The new title number is given by \a titleNumber.
+
+ \sa Feature
+*/
+
+/*!
+ \class Phonon::VideoWidget
+ \inmodule Phonon
+ \inheaderfile Phonon/VideoWidget
+ \since 4.4
+ \ingroup advanced
+ \ingroup multimedia
+ \brief The VideoWidget class provides a widget that is used to display video.
+
+ The VideoWidget class renders the video of a media stream on a
+ QWidget. It is connected to the \l{Phonon::}{MediaObject}, of
+ which video stream it should render. You connect the two objects
+ using the Phonon::createPath() function.
+
+ The widget has some possibilities to manipulate the video
+ stream. You can change the brightness(), hue(), saturation(),
+ and contrast().
+
+ Resizing of the video is handled automatically, but you can affect
+ the way the video is resized with the aspectRatio and scaleMode
+ properties. By default, the widget will use the aspect ratio of
+ the video stream itself.
+
+ The video widget takes the size of the video when it receives a new video
+ stream (i.e., when a new MediaSource is set on the MediaObject to which it is
+ connected). If you need to know the size of the video, you can call
+ \l{QWidget::}{sizeHint()} after the video has been loaded (i.e., after the
+ MediaObject leaves the \l{Phonon::}{LoadingState}).
+
+ It is also possible to go to \l{fullScreen}{full screen} mode.
+
+ A typical example of usage follows below:
+
+ \snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 21
+
+ \sa {Phonon Module}
+*/
+
+/*!
+ \fn Phonon::VideoWidget::VideoWidget(QWidget *parent = 0)
+
+ Constructs a new video widget with the specified \a parent.
+*/
+
+/*!
+ \fn Phonon::VideoWidget::VideoWidget(VideoWidgetPrivate &d, QWidget *parent)
+ \internal
+
+ Constructs a new video widget with the specified \a parent.
+*/
+
+/*!
+ \fn bool Phonon::VideoWidget::event(QEvent *)
+ \reimp
+*/
+
+/*!
+ \fn void Phonon::VideoWidget::mouseMoveEvent(QMouseEvent *)
+ \reimp
+*/
+
+/*!
+ \enum Phonon::VideoWidget::ScaleMode
+
+ The ScaleMode enum describes how to treat aspect ratio during
+ resizing of video.
+
+ \value FitInView The video will be fitted to fill the view
+ keeping aspect ratio.
+ \value ScaleAndCrop The video is scaled
+*/
+
+/*!
+ \property Phonon::VideoWidget::fullScreen
+ This property holds whether the video is shown using the complete
+ screen.
+
+ The property differs from QWidget::fullScreen in that it is
+ writeable.
+
+ By default the widget is not shown in fullScreen.
+
+ \warning When switching to full screen mode using setFullScreen(),
+ the widget onto which the video is rendered is shown as a
+ top-level window. Key event forwarding is handled by VideoWidget,
+ but if you need to handle other events, e.g., mouse events, you
+ should handle fullscreen mode yourself.
+*/
+
+/*!
+ \property Phonon::VideoWidget::aspectRatio
+ Defaults to AspectRatioAuto.
+
+ \sa AspectRatio
+*/
+
+/*!
+ \property Phonon::VideoWidget::scaleMode
+
+ If the size of the widget and the size of the video are not equal.
+ The video will be zoomed to fit the widget. The smaller zoom
+ (AddBarsScaleMode) adds black bars at the left/right or top/bottom to
+ make all of the image visible (default). The bigger zoom (ExpandMode)
+ fills the widget completely, keeping all information in one direction
+ and leaving parts of the image outside of the widget in the other
+ direction.
+*/
+
+/*!
+ \property Phonon::VideoWidget::brightness
+
+ This property holds brightness of the video.
+
+ Default is 0. Acceptable values are in range of -1, 1.
+*/
+
+/*!
+ \property Phonon::VideoWidget::contrast
+
+ This property holds the contrast of the video.
+
+ Default is 0. Acceptable values are in range of -1, 1.
+*/
+
+/*!
+ \property Phonon::VideoWidget::hue
+
+ This property holds the hue of the video.
+
+ Default is 0. Acceptable values are in range of -1, 1.
+*/
+
+/*!
+ \property Phonon::VideoWidget::saturation
+
+ This property holds saturation of the video.
+
+ Default is 0. Acceptable values are in range of -1, 1.
+*/
+
+/*!
+ \enum Phonon::VideoWidget::AspectRatio
+
+ Defines the width:height to be used for the video.
+
+ \value AspectRatioAuto
+ Let the decoder find the aspect ratio automatically from the
+ media file (this is the default).
+
+ \value AspectRatioWidget
+ Fits the video into the widget making the aspect ratio depend
+ solely on the size of the widget. This way the aspect ratio
+ is freely resizeable by the user.
+
+ \value AspectRatio4_3
+ Make width/height == 4/3, which is the old TV size and
+ monitor size (1024/768 == 4/3). (4:3)
+
+ \value AspectRatio16_9
+ Make width/height == 16/9, which is the size of most current
+ media. (16:9)
+*/
+
+/*!
+ \fn void Phonon::VideoWidget::exitFullScreen()
+
+ Convenience slot, calling setFullScreen(false)
+*/
+
+
+/*!
+ \fn void Phonon::VideoWidget::enterFullScreen()
+
+ Convenience slot, calling setFullScreen(true)
+*/
+
+/*!
+ \class Phonon::VideoWidgetInterface
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \fn virtual Phonon::VideoWidgetInterface::~VideoWidgetInterface()
+*/
+
+/*!
+ \fn virtual Phonon::VideoWidget::AspectRatio Phonon::VideoWidgetInterface::aspectRatio() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::VideoWidgetInterface::setAspectRatio(Phonon::VideoWidget::AspectRatio ratio) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual qreal Phonon::VideoWidgetInterface::brightness() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::VideoWidgetInterface::setBrightness(qreal) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual Phonon::VideoWidget::ScaleMode Phonon::VideoWidgetInterface::scaleMode() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::VideoWidgetInterface::setScaleMode(Phonon::VideoWidget::ScaleMode mode) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual qreal Phonon::VideoWidgetInterface::contrast() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::VideoWidgetInterface::setContrast(qreal) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual qreal Phonon::VideoWidgetInterface::hue() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::VideoWidgetInterface::setHue(qreal) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual qreal Phonon::VideoWidgetInterface::saturation() const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual void Phonon::VideoWidgetInterface::setSaturation(qreal) = 0
+ \internal
+*/
+
+/*!
+ \fn virtual QWidget *Phonon::VideoWidgetInterface::widget() = 0
+ \internal
+*/
+
+/*!
+ \class Phonon::PlatformPlugin
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \fn virtual AbstractMediaStream *Phonon::PlatformPlugin::createMediaStream(const QUrl &url, QObject *parent) = 0
+
+ Creates a AbstractMediaStream object with the given \a parent that provides the data
+ for the given URL specified by \a url.
+ \omit
+ On KDE this uses KIO.
+ \endomit
+*/
+
+/*!
+ \fn virtual QIcon Phonon::PlatformPlugin::icon(const QString &name) const = 0
+
+ Returns the icon for the given icon name.
+*/
+
+/*!
+ \fn virtual void Phonon::PlatformPlugin::notification(const char *notificationName, const QString &text,
+ const QStringList &actions, QObject *receiver, const char *actionSlot) const = 0
+
+ Shows a notification pop-up with the given \a notificationName and \a text.
+ Each action in the associated list of \a actions is connected to the \a actionSlot
+ of the specified \a receiver object, which is expected to act on the actions as
+ they are triggered by the user.
+*/
+
+/*!
+ \fn virtual QString Phonon::PlatformPlugin::applicationName() const = 0
+
+ Returns the name of the application. For most Qt application this is
+ QCoreApplication::applicationName(), but for KDE this is overridden by KAboutData.
+*/
+
+
+/*!
+ \fn virtual QObject *Phonon::PlatformPlugin::createBackend() = 0
+
+ Creates a backend object. This way the platform can decide the backend preference.
+*/
+
+/*!
+ \fn virtual QObject *Phonon::PlatformPlugin::createBackend(const QString &library, const QString &version) = 0
+
+ Using the library loader of the platform, loads a given backend provided the
+ specified \a library and \a version.
+*/
+
+/*!
+ \fn virtual bool Phonon::PlatformPlugin::isMimeTypeAvailable(const QString &mimeType) const = 0
+
+ Tries to check whether the default backend supports the MIME type specified by \a mimeType
+ without loading the actual backend library.
+ \omit
+ On KDE this reads the MIME type list from the .desktop file of
+ the backend.
+ \endomit
+*/
+
+/*!
+ \fn virtual void Phonon::PlatformPlugin::saveVolume(const QString &outputName, qreal volume) = 0
+
+ Saves the volume for the given output.
+*/
+
+/*!
+ \fn virtual qreal Phonon::PlatformPlugin::loadVolume(const QString &outputName) const = 0
+
+ Loads the volume for the given output.
+*/
+
+/*!
+ \class Phonon::MediaNode
+ \inmodule Phonon
+ \inheaderfile Phonon/MediaNode
+ \since 4.4
+ \brief The MediaNode class is the base class for all nodes in a media graph.
+
+ In all phonon applications, one builds a media graph consisting of
+ MediaNodes. The graph will take multimedia content, e.g., from a
+ file, as input. After its nodes have processed the multimedia, the
+ graph will output the media again, e.g., to a sound card.
+
+ The multimedia content is streamed over \l{Phonon::}{Path}s
+ between the nodes in the graph. You can query the paths that are
+ connected to a media node with inputPaths() and outputPaths().
+
+ You can check whether the node is implemented by the current
+ backend by calling isValid(). This does not guarantee that an
+ instance of the class works as expected, but that the backend has
+ implemented functionality for the class.
+
+ Currently, Phonon has four media nodes: \l{Phonon::}{MediaObject},
+ \l{Phonon::}{AudioOutput}, \l{Phonon::}{VideoWidget}, and \l{Phonon::}{Effect}.
+ Please refer to their class descriptions for details about their usage, and to
+ find out which nodes can be connected to each other. See also \l{Building
+ Graphs} in Phonon's \l{Phonon Overview}{overview} document.
+
+ Two nodes are connected to each other using the
+ Phonon::createPath() or \l{Phonon::}{Path::insertEffect()}
+ functions (only \l{Phonon::Effect}s use
+ \l{Phonon::Path::}{insertEffect()}). We show a code example below,
+ in which we build a media graph for video playback and then query
+ its media nodes for their \l{Phonon::}{Path}s:
+
+ \snippet doc/src/snippets/medianodesnippet.cpp 0
+
+ When you create a Phonon application, you will likely build the
+ graph yourself. This makes isValid() the most useful function of
+ this class. The other two functions help navigate the graph, which
+ you do not need to do as you created the nodes yourself.
+
+ \sa {Phonon Overview}, Phonon::MediaObject,
+ Phonon::AudioOutput, Phonon::VideoWidget, {Phonon Module}
+*/
+
+/*!
+ \fn virtual Phonon::MediaNode::~MediaNode()
+
+ Destroys the media node and any paths connecting it to other
+ nodes. Any \l{Phonon::}{Effect}s connected to these paths will
+ also be deleted.
+*/
+
+/*!
+ \fn bool Phonon::MediaNode::isValid() const
+
+ Returns true if the backend provides an implementation of this
+ class; otherwise returns false.
+
+ This does not guarantee that instances of the class works as
+ expected, but that the backend has implemented the functionality
+ for this class. For instance, Qt's GStreamer backend will return
+ true for instances of the \l{Phonon::}{AudioOutput} class, even if
+ there is a problem with GStreamer and it could not play sound.
+
+*/
+
+/*!
+ \fn QList Phonon::MediaNode::inputPaths() const
+
+ Returns the paths that inputs multimedia to this media node.
+
+ \sa outputPaths()
+*/
+
+/*!
+ \fn QList Phonon::MediaNode::outputPaths() const
+
+ Returns the paths to which this media node outputs media.
+
+ \sa inputPaths()
+*/
+
+/*!
+ \fn Phonon::MediaNode::MediaNode(MediaNodePrivate &dd)
+ \internal
+*/
+
+/*!
+ \class Phonon::GlobalConfig
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \fn Phonon::GlobalConfig::GlobalConfig()
+ \internal
+*/
+
+/*!
+ \fn Phonon::GlobalConfig::~GlobalConfig()
+ \internal
+*/
+
+/*!
+ \fn QList Phonon::GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const
+ \internal
+*/
+
+/*!
+ \fn int Phonon::GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const
+ \internal
+*/
+
+/*!
+ \class Phonon::ObjectDescriptionData
+ \inmodule Phonon
+ \since 4.4
+ \internal
+ \brief Data class for objects describing devices or features of the backend.
+
+ \sa Phonon::BackendCapabilities
+*/
+
+/*!
+ \fn bool Phonon::ObjectDescriptionData::operator==(const ObjectDescriptionData &otherDescription) const
+
+ Returns \c true if this ObjectDescription describes the same
+ as \a otherDescription; otherwise returns \c false.
+*/
+
+/*!
+ \fn QString Phonon::ObjectDescriptionData::name() const
+
+ Returns the name of the capture source.
+
+ \return A string that should be presented to the user to
+ choose the capture source.
+*/
+
+/*!
+ \fn QString Phonon::ObjectDescriptionData::description() const
+
+ Returns a description of the capture source. This text should
+ make clear what sound source this is, which is sometimes hard
+ to describe or understand from just the name.
+
+ \return A string describing the capture source.
+*/
+
+/*!
+ \fn QVariant Phonon::ObjectDescriptionData::property(const char *name) const
+
+ Returns a named property.
+
+ If the property is not set an invalid value is returned.
+
+ \sa propertyNames()
+*/
+
+/*!
+ \fn QList Phonon::ObjectDescriptionData::propertyNames() const
+
+ Returns all names that return valid data when property() is called.
+
+ \sa property()
+*/
+
+/*!
+ \fn bool Phonon::ObjectDescriptionData::isValid() const
+
+ Returns true if the Tuple is valid (index != -1); otherwise returns
+ false.
+*/
+
+/*!
+ \fn int Phonon::ObjectDescriptionData::index() const
+
+ A unique identifier for this device/. Used internally
+ to distinguish between the devices/.
+
+ \return An integer that uniquely identifies every device.
+*/
+
+/*!
+ \fn static ObjectDescriptionData *Phonon::ObjectDescriptionData::fromIndex(ObjectDescriptionType type, int index)
+ \internal
+*/
+
+/*!
+ \fn Phonon::ObjectDescriptionData::~ObjectDescriptionData()
+ \internal
+*/
+
+/*!
+ \fn Phonon::ObjectDescriptionData::ObjectDescriptionData(ObjectDescriptionPrivate * = 0)
+ \internal
+*/
+
+/*!
+ \class Phonon::AddonInterface
+ \inmodule Phonon
+ \since 4.4
+ \internal
+ \brief Interface for Menu, Chapter, Angle and Title/Track control.
+*/
+
+/*!
+ \fn virtual Phonon::AddonInterface::~AddonInterface()
+ \internal
+*/
+
+/*!
+ \enum Phonon::AddonInterface::Interface
+
+ This enum describes the type of interface represented by an AddonInterface object.
+
+ \value NavigationInterface
+ \value ChapterInterface
+ \value AngleInterface
+ \value TitleInterface
+*/
+
+/*!
+ \enum Phonon::AddonInterface::NavigationCommand
+ \internal
+ \value Menu1Button
+*/
+
+/*!
+ \enum Phonon::AddonInterface::ChapterCommand
+ \internal
+ \value availableChapters
+ \value chapter
+ \value setChapter
+*/
+
+/*!
+ \enum Phonon::AddonInterface::AngleCommand
+ \internal
+ \value availableAngles
+ \value angle
+ \value setAngle
+*/
+
+/*!
+ \enum Phonon::AddonInterface::TitleCommand
+ \internal
+ \value availableTitles
+ \value title
+ \value setTitle
+ \value autoplayTitles
+ \value setAutoplayTitles
+*/
+
+/*!
+ \fn virtual bool Phonon::AddonInterface::hasInterface(Interface iface) const = 0
+ \internal
+*/
+
+/*!
+ \fn virtual QVariant Phonon::AddonInterface::interfaceCall(Interface iface, int command,
+ const QList &arguments) = 0
+ \internal
+*/
+
+/*!
+ \class Phonon::MediaNodePrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \namespace Phonon::Factory
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \fn Sender *Phonon::Factory::sender()
+
+ Returns a pointer to the object emitting the signals.
+
+ \sa Sender::backendChanged()
+*/
+
+/*!
+ \fn QObject *Phonon::Factory::createMediaObject(QObject *parent = 0)
+
+ Create a new backend object for a MediaObject.
+
+ \return a pointer to the MediaObject the backend provides.
+*/
+
+/*!
+ \fn QObject *Phonon::Factory::createEffect(int effectId, QObject *parent = 0)
+
+ Create a new backend object for a Effect.
+
+ \return a pointer to the Effect the backend provides.
+*/
+
+/*!
+ \fn QObject *Phonon::Factory::createVolumeFaderEffect(QObject *parent = 0)
+
+ Create a new backend object for a VolumeFaderEffect.
+
+ \return a pointer to the VolumeFaderEffect the backend provides.
+*/
+
+/*!
+ \fn QObject *Phonon::Factory::createAudioOutput(QObject *parent = 0)
+
+ Create a new backend object for a AudioOutput.
+
+ \return a pointer to the AudioOutput the backend provides.
+*/
+
+/*!
+ \fn QObject *Phonon::Factory::createVideoWidget(QObject *parent = 0)
+
+ Create a new backend object for a VideoWidget.
+
+ \return a pointer to the VideoWidget the backend provides.
+*/
+
+/*!
+ \fn QObject *Phonon::Factory::backend(bool createWhenNull = true)
+
+ \return a pointer to the backend interface.
+*/
+
+/*!
+ \fn QString Phonon::Factory::identifier()
+
+ Unique identifier for the Backend. Can be used in configuration files
+ for example.
+*/
+
+
+/*!
+ \fn QString Phonon::Factory::backendName()
+
+ Get the name of the Backend.
+ \omit
+ It's the name from the .desktop file.
+ \endomit
+*/
+
+/*!
+ \fn QString Phonon::Factory::backendComment()
+
+ Get the comment of the Backend.
+ \omit
+ It's the comment from the .desktop file.
+ \endomit
+*/
+
+/*!
+ \fn QString Phonon::Factory::backendVersion()
+
+ Get the version of the Backend.
+ \omit
+ It's the version from the .desktop file.
+ \endomit
+
+ The version is especially interesting if there are several versions
+ available for binary incompatible versions of the backend's media
+ framework.
+*/
+
+/*!
+ \fn QString Phonon::Factory::backendIcon()
+
+ Get the icon (name) of the Backend.
+ \omit
+ It's the icon from the .desktop file.
+ \endomit
+*/
+
+/*!
+ \fn QString Phonon::Factory::backendWebsite()
+
+ Get the website of the Backend.
+ \omit
+ It's the website from the .desktop file.
+ \endomit
+*/
+
+/*!
+ \fn QObject *Phonon::Factory::registerQObject(QObject *object)
+
+ Registers the given backend \a object with the factory.
+*/
+
+/*!
+ \fn bool Phonon::Factory::isMimeTypeAvailable(const QString &mimeType)
+*/
+
+/*!
+ \fn void Phonon::Factory::registerFrontendObject(MediaNodePrivate *)
+ \internal
+*/
+
+/*!
+ \fn void Phonon::Factory::deregisterFrontendObject(MediaNodePrivate *)
+ \internal
+*/
+
+/*!
+ \fn void Phonon::Factory::setBackend(QObject *)
+*/
+
+/*!
+ \fn PlatformPlugin *Phonon::Factory::platformPlugin()
+*/
+
+/*!
+/*!
+ \class Phonon::AbstractMediaStreamPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::FrontendInterfacePrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::EffectWidgetPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::IODeviceStream
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \fn explicit Phonon::IODeviceStream::IODeviceStream(QIODevice *ioDevice, QObject *parent = 0)
+ \internal
+
+ Creates a new IODeviceStream with the given \a ioDevice and \a
+ parent.
+
+*/
+
+/*!
+ \fn Phonon::IODeviceStream::~IODeviceStream()
+ \internal
+*/
+
+/*!
+ \fn void Phonon::IODeviceStream::reset()
+ \internal
+*/
+
+/*!
+ \fn void Phonon::IODeviceStream::needData()
+ \internal
+*/
+
+/*!
+ \fn void Phonon::IODeviceStream::seekStream(qint64)
+ \internal
+*/
+
+/*!
+ \namespace Phonon::Platform
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \typedef Phonon::EffectDescriptionModel
+ \inmodule Phonon
+ \brief provides a item view model containing available audio effects.
+
+*/
+
+/*!
+ \typedef Phonon::SubtitleDescription
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \typedef Phonon::SubtitleDescriptionModel
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \typedef Phonon::AudioChannelDescription
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \typedef Phonon::AudioChannelDescriptionModel
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \typedef Phonon::AudioCaptureDevice
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \typedef Phonon::AudioCaptureDeviceModel
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \typedef Phonon::CleanUpFunction
+ \inmodule Phonon
+ \internal
+*/
+
+/*!
+ \typedef Phonon::QObjectPair
+ \inmodule Phonon
+ \since 4.4
+ \internal
+
+*/
+
+/*!
+ \typedef Phonon::AudioOutputDeviceModel
+ \inmodule Phonon
+ \brief provides an item view model containing available audio output devices.
+
+*/
+
+/*!
+ \fn uint Phonon::qHash(const Phonon::EffectParameter ¶m)
+ \internal
+
+*/
+
+/*!
+ \fn Phonon::CleanUpGlobalStatic::~CleanUpGlobalStatic()
+ \internal
+*/
+
+/*!
+ \class Phonon::ConstIface
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::CleanUpGlobalStatic
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class Phonon::EffectParameterPrivate
+ \inmodule Phonon
+ \since 4.4
+ \internal
+
+*/
+
+/*!
+ \class Phonon::QSettingsGroup
+ \inmodule Phonon
+ \since 4.4
+ \internal
+
+*/
+
+/*!
+ \class Phonon::MediaNodeDestructionHandler
+ \inmodule Phonon
+ \since 4.4
+ \internal
+
+*/
+
+/*!
+ \fn Phonon::MediaNodeDestructionHandler::~MediaNodeDestructionHandler()
+ \internal
+ Called from Base::~Base if this object was registered
+ using BasePrivate::addDestructionHandler().
+*/
+
+/*!
+ \fn Phonon::MediaNodeDestructionHandler::phononObjectDestroyed(MediaNodePrivate *)
+ \internal
+*/
+
+/*!
+ \fn explicit Phonon::EffectWidget::EffectWidget(Effect *effect, QWidget *parent = 0)
+ \internal
+
+ Constructs a new EffectWidget for the specified \a effect and with
+ the specified \a parent.
+*/
+
+/*!
+ \fn Phonon::EffectWidget::~EffectWidget()
+ \internal
+*/
+
+/*!
+ \fn QDebug Phonon::operator<<(QDebug s, const ObjectDescription &o)
+ \internal
+*/
+
+/*!
+ \class Phonon::ListModelHelper
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
+/*!
+ \class AudioOutputInterface42
+ \inmodule Phonon
+ \since 4.4
+ \internal
+*/
+
diff --git a/doc/src/classes/q3asciicache.qdoc b/doc/src/classes/q3asciicache.qdoc
new file mode 100644
index 0000000..43537cc
--- /dev/null
+++ b/doc/src/classes/q3asciicache.qdoc
@@ -0,0 +1,465 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \class Q3AsciiCache
+ \brief The Q3AsciiCache class is a template class that provides a cache based on char* keys.
+ \compat
+
+ Q3AsciiCache is implemented as a template class. Define a template
+ instance Q3AsciiCache\ to create a cache that operates on
+ pointers to X (X*).
+
+ A cache is a least recently used (LRU) list of cache items. The
+ cache items are accessed via \c char* keys. For Unicode keys use
+ the Q3Cache template instead, which uses QString keys. A Q3Cache
+ has the same performace as a Q3AsciiCache.
+
+ Each cache item has a cost. The sum of item costs, totalCost(),
+ will not exceed the maximum cache cost, maxCost(). If inserting a
+ new item would cause the total cost to exceed the maximum cost,
+ the least recently used items in the cache are removed.
+
+ Apart from insert(), by far the most important function is find()
+ (which also exists as operator[]()). This function looks up an
+ item, returns it, and by default marks it as being the most
+ recently used item.
+
+ There are also methods to remove() or take() an object from the
+ cache. Calling \link Q3PtrCollection::setAutoDelete()
+ setAutoDelete(TRUE)\endlink tells the cache to delete items that
+ are removed. The default is to not delete items when then are
+ removed (i.e., remove() and take() are equivalent).
+
+ When inserting an item into the cache, only the pointer is copied,
+ not the item itself. This is called a shallow copy. It is possible
+ to make the cache copy all of the item's data (known as a deep
+ copy) when an item is inserted. insert() calls the virtual
+ function Q3PtrCollection::newItem() for the item to be inserted.
+ Inherit a cache and reimplement newItem() if you want deep copies.
+
+ When removing a cache item the virtual function
+ Q3PtrCollection::deleteItem() is called. Its default implementation
+ in Q3AsciiCache is to delete the item if \link
+ Q3PtrCollection::setAutoDelete() auto-deletion\endlink is enabled.
+
+ There is a Q3AsciiCacheIterator which may be used to traverse the
+ items in the cache in arbitrary order.
+
+ \sa Q3AsciiCacheIterator, Q3Cache, Q3IntCache
+*/
+
+/*!
+ \fn Q3AsciiCache::Q3AsciiCache( const Q3AsciiCache &c )
+
+ \internal
+
+ Do not use. A Q3AsciiCache cannot be copied. Calls qFatal() in debug version.
+*/
+
+
+/*!
+ \fn Q3AsciiCache::Q3AsciiCache( int maxCost, int size, bool caseSensitive, bool copyKeys )
+
+ Constructs a cache whose contents will never have a total cost
+ greater than \a maxCost and which is expected to contain less than
+ \a size items.
+
+ \a size is actually the size of an internal hash array; it's
+ usually best to make it prime and at least 50% bigger than the
+ largest expected number of items in the cache.
+
+ Each inserted item has an associated cost. When inserting a new
+ item, if the total cost of all items in the cache will exceed \a
+ maxCost, the cache will start throwing out the older (least
+ recently used) items until there is enough room for the new item
+ to be inserted.
+
+ If \a caseSensitive is TRUE (the default), the cache keys are case
+ sensitive; if it is FALSE, they are case-insensitive.
+ Case-insensitive comparison only affects the 26 letters in
+ US-ASCII. If \a copyKeys is TRUE (the default), Q3AsciiCache makes
+ a copy of the cache keys, otherwise it copies just the const char
+ * pointer - slightly faster if you can guarantee that the keys
+ will never change, but very risky.
+*/
+
+/*!
+ \fn Q3AsciiCache::~Q3AsciiCache()
+
+ Removes all items from the cache and destroys it.
+ All iterators that access this cache will be reset.
+*/
+
+/*!
+ \fn Q3AsciiCache& Q3AsciiCache::operator=( const Q3AsciiCache &c )
+
+ \internal
+
+ Do not use. A Q3AsciiCache cannot be copied. Calls qFatal() in debug version.
+*/
+
+/*!
+ \fn int Q3AsciiCache::maxCost() const
+
+ Returns the maximum allowed total cost of the cache.
+
+ \sa setMaxCost() totalCost()
+*/
+
+/*!
+ \fn int Q3AsciiCache::totalCost() const
+
+ Returns the total cost of the items in the cache. This is an
+ integer in the range 0 to maxCost().
+
+ \sa setMaxCost()
+*/
+
+/*!
+ \fn void Q3AsciiCache::setMaxCost( int m )
+
+ Sets the maximum allowed total cost of the cache to \a m. If the
+ current total cost is greater than \a m, some items are removed
+ immediately.
+
+ \sa maxCost() totalCost()
+*/
+
+/*!
+ \fn uint Q3AsciiCache::count() const
+
+ Returns the number of items in the cache.
+
+ \sa totalCost() size()
+*/
+
+/*!
+ \fn uint Q3AsciiCache::size() const
+
+ Returns the size of the hash array used to implement the cache.
+ This should be a bit bigger than count() is likely to be.
+*/
+
+/*!
+ \fn bool Q3AsciiCache::isEmpty() const
+
+ Returns TRUE if the cache is empty; otherwise returns FALSE.
+*/
+
+/*!
+ \fn bool Q3AsciiCache::insert( const char *k, const type *d, int c, int p )
+
+ Inserts the item \a d into the cache using key \a k, and with an
+ associated cost of \a c. Returns TRUE if the item is successfully
+ inserted. Returns FALSE if the item is not inserted, for example,
+ if the cost of the item exceeds maxCost().
+
+ The cache's size is limited, and if the total cost is too high,
+ Q3AsciiCache will remove old, least recently used items until there
+ is room for this new item.
+
+ Items with duplicate keys can be inserted.
+
+ The parameter \a p is internal and should be left at the default
+ value (0).
+
+ \warning If this function returns FALSE, you must delete \a d
+ yourself. Additionally, be very careful about using \a d after
+ calling this function, because any other insertions into the
+ cache, from anywhere in the application or within Qt itself, could
+ cause the object to be discarded from the cache and the pointer to
+ become invalid.
+*/
+
+/*!
+ \fn bool Q3AsciiCache::remove( const char *k )
+
+ Removes the item with key \a k and returns TRUE if the item was
+ present in the cache; otherwise returns FALSE.
+
+ The item is deleted if auto-deletion has been enabled, i.e., if
+ you have called \link Q3PtrCollection::setAutoDelete()
+ setAutoDelete(TRUE)\endlink.
+
+ If there are two or more items with equal keys, the one that was
+ inserted last is removed.
+
+ All iterators that refer to the removed item are set to point to
+ the next item in the cache's traversal order.
+
+ \sa take(), clear()
+*/
+
+/*!
+ \fn type *Q3AsciiCache::take( const char *k )
+
+ Takes the item associated with \a k out of the cache without
+ deleting it and returns a pointer to the item taken out, or 0
+ if the key does not exist in the cache.
+
+ If there are two or more items with equal keys, the one that was
+ inserted last is taken.
+
+ All iterators that refer to the taken item are set to point to the
+ next item in the cache's traversal order.
+
+ \sa remove(), clear()
+*/
+
+/*!
+ \fn void Q3AsciiCache::clear()
+
+ Removes all items from the cache, and deletes them if \link
+ Q3PtrCollection::setAutoDelete() auto-deletion\endlink has been
+ enabled.
+
+ All cache iterators that operate on this cache are reset.
+
+ \sa remove() take()
+*/
+
+/*!
+ \fn type *Q3AsciiCache::find( const char *k, bool ref ) const
+
+ Returns the item with key \a k, or 0 if the key does not exist
+ in the cache. If \a ref is TRUE (the default), the item is moved
+ to the front of the least recently used list.
+
+ If there are two or more items with equal keys, the one that was
+ inserted last is returned.
+*/
+
+/*!
+ \fn type *Q3AsciiCache::operator[]( const char *k ) const
+
+ Returns the item with key \a k, or 0 if \a k does not exist in
+ the cache, and moves the item to the front of the least recently
+ used list.
+
+ If there are two or more items with equal keys, the one that was
+ inserted last is returned.
+
+ This is the same as find( k, TRUE ).
+
+ \sa find()
+*/
+
+/*!
+ \fn void Q3AsciiCache::statistics() const
+
+ A debug-only utility function. Prints out cache usage, hit/miss,
+ and distribution information using qDebug(). This function does
+ nothing in the release library.
+*/
+
+/*!
+ \class Q3AsciiCacheIterator
+ \brief The Q3AsciiCacheIterator class provides an iterator for Q3AsciiCache collections.
+ \compat
+
+ Note that the traversal order is arbitrary; you are not guaranteed
+ any particular order. If new objects are inserted into the cache
+ while the iterator is active, the iterator may or may not see
+ them.
+
+ Multiple iterators are completely independent, even when they
+ operate on the same Q3AsciiCache. Q3AsciiCache updates all iterators
+ that refer an item when that item is removed.
+
+ Q3AsciiCacheIterator provides an operator++() and an operator+=()
+ to traverse the cache; current() and currentKey() to access the
+ current cache item and its key. It also provides atFirst() and
+ atLast(), which return TRUE if the iterator points to the first or
+ last item in the cache respectively. The isEmpty() function
+ returns TRUE if the cache is empty; and count() returns the number
+ of items in the cache.
+
+ Note that atFirst() and atLast() refer to the iterator's arbitrary
+ ordering, not to the cache's internal least recently used list.
+
+ \sa Q3AsciiCache
+*/
+
+/*!
+ \fn Q3AsciiCacheIterator::Q3AsciiCacheIterator( const Q3AsciiCache &cache )
+
+ Constructs an iterator for \a cache. The current iterator item is
+ set to point to the first item in the \a cache.
+*/
+
+/*!
+ \fn Q3AsciiCacheIterator::Q3AsciiCacheIterator (const Q3AsciiCacheIterator