Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) QtQuestionDialog

 

QtQuestionDialog is a Qt dialog for QuestionDialog.

 

 

 

 

 

qtquestiondialog.h

 

//---------------------------------------------------------------------------
/*
QtQuestionDialog, Qt dialog for QuestionDialog
Copyright (C) 2011 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/CppQtQuestionDialog.htm
//---------------------------------------------------------------------------
#ifndef QTQUESTIONDIALOG_H
#define QTQUESTIONDIALOG_H
//---------------------------------------------------------------------------
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
//---------------------------------------------------------------------------
#include <QDialog>
struct Question;
struct QuestionDialog;
//---------------------------------------------------------------------------
///Qt dialog for QuestionDialog
struct QtQuestionDialog : public QDialog
{
  explicit QtQuestionDialog(QWidget *parent = 0);

  QtQuestionDialog(
    const boost::shared_ptr<QuestionDialog>& dialog,
    QWidget *parent = 0);

  ///Obtain a read-only pointer to the dialog
  const QuestionDialog * GetDialog() const { return m_dialog.get(); }

  ///Obtain the version of this class
  static const std::string GetVersion();

  ///Obtain the version history of this class
  static const std::vector<std::string> GetVersionHistory();

  ///This signal is emitted when the client submits an answer
  mutable boost::signals2::signal<void ()> m_signal_submitted;

  protected:
  virtual ~QtQuestionDialog() {}

  boost::shared_ptr<QuestionDialog> m_dialog;
};
//---------------------------------------------------------------------------
#endif // CPPQTQUESTIONDIALOG_H

 

 

 

 

 

qtquestiondialog.cpp

 

//---------------------------------------------------------------------------
/*
QtQuestionDialog, Qt dialog for QuestionDialog
Copyright (C) 2011 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/CppQtQuestionDialog.htm
//---------------------------------------------------------------------------
#include "questiondialog.h"
#include "qtquestiondialog.h"
//---------------------------------------------------------------------------
QtQuestionDialog::QtQuestionDialog(QWidget *parent)
  : QDialog(parent)
{

}
//---------------------------------------------------------------------------
QtQuestionDialog::QtQuestionDialog(
  const boost::shared_ptr<QuestionDialog>& dialog,
  QWidget *parent)
  : QDialog(parent),
    m_dialog(dialog)
{

}
//---------------------------------------------------------------------------
const std::string QtQuestionDialog::GetVersion()
{
  return "1.0";
}
//---------------------------------------------------------------------------
const std::vector<std::string> QtQuestionDialog::GetVersionHistory()
{
  std::vector<std::string> v;
  v.push_back("2011-06-30: version 1.0: initial version");
  return v;
}
//---------------------------------------------------------------------------


 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml