view Applications/Samples/Qt/MainWindow.cpp @ 276:5de5699ad570 am-2

first display in QCairoWidget; no mouse interaction yet
author am@osimis.io
date Mon, 27 Aug 2018 12:21:52 +0200
parents
children a38465cc909f
line wrap: on
line source

#include "MainWindow.h"

/**
 * Don't use "ui_MainWindow.h" instead of <ui_MainWindow.h> below, as
 * this makes CMake unable to detect when the UI file changes.
 **/
#include <ui_MainWindow.h>

MainWindow::MainWindow(OrthancStone::BasicNativeApplicationContext& context, QWidget *parent) :
  QMainWindow(parent),
  ui_(new Ui::MainWindow),
  context_(context)
{
  refreshTimer_ = new QTimer(this);
  ui_->setupUi(this);
  cairoCentralWidget_ = ui_->cairoCentralWidget;
  cairoCentralWidget_->SetContext(context_);

  //connect(refreshTimer_, SIGNAL(timeout()), ui_->ca, SLOT(Refresh()));
  refreshTimer_->start(100);
}

MainWindow::~MainWindow()
{
  delete ui_;
  delete refreshTimer_;
}