Commit a68383e9 authored by Andrius Štikonas's avatar Andrius Štikonas

Merge branch 'frameworks'

parents d332984f ba4fc343
.kdev4/
build/
*.kdev4
project (kubrick)
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames REQUIRED)
find_package(OpenGL REQUIRED)
macro_log_feature(OPENGL_FOUND "OpenGL" "API for developing portable, interactive 2D and 3Dgraphics applications" "http://mesa3d.sourceforge.net" TRUE "" "Kubrick will not be built and KSudoku will not have Roxdoku support without OpenGL.")
macro_log_feature(QT_QTOPENGL_FOUND "QtOpenGL" "Qt module that make it easy to use OpenGL in Qt apps" "http://doc.trolltech.com/latest/qtopengl.html" TRUE "" "Kubrick will not be built and KSudoku will not have Roxdoku support without QtOpenGL.")
macro_display_feature_log()
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
include_directories(${KDEGAMES_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QDBUS_INCLUDE_DIRS})
endif(NOT COMPILING_KDEGAMES)
add_subdirectory (src)
add_subdirectory (data)
add_subdirectory (themes)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.7.0")
set (KF5_MIN_VERSION "5.23.0")
find_package(ECM 1.7.0 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg OpenGL)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
ConfigWidgets
CoreAddons
Crash
DocTools
I18n
KIO
WidgetsAddons
XmlGui
)
find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(OpenGL REQUIRED)
include(FeatureSummary)
include(ECMAddAppIcon)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(themes)
add_subdirectory(doc)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
FILE(GLOB datafiles *.kbk)
install( FILES ${datafiles} DESTINATION ${DATA_INSTALL_DIR}/kubrick )
install( FILES ${datafiles} DESTINATION ${KDE_INSTALL_DATADIR}/kubrick )
########### install files ###############
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kubrick)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR kubrick)
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [
<!ENTITY kubrick "<application>Kubrick</application>">
<!ENTITY kappname "&kubrick;"><!-- Do *not* replace kappname-->
<!ENTITY package "kdegames"><!-- kdebase, kdeadmin, etc -->
......
......@@ -4,41 +4,54 @@
include_directories( ${OPENGL_INCLUDE_DIR} )
set(kubrick_SRCS
main.cpp
kubrick.cpp
game.cpp
cube.cpp
movetracker.cpp
quaternion.cpp
gamedialog.cpp
gameglview.cpp
scenelabel.cpp )
kde4_add_app_icon(kubrick_SRCS "hi*-app-kubrick.png")
kde4_add_executable(kubrick ${kubrick_SRCS})
kubrick_debug.cpp
main.cpp
kubrick.cpp
game.cpp
cube.cpp
movetracker.cpp
quaternion.cpp
gamedialog.cpp
gameglview.cpp
scenelabel.cpp
)
file(GLOB ICONS_SRCS "*-apps-kubrick.png")
ecm_add_app_icon(kubrick_SRCS ICONS ${ICONS_SRCS})
add_executable(kubrick ${kubrick_SRCS})
if(WIN32)
set(opengl_libs opengl32.lib glu32.lib)
endif(WIN32)
target_link_libraries(kubrick
${QT_QTOPENGL_LIBRARY}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
kdegames
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
Qt5::OpenGL
Qt5::Svg
KF5::Crash
KF5::ConfigCore
KF5::KIOCore
KF5::XmlGui
KF5KDEGames
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
)
install(TARGETS kubrick ${INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS kubrick ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install( FILES kubrickui.rc DESTINATION ${DATA_INSTALL_DIR}/kubrick )
install( PROGRAMS org.kde.kubrick.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install(FILES org.kde.kubrick.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo/ )
kde4_install_icons( ${ICON_INSTALL_DIR} )
install(FILES kubrickui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kubrick)
install(PROGRAMS org.kde.kubrick.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.kubrick.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
ecm_install_icons(ICONS
128-apps-kubrick.png
16-apps-kubrick.png
22-apps-kubrick.png
32-apps-kubrick.png
48-apps-kubrick.png
64-apps-kubrick.png
DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor
)
......@@ -20,8 +20,8 @@
#include "cube.h"
// The RubikCube object uses the sqrt() function.
#include <math.h>
#include <stdlib.h>
#include <cmath>
#include <cstdlib>
// Local includes
#include "gameglview.h"
......@@ -76,7 +76,7 @@ void Cube::moveSlice (Axis axis, int location, Rotation direction)
}
// Rotate all cubies that are in the required slice.
foreach (Cubie * cubie, cubies) {
for (Cubie * cubie : qAsConst(cubies)) {
cubie->rotate (axis, location, direction);
}
setBlinkingOff ();
......@@ -93,7 +93,7 @@ void Cube::addStickers ()
int location = sign * sizes [n];
color++; // FaceColor enum 1 --> 6.
foreach (Cubie * cubie, cubies) {
for (Cubie * cubie : qAsConst(cubies)) {
cubie->addSticker ((FaceColor) color, (Axis) n, location, sign);
}
}
......@@ -104,7 +104,7 @@ void Cube::addStickers ()
void Cube::drawCube (GameGLView * gameGLView, float cubieSize)
{
// For each cubie in the cube ...
foreach (Cubie * cubie, cubies) {
for (Cubie * cubie : qAsConst(cubies)) {
if (cubie->hasNoStickers()) {
// This cubie is deep inside the cube: save time by not drawing it.
......@@ -132,7 +132,7 @@ bool Cube::findSticker (double position [], float myCubieSize,
// IDW faceCentre [i] = 0; // Return zeroes if no sticker is found.
}
foreach (Cubie * cubie, cubies) {
for (Cubie * cubie : qAsConst(cubies)) {
d = cubie->findCloserSticker (distance, location, faceCentre);
if (d < distance) {
distance = d;
......@@ -160,7 +160,7 @@ void Cube::setMoveAngle (int angle)
void Cube::setBlinkingOn (Axis axis, int location)
{
foreach (Cubie * cubie, cubies) {
for (Cubie * cubie : qAsConst(cubies)) {
cubie->setBlinkingOn (axis, location, sizes[axis]);
}
}
......@@ -168,7 +168,7 @@ void Cube::setBlinkingOn (Axis axis, int location)
void Cube::setBlinkingOff ()
{
foreach (Cubie * cubie, cubies) {
for (Cubie * cubie : qAsConst(cubies)) {
cubie->setBlinkingOff ();
}
}
......@@ -227,7 +227,7 @@ void Cubie::rotate (Axis axis, int location, Rotation direction)
temp = currentCentre [coord1];
currentCentre [coord1] = - currentCentre [coord2];
currentCentre [coord2] = + temp;
foreach (Sticker * s, stickers) {
for (Sticker * s : qAsConst(stickers)) {
temp = s->currentFaceCentre [coord1];
s->currentFaceCentre [coord1] = - s->currentFaceCentre [coord2];
s->currentFaceCentre [coord2] = + temp;
......@@ -237,7 +237,7 @@ void Cubie::rotate (Axis axis, int location, Rotation direction)
temp = currentCentre [coord1];
currentCentre [coord1] = + currentCentre [coord2];
currentCentre [coord2] = - temp;
foreach (Sticker * s, stickers) {
for (Sticker * s : qAsConst(stickers)) {
temp = s->currentFaceCentre [coord1];
s->currentFaceCentre [coord1] = + s->currentFaceCentre [coord2];
s->currentFaceCentre [coord2] = - temp;
......@@ -246,7 +246,7 @@ void Cubie::rotate (Axis axis, int location, Rotation direction)
case (ONE_EIGHTY): // eg. around the Z-axis, X --> -X and Y --> -Y.
currentCentre [coord1] = - currentCentre [coord1];
currentCentre [coord2] = - currentCentre [coord2];
foreach (Sticker * s, stickers) {
for (Sticker * s : qAsConst(stickers)) {
s->currentFaceCentre [coord1] = - s->currentFaceCentre [coord1];
s->currentFaceCentre [coord2] = - s->currentFaceCentre [coord2];
}
......@@ -313,8 +313,7 @@ void Cubie::drawCubie (GameGLView * gameGLView, float cubieSize,
int faceNormal [nAxes];
// For each sticker on this cubie (there may be 0->3 stickers) ...
foreach (Sticker * sticker, stickers) {
for (Sticker * sticker : qAsConst(stickers)) {
// Calculate the integer unit-vector normal to this sticker's face
// and the centre of the face, in floating OpenGL co-ordinates.
LOOP (j, nAxes) {
......@@ -342,7 +341,7 @@ double Cubie::findCloserSticker (double distance, double location [],
double dmin = distance;
Sticker * foundSticker = 0;
foreach (Sticker * sticker, stickers) {
for (Sticker * sticker : qAsConst(stickers)) {
double d = 0.0;
LOOP (n, nAxes) {
len = location[n] - sticker->currentFaceCentre[n];
......@@ -374,7 +373,7 @@ void Cubie::setBlinkingOn (Axis axis, int location, int cubeBoundary)
// If the sticker is on the outside edges of the slice, make it blink, but
// not if it is perpendicular to the move-axis (ie. on the slice's face).
foreach (Sticker * sticker, stickers) {
for (Sticker * sticker : qAsConst(stickers)) {
if (abs(sticker->currentFaceCentre [axis]) != cubeBoundary) {
sticker->blinking = true;
}
......@@ -384,7 +383,7 @@ void Cubie::setBlinkingOn (Axis axis, int location, int cubeBoundary)
void Cubie::setBlinkingOff ()
{
foreach (Sticker * sticker, stickers) {
for (Sticker * sticker : qAsConst(stickers)) {
sticker->blinking = false;
}
}
......@@ -400,7 +399,7 @@ void Cubie::printAll ()
printf ("<NONE>\n");
}
else {
foreach (Sticker * sticker, stickers) {
for (Sticker * sticker : qAsConst(stickers)) {
printf ("<%d> at ", (int) sticker->color);
LOOP (n, nAxes) {
printf ("%2d ", sticker->currentFaceCentre [n]);
......@@ -423,7 +422,7 @@ void Cubie::printChanges ()
// Check if the cubie is back where it was but has been given a twist.
if (! moved) {
foreach (Sticker * s, stickers) {
for (Sticker * s : qAsConst(stickers)) {
LOOP (i, nAxes) {
if (s->currentFaceCentre [i] != s->originalFaceCentre [i])
moved = true;
......@@ -437,4 +436,4 @@ void Cubie::printChanges ()
}
}
#include "cube.moc"
......@@ -102,8 +102,6 @@ enum FaceColor {INTERNAL, LEFT, RIGHT, BOTTOM, TOP, BACK, FRONT};
*/
class Cube : public QObject
{
Q_OBJECT
public:
/**
* Constructor for the Cube object
......@@ -141,8 +139,6 @@ private:
class Cubie : public QObject
{
Q_OBJECT
public:
/**
* Constructor for the Cubie object
......
......@@ -20,8 +20,18 @@
#include "game.h"
#include "movetracker.h"
#include "scenelabel.h"
#include "kubrick_debug.h"
#include <KDebug>
#include <KConfig>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KMessageBox>
#include <KStandardAction>
#include <QFileDialog>
#include <QStandardPaths>
#include <QTimer>
#include <QUrl>
// Create the main game/document object
Game::Game (Kubrick * parent)
......@@ -53,10 +63,8 @@ Game::Game (Kubrick * parent)
moveTracker = new MoveTracker (myParent);
connect (moveTracker, SIGNAL(newMove(Move*)),
this, SLOT(addPlayersMove(Move*)));
connect (moveTracker, SIGNAL(cubeRotated()),
this, SLOT(setCubeNotAligned()));
connect(moveTracker, &MoveTracker::newMove, this, &Game::addPlayersMove);
connect(moveTracker, &MoveTracker::cubeRotated, this, &Game::setCubeNotAligned);
blinkStartTime = 300;
}
......@@ -125,7 +133,7 @@ void Game::initGame (GameGLView * glv, Kubrick * mw)
// Implement game ticks [SLOT(advance()) does most of the work in Kubrick].
QTimer* timer = new QTimer (this);
nTick = 0;
connect (timer, SIGNAL(timeout()), this, SLOT(advance()));
connect(timer, &QTimer::timeout, this, &Game::advance);
timer->start (20); // Tick interval is 20 msec.
}
......@@ -165,8 +173,8 @@ void Game::load ()
else if (tooBusy()) {
return;
}
QString loadFilename = KFileDialog::getOpenFileName (KUrl(),
"*.kbk", myParent, i18n("Load Puzzle"));
QString loadFilename = QFileDialog::getOpenFileName(myParent, i18n("Load Puzzle"),
QString(), i18n("Kubrick Game Files (*.kbk)"));
if (loadFilename.isNull()) {
return;
}
......@@ -174,9 +182,8 @@ void Game::load ()
KConfig config (loadFilename, KConfig::SimpleConfig);
if (! config.hasGroup ("KubrickGame")) {
// IDW 15 Jun 08 - Should be i18n and message box, but the freeze is on.
printf ("File '%s' is not a valid Kubrick game-file.\n",
loadFilename.toLatin1().data());
KMessageBox::sorry(mainWindow,
i18n("The file '%1' is not a valid Kubrick game-file.", loadFilename));
return;
}
......@@ -407,7 +414,7 @@ void Game::loadDemo (const QString & file)
{
if ((! demoPhase) && tooBusy())
return;
QString demoFile = KStandardDirs::locate ("appdata", file);
QString demoFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, file);
KConfig config (demoFile, KConfig::SimpleConfig);
if (config.hasGroup ("KubrickGame")) {
if (! demoPhase) {
......@@ -681,7 +688,7 @@ void Game::smWaitingForInput (const SingmasterMove smCode)
keyboardState = SingmasterFaceIDSeen; // Change the state.
break;
default:
kDebug() << "Unknown Singmaster code" << smCode;
qCDebug(KUBRICK_LOG) << "Unknown Singmaster code" << smCode;
break;
}
}
......@@ -714,7 +721,7 @@ void Game::smSingmasterPrefixSeen (const SingmasterMove smCode)
keyboardState = SingmasterFaceIDSeen; // Change the state.
break;
default:
kDebug() << "Unknown Singmaster code" << smCode;
qCDebug(KUBRICK_LOG) << "Unknown Singmaster code" << smCode;
break;
}
}
......@@ -752,7 +759,7 @@ void Game::smSingmasterFaceIDSeen (const SingmasterMove smCode)
keyboardState = SingmasterFaceIDSeen; // No change of state.
break;
default:
kDebug() << "Unknown Singmaster code" << smCode;
qCDebug(KUBRICK_LOG) << "Unknown Singmaster code" << smCode;
break;
}
}
......@@ -789,7 +796,7 @@ void Game::saveSingmasterFaceID (const SingmasterMove smCode)
direction = -1; // Face not visible.
break;
default:
kDebug() << "'Impossible' Singmaster code" << smCode;
qCDebug(KUBRICK_LOG) << "'Impossible' Singmaster code" << smCode;
return;
break;
}
......@@ -848,7 +855,7 @@ void Game::executeSingmasterMove (const SingmasterMove smCode)
smTempString.append (SingmasterNotation [SM_SPACER]);
break;
default:
kDebug() << "'Impossible' Singmaster code" << smCode;
qCDebug(KUBRICK_LOG) << "'Impossible' Singmaster code" << smCode;
return;
break;
}
......@@ -924,7 +931,7 @@ void Game::setSceneLabels ()
frontVL->setVisible (false);
backVL->setVisible (false);
foreach (CubeView * v, cubeViews) {
for (CubeView * v : qAsConst(cubeViews)) {
if ((v->sceneID != currentSceneID) || (v->label == NoLabel))
continue; // Skip unwanted scene IDs and labels.
......@@ -953,7 +960,7 @@ void Game::saveState ()
if (demoPhase) {
return; // Don't save if quitting during a demo.
}
QString sFile = KStandardDirs::locateLocal ("appdata", "kubrick.save");
QString sFile = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + "kubrick.save";
KConfig config (sFile, KConfig::SimpleConfig);
savePuzzle (config);
}
......@@ -961,7 +968,7 @@ void Game::saveState ()
void Game::restoreState ()
{
QString rFile = KStandardDirs::locateLocal ("appdata", "kubrick.save");
QString rFile = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + "kubrick.save";
KConfig config (rFile, KConfig::SimpleConfig);
if (config.hasGroup ("KubrickGame")) {
loadPuzzle (config);
......@@ -1084,7 +1091,7 @@ void Game::drawScene ()
float fieldHeight = -cubeCentreZ * 2.0 * tan (3.14159 * viewAngle/360.0);
float fieldWidth = aspect * fieldHeight;
foreach (CubeView * v, cubeViews) {
for (CubeView * v : qAsConst(cubeViews)) {
if (v->sceneID != currentSceneID)
continue; // Skip unwanted scene IDs.
......@@ -1288,7 +1295,7 @@ void Game::appendMove (Move * move)
move->degrees = 180;
}
// IDW testing - kDebug() << move->axis << move->slice <<
// IDW testing - qCDebug(KUBRICK_LOG) << move->axis << move->slice <<
// IDW testing - move->direction << move->degrees;
moves.append (move);
}
......@@ -1330,8 +1337,8 @@ void Game::doSave (bool getFilename)
if (demoPhase || tooBusy())
return;
if (saveFilename.isEmpty() || getFilename) {
QString newFilename = KFileDialog::getSaveFileName (KUrl(),
"*.kbk", myParent, i18n("Save Puzzle"));
QString newFilename = QFileDialog::getSaveFileName(myParent, i18n("Save Puzzle"),
QString(), i18n("Kubrick Game Files (*.kbk)"));
if (newFilename.isNull()) {
return;
}
......@@ -1401,7 +1408,7 @@ void Game::savePuzzle (KConfig & config)
// Save the list of moves, using names "m) 001", "m) 002", etc.
int n = 0;
list.clear ();
foreach (Move * m, moves) {
for (Move * m : qAsConst(moves)) {
value.sprintf ("%d", (int) m->axis);
list.append (value);
value.sprintf ("%d", m->slice);
......@@ -1799,7 +1806,7 @@ void Game::advance()
// we do not do this in the advance() method itself. This is not essential,
// but makes the game-logic and rendering more independent of each other.
QTimer::singleShot(0, gameGLView, SLOT (updateGL()));
QTimer::singleShot(0, gameGLView, &GameGLView::updateGL);
}
......@@ -1817,12 +1824,12 @@ void Game::chooseMousePointer ()
void Game::startNextDisplay ()
{
// Pick off the first character of the display sequence.
char c = displaySequence.at(0).toAscii();
char c = displaySequence.at(0).toLatin1();
displaySequence.remove (0, 1);
int nRMoves = 0;
// Set the animation speed: 0 = no animation, 15 = fastest. Note that if
// the "Watch Your Own Moves" option is off, animation is set to very fast.
// the "Watch Your Own Moves" option is off, animation is set to very fast.
int shSpeed = viewShuffle ? moveSpeed : 0;
int mvSpeed = viewMoves ? moveSpeed : defaultOwnMove;
......@@ -1908,7 +1915,7 @@ void Game::startAnimatedMove (Move * move, int speed)
// defines a range of characters and does not get matched as a "-".
QRegExp smPattern ("[.C]*[FBLRUD]['2 +-]*");
// IDW testing - kDebug() << "Undoing" << undoing << singmasterString <<
// IDW testing - qCDebug(KUBRICK_LOG) << "Undoing" << undoing << singmasterString <<
// IDW testing - smSelectionStart << smSelectionLength;
if (undoing) {
int pos1 = 0;
......@@ -1986,4 +1993,4 @@ void Game::startNextMove (int speed)
startAnimatedMove (move, speed);
}
#include "game.moc"
......@@ -20,24 +20,17 @@
#define GAME_H
// The Cube object uses the sqrt() function.
#include <math.h>
#include <stdlib.h>
#include <cmath>
#include <cstdlib>
// KDE includes
#include <kstandardgameaction.h> // Used only to get internal names of actions.
#include <KStandardGameAction> // Used only to get internal names of actions.
#include <KRandomSequence>
#include <KMessageBox>
#include <KCursor>
#include <KStandardDirs>
#include <KFileDialog>
// Qt includes
#include <QObject>
#include <QWidget>
#include <QString>
#include <QList>
#include <QTimer>
#include <QLabel>
#include <QTime>
// Local includes.
......
......@@ -17,42 +17,44 @@
*******************************************************************************/
#include "gamedialog.h"
#include <KConfigGroup>
#include <KLocalizedString>
#include <QVBoxLayout>
#include <QLabel>
#include <QDialogButtonBox>
#include <QFrame>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
/******************************************************************************/
/***************** DIALOG BOX TO SELECT A GAME AND LEVEL *****************/
/******************************************************************************/
GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent)
: KDialog (parent)
: QDialog (parent)
{
myParent = parent;
myChangePuzzle = changePuzzle;
opt = optionTemp;
int margin = marginHint();
int spacing = spacingHint();
QWidget * dad = new QWidget (this);
setMainWidget (dad);
setCaption (i18n ("Rubik's Cube Options"));
setButtons (KDialog::Ok | KDialog::Cancel | KDialog::Help);
setDefaultButton (KDialog::Ok);
QVBoxLayout * mainLayout = new QVBoxLayout (dad);
mainLayout->setSpacing (spacing);
mainLayout->setMargin (margin);
QVBoxLayout *mainLayout = new QVBoxLayout(dad);
mainLayout->addWidget(dad);
setLayout(mainLayout);
setWindowTitle (i18n ("Rubik's Cube Options"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Help);
QPushButton *okButton