You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.7 KiB
99 lines
2.7 KiB
15 years ago
|
#include "kdebug.h"
|
||
15 years ago
|
#include <tqwidget.h>
|
||
15 years ago
|
#include <kinstance.h>
|
||
|
#include <iostream>
|
||
15 years ago
|
#include <tqapplication.h>
|
||
|
#include <tqpen.h>
|
||
|
#include <tqvariant.h>
|
||
15 years ago
|
|
||
|
class TestWidget : public QWidget
|
||
|
{
|
||
|
|
||
|
public:
|
||
15 years ago
|
TestWidget(TQWidget* parent, const char* name)
|
||
|
: TQWidget(parent, name)
|
||
15 years ago
|
{
|
||
|
kdDebug().form("mytest %s", "hello") << endl;
|
||
15 years ago
|
TQString test = "%20C this is a string";
|
||
15 years ago
|
kdDebug(150) << test << endl;
|
||
15 years ago
|
TQCString cstr = test.latin1();
|
||
15 years ago
|
kdDebug(150) << test << endl;
|
||
15 years ago
|
TQChar ch = 'a';
|
||
|
kdDebug() << "TQChar a: " << ch << endl;
|
||
15 years ago
|
ch = '\r';
|
||
15 years ago
|
kdDebug() << "TQChar \\r: " << ch << endl;
|
||
15 years ago
|
kdDebug() << k_lineinfo << "error on this line" << endl;
|
||
|
kdDebug(2 == 2) << "this is right " << perror << endl;
|
||
|
kdDebug() << "Before instance creation" << endl;
|
||
|
kdDebug(1202) << "Before instance creation" << endl;
|
||
|
KInstance i("kdebugtest");
|
||
|
kdDebug(1) << "kDebugInfo with inexisting area number" << endl;
|
||
|
kdDebug(1202) << "This number has a value of " << 5 << endl;
|
||
|
// kdDebug() << "This number should come out as appname " << 5 << " " << "test" << endl;
|
||
|
kdWarning() << "1+1 = " << 1+1+1 << endl;
|
||
|
kdError(1+1 != 2) << "there is something really odd!" << endl;
|
||
15 years ago
|
TQString s = "mystring";
|
||
15 years ago
|
kdDebug() << s << endl;
|
||
|
kdError(1202) << "Error !!!" << endl;
|
||
|
kdError() << "Error with no area" << endl;
|
||
|
|
||
15 years ago
|
kdDebug() << "Printing a null TQWidget pointer: " << (TQWidget*)0 << endl;
|
||
15 years ago
|
|
||
|
kdDebug() << "char " << '^' << " " << char(26) << endl;
|
||
15 years ago
|
TQPoint p(0,9);
|
||
15 years ago
|
kdDebug() << p << endl;
|
||
|
|
||
15 years ago
|
TQRect r(9,12,58,234);
|
||
15 years ago
|
kdDebug() << r << endl;
|
||
|
|
||
15 years ago
|
TQRegion reg(r);
|
||
|
reg += TQRect(1,60,200,59);
|
||
15 years ago
|
kdDebug() << reg << endl;
|
||
|
|
||
15 years ago
|
TQStringList sl;
|
||
15 years ago
|
sl << "hi" << "this" << "list" << "is" << "short";
|
||
|
kdDebug() << sl << endl;
|
||
|
|
||
15 years ago
|
TQValueList<int> il;
|
||
|
kdDebug() << "Empty TQValueList<int>: " << il << endl;
|
||
15 years ago
|
il << 1 << 2 << 3 << 4 << 5;
|
||
15 years ago
|
kdDebug() << "TQValueList<int> filled: " << il << endl;
|
||
15 years ago
|
|
||
|
Q_LLONG big = 65536LL*65536*500;
|
||
|
kdDebug() << big << endl;
|
||
|
|
||
15 years ago
|
TQVariant v( 0.12345 );
|
||
15 years ago
|
kdDebug() << "Variant: " << v << endl;
|
||
15 years ago
|
v = TQPen( Qt::red );
|
||
15 years ago
|
kdDebug() << "Variant: " << v << endl;
|
||
|
|
||
15 years ago
|
TQByteArray data( 6 );
|
||
15 years ago
|
data[0] = 42;
|
||
|
data[1] = 'H';
|
||
|
data[2] = 'e';
|
||
|
data[3] = 'l';
|
||
|
data[4] = 'l';
|
||
|
data[5] = 'o';
|
||
|
kdDebug() << data << endl;
|
||
|
data.resize( 80 );
|
||
|
data.fill( 42 );
|
||
|
kdDebug() << data << endl;
|
||
|
}
|
||
15 years ago
|
void resizeEvent(TQResizeEvent*)
|
||
15 years ago
|
{
|
||
|
kdDebug() << this << endl;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
int main(int argc, char** argv)
|
||
|
{
|
||
15 years ago
|
TQApplication app(argc, argv);
|
||
15 years ago
|
TestWidget widget(0, "NoNameWidget");
|
||
|
widget.setGeometry(45, 54, 120, 80);
|
||
|
widget.show();
|
||
|
app.setMainWidget(&widget);
|
||
|
app.exec();
|
||
|
return 0;
|
||
|
}
|
||
|
|