|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
#######
#
# E-scripts on Qt
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
# (find-eev-quick-intro)
# http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/qt.e>
# or at <http://angg.twu.net/e/qt.e.html>.
# See also <http://angg.twu.net/emacs.html>,
# <http://angg.twu.net/.emacs[.html]>,
# <http://angg.twu.net/.zshrc[.html]>,
# <http://angg.twu.net/escripts.html>,
# and <http://angg.twu.net/>.
#
#######
# «.qt-debs» (to "qt-debs")
# «.qt4-x11-deb-src» (to "qt4-x11-deb-src")
# «.tutorial» (to "tutorial")
# «.qwt» (to "qwt")
# «.qtprogramming» (to "qtprogramming")
# «.qpainter0» (to "qpainter0")
# «.QPainter» (to "QPainter")
#####
#
# Qt from the debs
# 2007dec28
#
#####
# «qt-debs» (to ".qt-debs")
# (find-zsh "installeddebs | sort" "qt")
# (find-zsh "installeddebs | sort | grep qt")
# (find-zsh "availabledebs | sort" "qt")
# (find-zsh "availabledebs | sort | grep qt")
# (find-status "libqt4-ruby")
# (find-vldifile "libqt4-ruby.list")
# (find-udfile "libqt4-ruby/")
# (find-status "libqt4-ruby1.8")
# (find-vldifile "libqt4-ruby1.8.list")
# (find-udfile "libqt4-ruby1.8/")
# (find-zsh0 "installeddebs | sort | grep qt")
Docs:
# http://doc.trolltech.com/4.3/metaobjects.html
# http://doc.trolltech.com/4.2/metaobjects.html
# http://doc.trolltech.com/3.3/
# http://zumbi/doc/qt335/
# http://zumbi/doc/qt335/tools.html
# (find-status "qt4-doc")
# (find-vldifile "qt4-doc.list")
# (find-udfile "qt4-doc/")
# (code-c-d "qt4doc" "/usr/share/qt4/doc/html/")
# (find-qt4docfile "")
# (find-qt4docw3m "index.html")
# (find-qt4docw3m "how-to-learn-qt.html")
# (find-qt4docw3m "tutorial.html")
# (find-qt4docw3m "tutorial-t1.html")
# (find-qt4docw3m "qmake-manual.html")
# (find-qt4docw3m "moc.html")
IPC:
# (find-qt4docw3m "intro-to-dbus.html")
# (find-qt4docfile "" "qtopiacore-")
google: site:doc.trolltech.com/3.3 IPC
google: site:doc.trolltech.com/3.3 interprocess
http://doc.trolltech.com/qtopia4.2/ipc.html
# Classes importantes:
# (find-qt4docfile "")
# (find-qt4docw3m "qstring.html")
# (find-qt4docw3m "qbytearray.html")
# (find-qt4docw3m "qtextstream.html")
# Talvez gerais demais:
# (find-qt4docw3m "qobject.html")
# (find-qt4docw3m "qwidget.html")
# Non-gui:
# (find-qt4docw3m "tools.html")
#####
#
# qt4-x11 (from the debian sources)
# 2008jan08
#
#####
# «qt4-x11-deb-src» (to ".qt4-x11-deb-src")
# http://ftp.de.debian.org/debian/pool/main/q/qt4-x11/
psne http://ftp.de.debian.org/debian/pool/main/q/qt4-x11/qt4-x11_4.2.1-2+etch1.dsc
psne http://ftp.de.debian.org/debian/pool/main/q/qt4-x11/qt4-x11_4.2.1-2+etch1.diff.gz
psne http://ftp.de.debian.org/debian/pool/main/q/qt4-x11/qt4-x11_4.2.1.orig.tar.gz
#*
rm -Rv ~/bigsrc/qt4-x11/
mkdir ~/bigsrc/qt4-x11/
cd $S/http/ftp.de.debian.org/debian/pool/main/q/qt4-x11/
cp -v qt4-x11_4.2.1* ~/bigsrc/qt4-x11/
cd ~/bigsrc/qt4-x11/
dpkg-source -sn -x qt4-x11_4.2.1-2+etch1.dsc
cd ~/bigsrc/qt4-x11/qt4-x11-4.2.1/
# dpkg-buildpackage -us -uc -b -rfakeroot |& tee odb
cd ~/bigsrc/qt4-x11/qt4-x11-4.2.1/
find * -type f | sort > .files
#*
# (find-fline "~/bigsrc/qt4-x11/")
* (eepitch-shell)
cd ~/bigsrc/qt4-x11/
sudo dpkg -i *.deb
#*
# (code-c-d "qt4x11" "~/bigsrc/qt4-x11/qt4-x11-4.2.1/")
# (find-qt4x11file "")
# (find-qt4x11file ".files")
# (find-qt4x11file "README" "'qtdemo'")
# (find-qt4x11file "examples/")
# (find-qt4x11file "examples/tutorial/")
# (find-qt4x11file "examples/tutorial/README")
# (find-qt4x11file "examples/tutorial/t1/")
# (find-qt4x11file "examples/tutorial/t1/main.cpp")
# (find-qt4x11file "examples/tutorial/t1/main.cpp")
# (find-qt4x11w3m "doc/html/tutorial.html")
#*
# «tutorial» (to ".tutorial")
rm -Rv /tmp/qtdemos/
mkdir /tmp/qtdemos/
cd /tmp/qtdemos/
cd ~/bigsrc/qt4-x11/qt4-x11-4.2.1/examples/tutorial/
cp -Rv * /tmp/qtdemos/
cd /tmp/qtdemos/
#*
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/tmp/qtdemos/")
# (find-fline "/tmp/qtdemos/t1/")
cd /tmp/qtdemos/
cd /tmp/qtdemos/t1/
qmake-qt4 -project
qmake-qt4 t1.pro
make CXX="gcc -g" |& tee om
for i in t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14; do
cd /tmp/qtdemos/$i
qmake-qt4 -project
qmake-qt4 $i.pro
make CXX="gcc -g" |& tee om
done
cd /tmp/qtdemos/
#*
# (find-fline "/tmp/qtdemos/")
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/qtdemos/
t10/t10
t14/t14
#####
#
# pmake
# 2007dec20
#
#####
# todo: move to make.e
# (find-status "pmake")
# (find-vldifile "pmake.list")
# (find-udfile "pmake/")
# (find-man "pmake")
#####
#
# qwt
# 2007dec28
#
#####
# «qwt» (to ".qwt")
# (find-dmissing "qwt")
# (find-zsh "availabledebs | sort | grep qwt")
apti libqwt-dev libqwt-doc libqwt4c2
# (find-status "libqwt-dev")
# (find-vldifile "libqwt-dev.list")
# (find-udfile "libqwt-dev/")
# (find-status "libqwt-doc")
# (find-vldifile "libqwt-doc.list")
# (find-udfile "libqwt-doc/")
# (find-status "libqwt4c2")
# (find-vldifile "libqwt4c2.list")
# (find-udfile "libqwt4c2/")
# (code-c-d "qwtdoc" "/usr/share/doc/libqwt-doc/html/")
# (find-qwtdocfile "")
# (find-qwtdocw3m "index.html")
#####
#
# C++ GUI Programming with Qt (book)
# 2006sep23
#
#####
# «qtprogramming» (to ".qtprogramming")
# (find-es "ssh" "snailbook")
# http://www.flazx.com/
# (find-status "libchm-bin")
# (find-vldifile "libchm-bin.list")
# (find-udfile "libchm-bin/")
#*
mkdir /tmp/qtprogramming/
cd /tmp/
extract_chmLib \
~/books/Prentice.Hall.PTR.C.plus.plus.GUI.Programming.with.Qt.4.Jun.2006.chm \
/tmp/qtprogramming/
#*
# (find-fline "/tmp/")
# (find-fline "/tmp/qtprogramming/0131872494/")
# (code-c-d "qtprogramming" "/tmp/qtprogramming/0131872494/")
# (find-qtprogrammingfile "")
# (find-qtprogrammingw3m "toc.html")
# (find-qtprogrammingw3m "ch01lev1sec1.html")
#*
rm -Rv /tmp/qtdemo/
mkdir /tmp/qtdemo/
cd /tmp/qtdemo/
cat > hello.cpp <<'%%%'
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
%%%
qmake-qt4 -project
qmake-qt4 qtdemo.pro
make CXX="gcc -g" |& tee om
#*
# (find-fline "/tmp/qtdemo/")
#*
(defun eepitch-qtdemo-gdb ()
(eepitch-gdb "*gud-qtdemo*" "gdb --annotate=3 /tmp/qtdemo/qtdemo"))
(defun eepitch-qtdemo-gdb-kill ()
(eepitch-gdb-kill "*gud-qtdemo*"))
* (eepitch-qtdemo-gdb)
* (eepitch-qtdemo-gdb-kill)
* (eepitch-qtdemo-gdb)
br main
run
#####
#
# qpainter0
# 2008feb07
#
#####
# «qpainter0» (to ".qpainter0")
# (find-qtdemo-links "qtpainter")
# (find-fline "/tmp/qtdemos/t8/")
# (find-fline "/tmp/qtdemos/t8/cannonfield.h")
# (find-fline "/tmp/qtdemos/t8/cannonfield.cpp")
# (find-fline "/tmp/qtdemos/t8/main.cpp")
#*
rm -Rv /tmp/qpainter0/
mkdir /tmp/qpainter0/
cd /tmp/qpainter0/
cat > qpainter0.pro <<'%%%'
TEMPLATE = app
CONFIG += qt warn_on
HEADERS =
SOURCES = main.cpp
TARGET = qpainter0
QTDIR_build:REQUIRES="contains(QT_CONFIG, small-config)"
%%%
cat > main.cpp <<'%%%'
#include <QApplication>
#include <QPushButton>
#include <QPainter>
#include <QGridLayout>
class CannonField : public QWidget {
Q_OBJECT
public:
CannonField(QWidget *parent = 0) {};
protected:
void paintEvent(QPaintEvent *event);
};
void CannonField::paintEvent(QPaintEvent * /* event */) {
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(QPen(Qt::black, 12, Qt::DashDotLine, Qt::RoundCap));
painter.setBrush(QBrush(Qt::green, Qt::SolidPattern));
painter.drawEllipse(80, 80, 400, 240);
painter.drawText(200, 200, tr("Foo = ") + "bar");
}
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
CannonField cannonfield;
cannonfield.show();
return app.exec();
}
#include "main.moc"
%%%
qmake-qt4 -project
qmake-qt4 qpainter0.pro
make CXX="gcc -g" |& tee om
./qpainter0
#*
#####
#
# qpainter1
# 2008feb07
#
#####
# «qpainter1» (to ".qpainter1")
# (find-qtdemo-links "qtpainter")
# (find-fline "/tmp/qtdemos/t8/")
# (find-fline "/tmp/qtdemos/t8/cannonfield.h")
# (find-fline "/tmp/qtdemos/t8/cannonfield.cpp")
# (find-fline "/tmp/qtdemos/t8/main.cpp")
#*
rm -Rv /tmp/qpainter1/
mkdir /tmp/qpainter1/
cd /tmp/qpainter1/
cat > qpainter1.pro <<'%%%'
TEMPLATE = app
CONFIG += qt warn_on
HEADERS =
SOURCES = main.cpp
TARGET = qpainter1
QTDIR_build:REQUIRES="contains(QT_CONFIG, small-config)"
%%%
cat > main.cpp <<'%%%'
#include <QApplication>
#include <QPushButton>
#include <QPainter>
#include <QGridLayout>
// QPainter * painter;
class CannonField : public QWidget {
Q_OBJECT
private:
QPainter painter;
public:
CannonField(QWidget *parent = 0) : painter(this) {};
// drawEllipse(int a, int b, int c, int d)
protected:
void paintEvent(QPaintEvent *event);
};
void CannonField::paintEvent(QPaintEvent * /* event */) {
// QPainter painter(this);
// painter = new QPainter(this);
// painter = new QPainter(this);
// QPainter painter(this);
// painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(QPen(Qt::black, 12, Qt::DashDotLine, Qt::RoundCap));
painter.setBrush(QBrush(Qt::green, Qt::SolidPattern));
painter.drawEllipse(80, 80, 400, 240);
painter.drawText(200, 200, QString("Foo = bar"));
}
// void CannonField::drawEllipse(int a, int b, int c, int d) {
// painter.drawEllipse(80, 80, 400, 240);
// }
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
CannonField cannonfield;
cannonfield.show();
return app.exec();
}
#include "main.moc"
%%%
qmake-qt4 -project
qmake-qt4 qpainter1.pro
make CXX="gcc -g" |& tee om
./qpainter1
#*
#####
#
# painter
# 2008feb07
#
#####
# «QPainter» (to ".QPainter")
# (find-qtdemo-links "qtpainter")
# (find-qt4docw3m "qpainter.html")
# (find-qt4docw3m "layouts-basiclayouts.html")
# (find-qtprogrammingw3m "ch08lev1sec1.html")
# (find-qtprogrammingw3m "ch08lev1sec1.html" "draw the ellipse")
# (find-qtprogrammingw3m "toc.html")
# (find-qt4docw3m "qpaintdevice.html")
# (find-es "qt" "tutorial")
# (find-fline "/tmp/qtdemos/")
# (find-fline "/tmp/qtdemos/t1/")
# (find-fline "/tmp/qtdemos/t8/main.cpp")
# (find-fline "/tmp/qtdemos/t8/cannonfield.cpp")
# (find-qt4x11file "examples/tutorial/")
# (find-qt4x11file "examples/tutorial/t8/")
#*
rm -Rv /tmp/qtpainter/
mkdir /tmp/qtpainter/
cd /tmp/qtpainter/
cat > qtpainter.pro <<'%%%'
TEMPLATE = app
CONFIG += qt warn_on
HEADERS =
SOURCES = main.cpp
TARGET = qtpainter
QTDIR_build:REQUIRES="contains(QT_CONFIG, small-config)"
%%%
cat > main.cpp <<'%%%'
#include <QApplication>
#include <QPushButton>
#include <QPainter>
#include <QGridLayout>
// (find-fline "/tmp/qtdemos/t8/")
// (find-fline "/tmp/qtdemos/t8/cannonfield.h")
// (find-fline "/tmp/qtdemos/t8/cannonfield.cpp")
// (find-fline "/tmp/qtdemos/t8/main.cpp")
QPainter *painter;
class CannonField : public QWidget {
Q_OBJECT
public:
CannonField(QWidget *parent = 0) {};
protected:
void paintEvent(QPaintEvent *event);
};
void CannonField::paintEvent(QPaintEvent * /* event */) {
QPainter painter(this);
painter = new QPainter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(QPen(Qt::black, 12, Qt::DashDotLine, Qt::RoundCap));
painter.setBrush(QBrush(Qt::green, Qt::SolidPattern));
painter.drawEllipse(80, 80, 400, 240);
painter.drawText(200, 200, tr("Angle = ") + "foo");
}
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
CannonField cannonfield;
cannonfield.show();
return app.exec();
}
#include "main.moc"
%%%
qmake-qt4 -project
qmake-qt4 qtpainter.pro
make CXX="gcc -g" |& tee om
./qtpainter
#*
// QGridLayout *gridLayout = new QGridLayout;
// gridLayout->addWidget(painter, 0, 0);
// setLayout(gridLayout);
// MyWidget widget;
// widget.setGeometry(100, 100, 500, 355);
// widget.show();
# (find-fline "/tmp/qtdemos/t8/main.cpp")
MyWidget widget;
widget.setGeometry(100, 100, 500, 355);
widget.show();
return app.exec();
// void MyWidget::paintEvent(QPaintEvent *event)
// {
// QPainter painter(this);
// /* ... */
// }
# (find-qt4docw3m "qmap.html")
# Academic Solutions to Academic Problems:
# http://doc.trolltech.com/qq/qq15-academic.html
# Local Variables:
# coding: utf-8-unix
# modes: (fundamental-mode sh-mode)
# End: