23 #if defined (HAVE_CONFIG_H)
27 #include <QApplication>
29 #include <QMouseEvent>
53 return QString::fromLocal8Bit (s.c_str ());
80 foreach (
const QString&
s, l)
91 while ((tmp.length () > 0) && tmp.last ().isEmpty ())
103 template <
typename T>
109 static std::map<std::string, QFont::Weight> weightMap;
110 static std::map<std::string, QFont::Style> angleMap;
111 static bool mapsInitialized =
false;
113 if (! mapsInitialized)
120 angleMap[
std::string (
"normal")] = QFont::StyleNormal;
121 angleMap[
std::string (
"italic")] = QFont::StyleItalic;
122 angleMap[
std::string (
"oblique")] = QFont::StyleOblique;
124 mapsInitialized =
true;
127 f.setPointSizeF (props.get_fontsize_points (height));
128 f.setWeight (weightMap[props.get_fontweight ()]);
129 f.setStyle (angleMap[props.get_fontangle ()]);
148 if (rgb.
numel () == 3)
149 c.setRgbF (rgb(0), rgb(1), rgb(2));
163 c.getRgbF (tmp, tmp+1, tmp+2);
164 rgbData[0] = tmp[0]; rgbData[1] = tmp[1]; rgbData[2] = tmp[2];
176 Qt::MouseButtons buttons = event->buttons ();
177 Qt::KeyboardModifiers mods = event->modifiers ();
179 if (mods == Qt::NoModifier)
181 if (buttons == Qt::LeftButton)
183 else if (buttons == Qt::RightButton)
185 #if defined (Q_WS_WIN)
186 else if (buttons == (Qt::LeftButton | Qt::RightButton))
188 #elif defined (Q_WS_X11)
189 else if (buttons == Qt::MidButton)
193 else if (buttons == Qt::LeftButton)
195 if (mods == Qt::ShiftModifier)
197 else if (mods == Qt::ControlModifier)
221 QPoint
qp = c->mapFromGlobal (event->globalPos ());
228 return Matrix (1, 2, 0.0);
244 QPoint
qp = c->mapFromGlobal (QCursor::pos ());
251 return Matrix (1, 2, 0.0);
260 flags |= Qt::AlignLeft;
262 flags |= Qt::AlignHCenter;
264 flags |= Qt::AlignRight;
266 flags |= Qt::AlignLeft;
269 flags |= Qt::AlignVCenter;
271 flags |= Qt::AlignTop;
273 flags |= Qt::AlignBottom;
275 flags |= Qt::AlignVCenter;
287 int w = qMin (
dv(1), static_cast<octave_idx_type> (width));
288 int h = qMin (
dv(0), static_cast<octave_idx_type> (height));
290 int x_off = (w < width ? (width -
w) / 2 : 0);
291 int y_off = (h < height ? (height -
h) / 2 : 0);
293 QImage img (width, height, QImage::Format_ARGB32);
294 img.fill (qRgba (0, 0, 0, 0));
300 for (
int i = 0;
i <
w;
i++)
301 for (
int j = 0; j <
h; j++)
308 img.setPixel (x_off +
i, y_off + j, qRgba (r, g, b, a));
315 for (
int i = 0;
i <
w;
i++)
316 for (
int j = 0; j <
h; j++)
318 float r =
f(j,
i, 0);
319 float g =
f(j,
i, 1);
320 float b =
f(j,
i, 2);
324 img.setPixel (x_off +
i, y_off + j,
335 for (
int i = 0;
i <
w;
i++)
336 for (
int j = 0; j <
h; j++)
338 double r =
d(j,
i, 0);
339 double g =
d(j,
i, 1);
340 double b =
d(j,
i, 2);
344 img.setPixel (x_off +
i, y_off + j,
366 std::list<std::string> modList;
367 Qt::KeyboardModifiers mods =
event->modifiers ();
369 if (mods & Qt::ShiftModifier)
370 modList.push_back (
"shift");
371 if (mods & Qt::ControlModifier)
372 #if defined (Q_OS_MAC)
373 modList.push_back (
"command");
375 modList.push_back (
"control");
377 if (mods & Qt::AltModifier)
378 modList.push_back (
"alt");
379 #if defined (Q_OS_MAC)
380 if (mods & Qt::MetaModifier)
381 modList.push_back (
"control");
uint8NDArray uint8_array_value(void) const
static int qp(const Matrix &H, const ColumnVector &q, const Matrix &Aeq, const ColumnVector &beq, const Matrix &Ain, const ColumnVector &bin, int maxit, ColumnVector &x, ColumnVector &lambda, int &iter)
bool is_real_type(void) const
octave_idx_type numel(void) const
Number of elements in the array.
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
Qt::Alignment fromHVAlign(const std::string &halign, const std::string &valign)
QString fromStdString(const std::string &s)
void setfield(const std::string &key, const octave_value &val)
QStringList fromStringVector(const string_vector &v)
virtual Container * innerContainer(void)=0
Matrix figureCurrentPoint(const graphics_object &fig, QMouseEvent *event)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
template QFont computeFont< uicontrol >(const uicontrol::properties &props, int height)
QColor fromRgb(const Matrix &rgb)
std::string qKeyToKeyString(int key)
FloatNDArray float_array_value(bool frc_str_conv=false) const
template QFont computeFont< uibuttongroup >(const uibuttongroup::properties &props, int height)
octave_scalar_map makeKeyEventStruct(QKeyEvent *event)
Matrix toRgb(const QColor &c)
std::complex< double > w(std::complex< double > z, double relerr=0)
QFont computeFont(const typename T::properties &props, int height)
template QFont computeFont< uipanel >(const uipanel::properties &props, int height)
QImage makeImageFromCData(const octave_value &v, int width, int height)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
dim_vector dims(void) const
static Object * toolkitObject(const graphics_object &go)
bool strcmpi(const T &str_a, const T &str_b)
True if strings are the same, ignoring case.
NDArray array_value(bool frc_str_conv=false) const
std::string figureSelectionType(QMouseEvent *event, bool isDoubleClick)
=val(i)}if ode{val(i)}occurs in table i
bool is_uint8_type(void) const
octave_idx_type ndims(void) const
Number of dimensions.
Cell toCellString(const QStringList &l)
const T * fortran_vec(void) const
bool is_single_type(void) const
Vector representing the dimensions (size) of an Array.
std::string toStdString(const QString &s)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
base_properties & properties(void)
string_vector toStringVector(const QStringList &l)
T::properties & properties(graphics_object obj)