Use new TQ_METHOD, TQ_SIGNAL, TQ_SLOT defines

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 1a2c703f4d)
r14.1.x
Michele Calgaro 11 months ago
parent c5441a7230
commit 2ea8296a80
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -990,7 +990,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -990,7 +990,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -255,14 +255,14 @@ hello.resize( 100, 30 );
a.setMainWidget( &amp;hello ); a.setMainWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
} }
</programlisting> </programlisting>
</para> </para>
<para>Du mærker at alt du skal tilføje for at give knappen mere kommunikation er metoden <methodname>connect()</methodname>: <methodname>connect (&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() ))</methodname>;. Hvad er betydningen nu? Klassedeklarationen af TQObject siger følgende om metoden <methodname>connect()</methodname>: </para> <para>Du mærker at alt du skal tilføje for at give knappen mere kommunikation er metoden <methodname>connect()</methodname>: <methodname>connect (&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ))</methodname>;. Hvad er betydningen nu? Klassedeklarationen af TQObject siger følgende om metoden <methodname>connect()</methodname>: </para>
<para><methodname>bool connect ( const TQObject * afsender, const char * signal, const TQObject * modtager, const char * medlem ) </methodname></para> <para><methodname>bool connect ( const TQObject * afsender, const char * signal, const TQObject * modtager, const char * medlem ) </methodname></para>
<para>Dette betyder at du skal angive en <classname>TQObject</classname>-instanspeger som er signalets afsender, hvilket betyder at den kan sende signalet, som første parameter. Derefter skal du angive signalet som du vil forbinde til. De to sidste parametre er modtagerobjektet som sørger for en slot, fulgt af medlemsfunktionen som er en virkelig slot som vil køres når signalet sendes. </para> <para>Dette betyder at du skal angive en <classname>TQObject</classname>-instanspeger som er signalets afsender, hvilket betyder at den kan sende signalet, som første parameter. Derefter skal du angive signalet som du vil forbinde til. De to sidste parametre er modtagerobjektet som sørger for en slot, fulgt af medlemsfunktionen som er en virkelig slot som vil køres når signalet sendes. </para>
<para>Ved at bruge signaler og slots, kan programmets objekter nemt kommunikere med hinanden uden udtrykkeligt at afhænge af typen af modtagarobjektet. Du vil lære mere om hvordan denne mekanisme bruges produktivt senere i håndbogen. Mere information om signal/slot-mekanismen findes også i <ulink url="developer.kde.org/documentation/library/libraryref.html">KDE's biblioteksreferenceguide</ulink> og <ulink url="doc.trolltech.com">QT's reference på nettet</ulink>. </para> <para>Ved at bruge signaler og slots, kan programmets objekter nemt kommunikere med hinanden uden udtrykkeligt at afhænge af typen af modtagarobjektet. Du vil lære mere om hvordan denne mekanisme bruges produktivt senere i håndbogen. Mere information om signal/slot-mekanismen findes også i <ulink url="developer.kde.org/documentation/library/libraryref.html">KDE's biblioteksreferenceguide</ulink> og <ulink url="doc.trolltech.com">QT's reference på nettet</ulink>. </para>
@ -304,7 +304,7 @@ hello.resize( 100, 30 );
a.setTopWidget( &amp;hello ); a.setTopWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
@ -549,10 +549,10 @@ return a.exec();
16 statusBar()->show(); 16 statusBar()->show();
17 17
18 // tillad visningen at ændre statuslinjen og overskriften 18 // tillad visningen at ændre statuslinjen og overskriften
19 connect(m_view, SIGNAL(signalChangeStatusbar(const TQString&amp;)), 19 connect(m_view, TQ_SIGNAL(signalChangeStatusbar(const TQString&amp;)),
20 this, SLOT(changeStatusbar(const TQString&amp;))); 20 this, TQ_SLOT(changeStatusbar(const TQString&amp;)));
21 connect(m_view, SIGNAL(signalChangeCaption(const TQString&amp;)), 21 connect(m_view, TQ_SIGNAL(signalChangeCaption(const TQString&amp;)),
22 this, SLOT(changeCaption(const TQString&amp;))); 22 this, TQ_SLOT(changeCaption(const TQString&amp;)));
23 23
24 } 24 }
</programlisting> </programlisting>

@ -881,23 +881,23 @@ rc_DATA = kviewui.rc
<para>Den tilsvarende del til at oprette dette i C++ er: </para> <para>Den tilsvarende del til at oprette dette i C++ er: </para>
<programlisting>KStdAction::zoomIn ( this, SLOT(slotZoomIn()), actionCollection() ); <programlisting>KStdAction::zoomIn ( this, TQ_SLOT(slotZoomIn()), actionCollection() );
KStdAction::zoomOut ( this, SLOT(slotZoomOut()), actionCollection() ); KStdAction::zoomOut ( this, TQ_SLOT(slotZoomOut()), actionCollection() );
KStdAction::zoom ( this, SLOT(slotZoom()), actionCollection() ); KStdAction::zoom ( this, TQ_SLOT(slotZoom()), actionCollection() );
new TDEAction ( i18n("&amp;Half size"), ALT+Key_0, new TDEAction ( i18n("&amp;Half size"), ALT+Key_0,
this, SLOT(slotHalfSize()), this, TQ_SLOT(slotHalfSize()),
actionCollection(), "zoom50" ); actionCollection(), "zoom50" );
new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1, new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom100" ); actionCollection(), "zoom100" );
new TDEAction ( i18n("&amp;Double size"), ALT+Key_2, new TDEAction ( i18n("&amp;Double size"), ALT+Key_2,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom200" ); actionCollection(), "zoom200" );
new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3, new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3,
this, SLOT(slotFillScreen()), this, TQ_SLOT(slotFillScreen()),
actionCollection(), "zoomMaxpect" ); actionCollection(), "zoomMaxpect" );
new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F, new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F,
this, SLOT(slotFullScreen()), this, TQ_SLOT(slotFullScreen()),
actionCollection(), "fullscreen" ); actionCollection(), "fullscreen" );
</programlisting> </programlisting>
@ -1400,8 +1400,8 @@ else
{ {
KURL url("http://developer.kde.org/favicon.ico"); KURL url("http://developer.kde.org/favicon.ico");
TDEIO::MimetypeJob *job = TDEIO::mimetype(url); TDEIO::MimetypeJob *job = TDEIO::mimetype(url);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mimeResult(TDEIO::Job*)) ); this, TQ_SLOT(mimeResult(TDEIO::Job*)) );
} }
void FooClass::mimeResult(TDEIO::Job *job) void FooClass::mimeResult(TDEIO::Job *job)
@ -1507,8 +1507,8 @@ new KRun(url);
<programlisting>void FooClass::makeDirectory() <programlisting>void FooClass::makeDirectory()
{ {
SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir")); SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir"));
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mkdirResult(TDEIO::Job*)) ); this, TQ_SLOT(mkdirResult(TDEIO::Job*)) );
} }
void FooClass::mkdirResult(TDEIO::Job *job) void FooClass::mkdirResult(TDEIO::Job *job)
@ -1692,8 +1692,8 @@ if (TDEIO::NetAccess::download(url, tempFile) {
{ {
KURL url("http://developer.kde.org/documentation/kde2arch/index.html"); KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
TDEIO::TransferJob *job = TDEIO::get(url, true, false); TDEIO::TransferJob *job = TDEIO::get(url, true, false);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(transferResult(TDEIO::Job*)) ); this, TQ_SLOT(transferResult(TDEIO::Job*)) );
} }
void FooClass::transferResult(TDEIO::Job *job) void FooClass::transferResult(TDEIO::Job *job)

@ -990,7 +990,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -942,7 +942,7 @@ RotWidget::RotWidget( TQWidget *parent, const TQColor&amp; c1, const TQColor&amp
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -983,7 +983,7 @@ RotWidget::RotWidget( TQWidget *parent, const TQColor&amp; c1, const TQColor&amp
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -255,14 +255,14 @@ hello.resize( 100, 30 );
a.setMainWidget( &amp;hello ); a.setMainWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
} }
</programlisting> </programlisting>
</para> </para>
<para>Como puede comprobar, la única adición para dar más interacción al botón consiste en usar un método <methodname>connect()</methodname>: <methodname>connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() ));</methodname> es todo cuanto tiene que añadir. ¿Cuál es su significado? La declaración de la clase TQObject dice lo siguiente sobre el método <methodname>connect()</methodname>: </para> <para>Como puede comprobar, la única adición para dar más interacción al botón consiste en usar un método <methodname>connect()</methodname>: <methodname>connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));</methodname> es todo cuanto tiene que añadir. ¿Cuál es su significado? La declaración de la clase TQObject dice lo siguiente sobre el método <methodname>connect()</methodname>: </para>
<para><methodname>bool connect ( const TQObject * emisor, const char * señal, const TQObject * receptor, const char * miembro ) </methodname></para> <para><methodname>bool connect ( const TQObject * emisor, const char * señal, const TQObject * receptor, const char * miembro ) </methodname></para>
<para>Esto significa que debe especificar como primer parámetro un puntero de una instancia de la clase <classname>TQObject</classname>, que es el emisor de la señal (lo que significa que puede emitir esta señal); a continuación debe especificar la señal que desea conectar. Los dos últimos parámetros son, en primer lugar, el objeto receptor que proporciona un «slot», y, finalmente, la función miembro de dicho objeto que va a actuar como «slot» (y que será ejecutada tras la emisión de la señal). </para> <para>Esto significa que debe especificar como primer parámetro un puntero de una instancia de la clase <classname>TQObject</classname>, que es el emisor de la señal (lo que significa que puede emitir esta señal); a continuación debe especificar la señal que desea conectar. Los dos últimos parámetros son, en primer lugar, el objeto receptor que proporciona un «slot», y, finalmente, la función miembro de dicho objeto que va a actuar como «slot» (y que será ejecutada tras la emisión de la señal). </para>
<para>Mediante el uso de señales y «slots», los objetos de su programa pueden interactuar con otros fácilmente sin depender explícitamente del tipo de objeto receptor. Aprenderá más sobre el uso de este mecanismo para usos productivos en sucesivas secciones de este manual. También puede encontrar más información sobre el mecanismo de señales y «slots» en la <ulink url="developer.kde.org/documentation/library/libraryref.html">Guía de referencia de la biblioteca KDE</ulink> y la <ulink url="doc.trolltech.com">referencia en línea de Qt</ulink>. </para> <para>Mediante el uso de señales y «slots», los objetos de su programa pueden interactuar con otros fácilmente sin depender explícitamente del tipo de objeto receptor. Aprenderá más sobre el uso de este mecanismo para usos productivos en sucesivas secciones de este manual. También puede encontrar más información sobre el mecanismo de señales y «slots» en la <ulink url="developer.kde.org/documentation/library/libraryref.html">Guía de referencia de la biblioteca KDE</ulink> y la <ulink url="doc.trolltech.com">referencia en línea de Qt</ulink>. </para>
@ -304,7 +304,7 @@ hello.resize( 100, 30 );
a.setTopWidget( &amp;hello ); a.setTopWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
@ -549,10 +549,10 @@ return a.exec();
16 statusBar()->show(); 16 statusBar()->show();
17 17
18 // permitir que la vista pueda cambiar la barra de estado y el título 18 // permitir que la vista pueda cambiar la barra de estado y el título
19 connect(m_view, SIGNAL(signalChangeStatusbar(const TQString&amp;)), 19 connect(m_view, TQ_SIGNAL(signalChangeStatusbar(const TQString&amp;)),
20 this, SLOT(changeStatusbar(const TQString&amp;))); 20 this, TQ_SLOT(changeStatusbar(const TQString&amp;)));
21 connect(m_view, SIGNAL(signalChangeCaption(const TQString&amp;)), 21 connect(m_view, TQ_SIGNAL(signalChangeCaption(const TQString&amp;)),
22 this, SLOT(changeCaption(const TQString&amp;))); 22 this, TQ_SLOT(changeCaption(const TQString&amp;)));
23 23
24 } 24 }
</programlisting> </programlisting>

@ -881,23 +881,23 @@ rc_DATA = kviewui.rc
<para>La parte de código correspondiente en C++ es: </para> <para>La parte de código correspondiente en C++ es: </para>
<programlisting>KStdAction::zoomIn ( this, SLOT(slotZoomIn()), actionCollection() ); <programlisting>KStdAction::zoomIn ( this, TQ_SLOT(slotZoomIn()), actionCollection() );
KStdAction::zoomOut ( this, SLOT(slotZoomOut()), actionCollection() ); KStdAction::zoomOut ( this, TQ_SLOT(slotZoomOut()), actionCollection() );
KStdAction::zoom ( this, SLOT(slotZoom()), actionCollection() ); KStdAction::zoom ( this, TQ_SLOT(slotZoom()), actionCollection() );
new TDEAction ( i18n("&amp;Half size"), ALT+Key_0, new TDEAction ( i18n("&amp;Half size"), ALT+Key_0,
this, SLOT(slotHalfSize()), this, TQ_SLOT(slotHalfSize()),
actionCollection(), "zoom50" ); actionCollection(), "zoom50" );
new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1, new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom100" ); actionCollection(), "zoom100" );
new TDEAction ( i18n("&amp;Double size"), ALT+Key_2, new TDEAction ( i18n("&amp;Double size"), ALT+Key_2,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom200" ); actionCollection(), "zoom200" );
new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3, new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3,
this, SLOT(slotFillScreen()), this, TQ_SLOT(slotFillScreen()),
actionCollection(), "zoomMaxpect" ); actionCollection(), "zoomMaxpect" );
new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F, new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F,
this, SLOT(slotFullScreen()), this, TQ_SLOT(slotFullScreen()),
actionCollection(), "fullscreen" ); actionCollection(), "fullscreen" );
</programlisting> </programlisting>
@ -1400,8 +1400,8 @@ else
{ {
KURL url("http://developer.kde.org/favicon.ico"); KURL url("http://developer.kde.org/favicon.ico");
TDEIO::MimetypeJob *job = TDEIO::mimetype(url); TDEIO::MimetypeJob *job = TDEIO::mimetype(url);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mimeResult(TDEIO::Job*)) ); this, TQ_SLOT(mimeResult(TDEIO::Job*)) );
} }
void FooClass::mimeResult(TDEIO::Job *job) void FooClass::mimeResult(TDEIO::Job *job)
@ -1507,8 +1507,8 @@ new KRun(url);
<programlisting>void FooClass::makeDirectory() <programlisting>void FooClass::makeDirectory()
{ {
SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir")); SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir"));
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mkdirResult(TDEIO::Job*)) ); this, TQ_SLOT(mkdirResult(TDEIO::Job*)) );
} }
void FooClass::mkdirResult(TDEIO::Job *job) void FooClass::mkdirResult(TDEIO::Job *job)
@ -1692,8 +1692,8 @@ if (TDEIO::NetAccess::download(url, tempFile) {
{ {
KURL url("http://developer.kde.org/documentation/kde2arch/index.html"); KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
TDEIO::TransferJob *job = TDEIO::get(url, true, false); TDEIO::TransferJob *job = TDEIO::get(url, true, false);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(transferResult(TDEIO::Job*)) ); this, TQ_SLOT(transferResult(TDEIO::Job*)) );
} }
void FooClass::transferResult(TDEIO::Job *job) void FooClass::transferResult(TDEIO::Job *job)

@ -990,7 +990,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -255,14 +255,14 @@ hello.resize( 100, 30 );
a.setMainWidget( &amp;hello ); a.setMainWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
} }
</programlisting> </programlisting>
</para> </para>
<para>Nagu näed, saab üheainsa lisandusega anda nupule suurema interaktiivsuse. Selleks on vaja ainult lisada meetod <methodname>connect()</methodname>: <methodname>connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() ))</methodname>. Mida see tähendab? Klassi TQObject deklaratsioon ütleb meetodi <methodname>connect()</methodname> kohta järgmist: </para> <para>Nagu näed, saab üheainsa lisandusega anda nupule suurema interaktiivsuse. Selleks on vaja ainult lisada meetod <methodname>connect()</methodname>: <methodname>connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ))</methodname>. Mida see tähendab? Klassi TQObject deklaratsioon ütleb meetodi <methodname>connect()</methodname> kohta järgmist: </para>
<para><methodname>bool connect ( const TQObject * sender, const char * signal, const TQObject * receiver, const char * member ) </methodname></para> <para><methodname>bool connect ( const TQObject * sender, const char * signal, const TQObject * receiver, const char * member ) </methodname></para>
<para>See tähendab, et sul tuleb määrata <classname>TQObject</classname> eksemplari viit, mis on signaali saatja, mis tähendab, et sa emiteerid selle signaali esimese parameetrina. Seejärel tuleb määrata signaal, millega soovid ühenduse luua. Viimased kaks parameetrit on vastuvõttev objekt, mis pakub pesa, ning sellele järgneb liikmesfunktsioon, mis ongi tegelik pesa, mis käivitatakse signaali emiteerimisel. </para> <para>See tähendab, et sul tuleb määrata <classname>TQObject</classname> eksemplari viit, mis on signaali saatja, mis tähendab, et sa emiteerid selle signaali esimese parameetrina. Seejärel tuleb määrata signaal, millega soovid ühenduse luua. Viimased kaks parameetrit on vastuvõttev objekt, mis pakub pesa, ning sellele järgneb liikmesfunktsioon, mis ongi tegelik pesa, mis käivitatakse signaali emiteerimisel. </para>
<para>Signaalide ja pesade abil saavad sinu programmi objektid üksteisega suhelda ilma vajaduseta otseselt sõltuda vastuvõtva objekti tüübist. Selle mehhanismi kasutamisest tuleb käsiraamatus veel pikemalt juttu. Rohkem infot signaalide ja pesade mehhanismi kohta leiab ka <ulink url="developer.kde.org/documentation/library/libraryref.html">KDE teegi</ulink> ja <ulink url="doc.trolltech.com">Qt dokumentatsioonist</ulink>. </para> <para>Signaalide ja pesade abil saavad sinu programmi objektid üksteisega suhelda ilma vajaduseta otseselt sõltuda vastuvõtva objekti tüübist. Selle mehhanismi kasutamisest tuleb käsiraamatus veel pikemalt juttu. Rohkem infot signaalide ja pesade mehhanismi kohta leiab ka <ulink url="developer.kde.org/documentation/library/libraryref.html">KDE teegi</ulink> ja <ulink url="doc.trolltech.com">Qt dokumentatsioonist</ulink>. </para>
@ -304,7 +304,7 @@ hello.resize( 100, 30 );
a.setTopWidget( &amp;hello ); a.setTopWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
@ -549,10 +549,10 @@ return a.exec();
16 statusBar()->show(); 16 statusBar()->show();
17 17
18 // allow the view to change the statusbar and caption 18 // allow the view to change the statusbar and caption
19 connect(m_view, SIGNAL(signalChangeStatusbar(const TQString&amp;)), 19 connect(m_view, TQ_SIGNAL(signalChangeStatusbar(const TQString&amp;)),
20 this, SLOT(changeStatusbar(const TQString&amp;))); 20 this, TQ_SLOT(changeStatusbar(const TQString&amp;)));
21 connect(m_view, SIGNAL(signalChangeCaption(const TQString&amp;)), 21 connect(m_view, TQ_SIGNAL(signalChangeCaption(const TQString&amp;)),
22 this, SLOT(changeCaption(const TQString&amp;))); 22 this, TQ_SLOT(changeCaption(const TQString&amp;)));
23 23
24 } 24 }
</programlisting> </programlisting>

@ -881,23 +881,23 @@ rc_DATA = kviewui.rc
<para>Vastav osa C++ keeles kõlab: </para> <para>Vastav osa C++ keeles kõlab: </para>
<programlisting>KStdAction::zoomIn ( this, SLOT(slotZoomIn()), actionCollection() ); <programlisting>KStdAction::zoomIn ( this, TQ_SLOT(slotZoomIn()), actionCollection() );
KStdAction::zoomOut ( this, SLOT(slotZoomOut()), actionCollection() ); KStdAction::zoomOut ( this, TQ_SLOT(slotZoomOut()), actionCollection() );
KStdAction::zoom ( this, SLOT(slotZoom()), actionCollection() ); KStdAction::zoom ( this, TQ_SLOT(slotZoom()), actionCollection() );
new TDEAction ( i18n("&amp;Half size"), ALT+Key_0, new TDEAction ( i18n("&amp;Half size"), ALT+Key_0,
this, SLOT(slotHalfSize()), this, TQ_SLOT(slotHalfSize()),
actionCollection(), "zoom50" ); actionCollection(), "zoom50" );
new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1, new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom100" ); actionCollection(), "zoom100" );
new TDEAction ( i18n("&amp;Double size"), ALT+Key_2, new TDEAction ( i18n("&amp;Double size"), ALT+Key_2,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom200" ); actionCollection(), "zoom200" );
new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3, new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3,
this, SLOT(slotFillScreen()), this, TQ_SLOT(slotFillScreen()),
actionCollection(), "zoomMaxpect" ); actionCollection(), "zoomMaxpect" );
new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F, new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F,
this, SLOT(slotFullScreen()), this, TQ_SLOT(slotFullScreen()),
actionCollection(), "fullscreen" ); actionCollection(), "fullscreen" );
</programlisting> </programlisting>
@ -1400,8 +1400,8 @@ else
{ {
KURL url("http://developer.kde.org/favicon.ico"); KURL url("http://developer.kde.org/favicon.ico");
TDEIO::MimetypeJob *job = TDEIO::mimetype(url); TDEIO::MimetypeJob *job = TDEIO::mimetype(url);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mimeResult(TDEIO::Job*)) ); this, TQ_SLOT(mimeResult(TDEIO::Job*)) );
} }
void FooClass::mimeResult(TDEIO::Job *job) void FooClass::mimeResult(TDEIO::Job *job)
@ -1507,8 +1507,8 @@ new KRun(url);
<programlisting>void FooClass::makeDirectory() <programlisting>void FooClass::makeDirectory()
{ {
SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir")); SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir"));
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mkdirResult(TDEIO::Job*)) ); this, TQ_SLOT(mkdirResult(TDEIO::Job*)) );
} }
void FooClass::mkdirResult(TDEIO::Job *job) void FooClass::mkdirResult(TDEIO::Job *job)
@ -1692,8 +1692,8 @@ if (TDEIO::NetAccess::download(url, tempFile) {
{ {
KURL url("http://developer.kde.org/documentation/kde2arch/index.html"); KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
TDEIO::TransferJob *job = TDEIO::get(url, true, false); TDEIO::TransferJob *job = TDEIO::get(url, true, false);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(transferResult(TDEIO::Job*)) ); this, TQ_SLOT(transferResult(TDEIO::Job*)) );
} }
void FooClass::transferResult(TDEIO::Job *job) void FooClass::transferResult(TDEIO::Job *job)

@ -990,7 +990,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -116,7 +116,7 @@
</sect2> </sect2>
<sect2 id="statistics"> <sect2 id="statistics">
<title>Afficheur de statistiques</title> <title>Afficheur de statistiques</title>
<para>Optionnellement, en sélectionnant <guimenuitem>Statistiques de connexion</guimenuitem> dans le menu <guimenu>Fichier</guimenu>, une fenêtre séparée peut être représentée, qui affiche les graphes du niveau du signal et du niveau du bruit des 240 dernières secondes. Le niveau du signal est affiché en bleu et le niveau du bruit en rouge. La différence (SIGNAL moins BRUIT) est la qualité de connexion affichée dans la fenêtre principale.</para> <para>Optionnellement, en sélectionnant <guimenuitem>Statistiques de connexion</guimenuitem> dans le menu <guimenu>Fichier</guimenu>, une fenêtre séparée peut être représentée, qui affiche les graphes du niveau du signal et du niveau du bruit des 240 dernières secondes. Le niveau du signal est affiché en bleu et le niveau du bruit en rouge. La différence (TQ_SIGNAL moins BRUIT) est la qualité de connexion affichée dans la fenêtre principale.</para>
<para>Certaines cartes ne rapportent pas d'information sensée sur le bruit. Si c'est le cas de votre carte et que cette fichu ligne rouge vous ennuie, vous pouvez désactiver l'affichage du niveau de bruit dans la fenêtre des statistiques en dé-sélectionnant <menuchoice><guimenu>Confugation</guimenu><guimenuitem>Montrer les statistiques du niveau de bruit</guimenuitem></menuchoice> dans la fenêtre parincipale de &kwifimanager;.</para> <para>Certaines cartes ne rapportent pas d'information sensée sur le bruit. Si c'est le cas de votre carte et que cette fichu ligne rouge vous ennuie, vous pouvez désactiver l'affichage du niveau de bruit dans la fenêtre des statistiques en dé-sélectionnant <menuchoice><guimenu>Confugation</guimenu><guimenuitem>Montrer les statistiques du niveau de bruit</guimenuitem></menuchoice> dans la fenêtre parincipale de &kwifimanager;.</para>
</sect2> </sect2>
<sect2 id="config-edit"> <sect2 id="config-edit">

@ -881,23 +881,23 @@ rc_DATA = kviewui.rc
<para>La partie correspondante de la configuration en C++ est : </para> <para>La partie correspondante de la configuration en C++ est : </para>
<programlisting>KStdAction::zoomIn ( this, SLOT(slotZoomIn()), actionCollection() ); <programlisting>KStdAction::zoomIn ( this, TQ_SLOT(slotZoomIn()), actionCollection() );
KStdAction::zoomOut ( this, SLOT(slotZoomOut()), actionCollection() ); KStdAction::zoomOut ( this, TQ_SLOT(slotZoomOut()), actionCollection() );
KStdAction::zoom ( this, SLOT(slotZoom()), actionCollection() ); KStdAction::zoom ( this, TQ_SLOT(slotZoom()), actionCollection() );
new TDEAction ( i18n("&amp;Half size"), ALT+Key_0, new TDEAction ( i18n("&amp;Half size"), ALT+Key_0,
this, SLOT(slotHalfSize()), this, TQ_SLOT(slotHalfSize()),
actionCollection(), "zoom50" ); actionCollection(), "zoom50" );
new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1, new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom100" ); actionCollection(), "zoom100" );
new TDEAction ( i18n("&amp;Double size"), ALT+Key_2, new TDEAction ( i18n("&amp;Double size"), ALT+Key_2,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom200" ); actionCollection(), "zoom200" );
new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3, new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3,
this, SLOT(slotFillScreen()), this, TQ_SLOT(slotFillScreen()),
actionCollection(), "zoomMaxpect" ); actionCollection(), "zoomMaxpect" );
new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F, new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F,
this, SLOT(slotFullScreen()), this, TQ_SLOT(slotFullScreen()),
actionCollection(), "fullscreen" ); actionCollection(), "fullscreen" );
</programlisting> </programlisting>
@ -1400,8 +1400,8 @@ else
{ {
KURL url("http://developer.kde.org/favicon.ico"); KURL url("http://developer.kde.org/favicon.ico");
TDEIO::MimetypeJob *job = TDEIO::mimetype(url); TDEIO::MimetypeJob *job = TDEIO::mimetype(url);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mimeResult(TDEIO::Job*)) ); this, TQ_SLOT(mimeResult(TDEIO::Job*)) );
} }
void FooClass::mimeResult(TDEIO::Job *job) void FooClass::mimeResult(TDEIO::Job *job)
@ -1507,8 +1507,8 @@ new KRun(url);
<programlisting>void FooClass::makeDirectory() <programlisting>void FooClass::makeDirectory()
{ {
SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir")); SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir"));
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mkdirResult(TDEIO::Job*)) ); this, TQ_SLOT(mkdirResult(TDEIO::Job*)) );
} }
void FooClass::mkdirResult(TDEIO::Job *job) void FooClass::mkdirResult(TDEIO::Job *job)
@ -1692,8 +1692,8 @@ if (TDEIO::NetAccess::download(url, tempFile) {
{ {
KURL url("http://developer.kde.org/documentation/kde2arch/index.html"); KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
TDEIO::TransferJob *job = TDEIO::get(url, true, false); TDEIO::TransferJob *job = TDEIO::get(url, true, false);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(transferResult(TDEIO::Job*)) ); this, TQ_SLOT(transferResult(TDEIO::Job*)) );
} }
void FooClass::transferResult(TDEIO::Job *job) void FooClass::transferResult(TDEIO::Job *job)

@ -978,7 +978,7 @@ RotWidget::RotWidget( TQWidget *parent, const TQColor&amp; c1, const TQColor&amp
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -255,14 +255,14 @@ hello.resize( 100, 30 );
a.setMainWidget( &amp;hello ); a.setMainWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
} }
</programlisting> </programlisting>
</para> </para>
<para>Come si può vedere, l'unica modifica richiesta per dare maggiore interazione al pulsante consiste nell'utilizzare il metodo <methodname>connect()</methodname>: tutto quello che si deve aggiungere è <methodname>connect(&amp;hello,SIGNAL( clicked() ), &amp;a,SLOT( quit() ))</methodname>. Cosa significa? La dichiarazione del metodo <methodname>connect()</methodname> nella classe TQObject è: </para> <para>Come si può vedere, l'unica modifica richiesta per dare maggiore interazione al pulsante consiste nell'utilizzare il metodo <methodname>connect()</methodname>: tutto quello che si deve aggiungere è <methodname>connect(&amp;hello,TQ_SIGNAL( clicked() ), &amp;a,TQ_SLOT( quit() ))</methodname>. Cosa significa? La dichiarazione del metodo <methodname>connect()</methodname> nella classe TQObject è: </para>
<para><methodname>bool connect ( const TQObject * sender, const char * signal, const TQObject * receiver, const char * member ) </methodname></para> <para><methodname>bool connect ( const TQObject * sender, const char * signal, const TQObject * receiver, const char * member ) </methodname></para>
<para>Si deve specificare come primo parametro un puntatore ad una istanza di <classname>TQObject</classname> che trasmette il segnale, ovvero che può emettere questo segnale; poi si specifica il segnale che si vuole connettere. Gli ultimi due parametri sono l'oggetto ricevitore che fornisce uno slot, seguito dalla funzione membro che in effetti è lo slot che sarà eseguito dopo l'emissione del segnale. </para> <para>Si deve specificare come primo parametro un puntatore ad una istanza di <classname>TQObject</classname> che trasmette il segnale, ovvero che può emettere questo segnale; poi si specifica il segnale che si vuole connettere. Gli ultimi due parametri sono l'oggetto ricevitore che fornisce uno slot, seguito dalla funzione membro che in effetti è lo slot che sarà eseguito dopo l'emissione del segnale. </para>
<para>Utilizzando i segnali e gli slot gli oggetti dei proprio programma potranno interagire tra loro facilmente senza dipendere esplicitamente dal tipo dell'oggetto ricevente. Nei capitoli seguenti verrà spiegato come utilizzare in maniera produttiva questo meccanismo. Ulteriori informazioni sui segnali e gli slot possono essere trovati nella <ulink url="developer kde.org/documentation/library/libraryref.html">Guida di riferimento della libreria KDE</ulink> e nella <ulink url="doc.trolltech.com">documentazione Qt di riferimento</ulink>. </para> <para>Utilizzando i segnali e gli slot gli oggetti dei proprio programma potranno interagire tra loro facilmente senza dipendere esplicitamente dal tipo dell'oggetto ricevente. Nei capitoli seguenti verrà spiegato come utilizzare in maniera produttiva questo meccanismo. Ulteriori informazioni sui segnali e gli slot possono essere trovati nella <ulink url="developer kde.org/documentation/library/libraryref.html">Guida di riferimento della libreria KDE</ulink> e nella <ulink url="doc.trolltech.com">documentazione Qt di riferimento</ulink>. </para>
@ -304,7 +304,7 @@ hello.resize( 100, 30 );
a.setTopWidget( &amp;hello ); a.setTopWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
@ -549,10 +549,10 @@ return a.exec();
16 statusBar()->show(); 16 statusBar()->show();
17 17
18 // allow the view to change the statusbar and caption 18 // allow the view to change the statusbar and caption
19 connect(m_view, SIGNAL(signalChangeStatusbar(const TQString&amp;)), 19 connect(m_view, TQ_SIGNAL(signalChangeStatusbar(const TQString&amp;)),
20 this, SLOT(changeStatusbar(const TQString&amp;))); 20 this, TQ_SLOT(changeStatusbar(const TQString&amp;)));
21 connect(m_view, SIGNAL(signalChangeCaption(const TQString&amp;)), 21 connect(m_view, TQ_SIGNAL(signalChangeCaption(const TQString&amp;)),
22 this, SLOT(changeCaption(const TQString&amp;))); 22 this, TQ_SLOT(changeCaption(const TQString&amp;)));
23 23
24 } 24 }
</programlisting> </programlisting>

@ -881,23 +881,23 @@ rc_DATA = kviewui.rc
<para>Il codice C++ corrispondente è: </para> <para>Il codice C++ corrispondente è: </para>
<programlisting>KStdAction::zoomIn ( this, SLOT(slotZoomIn()), actionCollection() ); <programlisting>KStdAction::zoomIn ( this, TQ_SLOT(slotZoomIn()), actionCollection() );
KStdAction::zoomOut ( this, SLOT(slotZoomOut()), actionCollection() ); KStdAction::zoomOut ( this, TQ_SLOT(slotZoomOut()), actionCollection() );
KStdAction::zoom ( this, SLOT(slotZoom()), actionCollection() ); KStdAction::zoom ( this, TQ_SLOT(slotZoom()), actionCollection() );
new TDEAction ( i18n("&amp;Half size"), ALT+Key_0, new TDEAction ( i18n("&amp;Half size"), ALT+Key_0,
this, SLOT(slotHalfSize()), this, TQ_SLOT(slotHalfSize()),
actionCollection(), "zoom50" ); actionCollection(), "zoom50" );
new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1, new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom100" ); actionCollection(), "zoom100" );
new TDEAction ( i18n("&amp;Double size"), ALT+Key_2, new TDEAction ( i18n("&amp;Double size"), ALT+Key_2,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom200" ); actionCollection(), "zoom200" );
new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3, new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3,
this, SLOT(slotFillScreen()), this, TQ_SLOT(slotFillScreen()),
actionCollection(), "zoomMaxpect" ); actionCollection(), "zoomMaxpect" );
new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F, new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F,
this, SLOT(slotFullScreen()), this, TQ_SLOT(slotFullScreen()),
actionCollection(), "fullscreen" ); actionCollection(), "fullscreen" );
</programlisting> </programlisting>
@ -1400,8 +1400,8 @@ else
{ {
KURL url("http://developer.kde.org/favicon.ico"); KURL url("http://developer.kde.org/favicon.ico");
TDEIO::MimetypeJob *job = TDEIO::mimetype(url); TDEIO::MimetypeJob *job = TDEIO::mimetype(url);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mimeResult(TDEIO::Job*)) ); this, TQ_SLOT(mimeResult(TDEIO::Job*)) );
} }
void FooClass::mimeResult(TDEIO::Job *job) void FooClass::mimeResult(TDEIO::Job *job)
@ -1507,8 +1507,8 @@ new KRun(url);
<programlisting>void FooClass::makeDirectory() <programlisting>void FooClass::makeDirectory()
{ {
SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir")); SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir"));
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mkdirResult(TDEIO::Job*)) ); this, TQ_SLOT(mkdirResult(TDEIO::Job*)) );
} }
void FooClass::mkdirResult(TDEIO::Job *job) void FooClass::mkdirResult(TDEIO::Job *job)
@ -1692,8 +1692,8 @@ if (TDEIO::NetAccess::download(url, tempFile) {
{ {
KURL url("http://developer.kde.org/documentation/kde2arch/index.html"); KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
TDEIO::TransferJob *job = TDEIO::get(url, true, false); TDEIO::TransferJob *job = TDEIO::get(url, true, false);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(transferResult(TDEIO::Job*)) ); this, TQ_SLOT(transferResult(TDEIO::Job*)) );
} }
void FooClass::transferResult(TDEIO::Job *job) void FooClass::transferResult(TDEIO::Job *job)

@ -990,7 +990,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -990,7 +990,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -983,7 +983,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -255,14 +255,14 @@ ola.resize( 100, 30 );
a.setMainWidget( &amp;ola ); a.setMainWidget( &amp;ola );
connect(&amp;ola, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); connect(&amp;ola, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
ola.show(); ola.show();
return a.exec(); return a.exec();
} }
</programlisting> </programlisting>
</para> </para>
<para>Como vê, a única adição para dar ao botão mais interacção é usar um método <methodname>connect() </methodname>: o <methodname>connect(&amp;ola, SIGNAL( clicked() ), &amp;a, SLOT( quit() ))</methodname>; é tudo o que você tem para adicionar. Qual é o significado? A declaração da classe do TQObject fala sobre o método <methodname>connect()</methodname>: </para> <para>Como vê, a única adição para dar ao botão mais interacção é usar um método <methodname>connect() </methodname>: o <methodname>connect(&amp;ola, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ))</methodname>; é tudo o que você tem para adicionar. Qual é o significado? A declaração da classe do TQObject fala sobre o método <methodname>connect()</methodname>: </para>
<para><methodname>bool connect ( const TQObject * emissor, const char * signal, const TQObject * receptor, const char * membro ) </methodname></para> <para><methodname>bool connect ( const TQObject * emissor, const char * signal, const TQObject * receptor, const char * membro ) </methodname></para>
<para>Isto significa que você terá de indicar um ponteiro para uma instância de um <classname>TQObject</classname> que é o emissor do 'signal', o que significa que ele poderá emitir este 'signal' como primeiro parâmetro; depois, terá de indicar o 'signal' a que se deseja ligar. Os últimos dois parâmetros são o objecto receptor que contém um 'slot' seguido da função-membro que é, de facto, o 'slot' que será executado devido à emissão do 'signal'. </para> <para>Isto significa que você terá de indicar um ponteiro para uma instância de um <classname>TQObject</classname> que é o emissor do 'signal', o que significa que ele poderá emitir este 'signal' como primeiro parâmetro; depois, terá de indicar o 'signal' a que se deseja ligar. Os últimos dois parâmetros são o objecto receptor que contém um 'slot' seguido da função-membro que é, de facto, o 'slot' que será executado devido à emissão do 'signal'. </para>
<para>Usando os 'signals' e 'slots', os objectos do seu programa podem interagir uns com os outros facilmente sem terem de explicitamente depender do tipo do objecto receptor. Você irá aprender mais sobre a utilização deste mecanismo para uma utilização produtiva posteriormente neste manual. Se quiser saber mais informações sobre o mecanismo de 'signals'/'slots' poderá ir ao <ulink url="developer.kde.org/documentation/library/libraryref.html">Guia de Referência da Biblioteca do KDE</ulink> e à <ulink url="doc.trolltech.com">referência 'online' do Qt</ulink>. </para> <para>Usando os 'signals' e 'slots', os objectos do seu programa podem interagir uns com os outros facilmente sem terem de explicitamente depender do tipo do objecto receptor. Você irá aprender mais sobre a utilização deste mecanismo para uma utilização produtiva posteriormente neste manual. Se quiser saber mais informações sobre o mecanismo de 'signals'/'slots' poderá ir ao <ulink url="developer.kde.org/documentation/library/libraryref.html">Guia de Referência da Biblioteca do KDE</ulink> e à <ulink url="doc.trolltech.com">referência 'online' do Qt</ulink>. </para>
@ -304,7 +304,7 @@ ola.resize( 100, 30 );
a.setTopWidget( &amp;ola ); a.setTopWidget( &amp;ola );
connect(&amp;ola, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); connect(&amp;ola, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
ola.show(); ola.show();
return a.exec(); return a.exec();
@ -549,10 +549,10 @@ return a.exec();
16 statusBar()->show(); 16 statusBar()->show();
17 17
18 // permitir à vista mudar a barra de estado e o título 18 // permitir à vista mudar a barra de estado e o título
19 connect(m_view, SIGNAL(signalChangeStatusbar(const TQString&amp;)), 19 connect(m_view, TQ_SIGNAL(signalChangeStatusbar(const TQString&amp;)),
20 this, SLOT(changeStatusbar(const TQString&amp;))); 20 this, TQ_SLOT(changeStatusbar(const TQString&amp;)));
21 connect(m_view, SIGNAL(signalChangeCaption(const TQString&amp;)), 21 connect(m_view, TQ_SIGNAL(signalChangeCaption(const TQString&amp;)),
22 this, SLOT(changeCaption(const TQString&amp;))); 22 this, TQ_SLOT(changeCaption(const TQString&amp;)));
23 23
24 } 24 }
</programlisting> </programlisting>

@ -881,23 +881,23 @@ rc_DATA = kviewui.rc
<para>A componente correspondente da configuração em C++ é: </para> <para>A componente correspondente da configuração em C++ é: </para>
<programlisting>KStdAction::zoomIn ( this, SLOT(slotZoomIn()), actionCollection() ); <programlisting>KStdAction::zoomIn ( this, TQ_SLOT(slotZoomIn()), actionCollection() );
KStdAction::zoomOut ( this, SLOT(slotZoomOut()), actionCollection() ); KStdAction::zoomOut ( this, TQ_SLOT(slotZoomOut()), actionCollection() );
KStdAction::zoom ( this, SLOT(slotZoom()), actionCollection() ); KStdAction::zoom ( this, TQ_SLOT(slotZoom()), actionCollection() );
new TDEAction ( i18n("&amp;Half size"), ALT+Key_0, new TDEAction ( i18n("&amp;Half size"), ALT+Key_0,
this, SLOT(slotHalfSize()), this, TQ_SLOT(slotHalfSize()),
actionCollection(), "zoom50" ); actionCollection(), "zoom50" );
new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1, new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom100" ); actionCollection(), "zoom100" );
new TDEAction ( i18n("&amp;Double size"), ALT+Key_2, new TDEAction ( i18n("&amp;Double size"), ALT+Key_2,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom200" ); actionCollection(), "zoom200" );
new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3, new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3,
this, SLOT(slotFillScreen()), this, TQ_SLOT(slotFillScreen()),
actionCollection(), "zoomMaxpect" ); actionCollection(), "zoomMaxpect" );
new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F, new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F,
this, SLOT(slotFullScreen()), this, TQ_SLOT(slotFullScreen()),
actionCollection(), "fullscreen" ); actionCollection(), "fullscreen" );
</programlisting> </programlisting>
@ -1401,8 +1401,8 @@ else
{ {
KURL url("http://developer.kde.org/favicon.ico"); KURL url("http://developer.kde.org/favicon.ico");
TDEIO::MimetypeJob *tarefa = TDEIO::mimetype(url); TDEIO::MimetypeJob *tarefa = TDEIO::mimetype(url);
connect( tarefa, SIGNAL(result(TDEIO::Job*)), connect( tarefa, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mimeResult(TDEIO::Job*)) ); this, TQ_SLOT(mimeResult(TDEIO::Job*)) );
} }
void ClasseXpto::resultadoMime(TDEIO::Job *tarefa) void ClasseXpto::resultadoMime(TDEIO::Job *tarefa)
@ -1508,8 +1508,8 @@ new KRun(url);
<programlisting>void ClasseXpto::criarDirectoria() <programlisting>void ClasseXpto::criarDirectoria()
{ {
SimpleJob *tarefa = TDEIO::mkdir(KURL("file:/home/ze/dir_tdeio")); SimpleJob *tarefa = TDEIO::mkdir(KURL("file:/home/ze/dir_tdeio"));
connect( tarefa, SIGNAL(result(TDEIO::Job*)), connect( tarefa, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(resultadoMkdir(TDEIO::Job*)) ); this, TQ_SLOT(resultadoMkdir(TDEIO::Job*)) );
} }
void ClasseXpto::resultadoMkdir(TDEIO::Job *tarefa) void ClasseXpto::resultadoMkdir(TDEIO::Job *tarefa)
@ -1693,8 +1693,8 @@ if (TDEIO::NetAccess::download(url, ficheiroTemporario) {
{ {
KURL url("http://developer.kde.org/documentation/kde2arch/index.html"); KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
TDEIO::TransferJob *tarefa = TDEIO::get(url, true, false); TDEIO::TransferJob *tarefa = TDEIO::get(url, true, false);
connect( tarefa, SIGNAL(result(TDEIO::Job*)), connect( tarefa, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(transferirResultado(TDEIO::Job*)) ); this, TQ_SLOT(transferirResultado(TDEIO::Job*)) );
} }
void ClasseXpto::transferirResultado(TDEIO::Job *tarefa) void ClasseXpto::transferirResultado(TDEIO::Job *tarefa)

@ -983,7 +983,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -990,7 +990,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -255,14 +255,14 @@ hello.resize( 100, 30 );
a.setMainWidget( &amp;hello ); a.setMainWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
} }
</programlisting> </programlisting>
</para> </para>
<para>Как видите, мы лишь расширили возможности кнопки с использованием метода <methodname>connect()</methodname>: <methodname>connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() ))</methodname> &mdash; всё, что мы добавили. Что же это означает? Объявление метода <methodname>connect()</methodname> в классе TQObject: </para> <para>Как видите, мы лишь расширили возможности кнопки с использованием метода <methodname>connect()</methodname>: <methodname>connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ))</methodname> &mdash; всё, что мы добавили. Что же это означает? Объявление метода <methodname>connect()</methodname> в классе TQObject: </para>
<para><methodname>bool connect ( const TQObject * sender, const char * signal, const TQObject * receiver, const char * member ) </methodname></para> <para><methodname>bool connect ( const TQObject * sender, const char * signal, const TQObject * receiver, const char * member ) </methodname></para>
<para>Это значит, что указатель на экземпляр <classname>TQObject</classname> является инициатором сигнала, указанного во втором аргументе. Оставшиеся два аргумента есть объект-приёмник, который имеет слот, а затем и имя функции-слота, которая будет выполнена при получении сигнала. </para> <para>Это значит, что указатель на экземпляр <classname>TQObject</classname> является инициатором сигнала, указанного во втором аргументе. Оставшиеся два аргумента есть объект-приёмник, который имеет слот, а затем и имя функции-слота, которая будет выполнена при получении сигнала. </para>
<para>С помощью сигналов и слотов, объекты ваших программ могут взаимодействовать друг с другом без явной зависимости от типа объекта-приёмника. Далее в этом руководстве приводится более подробное описание работы механзима сигналов/слотов. Коме этого, о нём можно почитать в <ulink url="developer.kde.org/documentation/library/libraryref.html">The KDE Library Reference Guide</ulink> и <ulink url="doc.trolltech.com">Qt online reference</ulink>. </para> <para>С помощью сигналов и слотов, объекты ваших программ могут взаимодействовать друг с другом без явной зависимости от типа объекта-приёмника. Далее в этом руководстве приводится более подробное описание работы механзима сигналов/слотов. Коме этого, о нём можно почитать в <ulink url="developer.kde.org/documentation/library/libraryref.html">The KDE Library Reference Guide</ulink> и <ulink url="doc.trolltech.com">Qt online reference</ulink>. </para>
@ -304,7 +304,7 @@ hello.resize( 100, 30 );
a.setTopWidget( &amp;hello ); a.setTopWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
@ -549,10 +549,10 @@ return a.exec();
16 statusBar()->show(); 16 statusBar()->show();
17 17
18 // allow the view to change the statusbar and caption 18 // allow the view to change the statusbar and caption
19 connect(m_view, SIGNAL(signalChangeStatusbar(const TQString&amp;)), 19 connect(m_view, TQ_SIGNAL(signalChangeStatusbar(const TQString&amp;)),
20 this, SLOT(changeStatusbar(const TQString&amp;))); 20 this, TQ_SLOT(changeStatusbar(const TQString&amp;)));
21 connect(m_view, SIGNAL(signalChangeCaption(const TQString&amp;)), 21 connect(m_view, TQ_SIGNAL(signalChangeCaption(const TQString&amp;)),
22 this, SLOT(changeCaption(const TQString&amp;))); 22 this, TQ_SLOT(changeCaption(const TQString&amp;)));
23 23
24 } 24 }
</programlisting> </programlisting>

@ -881,23 +881,23 @@ rc_DATA = kviewui.rc
<para>Соответствующий код C++: </para> <para>Соответствующий код C++: </para>
<programlisting>KStdAction::zoomIn ( this, SLOT(slotZoomIn()), actionCollection() ); <programlisting>KStdAction::zoomIn ( this, TQ_SLOT(slotZoomIn()), actionCollection() );
KStdAction::zoomOut ( this, SLOT(slotZoomOut()), actionCollection() ); KStdAction::zoomOut ( this, TQ_SLOT(slotZoomOut()), actionCollection() );
KStdAction::zoom ( this, SLOT(slotZoom()), actionCollection() ); KStdAction::zoom ( this, TQ_SLOT(slotZoom()), actionCollection() );
new TDEAction ( i18n("&amp;Half size"), ALT+Key_0, new TDEAction ( i18n("&amp;Half size"), ALT+Key_0,
this, SLOT(slotHalfSize()), this, TQ_SLOT(slotHalfSize()),
actionCollection(), "zoom50" ); actionCollection(), "zoom50" );
new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1, new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom100" ); actionCollection(), "zoom100" );
new TDEAction ( i18n("&amp;Double size"), ALT+Key_2, new TDEAction ( i18n("&amp;Double size"), ALT+Key_2,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom200" ); actionCollection(), "zoom200" );
new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3, new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3,
this, SLOT(slotFillScreen()), this, TQ_SLOT(slotFillScreen()),
actionCollection(), "zoomMaxpect" ); actionCollection(), "zoomMaxpect" );
new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F, new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F,
this, SLOT(slotFullScreen()), this, TQ_SLOT(slotFullScreen()),
actionCollection(), "fullscreen" ); actionCollection(), "fullscreen" );
</programlisting> </programlisting>
@ -1400,8 +1400,8 @@ else
{ {
KURL url("http://developer.kde.org/favicon.ico"); KURL url("http://developer.kde.org/favicon.ico");
TDEIO::MimetypeJob *job = TDEIO::mimetype(url); TDEIO::MimetypeJob *job = TDEIO::mimetype(url);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mimeResult(TDEIO::Job*)) ); this, TQ_SLOT(mimeResult(TDEIO::Job*)) );
} }
void FooClass::mimeResult(TDEIO::Job *job) void FooClass::mimeResult(TDEIO::Job *job)
@ -1507,8 +1507,8 @@ new KRun(url);
<programlisting>void FooClass::makeDirectory() <programlisting>void FooClass::makeDirectory()
{ {
SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir")); SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir"));
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mkdirResult(TDEIO::Job*)) ); this, TQ_SLOT(mkdirResult(TDEIO::Job*)) );
} }
void FooClass::mkdirResult(TDEIO::Job *job) void FooClass::mkdirResult(TDEIO::Job *job)
@ -1693,8 +1693,8 @@ if (TDEIO::NetAccess::download(url, tempFile) {
{ {
KURL url("http://developer.kde.org/documentation/kde2arch/index.html"); KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
TDEIO::TransferJob *job = TDEIO::get(url, true, false); TDEIO::TransferJob *job = TDEIO::get(url, true, false);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(transferResult(TDEIO::Job*)) ); this, TQ_SLOT(transferResult(TDEIO::Job*)) );
} }
void FooClass::transferResult(TDEIO::Job *job) void FooClass::transferResult(TDEIO::Job *job)

@ -990,7 +990,7 @@ c2, int sp )
preparePixmap( i ); preparePixmap( i );
m_stepTimer = new QTimer( this ); m_stepTimer = new QTimer( this );
connect(m_stepTimer, SIGNAL(timeout()), this, SLOT(stepEvent())); connect(m_stepTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(stepEvent()));
m_stepTimer-&gt;start( 50 ); m_stepTimer-&gt;start( 50 );
} }

@ -255,14 +255,14 @@ hello.resize( 100, 30 );
a.setMainWidget( &amp;hello ); a.setMainWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
} }
</programlisting> </programlisting>
</para> </para>
<para>Du märker att allt du måste lägga till för att ge knappen mer kommunikation är metoden <methodname>connect()</methodname>: <methodname>connect (&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() ))</methodname>;. Vad är betydelsen nu? Klassdeklarationen av TQObject säger följande om metoden <methodname>connect()</methodname>: </para> <para>Du märker att allt du måste lägga till för att ge knappen mer kommunikation är metoden <methodname>connect()</methodname>: <methodname>connect (&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ))</methodname>;. Vad är betydelsen nu? Klassdeklarationen av TQObject säger följande om metoden <methodname>connect()</methodname>: </para>
<para><methodname>bool connect ( const TQObject * avsändare, const char * signal, const TQObject * mottagare, const char * medlem ) </methodname></para> <para><methodname>bool connect ( const TQObject * avsändare, const char * signal, const TQObject * mottagare, const char * medlem ) </methodname></para>
<para>Detta betyder att du måste ange en <classname>TQObject</classname>-instanspekare som är signalens avsändare, vilket betyder att den kan skicka signalen, som första parameter. Därefter måste du ange signalen som du vill ansluta till. De två sista parametrarna är mottagarobjektet som tillhandahåller en slot, följt av medlemsfunktionen som är en verklig slot som kommer att köras när signalen skickas. </para> <para>Detta betyder att du måste ange en <classname>TQObject</classname>-instanspekare som är signalens avsändare, vilket betyder att den kan skicka signalen, som första parameter. Därefter måste du ange signalen som du vill ansluta till. De två sista parametrarna är mottagarobjektet som tillhandahåller en slot, följt av medlemsfunktionen som är en verklig slot som kommer att köras när signalen skickas. </para>
<para>Genom att använda signaler och slots, kan programmets objekt enkelt kommunicera med varandra utan att uttryckligen bero på typen hos mottagarobjektet. Du får lära dig mer om hur den här mekanismen används produktivt senare i handboken. Mer information om signal/slot-mekanismen finns också i <ulink url="developer.kde.org/documentation/library/libraryref.html">KDE:s biblioteksreferensguide</ulink> och <ulink url="doc.trolltech.com">QT:s direktreferens</ulink>. </para> <para>Genom att använda signaler och slots, kan programmets objekt enkelt kommunicera med varandra utan att uttryckligen bero på typen hos mottagarobjektet. Du får lära dig mer om hur den här mekanismen används produktivt senare i handboken. Mer information om signal/slot-mekanismen finns också i <ulink url="developer.kde.org/documentation/library/libraryref.html">KDE:s biblioteksreferensguide</ulink> och <ulink url="doc.trolltech.com">QT:s direktreferens</ulink>. </para>
@ -304,7 +304,7 @@ hello.resize( 100, 30 );
a.setTopWidget( &amp;hello ); a.setTopWidget( &amp;hello );
TQObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() )); TQObject::connect(&amp;hello, TQ_SIGNAL( clicked() ), &amp;a, TQ_SLOT( quit() ));
hello.show(); hello.show();
return a.exec(); return a.exec();
@ -549,10 +549,10 @@ return a.exec();
16 statusBar()->show(); 16 statusBar()->show();
17 17
18 // tillåt vyn att ändra statusraden och rubriken 18 // tillåt vyn att ändra statusraden och rubriken
19 connect(m_view, SIGNAL(signalChangeStatusbar(const TQString&amp;)), 19 connect(m_view, TQ_SIGNAL(signalChangeStatusbar(const TQString&amp;)),
20 this, SLOT(changeStatusbar(const TQString&amp;))); 20 this, TQ_SLOT(changeStatusbar(const TQString&amp;)));
21 connect(m_view, SIGNAL(signalChangeCaption(const TQString&amp;)), 21 connect(m_view, TQ_SIGNAL(signalChangeCaption(const TQString&amp;)),
22 this, SLOT(changeCaption(const TQString&amp;))); 22 this, TQ_SLOT(changeCaption(const TQString&amp;)));
23 23
24 } 24 }
</programlisting> </programlisting>

@ -881,23 +881,23 @@ rc_DATA = kviewui.rc
<para>Motsvarande del av att skapa detta i C++ är: </para> <para>Motsvarande del av att skapa detta i C++ är: </para>
<programlisting>KStdAction::zoomIn ( this, SLOT(slotZoomIn()), actionCollection() ); <programlisting>KStdAction::zoomIn ( this, TQ_SLOT(slotZoomIn()), actionCollection() );
KStdAction::zoomOut ( this, SLOT(slotZoomOut()), actionCollection() ); KStdAction::zoomOut ( this, TQ_SLOT(slotZoomOut()), actionCollection() );
KStdAction::zoom ( this, SLOT(slotZoom()), actionCollection() ); KStdAction::zoom ( this, TQ_SLOT(slotZoom()), actionCollection() );
new TDEAction ( i18n("&amp;Half size"), ALT+Key_0, new TDEAction ( i18n("&amp;Half size"), ALT+Key_0,
this, SLOT(slotHalfSize()), this, TQ_SLOT(slotHalfSize()),
actionCollection(), "zoom50" ); actionCollection(), "zoom50" );
new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1, new TDEAction ( i18n("&amp;Normal size"), ALT+Key_1,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom100" ); actionCollection(), "zoom100" );
new TDEAction ( i18n("&amp;Double size"), ALT+Key_2, new TDEAction ( i18n("&amp;Double size"), ALT+Key_2,
this, SLOT(slotDoubleSize()), this, TQ_SLOT(slotDoubleSize()),
actionCollection(), "zoom200" ); actionCollection(), "zoom200" );
new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3, new TDEAction ( i18n("&amp;Fill Screen"), ALT+Key_3,
this, SLOT(slotFillScreen()), this, TQ_SLOT(slotFillScreen()),
actionCollection(), "zoomMaxpect" ); actionCollection(), "zoomMaxpect" );
new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F, new TDEAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F,
this, SLOT(slotFullScreen()), this, TQ_SLOT(slotFullScreen()),
actionCollection(), "fullscreen" ); actionCollection(), "fullscreen" );
</programlisting> </programlisting>
@ -1400,8 +1400,8 @@ else
{ {
KURL url("http://developer.kde.org/favicon.ico"); KURL url("http://developer.kde.org/favicon.ico");
TDEIO::MimetypeJob *job = TDEIO::mimetype(url); TDEIO::MimetypeJob *job = TDEIO::mimetype(url);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mimeResult(TDEIO::Job*)) ); this, TQ_SLOT(mimeResult(TDEIO::Job*)) );
} }
void FooClass::mimeResult(TDEIO::Job *job) void FooClass::mimeResult(TDEIO::Job *job)
@ -1507,8 +1507,8 @@ new KRun(url);
<programlisting>void FooClass::makeDirectory() <programlisting>void FooClass::makeDirectory()
{ {
SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir")); SimpleJob *job = TDEIO::mkdir(KURL("file:/home/bernd/kiodir"));
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(mkdirResult(TDEIO::Job*)) ); this, TQ_SLOT(mkdirResult(TDEIO::Job*)) );
} }
void FooClass::mkdirResult(TDEIO::Job *job) void FooClass::mkdirResult(TDEIO::Job *job)
@ -1692,8 +1692,8 @@ if (TDEIO::NetAccess::download(url, tempFile) {
{ {
KURL url("http://developer.kde.org/documentation/kde2arch/index.html"); KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
TDEIO::TransferJob *job = TDEIO::get(url, true, false); TDEIO::TransferJob *job = TDEIO::get(url, true, false);
connect( job, SIGNAL(result(TDEIO::Job*)), connect( job, TQ_SIGNAL(result(TDEIO::Job*)),
this, SLOT(transferResult(TDEIO::Job*)) ); this, TQ_SLOT(transferResult(TDEIO::Job*)) );
} }
void FooClass::transferResult(TDEIO::Job *job) void FooClass::transferResult(TDEIO::Job *job)

Loading…
Cancel
Save