* demo/src/mainwindow.cc,
* demo/src/mainwindow.hh,
* demo/ui/mainwindow.ui: add new functionalities.
- Auto-demo.
- Display ppm pictures instead of pbm ones.
---
scribo/ChangeLog | 10 ++
scribo/demo/src/mainwindow.cc | 286 +++++++++++++++++++++++++++++++----
scribo/demo/src/mainwindow.hh | 42 +++++-
scribo/demo/ui/mainwindow.ui | 333 ++++++++++++++++++++++++++++++++---------
4 files changed, 564 insertions(+), 107 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 39c6c72..2b85769 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,15 @@
2009-06-23 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Improve Scribo demo.
+
+ * demo/src/mainwindow.cc,
+ * demo/src/mainwindow.hh,
+ * demo/ui/mainwindow.ui: add new functionalities.
+ - Auto-demo.
+ - Display ppm pictures instead of pbm ones.
+
+2009-06-23 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Update Scribo.
* extract/lines_discontinued.hh: remove. Useless.
diff --git a/scribo/demo/src/mainwindow.cc b/scribo/demo/src/mainwindow.cc
index 28e120e..1bfaec9 100644
--- a/scribo/demo/src/mainwindow.cc
+++ b/scribo/demo/src/mainwindow.cc
@@ -34,15 +34,15 @@
const char * modes[][4] = {
- { "Text in pictures", "pics", "text_in_photo",
"image-x-generic.png" },
+ { "Text in pictures", "pics", "../src/text_in_photo",
"image-x-generic.png" },
{ (const char *)(1), 0, 0, 0}, // Separator
- { "Handwritten text lines", "hsc", "input_to_lines",
"text-x-generic.png" },
- { "Handwritten text words", "hsc", "input_to_words",
"text-x-generic.png" },
+ { "Handwritten text lines", "hsc",
"../../milena/sandbox/icdar/2009/hsc/input_to_lines",
"text-x-generic.png" },
+ { "Handwritten text words", "hsc",
"../../milena/sandbox/icdar/2009/hsc/input_to_words",
"text-x-generic.png" },
{ (const char *)(1), 0, 0, 0}, // Separator
- { "Horizontal and Vertical Lines", "hvl",
"extract/primitive/find_discontinued_lines", "list-add.png" },
- { "Tables", "tables", "table/extract",
"x-office-spreadsheet.png" },
- { "Pre-processing", "pproc", "preprocess",
"format-indent-more.png" },
- { "OCR", "ocr", "recognition", "edit-find.png"
},
+ { "Horizontal and Vertical Lines", "hvl",
"../src/extract/primitive/find_discontinued_lines", "list-add.png" },
+ { "Tables", "hvl", "../src/table/extract",
"x-office-spreadsheet.png" },
+ { "Pre-processing", "pproc", "../src/preprocess",
"format-indent-more.png" },
+ { "OCR", "ocr", "../src/recognition",
"edit-find.png" },
{ 0, 0, 0 } // Empty line, do NOT delete.
};
@@ -63,7 +63,7 @@ const char *args_list[][3] = {
{ "/dev/null", 0, 0 }, // Handwritten text lines
{ "/dev/null", 0, 0 }, // Handwritten text words
{ (const char *)(1), 0, 0}, // Separator
- { "51", "6", 0 }, // Horizontal and Vertical lines
+ { "51", 0, 0 }, // Horizontal and Vertical lines
{ "/dev/null", 0, 0 }, // Tables
{ 0, 0, 0 }, // Pre-processing
{ 0, 0, 0 }, // OCR
@@ -83,14 +83,22 @@ namespace scribo
{
setupUi(this);
- mainItem_ = 0;
- exec_prefix_ = "../src/";
+ unsigned nmodes = 0;
+ for (unsigned i = 0; modes[i][0] != 0; ++i)
+ ++nmodes;
+
+ cached_result_.resize(nmodes);
+ mainRefItem_ = 0;
+ mainResultItem_ = 0;
+ exec_prefix_ = "";
base_img_dir_ = QCoreApplication::applicationDirPath();
pdialog_.setRange(0,0);
pdialog_.setLabelText(tr("Please wait while computing..."));
pdialog_.setWindowModality(Qt::WindowModal);
+ qDebug() << "Cache located in " << QDir::tempPath();
+
connect(&pdialog_, SIGNAL(canceled()), this, SLOT(compute_canceled()));
connect(&exec_, SIGNAL(finished(int, QProcess::ExitStatus)),
this, SLOT(exec_finished(int, QProcess::ExitStatus)));
@@ -100,12 +108,36 @@ namespace scribo
connect(&context_, SIGNAL(triggered(QAction *)),
this, SLOT(context_changed(QAction *)));
+ connect(imageResult->verticalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(move_vertical_sliders(int)));
+ connect(imageResult->horizontalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(move_horizontal_sliders(int)));
+ connect(imageRef->verticalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(move_vertical_sliders(int)));
+ connect(imageRef->horizontalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(move_horizontal_sliders(int)));
+ connect(&timer_, SIGNAL(timeout()), this, SLOT(timer_timeout()));
+
context_.setExclusive(true);
+ // No status bar.
+ setStatusBar(0);
+
initToolBar();
setup_scene();
}
+ MainWindow::~MainWindow()
+ {
+ for (int i = 0; i < cached_result_.size(); ++i)
+ foreach(QString value, cached_result_[i])
+ {
+ QFile f(value);
+ f.remove();
+ }
+ }
+
+
void MainWindow::set_base_img_dir(const QString& dir)
{
QDir d(dir);
@@ -130,6 +162,7 @@ namespace scribo
context_.addAction(action);
action->setCheckable(true);
action->setData(i);
+ action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0 + i));
if (modes[i][3] != 0)
action->setIcon(QIcon(QString(":/icons/") + modes[i][3]));
@@ -143,7 +176,7 @@ namespace scribo
void MainWindow::on_browseBtn_clicked(bool)
{
- QString current_dir = modes[mode_][1] + QString("/");
+ QString current_dir = current_mode() + "/";
QString
filename = QFileDialog::getOpenFileName(this,
@@ -151,30 +184,61 @@ namespace scribo
base_img_dir_ + "/" + current_dir,
tr("Images (*.pbm *.pgm *.ppm)"));
+ prepare_for_run(filename);
+ }
+
+ void MainWindow::prepare_for_run(const QString& filename)
+ {
if (!filename.isEmpty())
{
filepath->setText(filename);
- update_pixmap(filepath->text());
+
+ update_pixmap(imageRef, filename);
+ update_pixmap(imageResult);
+
+ if (autoRun->isChecked())
+ on_runBtn_clicked();
}
}
-
- void MainWindow::on_runBtn_clicked(bool)
+ void MainWindow::on_runBtn_clicked()
{
+ if (useCache->isChecked() &&
cached_result_[mode_].contains(filepath->text()))
+ {
+ last_output_ = cached_result_[mode_][filepath->text()];
+ exec_finished(0, QProcess::NormalExit);
+ return;
+ }
+
wait_for_result();
QStringList args;
- args << filepath->text();
+
+ QString input = filepath->text();
+
+ // Loading ppm file
+ if (current_mode() == "pics")
+ {
+ QFileInfo f(input);
+ QDir dir = f.absoluteDir();
+ dir.cd("../pics_pbm");
+
+ QFileInfo pbm_file(dir.path() + "/" + f.completeBaseName() +
".pbm");
+ if (pbm_file.exists())
+ input = pbm_file.absoluteFilePath();
+ }
+
+ args << input;
for (unsigned i = 0; args_list[mode_][i]; ++i)
args << args_list[mode_][i];
- if (!is_in_ocr_mode())
- {
+// if (!is_in_ocr_mode())
+// {
QTemporaryFile f;
f.open();
args << f.fileName();
last_output_ = f.fileName();
- }
+// }
exec_.start(exec_prefix_ + modes[mode_][2], args);
}
@@ -182,7 +246,7 @@ namespace scribo
void MainWindow::on_displayBtn_clicked(bool)
{
- update_pixmap(filepath->text());
+ update_pixmap(imageRef, filepath->text());
}
@@ -195,8 +259,36 @@ namespace scribo
}
- void MainWindow::update_pixmap(const QString& name)
+ void MainWindow::on_zoomIn_clicked()
+ {
+ imageResult->scale(1.2, 1.2);
+ imageRef->scale(1.2, 1.2);
+ }
+
+ void MainWindow::on_zoomOut_clicked()
+ {
+ imageResult->scale(1 / 1.2, 1 / 1.2);
+ imageRef->scale(1 / 1.2, 1 / 1.2);
+ }
+
+ QGraphicsItem *& MainWindow::view_to_item(QGraphicsView *view)
+ {
+ if (view == imageResult)
+ return mainResultItem_;
+ else
+ return mainRefItem_;
+ }
+
+ void MainWindow::update_pixmap(QGraphicsView* view, const QString& name)
{
+ if (name.isEmpty())
+ {
+ update_status_message("");
+ return;
+ }
+
+ QGraphicsItem* item = view_to_item(view);
+
QPixmap pixmap;
if (!pixmap.load(name))
{
@@ -205,35 +297,67 @@ namespace scribo
return;
}
- imageResult->scene()->removeItem(mainItem_);
- mainItem_ = imageResult->scene()->addPixmap(pixmap);
- imageResult->scene()->setSceneRect(mainItem_->boundingRect());
- Q_ASSERT(mainItem_ != 0);
+ QFileInfo finfo(name);
+ if (item != mainResultItem_ && current_mode() != "hsc"
+ && current_mode() != "pproc"
+ && (current_mode() != "pics" || finfo.suffix() == "pbm"))
+ {
+ QImage image(pixmap.toImage());
+ image.invertPixels();
+ pixmap = QPixmap::fromImage(image);
+ }
+
+ if (item != 0)
+ {
+ view->scene()->removeItem(item);
+ delete item;
+ }
+ item = view->scene()->addPixmap(pixmap);
+ view->scene()->setSceneRect(item->boundingRect());
+ Q_ASSERT(item != 0);
+ view->fitInView(item->boundingRect(), Qt::KeepAspectRatio);
+ view_to_item(view) = item;
+
+ bool b = (mainResultItem_ != 0 || mainRefItem_ != 0);
+ zoomLabel->setEnabled(b);
+ zoomIn->setEnabled(b);
+ zoomOut->setEnabled(b);
+ zoomFixed->setEnabled(b);
+ zoomOriginal->setEnabled(b);
}
void MainWindow::exec_finished(int rvalue, QProcess::ExitStatus status)
{
pdialog_.hide();
- qDebug() << rvalue;
if (rvalue == 0)
{
if (status != QProcess::CrashExit)
{
+ if (useCache->isChecked())
+ cached_result_[mode_][filepath->text()] = last_output_;
+
setEnabled(true);
if (is_in_ocr_mode())
{
- textBrowser->setText(exec_.readAllStandardOutput());
+ QFile f(last_output_);
+ f.open(QIODevice::ReadOnly);
+ textBrowser->setText(QString::fromUtf8(f.readAll().data()));
+// textBrowser->setText(exec_.readAllStandardOutput());
on_displayBtn_clicked(true);
tabWidget->setCurrentIndex(1);
}
else
- update_pixmap(last_output_);
+ update_pixmap(imageResult, last_output_);
}
// Else : canceled.
}
else
exec_error(tr("Error during last run."));
+
+ imageResult->setFocus();
+ if (autoDemo->isChecked())
+ timer_.start(timeoutDelay->text().toInt() * 1000);
}
@@ -242,10 +366,14 @@ namespace scribo
QGraphicsScene *scene = new QGraphicsScene();
imageResult->setScene(scene);
+ scene = new QGraphicsScene();
+ imageRef->setScene(scene);
+
update_status_message(tr("1) Choose an algorithm.\n\
2) Select an image.\n3) Run."));
imageResult->show();
+ imageRef->show();
}
@@ -255,15 +383,18 @@ namespace scribo
setEnabled(false);
if (!is_in_ocr_mode())
- update_status_message(tr("Please wait while computing..."));
+ update_status_message("");
}
void MainWindow::update_status_message(const QString& msg)
{
- if (mainItem_ != 0)
- imageResult->scene()->removeItem(mainItem_);
- mainItem_ = imageResult->scene()->addText(msg);
+ if (mainResultItem_ != 0)
+ {
+ imageResult->scene()->removeItem(mainResultItem_);
+ delete mainResultItem_;
+ }
+ mainResultItem_ = imageResult->scene()->addText(msg);
}
@@ -283,7 +414,8 @@ namespace scribo
exec_error(tr("This program does not exist: ")
+ exec_prefix_ + modes[mode_][2]);
else
- qDebug() << "The computation stopped.";
+ exec_error(tr("The computation stopped.")
+ + exec_prefix_ + modes[mode_][2]);
}
@@ -305,7 +437,95 @@ namespace scribo
bool MainWindow::is_in_ocr_mode()
{
- return (QString(modes[mode_][1]) == "ocr");
+ return current_mode() == "ocr";
+ }
+
+
+ void MainWindow::resize_pixmaps(const QRectF& rect)
+ {
+ if (mainRefItem_ != 0)
+ imageRef->fitInView(rect, Qt::KeepAspectRatio);
+ if (mainResultItem_ != 0)
+ imageResult->fitInView(rect, Qt::KeepAspectRatio);
+ }
+
+ void MainWindow::move_vertical_sliders(int value)
+ {
+ imageRef->verticalScrollBar()->setValue(value);
+ imageResult->verticalScrollBar()->setValue(value);
+ }
+
+ void MainWindow::move_horizontal_sliders(int value)
+ {
+ imageRef->horizontalScrollBar()->setValue(value);
+ imageResult->horizontalScrollBar()->setValue(value);
+ }
+
+
+ void MainWindow::on_zoomFixed_clicked()
+ {
+ resize_pixmaps(mainRefItem_->boundingRect());
+ }
+
+ void MainWindow::on_zoomOriginal_clicked()
+ {
+ resize_pixmaps(imageResult->viewport()->geometry());
+ }
+
+ void MainWindow::on_autoDemo_clicked(bool checked)
+ {
+ if (checked)
+ timer_.start(100);
+ else
+ timer_.stop();
+ }
+
+ void MainWindow::resizeEvent(QResizeEvent * event)
+ {
+ if (mainRefItem_ != 0)
+ resize_pixmaps(mainRefItem_->boundingRect());
+ event->ignore();
+ }
+
+ void MainWindow::keyPressEvent(QKeyEvent *event)
+ {
+ if (event->text() == QString("+"))
+ {
+ on_zoomIn_clicked();
+ event->accept();
+ }
+ else if (event->text() == QString("-"))
+ {
+ on_zoomOut_clicked();
+ event->accept();
+ }
+ else
+ event->ignore();
+ }
+
+ QString MainWindow::current_mode() const
+ {
+ return modes[mode_][1];
+ }
+
+ void MainWindow::timer_timeout()
+ {
+ update_auto_demo_dir();
+ timer_.stop();
+ prepare_for_run(demoDir_.absolutePath() + "/"
+ + demo_files_[demo_index_]);
+ demo_index_ = (demo_index_ + 1) % demo_files_.size();
+ }
+
+ void MainWindow::update_auto_demo_dir()
+ {
+ QString tmp_path = base_img_dir_ + "/" + current_mode();
+ if (demoDir_.path() != tmp_path)
+ {
+ demoDir_.setPath(tmp_path);
+ demo_index_ = 0;
+ demo_files_ = demoDir_.entryList(QDir::NoDotAndDotDot | QDir::Files);
+ }
}
} // end of namespace scribo::demo
diff --git a/scribo/demo/src/mainwindow.hh b/scribo/demo/src/mainwindow.hh
index 25b7667..3641658 100644
--- a/scribo/demo/src/mainwindow.hh
+++ b/scribo/demo/src/mainwindow.hh
@@ -25,6 +25,8 @@
#ifndef SCRIBO_APPS_DEMO_SRC_MAINWINDOW_HH
+# include <QDir>
+# include <QTimer>
# include <QStringList>
# include <QProcess>
# include <QtGui/QWidget>
@@ -44,6 +46,7 @@ namespace scribo
public:
MainWindow(QWidget *parent = 0);
+ ~MainWindow();
void set_base_img_dir(const QString& dir);
@@ -51,9 +54,14 @@ namespace scribo
void initToolBar();
void on_browseBtn_clicked(bool b);
- void on_runBtn_clicked(bool b);
+ void on_runBtn_clicked();
void on_displayBtn_clicked(bool b);
void on_filepath_textChanged();
+ void on_zoomIn_clicked();
+ void on_zoomOut_clicked();
+ void on_zoomFixed_clicked();
+ void on_zoomOriginal_clicked();
+ void on_autoDemo_clicked(bool checked);
void exec_finished(int rvalue, QProcess::ExitStatus status);
void exec_error(QProcess::ProcessError error);
@@ -62,9 +70,15 @@ namespace scribo
void compute_canceled();
+ void resize_pixmaps(const QRectF& rect);
+
+ void move_vertical_sliders(int value);
+ void move_horizontal_sliders(int value);
+ void timer_timeout();
+
private: // Members
void setup_scene();
- void update_pixmap(const QString& name);
+ void update_pixmap(QGraphicsView* view, const QString& name = QString());
void exec_error(const QString& msg);
@@ -72,10 +86,22 @@ namespace scribo
void update_status_message(const QString& msg);
- bool is_in_ocr_mode();
+ void prepare_for_run(const QString& filename);
+
+ bool is_in_ocr_mode();
+
+ QGraphicsItem *& view_to_item(QGraphicsView *view);
+
+ void resizeEvent(QResizeEvent * event);
+ void keyPressEvent(QKeyEvent *event);
+
+ QString current_mode() const;
+
+ void update_auto_demo_dir();
private: // Attributes
- QGraphicsItem *mainItem_;
+ QGraphicsItem *mainRefItem_;
+ QGraphicsItem *mainResultItem_;
QString exec_prefix_;
QActionGroup context_;
@@ -86,6 +112,14 @@ namespace scribo
QProgressDialog pdialog_;
QString base_img_dir_;
+
+ QVector<QHash<QString, QString> > cached_result_;
+
+ /// Related to auto demo.
+ QTimer timer_;
+ QDir demoDir_;
+ unsigned demo_index_;
+ QStringList demo_files_;
};
diff --git a/scribo/demo/ui/mainwindow.ui b/scribo/demo/ui/mainwindow.ui
index 9a237be..cb85804 100644
--- a/scribo/demo/ui/mainwindow.ui
+++ b/scribo/demo/ui/mainwindow.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow" >
- <property name="geometry" >
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,122 +10,314 @@
<height>459</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Scribo Demo - v0.1</string>
</property>
- <property name="dockOptions" >
+ <property name="dockOptions">
<set>QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>
</property>
- <widget class="QWidget" name="centralwidget" >
- <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <property name="unifiedTitleAndToolBarOnMac">
+ <bool>false</bool>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <layout class="QVBoxLayout" name="verticalLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <property name="margin">
+ <number>5</number>
+ </property>
<item>
- <layout class="QGridLayout" name="gridLayout" >
- <item row="0" column="0" colspan="4" >
- <widget class="QLabel" name="description" >
- <property name="text" >
- <string>Write description here.</string>
- </property>
- </widget>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLineEdit" name="filepath"/>
</item>
- <item row="1" column="0" >
- <widget class="QLineEdit" name="filepath" />
- </item>
- <item row="1" column="1" >
- <widget class="QPushButton" name="browseBtn" >
- <property name="text" >
+ <item row="0" column="1">
+ <widget class="QPushButton" name="browseBtn">
+ <property name="text">
<string>&Browse</string>
</property>
- <property name="icon" >
- <iconset resource="../demo.qrc" >
+ <property name="icon">
+ <iconset resource="../demo.qrc">
<normaloff>:/icons/document-open.png</normaloff>:/icons/document-open.png</iconset>
</property>
+ <property name="shortcut">
+ <string>Ctrl+B</string>
+ </property>
</widget>
</item>
- <item row="1" column="2" >
- <widget class="QPushButton" name="displayBtn" >
- <property name="enabled" >
+ <item row="0" column="2">
+ <widget class="QPushButton" name="displayBtn">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="text" >
- <string>Display</string>
+ <property name="text">
+ <string>Refresh</string>
</property>
- <property name="icon" >
- <iconset resource="../demo.qrc" >
+ <property name="icon">
+ <iconset resource="../demo.qrc">
<normaloff>:/icons/view-refresh.png</normaloff>:/icons/view-refresh.png</iconset>
</property>
</widget>
</item>
- <item row="1" column="3" >
- <widget class="QPushButton" name="runBtn" >
- <property name="enabled" >
+ <item row="0" column="3">
+ <widget class="QPushButton" name="runBtn">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="text" >
+ <property name="text">
<string>Run</string>
</property>
- <property name="icon" >
- <iconset resource="../demo.qrc" >
+ <property name="icon">
+ <iconset resource="../demo.qrc">
<normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset>
</property>
</widget>
</item>
+ <item row="0" column="4">
+ <widget class="QCheckBox" name="autoRun">
+ <property name="text">
+ <string>Auto Run</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5">
+ <widget class="QCheckBox" name="useCache">
+ <property name="text">
+ <string>Enable cache</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item>
- <widget class="QTabWidget" name="tabWidget" >
- <property name="currentIndex" >
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="spacing">
+ <number>-1</number>
+ </property>
+ <property name="bottomMargin">
<number>0</number>
</property>
- <widget class="QWidget" name="tab" >
- <attribute name="title" >
- <string>Image</string>
- </attribute>
- <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="zoomLabel">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Zoom:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="zoomIn">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
<item>
- <widget class="QGraphicsView" name="imageResult" />
+ <widget class="QPushButton" name="zoomOut">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>-</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="zoomFixed">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Fixed width</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="zoomOriginal">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Original size</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="autoDemo">
+ <property name="text">
+ <string>Auto demo</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+D</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="timeoutDelay">
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="inputMask">
+ <string/>
+ </property>
+ <property name="text">
+ <string>5</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>s.</string>
+ </property>
+ </widget>
</item>
</layout>
- </widget>
- <widget class="QWidget" name="tab_2" >
- <attribute name="title" >
- <string>Text</string>
- </attribute>
- <layout class="QVBoxLayout" name="verticalLayout_4" >
+ </item>
+ <item>
+ <layout class="QHBoxLayout"
name="horizontalLayout_2">
<item>
- <widget class="QTextBrowser" name="textBrowser" >
- <property name="html" >
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext"
content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans
Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0;
text-indent:0px;">Test</p></body></html></string>
+ <widget class="QTabWidget" name="tabWidget_2">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab_3">
+ <attribute name="title">
+ <string>Reference Image</string>
+ </attribute>
+ <layout class="QVBoxLayout"
name="verticalLayout">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QGraphicsView" name="imageRef"/>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
</property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Result Image</string>
+ </attribute>
+ <layout class="QVBoxLayout"
name="verticalLayout_3">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QGraphicsView"
name="imageResult"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <property name="font">
+ <font>
+ <kerning>true</kerning>
+ </font>
+ </property>
+ <attribute name="title">
+ <string>Text</string>
+ </attribute>
+ <layout class="QVBoxLayout"
name="verticalLayout_4">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QTextBrowser"
name="textBrowser">
+ <property name="html">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext"
content="1" /><style
type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style="
font-family:'Lucida Grande'; font-size:13pt; font-weight:400;
font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
style=" font-family:'Sans Serif';
font-size:9pt;">Test</span></p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
</layout>
- </widget>
- </widget>
+ </item>
+ </layout>
</item>
</layout>
</item>
</layout>
</widget>
- <widget class="QMenuBar" name="menubar" >
- <property name="geometry" >
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>658</width>
- <height>31</height>
+ <height>22</height>
</rect>
</property>
</widget>
- <widget class="QStatusBar" name="statusbar" />
+ <widget class="QStatusBar" name="statusbar"/>
</widget>
<resources>
- <include location="../demo.qrc" />
+ <include location="../demo.qrc"/>
</resources>
<connections>
<connection>
@@ -133,13 +326,13 @@ p, li { white-space: pre-wrap; }
<receiver>displayBtn</receiver>
<slot>click()</slot>
<hints>
- <hint type="sourcelabel" >
- <x>201</x>
- <y>92</y>
+ <hint type="sourcelabel">
+ <x>213</x>
+ <y>62</y>
</hint>
- <hint type="destinationlabel" >
- <x>516</x>
- <y>92</y>
+ <hint type="destinationlabel">
+ <x>564</x>
+ <y>64</y>
</hint>
</hints>
</connection>
--
1.5.6.5