GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Table.cc File Reference
#include <QCheckBox>
#include <QComboBox>
#include <QEvent>
#include <QFrame>
#include <QHBoxLayout>
#include <QHeaderView>
#include <QLabel>
#include <QLineEdit>
#include <QModelIndexList>
#include <QMouseEvent>
#include <QString>
#include <QStringList>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QTimer>
#include "Container.h"
#include "ContextMenu.h"
#include "Table.h"
#include "QtHandlesUtils.h"
#include "octave-qobject.h"
#include "graphics.h"
#include "interpreter.h"
#include "oct-stream.h"
#include "oct-string.h"
#include "oct-strstrm.h"
#include "ov-struct.h"
Include dependency graph for Table.cc:

Go to the source code of this file.

Namespaces

 QtHandles
 

Macros

#define AUTO_HEIGHT   (tp.get_fontsize () * 2 - 1)
 
#define FORMAT_INT_VALUE()
 
#define FORMAT_UINT_VALUE()
 
#define FORMAT_VALUE(f, l)
 
#define FORMAT_VALUE_EXCEPT_RAT(f, l)
 
#define FORMATNUMBER(type)
 
#define SCANF_AND_CONVERT(name, ctype, format)
 

Functions

static octave_value QtHandles::attempt_type_conversion (const octave_value &ov, const octave_value &old_value)
 
static QString QtHandles::formatComplex (Complex c, char format='f', int precision=4)
 
static QString QtHandles::formatNumber (double d, char format='f', int precision=4)
 
static QString QtHandles::formatNumber (float d, char format='f', int precision=4)
 
static QTableWidgetItem * QtHandles::itemFor (octave_value val, std::string format="", bool enabled=false)
 
static std::pair< Qt::AlignmentFlag, QString > QtHandles::qStringValueFor (octave_value val, std::string format="")
 
static QSize QtHandles::realQSizeForTable (QTableWidget *t)
 

Variables

static const int QtHandles::AUTO_WIDTH = 75
 

Macro Definition Documentation

◆ AUTO_HEIGHT

#define AUTO_HEIGHT   (tp.get_fontsize () * 2 - 1)

Definition at line 65 of file Table.cc.

◆ FORMAT_INT_VALUE

#define FORMAT_INT_VALUE ( )
Value:
text = QString::number (value); \
if (format == "char" || format == "popup") \
flag = Qt::AlignLeft ; \
else if (format == "+") \
{ \
if (value > 0) \
text = Utils::fromStdString ("+"); \
else if (value < 0) \
text = Utils::fromStdString ("-"); \
else \
text = Utils::fromStdString (""); \
}
QString fromStdString(const std::string &s)
size_t format(std::ostream &os, const char *fmt,...)
Definition: utils.cc:1329

Definition at line 178 of file Table.cc.

◆ FORMAT_UINT_VALUE

#define FORMAT_UINT_VALUE ( )
Value:
text = QString::number (value); \
if (format == "char" || format == "popup") \
flag = Qt::AlignLeft; \
else if (format == "+") \
{ \
if (value > 0) \
text = Utils::fromStdString ("+"); \
else \
text = Utils::fromStdString (""); \
}

Definition at line 166 of file Table.cc.

◆ FORMAT_VALUE

#define FORMAT_VALUE (   f,
 
)
Value:
else if (format == "rat") \
text = Utils::fromStdString (rational_approx (double (value), 0)); \
else \
{ \
text = formatNumber (value, 'n', f); \
flag = Qt::AlignLeft ; \
}
#define FORMAT_VALUE_EXCEPT_RAT(f, l)
Definition: Table.cc:125
F77_RET_T const F77_DBLE const F77_DBLE * f
static QString formatNumber(float d, char format='f', int precision=4)
Definition: Table.cc:115
std::string rational_approx(T val, int len)
Definition: oct-string.cc:612

Definition at line 156 of file Table.cc.

◆ FORMAT_VALUE_EXCEPT_RAT

#define FORMAT_VALUE_EXCEPT_RAT (   f,
 
)
Value:
if (format == "numeric" || format == "short") \
text = formatNumber (value, 'n', f); \
else if (format == "short f" || format == "shortf") \
text = formatNumber (value, 'f', f); \
else if (format == "short e" || format == "shorte") \
text = formatNumber (value, 'e', f); \
else if (format == "short eng" || format == "shorteng") \
text = formatNumber (value, 'F', f); \
else if (format == "short g" || format == "shortg") \
text = formatNumber (value, 'g', f + 1); \
else if (format == "long") \
text = formatNumber (value, 'n', l); \
else if (format == "long f" || format == "longf") \
text = formatNumber (value, 'f', l); \
else if (format == "long e" || format == "longe") \
text = formatNumber (value, 'e', l); \
else if (format == "long eng" || format == "longeng") \
text = formatNumber (value, 'E', l); \
else if (format == "long g" || format == "longg") \
text = formatNumber (value, 'g', l + 1); \
else if (format == "bank") \
text = QString::number (value, 'f', 2); \
else if (format == "+") \
if (value > 0) \
text = Utils::fromStdString ("+"); \
else if (value < 0) \
text = Utils::fromStdString ("-"); \
else \
text = Utils::fromStdString ("");

Definition at line 125 of file Table.cc.

◆ FORMATNUMBER

#define FORMATNUMBER (   type)

Definition at line 78 of file Table.cc.

◆ SCANF_AND_CONVERT

#define SCANF_AND_CONVERT (   name,
  ctype,
  format 
)
Value:
else if (old_value.is_ ## name ## _type ()) \
{ \
ctype val; \
int n; \
const std::string cxx_str = ov.string_value (); \
const char *c_str = cxx_str.c_str (); \
int error = sscanf (c_str, format, &val, &n); \
if (error != 1 || c_str[n]) \
{ \
val = 0; \
} \
retval = octave_value ( octave_ ## name (val)); \
}
void error(const char *fmt,...)
Definition: error.cc:968
QString name
octave_idx_type n
Definition: mx-inlines.cc:753
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))