Back to index

salome-gui  6.5.0
Classes | Defines | Functions
QtxSplash.cxx File Reference
#include "QtxSplash.h"
#include "QtxResourceMgr.h"
#include <cstdio>
#include <QApplication>
#include <QPainter>
#include <QMessageBox>
#include <QDesktopWidget>

Go to the source code of this file.

Classes

class  ProgressEvent
 Progress change custom event. More...

Defines

#define BOUNDED(a, min, max)   ( a >= min && a <= max )

Functions

static bool checkGradient (const QGradient *g)
 Check if the gradient is defined in the relative coordinates [static].

Define Documentation

#define BOUNDED (   a,
  min,
  max 
)    ( a >= min && a <= max )

Function Documentation

static bool checkGradient ( const QGradient *  g) [static]

Check if the gradient is defined in the relative coordinates [static].

Returns:
true if gradient is defined in the relative coordinates

Definition at line 1157 of file QtxSplash.cxx.

{
#define BOUNDED( a, min, max ) ( a >= min && a <= max )
  if ( g->type() == QGradient::LinearGradient ) {
    const QLinearGradient* lg = static_cast<const QLinearGradient*>( g );
    return BOUNDED( lg->start().x(), 0.0, 1.0 ) && 
           BOUNDED( lg->start().y(), 0.0, 1.0 ) && 
           BOUNDED( lg->finalStop().x(), 0.0, 1.0 ) && 
           BOUNDED( lg->finalStop().y(), 0.0, 1.0 );
  }
  if ( g->type() == QGradient::RadialGradient ) {
    const QRadialGradient* rg = static_cast<const QRadialGradient*>( g );
    return BOUNDED( rg->center().x(), 0.0, 1.0 ) && 
           BOUNDED( rg->center().y(), 0.0, 1.0 ) && 
           BOUNDED( rg->focalPoint().x(), 0.0, 1.0 ) && 
           BOUNDED( rg->focalPoint().y(), 0.0, 1.0 ); // && BOUNDED( rg->radius(), 0.0, 1.0 );
  }
  if ( g->type() == QGradient::ConicalGradient ) {
    const QConicalGradient* cg = static_cast<const QConicalGradient*>( g );
    return BOUNDED( cg->center().x(), 0.0, 1.0 ) && 
           BOUNDED( cg->center().y(), 0.0, 1.0 );
  }
  return false;
}