Removed a lot of files not used by the doc generation.
This commit is contained in:
parent
35168cb86a
commit
ee92e460f1
133 changed files with 0 additions and 13336 deletions
|
|
@ -1,8 +0,0 @@
|
||||||
//! [0]
|
|
||||||
#include <QtScriptTools>
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QT += scripttools
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
//! [0]
|
|
||||||
Outlook::Application *outlook = new Outlook::Application;
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Outlook::_NameSpace *session = outlook->Session();
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
Outlook::NameSpace *session = outlook->Session();
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
Outlook::_NameSpace *tmp = outlook->Session();
|
|
||||||
Outlook::NameSpace *session = new Outlook::NameSpace(tmp);
|
|
||||||
delete tmp; // or any other use of tmp: segfault
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
Outlook::NameSpace *session = new Outlook::NameSpace(outlook->Session());
|
|
||||||
//! [4]
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
//! [0]
|
|
||||||
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
RC_FILE = myapp.rc
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
ICON = myapp.icns
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
kde-config --path icon
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
gnome-config --datadir
|
|
||||||
//! [4]
|
|
||||||
|
|
@ -1,110 +0,0 @@
|
||||||
//! [0]
|
|
||||||
assistant -collectionFile file
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<QHelpCollectionProject version="1.0">
|
|
||||||
<assistant>
|
|
||||||
<title>My Application Help</title>
|
|
||||||
<startPage>qthelp://com.mycompany.1_0_0/doc/index.html</startPage>
|
|
||||||
<currentFilter>myfilter</currentFilter>
|
|
||||||
<applicationIcon>application.png</applicationIcon>
|
|
||||||
<enableFilterFunctionality>false</enableFilterFunctionality>
|
|
||||||
<enableDocumentationManager>false</enableDocumentationManager>
|
|
||||||
<enableAddressBar visible="true">true</enableAddressBar>
|
|
||||||
<cacheDirectory>mycompany/myapplication</cacheDirectory>
|
|
||||||
<aboutMenuText>
|
|
||||||
<text>About My Application</text>
|
|
||||||
<text language="de">Über meine Applikation...</text>
|
|
||||||
</aboutMenuText>
|
|
||||||
<aboutDialog>
|
|
||||||
<file>about.txt</file>
|
|
||||||
<file language="de">ueber.txt</file>
|
|
||||||
<icon>about.png</icon>
|
|
||||||
</aboutDialog>
|
|
||||||
</assistant>
|
|
||||||
<docFiles>
|
|
||||||
<generate>
|
|
||||||
<file>
|
|
||||||
<input>myapplication-manual.qhp</input>
|
|
||||||
<output>myapplication-manual.qch</output>
|
|
||||||
</file>
|
|
||||||
</generate>
|
|
||||||
<register>
|
|
||||||
<file>myapplication-manual.qch</file>
|
|
||||||
</register>
|
|
||||||
</docFiles>
|
|
||||||
</QHelpCollectionProject>
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QProcess *process = new QProcess;
|
|
||||||
QStringList args;
|
|
||||||
args << QLatin1String("-collectionFile")
|
|
||||||
<< QLatin1String("mycollection.qhc")
|
|
||||||
<< QLatin1String("-enableRemoteControl");
|
|
||||||
process->start(QLatin1String("assistant"), args);
|
|
||||||
if (!process->waitForStarted())
|
|
||||||
return;
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QByteArray ba;
|
|
||||||
ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html");
|
|
||||||
ba.append('\0');
|
|
||||||
process->write(ba);
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QByteArray ba;
|
|
||||||
ba.append("hide bookmarks;");
|
|
||||||
ba.append("hide index;");
|
|
||||||
ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html");
|
|
||||||
ba.append('\0');
|
|
||||||
process->write(ba);
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<QHelpCollectionProject version="1.0">
|
|
||||||
...
|
|
||||||
<docFiles>
|
|
||||||
<register>
|
|
||||||
<file>myapplication-manual.qch</file>
|
|
||||||
<file>another-manual.qch</file>
|
|
||||||
</register>
|
|
||||||
</docFiles>
|
|
||||||
</QHelpCollectionProject>
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
assistant -collectionFile mycollection.qhc -register myapplication-manual.qch
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<QHelpCollectionProject version="1.0">
|
|
||||||
<assistant>
|
|
||||||
<title>My Application Help</title>
|
|
||||||
<cacheDirectory>mycompany/myapplication</cacheDirectory>
|
|
||||||
...
|
|
||||||
</assistant>
|
|
||||||
</QHelpCollectionProject>
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
assistant -collectionFile mycollection.qhc
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
%QDesktopServices::DataLocation%/mycompany/myapplication/mycollection.qhc
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
qcollectiongenerator mycollection.qhcp -o mycollection.qhc
|
|
||||||
//! [10]
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
//! [0]
|
|
||||||
if (*ptr == expected) {
|
|
||||||
*ptr = newval;
|
|
||||||
return !0;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
if (*ptr == expected) {
|
|
||||||
*ptr = newval;
|
|
||||||
return !0;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
++(*ptr);
|
|
||||||
return *ptr ? !0 : 0;
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
return ++(*ptr);
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
++(*ptr);
|
|
||||||
return !(ControlRegister & ZeroFlag);
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
--(*ptr);
|
|
||||||
return *ptr ? : 0;
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
return --(*ptr);
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
--(*ptr);
|
|
||||||
return !(ControlRegister & ZeroFlag);
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
tmp = *ptr;
|
|
||||||
*ptr = newval;
|
|
||||||
return tmp;
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
tmp = *ptr;
|
|
||||||
*ptr = newval;
|
|
||||||
return tmp;
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
tmp = *ptr;
|
|
||||||
*ptr += value;
|
|
||||||
return tmp;
|
|
||||||
//! [10]
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QTDIR=C:\Progra~1\Qt
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
/usr/vacpp/bin/makeC++SharedLib -o shr1.o cplussource1.o
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,235 +0,0 @@
|
||||||
//! [0]
|
|
||||||
class Employee
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Employee() {}
|
|
||||||
Employee(const Employee &other);
|
|
||||||
|
|
||||||
Employee &operator=(const Employee &other);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString myName;
|
|
||||||
QDate myDateOfBirth;
|
|
||||||
};
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QList<QString> list;
|
|
||||||
list << "A" << "B" << "C" << "D";
|
|
||||||
|
|
||||||
QListIterator<QString> i(list);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QListIterator<QString> i(list);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious())
|
|
||||||
qDebug() << i.previous();
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QMutableListIterator<int> i(list);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
if (i.next() % 2 != 0)
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QMutableListIterator<int> i(list);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious()) {
|
|
||||||
if (i.previous() % 2 != 0)
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QMutableListIterator<int> i(list);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
if (i.next() > 128)
|
|
||||||
i.setValue(128);
|
|
||||||
}
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
QMutableListIterator<int> i(list);
|
|
||||||
while (i.hasNext())
|
|
||||||
i.next() *= 2;
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
QMap<QString, QString> map;
|
|
||||||
map.insert("Paris", "France");
|
|
||||||
map.insert("Guatemala City", "Guatemala");
|
|
||||||
map.insert("Mexico City", "Mexico");
|
|
||||||
map.insert("Moscow", "Russia");
|
|
||||||
...
|
|
||||||
|
|
||||||
QMutableMapIterator<QString, QString> i(map);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
if (i.next().key().endsWith("City"))
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QMap<int, QWidget *> map;
|
|
||||||
QHash<int, QWidget *> hash;
|
|
||||||
|
|
||||||
QMapIterator<int, QWidget *> i(map);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
hash.insert(i.key(), i.value());
|
|
||||||
}
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QMutableMapIterator<int, QWidget *> i(map);
|
|
||||||
while (i.findNext(widget))
|
|
||||||
i.remove();
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
QList<QString> list;
|
|
||||||
list << "A" << "B" << "C" << "D";
|
|
||||||
|
|
||||||
QList<QString>::iterator i;
|
|
||||||
for (i = list.begin(); i != list.end(); ++i)
|
|
||||||
*i = (*i).toLower();
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
QList<QString> list;
|
|
||||||
list << "A" << "B" << "C" << "D";
|
|
||||||
|
|
||||||
QList<QString>::iterator i = list.end();
|
|
||||||
while (i != list.begin()) {
|
|
||||||
--i;
|
|
||||||
*i = (*i).toLower();
|
|
||||||
}
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
QList<QString>::const_iterator i;
|
|
||||||
for (i = list.constBegin(); i != list.constEnd(); ++i)
|
|
||||||
qDebug() << *i;
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
QMap<int, int> map;
|
|
||||||
...
|
|
||||||
QMap<int, int>::const_iterator i;
|
|
||||||
for (i = map.constBegin(); i != map.constEnd(); ++i)
|
|
||||||
qDebug() << i.key() << ":" << i.value();
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
// RIGHT
|
|
||||||
const QList<int> sizes = splitter->sizes();
|
|
||||||
QList<int>::const_iterator i;
|
|
||||||
for (i = sizes.begin(); i != sizes.end(); ++i)
|
|
||||||
...
|
|
||||||
|
|
||||||
// WRONG
|
|
||||||
QList<int>::const_iterator i;
|
|
||||||
for (i = splitter->sizes().begin();
|
|
||||||
i != splitter->sizes().end(); ++i)
|
|
||||||
...
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
QLinkedList<QString> list;
|
|
||||||
...
|
|
||||||
QString str;
|
|
||||||
foreach (str, list)
|
|
||||||
qDebug() << str;
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
QLinkedList<QString> list;
|
|
||||||
...
|
|
||||||
QLinkedListIterator<QString> i(list);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
QLinkedList<QString> list;
|
|
||||||
...
|
|
||||||
foreach (QString str, list)
|
|
||||||
qDebug() << str;
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
QLinkedList<QString> list;
|
|
||||||
...
|
|
||||||
foreach (QString str, list) {
|
|
||||||
if (str.isEmpty())
|
|
||||||
break;
|
|
||||||
qDebug() << str;
|
|
||||||
}
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
QMap<QString, int> map;
|
|
||||||
...
|
|
||||||
foreach (QString str, map.keys())
|
|
||||||
qDebug() << str << ":" << map.value(str);
|
|
||||||
//! [19]
|
|
||||||
|
|
||||||
|
|
||||||
//! [20]
|
|
||||||
QMultiMap<QString, int> map;
|
|
||||||
...
|
|
||||||
foreach (QString str, map.uniqueKeys()) {
|
|
||||||
foreach (int i, map.values(str))
|
|
||||||
qDebug() << str << ":" << i;
|
|
||||||
}
|
|
||||||
//! [20]
|
|
||||||
|
|
||||||
|
|
||||||
//! [21]
|
|
||||||
forever {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [21]
|
|
||||||
|
|
||||||
|
|
||||||
//! [22]
|
|
||||||
CONFIG += no_keywords
|
|
||||||
//! [22]
|
|
||||||
|
|
||||||
|
|
||||||
//! [23]
|
|
||||||
QString onlyLetters(const QString &in)
|
|
||||||
{
|
|
||||||
QString out;
|
|
||||||
for (int j = 0; j < in.size(); ++j) {
|
|
||||||
if (in[j].isLetter())
|
|
||||||
out += in[j];
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
//! [23]
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QPainter painter(this);
|
|
||||||
|
|
||||||
painter.setPen(Qt::darkGreen);
|
|
||||||
painter.drawRect(1, 2, 6, 4);
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QPainter painter(this);
|
|
||||||
|
|
||||||
painter.setPen(Qt::darkGreen);
|
|
||||||
painter.drawLine(2, 7, 6, 1);
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QPainter painter(this);
|
|
||||||
painter.setRenderHint(
|
|
||||||
QPainter::Antialiasing);
|
|
||||||
painter.setPen(Qt::darkGreen);
|
|
||||||
painter.drawRect(1, 2, 6, 4);
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QPainter painter(this);
|
|
||||||
painter.setRenderHint(
|
|
||||||
QPainter::Antialiasing);
|
|
||||||
painter.setPen(Qt::darkGreen);
|
|
||||||
painter.drawLine(2, 7, 6, 1);
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QPainter painter(this);
|
|
||||||
painter.setWindow(QRect(-50, -50, 100, 100));
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
int side = qMin(width(), height())
|
|
||||||
int x = (width() - side / 2);
|
|
||||||
int y = (height() - side / 2);
|
|
||||||
|
|
||||||
painter.setViewport(x, y, side, side);
|
|
||||||
//! [5]
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
//! [0]
|
|
||||||
qDebug() << "Widget" << widget << "at position" << widget->pos();
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
char *alloc(int size)
|
|
||||||
{
|
|
||||||
Q_ASSERT(size > 0);
|
|
||||||
char *ptr = new char[size];
|
|
||||||
Q_CHECK_PTR(ptr);
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
char *alloc(int size)
|
|
||||||
{
|
|
||||||
char *ptr;
|
|
||||||
Q_CHECK_PTR(ptr = new char[size]); // WRONG
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,414 +0,0 @@
|
||||||
//! [0]
|
|
||||||
cd /path/to/Qt
|
|
||||||
./configure -static -prefix /path/to/Qt <other parameters>
|
|
||||||
make sub-src
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
cd /path/to/Qt/examples/tools/plugandpaint
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
make clean
|
|
||||||
PATH=/path/to/Qt/bin:$PATH
|
|
||||||
export PATH
|
|
||||||
qmake -config release
|
|
||||||
make
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
ldd ./application
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
cd /path/to/Qt/examples/tools/plugandpaint
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
make clean
|
|
||||||
qmake -config release
|
|
||||||
make
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
cd ../plugandpaintplugins
|
|
||||||
make clean
|
|
||||||
qmake -config release
|
|
||||||
make
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
#!/bin/sh
|
|
||||||
appname=`basename $0 | sed s,\.sh$,,`
|
|
||||||
|
|
||||||
dirname=`dirname $0`
|
|
||||||
tmp="${dirname#?}"
|
|
||||||
|
|
||||||
if [ "${dirname%$tmp}" != "/" ]; then
|
|
||||||
dirname=$PWD/$dirname
|
|
||||||
fi
|
|
||||||
LD_LIBRARY_PATH=$dirname
|
|
||||||
export LD_LIBRARY_PATH
|
|
||||||
$dirname/$appname $*
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
DESTDIR = /path/to/Qt/plugandpaint/plugins
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
qApp->addLibraryPath("/some/other/path");
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
ldd ./application
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
cd C:\path\to\Qt
|
|
||||||
configure -static <any other options you need>
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
nmake sub-src
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
cd examples\tools\plugandpaint
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
nmake clean
|
|
||||||
qmake -config release
|
|
||||||
nmake
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
cd examples\tools\plugandpaint
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
nmake clean
|
|
||||||
qmake -config release
|
|
||||||
nmake
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
cd ..\plugandpaintplugins
|
|
||||||
nmake clean
|
|
||||||
qmake -config release
|
|
||||||
nmake
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
plugins\pnp_basictools.dll
|
|
||||||
plugins\pnp_extrafilters.dll
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
qApp->addLibraryPath("C:\some\other\path");
|
|
||||||
//! [19]
|
|
||||||
|
|
||||||
|
|
||||||
//! [20]
|
|
||||||
embed_manifest_dll
|
|
||||||
embed_manifest_exe
|
|
||||||
//! [20]
|
|
||||||
|
|
||||||
|
|
||||||
//! [21]
|
|
||||||
CONFIG += embed_manifest_exe
|
|
||||||
//! [21]
|
|
||||||
|
|
||||||
|
|
||||||
//! [22]
|
|
||||||
<Visual Studio Install Path>\VC\redist\<Architecture>\Microsoft.VC80.CRT
|
|
||||||
//! [22]
|
|
||||||
|
|
||||||
|
|
||||||
//! [23]
|
|
||||||
CONFIG-=embed_manifest_dll
|
|
||||||
//! [23]
|
|
||||||
|
|
||||||
|
|
||||||
//! [24]
|
|
||||||
depends <application executable>
|
|
||||||
//! [24]
|
|
||||||
|
|
||||||
|
|
||||||
//! [25]
|
|
||||||
C:<path to Qt>\plugins
|
|
||||||
//! [25]
|
|
||||||
|
|
||||||
|
|
||||||
//! [26]
|
|
||||||
CONFIG-=app_bundle
|
|
||||||
//! [26]
|
|
||||||
|
|
||||||
|
|
||||||
//! [27]
|
|
||||||
cd /path/to/Qt
|
|
||||||
./configure -static <other parameters>
|
|
||||||
make sub-src
|
|
||||||
//! [27]
|
|
||||||
|
|
||||||
|
|
||||||
//! [28]
|
|
||||||
cd /path/to/Qt/examples/tools/plugandpaint
|
|
||||||
//! [28]
|
|
||||||
|
|
||||||
|
|
||||||
//! [29]
|
|
||||||
make clean
|
|
||||||
qmake -config release
|
|
||||||
make
|
|
||||||
//! [29]
|
|
||||||
|
|
||||||
|
|
||||||
//! [30]
|
|
||||||
otool -L plugandpaint.app/Contents/MacOs/plugandpaint
|
|
||||||
//! [30]
|
|
||||||
|
|
||||||
|
|
||||||
//! [31]
|
|
||||||
plugandpaint.app/Contents/MacOS/plugandpaint:
|
|
||||||
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
|
|
||||||
(compatibility version 2.0.0, current version 128.0.0)
|
|
||||||
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
|
|
||||||
(compatibility version 1.0.0, current version 10.0.0)
|
|
||||||
/usr/lib/libz.1.dylib
|
|
||||||
(compatibility version 1.0.0, current version 1.2.3)
|
|
||||||
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
|
|
||||||
(compatibility version 1.0.0, current version 22.0.0)
|
|
||||||
/usr/lib/libstdc++.6.dylib
|
|
||||||
(compatibility version 7.0.0, current version 7.3.0)
|
|
||||||
/usr/lib/libgcc_s.1.dylib
|
|
||||||
(compatibility version 1.0.0, current version 1.0.0)
|
|
||||||
/usr/lib/libmx.A.dylib
|
|
||||||
(compatibility version 1.0.0, current version 92.0.0)
|
|
||||||
/usr/lib/libSystem.B.dylib
|
|
||||||
(compatibility version 1.0.0, current version 88.0.0)
|
|
||||||
//! [31]
|
|
||||||
|
|
||||||
|
|
||||||
//! [32]
|
|
||||||
-lQtGui
|
|
||||||
//! [32]
|
|
||||||
|
|
||||||
|
|
||||||
//! [33]
|
|
||||||
/where/static/qt/lib/is/libQtGui.a
|
|
||||||
//! [33]
|
|
||||||
|
|
||||||
|
|
||||||
//! [34]
|
|
||||||
cd /path/to/Qt/examples/tools/plugandpaint
|
|
||||||
//! [34]
|
|
||||||
|
|
||||||
|
|
||||||
//! [35]
|
|
||||||
make clean
|
|
||||||
qmake -config release
|
|
||||||
make
|
|
||||||
//! [35]
|
|
||||||
|
|
||||||
|
|
||||||
//! [36]
|
|
||||||
cd ../plugandpaintplugins
|
|
||||||
make clean
|
|
||||||
qmake -config release
|
|
||||||
make
|
|
||||||
//! [36]
|
|
||||||
|
|
||||||
|
|
||||||
//! [37]
|
|
||||||
otool -L QtGui.framework/QtGui
|
|
||||||
//! [37]
|
|
||||||
|
|
||||||
|
|
||||||
//! [38]
|
|
||||||
QtGui.framework/QtGui:
|
|
||||||
/path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
(compatibility version 4.0.0, current version 4.0.1)
|
|
||||||
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
|
|
||||||
(compatibility version 2.0.0, current version 128.0.0)
|
|
||||||
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
|
|
||||||
(compatibility version 1.0.0, current version 10.0.0)
|
|
||||||
/path/to/Qt/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
(compatibility version 4.0.0, current version 4.0.1)
|
|
||||||
/usr/lib/libz.1.dylib
|
|
||||||
(compatibility version 1.0.0, current version 1.2.3)
|
|
||||||
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
|
|
||||||
(compatibility version 1.0.0, current version 22.0.0)
|
|
||||||
/usr/lib/libstdc++.6.dylib
|
|
||||||
(compatibility version 7.0.0, current version 7.3.0)
|
|
||||||
/usr/lib/libgcc_s.1.dylib
|
|
||||||
(compatibility version 1.0.0, current version 1.0.0)
|
|
||||||
/usr/lib/libmx.A.dylib
|
|
||||||
(compatibility version 1.0.0, current version 92.0.0)
|
|
||||||
/usr/lib/libSystem.B.dylib
|
|
||||||
(compatibility version 1.0.0, current version 88.0.0)
|
|
||||||
//! [38]
|
|
||||||
|
|
||||||
|
|
||||||
//! [39]
|
|
||||||
mkdir plugandpaint.app/Contents/Frameworks
|
|
||||||
cp -R /path/to/Qt/lib/QtCore.framework
|
|
||||||
plugandpaint.app/Contents/Frameworks
|
|
||||||
cp -R /path/to/Qt/lib/QtGui.framework
|
|
||||||
plugandpaint.app/Contents/Frameworks
|
|
||||||
//! [39]
|
|
||||||
|
|
||||||
|
|
||||||
//! [40]
|
|
||||||
install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
plugandpaint.app/Contents/Frameworks/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
plugandpaint.app/Contents/Frameworks/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
//! [40]
|
|
||||||
|
|
||||||
|
|
||||||
//! [41]
|
|
||||||
install_name_tool -change path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
@executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
plugandpaint.app/Contents/MacOs/plugandpaint
|
|
||||||
install_name_tool -change path/to/qt/lib/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
@executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
plugandpaint.app/Contents/MacOs/plugandpaint
|
|
||||||
//! [41]
|
|
||||||
|
|
||||||
|
|
||||||
//! [42]
|
|
||||||
install_name_tool -change path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
@executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
plugandpaint.app/Contents/Frameworks/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
//! [42]
|
|
||||||
|
|
||||||
|
|
||||||
//! [43]
|
|
||||||
mv plugins plugandpaint.app/Contents
|
|
||||||
//! [43]
|
|
||||||
|
|
||||||
|
|
||||||
//! [44]
|
|
||||||
libpnp_basictools.dylib:
|
|
||||||
libpnp_basictools.dylib
|
|
||||||
(compatibility version 0.0.0, current version 0.0.0)
|
|
||||||
/path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
(compatibility version 4.0.0, current version 4.0.1)
|
|
||||||
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
|
|
||||||
(compatibility version 2.0.0, current version 128.0.0)
|
|
||||||
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
|
|
||||||
(compatibility version 1.0.0, current version 10.0.0)
|
|
||||||
/path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
(compatibility version 4.0.0, current version 4.0.1)
|
|
||||||
/usr/lib/libz.1.dylib
|
|
||||||
(compatibility version 1.0.0, current version 1.2.3)
|
|
||||||
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
|
|
||||||
(compatibility version 1.0.0, current version 22.0.0)
|
|
||||||
/usr/lib/libstdc++.6.dylib
|
|
||||||
(compatibility version 7.0.0, current version 7.3.0)
|
|
||||||
/usr/lib/libgcc_s.1.dylib
|
|
||||||
(compatibility version 1.0.0, current version 1.0.0)
|
|
||||||
/usr/lib/libmx.A.dylib
|
|
||||||
(compatibility version 1.0.0, current version 92.0.0)
|
|
||||||
/usr/lib/libSystem.B.dylib
|
|
||||||
(compatibility version 1.0.0, current version 88.0.0)
|
|
||||||
//! [44]
|
|
||||||
|
|
||||||
|
|
||||||
//! [45]
|
|
||||||
install_name_tool -change /path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
@executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
plugandpaint.app/Contents/plugins/libpnp_basictools.dylib
|
|
||||||
install_name_tool -change /path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
@executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
plugandpaint.app/Contents/plugins/libpnp_basictools.dylib
|
|
||||||
//! [45]
|
|
||||||
|
|
||||||
|
|
||||||
//! [46]
|
|
||||||
#elif defined(Q_OS_MAC)
|
|
||||||
if (pluginsDir.dirName() == "MacOS") {
|
|
||||||
pluginsDir.cdUp();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
//! [46]
|
|
||||||
|
|
||||||
|
|
||||||
//! [47]
|
|
||||||
cp -R /path/to/Qt/plugins/imageformats
|
|
||||||
pluginandpaint.app/Contents/plugins
|
|
||||||
//! [47]
|
|
||||||
|
|
||||||
|
|
||||||
//! [48]
|
|
||||||
install_name_tool -change /path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
@executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
|
|
||||||
plugandpaint.app/Contents/plugins/imageformats/libqjpeg.dylib
|
|
||||||
install_name_tool -change /path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
@executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
|
||||||
plugandpaint.app/Contents/plugins/imageformats/libqjpeg.dylib
|
|
||||||
//! [48]
|
|
||||||
|
|
||||||
|
|
||||||
//! [49]
|
|
||||||
QDir dir(QApplication::applicationDirPath());
|
|
||||||
dir.cdUp();
|
|
||||||
dir.cd("plugins");
|
|
||||||
QApplication::setLibraryPaths(QStringList(dir.absolutePath()));
|
|
||||||
//! [49]
|
|
||||||
|
|
||||||
|
|
||||||
//! [50]
|
|
||||||
otool -L MyApp.app/Contents/MacOS/MyApp
|
|
||||||
//! [50]
|
|
||||||
|
|
||||||
|
|
||||||
//! [51]
|
|
||||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3
|
|
||||||
//! [51]
|
|
||||||
|
|
||||||
//! [51a]
|
|
||||||
install_name_tool -change /System/Library/Frameworks/CoreVideo.framework/
|
|
||||||
Versions/A/CoreVideo /System/Library/Frameworks/QuartzCore.framework/
|
|
||||||
Versions/A/QuartzCore libphonon_qt7.dylib
|
|
||||||
//! [51a]
|
|
||||||
|
|
||||||
//! [51b]
|
|
||||||
./CONFIGURE - SDK MacOSX10.4u.sdk
|
|
||||||
//! [51b]
|
|
||||||
|
|
||||||
//! [52]
|
|
||||||
./configure (other arguments) -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk
|
|
||||||
//! [52]
|
|
||||||
|
|
||||||
|
|
||||||
//! [53]
|
|
||||||
QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
|
|
||||||
CONFIG+=x86 ppc
|
|
||||||
//! [53]
|
|
||||||
|
|
||||||
|
|
||||||
//! [54]
|
|
||||||
qApp->addLibraryPath("C:/customPath/plugins");
|
|
||||||
//! [54]
|
|
||||||
|
|
@ -1,98 +0,0 @@
|
||||||
//! [0]
|
|
||||||
CONFIG += uitools
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
#include <QtUiTools>
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
void on_<object name>_<signal name>(<signal parameters>);
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
CONFIG += release
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
|
||||||
INSTALLS += target
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QT += script
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
widget.text = 'Hi - I was built ' + new Date().toString();
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
class MyExtension: public QObject,
|
|
||||||
public QdesignerContainerExtension
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_INTERFACE(QDesignerContainerExtension)
|
|
||||||
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QObject *ANewExtensionFactory::createExtension(QObject *object,
|
|
||||||
const QString &iid, QObject *parent) const
|
|
||||||
{
|
|
||||||
if (iid != Q_TYPEID(QDesignerContainerExtension))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (MyCustomWidget *widget = qobject_cast<MyCustomWidget*>
|
|
||||||
(object))
|
|
||||||
return new MyContainerExtension(widget, parent);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QObject *AGeneralExtensionFactory::createExtension(QObject *object,
|
|
||||||
const QString &iid, QObject *parent) const
|
|
||||||
{
|
|
||||||
MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object);
|
|
||||||
|
|
||||||
if (widget && (iid == Q_TYPEID(QDesignerTaskMenuExtension))) {
|
|
||||||
return new MyTaskMenuExtension(widget, parent);
|
|
||||||
|
|
||||||
} else if (widget && (iid == Q_TYPEID(QDesignerContainerExtension))) {
|
|
||||||
return new MyContainerExtension(widget, parent);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
void MyPlugin::initialize(QDesignerFormEditorInterface *formEditor)
|
|
||||||
{
|
|
||||||
if (initialized)
|
|
||||||
return;
|
|
||||||
|
|
||||||
QExtensionManager *manager = formEditor->extensionManager();
|
|
||||||
Q_ASSERT(manager != 0);
|
|
||||||
|
|
||||||
manager->registerExtensions(new MyExtensionFactory(manager),
|
|
||||||
Q_TYPEID(QDesignerTaskMenuExtension));
|
|
||||||
|
|
||||||
initialized = true;
|
|
||||||
}
|
|
||||||
//! [10]
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
//! [0]
|
|
||||||
void MyQt3Widget::customStartDragFunction()
|
|
||||||
{
|
|
||||||
QDragObject *d = new QTextDrag( myHighlightedText(), this );
|
|
||||||
d->dragCopy();
|
|
||||||
// do NOT delete d.
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
void MyQt3Widget::dragEnterEvent(QDragEnterEvent* event)
|
|
||||||
{
|
|
||||||
event->accept(
|
|
||||||
QTextDrag::canDecode(event) ||
|
|
||||||
QImageDrag::canDecode(event)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
void MyQt3Widget::dropEvent(QDropEvent* event)
|
|
||||||
{
|
|
||||||
QImage image;
|
|
||||||
QString text;
|
|
||||||
|
|
||||||
if ( QImageDrag::decode(event, image) ) {
|
|
||||||
insertImageAt(image, event->pos());
|
|
||||||
} else if ( QTextDrag::decode(event, text) ) {
|
|
||||||
insertTextAt(text, event->pos());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
//! [0]
|
|
||||||
./configure -help
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
configure -qt-kbd-s15000
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
export QWS_KEYBOARD=<driver>[:<driver specific options>]
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
export QWS_KEYBOARD="<driver>[:<driver specific options>]
|
|
||||||
<driver>[:<driver specific options>]
|
|
||||||
<driver>[:<driver specific options>]"
|
|
||||||
//! [3]
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
//! [0]
|
|
||||||
export PATH=path/to/cross/compiler:$PATH
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
./configure -embedded arm -xplatform qws/linux-arm-g++ <other options>
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
cp path/to/QtEmbedded/mkspecs/qws/linux-mips-g++/...
|
|
||||||
path/to/QtEmbedded/mkspecs/qws/linux-myarchitecture-g++/...
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
cd path/to/QtEmbedded
|
|
||||||
./configure -embedded <architecture> -qt-kbd-<keyboarddriver>
|
|
||||||
-qt-mouse-<mousedriver> -qt-gfx-<screendriver>
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
cd path/to/QtEmbedded
|
|
||||||
./configure <other options>
|
|
||||||
-L /path/to/libjpeg/libraries -I /path/to/libjpeg/headers
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
cd path/to/myApplication
|
|
||||||
qmake -project
|
|
||||||
qmake
|
|
||||||
make
|
|
||||||
//! [5]
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
//! [0]
|
|
||||||
export QWS_DISPLAY=<driver>[:<driver specific options>]...
|
|
||||||
[:<display num>]
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
export QWS_SIZE=<width>x<height>
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
export QWS_MOUSE_PROTO=<driver>[:<driver specific options>]
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
export QWS_MOUSE_PROTO="<driver>[:<driver specific options>]
|
|
||||||
<driver>[:<driver specific options>]
|
|
||||||
<driver>[:<driver specific options>]"
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
export QWS_MOUSE_PROTO="Vr41xx:press=500:/dev/misc/ts"
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
export QWS_KEYBOARD=<driver>[:<driver specific options>]
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
export QWS_KEYBOARD="<driver>[:<driver specific options>]
|
|
||||||
<driver>[:<driver specific options>]
|
|
||||||
<driver>[:<driver specific options>]"
|
|
||||||
//! [6]
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
//! [0]
|
|
||||||
configure.exe -D QT_NO_THREAD
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
./configure -no-feature-thread
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
configure.exe -qconfig myfile
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
./configure -qconfig myfile
|
|
||||||
//! [3]
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
//! [0]
|
|
||||||
name file renderer italic weight size flags
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
//! [0]
|
|
||||||
cd <anywhere>
|
|
||||||
gunzip qt-embedded-linux-commercial-src-4.5.2.tar.gz
|
|
||||||
tar xf qt-embedded-linux-commercial-src-4.5.2.tar
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
~/qt-embedded-linux-commercial-src-4.5.2
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
cd ~/qt-embedded-linux-commercial-src-4.5.2
|
|
||||||
./configure -embedded [architecture]
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
make
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
su -c "make install"
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
PATH=/usr/local/Trolltech/QtEmbedded-4.5.2/bin:$PATH
|
|
||||||
export PATH
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
setenv PATH /usr/local/Trolltech/QtEmbedded-4.5.2/bin:$PATH
|
|
||||||
//! [6]
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
//! [0]
|
|
||||||
./configure -static
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
void *operator new[](size_t size)
|
|
||||||
{
|
|
||||||
return malloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *operator new(size_t size)
|
|
||||||
{
|
|
||||||
return malloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator delete[](void *ptr)
|
|
||||||
{
|
|
||||||
free(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator delete[](void *ptr, size_t)
|
|
||||||
{
|
|
||||||
free(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator delete(void *ptr)
|
|
||||||
{
|
|
||||||
free(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator delete(void *ptr, size_t)
|
|
||||||
{
|
|
||||||
free(ptr);
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
//! [0]
|
|
||||||
<qtopia-root-dir>/qtopiacore/qt/configure -embedded -help |grep -a1 mouse
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
./configure -extra-qtopiacore-config -qt-mouse-tslib
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
./configure -help
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
configure -qt-mouse-tslib
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
export QWS_MOUSE_PROTO=<driver>[:<driver specific options>]
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
export QWS_MOUSE_PROTO="<driver>[:<driver specific options>]
|
|
||||||
<driver>[:<driver specific options>]
|
|
||||||
<driver>[:<driver specific options>]"
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
export QWS_MOUSE_PROTO="Vr41xx:press=500:/dev/misc/ts"
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
./configure -L <path to tslib library> -I <path to tslib headers>
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
module_raw input
|
|
||||||
module linear
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
cat /dev/input/mouse0 | hexdump
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
chmod a+rw /dev/input/mouse0
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
//! [0]
|
|
||||||
cd path/to/QtEmbedded
|
|
||||||
./configure -qvfb
|
|
||||||
make
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
cd path/to/Qt/tools/qvfb
|
|
||||||
make
|
|
||||||
./qvfb
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
cd path/to/Qt/tools/qvfb/ClamshellPhone.skin/
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
[SkinFile]
|
|
||||||
Up=ClamshellPhone1-5.png
|
|
||||||
Down=ClamshellPhone1-5-pressed.png
|
|
||||||
Closed=ClamshellPhone1-5-closed.png
|
|
||||||
Screen=72 84 176 208
|
|
||||||
Areas=22
|
|
||||||
|
|
||||||
"Power" 0x0100000a 205 563 249 586
|
|
||||||
"1" 0x0031 62 414 119 438
|
|
||||||
"2" 0x0032 130 414 189 438
|
|
||||||
"3" 0x0033 198 413 257 438
|
|
||||||
"4" 0x0034 54 444 117 470
|
|
||||||
"5" 0x0035 128 444 189 471
|
|
||||||
"6" 0x0036 202 444 264 471
|
|
||||||
"7" 0x0037 47 477 113 507
|
|
||||||
"8" 0x0038 126 477 190 507
|
|
||||||
"9" 0x0039 205 478 270 509
|
|
||||||
"*" 0x002a 39 515 110 552
|
|
||||||
"0" 0x0030 122 515 195 553
|
|
||||||
"#" 0x0023 207 516 280 553
|
|
||||||
"Context1" 0x01100000 137 360 108 383 123 410 90 409 60 387 63 378
|
|
||||||
100 362
|
|
||||||
"Back" 0x01000061 184 361 206 376 213 387 197 410 226 410 256 392
|
|
||||||
258 381 244 369
|
|
||||||
"Backspace" 0x01000003 68 563 113 587
|
|
||||||
"Select" 0x01010000 160 391 172 390 181 386 184 381 180 377 173
|
|
||||||
373 165 372 155 372 145 375 138 378 136
|
|
||||||
382 138 387 147 390
|
|
||||||
"Left" 0x1000012 141 390 136 385 136 381 143 375 132 371 120
|
|
||||||
380 121 393 129 401
|
|
||||||
"Down" 0x1000015 143 389 130 402 162 412 191 404 175 390
|
|
||||||
"Right" 0x1000014 186 370 176 375 184 382 182 387 175 390 190 404
|
|
||||||
201 396 202 375
|
|
||||||
"Up" 0x1000013 133 370 143 374 176 374 185 370 169 362 149 362
|
|
||||||
"Flip" 0x01100006 98 325 225 353
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
cd path/to/QtEmbedded/examples/widgets/analogclock
|
|
||||||
make
|
|
||||||
./analogclock -qws
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
cd path/to/QtEmbedded/examples/widgets/analogclock
|
|
||||||
make
|
|
||||||
./analogclock -qws -display QVFb:0
|
|
||||||
//! [5]
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
//! [0]
|
|
||||||
cd path/to/QtEmbedded/demos/textedit
|
|
||||||
./textedit -qws
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
./myfirstserverapplication -qws -display "transformed:rot90:1"
|
|
||||||
./mysecondserverapplication -qws -display "QVFb:2"
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
./myclientapplication -display "QVFb:2"
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
./myserverapplication -qws -display "Multi: QVFb:0
|
|
||||||
QVFb:1:offset=0,0 VNC:offset=640,0 :2"
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
./myapplication -fn helvetica
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
./myapplication -bg blue
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
./myapplication -btn green
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
./myapplication -fg 'dark blue'
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
./myapplication -name texteditapplication
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
./myapplication -title 'Text Edit'
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
./myapplication -geometry 300x200+50+50
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
./myapplication -decoration windows
|
|
||||||
//! [11]
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
//! [0]
|
|
||||||
cd path/to/QtEmbedded
|
|
||||||
./configure -qt-gfx-vnc
|
|
||||||
make
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
cd path/to/QtEmbedded/examples/widgets/analogclock
|
|
||||||
./analogclock -qws -display VNC:0
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
vncviewer localhost:0
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
//! [Starting server]
|
|
||||||
analogclock -qws -display VNC:0
|
|
||||||
//! [Starting server]
|
|
||||||
//! [Starting clients]
|
|
||||||
calculator -display VNC:0
|
|
||||||
scribble -display VNC:0
|
|
||||||
imageviewer -display VNC:0
|
|
||||||
//! [Starting clients]
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
//! [0]
|
|
||||||
Private Application As comappLib.Application
|
|
||||||
Private MyApp As Boolean
|
|
||||||
|
|
||||||
Private Sub UpdateList()
|
|
||||||
DocumentList.Clear
|
|
||||||
DocumentsCount.Caption = Application.documents.Count
|
|
||||||
For Index = 0 To Application.documents.Count - 1
|
|
||||||
DocumentList.AddItem (Application.documents.Item(Index).Title)
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub Form_Load()
|
|
||||||
On Error GoTo CreateNew
|
|
||||||
Set Application = GetObject(, "comapp.Application")
|
|
||||||
MyApp = False
|
|
||||||
GoTo Initialized
|
|
||||||
CreateNew:
|
|
||||||
On Error GoTo InitializeFailed
|
|
||||||
Set Application = New Application
|
|
||||||
Application.Visible = True
|
|
||||||
MyApp = True
|
|
||||||
Initialized:
|
|
||||||
Caption = Application.id
|
|
||||||
UpdateList
|
|
||||||
InitializeFailed:
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub Form_Unload(Cancel As Integer)
|
|
||||||
If MyApp Then
|
|
||||||
Application.quit
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub NewDocument_Click()
|
|
||||||
Application.documents.addDocument
|
|
||||||
UpdateList
|
|
||||||
End Sub
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
//! [0]
|
|
||||||
' VB is case insensitive, but our C++ controls are not.
|
|
||||||
' Me.resetButton.enabled = True
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
//! [0]
|
|
||||||
<object ID="QMenus" CLASSID="CLSID:4dc3f340-a6f7-44e4-a79b-3e9217695fbd"
|
|
||||||
CODEBASE="http://qtsoftware.com/demos/menusax.cab">
|
|
||||||
[Object not available! Did you forget to build and register the server?]
|
|
||||||
</object>
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
//! [0]
|
|
||||||
myApplication -qws -display ahigl
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
myApplication -qws -display ahigl
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
//! [0]
|
|
||||||
application -style=windows
|
|
||||||
application -style=motif
|
|
||||||
application -style=cde
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
//! [0]
|
|
||||||
qApp->translate("ArrowPad", x)
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
lrelease arrowpad.pro
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
export LANG=fr
|
|
||||||
setenv LANG fr
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
set LANG=fr
|
|
||||||
//! [3]
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
//! [0]
|
|
||||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
|
||||||
INSTALLS += target
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
//! [0]
|
|
||||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
|
||||||
INSTALLS += target
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
//! [0]
|
|
||||||
foreach(variable, container)
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QVariant a = model->index(0, 0, QModelIndex()).data();
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QVariant b = model->index(1, 0, QModelIndex()).data();
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
//! [0]
|
|
||||||
lupdate -verbose hellotr.pro
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
<!DOCTYPE TS><TS>
|
|
||||||
<context>
|
|
||||||
<name>QPushButton</name>
|
|
||||||
<message>
|
|
||||||
<source>Hello world!</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
</TS>
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
linguist hellotr_la.ts
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
<translation type='unfinished'></translation>
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
<translation>Orbis, te saluto!</translation>
|
|
||||||
//! [4]
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
//! [0]
|
|
||||||
if (!condition)
|
|
||||||
qFatal("ASSERT: "condition" in file ...");
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
qmake "CONFIG += debug" icons.pro
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
qmake "CONFIG += release" icons.pro
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
//! [0]
|
|
||||||
imageLabel->resize(imageLabel->pixmap()->size());
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
if (!imageLabel->pixmap())
|
|
||||||
qFatal("ASSERT: "imageLabel->pixmap()" in file ...");
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
qmake "CONFIG += debug" foo.pro
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
qmake "CONFIG += release" foo.pro
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
scrollBar->setValue(int(factor * scrollBar->value()));
|
|
||||||
//! [4]
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
//! [0]
|
|
||||||
var ba = new ByteArray(); // constructs an empty ByteArray
|
|
||||||
var ba2 = new ByteArray(10); // constructs a ByteArray of length 10 (all bytes initialized to 0)
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
for (var i = 0; i < ba.length; ++i)
|
|
||||||
ba[i] = 123;
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
ba[0] = 257;
|
|
||||||
print(ba[0]); // 1
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
var ba3 = new ByteArray();
|
|
||||||
print(ba3.length); // 0
|
|
||||||
ba[0] = 64;
|
|
||||||
print(ba3.length); // 1
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
ba["foo"] = "Hello";
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
var ba64 = ba.toBase64();
|
|
||||||
print(ba64.toLatin1String());
|
|
||||||
//! [5]
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
//! [0]
|
|
||||||
// file is an open QFile object.
|
|
||||||
QDomDocument document;
|
|
||||||
if (document.setContent(&file)) {
|
|
||||||
|
|
||||||
QDomElement documentElement = document.documentElement();
|
|
||||||
QString text;
|
|
||||||
QDomNode node = documentElement.firstChild();
|
|
||||||
|
|
||||||
while (!node.isNull()) {
|
|
||||||
if (node.isText())
|
|
||||||
text += node.nodeValue();
|
|
||||||
else if (node.hasChildNodes()) {
|
|
||||||
// Examine the node's children and read any text found.
|
|
||||||
...
|
|
||||||
}
|
|
||||||
node = node.nextSibling();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
//! [0]
|
|
||||||
Getting Started How to familiarize yourself with Qt Designer
|
|
||||||
Launching Designer Running the Qt Designer application
|
|
||||||
The User Interface How to interact with Qt Designer
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Connection Editing Mode Connecting widgets together with signals and slots
|
|
||||||
Connecting Objects Making connections in Qt Designer
|
|
||||||
Editing Connections Changing existing connections
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
//! [0]
|
|
||||||
myApplication -qws -display svgalib
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
//! [0]
|
|
||||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
|
||||||
INSTALLS += target
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
//! [0]
|
|
||||||
CONFIG += uitools
|
|
||||||
HEADERS = textfinder.h
|
|
||||||
RESOURCES = textfinder.qrc
|
|
||||||
SOURCES = textfinder.cpp main.cpp
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
//! [0]
|
|
||||||
twoSidedEnabledRadio = new QRadioButton(tr("Enabled", "two-sided"));
|
|
||||||
twoSidedDisabledRadio = new QRadioButton(tr("Disabled", "two-sided"));
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
colorsEnabledRadio = new QRadioButton(tr("Enabled", "colors"), colors);
|
|
||||||
colorsDisabledRadio = new QRadioButton(tr("Disabled", "colors"), colors);
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
/*
|
|
||||||
TRANSLATOR MainWindow
|
|
||||||
|
|
||||||
In this application the whole application is a MainWindow.
|
|
||||||
Choose Help|About from the menu bar to see some text
|
|
||||||
belonging to MainWindow.
|
|
||||||
|
|
||||||
...
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
/*
|
|
||||||
TRANSLATOR ZClientErrorDialog
|
|
||||||
|
|
||||||
Choose Client|Edit to reach the Client Edit dialog, then choose
|
|
||||||
Client Specification from the drop down list at the top and pick
|
|
||||||
client Bartel Leendert van der Waerden. Now check the Profile
|
|
||||||
checkbox and then click the Start Processing button. You should
|
|
||||||
now see a pop up window with the text "Error: Name too long!".
|
|
||||||
This window is a ZClientErrorDialog.
|
|
||||||
//! [3]
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
//! [0]
|
|
||||||
qmake -project
|
|
||||||
qmake
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
qmake -project
|
|
||||||
qmake
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
//! [0]
|
|
||||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
|
||||||
INSTALLS += target
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
//! [0]
|
|
||||||
#ifdef Q_WS_X11
|
|
||||||
void qt_x11_wait_for_window_manager(QWidget *widget);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
...
|
|
||||||
window.show();
|
|
||||||
#ifdef Q_WS_X11
|
|
||||||
qt_x11_wait_for_window_manager(&window);
|
|
||||||
#endif
|
|
||||||
...
|
|
||||||
return app.exec();
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,679 +0,0 @@
|
||||||
//! [GPL v3]
|
|
||||||
You may use, distribute and copy the Qt GUI Toolkit under the terms of
|
|
||||||
GNU General Public License version 3, which is displayed below.
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program 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 General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
||||||
//! [GPL v3]
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QGraphicsScene scene;
|
|
||||||
QGraphicsRectItem *rect = scene.addRect(QRectF(0, 0, 100, 100));
|
|
||||||
|
|
||||||
QGraphicsItem *item = scene.itemAt(50, 50);
|
|
||||||
// item == rect
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QGraphicsScene scene;
|
|
||||||
myPopulateScene(&scene);
|
|
||||||
|
|
||||||
QGraphicsView view(&scene);
|
|
||||||
view.show();
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
class View : public QGraphicsView
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
...
|
|
||||||
public slots:
|
|
||||||
void zoomIn() { scale(1.2, 1.2); }
|
|
||||||
void zoomOut() { scale(1 / 1.2, 1 / 1.2); }
|
|
||||||
void rotateLeft() { rotate(-10); }
|
|
||||||
void rotateRight() { rotate(10); }
|
|
||||||
...
|
|
||||||
};
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QGraphicsScene scene;
|
|
||||||
scene.addRect(QRectF(0, 0, 100, 200), QPen(Qt::black), QBrush(Qt::green));
|
|
||||||
|
|
||||||
QPrinter printer;
|
|
||||||
if (QPrintDialog(&printer).exec() == QDialog::Accepted) {
|
|
||||||
QPainter painter(&printer);
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
scene.render(&painter);
|
|
||||||
}
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QGraphicsScene scene;
|
|
||||||
scene.addRect(QRectF(0, 0, 100, 200), QPen(Qt::black), QBrush(Qt::green));
|
|
||||||
|
|
||||||
QPixmap pixmap;
|
|
||||||
QPainter painter(&pixmap);
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
scene.render(&painter);
|
|
||||||
painter.end();
|
|
||||||
|
|
||||||
pixmap.save("scene.png");
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
void CustomItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|
||||||
{
|
|
||||||
QMimeData *data = new QMimeData;
|
|
||||||
data->setColor(Qt::green);
|
|
||||||
|
|
||||||
QDrag *drag = new QDrag(event->widget());
|
|
||||||
drag->setMimeData(data);
|
|
||||||
drag->start();
|
|
||||||
}
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
QGraphicsView view(&scene);
|
|
||||||
view.setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
|
|
||||||
//! [6]
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
//! [0]
|
|
||||||
void QPen::setStyle(Qt::PenStyle style)
|
|
||||||
{
|
|
||||||
detach(); // detach from common data
|
|
||||||
d->style = style; // set the style member
|
|
||||||
}
|
|
||||||
|
|
||||||
void QPen::detach()
|
|
||||||
{
|
|
||||||
if (d->ref != 1) {
|
|
||||||
... // perform a deep copy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QPixmap p1, p2;
|
|
||||||
p1.load("image.bmp");
|
|
||||||
p2 = p1; // p1 and p2 share data
|
|
||||||
|
|
||||||
QPainter paint;
|
|
||||||
paint.begin(&p2); // cuts p2 loose from p1
|
|
||||||
paint.drawText(0,50, "Hi");
|
|
||||||
paint.end();
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,155 +0,0 @@
|
||||||
//! [0]
|
|
||||||
LoginWidget::LoginWidget()
|
|
||||||
{
|
|
||||||
QLabel *label = new QLabel(tr("Password:"));
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
void some_global_function(LoginWidget *logwid)
|
|
||||||
{
|
|
||||||
QLabel *label = new QLabel(
|
|
||||||
LoginWidget::tr("Password:"), logwid);
|
|
||||||
}
|
|
||||||
|
|
||||||
void same_global_function(LoginWidget *logwid)
|
|
||||||
{
|
|
||||||
QLabel *label = new QLabel(
|
|
||||||
qApp->translate("LoginWidget", "Password:"), logwid);
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QString FriendlyConversation::greeting(int type)
|
|
||||||
{
|
|
||||||
static const char *greeting_strings[] = {
|
|
||||||
QT_TR_NOOP("Hello"),
|
|
||||||
QT_TR_NOOP("Goodbye")
|
|
||||||
};
|
|
||||||
return tr(greeting_strings[type]);
|
|
||||||
}
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
static const char *greeting_strings[] = {
|
|
||||||
QT_TRANSLATE_NOOP("FriendlyConversation", "Hello"),
|
|
||||||
QT_TRANSLATE_NOOP("FriendlyConversation", "Goodbye")
|
|
||||||
};
|
|
||||||
|
|
||||||
QString FriendlyConversation::greeting(int type)
|
|
||||||
{
|
|
||||||
return tr(greeting_strings[type]);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString global_greeting(int type)
|
|
||||||
{
|
|
||||||
return qApp->translate("FriendlyConversation",
|
|
||||||
greeting_strings[type]);
|
|
||||||
}
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
void FileCopier::showProgress(int done, int total,
|
|
||||||
const QString ¤tFile)
|
|
||||||
{
|
|
||||||
label.setText(tr("%1 of %2 files copied.\nCopying: %3")
|
|
||||||
.arg(done)
|
|
||||||
.arg(total)
|
|
||||||
.arg(currentFile));
|
|
||||||
}
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QString s1 = "%1 of %2 files copied. Copying: %3";
|
|
||||||
QString s2 = "Kopierer nu %3. Av totalt %2 filer er %1 kopiert.";
|
|
||||||
|
|
||||||
qDebug() << s1.arg(5).arg(10).arg("somefile.txt");
|
|
||||||
qDebug() << s2.arg(5).arg(10).arg("somefile.txt");
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
5 of 10 files copied. Copying: somefile.txt
|
|
||||||
Kopierer nu somefile.txt. Av totalt 10 filer er 5 kopiert.
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
HEADERS = funnydialog.h \
|
|
||||||
wackywidget.h
|
|
||||||
SOURCES = funnydialog.cpp \
|
|
||||||
main.cpp \
|
|
||||||
wackywidget.cpp
|
|
||||||
FORMS = fancybox.ui
|
|
||||||
TRANSLATIONS = superapp_dk.ts \
|
|
||||||
superapp_fi.ts \
|
|
||||||
superapp_no.ts \
|
|
||||||
superapp_se.ts
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
|
|
||||||
QTranslator qtTranslator;
|
|
||||||
qtTranslator.load("qt_" + QLocale::system().name(),
|
|
||||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
|
||||||
app.installTranslator(&qtTranslator);
|
|
||||||
|
|
||||||
QTranslator myappTranslator;
|
|
||||||
myappTranslator.load("myapp_" + QLocale::system().name());
|
|
||||||
app.installTranslator(&myappTranslator);
|
|
||||||
|
|
||||||
...
|
|
||||||
return app.exec();
|
|
||||||
}
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QString string = ...; // some Unicode text
|
|
||||||
|
|
||||||
QTextCodec *codec = QTextCodec::codecForName("ISO 8859-5");
|
|
||||||
QByteArray encodedString = codec->fromUnicode(string);
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
QByteArray encodedString = ...; // some ISO 8859-5 encoded text
|
|
||||||
|
|
||||||
QTextCodec *codec = QTextCodec::codecForName("ISO 8859-5");
|
|
||||||
QString string = codec->toUnicode(encodedString);
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
void Clock::setTime(const QTime &time)
|
|
||||||
{
|
|
||||||
if (tr("AMPM") == "AMPM") {
|
|
||||||
// 12-hour clock
|
|
||||||
} else {
|
|
||||||
// 24-hour clock
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
void QWidget::changeEvent(QEvent *event)
|
|
||||||
{
|
|
||||||
if (e->type() == QEvent::LanguageChange) {
|
|
||||||
titleLabel->setText(tr("Document Title"));
|
|
||||||
...
|
|
||||||
okPushButton->setText(tr("&OK"));
|
|
||||||
} else
|
|
||||||
QWidget::changeEvent(event);
|
|
||||||
}
|
|
||||||
//! [12]
|
|
||||||
|
|
@ -1,127 +0,0 @@
|
||||||
//! [0]
|
|
||||||
cd /tmp
|
|
||||||
gunzip qt-x11-opensource-desktop-4.5.2.tar.gz # uncompress the archive
|
|
||||||
tar xvf qt-x11-opensource-desktop-4.5.2.tar # unpack it
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
cd /tmp/qt-x11-opensource-desktop-4.5.2
|
|
||||||
./configure
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
make
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
make install
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
PATH - to locate qmake, moc and other Qt tools
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
PATH=/usr/local/Trolltech/Qt-4.5.2/bin:$PATH
|
|
||||||
export PATH
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
setenv PATH /usr/local/Trolltech/Qt-4.5.2/bin:$PATH
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
PATH - to locate qmake, moc and other Qt tools
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
C:
|
|
||||||
cd /D C:\Qt\4.5.2
|
|
||||||
configure
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
configure -platform win32-msvc
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
nmake
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
cd /tmp
|
|
||||||
gunzip qt-mac-opensource-desktop-4.5.2.tar.gz # uncompress the archive
|
|
||||||
tar xvf qt-mac-opensource-desktop-4.5.2.tar # unpack it
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
cd /tmp/qt-mac-opensource-desktop-4.5.2
|
|
||||||
./configure
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
make
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
sudo make -j1 install
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
PATH - to locate qmake, moc and other Qt tools
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
PATH=/usr/local/Trolltech/Qt-4.5.2/bin:$PATH
|
|
||||||
export PATH
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
setenv PATH /usr/local/Trolltech/Qt-4.5.2/bin:$PATH
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
PATH - to locate qmake, moc and other Qt tools
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
C:
|
|
||||||
cd \Qt\4.5.2
|
|
||||||
configure -platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005
|
|
||||||
//! [19]
|
|
||||||
|
|
||||||
|
|
||||||
//! [20]
|
|
||||||
set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\ce\include;C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Include\Armv4i
|
|
||||||
set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\ce\lib\armv4i;C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Lib\ARMV4I
|
|
||||||
set PATH=C:\Program Files\Microsoft Visual Studio 8\VC\ce\bin\x86_arm;%PATH%
|
|
||||||
//! [20]
|
|
||||||
|
|
||||||
|
|
||||||
//! [21]
|
|
||||||
setcepaths wincewm50pocket-msvc2005
|
|
||||||
//! [21]
|
|
||||||
|
|
||||||
|
|
||||||
//! [22]
|
|
||||||
nmake
|
|
||||||
//! [22]
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
//! [0]
|
|
||||||
org.freedesktop.DBus
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
//! [0]
|
|
||||||
#ifndef CARD_H
|
|
||||||
#define CARD_H
|
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QList>
|
|
||||||
|
|
||||||
class CardLayout : public QLayout
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CardLayout(QWidget *parent, int dist): QLayout(parent, 0, dist) {}
|
|
||||||
CardLayout(QLayout *parent, int dist): QLayout(parent, dist) {}
|
|
||||||
CardLayout(int dist): QLayout(dist) {}
|
|
||||||
~CardLayout();
|
|
||||||
|
|
||||||
void addItem(QLayoutItem *item);
|
|
||||||
QSize sizeHint() const;
|
|
||||||
QSize minimumSize() const;
|
|
||||||
QLayoutItem *count() const;
|
|
||||||
QLayoutItem *itemAt(int) const;
|
|
||||||
QLayoutItem *takeAt(int);
|
|
||||||
void setGeometry(const QRect &rect);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QList<QLayoutItem*> list;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
//#include "card.h"
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QLayoutItem *CardLayout::count() const
|
|
||||||
{
|
|
||||||
// QList::size() returns the number of QLayoutItems in the list
|
|
||||||
return list.size();
|
|
||||||
}
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QLayoutItem *CardLayout::itemAt(int idx) const
|
|
||||||
{
|
|
||||||
// QList::value() performs index checking, and returns 0 if we are
|
|
||||||
// outside the valid range
|
|
||||||
return list.value(idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
QLayoutItem *CardLayout::takeAt(int idx)
|
|
||||||
{
|
|
||||||
// QList::take does not do index checking
|
|
||||||
return idx >= 0 && idx < list.size() ? list.takeAt(idx) : 0;
|
|
||||||
}
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
void CardLayout::addItem(QLayoutItem *item)
|
|
||||||
{
|
|
||||||
list.append(item);
|
|
||||||
}
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
CardLayout::~CardLayout()
|
|
||||||
{
|
|
||||||
QLayoutItem *item;
|
|
||||||
while ((item = takeAt(0)))
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
void CardLayout::setGeometry(const QRect &r)
|
|
||||||
{
|
|
||||||
QLayout::setGeometry(r);
|
|
||||||
|
|
||||||
if (list.size() == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int w = r.width() - (list.count() - 1) * spacing();
|
|
||||||
int h = r.height() - (list.count() - 1) * spacing();
|
|
||||||
int i = 0;
|
|
||||||
while (i < list.size()) {
|
|
||||||
QLayoutItem *o = list.at(i);
|
|
||||||
QRect geom(r.x() + i * spacing(), r.y() + i * spacing(), w, h);
|
|
||||||
o->setGeometry(geom);
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
QSize CardLayout::sizeHint() const
|
|
||||||
{
|
|
||||||
QSize s(0,0);
|
|
||||||
int n = list.count();
|
|
||||||
if (n > 0)
|
|
||||||
s = QSize(100,70); //start with a nice default size
|
|
||||||
int i = 0;
|
|
||||||
while (i < n) {
|
|
||||||
QLayoutItem *o = list.at(i);
|
|
||||||
s = s.expandedTo(o->sizeHint());
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
return s + n*QSize(spacing(), spacing());
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize CardLayout::minimumSize() const
|
|
||||||
{
|
|
||||||
QSize s(0,0);
|
|
||||||
int n = list.count();
|
|
||||||
int i = 0;
|
|
||||||
while (i < n) {
|
|
||||||
QLayoutItem *o = list.at(i);
|
|
||||||
s = s.expandedTo(o->minimumSize());
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
return s + n*QSize(spacing(), spacing());
|
|
||||||
}
|
|
||||||
//! [7]
|
|
||||||
|
|
@ -1,507 +0,0 @@
|
||||||
//! [LGPL v2.1]
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
Version 2.1, February 1999
|
|
||||||
|
|
||||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
[This is the first released version of the Lesser GPL. It also counts
|
|
||||||
as the successor of the GNU Library Public License, version 2, hence
|
|
||||||
the version number 2.1.]
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
Licenses are intended to guarantee your freedom to share and change
|
|
||||||
free software--to make sure the software is free for all its users.
|
|
||||||
|
|
||||||
This license, the Lesser General Public License, applies to some
|
|
||||||
specially designated software packages--typically libraries--of the
|
|
||||||
Free Software Foundation and other authors who decide to use it. You
|
|
||||||
can use it too, but we suggest you first think carefully about whether
|
|
||||||
this license or the ordinary General Public License is the better
|
|
||||||
strategy to use in any particular case, based on the explanations below.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom of use,
|
|
||||||
not price. Our General Public Licenses are designed to make sure that
|
|
||||||
you have the freedom to distribute copies of free software (and charge
|
|
||||||
for this service if you wish); that you receive source code or can get
|
|
||||||
it if you want it; that you can change the software and use pieces of
|
|
||||||
it in new free programs; and that you are informed that you can do
|
|
||||||
these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
distributors to deny you these rights or to ask you to surrender these
|
|
||||||
rights. These restrictions translate to certain responsibilities for
|
|
||||||
you if you distribute copies of the library or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of the library, whether gratis
|
|
||||||
or for a fee, you must give the recipients all the rights that we gave
|
|
||||||
you. You must make sure that they, too, receive or can get the source
|
|
||||||
code. If you link other code with the library, you must provide
|
|
||||||
complete object files to the recipients, so that they can relink them
|
|
||||||
with the library after making changes to the library and recompiling
|
|
||||||
it. And you must show them these terms so they know their rights.
|
|
||||||
|
|
||||||
We protect your rights with a two-step method: (1) we copyright the
|
|
||||||
library, and (2) we offer you this license, which gives you legal
|
|
||||||
permission to copy, distribute and/or modify the library.
|
|
||||||
|
|
||||||
To protect each distributor, we want to make it very clear that
|
|
||||||
there is no warranty for the free library. Also, if the library is
|
|
||||||
modified by someone else and passed on, the recipients should know
|
|
||||||
that what they have is not the original version, so that the original
|
|
||||||
author's reputation will not be affected by problems that might be
|
|
||||||
introduced by others.
|
|
||||||
|
|
||||||
Finally, software patents pose a constant threat to the existence of
|
|
||||||
any free program. We wish to make sure that a company cannot
|
|
||||||
effectively restrict the users of a free program by obtaining a
|
|
||||||
restrictive license from a patent holder. Therefore, we insist that
|
|
||||||
any patent license obtained for a version of the library must be
|
|
||||||
consistent with the full freedom of use specified in this license.
|
|
||||||
|
|
||||||
Most GNU software, including some libraries, is covered by the
|
|
||||||
ordinary GNU General Public License. This license, the GNU Lesser
|
|
||||||
General Public License, applies to certain designated libraries, and
|
|
||||||
is quite different from the ordinary General Public License. We use
|
|
||||||
this license for certain libraries in order to permit linking those
|
|
||||||
libraries into non-free programs.
|
|
||||||
|
|
||||||
When a program is linked with a library, whether statically or using
|
|
||||||
a shared library, the combination of the two is legally speaking a
|
|
||||||
combined work, a derivative of the original library. The ordinary
|
|
||||||
General Public License therefore permits such linking only if the
|
|
||||||
entire combination fits its criteria of freedom. The Lesser General
|
|
||||||
Public License permits more lax criteria for linking other code with
|
|
||||||
the library.
|
|
||||||
|
|
||||||
We call this license the "Lesser" General Public License because it
|
|
||||||
does Less to protect the user's freedom than the ordinary General
|
|
||||||
Public License. It also provides other free software developers Less
|
|
||||||
of an advantage over competing non-free programs. These disadvantages
|
|
||||||
are the reason we use the ordinary General Public License for many
|
|
||||||
libraries. However, the Lesser license provides advantages in certain
|
|
||||||
special circumstances.
|
|
||||||
|
|
||||||
For example, on rare occasions, there may be a special need to
|
|
||||||
encourage the widest possible use of a certain library, so that it becomes
|
|
||||||
a de-facto standard. To achieve this, non-free programs must be
|
|
||||||
allowed to use the library. A more frequent case is that a free
|
|
||||||
library does the same job as widely used non-free libraries. In this
|
|
||||||
case, there is little to gain by limiting the free library to free
|
|
||||||
software only, so we use the Lesser General Public License.
|
|
||||||
|
|
||||||
In other cases, permission to use a particular library in non-free
|
|
||||||
programs enables a greater number of people to use a large body of
|
|
||||||
free software. For example, permission to use the GNU C Library in
|
|
||||||
non-free programs enables many more people to use the whole GNU
|
|
||||||
operating system, as well as its variant, the GNU/Linux operating
|
|
||||||
system.
|
|
||||||
|
|
||||||
Although the Lesser General Public License is Less protective of the
|
|
||||||
users' freedom, it does ensure that the user of a program that is
|
|
||||||
linked with the Library has the freedom and the wherewithal to run
|
|
||||||
that program using a modified version of the Library.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow. Pay close attention to the difference between a
|
|
||||||
"work based on the library" and a "work that uses the library". The
|
|
||||||
former contains code derived from the library, whereas the latter must
|
|
||||||
be combined with the library in order to run.
|
|
||||||
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License Agreement applies to any software library or other
|
|
||||||
program which contains a notice placed by the copyright holder or
|
|
||||||
other authorized party saying it may be distributed under the terms of
|
|
||||||
this Lesser General Public License (also called "this License").
|
|
||||||
Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
A "library" means a collection of software functions and/or data
|
|
||||||
prepared so as to be conveniently linked with application programs
|
|
||||||
(which use some of those functions and data) to form executables.
|
|
||||||
|
|
||||||
The "Library", below, refers to any such software library or work
|
|
||||||
which has been distributed under these terms. A "work based on the
|
|
||||||
Library" means either the Library or any derivative work under
|
|
||||||
copyright law: that is to say, a work containing the Library or a
|
|
||||||
portion of it, either verbatim or with modifications and/or translated
|
|
||||||
straightforwardly into another language. (Hereinafter, translation is
|
|
||||||
included without limitation in the term "modification".)
|
|
||||||
|
|
||||||
"Source code" for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For a library, complete source code means
|
|
||||||
all the source code for all modules it contains, plus any associated
|
|
||||||
interface definition files, plus the scripts used to control compilation
|
|
||||||
and installation of the library.
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running a program using the Library is not restricted, and output from
|
|
||||||
such a program is covered only if its contents constitute a work based
|
|
||||||
on the Library (independent of the use of the Library in a tool for
|
|
||||||
writing it). Whether that is true depends on what the Library does
|
|
||||||
and what the program that uses the Library does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
|
||||||
complete source code as you receive it, in any medium, provided that
|
|
||||||
you conspicuously and appropriately publish on each copy an
|
|
||||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
|
||||||
all the notices that refer to this License and to the absence of any
|
|
||||||
warranty; and distribute a copy of this License along with the
|
|
||||||
Library.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy,
|
|
||||||
and you may at your option offer warranty protection in exchange for a
|
|
||||||
fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Library or any portion
|
|
||||||
of it, thus forming a work based on the Library, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The modified work must itself be a software library.
|
|
||||||
|
|
||||||
b) You must cause the files modified to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
c) You must cause the whole of the work to be licensed at no
|
|
||||||
charge to all third parties under the terms of this License.
|
|
||||||
|
|
||||||
d) If a facility in the modified Library refers to a function or a
|
|
||||||
table of data to be supplied by an application program that uses
|
|
||||||
the facility, other than as an argument passed when the facility
|
|
||||||
is invoked, then you must make a good faith effort to ensure that,
|
|
||||||
in the event an application does not supply such function or
|
|
||||||
table, the facility still operates, and performs whatever part of
|
|
||||||
its purpose remains meaningful.
|
|
||||||
|
|
||||||
(For example, a function in a library to compute square roots has
|
|
||||||
a purpose that is entirely well-defined independent of the
|
|
||||||
application. Therefore, Subsection 2d requires that any
|
|
||||||
application-supplied function or table used by this function must
|
|
||||||
be optional: if the application does not supply it, the square
|
|
||||||
root function must still compute square roots.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Library,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Library, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote
|
|
||||||
it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Library.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Library
|
|
||||||
with the Library (or with a work based on the Library) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
|
||||||
License instead of this License to a given copy of the Library. To do
|
|
||||||
this, you must alter all the notices that refer to this License, so
|
|
||||||
that they refer to the ordinary GNU General Public License, version 2,
|
|
||||||
instead of to this License. (If a newer version than version 2 of the
|
|
||||||
ordinary GNU General Public License has appeared, then you can specify
|
|
||||||
that version instead if you wish.) Do not make any other change in
|
|
||||||
these notices.
|
|
||||||
|
|
||||||
Once this change is made in a given copy, it is irreversible for
|
|
||||||
that copy, so the ordinary GNU General Public License applies to all
|
|
||||||
subsequent copies and derivative works made from that copy.
|
|
||||||
|
|
||||||
This option is useful when you wish to copy part of the code of
|
|
||||||
the Library into a program that is not a library.
|
|
||||||
|
|
||||||
4. You may copy and distribute the Library (or a portion or
|
|
||||||
derivative of it, under Section 2) in object code or executable form
|
|
||||||
under the terms of Sections 1 and 2 above provided that you accompany
|
|
||||||
it with the complete corresponding machine-readable source code, which
|
|
||||||
must be distributed under the terms of Sections 1 and 2 above on a
|
|
||||||
medium customarily used for software interchange.
|
|
||||||
|
|
||||||
If distribution of object code is made by offering access to copy
|
|
||||||
from a designated place, then offering equivalent access to copy the
|
|
||||||
source code from the same place satisfies the requirement to
|
|
||||||
distribute the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
5. A program that contains no derivative of any portion of the
|
|
||||||
Library, but is designed to work with the Library by being compiled or
|
|
||||||
linked with it, is called a "work that uses the Library". Such a
|
|
||||||
work, in isolation, is not a derivative work of the Library, and
|
|
||||||
therefore falls outside the scope of this License.
|
|
||||||
|
|
||||||
However, linking a "work that uses the Library" with the Library
|
|
||||||
creates an executable that is a derivative of the Library (because it
|
|
||||||
contains portions of the Library), rather than a "work that uses the
|
|
||||||
library". The executable is therefore covered by this License.
|
|
||||||
Section 6 states terms for distribution of such executables.
|
|
||||||
|
|
||||||
When a "work that uses the Library" uses material from a header file
|
|
||||||
that is part of the Library, the object code for the work may be a
|
|
||||||
derivative work of the Library even though the source code is not.
|
|
||||||
Whether this is true is especially significant if the work can be
|
|
||||||
linked without the Library, or if the work is itself a library. The
|
|
||||||
threshold for this to be true is not precisely defined by law.
|
|
||||||
|
|
||||||
If such an object file uses only numerical parameters, data
|
|
||||||
structure layouts and accessors, and small macros and small inline
|
|
||||||
functions (ten lines or less in length), then the use of the object
|
|
||||||
file is unrestricted, regardless of whether it is legally a derivative
|
|
||||||
work. (Executables containing this object code plus portions of the
|
|
||||||
Library will still fall under Section 6.)
|
|
||||||
|
|
||||||
Otherwise, if the work is a derivative of the Library, you may
|
|
||||||
distribute the object code for the work under the terms of Section 6.
|
|
||||||
Any executables containing that work also fall under Section 6,
|
|
||||||
whether or not they are linked directly with the Library itself.
|
|
||||||
|
|
||||||
6. As an exception to the Sections above, you may also combine or
|
|
||||||
link a "work that uses the Library" with the Library to produce a
|
|
||||||
work containing portions of the Library, and distribute that work
|
|
||||||
under terms of your choice, provided that the terms permit
|
|
||||||
modification of the work for the customer's own use and reverse
|
|
||||||
engineering for debugging such modifications.
|
|
||||||
|
|
||||||
You must give prominent notice with each copy of the work that the
|
|
||||||
Library is used in it and that the Library and its use are covered by
|
|
||||||
this License. You must supply a copy of this License. If the work
|
|
||||||
during execution displays copyright notices, you must include the
|
|
||||||
copyright notice for the Library among them, as well as a reference
|
|
||||||
directing the user to the copy of this License. Also, you must do one
|
|
||||||
of these things:
|
|
||||||
|
|
||||||
a) Accompany the work with the complete corresponding
|
|
||||||
machine-readable source code for the Library including whatever
|
|
||||||
changes were used in the work (which must be distributed under
|
|
||||||
Sections 1 and 2 above); and, if the work is an executable linked
|
|
||||||
with the Library, with the complete machine-readable "work that
|
|
||||||
uses the Library", as object code and/or source code, so that the
|
|
||||||
user can modify the Library and then relink to produce a modified
|
|
||||||
executable containing the modified Library. (It is understood
|
|
||||||
that the user who changes the contents of definitions files in the
|
|
||||||
Library will not necessarily be able to recompile the application
|
|
||||||
to use the modified definitions.)
|
|
||||||
|
|
||||||
b) Use a suitable shared library mechanism for linking with the
|
|
||||||
Library. A suitable mechanism is one that (1) uses at run time a
|
|
||||||
copy of the library already present on the user's computer system,
|
|
||||||
rather than copying library functions into the executable, and (2)
|
|
||||||
will operate properly with a modified version of the library, if
|
|
||||||
the user installs one, as long as the modified version is
|
|
||||||
interface-compatible with the version that the work was made with.
|
|
||||||
|
|
||||||
c) Accompany the work with a written offer, valid for at
|
|
||||||
least three years, to give the same user the materials
|
|
||||||
specified in Subsection 6a, above, for a charge no more
|
|
||||||
than the cost of performing this distribution.
|
|
||||||
|
|
||||||
d) If distribution of the work is made by offering access to copy
|
|
||||||
from a designated place, offer equivalent access to copy the above
|
|
||||||
specified materials from the same place.
|
|
||||||
|
|
||||||
e) Verify that the user has already received a copy of these
|
|
||||||
materials or that you have already sent this user a copy.
|
|
||||||
|
|
||||||
For an executable, the required form of the "work that uses the
|
|
||||||
Library" must include any data and utility programs needed for
|
|
||||||
reproducing the executable from it. However, as a special exception,
|
|
||||||
the materials to be distributed need not include anything that is
|
|
||||||
normally distributed (in either source or binary form) with the major
|
|
||||||
components (compiler, kernel, and so on) of the operating system on
|
|
||||||
which the executable runs, unless that component itself accompanies
|
|
||||||
the executable.
|
|
||||||
|
|
||||||
It may happen that this requirement contradicts the license
|
|
||||||
restrictions of other proprietary libraries that do not normally
|
|
||||||
accompany the operating system. Such a contradiction means you cannot
|
|
||||||
use both them and the Library together in an executable that you
|
|
||||||
distribute.
|
|
||||||
|
|
||||||
7. You may place library facilities that are a work based on the
|
|
||||||
Library side-by-side in a single library together with other library
|
|
||||||
facilities not covered by this License, and distribute such a combined
|
|
||||||
library, provided that the separate distribution of the work based on
|
|
||||||
the Library and of the other library facilities is otherwise
|
|
||||||
permitted, and provided that you do these two things:
|
|
||||||
|
|
||||||
a) Accompany the combined library with a copy of the same work
|
|
||||||
based on the Library, uncombined with any other library
|
|
||||||
facilities. This must be distributed under the terms of the
|
|
||||||
Sections above.
|
|
||||||
|
|
||||||
b) Give prominent notice with the combined library of the fact
|
|
||||||
that part of it is a work based on the Library, and explaining
|
|
||||||
where to find the accompanying uncombined form of the same work.
|
|
||||||
|
|
||||||
8. You may not copy, modify, sublicense, link with, or distribute
|
|
||||||
the Library except as expressly provided under this License. Any
|
|
||||||
attempt otherwise to copy, modify, sublicense, link with, or
|
|
||||||
distribute the Library is void, and will automatically terminate your
|
|
||||||
rights under this License. However, parties who have received copies,
|
|
||||||
or rights, from you under this License will not have their licenses
|
|
||||||
terminated so long as such parties remain in full compliance.
|
|
||||||
|
|
||||||
9. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Library or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Library (or any work based on the
|
|
||||||
Library), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Library or works based on it.
|
|
||||||
|
|
||||||
10. Each time you redistribute the Library (or any work based on the
|
|
||||||
Library), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute, link with or modify the Library
|
|
||||||
subject to these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties with
|
|
||||||
this License.
|
|
||||||
|
|
||||||
11. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Library at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Library by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Library.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under any
|
|
||||||
particular circumstance, the balance of the section is intended to apply,
|
|
||||||
and the section as a whole is intended to apply in other circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
12. If the distribution and/or use of the Library is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Library under this License may add
|
|
||||||
an explicit geographical distribution limitation excluding those countries,
|
|
||||||
so that distribution is permitted only in or among countries not thus
|
|
||||||
excluded. In such case, this License incorporates the limitation as if
|
|
||||||
written in the body of this License.
|
|
||||||
|
|
||||||
13. The Free Software Foundation may publish revised and/or new
|
|
||||||
versions of the Lesser General Public License from time to time.
|
|
||||||
Such new versions will be similar in spirit to the present version,
|
|
||||||
but may differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Library
|
|
||||||
specifies a version number of this License which applies to it and
|
|
||||||
"any later version", you have the option of following the terms and
|
|
||||||
conditions either of that version or of any later version published by
|
|
||||||
the Free Software Foundation. If the Library does not specify a
|
|
||||||
license version number, you may choose any version ever published by
|
|
||||||
the Free Software Foundation.
|
|
||||||
|
|
||||||
14. If you wish to incorporate parts of the Library into other free
|
|
||||||
programs whose distribution conditions are incompatible with these,
|
|
||||||
write to the author to ask for permission. For software which is
|
|
||||||
copyrighted by the Free Software Foundation, write to the Free
|
|
||||||
Software Foundation; we sometimes make exceptions for this. Our
|
|
||||||
decision will be guided by the two goals of preserving the free status
|
|
||||||
of all derivatives of our free software and of promoting the sharing
|
|
||||||
and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
|
||||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
|
||||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
|
||||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
|
||||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
|
||||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
|
||||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
|
||||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
|
||||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
|
||||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
|
||||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
|
||||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
|
||||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
|
||||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
|
||||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
||||||
DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Libraries
|
|
||||||
|
|
||||||
If you develop a new library, and you want it to be of the greatest
|
|
||||||
possible use to the public, we recommend making it free software that
|
|
||||||
everyone can redistribute and change. You can do so by permitting
|
|
||||||
redistribution under these terms (or, alternatively, under the terms of the
|
|
||||||
ordinary General Public License).
|
|
||||||
|
|
||||||
To apply these terms, attach the following notices to the library. It is
|
|
||||||
safest to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least the
|
|
||||||
"copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the library's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
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
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with this library; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
|
||||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1990
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
That's all there is to it!
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//! [LGPL v2.1]
|
|
||||||
|
|
@ -1,108 +0,0 @@
|
||||||
//! [1]
|
|
||||||
[utopiafonts] 1999 free font
|
|
||||||
----------------------------------------------------
|
|
||||||
|
|
||||||
this font is provided free for personal or commercial use,
|
|
||||||
it can be redistributed however it may not be sold.
|
|
||||||
----------------------------------------------------
|
|
||||||
(C) 1999 utopiafonts. dale_thorpe@bssc.edu.au
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
Bitstream Vera Fonts Copyright
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
Arev Fonts Copyright
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
|
|
||||||
|
|
||||||
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 modifications to the Bitstream Vera 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 "Tavmjong Bah" or the word "Arev".
|
|
||||||
|
|
||||||
This License becomes null and void to the extent applicable to Fonts
|
|
||||||
or Font Software that has been modified and is distributed under the
|
|
||||||
"Tavmjong Bah Arev" 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
|
|
||||||
TAVMJONG BAH 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 name of Tavmjong Bah 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 Tavmjong Bah. For further information, contact: tavmjong @ free
|
|
||||||
. fr.
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,183 +0,0 @@
|
||||||
//! [0]
|
|
||||||
HEADERS = main-dlg.h \
|
|
||||||
options-dlg.h
|
|
||||||
SOURCES = main-dlg.cpp \
|
|
||||||
options-dlg.cpp \
|
|
||||||
main.cpp
|
|
||||||
FORMS = search-dlg.ui
|
|
||||||
TRANSLATIONS = superapp_dk.ts \
|
|
||||||
superapp_fi.ts \
|
|
||||||
superapp_no.ts \
|
|
||||||
superapp_se.ts
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
CODECFORTR = ISO-8859-5
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
CODECFORSRC = UTF-8
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
label->setText(tr("F\374r \310lise"));
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
Usage:
|
|
||||||
lupdate [options] [project-file]
|
|
||||||
lupdate [options] [source-file|path]... -ts ts-files
|
|
||||||
Options:
|
|
||||||
-help Display this information and exit.
|
|
||||||
-noobsolete
|
|
||||||
Drop all obsolete strings.
|
|
||||||
-extensions <ext>[,<ext>]...
|
|
||||||
Process files with the given extensions only.
|
|
||||||
The extension list must be separated with commas, not with whitespace.
|
|
||||||
Default: 'ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx'.
|
|
||||||
-pluralonly
|
|
||||||
Only include plural form messages.
|
|
||||||
-silent
|
|
||||||
Don't explain what is being done.
|
|
||||||
-version
|
|
||||||
Display the version of lupdate and exit.
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
Usage:
|
|
||||||
lrelease [options] project-file
|
|
||||||
lrelease [options] ts-files [-qm qm-file]
|
|
||||||
Options:
|
|
||||||
-help Display this information and exit
|
|
||||||
-compress
|
|
||||||
Compress the .qm files
|
|
||||||
-nounfinished
|
|
||||||
Do not include unfinished translations
|
|
||||||
-removeidentical
|
|
||||||
If the translated text is the same as
|
|
||||||
the source text, do not include the message
|
|
||||||
-silent
|
|
||||||
Don't explain what is being done
|
|
||||||
-version
|
|
||||||
Display the version of lrelease and exit
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
void wrapInFunction()
|
|
||||||
{
|
|
||||||
//! [6]
|
|
||||||
button = new QPushButton("&Quit", this);
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
button = new QPushButton(tr("&Quit"), this);
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QPushButton::tr("&Quit")
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QObject::tr("&Quit")
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
rbc = new QRadioButton(tr("Enabled", "Color frame"), this);
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
rbh = new QRadioButton(tr("Enabled", "Hue frame"), this);
|
|
||||||
//! [11]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
/*
|
|
||||||
TRANSLATOR FindDialog
|
|
||||||
|
|
||||||
Choose Edit|Find from the menu bar or press Ctrl+F to pop up the
|
|
||||||
Find dialog.
|
|
||||||
|
|
||||||
...
|
|
||||||
*/
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
/*
|
|
||||||
TRANSLATOR MyNamespace::MyClass
|
|
||||||
|
|
||||||
Necessary for lupdate.
|
|
||||||
|
|
||||||
...
|
|
||||||
*/
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
void some_global_function(LoginWidget *logwid)
|
|
||||||
{
|
|
||||||
QLabel *label = new QLabel(
|
|
||||||
LoginWidget::tr("Password:"), logwid);
|
|
||||||
}
|
|
||||||
|
|
||||||
void same_global_function(LoginWidget *logwid)
|
|
||||||
{
|
|
||||||
QLabel *label = new QLabel(
|
|
||||||
qApp->translate("LoginWidget", "Password:"),
|
|
||||||
logwid);
|
|
||||||
}
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
QString FriendlyConversation::greeting(int greet_type)
|
|
||||||
{
|
|
||||||
static const char* greeting_strings[] = {
|
|
||||||
QT_TR_NOOP("Hello"),
|
|
||||||
QT_TR_NOOP("Goodbye")
|
|
||||||
};
|
|
||||||
return tr(greeting_strings[greet_type]);
|
|
||||||
}
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
static const char* greeting_strings[] = {
|
|
||||||
QT_TRANSLATE_NOOP("FriendlyConversation", "Hello"),
|
|
||||||
QT_TRANSLATE_NOOP("FriendlyConversation", "Goodbye")
|
|
||||||
};
|
|
||||||
|
|
||||||
QString FriendlyConversation::greeting(int greet_type)
|
|
||||||
{
|
|
||||||
return tr(greeting_strings[greet_type]);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString global_greeting(int greet_type)
|
|
||||||
{
|
|
||||||
return qApp->translate("FriendlyConversation",
|
|
||||||
greeting_strings[greet_type]);
|
|
||||||
}
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
void wrapInFunction()
|
|
||||||
{
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
QString tr(const char *text, const char *comment, int n);
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
tr("%n item(s) replaced", "", count);
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,124 +0,0 @@
|
||||||
//! [0]
|
|
||||||
moc_%.cpp: %.h
|
|
||||||
moc $(DEFINES) $(INCPATH) $< -o $@
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
moc_foo.cpp: foo.h
|
|
||||||
moc $(DEFINES) $(INCPATH) $< -o $@
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
foo.o: foo.moc
|
|
||||||
|
|
||||||
foo.moc: foo.cpp
|
|
||||||
moc $(DEFINES) $(INCPATH) -i $< -o $@
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
#include "foo.moc"
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
#ifndef Q_MOC_RUN
|
|
||||||
...
|
|
||||||
#endif
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
class SomeTemplate<int> : public QFrame
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
...
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void mySignal(int);
|
|
||||||
};
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
// correct
|
|
||||||
class SomeClass : public QObject, public OtherClass
|
|
||||||
{
|
|
||||||
...
|
|
||||||
};
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
class SomeClass : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void apply(void (*apply)(List *, void *), char *); // WRONG
|
|
||||||
};
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
typedef void (*ApplyFunction)(List *, void *);
|
|
||||||
|
|
||||||
class SomeClass : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void apply(ApplyFunction, char *);
|
|
||||||
};
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
class MyClass : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
enum Error {
|
|
||||||
ConnectionRefused,
|
|
||||||
RemoteHostClosed,
|
|
||||||
UnknownError
|
|
||||||
};
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void stateChanged(MyClass::Error error);
|
|
||||||
};
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
#ifdef ultrix
|
|
||||||
#define SIGNEDNESS(a) unsigned a
|
|
||||||
#else
|
|
||||||
#define SIGNEDNESS(a) a
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class Whatever : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void someSignal(SIGNEDNESS(int));
|
|
||||||
};
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
class A
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
class B
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public slots: // WRONG
|
|
||||||
void b();
|
|
||||||
};
|
|
||||||
};
|
|
||||||
//! [11]
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QAbstractItemModel *model = index.model();
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QModelIndex index = model->index(row, column, ...);
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QModelIndex indexA = model->index(0, 0, QModelIndex());
|
|
||||||
QModelIndex indexB = model->index(1, 1, QModelIndex());
|
|
||||||
QModelIndex indexC = model->index(2, 1, QModelIndex());
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QModelIndex index = model->index(row, column, parent);
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QModelIndex indexA = model->index(0, 0, QModelIndex());
|
|
||||||
QModelIndex indexC = model->index(2, 1, QModelIndex());
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QModelIndex indexB = model->index(1, 0, indexA);
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
QVariant value = model->data(index, role);
|
|
||||||
//! [6]
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QT -= gui
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
//![0]
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
QWidget window;
|
|
||||||
QPushButton quit("Quit", &window);
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//![0]
|
|
||||||
|
|
||||||
|
|
||||||
//![1]
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
QPushButton quit("Quit");
|
|
||||||
QWidget window;
|
|
||||||
|
|
||||||
quit.setParent(&window);
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//![1]
|
|
||||||
|
|
@ -1,224 +0,0 @@
|
||||||
//! [0]
|
|
||||||
PushStream::PushStream(QObject *parent)
|
|
||||||
: AbstractMediaStream(parent), m_timer(new QTimer(this))
|
|
||||||
{
|
|
||||||
setStreamSize(getMediaStreamSize());
|
|
||||||
|
|
||||||
connect(m_timer, SIGNAL(timeout()), SLOT(moreData()));
|
|
||||||
m_timer->setInterval(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PushStream::moreData()
|
|
||||||
{
|
|
||||||
const QByteArray data = getMediaData();
|
|
||||||
if (data.isEmpty()) {
|
|
||||||
endOfData();
|
|
||||||
} else {
|
|
||||||
writeData(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PushStream::needData()
|
|
||||||
{
|
|
||||||
m_timer->start();
|
|
||||||
moreData();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PushStream::enoughData()
|
|
||||||
{
|
|
||||||
m_timer->stop();
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
PullStream::PullStream(QObject *parent)
|
|
||||||
: AbstractMediaStream(parent)
|
|
||||||
{
|
|
||||||
setStreamSize(getMediaStreamSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
void PullStream::needData()
|
|
||||||
{
|
|
||||||
const QByteArray data = getMediaData();
|
|
||||||
if (data.isEmpty()) {
|
|
||||||
endOfData();
|
|
||||||
} else {
|
|
||||||
writeData(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
seekStream(0);
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
MediaObject m;
|
|
||||||
QString fileName("/home/foo/bar.ogg");
|
|
||||||
QUrl url("http://www.example.com/stream.mp3");
|
|
||||||
QBuffer *someBuffer;
|
|
||||||
m.setCurrentSource(fileName);
|
|
||||||
m.setCurrentSource(url);
|
|
||||||
m.setCurrentSource(someBuffer);
|
|
||||||
m.setCurrentSource(Phonon::Cd);
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
VideoPlayer *player = new VideoPlayer(Phonon::VideoCategory, parentWidget);
|
|
||||||
connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));
|
|
||||||
player->play(url);
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
audioPlayer->load(url);
|
|
||||||
audioPlayer->play();
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
media = new MediaObject(this);
|
|
||||||
connect(media, SIGNAL(finished()), SLOT(slotFinished());
|
|
||||||
media->setCurrentSource("/home/username/music/filename.ogg");
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
media->play();
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
media->setCurrentSource(":/sounds/startsound.ogg");
|
|
||||||
media->enqueue("/home/username/music/song.mp3");
|
|
||||||
media->enqueue(":/sounds/endsound.ogg");
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
media->setCurrentSource(":/sounds/startsound.ogg");
|
|
||||||
connect(media, SIGNAL(aboutToFinish()), SLOT(enqueueNextSource()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void enqueueNextSource()
|
|
||||||
{
|
|
||||||
media->enqueue("/home/username/music/song.mp3");
|
|
||||||
}
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
int x = 200;
|
|
||||||
media->setTickInterval(x);
|
|
||||||
Q_ASSERT(x == producer->tickInterval());
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
int x = 200;
|
|
||||||
media->setTickInterval(x);
|
|
||||||
Q_ASSERT(x >= producer->tickInterval() &&
|
|
||||||
x <= 2producer->tickInterval());
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
connect(media, SIGNAL(hasVideoChanged(bool)), hasVideoChanged(bool));
|
|
||||||
media->setCurrentSource("somevideo.avi");
|
|
||||||
media->hasVideo(); // returns false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void hasVideoChanged(bool b)
|
|
||||||
{
|
|
||||||
// b == true
|
|
||||||
media->hasVideo(); // returns true;
|
|
||||||
}
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
connect(media, SIGNAL(hasVideoChanged(bool)), hasVideoChanged(bool));
|
|
||||||
media->setCurrentSource("somevideo.avi");
|
|
||||||
media->hasVideo(); // returns false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void hasVideoChanged(bool b)
|
|
||||||
{
|
|
||||||
// b == true
|
|
||||||
media->hasVideo(); // returns true;
|
|
||||||
}
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
setMetaArtist(media->metaData("ARTIST"));
|
|
||||||
setMetaAlbum(media->metaData("ALBUM"));
|
|
||||||
setMetaTitle(media->metaData("TITLE"));
|
|
||||||
setMetaDate(media->metaData("DATE"));
|
|
||||||
setMetaGenre(media->metaData("GENRE"));
|
|
||||||
setMetaTrack(media->metaData("TRACKNUMBER"));
|
|
||||||
setMetaComment(media->metaData("DESCRIPTION"));
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
QUrl url("http://www.example.com/music.ogg");
|
|
||||||
media->setCurrentSource(url);
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
progressBar->setRange(0, 100); // this is the default
|
|
||||||
connect(media, SIGNAL(bufferStatus(int)), progressBar, SLOT(setValue(int)));
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
QObject::connect(BackendCapabilities::notifier(), SIGNAL(capabilitiesChanged()), ...
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
QComboBox *cb = new QComboBox(parentWidget);
|
|
||||||
ObjectDescriptionModel *model = new ObjectDescriptionModel(cb);
|
|
||||||
model->setModelData(BackendCapabilities::availableAudioOutputDevices());
|
|
||||||
cb->setModel(model);
|
|
||||||
cb->setCurrentIndex(0); // select first entry
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
int cbIndex = cb->currentIndex();
|
|
||||||
AudioOutputDevice selectedDevice = model->modelData(cbIndex);
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
Path path = Phonon::createPath(...);
|
|
||||||
Effect *effect = new Effect(this);
|
|
||||||
path.insertEffect(effect);
|
|
||||||
//! [19]
|
|
||||||
|
|
||||||
|
|
||||||
//! [20]
|
|
||||||
MediaObject *media = new MediaObject;
|
|
||||||
AudioOutput *output = new AudioOutput(Phonon::MusicCategory);
|
|
||||||
Path path = Phonon::createPath(media, output);
|
|
||||||
Q_ASSERT(path.isValid()); // for this simple case the path should always be
|
|
||||||
//valid - there are unit tests to ensure it
|
|
||||||
// insert an effect
|
|
||||||
QList<EffectDescription> effectList = BackendCapabilities::availableAudioEffects();
|
|
||||||
if (!effectList.isEmpty()) {
|
|
||||||
Effect *effect = path.insertEffect(effectList.first());
|
|
||||||
}
|
|
||||||
//! [20]
|
|
||||||
|
|
||||||
|
|
||||||
//! [21]
|
|
||||||
MediaObject *media = new MediaObject(parent);
|
|
||||||
VideoWidget *vwidget = new VideoWidget(parent);
|
|
||||||
Phonon::createPath(media, vwidget);
|
|
||||||
//! [21]
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QT += phonon
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QT += phonon
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
#include <Phonon/MediaObject>
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
//! [0]
|
|
||||||
undefined reference to `_vt.11QPushButton'
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
ANSI C++ forbids declaration ... with no type
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
c:\program.obj not found
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
-universal -sdk /Developer/SDKs/MacOSX10.4u.sdk
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
|
|
||||||
CONFIG+=x86 ppc
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
/usr/bin/ld: /System/Library/Frameworks/Carbon.framework/Carbon
|
|
||||||
load command 20 unknown cmd field
|
|
||||||
/usr/bin/ld: /usr/lib/libSystem.dylib
|
|
||||||
load command 6 unknown cmd field
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
|
|
||||||
/usr/local/mysql/lib/libmysqlclient.a(my_error.o) definition of common _errbuff (size 512)
|
|
||||||
/usr/bin/libtool: internal link edit command failed
|
|
||||||
//! [6]
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
//! [0]
|
|
||||||
class MyStylePlugin : public QStylePlugin
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QStringList keys() const;
|
|
||||||
QStyle *create(const QString &key);
|
|
||||||
};
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
#include "mystyleplugin.h"
|
|
||||||
|
|
||||||
QStringList MyStylePlugin::keys() const
|
|
||||||
{
|
|
||||||
return QStringList() << "MyStyle";
|
|
||||||
}
|
|
||||||
|
|
||||||
QStyle *MyStylePlugin::create(const QString &key)
|
|
||||||
{
|
|
||||||
if (key.toLower() == "mystyle")
|
|
||||||
return new MyStyle;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(pnp_mystyleplugin, MyStylePlugin)
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QApplication::setStyle(QStyleFactory::create("MyStyle"));
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
CONFIG += release
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QtPlugin>
|
|
||||||
|
|
||||||
Q_IMPORT_PLUGIN(qjpeg)
|
|
||||||
Q_IMPORT_PLUGIN(qgif)
|
|
||||||
Q_IMPORT_PLUGIN(qkrcodecs)
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
...
|
|
||||||
return app.exec();
|
|
||||||
}
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QTPLUGIN += qjpeg \
|
|
||||||
qgif \
|
|
||||||
qkrcodecs
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.2.debug
|
|
||||||
HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.2.false
|
|
||||||
//! [6]
|
|
||||||
|
|
@ -1,187 +0,0 @@
|
||||||
//! [0]
|
|
||||||
point = new Object();
|
|
||||||
point.x = 12;
|
|
||||||
point.y = 35;
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
function manhattanLength(point) {
|
|
||||||
return point.x + point.y;
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
manhattanLength = function(point) {
|
|
||||||
return point.x + point.y;
|
|
||||||
}
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
point.manhattanLength = function() {
|
|
||||||
return this.x + this.y;
|
|
||||||
}
|
|
||||||
print(point.manhattanLength()); // prints 47
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
class Point() {
|
|
||||||
var x;
|
|
||||||
var y;
|
|
||||||
function manhattanLength() { return x + y; }
|
|
||||||
}
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
point.manhattanLength = function() {
|
|
||||||
return this.x + this.y;
|
|
||||||
}
|
|
||||||
print(point.manhattanLength()); // prints 47
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
class Car {
|
|
||||||
var regNumber;
|
|
||||||
function Car(regnr) {
|
|
||||||
regNumber = regnr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var car = new Car("ABC 123");
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
function Car(regnr) {
|
|
||||||
this.regNumber = regnr;
|
|
||||||
}
|
|
||||||
var car = new Car("ABC 123");
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
var car = new Object();
|
|
||||||
car.constructor = function(regnr) { ... }
|
|
||||||
car.constructor();
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
class Car {
|
|
||||||
var regNumber;
|
|
||||||
function Car(regnr) {
|
|
||||||
regNumber = regnr;
|
|
||||||
}
|
|
||||||
function toString() {
|
|
||||||
return regNumber;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
function Car(regnr) {
|
|
||||||
this.regNumber = regnr;
|
|
||||||
this.toString = function() { return this.regNumber; }
|
|
||||||
}
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
function Car(regnr) {
|
|
||||||
this.regNumber = regnr;
|
|
||||||
}
|
|
||||||
Car.prototype.toString = function() { return this.regNumber; }
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
class GasolineCar extends Car {
|
|
||||||
function GasolineCar(regnr) {
|
|
||||||
Car(regnr);
|
|
||||||
}
|
|
||||||
function toString() {
|
|
||||||
return "GasolineCar(" + regNumber + ")";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
function GasolineCar(regnr) {
|
|
||||||
Car(regnr);
|
|
||||||
}
|
|
||||||
GasolineCar.prototype = new Car();
|
|
||||||
GasolineCar.prototype.toString = function() {
|
|
||||||
return "GasolineCar(" + this.regNumber + ")";
|
|
||||||
}
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
class Car {
|
|
||||||
static var globalCount = 0;
|
|
||||||
}
|
|
||||||
print(Car.globalCount);
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
Car.globalCount = 0;
|
|
||||||
print(Car.globalCount);
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
QPushButton *button = new QPushButton();
|
|
||||||
button->setObjectName("button");
|
|
||||||
interpreter->addTransientObject(button);
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
QPushButton *button = new QPushButton();
|
|
||||||
QScriptValue scriptButton = engine.newQObject(button);
|
|
||||||
engine.globalObject().setProperty("button", scriptButton);
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
ModuleFactory::ModuleFactory()
|
|
||||||
{
|
|
||||||
registerClass( "ImageSource", &ImgSource::staticMetaObject);
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
QObject *ModuleFactory::create( const QString &type,
|
|
||||||
const QVariantList &,
|
|
||||||
QObject * )
|
|
||||||
{
|
|
||||||
if ( type == "ImageSource" )
|
|
||||||
return new ImgSource();
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
interpreter.addObjectFactory(new ModuleFactory());
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
QScriptValue construct_QPushButton(QScriptContext *, QScriptEngine *engine) {
|
|
||||||
return engine->newQObject(new QPushButton());
|
|
||||||
}
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
QScriptValue constructor = engine.newFunction(construct_QPushButton);
|
|
||||||
QScriptValue value =
|
|
||||||
engine.newQMetaObject(&QPushButton::staticMetaObject,
|
|
||||||
constructor);
|
|
||||||
engine.globalObject().setProperty("QPushButton", value);
|
|
||||||
//! [19]
|
|
||||||
|
|
@ -1,116 +0,0 @@
|
||||||
//! [0]
|
|
||||||
item->scene().sceneRect().intersects(item->sceneBoundingRect());
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
class TileScene : public QGraphicsScene
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
...
|
|
||||||
|
|
||||||
void setTiles(const QPixmap &pixmap, int h, int v,
|
|
||||||
int tileHeight, int tileWidth);
|
|
||||||
void setTile(int x, int y, int tilenum);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QRect tileRect(int x, int y) const;
|
|
||||||
QRect tileRect(int tileNum) const;
|
|
||||||
|
|
||||||
QVector<QVector<int> > tiles;
|
|
||||||
QPixmap tilePixmap;
|
|
||||||
int tileW, tileH;
|
|
||||||
int hTiles, vTiles;
|
|
||||||
};
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
void TileScene::setTiles(const QPixmap &pixmap, int h, int v,
|
|
||||||
int tileHeight, int tileWidth)
|
|
||||||
{
|
|
||||||
tilePixmap = pixmap;
|
|
||||||
tileW = tileWidth;
|
|
||||||
tileH = tileHeight;
|
|
||||||
hTiles = h;
|
|
||||||
vTiles = v;
|
|
||||||
|
|
||||||
tiles.resize(v);
|
|
||||||
for (int y = 0; y < v; ++y)
|
|
||||||
tiles[y].resize(h);
|
|
||||||
}
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
void TileScene::setTile(int x, int y, int tilenum)
|
|
||||||
{
|
|
||||||
tiles[y][x] = tilenum;
|
|
||||||
update(tileRect(x, y));
|
|
||||||
}
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QRect TileScene::tileRect(int x, int y) const
|
|
||||||
{
|
|
||||||
return QRect(x * tileW, y * tileH, tileW, tileH);
|
|
||||||
}
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QRect TileScene::tileRect(int tileNum) const
|
|
||||||
{
|
|
||||||
int numHTiles = tilePixmap.width() / tileW;
|
|
||||||
int numVTiles = tilePixmap.height() / tileH;
|
|
||||||
return tileRect(tileNum % numHTiles, tileNum / numHTiles);
|
|
||||||
}
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
void drawBackground(QPainter *painter, const QRectF &exposed)
|
|
||||||
{
|
|
||||||
for (int y = 0; y < vTiles; ++y) {
|
|
||||||
for (int x = 0; x < hTiles; ++x) {
|
|
||||||
QRect destRect = tileRect(x, y);
|
|
||||||
if (exposed.intersects(destRect)) {
|
|
||||||
painter->drawPixmap(destRect, tilePixmap,
|
|
||||||
tileRect(tiles[y][x]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
// Before
|
|
||||||
Q3CanvasEllipse ellipse(10, 10);
|
|
||||||
|
|
||||||
// After
|
|
||||||
QGraphicsEllipseItem ellipse(-5, -5, 10, 10);
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
static QPainterPath fromControlPoints(const Q3PointArray &pa)
|
|
||||||
{
|
|
||||||
QPainterPath path;
|
|
||||||
path.moveTo(pa[0]);
|
|
||||||
for (int i = 1; i < pa.size(); i += 3)
|
|
||||||
path.cubicTo(pa[i], pa[(i + 1) % pa.size()], pa[(i + 2) % pa.size()]);
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
wildcardPath.replace("%1", "*");
|
|
||||||
QFileInfo fi(wildcardPath);
|
|
||||||
|
|
||||||
QList<QPixmap> frames;
|
|
||||||
foreach (QString entry, QDir(fi.path(), fi.fileName()).entryList())
|
|
||||||
frames << QPixmap(fi.path() + "/" + entry);
|
|
||||||
//! [9]
|
|
||||||
|
|
@ -1,159 +0,0 @@
|
||||||
//! [0]
|
|
||||||
namespace Ui {
|
|
||||||
|
|
||||||
class HelloWorld
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QVBoxLayout *vboxLayout;
|
|
||||||
QPushButton *pushButton;
|
|
||||||
|
|
||||||
void setupUi(QWidget *HelloWorld)
|
|
||||||
{
|
|
||||||
HelloWorld->setObjectName(QString::fromUtf8("HelloWorld"));
|
|
||||||
|
|
||||||
vboxLayout = new QVBoxLayout(HelloWorld);
|
|
||||||
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
|
|
||||||
|
|
||||||
pushButton = new QPushButton(HelloWorld);
|
|
||||||
pushButton->setObjectName(QString::fromUtf8("pushButton"));
|
|
||||||
|
|
||||||
vboxLayout->addWidget(pushButton);
|
|
||||||
|
|
||||||
retranslateUi(HelloWorld);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
#include "ui_helloworld.h" // defines Ui::HelloWorld
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
|
|
||||||
QWidget w;
|
|
||||||
Ui::HelloWorld ui;
|
|
||||||
ui.setupUi(&w);
|
|
||||||
|
|
||||||
w.show();
|
|
||||||
return app.exec();
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
#include "ui_helloworld.h" // defines Ui::HelloWorld
|
|
||||||
|
|
||||||
class HelloWorldWidget : public QWidget, public Ui::HelloWorld
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
HelloWorldWidget(QWidget *parent = 0)
|
|
||||||
: QWidget(parent)
|
|
||||||
{ setupUi(this); }
|
|
||||||
};
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
HelloWorldWidget w;
|
|
||||||
w.show();
|
|
||||||
return app.exec();
|
|
||||||
}
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
uic3 myform.ui > myform.h
|
|
||||||
uic3 -impl myform.h myform.ui > myform.cpp
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
uic3 -convert myform3.ui > myform4.ui
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
class HelloWorldWidget : public QWidget, public Ui::HelloWorld
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
HelloWorldWidget(QWidget *parent = 0);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void mySlot();
|
|
||||||
};
|
|
||||||
|
|
||||||
HelloWorldWidget::HelloWorldWidget(QWidget *parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
{
|
|
||||||
setupUi(this);
|
|
||||||
|
|
||||||
QObject::connect(pushButton, SIGNAL(clicked()),
|
|
||||||
this, SLOT(mySlot()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void HelloWorldWidget::mySlot()
|
|
||||||
{
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
class HelloWorldWidget : public QWidget, public Ui::HelloWorld
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
HelloWorldWidget(QWidget *parent = 0);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void on_pushButton_clicked();
|
|
||||||
};
|
|
||||||
|
|
||||||
HelloWorldWidget::HelloWorldWidget(QWidget *parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
{
|
|
||||||
setupUi(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HelloWorldWidget::on_pushButton_clicked()
|
|
||||||
{
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
<RCC version="1.0">
|
|
||||||
<qresource prefix="/icons">
|
|
||||||
<file>yes.png</file>
|
|
||||||
<file>no.png</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
RESOURCES += icons.qrc
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QFile file(":/icons/yes.png");
|
|
||||||
QIcon icon(":/icons/no.png");
|
|
||||||
QPixmap pixmap(":/icons/no.png");
|
|
||||||
//! [9]
|
|
||||||
|
|
@ -1,473 +0,0 @@
|
||||||
//! [0]
|
|
||||||
void MyButton::paintEvent(QPaintEvent *)
|
|
||||||
{
|
|
||||||
QPainter painter(this);
|
|
||||||
drawButton(&painter);
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
ba.at(0) = 'X';
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
ba[0] = 'X';
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
if (!cache.insert(key, object))
|
|
||||||
delete object;
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
cache.insert(key, object);
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
Q3Cache<QWidget> cache;
|
|
||||||
cache.insert(widget->name(), widget);
|
|
||||||
...
|
|
||||||
QWidget *foo = cache.take("foo");
|
|
||||||
if (foo)
|
|
||||||
foo->show();
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
typedef QWidget *QWidgetPtr;
|
|
||||||
QCache<QString, QWidgetPtr> cache;
|
|
||||||
cache.insert(widget->name(), new QWidgetPtr(widget));
|
|
||||||
...
|
|
||||||
QWidgetPtr *ptr = cache.take("foo");
|
|
||||||
if (ptr) {
|
|
||||||
QWidget *foo = *ptr;
|
|
||||||
delete ptr;
|
|
||||||
foo->show();
|
|
||||||
}
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
painter.setBrush(palette().brush(QPalette::Text));
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QByteArray ba("Hello");
|
|
||||||
ba.size(); // returns 5 (the '\0' is not counted)
|
|
||||||
ba.length(); // returns 5
|
|
||||||
ba.data()[5]; // returns '\0'
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
dict.replace(key, value);
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
delete hash.take(key);
|
|
||||||
hash.insert(key, value);
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
dict.remove(key, value);
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
delete hash.take(key);
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
dict.clear();
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
while (!hash.isEmpty()) {
|
|
||||||
T *value = *hash.begin();
|
|
||||||
hash.erase(hash.begin());
|
|
||||||
delete value;
|
|
||||||
}
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
qDeleteAll(hash);
|
|
||||||
hash.clear();
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
Q3DictIterator<QWidget> i(dict);
|
|
||||||
while (i.current() != 0) {
|
|
||||||
do_something(i.currentKey(), i.current());
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
QHashIterator<QString, QWidget *> i(hash);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next(); // must come first
|
|
||||||
do_something(i.key(), i.value());
|
|
||||||
}
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
QList<QWidget *> myWidgets = qFindChildren<QWidget *>(myParent);
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
list.replace(index, value);
|
|
||||||
//! [19]
|
|
||||||
|
|
||||||
|
|
||||||
//! [20]
|
|
||||||
delete list[index];
|
|
||||||
list[index] = value;
|
|
||||||
//! [20]
|
|
||||||
|
|
||||||
|
|
||||||
//! [21]
|
|
||||||
list.removeFirst();
|
|
||||||
//! [21]
|
|
||||||
|
|
||||||
|
|
||||||
//! [22]
|
|
||||||
delete list.takeFirst();
|
|
||||||
//! [22]
|
|
||||||
|
|
||||||
|
|
||||||
//! [23]
|
|
||||||
list.removeLast();
|
|
||||||
//! [23]
|
|
||||||
|
|
||||||
|
|
||||||
//! [24]
|
|
||||||
delete list.takeLast();
|
|
||||||
//! [24]
|
|
||||||
|
|
||||||
|
|
||||||
//! [25]
|
|
||||||
list.remove(index);
|
|
||||||
//! [25]
|
|
||||||
|
|
||||||
|
|
||||||
//! [26]
|
|
||||||
delete list.takeAt(index);
|
|
||||||
//! [26]
|
|
||||||
|
|
||||||
|
|
||||||
//! [27]
|
|
||||||
list.remove(value);
|
|
||||||
//! [27]
|
|
||||||
|
|
||||||
|
|
||||||
//! [28]
|
|
||||||
int i = list.indexOf(value);
|
|
||||||
if (i != -1)
|
|
||||||
delete list.takeAt(i);
|
|
||||||
//! [28]
|
|
||||||
|
|
||||||
|
|
||||||
//! [29]
|
|
||||||
list.remove();
|
|
||||||
//! [29]
|
|
||||||
|
|
||||||
|
|
||||||
//! [30]
|
|
||||||
QMutableListIterator<T *> i;
|
|
||||||
...
|
|
||||||
delete i.value();
|
|
||||||
i.remove();
|
|
||||||
//! [30]
|
|
||||||
|
|
||||||
|
|
||||||
//! [31]
|
|
||||||
list.clear();
|
|
||||||
//! [31]
|
|
||||||
|
|
||||||
|
|
||||||
//! [32]
|
|
||||||
while (!list.isEmpty())
|
|
||||||
delete list.takeFirst();
|
|
||||||
//! [32]
|
|
||||||
|
|
||||||
|
|
||||||
//! [33]
|
|
||||||
qDeleteAll(list);
|
|
||||||
list.clear();
|
|
||||||
//! [33]
|
|
||||||
|
|
||||||
|
|
||||||
//! [34]
|
|
||||||
QPtrList<QWidget> list;
|
|
||||||
...
|
|
||||||
while (list.current() != 0) {
|
|
||||||
do_something(list.current());
|
|
||||||
list.next();
|
|
||||||
}
|
|
||||||
//! [34]
|
|
||||||
|
|
||||||
|
|
||||||
//! [35]
|
|
||||||
QList<QWidget *> list;
|
|
||||||
...
|
|
||||||
QListIterator<QWidget *> i(list);
|
|
||||||
while (i.hasNext())
|
|
||||||
do_something(i.next());
|
|
||||||
//! [35]
|
|
||||||
|
|
||||||
|
|
||||||
//! [36]
|
|
||||||
QPtrList<QWidget> list;
|
|
||||||
...
|
|
||||||
QPtrListIterator<QWidget> i;
|
|
||||||
while (i.current() != 0) {
|
|
||||||
do_something(i.current());
|
|
||||||
i.next();
|
|
||||||
}
|
|
||||||
//! [36]
|
|
||||||
|
|
||||||
|
|
||||||
//! [37]
|
|
||||||
QList<QWidget *> list;
|
|
||||||
...
|
|
||||||
QListIterator<QWidget *> i(list);
|
|
||||||
while (i.hasNext())
|
|
||||||
do_something(i.next());
|
|
||||||
//! [37]
|
|
||||||
|
|
||||||
|
|
||||||
//! [38]
|
|
||||||
queue.dequeue();
|
|
||||||
//! [38]
|
|
||||||
|
|
||||||
|
|
||||||
//! [39]
|
|
||||||
delete queue.dequeue();
|
|
||||||
//! [39]
|
|
||||||
|
|
||||||
|
|
||||||
//! [40]
|
|
||||||
queue.remove();
|
|
||||||
//! [40]
|
|
||||||
|
|
||||||
|
|
||||||
//! [41]
|
|
||||||
delete queue.dequeue();
|
|
||||||
//! [41]
|
|
||||||
|
|
||||||
|
|
||||||
//! [42]
|
|
||||||
queue.clear();
|
|
||||||
//! [42]
|
|
||||||
|
|
||||||
|
|
||||||
//! [43]
|
|
||||||
while (!queue.isEmpty())
|
|
||||||
delete queue.dequeue();
|
|
||||||
//! [43]
|
|
||||||
|
|
||||||
|
|
||||||
//! [44]
|
|
||||||
qDeleteAll(queue);
|
|
||||||
queue.clear();
|
|
||||||
//! [44]
|
|
||||||
|
|
||||||
|
|
||||||
//! [45]
|
|
||||||
stack.pop();
|
|
||||||
//! [45]
|
|
||||||
|
|
||||||
|
|
||||||
//! [46]
|
|
||||||
delete stack.pop();
|
|
||||||
//! [46]
|
|
||||||
|
|
||||||
|
|
||||||
//! [47]
|
|
||||||
stack.remove();
|
|
||||||
//! [47]
|
|
||||||
|
|
||||||
|
|
||||||
//! [48]
|
|
||||||
delete stack.pop();
|
|
||||||
//! [48]
|
|
||||||
|
|
||||||
|
|
||||||
//! [49]
|
|
||||||
stack.clear();
|
|
||||||
//! [49]
|
|
||||||
|
|
||||||
|
|
||||||
//! [50]
|
|
||||||
while (!stack.isEmpty())
|
|
||||||
delete stack.pop();
|
|
||||||
//! [50]
|
|
||||||
|
|
||||||
|
|
||||||
//! [51]
|
|
||||||
qDeleteAll(stack);
|
|
||||||
stack.clear();
|
|
||||||
//! [51]
|
|
||||||
|
|
||||||
|
|
||||||
//! [52]
|
|
||||||
vect.insert(i, ptr);
|
|
||||||
//! [52]
|
|
||||||
|
|
||||||
|
|
||||||
//! [53]
|
|
||||||
delete vect[i];
|
|
||||||
vect[i] = ptr;
|
|
||||||
//! [53]
|
|
||||||
|
|
||||||
|
|
||||||
//! [54]
|
|
||||||
vect.remove(i);
|
|
||||||
//! [54]
|
|
||||||
|
|
||||||
|
|
||||||
//! [55]
|
|
||||||
delete vect[i];
|
|
||||||
vect[i] = 0;
|
|
||||||
//! [55]
|
|
||||||
|
|
||||||
|
|
||||||
//! [56]
|
|
||||||
T *ptr = vect.take(i);
|
|
||||||
//! [56]
|
|
||||||
|
|
||||||
|
|
||||||
//! [57]
|
|
||||||
T *ptr = vect[i];
|
|
||||||
vect[i] = 0;
|
|
||||||
//! [57]
|
|
||||||
|
|
||||||
|
|
||||||
//! [58]
|
|
||||||
vect.resize(n)
|
|
||||||
//! [58]
|
|
||||||
|
|
||||||
|
|
||||||
//! [59]
|
|
||||||
while (n > vect.size())
|
|
||||||
vect.append(0);
|
|
||||||
while (n < vect.size() {
|
|
||||||
T *ptr = vect.last();
|
|
||||||
vect.remove(vect.size() - 1);
|
|
||||||
delete ptr;
|
|
||||||
}
|
|
||||||
//! [59]
|
|
||||||
|
|
||||||
|
|
||||||
//! [60]
|
|
||||||
vect.clear();
|
|
||||||
//! [60]
|
|
||||||
|
|
||||||
|
|
||||||
//! [61]
|
|
||||||
for (int i = 0; i < vect.size(); ++i)
|
|
||||||
T *ptr = vect[i];
|
|
||||||
vect[i] = 0;
|
|
||||||
delete ptr;
|
|
||||||
}
|
|
||||||
//! [61]
|
|
||||||
|
|
||||||
|
|
||||||
//! [62]
|
|
||||||
qDeleteAll(vect);
|
|
||||||
vect.clear();
|
|
||||||
//! [62]
|
|
||||||
|
|
||||||
|
|
||||||
//! [63]
|
|
||||||
struct Shared
|
|
||||||
{
|
|
||||||
Shared() : count(1) {}
|
|
||||||
void ref() { ++count; }
|
|
||||||
bool deref() { return !--count; }
|
|
||||||
uint count;
|
|
||||||
};
|
|
||||||
//! [63]
|
|
||||||
|
|
||||||
//! [63a]
|
|
||||||
// Declare the object
|
|
||||||
QSimpleRichText richText(text, font);
|
|
||||||
|
|
||||||
// Set the width of the paragraph to w
|
|
||||||
richText.setWidth(w);
|
|
||||||
|
|
||||||
// Or set a resonable default size
|
|
||||||
richText.adjustSize();
|
|
||||||
|
|
||||||
// Query for its used size
|
|
||||||
int width = richText.widthUsed();
|
|
||||||
int height = richText.height();
|
|
||||||
|
|
||||||
// Draw
|
|
||||||
richText.draw(painter, x, y, clipRect, colorGroup);
|
|
||||||
//! [63a]
|
|
||||||
|
|
||||||
|
|
||||||
//! [63b]
|
|
||||||
// Declare the object
|
|
||||||
QTextDocument doc;
|
|
||||||
|
|
||||||
// If text is rich text, use setHtml()
|
|
||||||
doc.setHtml(text);
|
|
||||||
|
|
||||||
// Otherwise, use setPlainText()
|
|
||||||
doc.setPlainText(text);
|
|
||||||
|
|
||||||
// Set the width of the paragraph of text to w
|
|
||||||
doc.setTextWidth(w);
|
|
||||||
|
|
||||||
// Query for the used size
|
|
||||||
int width = doc.idealWidth();
|
|
||||||
int height = doc.size().height();
|
|
||||||
|
|
||||||
// Draw
|
|
||||||
painter.translate(x, y);
|
|
||||||
doc.drawContents(painter, clipRect);
|
|
||||||
|
|
||||||
// If you have a palette/colorgroup you can draw using lower-level functions:
|
|
||||||
QAbstractTextDocumentLayout::PaintContext context;
|
|
||||||
context.palette = myPalette;
|
|
||||||
doc.documentLayout()->draw(painter, context);
|
|
||||||
//! [63b]
|
|
||||||
|
|
||||||
//! [63c]
|
|
||||||
QSlider *slider;
|
|
||||||
slider->style()->subControlRect(CC_Slider, sliderOption, SC_SliderHandle, slider);
|
|
||||||
//! [63c]
|
|
||||||
|
|
||||||
//! [64]
|
|
||||||
QString greeting = "Hello";
|
|
||||||
const char *badData = greeting.toAscii().constData(); // data is invalid
|
|
||||||
QByteArray asciiData = greeting.toAscii();
|
|
||||||
const char *goodData = asciiData.constData();
|
|
||||||
//! [64]
|
|
||||||
|
|
||||||
|
|
||||||
//! [65]
|
|
||||||
str.at(0) = 'X';
|
|
||||||
//! [65]
|
|
||||||
|
|
||||||
|
|
||||||
//! [66]
|
|
||||||
str[0] = 'X';
|
|
||||||
//! [66]
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
//! [0]
|
|
||||||
Q_PROPERTY(type name
|
|
||||||
READ getFunction
|
|
||||||
[WRITE setFunction]
|
|
||||||
[RESET resetFunction]
|
|
||||||
[NOTIFY notifySignal]
|
|
||||||
[DESIGNABLE bool]
|
|
||||||
[SCRIPTABLE bool]
|
|
||||||
[STORED bool]
|
|
||||||
[USER bool])
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Q_PROPERTY(bool focus READ hasFocus)
|
|
||||||
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled)
|
|
||||||
Q_PROPERTY(QCursor cursor READ cursor WRITE setCursor RESET unsetCursor)
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
Q_PROPERTY(QDate date READ getDate WRITE setDate)
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QPushButton *button = new QPushButton;
|
|
||||||
QObject *object = button;
|
|
||||||
|
|
||||||
button->setDown(true);
|
|
||||||
object->setProperty("down", true);
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QObject *object = ...
|
|
||||||
const QMetaObject *metaobject = object->metaObject();
|
|
||||||
int count = metaobject->propertyCount();
|
|
||||||
for (int i=0; i<count; ++i) {
|
|
||||||
QMetaProperty metaproperty = metaobject->property(i);
|
|
||||||
const char *name = metaproperty.name();
|
|
||||||
QVariant value = object->property(name);
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
class MyClass : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PROPERTY(Priority priority READ priority WRITE setPriority)
|
|
||||||
Q_ENUMS(Priority)
|
|
||||||
|
|
||||||
public:
|
|
||||||
MyClass(QObject *parent = 0);
|
|
||||||
~MyClass();
|
|
||||||
|
|
||||||
enum Priority { High, Low, VeryHigh, VeryLow };
|
|
||||||
|
|
||||||
void setPriority(Priority priority);
|
|
||||||
Priority priority() const;
|
|
||||||
};
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
MyClass *myinstance = new MyClass;
|
|
||||||
QObject *object = myinstance;
|
|
||||||
|
|
||||||
myinstance->setPriority(MyClass::VeryHigh);
|
|
||||||
object->setProperty("priority", "VeryHigh");
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
Q_CLASSINFO("Version", "3.0.0")
|
|
||||||
//! [7]
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
//! [0]
|
|
||||||
Q3AsciiDict<QLineEdit> fields; // char* keys, QLineEdit* values
|
|
||||||
fields.insert( "forename", new QLineEdit( this ) );
|
|
||||||
fields.insert( "surname", new QLineEdit( this ) );
|
|
||||||
|
|
||||||
fields["forename"]->setText( "Homer" );
|
|
||||||
fields["surname"]->setText( "Simpson" );
|
|
||||||
|
|
||||||
Q3AsciiDictIterator<QLineEdit> it( fields ); // See Q3AsciiDictIterator
|
|
||||||
for( ; it.current(); ++it )
|
|
||||||
cout << it.currentKey() << ": " << it.current()->text() << endl;
|
|
||||||
cout << endl;
|
|
||||||
|
|
||||||
if ( fields["forename"] && fields["surname"] )
|
|
||||||
cout << fields["forename"]->text() << " "
|
|
||||||
<< fields["surname"]->text() << endl; // Prints "Homer Simpson"
|
|
||||||
|
|
||||||
fields.remove( "forename" ); // Does not delete the line edit
|
|
||||||
if ( ! fields["forename"] )
|
|
||||||
cout << "forename is not in the dictionary" << endl;
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Q3AsciiDict<char> dict;
|
|
||||||
...
|
|
||||||
if ( dict.find(key) )
|
|
||||||
dict.remove( key );
|
|
||||||
dict.insert( key, item );
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
Q3AsciiDict<QLineEdit> fields;
|
|
||||||
fields.insert( "forename", new QLineEdit( this ) );
|
|
||||||
fields.insert( "surname", new QLineEdit( this ) );
|
|
||||||
fields.insert( "age", new QLineEdit( this ) );
|
|
||||||
|
|
||||||
fields["forename"]->setText( "Homer" );
|
|
||||||
fields["surname"]->setText( "Simpson" );
|
|
||||||
fields["age"]->setText( "45" );
|
|
||||||
|
|
||||||
Q3AsciiDictIterator<QLineEdit> it( fields );
|
|
||||||
for( ; it.current(); ++it )
|
|
||||||
cout << it.currentKey() << ": " << it.current()->text() << endl;
|
|
||||||
cout << endl;
|
|
||||||
|
|
||||||
// Output (random order):
|
|
||||||
// age: 45
|
|
||||||
// surname: Simpson
|
|
||||||
// forename: Homer
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
//! [0]
|
|
||||||
Q3Dict<char> dict;
|
|
||||||
...
|
|
||||||
if ( dict.find( key ) )
|
|
||||||
dict.remove( key );
|
|
||||||
dict.insert( key, item );
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Q3Dict<QLineEdit> fields;
|
|
||||||
fields.insert( "forename", new QLineEdit( this ) );
|
|
||||||
fields.insert( "surname", new QLineEdit( this ) );
|
|
||||||
fields.insert( "age", new QLineEdit( this ) );
|
|
||||||
|
|
||||||
fields["forename"]->setText( "Homer" );
|
|
||||||
fields["surname"]->setText( "Simpson" );
|
|
||||||
fields["age"]->setText( "45" );
|
|
||||||
|
|
||||||
Q3DictIterator<QLineEdit> it( fields );
|
|
||||||
for( ; it.current(); ++it )
|
|
||||||
cout << it.currentKey() << ": " << it.current()->text() << endl;
|
|
||||||
cout << endl;
|
|
||||||
|
|
||||||
// Output (random order):
|
|
||||||
// age: 45
|
|
||||||
// surname: Simpson
|
|
||||||
// forename: Homer
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
//! [0]
|
|
||||||
Q3IntDict<QLineEdit> fields; // long int keys, QLineEdit* values
|
|
||||||
for ( int i = 0; i < 3; i++ )
|
|
||||||
fields.insert( i, new QLineEdit( this ) );
|
|
||||||
|
|
||||||
fields[0]->setText( "Homer" );
|
|
||||||
fields[1]->setText( "Simpson" );
|
|
||||||
fields[2]->setText( "45" );
|
|
||||||
|
|
||||||
Q3IntDictIterator<QLineEdit> it( fields );
|
|
||||||
for ( ; it.current(); ++it )
|
|
||||||
cout << it.currentKey() << ": " << it.current()->text() << endl;
|
|
||||||
|
|
||||||
for ( int i = 0; i < 3; i++ )
|
|
||||||
cout << fields[i]->text() << " "; // Prints "Homer Simpson 45"
|
|
||||||
cout << endl;
|
|
||||||
|
|
||||||
fields.remove( 1 ); // Does not delete the line edit
|
|
||||||
for ( int i = 0; i < 3; i++ )
|
|
||||||
if ( fields[i] )
|
|
||||||
cout << fields[i]->text() << " "; // Prints "Homer 45"
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Q3IntDict<char> dict;
|
|
||||||
// ...
|
|
||||||
if ( dict.find(key) )
|
|
||||||
dict.remove( key );
|
|
||||||
dict.insert( key, item );
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
Q3IntDict<QLineEdit> fields;
|
|
||||||
for ( int i = 0; i < 3; i++ )
|
|
||||||
fields.insert( i, new QLineEdit( this ) );
|
|
||||||
|
|
||||||
fields[0]->setText( "Homer" );
|
|
||||||
fields[1]->setText( "Simpson" );
|
|
||||||
fields[2]->setText( "45" );
|
|
||||||
|
|
||||||
Q3IntDictIterator<QLineEdit> it( fields );
|
|
||||||
for ( ; it.current(); ++it )
|
|
||||||
cout << it.currentKey() << ": " << it.current()->text() << endl;
|
|
||||||
|
|
||||||
// Output (random order):
|
|
||||||
// 0: Homer
|
|
||||||
// 1: Simpson
|
|
||||||
// 2: 45
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
//! [0]
|
|
||||||
#include <q3memarray.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
Q3MemArray<int> fib( int num ) // returns fibonacci array
|
|
||||||
{
|
|
||||||
Q_ASSERT( num > 2 );
|
|
||||||
Q3MemArray<int> f( num ); // array of ints
|
|
||||||
|
|
||||||
f[0] = f[1] = 1;
|
|
||||||
for ( int i = 2; i < num; i++ )
|
|
||||||
f[i] = f[i-1] + f[i-2];
|
|
||||||
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
Q3MemArray<int> a = fib( 6 ); // get first 6 fibonaccis
|
|
||||||
for ( int i = 0; i < a.size(); i++ )
|
|
||||||
qDebug( "%d: %d", i, a[i] );
|
|
||||||
|
|
||||||
qDebug( "1 is found %d times", a.contains(1) );
|
|
||||||
qDebug( "5 is found at index %d", a.find(5) );
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
0: 1
|
|
||||||
1: 1
|
|
||||||
2: 2
|
|
||||||
3: 3
|
|
||||||
4: 5
|
|
||||||
5: 8
|
|
||||||
1 is found 2 times
|
|
||||||
5 is found at index 4
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
// MyStruct may be padded to 4 or 8 bytes
|
|
||||||
struct MyStruct
|
|
||||||
{
|
|
||||||
short i; // 2 bytes
|
|
||||||
char c; // 1 byte
|
|
||||||
};
|
|
||||||
|
|
||||||
Q3MemArray<MyStruct> a(1);
|
|
||||||
a[0].i = 5;
|
|
||||||
a[0].c = 't';
|
|
||||||
|
|
||||||
MyStruct x;
|
|
||||||
x.i = '5';
|
|
||||||
x.c = 't';
|
|
||||||
int i = a.find( x ); // may return -1 if the pad bytes differ
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
static char bindata[] = { 231, 1, 44, ... };
|
|
||||||
QByteArray a;
|
|
||||||
a.setRawData( bindata, sizeof(bindata) ); // a points to bindata
|
|
||||||
QDataStream s( a, IO_ReadOnly ); // open on a's data
|
|
||||||
s >> <something>; // read raw bindata
|
|
||||||
a.resetRawData( bindata, sizeof(bindata) ); // finished
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
static char bindata[] = { 231, 1, 44, ... };
|
|
||||||
QByteArray a, b;
|
|
||||||
a.setRawData( bindata, sizeof(bindata) ); // a points to bindata
|
|
||||||
a.resize( 8 ); // will crash
|
|
||||||
b = a; // will crash
|
|
||||||
a[2] = 123; // might crash
|
|
||||||
// forget to resetRawData: will crash
|
|
||||||
//! [4]
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
//! [0]
|
|
||||||
Q3PtrDict<char> fields; // void* keys, char* values
|
|
||||||
|
|
||||||
QLineEdit *le1 = new QLineEdit( this );
|
|
||||||
le1->setText( "Simpson" );
|
|
||||||
QLineEdit *le2 = new QLineEdit( this );
|
|
||||||
le2->setText( "Homer" );
|
|
||||||
QLineEdit *le3 = new QLineEdit( this );
|
|
||||||
le3->setText( "45" );
|
|
||||||
|
|
||||||
fields.insert( le1, "Surname" );
|
|
||||||
fields.insert( le2, "Forename" );
|
|
||||||
fields.insert( le3, "Age" );
|
|
||||||
|
|
||||||
Q3PtrDictIterator<char> it( fields );
|
|
||||||
for( ; it.current(); ++it )
|
|
||||||
cout << it.current() << endl;
|
|
||||||
cout << endl;
|
|
||||||
|
|
||||||
if ( fields[le1] ) // Prints "Surname: Simpson"
|
|
||||||
cout << fields[le1] << ": " << le1->text() << endl;
|
|
||||||
if ( fields[le2] ) // Prints "Forename: Homer"
|
|
||||||
cout << fields[le2] << ": " << le2->text() << endl;
|
|
||||||
|
|
||||||
fields.remove( le1 ); // Removes le1 from the dictionary
|
|
||||||
cout << le1->text() << endl; // Prints "Simpson"
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Q3PtrDict<ItemType> dict;
|
|
||||||
...
|
|
||||||
if ( dict.find( key ) )
|
|
||||||
dict.remove( key );
|
|
||||||
dict.insert( key, item );
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
Q3PtrDict<char> fields;
|
|
||||||
|
|
||||||
QLineEdit *le1 = new QLineEdit( this );
|
|
||||||
le1->setText( "Simpson" );
|
|
||||||
QLineEdit *le2 = new QLineEdit( this );
|
|
||||||
le2->setText( "Homer" );
|
|
||||||
QLineEdit *le3 = new QLineEdit( this );
|
|
||||||
le3->setText( "45" );
|
|
||||||
|
|
||||||
fields.insert( le1, "Surname" );
|
|
||||||
fields.insert( le2, "Forename" );
|
|
||||||
fields.insert( le3, "Age" );
|
|
||||||
|
|
||||||
Q3PtrDictIterator<char> it( fields );
|
|
||||||
for( ; it.current(); ++it ) {
|
|
||||||
QLineEdit *le = (QLineEdit)it.currentKey();
|
|
||||||
cout << it.current() << ": " << le->text() << endl;
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
|
|
||||||
// Output (random order):
|
|
||||||
// Forename: Homer
|
|
||||||
// Age: 45
|
|
||||||
// Surname: Simpson
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
//! [0]
|
|
||||||
class Employee
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Employee() : sn( 0 ) { }
|
|
||||||
Employee( const QString& forename, const QString& surname, int salary )
|
|
||||||
: fn( forename ), sn( surname ), sal( salary )
|
|
||||||
{ }
|
|
||||||
|
|
||||||
void setSalary( int salary ) { sal = salary; }
|
|
||||||
|
|
||||||
QString forename() const { return fn; }
|
|
||||||
QString surname() const { return sn; }
|
|
||||||
int salary() const { return sal; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString fn;
|
|
||||||
QString sn;
|
|
||||||
int sal;
|
|
||||||
};
|
|
||||||
|
|
||||||
Q3PtrList<Employee> list;
|
|
||||||
list.setAutoDelete( TRUE ); // the list owns the objects
|
|
||||||
|
|
||||||
list.append( new Employee("John", "Doe", 50000) );
|
|
||||||
list.append( new Employee("Jane", "Williams", 80000) );
|
|
||||||
list.append( new Employee("Tom", "Jones", 60000) );
|
|
||||||
|
|
||||||
Employee *employee;
|
|
||||||
for ( employee = list.first(); employee; employee = list.next() )
|
|
||||||
cout << employee->surname().latin1() << ", " <<
|
|
||||||
employee->forename().latin1() << " earns " <<
|
|
||||||
employee->salary() << endl;
|
|
||||||
cout << endl;
|
|
||||||
|
|
||||||
// very inefficient for big lists
|
|
||||||
for ( uint i = 0; i < list.count(); ++i )
|
|
||||||
if ( list.at(i) )
|
|
||||||
cout << list.at( i )->surname().latin1() << endl;
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Doe, John earns 50000
|
|
||||||
Williams, Jane earns 80000
|
|
||||||
Jones, Tom earns 60000
|
|
||||||
|
|
||||||
Doe
|
|
||||||
Williams
|
|
||||||
Jones
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
if ( list.findRef( item ) != -1 )
|
|
||||||
list.remove();
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
Q3PtrList<Employee> list;
|
|
||||||
|
|
||||||
list.append( new Employee("John", "Doe", 50000) );
|
|
||||||
list.append( new Employee("Jane", "Williams", 80000) );
|
|
||||||
list.append( new Employee("Tom", "Jones", 60000) );
|
|
||||||
|
|
||||||
Q3PtrListIterator<Employee> it( list );
|
|
||||||
Employee *employee;
|
|
||||||
while ( (employee = it.current()) != 0 ) {
|
|
||||||
++it;
|
|
||||||
cout << employee->surname().latin1() << ", " <<
|
|
||||||
employee->forename().latin1() << " earns " <<
|
|
||||||
employee->salary() << endl;
|
|
||||||
}
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
Doe, John earns 50000
|
|
||||||
Williams, Jane earns 80000
|
|
||||||
Jones, Tom earns 60000
|
|
||||||
//! [4]
|
|
||||||
|
|
@ -1,95 +0,0 @@
|
||||||
//! [0]
|
|
||||||
class Employee
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Employee(): sn(0) {}
|
|
||||||
Employee( const QString& forename, const QString& surname, int salary )
|
|
||||||
: fn(forename), sn(surname), sal(salary)
|
|
||||||
{}
|
|
||||||
|
|
||||||
QString forename() const { return fn; }
|
|
||||||
QString surname() const { return sn; }
|
|
||||||
int salary() const { return sal; }
|
|
||||||
void setSalary( int salary ) { sal = salary; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString fn;
|
|
||||||
QString sn;
|
|
||||||
int sal;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef Q3ValueList<Employee> EmployeeList;
|
|
||||||
EmployeeList list;
|
|
||||||
|
|
||||||
list.append( Employee("John", "Doe", 50000) );
|
|
||||||
list.append( Employee("Jane", "Williams", 80000) );
|
|
||||||
list.append( Employee("Tom", "Jones", 60000) );
|
|
||||||
|
|
||||||
Employee mary( "Mary", "Hawthorne", 90000 );
|
|
||||||
list.append( mary );
|
|
||||||
mary.setSalary( 100000 );
|
|
||||||
|
|
||||||
EmployeeList::iterator it;
|
|
||||||
for ( it = list.begin(); it != list.end(); ++it )
|
|
||||||
cout << (*it).surname().latin1() << ", " <<
|
|
||||||
(*it).forename().latin1() << " earns " <<
|
|
||||||
(*it).salary() << endl;
|
|
||||||
|
|
||||||
// Output:
|
|
||||||
// Doe, John earns 50000
|
|
||||||
// Williams, Jane earns 80000
|
|
||||||
// Hawthorne, Mary earns 90000
|
|
||||||
// Jones, Tom earns 60000
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Q3ValueList<int> list;
|
|
||||||
list.append( 1 );
|
|
||||||
list.append( 2 );
|
|
||||||
list.append( 3 );
|
|
||||||
...
|
|
||||||
if ( !list.empty() ) {
|
|
||||||
// OK, modify the first item
|
|
||||||
int& i = list.first();
|
|
||||||
i = 18;
|
|
||||||
}
|
|
||||||
...
|
|
||||||
Q3ValueList<double> dlist;
|
|
||||||
double d = dlist.last(); // undefined
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
Q3ValueList<int> l;
|
|
||||||
...
|
|
||||||
Q3ValueList<int>::iterator it = l.end();
|
|
||||||
--it;
|
|
||||||
if ( it != end() )
|
|
||||||
// ...
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
Q3ValueList<int> l;
|
|
||||||
...
|
|
||||||
Q3ValueList<int>::iterator it = l.end();
|
|
||||||
--it;
|
|
||||||
if ( it != end() )
|
|
||||||
// ...
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
EmployeeList::iterator it;
|
|
||||||
for ( it = list.begin(); it != list.end(); ++it )
|
|
||||||
cout << (*it).surname().latin1() << ", " <<
|
|
||||||
(*it).forename().latin1() << " earns " <<
|
|
||||||
(*it).salary() << endl;
|
|
||||||
|
|
||||||
// Output:
|
|
||||||
// Doe, John earns 50000
|
|
||||||
// Williams, Jane earns 80000
|
|
||||||
// Hawthorne, Mary earns 90000
|
|
||||||
// Jones, Tom earns 60000
|
|
||||||
//! [4]
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
//! [0]
|
|
||||||
Q3ValueStack<int> stack;
|
|
||||||
stack.push( 1 );
|
|
||||||
stack.push( 2 );
|
|
||||||
stack.push( 3 );
|
|
||||||
while ( ! stack.isEmpty() )
|
|
||||||
cout << "Item: " << stack.pop() << endl;
|
|
||||||
|
|
||||||
// Output:
|
|
||||||
// Item: 3
|
|
||||||
// Item: 2
|
|
||||||
// Item: 1
|
|
||||||
//! [0]
|
|
||||||
|
|
@ -1,85 +0,0 @@
|
||||||
//! [0]
|
|
||||||
#include <qvaluevector.h>
|
|
||||||
#include <qstring.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
class Employee
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Employee(): s(0) {}
|
|
||||||
Employee( const QString& name, int salary )
|
|
||||||
: n( name ), s( salary )
|
|
||||||
{ }
|
|
||||||
|
|
||||||
QString name() const { return n; }
|
|
||||||
int salary() const { return s; }
|
|
||||||
void setSalary( int salary ) { s = salary; }
|
|
||||||
private:
|
|
||||||
QString n;
|
|
||||||
int s;
|
|
||||||
};
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
typedef Q3ValueVector<Employee> EmployeeVector;
|
|
||||||
EmployeeVector vec( 3 ); // vector of 3 Employees
|
|
||||||
|
|
||||||
vec[0] = Employee( "Bill", 50000 );
|
|
||||||
vec[1] = Employee( "Steve", 80000 );
|
|
||||||
vec[2] = Employee( "Ron", 60000 );
|
|
||||||
|
|
||||||
Employee joe( "Joe", 50000 );
|
|
||||||
vec.push_back( joe ); // vector expands to accommodate 4 Employees
|
|
||||||
joe.setSalary( 70000 );
|
|
||||||
|
|
||||||
EmployeeVector::iterator it;
|
|
||||||
for( it = vec.begin(); it != vec.end(); ++it )
|
|
||||||
printf( "%s earns %d\n", (*it).name().latin1(), (*it).salary() );
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Bill earns 50000
|
|
||||||
Steve earns 80000
|
|
||||||
Ron earns 60000
|
|
||||||
Joe earns 50000
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
Q3ValueVector<int> vec1; // an empty vector
|
|
||||||
vec1[10] = 4; // WARNING: undefined, probably a crash
|
|
||||||
|
|
||||||
Q3ValueVector<QString> vec2(25); // initialize with 25 elements
|
|
||||||
vec2[10] = "Dave"; // OK
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
void func( Q3ValueVector<int>& vec )
|
|
||||||
{
|
|
||||||
if ( vec.size() > 10 ) {
|
|
||||||
vec[9] = 99; // OK
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
Q3ValueVector<int> vec( 3 );
|
|
||||||
vec.push_back( 1 );
|
|
||||||
vec.push_back( 2 );
|
|
||||||
vec.push_back( 3 );
|
|
||||||
...
|
|
||||||
if ( !vec.empty() ) {
|
|
||||||
// OK: modify the first element
|
|
||||||
int& i = vec.front();
|
|
||||||
i = 18;
|
|
||||||
}
|
|
||||||
...
|
|
||||||
Q3ValueVector<double> dvec;
|
|
||||||
double d = dvec.back(); // undefined behavior
|
|
||||||
//! [4]
|
|
||||||
|
|
@ -1,314 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QStringList list;
|
|
||||||
list << "one" << "two" << "three";
|
|
||||||
|
|
||||||
qFill(list.begin(), list.end(), "eleven");
|
|
||||||
// list: [ "eleven", "eleven", "eleven" ]
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
qFill(list.begin() + 1, list.end(), "six");
|
|
||||||
// list: [ "eleven", "six", "six" ]
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QChar resolveEntity(const QString &entity)
|
|
||||||
{
|
|
||||||
static const QLatin1String name_table[] = {
|
|
||||||
"AElig", "Aacute", ..., "zwnj"
|
|
||||||
};
|
|
||||||
static const ushort value_table[] = {
|
|
||||||
0x0061, 0x00c1, ..., 0x200c
|
|
||||||
};
|
|
||||||
int N = sizeof(name_table) / sizeof(name_table[0]);
|
|
||||||
|
|
||||||
const QLatin1String *name = qBinaryFind(name_table, name_table + N,
|
|
||||||
entity);
|
|
||||||
int index = name - name_table;
|
|
||||||
if (index == N)
|
|
||||||
return QChar();
|
|
||||||
|
|
||||||
return QChar(value_table[index]);
|
|
||||||
}
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QChar resolveEntity(const QString &entity)
|
|
||||||
{
|
|
||||||
static QMap<QString, int> entityMap;
|
|
||||||
|
|
||||||
if (!entityMap) {
|
|
||||||
entityMap.insert("AElig", 0x0061);
|
|
||||||
entityMap.insert("Aacute", 0x00c1);
|
|
||||||
...
|
|
||||||
entityMap.insert("zwnj", 0x200c);
|
|
||||||
}
|
|
||||||
return QChar(entityMap.value(entity));
|
|
||||||
}
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QStringList list;
|
|
||||||
list << "one" << "two" << "three";
|
|
||||||
|
|
||||||
QVector<QString> vect1(3);
|
|
||||||
qCopy(list.begin(), list.end(), vect1.begin());
|
|
||||||
// vect: [ "one", "two", "three" ]
|
|
||||||
|
|
||||||
QVector<QString> vect2(8);
|
|
||||||
qCopy(list.begin(), list.end(), vect2.begin() + 2);
|
|
||||||
// vect: [ "", "", "one", "two", "three", "", "", "" ]
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QStringList list;
|
|
||||||
list << "one" << "two" << "three";
|
|
||||||
|
|
||||||
QVector<QString> vect(5);
|
|
||||||
qCopyBackward(list.begin(), list.end(), vect.end());
|
|
||||||
// vect: [ "", "", "one", "two", "three" ]
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
QStringList list;
|
|
||||||
list << "one" << "two" << "three";
|
|
||||||
|
|
||||||
QVector<QString> vect(3);
|
|
||||||
vect[0] = "one";
|
|
||||||
vect[1] = "two";
|
|
||||||
vect[2] = "three";
|
|
||||||
|
|
||||||
bool ret1 = qEqual(list.begin(), list.end(), vect.begin());
|
|
||||||
// ret1 == true
|
|
||||||
|
|
||||||
vect[2] = "seven";
|
|
||||||
bool ret2 = qEqual(list.begin(), list.end(), vect.begin());
|
|
||||||
// ret2 == false
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
QStringList list;
|
|
||||||
list << "one" << "two" << "three";
|
|
||||||
|
|
||||||
qFill(list.begin(), list.end(), "eleven");
|
|
||||||
// list: [ "eleven", "eleven", "eleven" ]
|
|
||||||
|
|
||||||
qFill(list.begin() + 1, list.end(), "six");
|
|
||||||
// list: [ "eleven", "six", "six" ]
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QStringList list;
|
|
||||||
list << "one" << "two" << "three";
|
|
||||||
|
|
||||||
QStringList::iterator i1 = qFind(list.begin(), list.end(), "two");
|
|
||||||
// i1 == list.begin() + 1
|
|
||||||
|
|
||||||
QStringList::iterator i2 = qFind(list.begin(), list.end(), "seventy");
|
|
||||||
// i2 == list.end()
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QList<int> list;
|
|
||||||
list << 3 << 3 << 6 << 6 << 6 << 8;
|
|
||||||
|
|
||||||
int countOf6 = 0;
|
|
||||||
qCount(list.begin(), list.end(), 6, countOf6);
|
|
||||||
// countOf6 == 3
|
|
||||||
|
|
||||||
int countOf7 = 0;
|
|
||||||
qCount(list.begin(), list.end(), 7, countOf7);
|
|
||||||
// countOf7 == 0
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
double pi = 3.14;
|
|
||||||
double e = 2.71;
|
|
||||||
|
|
||||||
qSwap(pi, e);
|
|
||||||
// pi == 2.71, e == 3.14
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
QList<int> list;
|
|
||||||
list << 33 << 12 << 68 << 6 << 12;
|
|
||||||
qSort(list.begin(), list.end());
|
|
||||||
// list: [ 6, 12, 12, 33, 68 ]
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
|
|
||||||
{
|
|
||||||
return s1.toLower() < s2.toLower();
|
|
||||||
}
|
|
||||||
|
|
||||||
int doSomething()
|
|
||||||
{
|
|
||||||
QStringList list;
|
|
||||||
list << "AlPha" << "beTA" << "gamma" << "DELTA";
|
|
||||||
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
|
|
||||||
// list: [ "AlPha", "beTA", "DELTA", "gamma" ]
|
|
||||||
}
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
QList<int> list;
|
|
||||||
list << 33 << 12 << 68 << 6 << 12;
|
|
||||||
qSort(list.begin(), list.end(), qGreater<int>());
|
|
||||||
// list: [ 68, 33, 12, 12, 6 ]
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
QStringList list;
|
|
||||||
list << "AlPha" << "beTA" << "gamma" << "DELTA";
|
|
||||||
|
|
||||||
QMap<QString, QString> map;
|
|
||||||
foreach (QString str, list)
|
|
||||||
map.insert(str.toLower(), str);
|
|
||||||
|
|
||||||
list = map.values();
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
QList<int> list;
|
|
||||||
list << 33 << 12 << 68 << 6 << 12;
|
|
||||||
qStableSort(list.begin(), list.end());
|
|
||||||
// list: [ 6, 12, 12, 33, 68 ]
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
|
|
||||||
{
|
|
||||||
return s1.toLower() < s2.toLower();
|
|
||||||
}
|
|
||||||
|
|
||||||
int doSomething()
|
|
||||||
{
|
|
||||||
QStringList list;
|
|
||||||
list << "AlPha" << "beTA" << "gamma" << "DELTA";
|
|
||||||
qStableSort(list.begin(), list.end(), caseInsensitiveLessThan);
|
|
||||||
// list: [ "AlPha", "beTA", "DELTA", "gamma" ]
|
|
||||||
}
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
QList<int> list;
|
|
||||||
list << 33 << 12 << 68 << 6 << 12;
|
|
||||||
qStableSort(list.begin(), list.end(), qGreater<int>());
|
|
||||||
// list: [ 68, 33, 12, 12, 6 ]
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
QList<int> list;
|
|
||||||
list << 3 << 3 << 6 << 6 << 6 << 8;
|
|
||||||
|
|
||||||
QList<int>::iterator i = qLowerBound(list.begin(), list.end(), 5);
|
|
||||||
list.insert(i, 5);
|
|
||||||
// list: [ 3, 3, 5, 6, 6, 6, 8 ]
|
|
||||||
|
|
||||||
i = qLowerBound(list.begin(), list.end(), 12);
|
|
||||||
list.insert(i, 12);
|
|
||||||
// list: [ 3, 3, 5, 6, 6, 6, 8, 12 ]
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
QVector<int> vect;
|
|
||||||
vect << 3 << 3 << 6 << 6 << 6 << 8;
|
|
||||||
QVector<int>::iterator begin6 =
|
|
||||||
qLowerBound(vect.begin(), vect.end(), 6);
|
|
||||||
QVector<int>::iterator end6 =
|
|
||||||
qUpperBound(begin6, vect.end(), 6);
|
|
||||||
|
|
||||||
QVector<int>::iterator i = begin6;
|
|
||||||
while (i != end6) {
|
|
||||||
*i = 7;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
// vect: [ 3, 3, 7, 7, 7, 8 ]
|
|
||||||
//! [19]
|
|
||||||
|
|
||||||
|
|
||||||
//! [20]
|
|
||||||
QList<int> list;
|
|
||||||
list << 3 << 3 << 6 << 6 << 6 << 8;
|
|
||||||
|
|
||||||
QList<int>::iterator i = qUpperBound(list.begin(), list.end(), 5);
|
|
||||||
list.insert(i, 5);
|
|
||||||
// list: [ 3, 3, 5, 6, 6, 6, 8 ]
|
|
||||||
|
|
||||||
i = qUpperBound(list.begin(), list.end(), 12);
|
|
||||||
list.insert(i, 12);
|
|
||||||
// list: [ 3, 3, 5, 6, 6, 6, 8, 12 ]
|
|
||||||
//! [20]
|
|
||||||
|
|
||||||
|
|
||||||
//! [21]
|
|
||||||
QVector<int> vect;
|
|
||||||
vect << 3 << 3 << 6 << 6 << 6 << 8;
|
|
||||||
QVector<int>::iterator begin6 =
|
|
||||||
qLowerBound(vect.begin(), vect.end(), 6);
|
|
||||||
QVector<int>::iterator end6 =
|
|
||||||
qUpperBound(vect.begin(), vect.end(), 6);
|
|
||||||
|
|
||||||
QVector<int>::iterator i = begin6;
|
|
||||||
while (i != end6) {
|
|
||||||
*i = 7;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
// vect: [ 3, 3, 7, 7, 7, 8 ]
|
|
||||||
//! [21]
|
|
||||||
|
|
||||||
|
|
||||||
//! [22]
|
|
||||||
QVector<int> vect;
|
|
||||||
vect << 3 << 3 << 6 << 6 << 6 << 8;
|
|
||||||
|
|
||||||
QVector<int>::iterator i =
|
|
||||||
qBinaryFind(vect.begin(), vect.end(), 6);
|
|
||||||
// i == vect.begin() + 2 (or 3 or 4)
|
|
||||||
//! [22]
|
|
||||||
|
|
||||||
|
|
||||||
//! [23]
|
|
||||||
QList<Employee *> list;
|
|
||||||
list.append(new Employee("Blackpool", "Stephen"));
|
|
||||||
list.append(new Employee("Twist", "Oliver"));
|
|
||||||
|
|
||||||
qDeleteAll(list.begin(), list.end());
|
|
||||||
list.clear();
|
|
||||||
//! [23]
|
|
||||||
|
|
||||||
|
|
||||||
//! [24]
|
|
||||||
QList<int> list;
|
|
||||||
list << 33 << 12 << 68 << 6 << 12;
|
|
||||||
qSort(list.begin(), list.end(), qLess<int>());
|
|
||||||
// list: [ 68, 33, 12, 12, 6 ]
|
|
||||||
//! [24]
|
|
||||||
|
|
||||||
|
|
||||||
//! [25]
|
|
||||||
QList<int> list;
|
|
||||||
list << 33 << 12 << 68 << 6 << 12;
|
|
||||||
qSort(list.begin(), list.end(), qGreater<int>());
|
|
||||||
// list: [ 68, 33, 12, 12, 6 ]
|
|
||||||
//! [25]
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
//! [0]
|
|
||||||
CONFIG += qaxcontainer
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
TYPELIBS = file.tlb
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,223 +0,0 @@
|
||||||
//! [0]
|
|
||||||
TEMPLATE = app
|
|
||||||
CONFIG += qaxserver
|
|
||||||
|
|
||||||
RC_FILE = qaxserver.rc
|
|
||||||
...
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
TEMPLATE = lib
|
|
||||||
CONFIG += qaxserver dll
|
|
||||||
|
|
||||||
DEF_FILE = qaxserver.def
|
|
||||||
RC_FILE = qaxserver.rc
|
|
||||||
...
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
TEMPLATE = lib
|
|
||||||
VERSION = 2.5
|
|
||||||
...
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
class MyActiveX : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
Q_CLASSINFO("ClassID", "{1D9928BD-4453-4bdd-903D-E525ED17FDE5}")
|
|
||||||
Q_CLASSINFO("InterfaceID", "{99F6860E-2C5A-42ec-87F2-43396F4BE389}")
|
|
||||||
Q_CLASSINFO("EventsID", "{0A3E9F27-E4F1-45bb-9E47-63099BCCD0E3}")
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
Q_PROPERTY(int value READ value WRITE setValue)
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
public:
|
|
||||||
MyActiveX(QWidget *parent = 0)
|
|
||||||
...
|
|
||||||
|
|
||||||
int value() const;
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setValue(int v);
|
|
||||||
...
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void valueChange(int v);
|
|
||||||
...
|
|
||||||
|
|
||||||
};
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
#include <QAxBindable>
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
class MyActiveX : public QWidget, public QAxBindable
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QAXFACTORY_BEGIN("{ad90301a-849e-4e8b-9a91-0a6dc5f6461f}",
|
|
||||||
"{a8f21901-7ff7-4f6a-b939-789620c03d83}")
|
|
||||||
QAXCLASS(MyWidget)
|
|
||||||
QAXCLASS(MyWidget2)
|
|
||||||
QAXTYPE(MySubType)
|
|
||||||
QAXFACTORY_END()
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QAxFactory>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
if (!QAxFactory::isServer()) {
|
|
||||||
// create and show main window
|
|
||||||
}
|
|
||||||
return app.exec();
|
|
||||||
}
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
MyFactory(const QUuid &, const QUuid &);
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
HMODULE dll = LoadLibrary("myserver.dll");
|
|
||||||
typedef HRESULT(__stdcall *DllRegisterServerProc)();
|
|
||||||
DllRegisterServerProc DllRegisterServer =
|
|
||||||
(DllRegisterServerProc)GetProcAddress(dll, "DllRegisterServer");
|
|
||||||
|
|
||||||
HRESULT res = E_FAIL;
|
|
||||||
if (DllRegisterServer)
|
|
||||||
res = DllRegisterServer();
|
|
||||||
if (res != S_OK)
|
|
||||||
// error handling
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
cabarc N simpleax.cab simpleax.exe simple.inf
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
<object ID="MyActiveX1" CLASSID="CLSID:ad90301a-849e-4e8b-9a91-0a6dc5f6461f">
|
|
||||||
...
|
|
||||||
<\object>
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
<object ID=...>
|
|
||||||
<param name="name" value="value">
|
|
||||||
<\object>
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
class MyActiveX : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_CLASSINFO("Version", "2.0")
|
|
||||||
Q_CLASSINFO("ClassID", "{7a4cffd8-cbcd-4ae9-ae7e-343e1e5710df}")
|
|
||||||
Q_CLASSINFO("InterfaceID", "{6fb035bf-8019-48d8-be51-ef05427d8994}")
|
|
||||||
Q_CLASSINFO("EventsID", "{c42fffdf-6557-47c9-817a-2da2228bc29c}")
|
|
||||||
Q_CLASSINFO("Insertable", "yes")
|
|
||||||
Q_CLASSINFO("ToSuperClass", "MyActiveX")
|
|
||||||
Q_PROPERTY(...)
|
|
||||||
|
|
||||||
public:
|
|
||||||
MyActiveX(QWidget *parent = 0);
|
|
||||||
|
|
||||||
...
|
|
||||||
};
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
class MyLicensedControl : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_CLASSINFO("LicenseKey", "<key string>")
|
|
||||||
...
|
|
||||||
};
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
class AxImpl : public QAxAggregated, public ISomeCOMInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
AxImpl() {}
|
|
||||||
|
|
||||||
long queryInterface(const QUuid &iid, void **iface);
|
|
||||||
|
|
||||||
// IUnknown
|
|
||||||
QAXAGG_IUNKNOWN
|
|
||||||
|
|
||||||
// ISomeCOMInterface
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
long AxImpl::queryInterface(const QUuid &iid, void **iface)
|
|
||||||
{
|
|
||||||
*iface = 0;
|
|
||||||
if (iid == IID_ISomeCOMInterface)
|
|
||||||
*iface = (ISomeCOMInterface *)this;
|
|
||||||
else
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
|
|
||||||
AddRef();
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
HRESULT AxImpl::QueryInterface(REFIID iid, void **iface)
|
|
||||||
{
|
|
||||||
return controllingUnknown()->QueryInterface(iid, iface);
|
|
||||||
}
|
|
||||||
//! [19]
|
|
||||||
|
|
||||||
|
|
||||||
//! [20]
|
|
||||||
class MyActiveX : public QWidget, public QAxBindable
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
MyActiveX(QWidget *parent);
|
|
||||||
|
|
||||||
QAxAggregated *createAggregate()
|
|
||||||
{
|
|
||||||
return new AxImpl();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//! [20]
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QCache<int, Employee> cache;
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Employee *employee = new Employee;
|
|
||||||
employee->setId(37);
|
|
||||||
employee->setName("Richard Schmit");
|
|
||||||
...
|
|
||||||
cache.insert(employee->id(), employee);
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QCache<int, MyDataStructure> cache(5000);
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,253 +0,0 @@
|
||||||
//! [0]
|
|
||||||
class MainApplicationAdaptor: public QDBusAbstractAdaptor
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_CLASSINFO("D-Bus Interface", "org.kde.DBus.MainApplication")
|
|
||||||
Q_PROPERTY(QString caption READ caption WRITE setCaption)
|
|
||||||
Q_PROPERTY(QString organizationName READ organizationName)
|
|
||||||
Q_PROPERTY(QString organizationDomain READ organizationDomain)
|
|
||||||
|
|
||||||
private:
|
|
||||||
QApplication *app;
|
|
||||||
|
|
||||||
public:
|
|
||||||
MainApplicationAdaptor(QApplication *application)
|
|
||||||
: QDBusAbstractAdaptor(application), app(application)
|
|
||||||
{
|
|
||||||
connect(application, SIGNAL(aboutToQuit()), SIGNAL(aboutToQuit()));
|
|
||||||
connect(application, SIGNAL(focusChanged(QWidget*, QWidget*)),
|
|
||||||
SLOT(focusChangedSlot(QWidget*, QWidget*)));
|
|
||||||
}
|
|
||||||
|
|
||||||
QString caption()
|
|
||||||
{
|
|
||||||
if (app->hasMainWindow())
|
|
||||||
return app->mainWindow()->caption();
|
|
||||||
return QString(""); // must not return a null QString
|
|
||||||
}
|
|
||||||
|
|
||||||
void setCaption(const QString &newCaption)
|
|
||||||
{
|
|
||||||
if (app->hasMainWindow())
|
|
||||||
app->mainWindow()->setCaption(newCaption);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString organizationName()
|
|
||||||
{
|
|
||||||
return app->organizationName();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString organizationDomain()
|
|
||||||
{
|
|
||||||
return app->organizationDomain();
|
|
||||||
}
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
Q_NOREPLY void quit()
|
|
||||||
{ app->quit(); }
|
|
||||||
|
|
||||||
void reparseConfiguration()
|
|
||||||
{ app->reparseConfiguration(); }
|
|
||||||
|
|
||||||
QString mainWindowObject()
|
|
||||||
{
|
|
||||||
if (app->hasMainWindow())
|
|
||||||
return QString("/%1/mainwindow").arg(app->applicationName());
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setSessionManagement(bool enable)
|
|
||||||
{
|
|
||||||
if (enable)
|
|
||||||
app->enableSessionManagement();
|
|
||||||
else
|
|
||||||
app->disableSessionManagement();
|
|
||||||
}
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void focusChangedSlot(QWidget *, QWidget *now)
|
|
||||||
{
|
|
||||||
if (now == app->mainWindow())
|
|
||||||
emit mainWindowHasFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void aboutToQuit();
|
|
||||||
void mainWindowHasFocus();
|
|
||||||
};
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
interface org.kde.DBus.MainApplication
|
|
||||||
{
|
|
||||||
property readwrite STRING caption
|
|
||||||
property read STRING organizationName
|
|
||||||
property read STRING organizationDomain
|
|
||||||
|
|
||||||
method quit() annotation("org.freedesktop.DBus.Method.NoReply", "true")
|
|
||||||
method reparseConfiguration()
|
|
||||||
method mainWindowObject(out STRING)
|
|
||||||
method disableSessionManagement(in BOOLEAN enable)
|
|
||||||
|
|
||||||
signal aboutToQuit()
|
|
||||||
signal mainWindowHasFocus()
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
// create the QApplication object
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
|
|
||||||
// create the MainApplication adaptor:
|
|
||||||
new MainApplicationAdaptor(app);
|
|
||||||
|
|
||||||
// connect to D-Bus and register as an object:
|
|
||||||
QDBusConnection::sessionBus().registerObject("/MainApplication", app);
|
|
||||||
|
|
||||||
// add main window, etc.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
app.exec();
|
|
||||||
}
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
class MainApplicationAdaptor: public QDBusAbstractAdaptor
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_CLASSINFO("D-Bus Interface", "org.kde.DBus.MainApplication")
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
Q_PROPERTY(QString caption READ caption WRITE setCaption)
|
|
||||||
Q_PROPERTY(QString organizationName READ organizationName)
|
|
||||||
Q_PROPERTY(QString organizationDomain READ organizationDomain)
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QString caption()
|
|
||||||
{
|
|
||||||
if (app->hasMainWindow())
|
|
||||||
return app->mainWindow()->caption();
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setCaption(const QString &newCaption)
|
|
||||||
{
|
|
||||||
if (app->hasMainWindow())
|
|
||||||
app->mainWindow()->setCaption(newCaption);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString organizationName()
|
|
||||||
{
|
|
||||||
return app->organizationName();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString organizationDomain()
|
|
||||||
{
|
|
||||||
return app->organizationDomain();
|
|
||||||
}
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
MyInterfaceAdaptor(QApplication *application)
|
|
||||||
: QDBusAbstractAdaptor(application), app(application)
|
|
||||||
{
|
|
||||||
connect(application, SIGNAL(aboutToQuit()), SIGNAL(aboutToQuit());
|
|
||||||
connect(application, SIGNAL(focusChanged(QWidget*, QWidget*)),
|
|
||||||
SLOT(focusChangedSlot(QWidget*, QWidget*)));
|
|
||||||
}
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
public slots:
|
|
||||||
Q_NOREPLY void quit()
|
|
||||||
{ app->quit(); }
|
|
||||||
|
|
||||||
void reparseConfiguration()
|
|
||||||
{ app->reparseConfiguration(); }
|
|
||||||
|
|
||||||
QString mainWindowObject()
|
|
||||||
{
|
|
||||||
if (app->hasMainWindow())
|
|
||||||
return QString("/%1/mainwindow").arg(app->applicationName());
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setSessionManagement(bool enable)
|
|
||||||
{
|
|
||||||
if (enable)
|
|
||||||
app->enableSessionManagement();
|
|
||||||
else
|
|
||||||
app->disableSessionManagement();
|
|
||||||
}
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
signals:
|
|
||||||
void aboutToQuit();
|
|
||||||
void mainWindowHasFocus();
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
private slots:
|
|
||||||
void focusChangedSlot(QWidget *, QWidget *now)
|
|
||||||
{
|
|
||||||
if (now == app->mainWindow())
|
|
||||||
emit mainWindowHasFocus();
|
|
||||||
}
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
struct RequestData
|
|
||||||
{
|
|
||||||
QString request;
|
|
||||||
QString processedData;
|
|
||||||
QDBusMessage reply;
|
|
||||||
};
|
|
||||||
|
|
||||||
QString processRequest(const QString &request, const QDBusMessage &message)
|
|
||||||
{
|
|
||||||
RequestData *data = new RequestData;
|
|
||||||
data->request = request;
|
|
||||||
message.setDelayedReply(true);
|
|
||||||
data->reply = message.createReply();
|
|
||||||
QDBusConnection::sessionBus().send(data->reply);
|
|
||||||
|
|
||||||
appendRequest(data);
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
void sendReply(RequestData *data)
|
|
||||||
{
|
|
||||||
// data->processedData has been initialized with the request's reply
|
|
||||||
QDBusMessage &reply = &data->reply;
|
|
||||||
|
|
||||||
// send the reply over D-Bus:
|
|
||||||
reply << data->processedData;
|
|
||||||
QDBusConnection::sessionBus().send(reply);
|
|
||||||
|
|
||||||
// dispose of the transaction data
|
|
||||||
delete data;
|
|
||||||
}
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
Q_NOREPLY void myMethod();
|
|
||||||
//! [12]
|
|
||||||
|
|
@ -1,380 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QList<float> list;
|
|
||||||
...
|
|
||||||
QListIterator<float> i(list);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QListIterator<float> i(list);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious())
|
|
||||||
qDebug() << i.previous();
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QLinkedList<float> list;
|
|
||||||
...
|
|
||||||
QLinkedListIterator<float> i(list);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QLinkedListIterator<float> i(list);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious())
|
|
||||||
qDebug() << i.previous();
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QVector<float> vector;
|
|
||||||
...
|
|
||||||
QVectorIterator<float> i(vector);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QVectorIterator<float> i(vector);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious())
|
|
||||||
qDebug() << i.previous();
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
QSet<QString> set;
|
|
||||||
...
|
|
||||||
QSetIterator<QString> i(set);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
QSetIterator<QString> i(set);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious())
|
|
||||||
qDebug() << i.previous();
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QList<float> list;
|
|
||||||
...
|
|
||||||
QMutableListIterator<float> i(list);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QMutableListIterator<float> i(list);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious())
|
|
||||||
qDebug() << i.previous();
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
QMutableListIterator<int> i(list);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
int val = i.next();
|
|
||||||
if (val < 0) {
|
|
||||||
i.setValue(-val);
|
|
||||||
} else if (val == 0) {
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
QLinkedList<float> list;
|
|
||||||
...
|
|
||||||
QMutableLinkedListIterator<float> i(list);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
QMutableLinkedListIterator<float> i(list);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious())
|
|
||||||
qDebug() << i.previous();
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
QMutableLinkedListIterator<int> i(list);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
int val = i.next();
|
|
||||||
if (val < 0) {
|
|
||||||
i.setValue(-val);
|
|
||||||
} else if (val == 0) {
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
QVector<float> vector;
|
|
||||||
...
|
|
||||||
QMutableVectorIterator<float> i(vector);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
QMutableVectorIterator<float> i(vector);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious())
|
|
||||||
qDebug() << i.previous();
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
QMutableVectorIterator<int> i(vector);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
int val = i.next();
|
|
||||||
if (val < 0) {
|
|
||||||
i.setValue(-val);
|
|
||||||
} else if (val == 0) {
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
QSet<float> set;
|
|
||||||
...
|
|
||||||
QMutableSetIterator<float> i(set);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
QMutableSetIterator<float> i(set);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious())
|
|
||||||
qDebug() << i.previous();
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
QMutableListIterator<int> i(list);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
int val = i.next();
|
|
||||||
if (val < -32768 || val > 32767)
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
//! [19]
|
|
||||||
|
|
||||||
|
|
||||||
//! [20]
|
|
||||||
QMutableLinkedListIterator<int> i(list);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
int val = i.next();
|
|
||||||
if (val < -32768 || val > 32767)
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
//! [20]
|
|
||||||
|
|
||||||
|
|
||||||
//! [21]
|
|
||||||
QMutableVectorIterator<int> i(vector);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
int val = i.next();
|
|
||||||
if (val < -32768 || val > 32767)
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
//! [21]
|
|
||||||
|
|
||||||
|
|
||||||
//! [22]
|
|
||||||
QMutableSetIterator<int> i(set);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
int val = i.next();
|
|
||||||
if (val < -32768 || val > 32767)
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
//! [22]
|
|
||||||
|
|
||||||
|
|
||||||
//! [23]
|
|
||||||
QMutableListIterator<double> i(list);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
double val = i.next();
|
|
||||||
i.setValue(sqrt(val));
|
|
||||||
}
|
|
||||||
//! [23]
|
|
||||||
|
|
||||||
|
|
||||||
//! [24]
|
|
||||||
QMutableLinkedListIterator<double> i(list);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
double val = i.next();
|
|
||||||
i.setValue(sqrt(val));
|
|
||||||
}
|
|
||||||
//! [24]
|
|
||||||
|
|
||||||
|
|
||||||
//! [25]
|
|
||||||
QMutableVectorIterator<double> i(list);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
double val = i.next();
|
|
||||||
i.setValue(sqrt(val));
|
|
||||||
}
|
|
||||||
//! [25]
|
|
||||||
|
|
||||||
|
|
||||||
//! [26]
|
|
||||||
QMap<int, QWidget *> map;
|
|
||||||
...
|
|
||||||
QMapIterator<int, QWidget *> i(map);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
qDebug() << i.key() << ": " << i.value();
|
|
||||||
}
|
|
||||||
//! [26]
|
|
||||||
|
|
||||||
|
|
||||||
//! [27]
|
|
||||||
QMapIterator<int, QWidget *> i(map);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious()) {
|
|
||||||
i.previous();
|
|
||||||
qDebug() << i.key() << ": " << i.value();
|
|
||||||
}
|
|
||||||
//! [27]
|
|
||||||
|
|
||||||
|
|
||||||
//! [28]
|
|
||||||
QMapIterator<int, QWidget *> i(map);
|
|
||||||
while (i.findNext(widget)) {
|
|
||||||
qDebug() << "Found widget " << widget << " under key "
|
|
||||||
<< i.key();
|
|
||||||
}
|
|
||||||
//! [28]
|
|
||||||
|
|
||||||
|
|
||||||
//! [29]
|
|
||||||
QHash<int, QWidget *> hash;
|
|
||||||
...
|
|
||||||
QHashIterator<int, QWidget *> i(hash);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
qDebug() << i.key() << ": " << i.value();
|
|
||||||
}
|
|
||||||
//! [29]
|
|
||||||
|
|
||||||
|
|
||||||
//! [30]
|
|
||||||
QHashIterator<int, QWidget *> i(hash);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious()) {
|
|
||||||
i.previous();
|
|
||||||
qDebug() << i.key() << ": " << i.value();
|
|
||||||
}
|
|
||||||
//! [30]
|
|
||||||
|
|
||||||
|
|
||||||
//! [31]
|
|
||||||
QHashIterator<int, QWidget *> i(hash);
|
|
||||||
while (i.findNext(widget)) {
|
|
||||||
qDebug() << "Found widget " << widget << " under key "
|
|
||||||
<< i.key();
|
|
||||||
}
|
|
||||||
//! [31]
|
|
||||||
|
|
||||||
|
|
||||||
//! [32]
|
|
||||||
QMap<int, QWidget *> map;
|
|
||||||
...
|
|
||||||
QMutableMapIterator<int, QWidget *> i(map);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
qDebug() << i.key() << ": " << i.value();
|
|
||||||
}
|
|
||||||
//! [32]
|
|
||||||
|
|
||||||
|
|
||||||
//! [33]
|
|
||||||
QMutableMapIterator<int, QWidget *> i(map);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious()) {
|
|
||||||
i.previous();
|
|
||||||
qDebug() << i.key() << ": " << i.value();
|
|
||||||
}
|
|
||||||
//! [33]
|
|
||||||
|
|
||||||
|
|
||||||
//! [34]
|
|
||||||
QMutableMapIterator<int, QWidget *> i(map);
|
|
||||||
while (i.findNext(widget)) {
|
|
||||||
qDebug() << "Found widget " << widget << " under key "
|
|
||||||
<< i.key();
|
|
||||||
}
|
|
||||||
//! [34]
|
|
||||||
|
|
||||||
|
|
||||||
//! [35]
|
|
||||||
QMutableMapIterator<QString, QString> i(map);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
if (i.key() == i.value())
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
//! [35]
|
|
||||||
|
|
||||||
|
|
||||||
//! [36]
|
|
||||||
QHash<int, QWidget *> hash;
|
|
||||||
...
|
|
||||||
QMutableHashIterator<QString, QWidget *> i(hash);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
qDebug() << i.key() << ": " << i.value();
|
|
||||||
}
|
|
||||||
//! [36]
|
|
||||||
|
|
||||||
|
|
||||||
//! [37]
|
|
||||||
QMutableHashIterator<int, QWidget *> i(hash);
|
|
||||||
i.toBack();
|
|
||||||
while (i.hasPrevious()) {
|
|
||||||
i.previous();
|
|
||||||
qDebug() << i.key() << ": " << i.value();
|
|
||||||
}
|
|
||||||
//! [37]
|
|
||||||
|
|
||||||
|
|
||||||
//! [38]
|
|
||||||
QMutableHashIterator<int, QWidget *> i(hash);
|
|
||||||
while (i.findNext(widget)) {
|
|
||||||
qDebug() << "Found widget " << widget << " under key "
|
|
||||||
<< i.key();
|
|
||||||
}
|
|
||||||
//! [38]
|
|
||||||
|
|
||||||
|
|
||||||
//! [39]
|
|
||||||
QMutableHashIterator<QString, QString> i(hash);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
if (i.key() == i.value())
|
|
||||||
i.remove();
|
|
||||||
}
|
|
||||||
//! [39]
|
|
||||||
|
|
@ -1,813 +0,0 @@
|
||||||
//! [0]
|
|
||||||
make all
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
CONFIG += qt thread debug
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
CONFIG += qt
|
|
||||||
QT += network xml
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QT = network xml # This will omit the core and gui modules.
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QT -= gui # Only the core module is used.
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
CONFIG += link_pkgconfig
|
|
||||||
PKGCONFIG += ogg dbus-1
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
LIBS += -L/usr/local/lib -lmath
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
INCLUDEPATH = c:/msdev/include d:/stl/include
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
qmake [mode] [options] files
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
qmake -makefile [options] files
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
qmake -makefile -unix -o Makefile "CONFIG+=test" test.pro
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
qmake "CONFIG+=test" test.pro
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
qmake -project [options] files
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
qmake -spec macx-g++
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
QMAKE_LFLAGS += -F/path/to/framework/directory/
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
LIBS += -framework TheFramework
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
TEMPLATE = lib
|
|
||||||
CONFIG += lib_bundle
|
|
||||||
//! [16]
|
|
||||||
|
|
||||||
|
|
||||||
//! [17]
|
|
||||||
FRAMEWORK_HEADERS.version = Versions
|
|
||||||
FRAMEWORK_HEADERS.files = path/to/header_one.h path/to/header_two.h
|
|
||||||
FRAMEWORK_HEADERS.path = Headers
|
|
||||||
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
|
|
||||||
//! [17]
|
|
||||||
|
|
||||||
|
|
||||||
//! [18]
|
|
||||||
CONFIG += x86 ppc
|
|
||||||
//! [18]
|
|
||||||
|
|
||||||
|
|
||||||
//! [19]
|
|
||||||
qmake -spec macx-xcode project.pro
|
|
||||||
//! [19]
|
|
||||||
|
|
||||||
|
|
||||||
//! [20]
|
|
||||||
qmake -tp vc
|
|
||||||
//! [20]
|
|
||||||
|
|
||||||
|
|
||||||
//! [21]
|
|
||||||
qmake -tp vc -r
|
|
||||||
//! [21]
|
|
||||||
|
|
||||||
|
|
||||||
//! [22]
|
|
||||||
CONFIG -= embed_manifest_exe
|
|
||||||
//! [22]
|
|
||||||
|
|
||||||
|
|
||||||
//! [23]
|
|
||||||
CONFIG -= embed_manifest_dll
|
|
||||||
//! [23]
|
|
||||||
|
|
||||||
|
|
||||||
//! [24]
|
|
||||||
make all
|
|
||||||
//! [24]
|
|
||||||
|
|
||||||
|
|
||||||
//! [25]
|
|
||||||
build_pass:CONFIG(debug, debug|release) {
|
|
||||||
unix: TARGET = $$join(TARGET,,,_debug)
|
|
||||||
else: TARGET = $$join(TARGET,,,d)
|
|
||||||
}
|
|
||||||
//! [25]
|
|
||||||
|
|
||||||
|
|
||||||
//! [26]
|
|
||||||
CONFIG += qt console newstuff
|
|
||||||
...
|
|
||||||
newstuff {
|
|
||||||
SOURCES += new.cpp
|
|
||||||
HEADERS += new.h
|
|
||||||
}
|
|
||||||
//! [26]
|
|
||||||
|
|
||||||
|
|
||||||
//! [27]
|
|
||||||
DEFINES += USE_MY_STUFF QT_DLL
|
|
||||||
//! [27]
|
|
||||||
|
|
||||||
|
|
||||||
//! [28]
|
|
||||||
myFiles.sources = path\*.png
|
|
||||||
DEPLOYMENT += myFiles
|
|
||||||
//! [28]
|
|
||||||
|
|
||||||
|
|
||||||
//! [29]
|
|
||||||
myFiles.sources = path\file1.ext1 path2\file2.ext1 path3\*
|
|
||||||
myFiles.path = \some\path\on\device
|
|
||||||
someother.sources = C:\additional\files\*
|
|
||||||
someother.path = \myFiles\path2
|
|
||||||
DEPLOYMENT += myFiles someother
|
|
||||||
//! [29]
|
|
||||||
|
|
||||||
|
|
||||||
//! [30]
|
|
||||||
DESTDIR = ../../lib
|
|
||||||
//! [30]
|
|
||||||
|
|
||||||
|
|
||||||
//! [31]
|
|
||||||
DISTFILES += ../program.txt
|
|
||||||
//! [31]
|
|
||||||
|
|
||||||
|
|
||||||
//! [32]
|
|
||||||
FORMS = mydialog.ui \
|
|
||||||
mywidget.ui \
|
|
||||||
myconfig.ui
|
|
||||||
//! [32]
|
|
||||||
|
|
||||||
|
|
||||||
//! [33]
|
|
||||||
FORMS3 = my_uic3_dialog.ui \
|
|
||||||
my_uic3_widget.ui \
|
|
||||||
my_uic3_config.ui
|
|
||||||
//! [33]
|
|
||||||
|
|
||||||
|
|
||||||
//! [34]
|
|
||||||
HEADERS = myclass.h \
|
|
||||||
login.h \
|
|
||||||
mainwindow.h
|
|
||||||
//! [34]
|
|
||||||
|
|
||||||
|
|
||||||
//! [35]
|
|
||||||
INCLUDEPATH = c:/msdev/include d:/stl/include
|
|
||||||
//! [35]
|
|
||||||
|
|
||||||
|
|
||||||
//! [36]
|
|
||||||
target.path += $$[QT_INSTALL_PLUGINS]/imageformats
|
|
||||||
INSTALLS += target
|
|
||||||
//! [36]
|
|
||||||
|
|
||||||
|
|
||||||
//! [37]
|
|
||||||
LEXSOURCES = lexer.l
|
|
||||||
//! [37]
|
|
||||||
|
|
||||||
|
|
||||||
//! [38]
|
|
||||||
unix:LIBS += -L/usr/local/lib -lmath
|
|
||||||
win32:LIBS += c:/mylibs/math.lib
|
|
||||||
//! [38]
|
|
||||||
|
|
||||||
|
|
||||||
//! [39]
|
|
||||||
CONFIG += no_lflags_merge
|
|
||||||
//! [39]
|
|
||||||
|
|
||||||
|
|
||||||
//! [40]
|
|
||||||
unix:MOC_DIR = ../myproject/tmp
|
|
||||||
win32:MOC_DIR = c:/myproject/tmp
|
|
||||||
//! [40]
|
|
||||||
|
|
||||||
|
|
||||||
//! [41]
|
|
||||||
unix:OBJECTS_DIR = ../myproject/tmp
|
|
||||||
win32:OBJECTS_DIR = c:/myproject/tmp
|
|
||||||
//! [41]
|
|
||||||
|
|
||||||
|
|
||||||
//! [42]
|
|
||||||
app {
|
|
||||||
# Conditional code for 'app' template here
|
|
||||||
}
|
|
||||||
//! [42]
|
|
||||||
|
|
||||||
|
|
||||||
//! [43]
|
|
||||||
FRAMEWORK_HEADERS.version = Versions
|
|
||||||
FRAMEWORK_HEADERS.files = path/to/header_one.h path/to/header_two.h
|
|
||||||
FRAMEWORK_HEADERS.path = Headers
|
|
||||||
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
|
|
||||||
//! [43]
|
|
||||||
|
|
||||||
|
|
||||||
//! [44]
|
|
||||||
QMAKE_BUNDLE_EXTENSION = .myframework
|
|
||||||
//! [44]
|
|
||||||
|
|
||||||
|
|
||||||
//! [45]
|
|
||||||
QMAKE_RESOURCE_FLAGS += -threshold 0 -compress 9
|
|
||||||
//! [45]
|
|
||||||
|
|
||||||
|
|
||||||
//! [46]
|
|
||||||
QMAKE_UIC = uic -L /path/to/plugin
|
|
||||||
//! [46]
|
|
||||||
|
|
||||||
|
|
||||||
//! [47]
|
|
||||||
QT -= gui # Only the core module is used.
|
|
||||||
//! [47]
|
|
||||||
|
|
||||||
|
|
||||||
//! [48]
|
|
||||||
unix:RCC_DIR = ../myproject/resources
|
|
||||||
win32:RCC_DIR = c:/myproject/resources
|
|
||||||
//! [48]
|
|
||||||
|
|
||||||
|
|
||||||
//! [49]
|
|
||||||
SOURCES = myclass.cpp \
|
|
||||||
login.cpp \
|
|
||||||
mainwindow.cpp
|
|
||||||
//! [49]
|
|
||||||
|
|
||||||
|
|
||||||
//! [50]
|
|
||||||
SUBDIRS = kernel \
|
|
||||||
tools
|
|
||||||
//! [50]
|
|
||||||
|
|
||||||
|
|
||||||
//! [51]
|
|
||||||
CONFIG += ordered
|
|
||||||
//! [51]
|
|
||||||
|
|
||||||
|
|
||||||
//! [52]
|
|
||||||
TEMPLATE = app
|
|
||||||
TARGET = myapp
|
|
||||||
SOURCES = main.cpp
|
|
||||||
//! [52]
|
|
||||||
|
|
||||||
|
|
||||||
//! [53]
|
|
||||||
TEMPLATE = lib
|
|
||||||
SOURCES = main.cpp
|
|
||||||
TARGET = mylib
|
|
||||||
//! [53]
|
|
||||||
|
|
||||||
|
|
||||||
//! [54]
|
|
||||||
unix:UI_DIR = ../myproject/ui
|
|
||||||
win32:UI_DIR = c:/myproject/ui
|
|
||||||
//! [54]
|
|
||||||
|
|
||||||
|
|
||||||
//! [55]
|
|
||||||
unix:UI_HEADERS_DIR = ../myproject/ui/include
|
|
||||||
win32:UI_HEADERS_DIR = c:/myproject/ui/include
|
|
||||||
//! [55]
|
|
||||||
|
|
||||||
|
|
||||||
//! [56]
|
|
||||||
unix:UI_SOURCES_DIR = ../myproject/ui/src
|
|
||||||
win32:UI_SOURCES_DIR = c:/myproject/ui/src
|
|
||||||
//! [56]
|
|
||||||
|
|
||||||
|
|
||||||
//! [57]
|
|
||||||
VERSION = 1.2.3
|
|
||||||
//! [57]
|
|
||||||
|
|
||||||
|
|
||||||
//! [58]
|
|
||||||
YACCSOURCES = moc.y
|
|
||||||
//! [58]
|
|
||||||
|
|
||||||
|
|
||||||
//! [59]
|
|
||||||
FILE = /etc/passwd
|
|
||||||
FILENAME = $$basename(FILE) #passwd
|
|
||||||
//! [59]
|
|
||||||
|
|
||||||
|
|
||||||
//! [60]
|
|
||||||
CONFIG = debug
|
|
||||||
CONFIG += release
|
|
||||||
CONFIG(release, debug|release):message(Release build!) #will print
|
|
||||||
CONFIG(debug, debug|release):message(Debug build!) #no print
|
|
||||||
//! [60]
|
|
||||||
|
|
||||||
|
|
||||||
//! [61]
|
|
||||||
contains( drivers, network ) {
|
|
||||||
# drivers contains 'network'
|
|
||||||
message( "Configuring for network build..." )
|
|
||||||
HEADERS += network.h
|
|
||||||
SOURCES += network.cpp
|
|
||||||
}
|
|
||||||
//! [61]
|
|
||||||
|
|
||||||
|
|
||||||
//! [62]
|
|
||||||
error(An error has occurred in the configuration process.)
|
|
||||||
//! [62]
|
|
||||||
|
|
||||||
|
|
||||||
//! [63]
|
|
||||||
exists( $(QTDIR)/lib/libqt-mt* ) {
|
|
||||||
message( "Configuring for multi-threaded Qt..." )
|
|
||||||
CONFIG += thread
|
|
||||||
}
|
|
||||||
//! [63]
|
|
||||||
|
|
||||||
|
|
||||||
//! [64]
|
|
||||||
MY_VAR = one two three four
|
|
||||||
MY_VAR2 = $$join(MY_VAR, " -L", -L) -Lfive
|
|
||||||
MY_VAR3 = $$member(MY_VAR, 2) $$find(MY_VAR, t.*)
|
|
||||||
//! [64]
|
|
||||||
|
|
||||||
|
|
||||||
//! [65]
|
|
||||||
LIST = 1 2 3
|
|
||||||
for(a, LIST):exists(file.$${a}):message(I see a file.$${a}!)
|
|
||||||
//! [65]
|
|
||||||
|
|
||||||
|
|
||||||
//! [66]
|
|
||||||
include( shared.pri )
|
|
||||||
OPTIONS = standard custom
|
|
||||||
!include( options.pri ) {
|
|
||||||
message( "No custom build options specified" )
|
|
||||||
OPTIONS -= custom
|
|
||||||
}
|
|
||||||
//! [66]
|
|
||||||
|
|
||||||
|
|
||||||
//! [67]
|
|
||||||
isEmpty( CONFIG ) {
|
|
||||||
CONFIG += qt warn_on debug
|
|
||||||
}
|
|
||||||
//! [67]
|
|
||||||
|
|
||||||
|
|
||||||
//! [68]
|
|
||||||
message( "This is a message" )
|
|
||||||
//! [68]
|
|
||||||
|
|
||||||
|
|
||||||
//! [69]
|
|
||||||
!build_pass:message( "This is a message" )
|
|
||||||
//! [69]
|
|
||||||
|
|
||||||
|
|
||||||
//! [70]
|
|
||||||
This is a test.
|
|
||||||
//! [70]
|
|
||||||
|
|
||||||
|
|
||||||
//! [71]
|
|
||||||
system(ls /bin):HAS_BIN=FALSE
|
|
||||||
//! [71]
|
|
||||||
|
|
||||||
|
|
||||||
//! [72]
|
|
||||||
UNAME = $$system(uname -s)
|
|
||||||
contains( UNAME, [lL]inux ):message( This looks like Linux ($$UNAME) to me )
|
|
||||||
//! [72]
|
|
||||||
|
|
||||||
|
|
||||||
//! [73]
|
|
||||||
ARGS = 1 2 3 2 5 1
|
|
||||||
ARGS = $$unique(ARGS) #1 2 3 5
|
|
||||||
//! [73]
|
|
||||||
|
|
||||||
|
|
||||||
//! [74]
|
|
||||||
qmake -set VARIABLE VALUE
|
|
||||||
//! [74]
|
|
||||||
|
|
||||||
|
|
||||||
//! [75]
|
|
||||||
qmake -query VARIABLE
|
|
||||||
qmake -query #queries all current VARIABLE/VALUE pairs..
|
|
||||||
//! [75]
|
|
||||||
|
|
||||||
|
|
||||||
//! [76]
|
|
||||||
qmake -query "1.06a/VARIABLE"
|
|
||||||
//! [76]
|
|
||||||
|
|
||||||
|
|
||||||
//! [77]
|
|
||||||
qmake -query "QT_INSTALL_PREFIX"
|
|
||||||
//! [77]
|
|
||||||
|
|
||||||
|
|
||||||
//! [78]
|
|
||||||
QMAKE_VERS = $$[QMAKE_VERSION]
|
|
||||||
//! [78]
|
|
||||||
|
|
||||||
|
|
||||||
//! [79]
|
|
||||||
documentation.path = /usr/local/program/doc
|
|
||||||
documentation.files = docs/*
|
|
||||||
//! [79]
|
|
||||||
|
|
||||||
|
|
||||||
//! [80]
|
|
||||||
INSTALLS += documentation
|
|
||||||
//! [80]
|
|
||||||
|
|
||||||
|
|
||||||
//! [81]
|
|
||||||
unix:documentation.extra = create_docs; mv master.doc toc.doc
|
|
||||||
//! [81]
|
|
||||||
|
|
||||||
|
|
||||||
//! [82]
|
|
||||||
target.path = /usr/local/myprogram
|
|
||||||
INSTALLS += target
|
|
||||||
//! [82]
|
|
||||||
|
|
||||||
|
|
||||||
//! [83]
|
|
||||||
CONFIG += create_prl
|
|
||||||
//! [83]
|
|
||||||
|
|
||||||
|
|
||||||
//! [84]
|
|
||||||
CONFIG += link_prl
|
|
||||||
//! [84]
|
|
||||||
|
|
||||||
|
|
||||||
//! [85]
|
|
||||||
QMAKE_EXT_MOC = .mymoc
|
|
||||||
//! [85]
|
|
||||||
|
|
||||||
|
|
||||||
//! [86]
|
|
||||||
mytarget.target = .buildfile
|
|
||||||
mytarget.commands = touch $$mytarget.target
|
|
||||||
mytarget.depends = mytarget2
|
|
||||||
|
|
||||||
mytarget2.commands = @echo Building $$mytarget.target
|
|
||||||
//! [86]
|
|
||||||
|
|
||||||
|
|
||||||
//! [87]
|
|
||||||
QMAKE_EXTRA_TARGETS += mytarget mytarget2
|
|
||||||
//! [87]
|
|
||||||
|
|
||||||
|
|
||||||
//! [88]
|
|
||||||
new_moc.output = moc_${QMAKE_FILE_BASE}.cpp
|
|
||||||
new_moc.commands = moc ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
|
|
||||||
new_moc.depend_command = g++ -E -M ${QMAKE_FILE_NAME} | sed "s,^.*: ,,"
|
|
||||||
new_moc.input = NEW_HEADERS
|
|
||||||
QMAKE_EXTRA_COMPILERS += new_moc
|
|
||||||
//! [88]
|
|
||||||
|
|
||||||
|
|
||||||
//! [89]
|
|
||||||
TARGET = myapp
|
|
||||||
//! [89]
|
|
||||||
|
|
||||||
|
|
||||||
//! [90]
|
|
||||||
DEFINES += QT_DLL
|
|
||||||
//! [90]
|
|
||||||
|
|
||||||
|
|
||||||
//! [91]
|
|
||||||
DEFINES -= QT_DLL
|
|
||||||
//! [91]
|
|
||||||
|
|
||||||
|
|
||||||
//! [92]
|
|
||||||
DEFINES *= QT_DLL
|
|
||||||
//! [92]
|
|
||||||
|
|
||||||
|
|
||||||
//! [93]
|
|
||||||
DEFINES ~= s/QT_[DT].+/QT
|
|
||||||
//! [93]
|
|
||||||
|
|
||||||
|
|
||||||
//! [94]
|
|
||||||
EVERYTHING = $$SOURCES $$HEADERS
|
|
||||||
message("The project contains the following files:")
|
|
||||||
message($$EVERYTHING)
|
|
||||||
//! [94]
|
|
||||||
|
|
||||||
|
|
||||||
//! [95]
|
|
||||||
win32:DEFINES += QT_DLL
|
|
||||||
//! [95]
|
|
||||||
|
|
||||||
|
|
||||||
//! [96]
|
|
||||||
win32:xml {
|
|
||||||
message(Building for Windows)
|
|
||||||
SOURCES += xmlhandler_win.cpp
|
|
||||||
} else:xml {
|
|
||||||
SOURCES += xmlhandler.cpp
|
|
||||||
} else {
|
|
||||||
message("Unknown configuration")
|
|
||||||
}
|
|
||||||
//! [96]
|
|
||||||
|
|
||||||
|
|
||||||
//! [97]
|
|
||||||
MY_VARIABLE = value
|
|
||||||
//! [97]
|
|
||||||
|
|
||||||
|
|
||||||
//! [98]
|
|
||||||
MY_DEFINES = $$DEFINES
|
|
||||||
//! [98]
|
|
||||||
|
|
||||||
|
|
||||||
//! [99]
|
|
||||||
MY_DEFINES = $${DEFINES}
|
|
||||||
//! [99]
|
|
||||||
|
|
||||||
|
|
||||||
//! [100]
|
|
||||||
TARGET = myproject_$${TEMPLATE}
|
|
||||||
//! [100]
|
|
||||||
|
|
||||||
|
|
||||||
//! [101]
|
|
||||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
|
||||||
INSTALLS += target
|
|
||||||
//! [101]
|
|
||||||
|
|
||||||
|
|
||||||
//! [102]
|
|
||||||
defineReplace(functionName){
|
|
||||||
#function code
|
|
||||||
}
|
|
||||||
//! [102]
|
|
||||||
|
|
||||||
|
|
||||||
//! [103]
|
|
||||||
CONFIG += myfeatures
|
|
||||||
//! [103]
|
|
||||||
|
|
||||||
|
|
||||||
//! [104]
|
|
||||||
// Add C includes here
|
|
||||||
|
|
||||||
#if defined __cplusplus
|
|
||||||
// Add C++ includes here
|
|
||||||
#include <stdlib>
|
|
||||||
#include <iostream>
|
|
||||||
#include <vector>
|
|
||||||
#include <QApplication> // Qt includes
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QLabel>
|
|
||||||
#include "thirdparty/include/libmain.h"
|
|
||||||
#include "my_stable_class.h"
|
|
||||||
...
|
|
||||||
#endif
|
|
||||||
//! [104]
|
|
||||||
|
|
||||||
|
|
||||||
//! [105]
|
|
||||||
PRECOMPILED_HEADER = stable.h
|
|
||||||
//! [105]
|
|
||||||
|
|
||||||
|
|
||||||
//! [106]
|
|
||||||
precompile_header:!isEmpty(PRECOMPILED_HEADER) {
|
|
||||||
DEFINES += USING_PCH
|
|
||||||
}
|
|
||||||
//! [106]
|
|
||||||
|
|
||||||
|
|
||||||
//! [107]
|
|
||||||
PRECOMPILED_HEADER = window.h
|
|
||||||
SOURCES = window.cpp
|
|
||||||
//! [107]
|
|
||||||
|
|
||||||
|
|
||||||
//! [108]
|
|
||||||
SOURCES += hello.cpp
|
|
||||||
//! [108]
|
|
||||||
|
|
||||||
|
|
||||||
//! [109]
|
|
||||||
SOURCES += hello.cpp
|
|
||||||
SOURCES += main.cpp
|
|
||||||
//! [109]
|
|
||||||
|
|
||||||
|
|
||||||
//! [110]
|
|
||||||
SOURCES = hello.cpp \
|
|
||||||
main.cpp
|
|
||||||
//! [110]
|
|
||||||
|
|
||||||
|
|
||||||
//! [111]
|
|
||||||
HEADERS += hello.h
|
|
||||||
SOURCES += hello.cpp
|
|
||||||
SOURCES += main.cpp
|
|
||||||
//! [111]
|
|
||||||
|
|
||||||
|
|
||||||
//! [112]
|
|
||||||
TARGET = helloworld
|
|
||||||
//! [112]
|
|
||||||
|
|
||||||
|
|
||||||
//! [113]
|
|
||||||
CONFIG += qt
|
|
||||||
HEADERS += hello.h
|
|
||||||
SOURCES += hello.cpp
|
|
||||||
SOURCES += main.cpp
|
|
||||||
//! [113]
|
|
||||||
|
|
||||||
|
|
||||||
//! [114]
|
|
||||||
qmake -o Makefile hello.pro
|
|
||||||
//! [114]
|
|
||||||
|
|
||||||
|
|
||||||
//! [115]
|
|
||||||
qmake -tp vc -o hello.dsp hello.pro
|
|
||||||
//! [115]
|
|
||||||
|
|
||||||
|
|
||||||
//! [116]
|
|
||||||
CONFIG += qt debug
|
|
||||||
HEADERS += hello.h
|
|
||||||
SOURCES += hello.cpp
|
|
||||||
SOURCES += main.cpp
|
|
||||||
//! [116]
|
|
||||||
|
|
||||||
|
|
||||||
//! [117]
|
|
||||||
win32 {
|
|
||||||
SOURCES += hellowin.cpp
|
|
||||||
}
|
|
||||||
//! [117]
|
|
||||||
|
|
||||||
|
|
||||||
//! [118]
|
|
||||||
CONFIG += qt debug
|
|
||||||
HEADERS += hello.h
|
|
||||||
SOURCES += hello.cpp
|
|
||||||
SOURCES += main.cpp
|
|
||||||
win32 {
|
|
||||||
SOURCES += hellowin.cpp
|
|
||||||
}
|
|
||||||
unix {
|
|
||||||
SOURCES += hellounix.cpp
|
|
||||||
}
|
|
||||||
//! [118]
|
|
||||||
|
|
||||||
|
|
||||||
//! [119]
|
|
||||||
!exists( main.cpp ) {
|
|
||||||
error( "No main.cpp file found" )
|
|
||||||
}
|
|
||||||
//! [119]
|
|
||||||
|
|
||||||
|
|
||||||
//! [120]
|
|
||||||
CONFIG += qt debug
|
|
||||||
HEADERS += hello.h
|
|
||||||
SOURCES += hello.cpp
|
|
||||||
SOURCES += main.cpp
|
|
||||||
win32 {
|
|
||||||
SOURCES += hellowin.cpp
|
|
||||||
}
|
|
||||||
unix {
|
|
||||||
SOURCES += hellounix.cpp
|
|
||||||
}
|
|
||||||
!exists( main.cpp ) {
|
|
||||||
error( "No main.cpp file found" )
|
|
||||||
}
|
|
||||||
//! [120]
|
|
||||||
|
|
||||||
|
|
||||||
//! [121]
|
|
||||||
win32 {
|
|
||||||
debug {
|
|
||||||
CONFIG += console
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [121]
|
|
||||||
|
|
||||||
|
|
||||||
//! [122]
|
|
||||||
CONFIG += qt debug
|
|
||||||
HEADERS += hello.h
|
|
||||||
SOURCES += hello.cpp
|
|
||||||
SOURCES += main.cpp
|
|
||||||
win32 {
|
|
||||||
SOURCES += hellowin.cpp
|
|
||||||
}
|
|
||||||
unix {
|
|
||||||
SOURCES += hellounix.cpp
|
|
||||||
}
|
|
||||||
!exists( main.cpp ) {
|
|
||||||
error( "No main.cpp file found" )
|
|
||||||
}
|
|
||||||
win32:debug {
|
|
||||||
CONFIG += console
|
|
||||||
}
|
|
||||||
//! [122]
|
|
||||||
|
|
||||||
|
|
||||||
//! [123]
|
|
||||||
TEMPLATE = app
|
|
||||||
DESTDIR = c:/helloapp
|
|
||||||
HEADERS += hello.h
|
|
||||||
SOURCES += hello.cpp
|
|
||||||
SOURCES += main.cpp
|
|
||||||
DEFINES += QT_DLL
|
|
||||||
CONFIG += qt warn_on release
|
|
||||||
//! [123]
|
|
||||||
|
|
||||||
|
|
||||||
//! [124]
|
|
||||||
make all
|
|
||||||
//! [124]
|
|
||||||
|
|
||||||
|
|
||||||
//! [125]
|
|
||||||
make
|
|
||||||
//! [125]
|
|
||||||
|
|
||||||
|
|
||||||
//! [126]
|
|
||||||
make install
|
|
||||||
//! [126]
|
|
||||||
|
|
||||||
|
|
||||||
//! [127]
|
|
||||||
CONFIG(debug, debug|release) {
|
|
||||||
mac: TARGET = $$join(TARGET,,,_debug)
|
|
||||||
win32: TARGET = $$join(TARGET,,d)
|
|
||||||
}
|
|
||||||
//! [127]
|
|
||||||
|
|
||||||
//! [128]
|
|
||||||
DEPLOYMENT_PLUGIN += qjpeg
|
|
||||||
//! [128]
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QObject::connect: Cannot queue arguments of type 'MyType'
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
enum CustomEventPriority
|
|
||||||
{
|
|
||||||
// An important event
|
|
||||||
ImportantEventPriority = Qt::HighEventPriority,
|
|
||||||
|
|
||||||
// A more important event
|
|
||||||
MoreImportantEventPriority = ImportantEventPriority + 1,
|
|
||||||
|
|
||||||
// A critical event
|
|
||||||
CriticalEventPriority = 100 * MoreImportantEventPriority,
|
|
||||||
|
|
||||||
// Not that important
|
|
||||||
StatusEventPriority = Qt::LowEventPriority,
|
|
||||||
|
|
||||||
// These are less important than Status events
|
|
||||||
IdleProcessingDoneEventPriority = StatusEventPriority - 1
|
|
||||||
};
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QPair<QString, double> pair;
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
pair.first = "pi";
|
|
||||||
pair.second = 3.14159265358979323846;
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QList<QPair<int, double> > list;
|
|
||||||
list.append(qMakePair(66, 3.14159));
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
//! [0]
|
|
||||||
namespace Foo
|
|
||||||
{
|
|
||||||
struct MyInterface { ... };
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_DECLARE_INTERFACE(Foo::MyInterface, "org.examples.MyInterface")
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Q_EXPORT_PLUGIN2(pnp_extrafilters, ExtraFiltersPlugin)
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
Q_IMPORT_PLUGIN(qjpeg)
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
TEMPLATE = app
|
|
||||||
QTPLUGIN += qjpeg qgif qmng # image formats
|
|
||||||
//! [3]
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QSet<QString> set;
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
set.insert("one");
|
|
||||||
set.insert("three");
|
|
||||||
set.insert("seven");
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
set << "twelve" << "fifteen" << "nineteen";
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
if (!set.contains("ninety-nine"))
|
|
||||||
...
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QSetIterator<QWidget *> i(set);
|
|
||||||
while (i.hasNext())
|
|
||||||
qDebug() << i.next();
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QSet<QWidget *>::const_iterator i = set.constBegin();
|
|
||||||
while (i != set.constEnd()) {
|
|
||||||
qDebug() << *i;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
QSet<QString> set;
|
|
||||||
...
|
|
||||||
foreach (QString value, set)
|
|
||||||
qDebug() << value;
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
QSet<QString> set;
|
|
||||||
set.reserve(20000);
|
|
||||||
for (int i = 0; i < 20000; ++i)
|
|
||||||
set.insert(values[i]);
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QSet<QString> set;
|
|
||||||
set << "January" << "February" << ... << "December";
|
|
||||||
|
|
||||||
QSet<QString>::iterator i;
|
|
||||||
for (i = set.begin(); i != set.end(); ++i)
|
|
||||||
qDebug() << *i;
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QSet<QString> set;
|
|
||||||
set << "January" << "February" << ... << "December";
|
|
||||||
|
|
||||||
QSet<QString>::iterator i = set.begin();
|
|
||||||
while (i != set.end()) {
|
|
||||||
if ((*i).startsWith('J')) {
|
|
||||||
i = set.erase(i);
|
|
||||||
} else {
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
QSet<QString> set;
|
|
||||||
...
|
|
||||||
QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette");
|
|
||||||
if (it != set.end())
|
|
||||||
cout << "Found Jeanette" << endl;
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
QSet<QString> set;
|
|
||||||
set << "January" << "February" << ... << "December";
|
|
||||||
|
|
||||||
QSet<QString>::const_iterator i;
|
|
||||||
for (i = set.begin(); i != set.end(); ++i)
|
|
||||||
qDebug() << *i;
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
QSet<QString> set;
|
|
||||||
...
|
|
||||||
QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette");
|
|
||||||
if (it != set.constEnd())
|
|
||||||
cout << "Found Jeanette" << endl;
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
QSet<QString> set;
|
|
||||||
set << "red" << "green" << "blue" << ... << "black";
|
|
||||||
|
|
||||||
QList<QString> list = set.toList();
|
|
||||||
qSort(list);
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
QStringList list;
|
|
||||||
list << "Julia" << "Mike" << "Mike" << "Julia" << "Julia";
|
|
||||||
|
|
||||||
QSet<QString> set = QSet<QString>::fromList(list);
|
|
||||||
set.contains("Julia"); // returns true
|
|
||||||
set.contains("Mike"); // returns true
|
|
||||||
set.size(); // returns 2
|
|
||||||
//! [14]
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QCheckBox *box = ...;
|
|
||||||
QSignalSpy spy(box, SIGNAL(clicked(bool)));
|
|
||||||
|
|
||||||
// do something that triggers the signal
|
|
||||||
box->animateClick();
|
|
||||||
|
|
||||||
QCOMPARE(spy.count(), 1); // make sure the signal was emitted exactly one time
|
|
||||||
QList<QVariant> arguments = spy.takeFirst(); // take the first signal
|
|
||||||
|
|
||||||
QVERIFY(arguments.at(0).toBool() == true); // verify the first argument
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QSignalSpy spy(myCustomObject, SIGNAL(mySignal(int, QString, double)));
|
|
||||||
|
|
||||||
myCustomObject->doSomething(); // trigger emission of the signal
|
|
||||||
|
|
||||||
QList<QVariant> arguments = spy.takeFirst();
|
|
||||||
QVERIFY(arguments.at(0).type() == QVariant::Int);
|
|
||||||
QVERIFY(arguments.at(1).type() == QVariant::QString);
|
|
||||||
QVERIFY(arguments.at(2).type() == QVariant::double);
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
qRegisterMetaType<QModelIndex>("QModelIndex");
|
|
||||||
QSignalSpy spy(&model, SIGNAL(whatever(QModelIndex)));
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
// get the first argument from the first received signal:
|
|
||||||
QModelIndex result = qvariant_cast<QModelIndex>(spy.at(0).at(0));
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QSignalSpy spy(myPushButton, SIGNAL(clicked(bool)));
|
|
||||||
//! [4]
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
//! [0]
|
|
||||||
[Paths]
|
|
||||||
Prefix = /some/path
|
|
||||||
Translations = i18n
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Paths
|
|
||||||
Paths/4
|
|
||||||
Paths/4.1
|
|
||||||
Paths/4.2.5
|
|
||||||
Paths/6
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
//! [0]
|
|
||||||
$QPEDIR/qtopiacore/qt/configure -help
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
./configure -help
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
./configure -extra-qt-embedded-config "-qt-gfx-transformed"
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
./configure -qt-gfx-transformed
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
export QWS_DISPLAY="<driver>[:<driver specific options>]...
|
|
||||||
[:<display num>]"
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
myApplication -display "<driver>[:<driver specific options>]...
|
|
||||||
[:<display num>]"
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
export QWS_DISPLAY="<driver>[:<subdriver>][:<subdriver options>]...
|
|
||||||
[ :<display num>]"
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
export QWS_DISPLAY="Multi: QVFb:0 QVFb:offset=640,0:1 :2"
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
export QWS_DISPLAY="VNC:size=720x480:depth=32"
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
export QWS_DISPLAY="VNC:LinuxFb"
|
|
||||||
//! [9]
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
//! [0]
|
|
||||||
#include <Qt3Support>
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QT += qt3support
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
//! [0]
|
|
||||||
qt3to4 myfile.cpp
|
|
||||||
qt3to4 myapp.pro
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
<Rules>
|
|
||||||
<Include>/path/to/q3porting.xml</Include>
|
|
||||||
|
|
||||||
<item Type="RenamedHeader" Disable="True" >
|
|
||||||
<Qt4>q3sqlselectcursor.h</Qt4>
|
|
||||||
<Qt3>qsqlselectcursor.h</Qt3>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
<item Type="RenamedHeader" >
|
|
||||||
<Qt4>newclass.h</Qt4>
|
|
||||||
<Qt3>oldclass.h</Qt3>
|
|
||||||
</item>
|
|
||||||
</Rules>
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
using namespace Qt;
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
//! [environment]
|
|
||||||
export QT_ACCESSIBILITY=1
|
|
||||||
//! [environment]
|
|
||||||
|
|
||||||
//! [0]
|
|
||||||
class MyWidgetInterface : public QAccessibleWidget
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
MyWidgetInterface(QWidget *widget, Role role);
|
|
||||||
|
|
||||||
QString text(Text text, int child) const;
|
|
||||||
State state(int child) const;
|
|
||||||
QString actionText(int action, Text text, int child) const;
|
|
||||||
bool doAction(int action, int child, const QVariantList ¶ms);
|
|
||||||
...
|
|
||||||
};
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
bool MyWidgetInterface::doAction(int action, int child,
|
|
||||||
const QVariantList ¶ms)
|
|
||||||
{
|
|
||||||
if (child || !widget()->isEnabled())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
switch (action) {
|
|
||||||
case DefaultAction:
|
|
||||||
case Press:
|
|
||||||
{
|
|
||||||
MyWidget *widget = qobject_cast<MyWidget *>(object());
|
|
||||||
if (widget)
|
|
||||||
widget->click();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return QAccessibleWidget::doAction(action, child, params);
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QStringList MyFactory::keys() const
|
|
||||||
{
|
|
||||||
return QStringList() << "MyWidget" << "MyOtherWidget";
|
|
||||||
}
|
|
||||||
|
|
||||||
QAccessibleInterface *MyFactory::create(const QString &className,
|
|
||||||
QObject *object)
|
|
||||||
{
|
|
||||||
if (classname == "MyWidget")
|
|
||||||
return new MyWidgetInterface(object);
|
|
||||||
if (classname == "MyOtherWidget")
|
|
||||||
return new MyOtherWidgetInterface(object);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(myfactory, MyFactory)
|
|
||||||
//! [2]
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QLinearGradient gradient(0, 0, 100, 100);
|
|
||||||
gradient.setColorAt(0, Qt::red);
|
|
||||||
gradient.setColorAt(0.5, Qt::green);
|
|
||||||
gradient.setColorAt(1, Qt::blue);
|
|
||||||
painter.setBrush(gradient);
|
|
||||||
painter.drawRect(0, 0, 100, 100);
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QRadialGradient gradient(50, 50, 50, 30, 30);
|
|
||||||
gradient.setColorAt(0.2, Qt::white);
|
|
||||||
gradient.setColorAt(0.8, Qt::green);
|
|
||||||
gradient.setColorAt(1, Qt::black);
|
|
||||||
painter.setBrush(gradient);
|
|
||||||
painter.drawEllipse(0, 0, 100, 100);
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
QConicalGradient gradient(60, 40, 0);
|
|
||||||
gradient.setColorAt(0, Qt::black);
|
|
||||||
gradient.setColorAt(0.4, Qt::green);
|
|
||||||
gradient.setColorAt(0.6, Qt::white);
|
|
||||||
gradient.setColorAt(1, Qt::black);
|
|
||||||
painter.setBrush(gradient);
|
|
||||||
painter.drawEllipse(0, 0, 100, 100);
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
// Specfiy semi-transparent red
|
|
||||||
painter.setBrush(QColor(255, 0, 0, 127));
|
|
||||||
painter.drawRect(0, 0, width()/2, height());
|
|
||||||
|
|
||||||
// Specify semi-transparend blue
|
|
||||||
painter.setBrush(QColor(0, 0, 255, 127));
|
|
||||||
painter.drawRect(0, 0, width(), height()/2);
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
// One line without anti-aliasing
|
|
||||||
painter.drawLine(0, 0, width()/2, height());
|
|
||||||
|
|
||||||
// One line with anti-aliasing
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
|
||||||
painter.drawLine(width()/2, 0, width()/2, height());
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QPainterPath path;
|
|
||||||
path.addRect(20, 20, 60, 60);
|
|
||||||
path.addBezier(0, 0, 99, 0, 50, 50, 99, 99);
|
|
||||||
path.addBezier(99, 99, 0, 99, 50, 50, 0, 0);
|
|
||||||
painter.drawPath(path);
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
QPixmap buffer(size());
|
|
||||||
QPainter painter(&buffer);
|
|
||||||
|
|
||||||
// Paint code here
|
|
||||||
|
|
||||||
painter.end();
|
|
||||||
bitBlt(this, 0, 0, &buffer);
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
QPainter painter(this);
|
|
||||||
|
|
||||||
// Paint code here
|
|
||||||
|
|
||||||
painter.end();
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
unbufferedWidget->setAttribute(Qt::WA_PaintOnScreen);
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QLinearGradient gradient(0, 0, 100, 100);
|
|
||||||
gradient.setColorAt(0, Qt::blue);
|
|
||||||
gradient.setColorAt(1, Qt::red);
|
|
||||||
painter.setPen(QPen(gradient, 0));
|
|
||||||
for (int y=fontSize; y<100; y+=fontSize)
|
|
||||||
drawText(0, y, text);
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
QImage image(100, 100, 32);
|
|
||||||
QPainter painter(&image);
|
|
||||||
|
|
||||||
// painter commands.
|
|
||||||
|
|
||||||
painter.end();
|
|
||||||
//! [10]
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QT -= gui
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QT += network opengl sql qt3support
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
CONFIG += uic3
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
#include <QClassName>
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
#include <QString>
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QSqlTableModel>
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
#include <qclassname.h>
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
#include <QtCore>
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
using namespace Qt;
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QLabel *label1 = new QLabel("Hello", this);
|
|
||||||
QLabel *label2 = new QLabel(this, "Hello");
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
MyWidget::MyWidget(QWidget *parent, const char *name)
|
|
||||||
: QWidget(parent, name)
|
|
||||||
{
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [9]
|
|
||||||
|
|
||||||
|
|
||||||
//! [10]
|
|
||||||
// DEPRECATED
|
|
||||||
if (obj->inherits("QPushButton")) {
|
|
||||||
QPushButton *pushButton = (QPushButton *)obj;
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [10]
|
|
||||||
|
|
||||||
|
|
||||||
//! [11]
|
|
||||||
QPushButton *pushButton = qobject_cast<QPushButton *>(obj);
|
|
||||||
if (pushButton) {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [11]
|
|
||||||
|
|
||||||
|
|
||||||
//! [12]
|
|
||||||
QLabel *label = new QLabel;
|
|
||||||
QPointer<QLabel> safeLabel = label;
|
|
||||||
safeLabel->setText("Hello world!");
|
|
||||||
delete label;
|
|
||||||
// safeLabel is now 0, whereas label is a dangling pointer
|
|
||||||
//! [12]
|
|
||||||
|
|
||||||
|
|
||||||
//! [13]
|
|
||||||
QT += qt3support
|
|
||||||
//! [13]
|
|
||||||
|
|
||||||
|
|
||||||
//! [14]
|
|
||||||
DEFINES += QT3_SUPPORT
|
|
||||||
//! [14]
|
|
||||||
|
|
||||||
|
|
||||||
//! [15]
|
|
||||||
DEFINES += QT3_SUPPORT_WARNINGS
|
|
||||||
//! [15]
|
|
||||||
|
|
||||||
|
|
||||||
//! [16]
|
|
||||||
DEFINES += QT3_SUPPORT
|
|
||||||
//! [16]
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
//! [0]
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
|
||||||
: QMainWindow(parent)
|
|
||||||
{
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
fileToolbar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
|
|
||||||
addToolBar(Qt::TopToolBarArea, fileToolbar);
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
|
|
||||||
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
|
||||||
setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
|
|
||||||
setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
QWidget *centralWidget = new QWidget(this);
|
|
||||||
setCentralWidget(centralWidget);
|
|
||||||
//! [3]
|
|
||||||
|
|
||||||
|
|
||||||
//! [4]
|
|
||||||
QPopupMenu *fileMenu = new QPopupMenu(this);
|
|
||||||
openAction->addTo(fileMenu);
|
|
||||||
saveAction->addTo(fileMenu);
|
|
||||||
...
|
|
||||||
menuBar()->insertItem(tr("&File"), fileMenu);
|
|
||||||
//! [4]
|
|
||||||
|
|
||||||
|
|
||||||
//! [5]
|
|
||||||
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
|
|
||||||
fileMenu->addAction(openAction);
|
|
||||||
fileMenu->addAction(saveAction);
|
|
||||||
...
|
|
||||||
//! [5]
|
|
||||||
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
QToolBar *fileTools = new QToolBar(this, "file toolbar");
|
|
||||||
openAction->addTo(fileTools);
|
|
||||||
saveAction->addTo(fileTools);
|
|
||||||
...
|
|
||||||
//! [6]
|
|
||||||
|
|
||||||
|
|
||||||
//! [7]
|
|
||||||
QToolBar *fileTools = addToolBar(tr("File Tool Bar"));
|
|
||||||
fileTools->addAction(openAction);
|
|
||||||
fileTools->addAction(saveAction);
|
|
||||||
...
|
|
||||||
//! [7]
|
|
||||||
|
|
||||||
|
|
||||||
//! [8]
|
|
||||||
QDockWidget *dockWidget = new QDockWidget(this);
|
|
||||||
mainWin->moveDockWidget(dockWidget, Qt::DockLeft);
|
|
||||||
//! [8]
|
|
||||||
|
|
||||||
|
|
||||||
//! [9]
|
|
||||||
QDockWidget *dockWidget = new QDockWidget(mainWindow);
|
|
||||||
mainWindow->addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
|
|
||||||
//! [9]
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
//! [0]
|
|
||||||
QSqlQueryModel model;
|
|
||||||
model.setQuery("select * from person");
|
|
||||||
|
|
||||||
QTableView view;
|
|
||||||
view.setModel(&model);
|
|
||||||
view.show();
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
QSqlTableModel model;
|
|
||||||
model.setTable("person");
|
|
||||||
model.select();
|
|
||||||
|
|
||||||
QTableView view;
|
|
||||||
view.setModel(&model);
|
|
||||||
view.show();
|
|
||||||
//! [1]
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
//! [0]
|
|
||||||
const QStyleOptionFocusRect *focusRectOption =
|
|
||||||
qstyleoption_cast<const QStyleOptionFocusRect *>(option);
|
|
||||||
if (focusRectOption) {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
void MyWidget::paintEvent(QPaintEvent *event)
|
|
||||||
{
|
|
||||||
QPainter painter(this);
|
|
||||||
...
|
|
||||||
|
|
||||||
QStyleOptionFocusRect option(1);
|
|
||||||
option.init(this);
|
|
||||||
option.backgroundColor = palette().color(QPalette::Window);
|
|
||||||
|
|
||||||
style().drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter,
|
|
||||||
this);
|
|
||||||
}
|
|
||||||
//! [1]
|
|
||||||
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
void drawControl(ControlElement element,
|
|
||||||
QPainter *painter,
|
|
||||||
const QWidget *widget,
|
|
||||||
const QRect &rect,
|
|
||||||
const QColorGroup &colorGroup,
|
|
||||||
SFlags how = Style_Default,
|
|
||||||
const QStyleOption &option = QStyleOption::Default) const;
|
|
||||||
//! [2]
|
|
||||||
|
|
||||||
|
|
||||||
//! [3]
|
|
||||||
void drawControl(ControlElement element,
|
|
||||||
const QStyleOption *option,
|
|
||||||
QPainter *painter,
|
|
||||||
const QWidget *widget = 0) const;
|
|
||||||
//! [3]
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue