mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
uncrustification
This commit is contained in:
parent
e8150399f6
commit
2f2cff3dc6
@ -58,7 +58,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
|||||||
"Built on %4 at %5<br/>"
|
"Built on %4 at %5<br/>"
|
||||||
"Based on Qt %6 (%7 bit)<br/>"
|
"Based on Qt %6 (%7 bit)<br/>"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"© %8, 2010-%9. All rights reserved.<br/>"
|
"© %8, 2010-%9. All rights reserved.<br/>"
|
||||||
).arg(
|
).arg(
|
||||||
VersionInfo::revision().left(60), // %1
|
VersionInfo::revision().left(60), // %1
|
||||||
VersionInfo::uavoHash().left(8), // %2
|
VersionInfo::uavoHash().left(8), // %2
|
||||||
@ -77,12 +77,12 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
|||||||
view->setResizeMode(QQuickView::SizeRootObjectToView);
|
view->setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml"));
|
view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml"));
|
||||||
|
|
||||||
QWidget * container = QWidget::createWindowContainer(view);
|
QWidget *container = QWidget::createWindowContainer(view);
|
||||||
container->setMinimumSize(600, 400);
|
container->setMinimumSize(600, 400);
|
||||||
container->setMaximumSize(800, 600);
|
container->setMaximumSize(800, 600);
|
||||||
container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
QVBoxLayout *lay = new QVBoxLayout();
|
QVBoxLayout *lay = new QVBoxLayout();
|
||||||
lay->setContentsMargins(0,0,0,0);
|
lay->setContentsMargins(0, 0, 0, 0);
|
||||||
setLayout(lay);
|
setLayout(lay);
|
||||||
layout()->addWidget(container);
|
layout()->addWidget(container);
|
||||||
}
|
}
|
||||||
@ -93,5 +93,4 @@ void AboutDialog::openUrl(const QString &url)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AboutDialog::~AboutDialog()
|
AboutDialog::~AboutDialog()
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
@ -26,8 +26,7 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
class AboutDialog : public QDialog
|
class AboutDialog : public QDialog {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -36,7 +35,6 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void openUrl(const QString &url);
|
void openUrl(const QString &url);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ABOUTDIALOG_H
|
#endif // ABOUTDIALOG_H
|
||||||
|
@ -23,7 +23,7 @@ PfdQmlGadget::PfdQmlGadget(QString classId, PfdQmlGadgetWidget *widget, QWidget
|
|||||||
m_widget(widget)
|
m_widget(widget)
|
||||||
{
|
{
|
||||||
m_container = NULL;
|
m_container = NULL;
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
PfdQmlGadget::~PfdQmlGadget()
|
PfdQmlGadget::~PfdQmlGadget()
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
|
|
||||||
QWidget *widget()
|
QWidget *widget()
|
||||||
{
|
{
|
||||||
if(!m_container){
|
if (!m_container) {
|
||||||
m_container = QWidget::createWindowContainer(m_widget, m_parent);
|
m_container = QWidget::createWindowContainer(m_widget, m_parent);
|
||||||
m_container->setMinimumSize(64, 64);
|
m_container->setMinimumSize(64, 64);
|
||||||
m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
|
@ -162,7 +162,7 @@ void PfdQmlGadgetWidget::setAltitudeFactor(double factor)
|
|||||||
|
|
||||||
void PfdQmlGadgetWidget::setOpenGLEnabled(bool arg)
|
void PfdQmlGadgetWidget::setOpenGLEnabled(bool arg)
|
||||||
{
|
{
|
||||||
setTerrainEnabled(m_terrainEnabled);
|
setTerrainEnabled(m_terrainEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch between PositionState UAVObject position
|
// Switch between PositionState UAVObject position
|
||||||
|
@ -35,7 +35,7 @@ QmlViewGadget::QmlViewGadget(QString classId, QmlViewGadgetWidget *widget, QWidg
|
|||||||
m_widget(widget)
|
m_widget(widget)
|
||||||
{
|
{
|
||||||
m_container = NULL;
|
m_container = NULL;
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlViewGadget::~QmlViewGadget()
|
QmlViewGadget::~QmlViewGadget()
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
QWidget *widget()
|
QWidget *widget()
|
||||||
{
|
{
|
||||||
if(!m_container){
|
if (!m_container) {
|
||||||
m_container = QWidget::createWindowContainer(m_widget, m_parent);
|
m_container = QWidget::createWindowContainer(m_widget, m_parent);
|
||||||
m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
m_container->setMinimumSize(64, 64);
|
m_container->setMinimumSize(64, 64);
|
||||||
|
@ -114,7 +114,8 @@ public:
|
|||||||
QWidget *createEditor(QWidget *parent)
|
QWidget *createEditor(QWidget *parent)
|
||||||
{
|
{
|
||||||
QComboBox *editor = new QComboBox(parent);
|
QComboBox *editor = new QComboBox(parent);
|
||||||
// Setting ClickFocus lets the ComboBox stay open on Mac OSX.
|
|
||||||
|
// Setting ClickFocus lets the ComboBox stay open on Mac OSX.
|
||||||
editor->setFocusPolicy(Qt::ClickFocus);
|
editor->setFocusPolicy(Qt::ClickFocus);
|
||||||
foreach(QString option, m_enumOptions)
|
foreach(QString option, m_enumOptions)
|
||||||
editor->addItem(option);
|
editor->addItem(option);
|
||||||
|
@ -100,7 +100,7 @@ int WelcomeMode::priority() const
|
|||||||
|
|
||||||
QWidget *WelcomeMode::widget()
|
QWidget *WelcomeMode::widget()
|
||||||
{
|
{
|
||||||
if(!m_container){
|
if (!m_container) {
|
||||||
m_container = QWidget::createWindowContainer(m_d->quickView);
|
m_container = QWidget::createWindowContainer(m_d->quickView);
|
||||||
m_container->setMinimumSize(64, 64);
|
m_container->setMinimumSize(64, 64);
|
||||||
m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
|
@ -127,9 +127,9 @@ bool UAVObjectGeneratorGCS::process_object(ObjectInfo *info)
|
|||||||
type = fieldTypeStrCPP[field->type];
|
type = fieldTypeStrCPP[field->type];
|
||||||
// Append field
|
// Append field
|
||||||
if (field->numElements > 1) {
|
if (field->numElements > 1) {
|
||||||
//add both field(elementIndex)/setField(elemntIndex,value) and field_element properties
|
// add both field(elementIndex)/setField(elemntIndex,value) and field_element properties
|
||||||
//field_element is more convenient if only certain element is used
|
// field_element is more convenient if only certain element is used
|
||||||
//and much easier to use from the qml side
|
// and much easier to use from the qml side
|
||||||
propertyGetters +=
|
propertyGetters +=
|
||||||
QString(" Q_INVOKABLE %1 get%2(quint32 index) const;\n")
|
QString(" Q_INVOKABLE %1 get%2(quint32 index) const;\n")
|
||||||
.arg(type).arg(field->name);
|
.arg(type).arg(field->name);
|
||||||
@ -160,37 +160,37 @@ bool UAVObjectGeneratorGCS::process_object(ObjectInfo *info)
|
|||||||
for (int elementIndex = 0; elementIndex < field->numElements; elementIndex++) {
|
for (int elementIndex = 0; elementIndex < field->numElements; elementIndex++) {
|
||||||
QString elementName = field->elementNames[elementIndex];
|
QString elementName = field->elementNames[elementIndex];
|
||||||
properties += QString(" Q_PROPERTY(%1 %2 READ get%2 WRITE set%2 NOTIFY %2Changed);\n")
|
properties += QString(" Q_PROPERTY(%1 %2 READ get%2 WRITE set%2 NOTIFY %2Changed);\n")
|
||||||
.arg(type).arg(field->name+"_"+elementName);
|
.arg(type).arg(field->name + "_" + elementName);
|
||||||
propertyGetters +=
|
propertyGetters +=
|
||||||
QString(" Q_INVOKABLE %1 get%2_%3() const;\n")
|
QString(" Q_INVOKABLE %1 get%2_%3() const;\n")
|
||||||
.arg(type).arg(field->name).arg(elementName);
|
.arg(type).arg(field->name).arg(elementName);
|
||||||
propertiesImpl +=
|
propertiesImpl +=
|
||||||
QString("%1 %2::get%3_%4() const\n"
|
QString("%1 %2::get%3_%4() const\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" QMutexLocker locker(mutex);\n"
|
" QMutexLocker locker(mutex);\n"
|
||||||
" return data.%3[%5];\n"
|
" return data.%3[%5];\n"
|
||||||
"}\n")
|
"}\n")
|
||||||
.arg(type).arg(info->name).arg(field->name).arg(elementName).arg(elementIndex);
|
.arg(type).arg(info->name).arg(field->name).arg(elementName).arg(elementIndex);
|
||||||
propertySetters +=
|
propertySetters +=
|
||||||
QString(" void set%1_%2(%3 value);\n")
|
QString(" void set%1_%2(%3 value);\n")
|
||||||
.arg(field->name).arg(elementName).arg(type);
|
.arg(field->name).arg(elementName).arg(type);
|
||||||
propertiesImpl +=
|
propertiesImpl +=
|
||||||
QString("void %1::set%2_%3(%4 value)\n"
|
QString("void %1::set%2_%3(%4 value)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" mutex->lock();\n"
|
" mutex->lock();\n"
|
||||||
" bool changed = data.%2[%5] != value;\n"
|
" bool changed = data.%2[%5] != value;\n"
|
||||||
" data.%2[%5] = value;\n"
|
" data.%2[%5] = value;\n"
|
||||||
" mutex->unlock();\n"
|
" mutex->unlock();\n"
|
||||||
" if (changed) emit %2_%3Changed(value);\n"
|
" if (changed) emit %2_%3Changed(value);\n"
|
||||||
"}\n\n")
|
"}\n\n")
|
||||||
.arg(info->name).arg(field->name).arg(elementName).arg(type).arg(elementIndex);
|
.arg(info->name).arg(field->name).arg(elementName).arg(type).arg(elementIndex);
|
||||||
propertyNotifications +=
|
propertyNotifications +=
|
||||||
QString(" void %1_%2Changed(%3 value);\n")
|
QString(" void %1_%2Changed(%3 value);\n")
|
||||||
.arg(field->name).arg(elementName).arg(type);
|
.arg(field->name).arg(elementName).arg(type);
|
||||||
propertyNotificationsImpl +=
|
propertyNotificationsImpl +=
|
||||||
QString(" //if (data.%1[%2] != oldData.%1[%2])\n"
|
QString(" //if (data.%1[%2] != oldData.%1[%2])\n"
|
||||||
" emit %1_%3Changed(data.%1[%2]);\n")
|
" emit %1_%3Changed(data.%1[%2]);\n")
|
||||||
.arg(field->name).arg(elementIndex).arg(elementName);
|
.arg(field->name).arg(elementIndex).arg(elementName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
properties += QString(" Q_PROPERTY(%1 %2 READ get%2 WRITE set%2 NOTIFY %2Changed);\n")
|
properties += QString(" Q_PROPERTY(%1 %2 READ get%2 WRITE set%2 NOTIFY %2Changed);\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user