Updated log window layout, button placement, and tab ordering
This commit is contained in:
parent
7ab8e9a8d6
commit
6cd22b48a9
32
logqso.cpp
32
logqso.cpp
@ -88,9 +88,7 @@ void LogQSO::createAdditionalField(QString key, QString value){
|
||||
c->setCurrentText(key);
|
||||
|
||||
auto layout = static_cast<QFormLayout*>(ui->additionalFields->layout());
|
||||
layout->removeItem(ui->field_button_layout);
|
||||
layout->addRow(c, l);
|
||||
layout->addItem(ui->field_button_layout);
|
||||
|
||||
// set tab ordering
|
||||
if(m_additionalFieldsControls.isEmpty()){
|
||||
@ -103,6 +101,7 @@ void LogQSO::createAdditionalField(QString key, QString value){
|
||||
c->setFocus();
|
||||
|
||||
m_additionalFieldsControls.append(l);
|
||||
ui->additionalFields->setVisible(true);
|
||||
}
|
||||
|
||||
QMap<QString, QVariant> LogQSO::collectAdditionalFields(){
|
||||
@ -118,26 +117,25 @@ QMap<QString, QVariant> LogQSO::collectAdditionalFields(){
|
||||
}
|
||||
|
||||
void LogQSO::resetAdditionalFields(){
|
||||
if(m_additionalFieldsControls.isEmpty()){
|
||||
return;
|
||||
}
|
||||
|
||||
auto layout = static_cast<QFormLayout*>(ui->additionalFields->layout());
|
||||
layout->removeItem(ui->field_button_layout);
|
||||
if(!m_additionalFieldsControls.isEmpty()){
|
||||
auto layout = static_cast<QFormLayout*>(ui->additionalFields->layout());
|
||||
|
||||
#if QT_VERSION >= 0x050800
|
||||
for(int i = 0, count = layout->rowCount(); i < count; i++){
|
||||
layout->removeRow(0);
|
||||
}
|
||||
for(int i = 0, count = layout->rowCount(); i < count; i++){
|
||||
layout->removeRow(0);
|
||||
}
|
||||
#else
|
||||
QLayoutItem *child;
|
||||
while((child = layout->takeAt(0)) != 0){
|
||||
delete child;
|
||||
}
|
||||
QLayoutItem *child;
|
||||
while((child = layout->takeAt(0)) != 0){
|
||||
delete child;
|
||||
}
|
||||
#endif
|
||||
|
||||
layout->addItem(ui->field_button_layout);
|
||||
m_additionalFieldsControls.clear();
|
||||
m_additionalFieldsControls.clear();
|
||||
}
|
||||
|
||||
setTabOrder(ui->cbComments, ui->add_new_field_button);
|
||||
ui->additionalFields->setVisible(false);
|
||||
}
|
||||
|
||||
void LogQSO::loadSettings ()
|
||||
|
88
logqso.ui
88
logqso.ui
@ -41,9 +41,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<y>-53</y>
|
||||
<width>568</width>
|
||||
<height>473</height>
|
||||
<height>485</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
@ -308,6 +308,19 @@
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="sent">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="lab7">
|
||||
<property name="font">
|
||||
@ -439,21 +452,29 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="sent">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="additionalFields">
|
||||
<property name="title">
|
||||
<string>Additional Fields</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_2"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="add_new_field_button">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add New Field</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
@ -468,40 +489,11 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="additionalFields">
|
||||
<property name="title">
|
||||
<string>Additional Fields</string>
|
||||
<layout class="QHBoxLayout" name="field_button_layout" stretch="">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="field_button_layout">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="add_new_field_button">
|
||||
<property name="text">
|
||||
<string>Add New Field</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
Loading…
Reference in New Issue
Block a user