Przeglądaj źródła

First demo of successful processing by ctkCLIModuleTour inside hosted app

Ivo Wolf 13 lat temu
rodzic
commit
8cafd4e0f6

+ 8 - 3
Libs/CommandLineModules/Core/Testing/CLIModules/Tour/ctkCLIModuleTour.cpp

@@ -45,11 +45,12 @@ int main(int argc, char* argv[])
   parser.addArgument("help", "h", QVariant::Bool, "Show this help text");
   parser.addArgument("xml", "", QVariant::Bool, "Print a XML description of this modules command line interface");
 
-  parser.addArgument("integer", "", QVariant::Int, "Show this help text");
-  parser.addArgument("", "b", QVariant::Bool, "Show this help text");
+  parser.addArgument("integer", "i", QVariant::Int, "Show this help text",15);
+  parser.addArgument("", "b", QVariant::String, "Show this help text");
   parser.addArgument("double", "d", QVariant::Double, "Show this help text");
   parser.addArgument("floatVector", "f", QVariant::String, "Show this help text");
   parser.addArgument("enumeration", "e", QVariant::String, "Show this help text");
+  parser.addArgument("string_vector", "", QVariant::String, "Show this help text");
   parser.addArgument("", "p", QVariant::String, "Show this help text");
 
   // Parse the command line arguments
@@ -79,6 +80,10 @@ int main(int argc, char* argv[])
   {
     QTextStream(stdout, QIODevice::WriteOnly) << parsedArgs["p"].toString();
   }
+  if(parsedArgs.contains("double"))
+  {
+    QTextStream(stdout, QIODevice::WriteOnly) << parsedArgs["double"].toString();
+  }
 
   // Do something
   // do we have enough information (input/output)?
@@ -90,7 +95,7 @@ int main(int argc, char* argv[])
     QPixmap pix(input);
     QPainter painter(&pix);
     painter.setPen(Qt::white);
-    painter.setFont(QFont("Arial", 15));
+    painter.setFont(QFont("Arial", parsedArgs["integer"].toInt()));
     painter.drawText(pix.rect(),Qt::AlignBottom|Qt::AlignLeft,"Result image produced by ctkCLIModuleTour");
     pix.save(output, "JPEG");
   }

+ 3 - 0
Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppLogic.cpp

@@ -319,6 +319,9 @@ void ctkCommandLineModuleAppLogic::onCreateSecondaryCapture()
     ModuleInstance->setValue("dirVar", outputFileName);
     ModuleInstance->run();
 
+    QPixmap resultpix(outputFileName);
+    ui.PlaceHolderForResult->setPixmap(resultpix);
+
     //if(tempfile->open())
     //{
     //  QString filename = QFileInfo(tempfile->fileName()).absoluteFilePath();

+ 34 - 17
Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppWidget.ui

@@ -58,23 +58,40 @@
     </widget>
    </item>
    <item>
-    <widget class="QLabel" name="PlaceHolderForImage">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>100</width>
-       <height>100</height>
-      </size>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="PlaceHolderForImage">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>100</width>
+         <height>100</height>
+        </size>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="PlaceHolderForResult">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
    <item>
     <widget class="QPushButton" name="CreateSecondaryCaptureButton">