Back to index

salome-gui  6.5.0
Defines | Functions
Qtx.cxx File Reference
#include "Qtx.h"
#include <QDir>
#include <QMenu>
#include <QRegExp>
#include <QBitmap>
#include <QWidget>
#include <QLayout>
#include <QPainter>
#include <QDirModel>
#include <QFileInfo>
#include <QCompleter>
#include <QApplication>
#include <QDesktopWidget>
#include <QtDebug>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <clocale>
#include <X11/Xlib.h>
#include <GL/glx.h>

Go to the source code of this file.

Defines

#define BICOLOR_CHANGE_HUE

Functions

static int stringToInt (const QString &str, int defVal, int minVal, int maxVal)
 Auxiliary function converting string str to the integer value.

Define Documentation

Definition at line 47 of file Qtx.cxx.


Function Documentation

static int stringToInt ( const QString &  str,
int  defVal,
int  minVal,
int  maxVal 
) [static]

Auxiliary function converting string str to the integer value.

Parameter defVal specifies default value that is returned if conversion can't be done. Parameters minVal and maxVal limit the resulting value.

Parameters:
strstring being converted
defValdefault value
minValminimum allowed value
maxValmaximum allowed value
Returns:
integer value obtained from the string

Definition at line 60 of file Qtx.cxx.

{
  bool ok;
  int v = str.toInt( &ok );
  if ( !ok ) v = defVal;
  return qMin( qMax( v, minVal ), maxVal );
}