# HG changeset patch
# User am@osimis.io
# Date 1539687458 -7200
# Node ID 612238b3f3e89fc5a55947fbde6afbaba20a8795
# Parent 37ab9d83dc9ba4b8221a2b0b6931910e9199beb3
all 4 samples now working in Qt, SDL and wasm
diff -r 37ab9d83dc9b -r 612238b3f3e8 Applications/Samples/CMakeLists.txt
--- a/Applications/Samples/CMakeLists.txt Tue Oct 16 11:30:00 2018 +0200
+++ b/Applications/Samples/CMakeLists.txt Tue Oct 16 12:57:38 2018 +0200
@@ -95,6 +95,8 @@
${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleQtApplicationRunner.h
${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleMainWindow.cpp
${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleMainWindow.ui
+ ${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleMainWindowWithButtons.cpp
+ ${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleMainWindowWithButtons.ui
)
endif()
diff -r 37ab9d83dc9b -r 612238b3f3e8 Applications/Samples/Qt/SampleMainWindow.cpp
--- a/Applications/Samples/Qt/SampleMainWindow.cpp Tue Oct 16 11:30:00 2018 +0200
+++ b/Applications/Samples/Qt/SampleMainWindow.cpp Tue Oct 16 12:57:38 2018 +0200
@@ -32,36 +32,13 @@
namespace Samples
{
- SampleMainWindow::SampleMainWindow(OrthancStone::NativeStoneApplicationContext& context, OrthancStone::Samples::SampleApplicationBase& stoneSampleApplication, QWidget *parent) :
+ SampleMainWindow::SampleMainWindow(OrthancStone::NativeStoneApplicationContext& context, OrthancStone::Samples::SampleSingleCanvasApplicationBase& stoneSampleApplication, QWidget *parent) :
QStoneMainWindow(context, parent),
ui_(new Ui::SampleMainWindow),
stoneSampleApplication_(stoneSampleApplication)
{
ui_->setupUi(this);
SetCentralStoneWidget(ui_->cairoCentralWidget);
-
-#if QT_VERSION >= 0x050000
- connect(ui_->toolButton1, &QToolButton::clicked, this, &SampleMainWindow::tool1Clicked);
- connect(ui_->toolButton2, &QToolButton::clicked, this, &SampleMainWindow::tool2Clicked);
- connect(ui_->pushButton1, &QPushButton::clicked, this, &SampleMainWindow::pushButton1Clicked);
- connect(ui_->pushButton1, &QPushButton::clicked, this, &SampleMainWindow::pushButton2Clicked);
-#else
- connect(ui_->toolButton1, SIGNAL(clicked()), this, SLOT(tool1Clicked()));
- connect(ui_->toolButton2, SIGNAL(clicked()), this, SLOT(tool2Clicked()));
- connect(ui_->pushButton1, SIGNAL(clicked()), this, SLOT(pushButton1Clicked()));
- connect(ui_->pushButton1, SIGNAL(clicked()), this, SLOT(pushButton2Clicked()));
-#endif
-
- std::string pushButton1Name;
- std::string pushButton2Name;
- std::string tool1Name;
- std::string tool2Name;
- stoneSampleApplication_.GetButtonNames(pushButton1Name, pushButton2Name, tool1Name, tool2Name);
-
- ui_->toolButton1->setText(QString::fromStdString(tool1Name));
- ui_->toolButton2->setText(QString::fromStdString(tool2Name));
- ui_->pushButton1->setText(QString::fromStdString(pushButton1Name));
- ui_->pushButton2->setText(QString::fromStdString(pushButton2Name));
}
SampleMainWindow::~SampleMainWindow()
@@ -69,25 +46,5 @@
delete ui_;
}
- void SampleMainWindow::tool1Clicked()
- {
- stoneSampleApplication_.OnTool1Clicked();
- }
-
- void SampleMainWindow::tool2Clicked()
- {
- stoneSampleApplication_.OnTool2Clicked();
- }
-
- void SampleMainWindow::pushButton1Clicked()
- {
- stoneSampleApplication_.OnPushButton1Clicked();
- }
-
- void SampleMainWindow::pushButton2Clicked()
- {
- stoneSampleApplication_.OnPushButton2Clicked();
- }
-
}
}
diff -r 37ab9d83dc9b -r 612238b3f3e8 Applications/Samples/Qt/SampleMainWindow.h
--- a/Applications/Samples/Qt/SampleMainWindow.h Tue Oct 16 11:30:00 2018 +0200
+++ b/Applications/Samples/Qt/SampleMainWindow.h Tue Oct 16 12:57:38 2018 +0200
@@ -32,7 +32,7 @@
namespace Samples
{
- class SampleApplicationBase;
+ class SampleSingleCanvasApplicationBase;
class SampleMainWindow : public QStoneMainWindow
{
@@ -40,17 +40,11 @@
private:
Ui::SampleMainWindow* ui_;
- SampleApplicationBase& stoneSampleApplication_;
+ SampleSingleCanvasApplicationBase& stoneSampleApplication_;
public:
- explicit SampleMainWindow(OrthancStone::NativeStoneApplicationContext& context, SampleApplicationBase& stoneSampleApplication, QWidget *parent = 0);
+ explicit SampleMainWindow(OrthancStone::NativeStoneApplicationContext& context, SampleSingleCanvasApplicationBase& stoneSampleApplication, QWidget *parent = 0);
~SampleMainWindow();
-
- private slots:
- void tool1Clicked();
- void tool2Clicked();
- void pushButton1Clicked();
- void pushButton2Clicked();
};
}
}
diff -r 37ab9d83dc9b -r 612238b3f3e8 Applications/Samples/Qt/SampleMainWindow.ui
--- a/Applications/Samples/Qt/SampleMainWindow.ui Tue Oct 16 11:30:00 2018 +0200
+++ b/Applications/Samples/Qt/SampleMainWindow.ui Tue Oct 16 12:57:38 2018 +0200
@@ -38,7 +38,7 @@
Qt::LeftToRight
-
+
QLayout::SetDefaultConstraint
@@ -52,52 +52,6 @@
- -
-
-
-
- 0
- 100
-
-
-
-
- 16777215
- 100
-
-
-
-
-
-
-
- tool1
-
-
-
- -
-
-
- tool2
-
-
-
- -
-
-
- action1
-
-
-
- -
-
-
- action2
-
-
-
-
-
-