Commit d8ed35d5 authored by Thomas Friedrichsmeier's avatar Thomas Friedrichsmeier
Browse files

Some tweaks to <matrix> element

parent e4d85443
......@@ -3069,19 +3069,19 @@ made checkable, thus acting like a simple checkbox at the same time.
</varlistentry>
<varlistentry>
<term><parameter>fixed_width</parameter></term>
<listitem><para>Force the GUI element to stay at its initial width. Do not use in combindation with matrices, where the number of columns may change in any way. Useful, esp. when creating a vector input element (rows="1"). (optional, defaults to false).</para></listitem>
<listitem><para>Force the GUI element to stay at its initial width. Do not use in combination with matrices, where the number of columns may change in any way. Useful, esp. when creating a vector input element (rows="1"). With this option set to true, no vertical scroll bar will be shown, even in the matrix exceeds the available height (as this would affect the width). (optional, defaults to false).</para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>fixed_height</parameter></term>
<listitem><para>Force the GUI element to stay at its initial height. Do not use in combindation with matrices, where the number of rows may change in any way. Useful, esp. when creating a vector input element (columns="1"). (optional, defaults to false).</para></listitem>
<listitem><para>Force the GUI element to stay at its initial height. Do not use in combination with matrices, where the number of rows may change in any way. Useful, esp. when creating a vector input element (columns="1"). With this option set to true, no horizontal scroll bar will be shown, even in the matrix exceeds the available width (as this would affect the height). (optional, defaults to false).</para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>horiz_headers</parameter></term>
<listitem><para>Strings to ues for the horiztonal header, separated by ";". (optional, defaults to column number).</para></listitem>
<listitem><para>Strings to ues for the horiztonal header, separated by ";". The header will be hidden, if set to "". (optional, defaults to column number).</para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>vert_headers</parameter></term>
<listitem><para>Strings to ues for the vertical header, separated by ";". (optional, defaults to row number).</para></listitem>
<listitem><para>Strings to ues for the vertical header, separated by ";". The header will be hidden, if set to "". (optional, defaults to row number).</para></listitem>
</varlistentry>
</variablelist></para></listitem>
</varlistentry>
......
......@@ -2,7 +2,7 @@
rkmatrixinput - description
-------------------
begin : Tue Oct 09 2012
copyright : (C) 2012 by Thomas Friedrichsmeier
copyright : (C) 2012, 2015 by Thomas Friedrichsmeier
email : tfry@users.sourceforge.net
***************************************************************************/
......@@ -83,17 +83,21 @@ RKMatrixInput::RKMatrixInput (const QDomElement& element, RKComponent* parent_co
model = new RKMatrixInputModel (this);
QString headers = xml->getStringAttribute (element, "horiz_headers", QString (), DL_INFO);
if (!headers.isEmpty ()) model->horiz_header = headers.split (';');
else if (!headers.isNull ()) display->horizontalHeader ()->hide (); // attribute explicitly set to ""
headers = xml->getStringAttribute (element, "vert_headers", QString (), DL_INFO);
if (!headers.isEmpty ()) model->vert_header = headers.split (';');
else if (!headers.isNull ()) display->verticalHeader ()->hide ();
updateAll ();
display->setModel (model);
display->setAlternatingRowColors (true);
if (xml->getBoolAttribute (element, "fixed_width", false, DL_INFO)) {
int max_col = column_count->intValue () - 1;
display->setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
display->setFixedWidth (display->verticalHeader ()->width () + display->columnViewportPosition (max_col) + display->columnWidth (max_col) + display->verticalHeader ()->fontMetrics ().width ("0"));
}
if (xml->getBoolAttribute (element, "fixed_height", false, DL_INFO)) {
int max_row = row_count->intValue () - 1;
display->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
display->setFixedHeight (display->horizontalHeader ()->height () + display->rowViewportPosition (max_row) + display->rowHeight (max_row));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment