Definition in file utils.cpp.
#include <cmath>
#include <qcheckbox.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qtable.h>
#include "utils.h"
Go to the source code of this file.
Functions | |
QString | inputLine (const QString keyword, const double a, const double b, const double c) |
Returns a string ready to be written to a Brabo input file. | |
QString | inputLine (const QString keyword, const int a, const int b, const int c) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a string ready to be written to a Brabo input file. | |
QString | inputLine (const QString keyword, const int a, const double b) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a string ready to be written to a Brabo input file. | |
QString | validatedSYMMLine (QCheckBox *bx, QCheckBox *by, QCheckBox *bz, QCheckBox *bxy, QCheckBox *bxz, QCheckBox *byz, QCheckBox *bxyz) |
Returns a string ready to be written to an input file, from the symmetry checkboxes. | |
template<typename T> | |
void | limitRange (const T &min, T &value, const T &max) |
Limits the value between min and max. | |
void | resetTable (QTable *table) |
Clears a table and sets the number of rows to 3. | |
void | saveTable (const QTable *table, unsigned int &numLines, vector< unsigned int > &hPos, vector< unsigned int > &vPos, QStringList &contents) |
Saves the contents of a QTable to a data structure for use with BraboBase, RelaxBase, . | |
void | restoreTable (QTable *table, const unsigned int &numLines, const vector< unsigned int > &hPos, const vector< unsigned int > &vPos, const QStringList &contents) |
Restores a QTable from the contents of a data structure for use with BraboBase, RelaxBase, . | |
void | checkTableOverflow (QTable *table, const int row, const int col) |
Spans cells of a QTable over multiple columns if the contents exceed 10 characters. | |
void | addTableRow (QTable *table) |
Adds a row to a table when no rows are selected. | |
bool | removeTableRow (QTable *table) |
Removes the selected rows from a QTable. | |
bool | clearTableSelection (QTable *table) |
Clears the selected cells in a table. Returns false if no cells were cleared. | |
QStringList | tableContents (const QTable *table) |
Returns the contents of the non-empty rows of the Table in BRABO fixed format. | |
bool | emptyTableRow (const QTable *table, const int row) |
Returns true if a certain row of a Table is empty. | |
int | firstEmptyTableRow (QTable *table) |
Returns the number of the first empty row of a Table and adds a new row if none are empty. |
|
Returns a string ready to be written to a Brabo input file. It will consist of the keyword and up to 3 double values. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a string ready to be written to a Brabo input file. It will consist of the keyword and up to 3 integer values. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a string ready to be written to a Brabo input file. It will consist of the keyword, 1 integer and 1 double value. |
|
Returns a string ready to be written to an input file, from the symmetry checkboxes. It should also adapt those checkboxes to reflect the proper configuration. |
|
Limits the value between min and max.
|
|
Clears a table and sets the number of rows to 3.
|
|
Saves the contents of a QTable to a data structure for use with BraboBase, RelaxBase, . .. |
|
Restores a QTable from the contents of a data structure for use with BraboBase, RelaxBase, . .. |
|
Spans cells of a QTable over multiple columns if the contents exceed 10 characters. |
|
Adds a row to a table when no rows are selected. Inserts a row before a selected row. |
|
Removes the selected rows from a QTable. Returns false if no rows were selected. |
|
Clears the selected cells in a table. Returns false if no cells were cleared.
|
|
Returns the contents of the non-empty rows of the Table in BRABO fixed format.
|
|
Returns true if a certain row of a Table is empty.
|
|
Returns the number of the first empty row of a Table and adds a new row if none are empty.
|