1 /*
2 Copyright (C) 2011 Elvis Stansvik <elvstone@gmail.com>
3 
4 For general Scribus (>=1.3.2) copyright and licensing information please refer
5 to the COPYING file provided with the program. Following this notice may exist
6 a copyright and/or license notice that predates the release of Scribus 1.3.2
7 for which a new license (GPL+exception) is in place.
8 */
9 #include "pageitem_table.h"
10 #include "scribusdoc.h"
11 
12 #include "tablecolumnwidthsdialog.h"
13 
TableColumnWidthsDialog(ScribusDoc * doc,QWidget * parent)14 TableColumnWidthsDialog::TableColumnWidthsDialog(ScribusDoc* doc, QWidget *parent) : QDialog(parent),
15 	m_doc(doc)
16 {
17 	Q_ASSERT(m_doc);
18 
19 	setupUi(this);
20 
21 	tableColumnWidth->setNewUnit(m_doc->unitIndex());
22 	tableColumnWidth->setMinimum(PageItem_Table::MinimumColumnWidth * m_doc->unitRatio());
23 }
24 
columnWidth() const25 double TableColumnWidthsDialog::columnWidth() const
26 {
27 	Q_ASSERT(m_doc);
28 
29 	return tableColumnWidth->getValue(m_doc->unitIndex());
30 }
31