Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

main.cpp

Go to the documentation of this file.
00001 #include <WApplication>
00002 #include <WContainerWidget>
00003 #include <WText>
00004 #include <WPushButton>
00005 #undef SLOT
00006 //qt includes
00007 
00008 #include <QString>
00009 #include <QStringList>
00010 
00011 //omg includes
00012 #include <omgui.h>
00013 
00014 //
00015 // This is the entry-point for the program.
00016 //
00017 // This function is executed when a new user surfs to the Wt application,
00018 // and after the library has negotiated browser support. When this function
00019 // returns, the application is terminated.
00020 
00021 int wmain(int argc, char **argv)
00022 {
00023   // Instantiate the Wt application.
00024 
00025   WApplication appl(argc, argv);
00026 
00027   // Widgets can be added to a parent by calling addWidget()...
00028   // WApplication::root() is a WContainerWidget that is associated with
00029   // the entire browser window.
00030 
00031   appl.root()->addWidget(new WText("<h1>Hello, World!</h1>"));
00032 
00033   // .. or by specifying a parent at construction
00034 
00035   WPushButton *Button = new WPushButton("Quit", appl.root());
00036 
00037   //Print a list of available algorithms
00038   QStringList myList = Omgui::getModellerPluginNameList();
00039   QStringListIterator myIterator(myList);
00040   qDebug("Looking for plugins");
00041   while (myIterator.hasNext())
00042   {
00043     QString myString = myIterator.next();
00044     qDebug("Found plugin : " + myString.toLocal8Bit());
00045     myString += "<br />";
00046     //appl.root()->addWidget(new WText(myString.toStdString()));
00047   }
00048   // React to user events using a signal/slot mechanism.
00049 
00050   Button->clicked.connect(&appl, &WApplication::quit);
00051 
00052   // Start the application event loop.
00053   //   This function returns when the user has closed the application window
00054   //   (which is detected by a time-out of the keep-alive messages), or when
00055   //   the application is exited using the Quit button.
00056 
00057   return appl.exec();
00058 }

Generated on Mon Apr 28 15:06:39 2008 for openModellerDesktop by  doxygen 1.4.1-20050210