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 --- examples/extension/dialogform.ui | 206 +++++++++++++++++++++++++++++++++++++ examples/extension/dialogform.ui.h | 24 +++++ examples/extension/extension.doc | 41 ++++++++ examples/extension/extension.pro | 12 +++ examples/extension/extension.ui | 114 ++++++++++++++++++++ examples/extension/extension.ui.h | 7 ++ examples/extension/main.cpp | 11 ++ examples/extension/mainform.ui | 74 +++++++++++++ examples/extension/mainform.ui.h | 46 +++++++++ 9 files changed, 535 insertions(+) create mode 100644 examples/extension/dialogform.ui create mode 100644 examples/extension/dialogform.ui.h create mode 100644 examples/extension/extension.doc create mode 100644 examples/extension/extension.pro create mode 100644 examples/extension/extension.ui create mode 100644 examples/extension/extension.ui.h create mode 100644 examples/extension/main.cpp create mode 100644 examples/extension/mainform.ui create mode 100644 examples/extension/mainform.ui.h (limited to 'examples/extension') diff --git a/examples/extension/dialogform.ui b/examples/extension/dialogform.ui new file mode 100644 index 000000000..edb70c76c --- /dev/null +++ b/examples/extension/dialogform.ui @@ -0,0 +1,206 @@ + +DialogForm + + + DialogForm + + + + 0 + 0 + 288 + 145 + + + + Dialog + + + + unnamed + + + + Layout7 + + + + unnamed + + + + Layout5 + + + + unnamed + + + + Layout1 + + + + unnamed + + + + sessionsCheckBox + + + Save/Restore &Sessions + + + true + + + + + loggingCheckBox + + + &Log Activities + + + + + + + Spacer2 + + + Vertical + + + Expanding + + + + 20 + 0 + + + + + + Layout4 + + + + unnamed + + + + detailsPushButton + + + &Details >>> + + + + + Spacer4 + + + Horizontal + + + Expanding + + + + 0 + 20 + + + + + + + + + + Layout3 + + + + unnamed + + + + okPushButton + + + OK + + + true + + + + + cancelPushButton + + + Cancel + + + + + Spacer3 + + + Vertical + + + Expanding + + + + 20 + 0 + + + + + + + + + + + + okPushButton + clicked() + DialogForm + accept() + + + cancelPushButton + clicked() + DialogForm + reject() + + + detailsPushButton + clicked() + DialogForm + toggleDetails() + + + + extension.h + dialogform.ui.h + + + bool extensionShown; + + + toggleDetails() + + + init() + + + + diff --git a/examples/extension/dialogform.ui.h b/examples/extension/dialogform.ui.h new file mode 100644 index 000000000..d6f873f33 --- /dev/null +++ b/examples/extension/dialogform.ui.h @@ -0,0 +1,24 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions use TQt Designer which will +** update this file, preserving your code. Create an init() function in place +** of a constructor, and a destroy() function in place of a destructor. +*****************************************************************************/ + +void DialogForm::init() +{ + extensionShown = FALSE; + setExtension( new Extension( this ) ); + setOrientation( Vertical ); +} + + +void DialogForm::toggleDetails() +{ + extensionShown = !extensionShown; + showExtension( extensionShown ); + TQString text = tr( "&Details " ); + text += TQString( extensionShown ? "<<<" : ">>>" ); + detailsPushButton->setText( text ); +} diff --git a/examples/extension/extension.doc b/examples/extension/extension.doc new file mode 100644 index 000000000..98b4a3373 --- /dev/null +++ b/examples/extension/extension.doc @@ -0,0 +1,41 @@ +/*! + \page extension-dialog-example.html + + \ingroup step-by-step-examples + + + \title An Extension Dialog Example + + This example demonstrates how to create an extension dialog. + + Essentially all that is necessary is to create a standard dialog + and then create a QWidget form to be used as the extension. See + the article in \link http://doc.trolltech.com/qq/ Qt + Quarterly\endlink issue #3. + + +
+ + + Project file: + + \include extension/extension.pro + +
+ +
+ + Implementation: + + \include extension/mainform.ui.h + \include extension/dialogform.ui.h + \include extension/extension.ui.h + +
+ + Main: + + \include extension/main.cpp + + +*/ diff --git a/examples/extension/extension.pro b/examples/extension/extension.pro new file mode 100644 index 000000000..7cc65985a --- /dev/null +++ b/examples/extension/extension.pro @@ -0,0 +1,12 @@ +TEMPLATE = app +LANGUAGE = C++ + +CONFIG += qt warn_on release + +REQUIRES = full-config nocrosscompiler + +SOURCES += main.cpp +FORMS = mainform.ui \ + dialogform.ui \ + extension.ui +DBFILE = extension.db diff --git a/examples/extension/extension.ui b/examples/extension/extension.ui new file mode 100644 index 000000000..32dcc48b7 --- /dev/null +++ b/examples/extension/extension.ui @@ -0,0 +1,114 @@ + +Extension + + + Extension + + + + 0 + 0 + 258 + 128 + + + + Extension + + + + unnamed + + + + Layout6 + + + + unnamed + + + + TextLabel1 + + + Log &File + + + logfileLineEdit + + + + + logfileLineEdit + + + + + browsePushButton + + + &Browse... + + + + + + + ButtonGroup1 + + + Log What? + + + + unnamed + + + + Layout7 + + + + unnamed + + + 0 + + + 0 + + + + logActionsCheckBox + + + &Actions + + + true + + + + + logErrorsCheckBox + + + &Errors + + + true + + + + + + + + + + extension.ui.h + + + + diff --git a/examples/extension/extension.ui.h b/examples/extension/extension.ui.h new file mode 100644 index 000000000..e43b8f3fd --- /dev/null +++ b/examples/extension/extension.ui.h @@ -0,0 +1,7 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions use TQt Designer which will +** update this file, preserving your code. Create an init() function in place +** of a constructor, and a destroy() function in place of a destructor. +*****************************************************************************/ diff --git a/examples/extension/main.cpp b/examples/extension/main.cpp new file mode 100644 index 000000000..608ef06a6 --- /dev/null +++ b/examples/extension/main.cpp @@ -0,0 +1,11 @@ +#include +#include "mainform.h" + +int main( int argc, char ** argv ) +{ + TQApplication a( argc, argv ); + MainForm *w = new MainForm; + w->show(); + a.connect( &a, SIGNAL( lastWindowClosed() ), w, SLOT( tquit() ) ); + return a.exec(); +} diff --git a/examples/extension/mainform.ui b/examples/extension/mainform.ui new file mode 100644 index 000000000..db156785b --- /dev/null +++ b/examples/extension/mainform.ui @@ -0,0 +1,74 @@ + +MainForm + + + MainForm + + + + 0 + 0 + 284 + 120 + + + + Main Form + + + + unnamed + + + + optionsPushButton + + + &Options... + + + + + tquitPushButton + + + &Quit + + + + + + + optionsPushButton + clicked() + MainForm + optionsDlg() + + + tquitPushButton + clicked() + MainForm + tquit() + + + + mainform.ui.h + + + bool log_errors; + bool log_warnings; + bool log_actions; + bool logging; + bool sessions; + TQString log_filename; + + + optionsDlg() + tquit() + + + init() + + + + diff --git a/examples/extension/mainform.ui.h b/examples/extension/mainform.ui.h new file mode 100644 index 000000000..82fc700d0 --- /dev/null +++ b/examples/extension/mainform.ui.h @@ -0,0 +1,46 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions use TQt Designer which will +** update this file, preserving your code. Create an init() function in place +** of a constructor, and a destroy() function in place of a destructor. +*****************************************************************************/ +#include "dialogform.h" +#include "extension.h" +#include +#include +#include + +void MainForm::init() +{ + sessions = FALSE; + logging = FALSE; + log_filename = TQString::null; + log_errors = TRUE; + log_actions = TRUE; +} + +void MainForm::optionsDlg() +{ + DialogForm *dlg = new DialogForm( this, "dialog", TRUE ); + Extension *ext = (Extension*)dlg->extension()->qt_cast( "Extension" ); + if ( !ext ) + return; + dlg->sessionsCheckBox->setChecked( sessions ); + dlg->loggingCheckBox->setChecked( logging ); + ext->logfileLineEdit->setText( log_filename ); + ext->logErrorsCheckBox->setChecked( log_errors ); + + if ( dlg->exec() ) { + sessions = dlg->sessionsCheckBox->isChecked(); + logging = dlg->loggingCheckBox->isChecked(); + log_filename = ext->logfileLineEdit->text(); + log_errors = ext->logErrorsCheckBox->isChecked(); + } +} + + +void MainForm::tquit() +{ + TQApplication::exit( 0 ); +} -- cgit v1.2.1