Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) TestQtRoundedTextRectItem

 

TestQtRoundedTextRectItem is a tool to test the QtRoundedTextRectItem class.

 

 

 

 

 

Downloads

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./ToolTestQtRoundedTextRectItem/ToolTestQtRoundedTextRectItemDesktop.pro

 

include(../../DesktopApplication.pri)

include(../../Libraries/GeneralConsole.pri)
include(../../Libraries/GeneralDesktop.pri)
include(../../Libraries/Boost.pri)

include(../../Classes/CppQtKeyboardFriendlyGraphicsView/CppQtKeyboardFriendlyGraphicsView.pri)
include(../../Classes/CppQtRoundedRectItem/CppQtRoundedRectItem.pri)
include(../../Classes/CppQtRoundedEditRectItem/CppQtRoundedEditRectItem.pri)
include(../../Classes/CppQtRoundedTextRectItem/CppQtRoundedTextRectItem.pri)

include(ToolTestQtRoundedTextRectItemDesktop.pri)

SOURCES += \
    qtmain.cpp

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/ToolTestQtRoundedTextRectItemConsole.pri

 

INCLUDEPATH += \
    ../../Tools/ToolTestQtRoundedTextRectItem

SOURCES += \
    ../../Tools/ToolTestQtRoundedTextRectItem/testqtroundedtextrectitemmenudialog.cpp

HEADERS += \
    ../../Tools/ToolTestQtRoundedTextRectItem/testqtroundedtextrectitemmenudialog.h

OTHER_FILES += \
    ../../Tools/ToolTestQtRoundedTextRectItem/Licence.txt

RESOURCES += \
    ../../Tools/ToolTestQtRoundedTextRectItem/ToolTestQtRoundedTextRectItem.qrc

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/ToolTestQtRoundedTextRectItemDesktop.pri

 

include(../../Tools/ToolTestQtRoundedTextRectItem/ToolTestQtRoundedTextRectItemConsole.pri)

HEADERS += \
    ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemwidget.h \
    ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmenudialog.h \
    ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmaindialog.h

SOURCES += \
    ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemwidget.cpp \
    ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmenudialog.cpp \
    ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmaindialog.cpp

FORMS += \
    ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmenudialog.ui \
    ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmaindialog.ui

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/ToolTestQtRoundedTextRectItemWebsite.pri

 

include(../../Tools/ToolTestQtRoundedTextRectItem/ToolTestQtRoundedTextRectItemConsole.pri)

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/qtmain.cpp

 

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include <QApplication>
#include <QDesktopWidget>
#include "qttestqtroundedtextrectitemmenudialog.h"
#pragma GCC diagnostic pop

int main(int argc, char *argv[])
{
  QApplication a(argc, argv);
  ribi::QtTestQtRoundedTextRectItemMenuDialog w;
  w.show();
  return a.exec();
}

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmaindialog.h

 

//---------------------------------------------------------------------------
/*
TestQtRoundedTextRectItem, tool to test QtRoundedTextRectItem
Copyright (C) 2012-2014 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/ToolTestQtRoundedTextRectItem.htm
//---------------------------------------------------------------------------
#ifndef QTTESTQTROUNDEDTEXTRECTITEMMAINDIALOG_H
#define QTTESTQTROUNDEDTEXTRECTITEMMAINDIALOG_H

#include "qthideandshowdialog.h"

namespace Ui {
  class QtTestQtRoundedTextRectItemMainDialog;
}

namespace ribi {

class QtTestQtRoundedTextRectItemMainDialog : public ribi::QtHideAndShowDialog
{
  Q_OBJECT
    
public:

  explicit QtTestQtRoundedTextRectItemMainDialog(QWidget *parent = 0);
  QtTestQtRoundedTextRectItemMainDialog(const QtTestQtRoundedTextRectItemMainDialog&) = delete;
  QtTestQtRoundedTextRectItemMainDialog& operator=(const QtTestQtRoundedTextRectItemMainDialog&) = delete;
  ~QtTestQtRoundedTextRectItemMainDialog() noexcept;
protected:
  void keyPressEvent(QKeyEvent * event);

private:
  Ui::QtTestQtRoundedTextRectItemMainDialog *ui;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // QTTESTQTROUNDEDTEXTRECTITEMMAINDIALOG_H

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmaindialog.cpp

 

//---------------------------------------------------------------------------
/*
TestQtRoundedTextRectItem, tool to test QtRoundedTextRectItem
Copyright (C) 2012-2014 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/ToolTestQtRoundedTextRectItem.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "qttestqtroundedtextrectitemmaindialog.h"

#include <QKeyEvent>

#include "trace.h"
#include "ui_qttestqtroundedtextrectitemmaindialog.h"
#pragma GCC diagnostic pop

ribi::QtTestQtRoundedTextRectItemMainDialog::QtTestQtRoundedTextRectItemMainDialog(QWidget *parent) :
    QtHideAndShowDialog(parent),
    ui(new Ui::QtTestQtRoundedTextRectItemMainDialog)
{
  #ifndef NDEBUG
  Test();
  #endif
  ui->setupUi(this);
}

ribi::QtTestQtRoundedTextRectItemMainDialog::~QtTestQtRoundedTextRectItemMainDialog() noexcept
{
  delete ui;
}

void ribi::QtTestQtRoundedTextRectItemMainDialog::keyPressEvent(QKeyEvent * event)
{
  if (event->key() == Qt::Key_Escape) { close(); return; }
}

#ifndef NDEBUG
void ribi::QtTestQtRoundedTextRectItemMainDialog::Test() noexcept
{
  {
    static bool is_tested = false;
    if (is_tested) return;
    is_tested = true;
  }
  TRACE("Starting ribi::QtTestQtRoundedTextRectItemMainDialog::Test");
  TRACE("Finished ribi::QtTestQtRoundedTextRectItemMainDialog::Test successfully");
}
#endif

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmenudialog.h

 

//---------------------------------------------------------------------------
/*
TestQtRoundedTextRectItem, tool to test QtRoundedTextRectItem
Copyright (C) 2012-2014 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/ToolTestQtRoundedTextRectItem.htm
//---------------------------------------------------------------------------
#ifndef QTTESTQTROUNDEDTEXTRECTITEMMENUDIALOG_H
#define QTTESTQTROUNDEDTEXTRECTITEMMENUDIALOG_H

#include "qthideandshowdialog.h"

namespace Ui {
  class QtTestQtRoundedTextRectItemMenuDialog;
}

namespace ribi {

class QtTestQtRoundedTextRectItemMenuDialog : public ribi::QtHideAndShowDialog
{
  Q_OBJECT

public:
  explicit QtTestQtRoundedTextRectItemMenuDialog(QWidget *parent = 0);
  QtTestQtRoundedTextRectItemMenuDialog(const QtTestQtRoundedTextRectItemMenuDialog&) = delete;
  QtTestQtRoundedTextRectItemMenuDialog& operator=(const QtTestQtRoundedTextRectItemMenuDialog&) = delete;
  ~QtTestQtRoundedTextRectItemMenuDialog() noexcept;

protected:
  
  void keyPressEvent(QKeyEvent * event);

private:
  Ui::QtTestQtRoundedTextRectItemMenuDialog *ui;

private slots:
  void on_button_about_clicked();
  void on_button_quit_clicked();
  void on_button_start_clicked();

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // QTTESTQTROUNDEDTEXTRECTITEMMENUDIALOG_H

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemmenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestQtRoundedTextRectItem, tool to test QtRoundedTextRectItem
Copyright (C) 2012-2014 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/ToolTestQtRoundedTextRectItem.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "qttestqtroundedtextrectitemmenudialog.h"

#include <QDesktopWidget>
#include <QKeyEvent>

#include "qtkeyboardfriendlygraphicsview.h"
#include "qtroundedrectitem.h"
#include "qtroundedtextrectitem.h"
#include "testqtroundedtextrectitemmenudialog.h"
#include "trace.h"
#include "qtaboutdialog.h"
#include "qttestqtroundedtextrectitemmaindialog.h"
#include "ui_qttestqtroundedtextrectitemmenudialog.h"
#pragma GCC diagnostic pop

ribi::QtTestQtRoundedTextRectItemMenuDialog::QtTestQtRoundedTextRectItemMenuDialog(QWidget *parent) :
    QtHideAndShowDialog(parent),
    ui(new Ui::QtTestQtRoundedTextRectItemMenuDialog)
{
  #ifndef NDEBUG
  Test();
  #endif
  ui->setupUi(this);
}

ribi::QtTestQtRoundedTextRectItemMenuDialog::~QtTestQtRoundedTextRectItemMenuDialog() noexcept
{
  delete ui;
}

void ribi::QtTestQtRoundedTextRectItemMenuDialog::keyPressEvent(QKeyEvent * event)
{
  if (event->key() == Qt::Key_Escape) { close(); return; }
}

void ribi::QtTestQtRoundedTextRectItemMenuDialog::on_button_about_clicked()
{
  About a = TestQtRoundedTextRectItemMenuDialog().GetAbout();
  a.AddLibrary("QtHideAndShowDialog version: " + QtHideAndShowDialog::GetVersion());
  a.AddLibrary("QtKeyboardFriendlyGraphicsView version: " + QtKeyboardFriendlyGraphicsView::GetVersion());
  a.AddLibrary("QtRoundedRectItem version: " + QtRoundedRectItem::GetVersion());
  a.AddLibrary("QtRoundedTextRectItem version: " + QtRoundedTextRectItem::GetVersion());
  QtAboutDialog d(a);
  d.setWindowIcon(this->windowIcon());
  d.setStyleSheet(this->styleSheet());
  this->ShowChild(&d);
}

void ribi::QtTestQtRoundedTextRectItemMenuDialog::on_button_quit_clicked()
{
  close();
}

void ribi::QtTestQtRoundedTextRectItemMenuDialog::on_button_start_clicked()
{
  QtTestQtRoundedTextRectItemMainDialog d;
  ShowChild(&d);
}

#ifndef NDEBUG
void ribi::QtTestQtRoundedTextRectItemMenuDialog::Test() noexcept
{
  {
    static bool is_tested = false;
    if (is_tested) return;
    is_tested = true;
  }
  TRACE("Starting ribi::QtTestQtRoundedTextRectItemMenuDialog::Test");
  TRACE("Finished ribi::QtTestQtRoundedTextRectItemMenuDialog::Test successfully");
}
#endif

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemwidget.h

 

//---------------------------------------------------------------------------
/*
TestQtRoundedTextRectItem, tool to test QtRoundedTextRectItem
Copyright (C) 2012-2014 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/ToolTestQtRoundedTextRectItem.htm
//---------------------------------------------------------------------------
#ifndef QTTESTQTROUNDEDTEXTRECTITEMWIDGETWIDGET_H
#define QTTESTQTROUNDEDTEXTRECTITEMWIDGETWIDGET_H

#include "qtkeyboardfriendlygraphicsview.h"

struct QFont;

namespace ribi {

///The widget holding the items
struct QtTestQtRoundedTextRectItemWidget : public QtKeyboardFriendlyGraphicsView
{
  QtTestQtRoundedTextRectItemWidget(QWidget *parent = 0);

  void keyPressEvent(QKeyEvent *event) noexcept;

private:
  ///Display a font
  void Display(const QFont& font);
};

} //~namespace ribi

#endif // QTTESTQTROUNDEDTEXTRECTITEMWIDGETWIDGET_H

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemwidget.cpp

 

//---------------------------------------------------------------------------
/*
TestQtRoundedTextRectItem, tool to test QtRoundedTextRectItem
Copyright (C) 2012-2014 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/ToolTestQtRoundedTextRectItem.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include "qttestqtroundedtextrectitemwidget.h"

#include <cassert>
#include <cmath>
#include <iostream>

#include <boost/lexical_cast.hpp>

#include <QFontDialog>
#include <QGraphicsScene>
#include <QGraphicsSimpleTextItem>
#include <QIcon>
#include <QKeyEvent>
#include <QGraphicsSimpleTextItem>
#include "about.h"
#include "qtaboutdialog.h"
#include "qtroundedtextrectitem.h"
#include "testqtroundedtextrectitemmenudialog.h"
#pragma GCC diagnostic pop

ribi::QtTestQtRoundedTextRectItemWidget::QtTestQtRoundedTextRectItemWidget(QWidget *parent)
  : QtKeyboardFriendlyGraphicsView(parent)
{
  //Display with default font
  QtRoundedTextRectItem tmp;
  const QFont font = tmp.GetFont();
  this->Display(font);
}

void ribi::QtTestQtRoundedTextRectItemWidget::Display(const QFont& font)
{
  assert(scene());
  scene()->clear();

  //Add texts
  {
    const std::vector<std::string> v
      =
      {
        "F1: change font",
        "ESC: quit",
        "Space: set focus to random item",
        "Arrow keys: move focus",
        "Shift + arrow keys: move item",
        "F2: edit item"
      };
    const int sz = boost::numeric_cast<int>(v.size());
    for (int i=0; i!=sz; ++i)
    {
      QGraphicsSimpleTextItem * const item = new QGraphicsSimpleTextItem(v[i].c_str());
      const double w = item->boundingRect().width();
      const double h = item->boundingRect().height();
      const double y = static_cast<double>(i - (sz/2)) * 20.0;
      item->setPos(-0.5 * w,(-0.5 * h) + y);
      assert(!item->scene());
      scene()->addItem(item);
    }
  }
  const int n_cols = 2;
  const int n_rows = 26;
  for (int col=0; col!=n_cols; ++col)
  {
    const double x = -200.0 + (static_cast<double>(col) * 400.0);
    for (int row=0; row!=n_rows; ++row)
    {
      const double y = static_cast<double>(row-(n_rows/2)) * 22.0;
      QtRoundedTextRectItem * const item = new QtRoundedTextRectItem;
      item->SetFont(font);
      const char c = (col % 2  ? 'A' : 'a') + row;
      const std::string s
        = std::string(1 + (col/2),c)
        + " "
        + boost::lexical_cast<std::string>(c);
      item->SetText(s);
      item->SetPos(x,y);
      assert(!item->scene());
      scene()->addItem(item);
    }
  }

}

void ribi::QtTestQtRoundedTextRectItemWidget::keyPressEvent(QKeyEvent *event) noexcept
{

  switch (event->key())
  {
    case Qt::Key_F1:
    {
      bool ok;
      static QFont font = QtRoundedTextRectItem().GetFont();
      const QFont new_font = QFontDialog::getFont(&ok, font, this);
      if (ok) { font = new_font; Display(font); }
    }
    return;
  }
  QtKeyboardFriendlyGraphicsView::keyPressEvent(event);
}

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/testqtroundedtextrectitemmenudialog.h

 

//---------------------------------------------------------------------------
/*
TestQtRoundedTextRectItem, tool to test QtRoundedTextRectItem
Copyright (C) 2012-2014 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/ToolTestQtRoundedTextRectItem.htm
//---------------------------------------------------------------------------
#ifndef TESTQTROUNDEDTEXTRECTITEMMENUDIALOG_H
#define TESTQTROUNDEDTEXTRECTITEMMENUDIALOG_H

#include "menudialog.h"

namespace ribi {

struct TestQtRoundedTextRectItemMenuDialog : public MenuDialog
{
  About GetAbout() const noexcept;
  Help GetHelp() const noexcept;
  boost::shared_ptr<const Program> GetProgram() const noexcept;
  std::string GetVersion() const noexcept;
  std::vector<std::string> GetVersionHistory() const noexcept;

  private:
  int ExecuteSpecific(const std::vector<std::string>& argv) noexcept;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // TESTQTROUNDEDTEXTRECTITEMMENUDIALOG_H

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/testqtroundedtextrectitemmenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestQtRoundedTextRectItem, tool to test QtRoundedTextRectItem
Copyright (C) 2012-2014 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/ToolTestQtRoundedTextRectItem.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "testqtroundedtextrectitemmenudialog.h"

#include <cassert>
#include <iostream>

#include "richelbilderbeekprogram.h"
#include "trace.h"
#pragma GCC diagnostic pop

int ribi::TestQtRoundedTextRectItemMenuDialog::ExecuteSpecific(const std::vector<std::string>& argv) noexcept
{
  #ifndef NDEBUG
  Test();
  #endif
  const int argc = static_cast<int>(argv.size());
  if (argc == 1)
  {
    std::cout << GetHelp() << '\n';
    return 1;
  }
  assert(!"TODO");
  return 1;
}

ribi::About ribi::TestQtRoundedTextRectItemMenuDialog::GetAbout() const noexcept
{
  About a(
    "Richel Bilderbeek",
    "TestQtRoundedTextRectItemWidget",
    "tests QtRoundedTextRectItemWidget",
    "the 31st of December 2012",
    "2012-2014",
    "http://www.richelbilderbeek.nl/ToolTestQtRoundedTextRectItemWidget.htm",
    GetVersion(),
    GetVersionHistory());
  //a.AddLibrary("ProFile version: " + ProFile::GetVersion());
  a.AddLibrary("Trace version: " + Trace::GetVersion());
  return a;
}

ribi::Help ribi::TestQtRoundedTextRectItemMenuDialog::GetHelp() const noexcept
{
  return Help(
    this->GetAbout().GetFileTitle(),
    this->GetAbout().GetFileDescription(),
    {

    },
    {

    }
  );
}

boost::shared_ptr<const ribi::Program> ribi::TestQtRoundedTextRectItemMenuDialog::GetProgram() const noexcept
{
  const boost::shared_ptr<const Program> p {
    new ProgramTestQtRoundedTextRectItem
  };
  assert(p);
  return p;
}

std::string ribi::TestQtRoundedTextRectItemMenuDialog::GetVersion() const noexcept
{
  return "1.2";
}

std::vector<std::string> ribi::TestQtRoundedTextRectItemMenuDialog::GetVersionHistory() const noexcept
{
  return {
    "2012-12-21: version 1.0: initial version",
    "2012-12-31: version 1.1: added menu",
    "2013-11-05: version 1.2: conformized for ProjectRichelBilderbeekConsole"
  };
}

#ifndef NDEBUG
void ribi::TestQtRoundedTextRectItemMenuDialog::Test() noexcept
{
  {
    static bool is_tested = false;
    if (is_tested) return;
    is_tested = true;
  }
  TRACE("Starting ribi::TestQtRoundedTextRectItemMenuDialog::Test");
  TRACE("Finished ribi::TestQtRoundedTextRectItemMenuDialog::Test successfully");
}
#endif

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/crosscompiletowindows.sh

 

#!/bin/sh
#From http://richelbilderbeek.nl/CppQtCrosscompileToWindowsExample15.htm

echo "Cross compiling to Windows"

echo "1/2: Creating Windows makefile"
i686-pc-mingw32-qmake ToolTestQtRoundedTextRectItem.pro

echo "2/2: making makefile"

make

echo "Done cross compiling, starting Windows executable with Wine"

cd release

wine ToolTestQtRoundedTextRectItem.exe

 

 

 

 

 

./ToolTestQtRoundedTextRectItem/zip.sh

 

#!/bin/sh

echo "Removing user information"
rm *.user

echo "Removing possible temp file"
rm copy.txt
rm tmp.txt


echo "Creating of all main folders"

mkdir temp_zip
mkdir temp_zip/Classes
mkdir temp_zip/Tools

echo "Creating of all subfolders"

mkdir temp_zip/Classes/CppAbout
mkdir temp_zip/Classes/CppQtAboutDialog
mkdir temp_zip/Classes/CppQtKeyboardFriendlyGraphicsView
mkdir temp_zip/Classes/CppQtRoundedRectItem
mkdir temp_zip/Classes/CppQtRoundedTextRectItem
mkdir temp_zip/Classes/CppTrace
mkdir temp_zip/Tools/ToolTestQtRoundedTextRectItem

echo "Copying files"

cp ../../Classes/CppAbout/Licence.txt temp_zip/Classes/CppAbout/Licence.txt
cp ../../Classes/CppAbout/about.cpp temp_zip/Classes/CppAbout/about.cpp
cp ../../Classes/CppAbout/about.h temp_zip/Classes/CppAbout/about.h
cp ../../Classes/CppQtAboutDialog/Licence.txt temp_zip/Classes/CppQtAboutDialog/Licence.txt
cp ../../Classes/CppQtAboutDialog/qtaboutdialog.cpp temp_zip/Classes/CppQtAboutDialog/qtaboutdialog.cpp
cp ../../Classes/CppQtAboutDialog/qtaboutdialog.h temp_zip/Classes/CppQtAboutDialog/qtaboutdialog.h
cp ../../Classes/CppQtAboutDialog/qtaboutdialog.ui temp_zip/Classes/CppQtAboutDialog/qtaboutdialog.ui
cp ../../Classes/CppQtKeyboardFriendlyGraphicsView/Licence.txt temp_zip/Classes/CppQtKeyboardFriendlyGraphicsView/Licence.txt
cp ../../Classes/CppQtKeyboardFriendlyGraphicsView/qtkeyboardfriendlygraphicsview.cpp temp_zip/Classes/CppQtKeyboardFriendlyGraphicsView/qtkeyboardfriendlygraphicsview.cpp
cp ../../Classes/CppQtKeyboardFriendlyGraphicsView/qtkeyboardfriendlygraphicsview.h temp_zip/Classes/CppQtKeyboardFriendlyGraphicsView/qtkeyboardfriendlygraphicsview.h
cp ../../Classes/CppQtRoundedRectItem/Licence.txt temp_zip/Classes/CppQtRoundedRectItem/Licence.txt
cp ../../Classes/CppQtRoundedRectItem/qtroundedrectitem.cpp temp_zip/Classes/CppQtRoundedRectItem/qtroundedrectitem.cpp
cp ../../Classes/CppQtRoundedRectItem/qtroundedrectitem.h temp_zip/Classes/CppQtRoundedRectItem/qtroundedrectitem.h
cp ../../Classes/CppQtRoundedTextRectItem/Licence.txt temp_zip/Classes/CppQtRoundedTextRectItem/Licence.txt
cp ../../Classes/CppQtRoundedTextRectItem/qtroundedtextrectitem.cpp temp_zip/Classes/CppQtRoundedTextRectItem/qtroundedtextrectitem.cpp
cp ../../Classes/CppQtRoundedTextRectItem/qtroundedtextrectitem.h temp_zip/Classes/CppQtRoundedTextRectItem/qtroundedtextrectitem.h
cp ../../Classes/CppTrace/Licence.txt temp_zip/Classes/CppTrace/Licence.txt
cp ../../Classes/CppTrace/trace.h temp_zip/Classes/CppTrace/trace.h
cp ../../Tools/ToolTestQtRoundedTextRectItem/Licence.txt temp_zip/Tools/ToolTestQtRoundedTextRectItem/Licence.txt
cp ../../Tools/ToolTestQtRoundedTextRectItem/ToolTestQtRoundedTextRectItem.pro temp_zip/Tools/ToolTestQtRoundedTextRectItem/ToolTestQtRoundedTextRectItem.pro
cp ../../Tools/ToolTestQtRoundedTextRectItem/crosscompiletowindows.sh temp_zip/Tools/ToolTestQtRoundedTextRectItem/crosscompiletowindows.sh
cp ../../Tools/ToolTestQtRoundedTextRectItem/qtmain.cpp temp_zip/Tools/ToolTestQtRoundedTextRectItem/qtmain.cpp
cp ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemwidget.cpp temp_zip/Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemwidget.cpp
cp ../../Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemwidget.h temp_zip/Tools/ToolTestQtRoundedTextRectItem/qttestqtroundedtextrectitemwidget.h
cp ../../Tools/ToolTestQtRoundedTextRectItem/testqtroundedtextrectitemmenudialog.cpp temp_zip/Tools/ToolTestQtRoundedTextRectItem/testqtroundedtextrectitemmenudialog.cpp
cp ../../Tools/ToolTestQtRoundedTextRectItem/testqtroundedtextrectitemmenudialog.h temp_zip/Tools/ToolTestQtRoundedTextRectItem/testqtroundedtextrectitemmenudialog.h
cp ../../Tools/ToolTestQtRoundedTextRectItem/zip.sh temp_zip/Tools/ToolTestQtRoundedTextRectItem/zip.sh

FILENAME="ToolTestQtRoundedTextRectItemSource"
ZIP_FILENAME=$FILENAME".zip"

echo "Compressing files"

cd temp_zip
zip -r $FILENAME Classes
zip -r $FILENAME Tools
cd ..
cp "temp_zip/"$ZIP_FILENAME $ZIP_FILENAME

echo "Cleaning up"

echo "Emptying subfolders"

rm temp_zip/Classes/CppAbout/*.*
rm temp_zip/Classes/CppQtAboutDialog/*.*
rm temp_zip/Classes/CppQtKeyboardFriendlyGraphicsView/*.*
rm temp_zip/Classes/CppQtRoundedRectItem/*.*
rm temp_zip/Classes/CppQtRoundedTextRectItem/*.*
rm temp_zip/Classes/CppTrace/*.*
rm temp_zip/Tools/ToolTestQtRoundedTextRectItem/*.*

echo "Removing subfolders"

rmdir temp_zip/Classes/CppAbout
rmdir temp_zip/Classes/CppQtAboutDialog
rmdir temp_zip/Classes/CppQtKeyboardFriendlyGraphicsView
rmdir temp_zip/Classes/CppQtRoundedRectItem
rmdir temp_zip/Classes/CppQtRoundedTextRectItem
rmdir temp_zip/Classes/CppTrace
rmdir temp_zip/Tools/ToolTestQtRoundedTextRectItem

echo "Removing main folders"

rmdir temp_zip/Classes
rmdir temp_zip/Tools

echo "Removing temporary folder"

rm temp_zip/*.*
rmdir temp_zip

echo "Done"

# CreateQtProjectZipFile, version 1.3
# Copyright (C) 2012 Richel Bilderbeek
# Programmed on the 10th of June 2012
# by Richel Bilderbeek
#
# CreateQtProjectZipFile can be downloaded from http://www.richelbilderbeek.nl/ToolCreateQtProjectZipFile.htm
# Licenced under GPL 3.0

 

 

 

 

 

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