From d796c9dd933ab96ec83b9a634feedd5d32e1ba3f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 8 Nov 2011 12:31:36 -0600 Subject: Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731 --- doc/html/toggleaction-example.html | 82 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 doc/html/toggleaction-example.html (limited to 'doc/html/toggleaction-example.html') diff --git a/doc/html/toggleaction-example.html b/doc/html/toggleaction-example.html new file mode 100644 index 000000000..8e5247404 --- /dev/null +++ b/doc/html/toggleaction-example.html @@ -0,0 +1,82 @@ + + + + + +A Tiny Example Featuring a Toggle Action + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

A Tiny Example Featuring a Toggle Action

+ + +

+

This example program demonstrates the use of TQAction +in its incarnation as a toggle action. +


+

Main: +

#include <qapplication.h>
+#include <qmainwindow.h>
+#include <qtoolbar.h>
+#include <qaction.h>
+
+#include "labelonoff.xpm"
+
+int main( int argc, char **argv )
+{
+    TQApplication app( argc, argv );
+    TQMainWindow * window = new TQMainWindow;
+    window->setCaption("TQt Example - Toggleaction");
+    TQToolBar * toolbar = new TQToolBar( window );
+
+    TQAction * labelonoffaction = new TQAction( window, "labelonoff" );
+    labelonoffaction->setToggleAction( TRUE );
+
+    labelonoffaction->setText( "labels on/off" );
+    labelonoffaction->setAccel( TQt::ALT+TQt::Key_L );
+    labelonoffaction->setIconSet( (TQPixmap) labelonoff_xpm );
+
+    TQObject::connect( labelonoffaction, SIGNAL( toggled( bool ) ),
+                      window, SLOT( setUsesTextLabel( bool ) ) );
+
+    labelonoffaction->addTo( toolbar );
+
+    app.setMainWidget( window );
+    window->show();
+    return app.exec();
+}
+
+
+ +

See also TQAction Examples. + + +


+ +
Copyright © 2007 +TrolltechTrademarks +
TQt 3.3.8
+
+ -- cgit v1.2.1