More layout stuff, plus some Import preferences stubs

This commit is contained in:
Mark Watkins 2011-12-13 17:50:22 +10:00
parent 66d00ead14
commit 63aaf4c815
2 changed files with 221 additions and 8 deletions

View File

@ -814,8 +814,8 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
if (bounds.height()>maxy) maxy=bounds.height();
}
if (name=="Daily") {
QString cpapinfo=date.toString(Qt::SystemLocaleLongDate)+"\n\n";
Day *cpap=PROFILE.GetDay(date,MT_CPAP);
QString cpapinfo=date.toString(Qt::SystemLocaleLongDate)+"\n\n";
if (cpap) {
time_t f=cpap->first()/1000L;
time_t l=cpap->last()/1000L;
@ -900,8 +900,10 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
painter.drawPixmap(res.width()-piesize,bounds.height(),piesize,piesize,ebp);
getDaily()->eventBreakdownPie()->showTitle(true);
painter.setFont(*defaultfont);
bounds=painter.boundingRect(QRectF((res.width()/2)-(res.width()/6),top,res.width()/2,0),cpapinfo,QTextOption(Qt::AlignLeft));
painter.drawText(bounds,cpapinfo,QTextOption(Qt::AlignLeft));
if (bounds.height()>maxy) maxy=bounds.height();
stats="AI="+QString::number(oai,'f',2)+" ";
stats+="HI="+QString::number(hi,'f',2)+" ";
@ -921,10 +923,12 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
bounds=painter.boundingRect(QRectF(0,top+maxy,res.width(),0),stats,QTextOption(Qt::AlignCenter));
painter.drawText(bounds,stats,QTextOption(Qt::AlignCenter));
if (maxy+bounds.height()>maxy) maxy=maxy+bounds.height();
} else {
bounds=painter.boundingRect(QRectF(0,top+maxy,res.width(),0),cpapinfo,QTextOption(Qt::AlignCenter));
painter.drawText(bounds,cpapinfo,QTextOption(Qt::AlignCenter));
if (maxy+bounds.height()>maxy) maxy=maxy+bounds.height();
}
QRectF bounds=painter.boundingRect(QRectF((res.width()/2)-(res.width()/6),top,res.width()/2,0),cpapinfo,QTextOption(Qt::AlignLeft));
painter.drawText(bounds,cpapinfo,QTextOption(Qt::AlignLeft));
if (bounds.height()>maxy) maxy=bounds.height();
} else if (name=="Overview") {
QDateTime first=QDateTime::fromTime_t((*gv)[0]->min_x/1000L);
QDateTime last=QDateTime::fromTime_t((*gv)[0]->max_x/1000L);

View File

@ -273,12 +273,221 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QGroupBox" name="groupBox_8">
<property name="title">
<string>Custom Event Flagging</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>4</number>
</property>
<item row="1" column="2">
<widget class="QDoubleSpinBox" name="apneaDuration">
<property name="suffix">
<string>s</string>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QDoubleSpinBox" name="apneaFlowRestriction">
<property name="suffix">
<string>%</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_34">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Apnea</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_38">
<property name="text">
<string>Duration</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="label_35">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Flow Restriction</string>
</property>
</widget>
</item>
<item row="1" column="5">
<spacer name="horizontalSpacer_4">
<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 row="2" column="4">
<widget class="QDoubleSpinBox" name="hypopneaFlowRestriction">
<property name="suffix">
<string>%</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="hypopneaDuration">
<property name="suffix">
<string>s</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_37">
<property name="text">
<string>Hypopnea</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_9">
<property name="title">
<string>AHI/Hour Graph Settings</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>4</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_36">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Window Size</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="ahiGraphWindowSize">
<property name="suffix">
<string> minutes</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="ahiGraphZeroReset">
<property name="text">
<string>Reset to zero after each window</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabOther">
<attribute name="title">
<string>Other</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_13">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">