Commit f45cd1d4 authored by Don Gagne's avatar Don Gagne

Add new Qml Control test window/menu

parent 70a55798
......@@ -71,6 +71,10 @@ This file is part of the QGROUNDCONTROL project
#include "QGCMessageBox.h"
#include "QGCDockWidget.h"
#ifdef UNITTEST_BUILD
#include "QmlControls/QmlTestWidget.h"
#endif
#ifdef QGC_OSG_ENABLED
#include "Q3DWidgetFactory.h"
#endif
......@@ -186,6 +190,12 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) :
#ifdef Q_OS_LINUX
menuBar()->setNativeMenuBar(false);
#endif
#ifdef UNITTEST_BUILD
QAction* qmlTestAction = new QAction("Test QML palette and controls", NULL);
connect(qmlTestAction, &QAction::triggered, this, &MainWindow::_showQmlTestWidget);
ui.menuTools->addAction(qmlTestAction);
#endif
// Setup UI state machines
centerStackActionGroup->setExclusive(true);
......@@ -338,7 +348,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) :
connect(&windowNameUpdateTimer, SIGNAL(timeout()), this, SLOT(configureWindowName()));
windowNameUpdateTimer.start(15000);
emit initStatusChanged(tr("Done"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
if (!qgcApp()->runningUnitTests()) {
show();
}
......@@ -1519,3 +1529,11 @@ bool MainWindow::x11Event(XEvent *event)
return false;
}
#endif // QGC_MOUSE_ENABLED_LINUX
#ifdef UNITTEST_BUILD
void MainWindow::_showQmlTestWidget(void)
{
new QmlTestWidget();
}
#endif
......@@ -294,7 +294,10 @@ private slots:
void _showDockWidgetAction(bool show);
void _loadCustomWidgetFromFile(void);
void _createNewCustomWidget(void);
#ifdef UNITTEST_BUILD
void _showQmlTestWidget(void);
#endif
private:
/// Constructor is private since all creation should be through MainWindow::_create
MainWindow(QSplashScreen* splashScreen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment