Skip to content
Snippets Groups Projects
Commit aabaa520 authored by SeeLook's avatar SeeLook
Browse files

Exec of Touch menu returns action now, using Fusion style under Android and proper plugins path

parent e90d9d21
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
......@@ -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
......
......@@ -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();
......
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment