diff --git a/src/libs/core/touch/ttouchmenu.cpp b/src/libs/core/touch/ttouchmenu.cpp index dd0daba609ef6542a00518df0d280ffe2b6bef78..3b3e6e66de7a3b5e6bec17728aa0dc9b7dd8b404 100644 --- a/src/libs/core/touch/ttouchmenu.cpp +++ b/src/libs/core/touch/ttouchmenu.cpp @@ -73,9 +73,9 @@ void TtouchMenu::addAction(QAction* a) { } -void TtouchMenu::exec(const QPoint& endPos, const QPoint& startPos) { +QAction* TtouchMenu::exec(const QPoint& endPos, const QPoint& startPos) { if (startPos.x() == -1 && startPos.y() == -1) - QMenu::exec(endPos); + return QMenu::exec(endPos); else { m_endPos = endPos; m_startPos = startPos; @@ -83,7 +83,7 @@ void TtouchMenu::exec(const QPoint& endPos, const QPoint& startPos) { m_step = 0; m_offset = QPoint((m_endPos.x() - m_startPos.x()) / m_count, (m_endPos.y() - m_startPos.y()) / m_count); m_animTimer->start(40); - QMenu::exec(startPos); + return QMenu::exec(startPos); } } diff --git a/src/libs/core/touch/ttouchmenu.h b/src/libs/core/touch/ttouchmenu.h index f62f8bba6481f4cc2e43f8d30de0a215d168c902..2c5166e1c21a48db3d3d9ba6a62513ba610653ac 100644 --- a/src/libs/core/touch/ttouchmenu.h +++ b/src/libs/core/touch/ttouchmenu.h @@ -49,7 +49,7 @@ public: /** Overrides standard @p exec method of @p QMenu. * Menu is positioned at @p endPos point but when @p startPos is set, * an animation from it is performed */ - void exec(const QPoint& endPos, const QPoint& startPos = QPoint(-1, -1)); + QAction* exec(const QPoint& endPos, const QPoint& startPos = QPoint(-1, -1)); protected: virtual void showEvent(QShowEvent* e); // correct initial position diff --git a/src/main.cpp b/src/main.cpp index 3e45092d1fadc357f413a854f86f1bf49cd355b8..dbbf71dcfcd0826fdd8cae3e18aff7ab7ad358ba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,7 @@ #include <QFile> #include <QSettings> #include <QApplication> +#include <QStyleFactory> #include <QDebug> #include <QTranslator> @@ -61,6 +62,9 @@ int main(int argc, char *argv[]) } resetConfig = false; a = new QApplication(argc, argv); +#if defined (Q_OS_ANDROID) + a->setStyle(QStyleFactory::create("Fusion")); +#endif gl = new Tglobals(); gl->path = Tglobals::getInstPath(qApp->applicationDirPath()); confFile = gl->config->fileName(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 144bb7e9cb404398429d789d4a93d3c47880d101..cf102f3aa9ba18647cf1944e71d7c5855b13d5c9 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -38,15 +38,14 @@ #include "exam/tprogresswidget.h" #include "exam/texamview.h" #include "exam/texamexecutor.h" - #include <level/tlevelselector.h> #include <widgets/tpitchview.h> #include <tsound.h> #include <taboutnootka.h> #include <tsupportnootka.h> - #include <plugins/tpluginsloader.h> #endif - +#include <level/tlevelselector.h> +#include <plugins/tpluginsloader.h> extern Tglobals *gl; extern bool resetConfig; @@ -172,7 +171,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(bar->aboutSimpleAct, &QAction::triggered, this, &MainWindow::aboutSlot); #else connect(bar->settingsAct, SIGNAL(triggered()), this, SLOT(createSettingsDialog())); - connect(bar->levelCreatorAct, SIGNAL(triggered()), this, SLOT(openLevelCreator())); +// connect(bar->levelCreatorAct, SIGNAL(triggered()), this, SLOT(openLevelCreator())); connect(bar->startExamAct, SIGNAL(triggered()), this, SLOT(startExamSlot())); connect(bar->analyseAct, SIGNAL(triggered()), this, SLOT(analyseSlot())); connect(bar->aboutAct, &QAction::triggered, this, &MainWindow::aboutSlot); @@ -183,6 +182,7 @@ MainWindow::MainWindow(QWidget *parent) : #endif setSingleNoteMode(gl->S->isSingleNoteMode); + connect(bar->levelCreatorAct, SIGNAL(triggered()), this, SLOT(openLevelCreator())); connect(score, SIGNAL(noteChanged(int,Tnote)), this, SLOT(noteWasClicked(int,Tnote))); connect(score, &TmainScore::clefChanged, this, &MainWindow::adjustAmbitus); connect(guitar, &TfingerBoard::guitarClicked, this, &MainWindow::guitarWasClicked); @@ -345,7 +345,6 @@ void MainWindow::createSettingsDialog() { void MainWindow::openLevelCreator(QString levelFile) { -#if !defined (Q_OS_ANDROID) if (score->isScorePlayed()) m_melButt->playMelodySlot(); // stop playing sound->wait(); // stops pitch detection @@ -368,15 +367,16 @@ void MainWindow::openLevelCreator(QString levelFile) { bool ok; int levelNr = levelText.toInt(&ok); if (ok) { +#if !defined (Q_OS_ANDROID) TlevelSelector ls; ls.selectLevel(levelNr); m_level = ls.getSelectedLevel(); prepareToExam(); executor = new TexamExecutor(this, startExercise ? "exercise" : "", &m_level); // start exam +#endif } else sound->go(); // restore pitch detection -#endif }