1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

OP-138 Minor changes to UI layouts to scale better.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2104 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
andrew 2010-11-11 07:34:27 +00:00 committed by andrew
parent ac42393502
commit ca16298793
3 changed files with 84 additions and 24 deletions

View File

@ -75,7 +75,7 @@
</size>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="BasicTab">
<attribute name="title">
@ -95,7 +95,7 @@
<item>
<widget class="QGroupBox" name="SwashplateBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -213,7 +213,7 @@
<item>
<widget class="QGroupBox" name="SwashplateBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -504,7 +504,7 @@
<item>
<widget class="QGroupBox" name="SwashplateBox_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -1519,11 +1519,11 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<layout class="QVBoxLayout" name="verticalLayout_11">
<layout class="QVBoxLayout" name="verticalLayout_11" stretch="3,1">
<item>
<widget class="QTableWidget" name="CurveSettings">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<sizepolicy hsizetype="Maximum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -1531,7 +1531,7 @@
<property name="minimumSize">
<size>
<width>142</width>
<height>173</height>
<height>148</height>
</size>
</property>
<property name="maximumSize">
@ -1552,7 +1552,7 @@
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="autoScroll">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
@ -1813,12 +1813,12 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@ -1838,8 +1838,8 @@
<widget class="QGroupBox" name="ThrottleCurveBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
@ -1848,6 +1848,18 @@
<height>0</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="baseSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
@ -1877,8 +1889,8 @@
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
@ -1908,10 +1920,22 @@
<widget class="QGroupBox" name="PitchCurveBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="sizeIncrement">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="baseSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="title">
<string>Pitch Curve</string>
</property>
@ -1932,8 +1956,8 @@
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
@ -1967,7 +1991,7 @@
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@ -1996,15 +2020,21 @@
<item>
<widget class="QTableWidget" name="ccpmAdvancedSettingsTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>525</width>
<height>210</height>
<width>1000</width>
<height>203</height>
</size>
</property>
<property name="verticalScrollBarPolicy">
@ -2014,7 +2044,7 @@
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="autoScroll">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
@ -2396,7 +2426,7 @@
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>

View File

@ -171,6 +171,7 @@ ConfigccpmWidget::ConfigccpmWidget(QWidget *parent) : ConfigTaskWidget(parent)
connect(m_ccpm->ccpmType, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateType()));
connect(m_ccpm->ccpmSingleServo, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateType()));
connect(m_ccpm->CurveSettings, SIGNAL(cellChanged (int, int)), this, SLOT(UpdateCurveWidgets()));
connect(m_ccpm->TabObject, SIGNAL(currentChanged ( QWidget * )), this, SLOT(UpdateType()));
@ -297,6 +298,11 @@ void ConfigccpmWidget::UpdateType()
}
m_ccpm->ccpmAdvancedSettingsTable->resizeColumnsToContents();
for (int i=0;i<6;i++) {
m_ccpm->ccpmAdvancedSettingsTable->setColumnWidth(i,(m_ccpm->ccpmAdvancedSettingsTable->width()-
m_ccpm->ccpmAdvancedSettingsTable->verticalHeader()->width())/6);
}
//update UI
ccpmSwashplateUpdate();
@ -1134,3 +1140,24 @@ void ConfigccpmWidget::saveccpmUpdate()
updateObjectPersistance(ObjectPersistence::OPERATION_SAVE, obj);
}
void ConfigccpmWidget::resizeEvent(QResizeEvent* event)
{
Q_UNUSED(event);
// Make the custom table columns autostretch:
m_ccpm->ccpmAdvancedSettingsTable->resizeColumnsToContents();
for (int i=0;i<6;i++) {
m_ccpm->ccpmAdvancedSettingsTable->setColumnWidth(i,(m_ccpm->ccpmAdvancedSettingsTable->width()-
m_ccpm->ccpmAdvancedSettingsTable->verticalHeader()->width())/6);
}
}
void ConfigccpmWidget::showEvent(QShowEvent *event)
{
Q_UNUSED(event)
m_ccpm->ccpmAdvancedSettingsTable->resizeColumnsToContents();
for (int i=0;i<6;i++) {
m_ccpm->ccpmAdvancedSettingsTable->setColumnWidth(i,(m_ccpm->ccpmAdvancedSettingsTable->width()-
m_ccpm->ccpmAdvancedSettingsTable->verticalHeader()->width())/6);
}
}

View File

@ -76,6 +76,9 @@ private:
void requestccpmUpdate();
void sendccpmUpdate();
void saveccpmUpdate();
protected:
void showEvent(QShowEvent *event);
void resizeEvent(QResizeEvent *event);
};