diff --git a/CMakeLists.txt b/CMakeLists.txt index 21e357bd53c36e81f1c60b236b2201dd8938a178..ca115b349357afef861f69893d193ef35c49963e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Crash DocTools - KDELibs4Support I18n KIO WidgetsAddons diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 406b97b8148d776bc2eb8defac6439e8354955d1..cd12d4b28c506d9b52e5263e4ba8de0cfaba97ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,7 +29,6 @@ target_link_libraries(kubrick Qt5::Svg KF5::Crash KF5::ConfigCore - KF5::KDELibs4Support KF5::KIOCore KF5::XmlGui KF5KDEGames diff --git a/src/game.cpp b/src/game.cpp index f97a229a7144242292b47df59263c6d6f18ce81e..5a3ce6c5d03b59201a900042dfed17c7c0d5d0e3 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -21,7 +21,9 @@ #include "movetracker.h" #include "scenelabel.h" #include "kubrick_debug.h" + #include +#include #include #include #include @@ -1822,7 +1824,7 @@ 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; diff --git a/src/gamedialog.cpp b/src/gamedialog.cpp index 85959dea873c768b27208b1f7cb493f2d5434207..cb36baad2960e91771945b966d0230040e4951c4 100644 --- a/src/gamedialog.cpp +++ b/src/gamedialog.cpp @@ -17,43 +17,44 @@ *******************************************************************************/ #include "gamedialog.h" +#include #include -#include -#include +#include #include +#include +#include +#include /******************************************************************************/ /***************** 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 = buttonBox->button(QDialogButtonBox::Ok); + okButton->setDefault(true); + okButton->setShortcut(Qt::CTRL | Qt::Key_Return); + connect(buttonBox, &QDialogButtonBox::accepted, this, &GameDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &GameDialog::reject); + buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); QHBoxLayout * cubeDimensions = new QHBoxLayout(); mainLayout->addLayout (cubeDimensions); - cubeDimensions->setSpacing (spacing); QHBoxLayout * difficulty = new QHBoxLayout(); mainLayout->addLayout (difficulty); - difficulty->setSpacing (spacing); if (changePuzzle) { // Lay out spin boxes for the cube dimensions. @@ -116,7 +117,6 @@ GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent) QHBoxLayout * speed = new QHBoxLayout(); mainLayout->addLayout (speed); - speed->setSpacing (spacing); speedL = new QLabel (i18n("Speed of moves:")); speedN = new QSpinBox (); @@ -126,7 +126,6 @@ GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent) QHBoxLayout * bevel = new QHBoxLayout(); mainLayout->addLayout (bevel); - bevel->setSpacing (spacing); // xgettext: no-c-format bevelL = new QLabel (i18n("% of bevel on edges of cubies:")); @@ -136,6 +135,8 @@ GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent) bevel->addWidget (bevelL); bevel->addWidget (bevelN); + mainLayout->addWidget(buttonBox); + // Set the option-widgets to the current values of the options. if (changePuzzle) { dimX->setValue (optionTemp [optXDim]); @@ -150,8 +151,8 @@ GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent) bevelN->setValue (optionTemp [optBevel]); - connect(this, &GameDialog::okClicked, this, &GameDialog::slotOk); - connect(this, &GameDialog::helpClicked, this, &GameDialog::slotHelp); + connect(okButton, &QPushButton::clicked, this, &GameDialog::slotOk); + connect(buttonBox->button(QDialogButtonBox::Help), &QPushButton::clicked, this, &GameDialog::slotHelp); } diff --git a/src/gamedialog.h b/src/gamedialog.h index 61d7a7a600f3c99e2e3ac6cd8f0fb71c71ff3657..504193f88df60ff9e0917e4de8cf02af1ae44e71 100644 --- a/src/gamedialog.h +++ b/src/gamedialog.h @@ -19,14 +19,12 @@ #ifndef GAMEDIALOG_H #define GAMEDIALOG_H -// Use KDialog and KMessageBox. -#include #include - +#include +#include #include #include -#include #include "kbkglobal.h" @@ -40,7 +38,7 @@ class Game; /******************* DIALOG TO SELECT A GAME AND LEVEL *******************/ /******************************************************************************/ -class GameDialog : public KDialog +class GameDialog : public QDialog { public: GameDialog (bool changePuzzle, int optionTemp [8], QWidget * parent = 0); diff --git a/src/gameglview.cpp b/src/gameglview.cpp index 97d62989dd3acadd70431bdca99f134135274d5f..f7c9c837162b3263743ba975a80e145ab4c41222 100644 --- a/src/gameglview.cpp +++ b/src/gameglview.cpp @@ -25,15 +25,11 @@ #include #include #include +#include #include - -// IDW - This is temporary code for KDE 4.1. Do themes properly in KDE 4.2. -#include -#include #include + #include "kubrick_debug.h" -#include -#include // C++ includes #include diff --git a/src/kubrick.cpp b/src/kubrick.cpp index 215332aa94bb9e9c75f4083f6dc14743592e6210..9040e65dd72e69a489661ee7c516c2376691f915 100644 --- a/src/kubrick.cpp +++ b/src/kubrick.cpp @@ -21,19 +21,20 @@ // Qt includes. #include -#include -#include #include +#include +#include #include #include #include // KDE includes. #include +#include #include -#include #include #include +#include #include // Local includes. @@ -47,7 +48,7 @@ Kubrick::Kubrick () : singmasterMoves (0) { // Window title. - // setCaption("Rubik's Cube"); // DELETED - This is a *trademark*. + // setWindowTitle("Rubik's Cube"); // DELETED - This is a *trademark*. // use multi-sample (anti-aliased) OpenGL if available QGLFormat defFormat = QGLFormat::defaultFormat();