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