QString CAF_Application::getFileFilter() const
{
if ( stdApp().IsNull() )
- return QString::null;
+ return QString();
TColStd_SequenceOfExtendedString formats;
stdApp()->Formats( formats );
}
if ( wildCards.isEmpty() )
- return QString::null;
+ return QString();
QStringList filters;
for ( QMap<QString, QStringList>::ConstIterator it = wildCards.begin(); it != wildCards.end(); ++it )
virtual bool openTransaction();
virtual bool abortTransaction();
virtual bool hasTransaction() const;
- virtual bool commitTransaction( const QString& = QString::null );
+ virtual bool commitTransaction( const QString& = QString() );
virtual void setStdDoc( Handle(TDocStd_Document)& );
}
}
if ( modList.isEmpty() ) {
- QString mods = resMgr->stringValue( "launch", "modules", QString::null );
+ QString mods = resMgr->stringValue( "launch", "modules", QString() );
modList = mods.split( ",", QString::SkipEmptyParts );
}
if ( modName.isEmpty() )
continue;
- QString modTitle = resMgr->stringValue( *it, "name", QString::null );
+ QString modTitle = resMgr->stringValue( *it, "name", QString() );
if ( modTitle.isEmpty() )
{
printf( "****************************************************************\n" );
continue;
}
- QString modIcon = resMgr->stringValue( *it, "icon", QString::null );
+ QString modIcon = resMgr->stringValue( *it, "icon", QString() );
- QString modLibrary = resMgr->stringValue( *it, "library", QString::null ).trimmed();
+ QString modLibrary = resMgr->stringValue( *it, "library", QString() ).trimmed();
if ( !modLibrary.isEmpty() )
{
modLibrary = SUIT_Tools::file( modLibrary.trimmed() );
#include <QCompleter>
#include <QApplication>
#include <QDesktopWidget>
+#include <QLinearGradient>
+#include <QRadialGradient>
+#include <QConicalGradient>
#include <stdio.h>
#include <stdlib.h>
return res;
}
+
+/*!
+ \brief Convert color to the string representation.
+
+ The resulting string is in the one of two possible formats
+ (\c RR, \c GG, \c BB and \c AA value represent red, green, blue
+ and alpha components of the color):
+ - if color has alpha channel : "#RR,#GG,#BB,#AA"
+ - if color does not have alpha channel : "#RRGGBB"
+
+ If color is invalid, null string is returned.
+
+ Backward conversion can be done with stringToColor() method.
+
+ \param color color to be converted
+ \return string representation of the color
+
+ \sa stringToColor()
+*/
+QString Qtx::colorToString( const QColor& color )
+{
+ QString str;
+ if ( color.isValid() )
+ {
+ if ( color.alpha() != 255 )
+ {
+ QStringList vals;
+ vals << QString( "#%1" ).arg( color.red(), 0, 16 );
+ vals << QString( "#%1" ).arg( color.green(), 0, 16 );
+ vals << QString( "#%1" ).arg( color.blue(), 0, 16 );
+ vals << QString( "#%1" ).arg( color.alpha(), 0, 16 );
+ str = vals.join( "," );
+ }
+ else
+ {
+ str = color.name();
+ }
+ }
+ return str;
+}
+
+/*!
+ \brief Create color from the string representation.
+
+ The parameter \a str must be in the one of following formats
+ (\c RR, \c GG, \c BB and \c AA value represent red, green, blue
+ and alpha components of the color):
+ - "#RR,#GG,#BB[,#AA]" or "#RR #GG #BB[ #AA]" (\c RR, \c GG, \c BB
+ and optional \c AA values represent red, green, blue and alpha
+ components of the color in hexadecimal form)
+ - "RR,GG,BB[,AA]" or "RR GG BB[ AA]" (\c RR, \c GG, \c BB
+ and optional \c AA values represent red, green, blue and alpha
+ components of the color in decimal form)
+ - #RRGGBB" - (\c RR, \c GG and \c BB values represent red, green and blue
+ components of the color in hexadecimal form)
+ - an integer value representing packed color components (see rgbSet())
+ - a name from the list of colors defined in the list of SVG color keyword names
+ provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro".
+
+ Backward conversion can be done with colorToString() method.
+
+ \param str string representation of the color
+ \param color resulting color value
+ \return \c true if the conversion is successful and \c false otherwise
+
+ \sa colorToString(), rgbSet()
+*/
+bool Qtx::stringToColor( const QString& str, QColor& color )
+{
+ bool res = true;
+ QStringList vals = str.split( QRegExp( "[\\s|,]" ), QString::SkipEmptyParts );
+
+ QIntList nums;
+ for ( QStringList::const_iterator it = vals.begin(); it != vals.end() && res; ++it )
+ {
+ int num = 0;
+ if ( (*it).startsWith( "#" ) )
+ num = (*it).mid( 1 ).toInt( &res, 16 );
+ else
+ num = (*it).toInt( &res, 10 );
+ if ( res )
+ nums.append( num );
+ }
+
+ res = res && nums.count() >= 3;
+ if ( res )
+ color.setRgb( nums[0], nums[1], nums[2] );
+
+ if ( !res )
+ {
+ int pack = str.toInt( &res );
+ if ( res )
+ color = Qtx::rgbSet( pack );
+ }
+
+ if ( !res )
+ {
+ color = QColor( str );
+ res = color.isValid();
+ }
+
+ return res;
+}
+
+/*!
+ \brief Dump linear gradient to the string description.
+ \param gradient linear gradient to be converted
+ \return string representation of the linear gradient
+ \sa stringToLinearGradient()
+*/
+QString Qtx::gradientToString( const QLinearGradient& gradient )
+{
+ QStringList data;
+ data << "linear";
+ data << QString::number( gradient.start().x() );
+ data << QString::number( gradient.start().y() );
+ data << QString::number( gradient.finalStop().x() );
+ data << QString::number( gradient.finalStop().y() );
+ switch( gradient.spread() )
+ {
+ case QGradient::PadSpread:
+ data << "pad";
+ break;
+ case QGradient::RepeatSpread:
+ data << "repeat";
+ break;
+ case QGradient::ReflectSpread:
+ data << "reflect";
+ break;
+ default:
+ break;
+ }
+ QGradientStops stops = gradient.stops();
+ QGradientStop stop;
+ foreach ( stop, stops )
+ {
+ data << QString::number( stop.first );
+ data << colorToString( stop.second );
+ }
+ return data.join( "|" );
+}
+
+/*!
+ \brief Dump radial gradient to the string description.
+ \param gradient radial gradient to be converted
+ \return string representation of the radial gradient
+ \sa stringToRadialGradient()
+*/
+QString Qtx::gradientToString( const QRadialGradient& gradient )
+{
+ QStringList data;
+ data << "radial";
+ data << QString::number( gradient.center().x() );
+ data << QString::number( gradient.center().y() );
+ data << QString::number( gradient.radius() );
+ data << QString::number( gradient.focalPoint().x() );
+ data << QString::number( gradient.focalPoint().y() );
+ switch( gradient.spread() )
+ {
+ case QGradient::PadSpread:
+ data << "pad";
+ break;
+ case QGradient::RepeatSpread:
+ data << "repeat";
+ break;
+ case QGradient::ReflectSpread:
+ data << "reflect";
+ break;
+ default:
+ break;
+ }
+ QGradientStops stops = gradient.stops();
+ QGradientStop stop;
+ foreach ( stop, stops )
+ {
+ data << QString::number( stop.first );
+ data << colorToString( stop.second );
+ }
+ return data.join( "|" );
+}
+
+/*!
+ \brief Dump conical gradient to the string description.
+ \param gradient conical gradient to be converted
+ \return string representation of the conical gradient
+ \sa stringToConicalGradient()
+*/
+QString Qtx::gradientToString( const QConicalGradient& gradient )
+{
+ QStringList data;
+ data << "conical";
+ data << QString::number( gradient.center().x() );
+ data << QString::number( gradient.center().y() );
+ data << QString::number( gradient.angle() );
+ switch( gradient.spread() )
+ {
+ case QGradient::PadSpread:
+ data << "pad";
+ break;
+ case QGradient::RepeatSpread:
+ data << "repeat";
+ break;
+ case QGradient::ReflectSpread:
+ data << "reflect";
+ break;
+ default:
+ break;
+ }
+ QGradientStops stops = gradient.stops();
+ QGradientStop stop;
+ foreach ( stop, stops )
+ {
+ data << QString::number( stop.first );
+ data << colorToString( stop.second );
+ }
+ return data.join( "|" );
+}
+
+/*!
+ \brief Create linear gradient from its string representation.
+ \param str string representation of the linear gradient
+ \param gradient resulting linear gradient object
+ \return \c true if the conversion is successful and \c false otherwise
+ \sa gradientToString()
+*/
+bool Qtx::stringToLinearGradient( const QString& str, QLinearGradient& gradient )
+{
+ bool success = false;
+ QStringList vals = str.split( "|", QString::SkipEmptyParts );
+ if ( vals.count() > 4 && ( vals[0] == "linear" || vals[0] == "lg" ) )
+ {
+ // start and end points
+ double x1, y1, x2, y2;
+ bool bOk1, bOk2, bOk3, bOk4;
+ x1 = vals[1].toDouble( &bOk1 );
+ y1 = vals[2].toDouble( &bOk2 );
+ x2 = vals[3].toDouble( &bOk3 );
+ y2 = vals[4].toDouble( &bOk4 );
+ if ( bOk1 && bOk2 && bOk3 && bOk4 )
+ {
+ gradient = QLinearGradient( x1, y1, x2, y2 );
+ // spread type
+ if ( vals.count() > 5 )
+ {
+ if ( vals[ 5 ] == "pad" || vals[ 5 ] == "0" )
+ gradient.setSpread( QGradient::PadSpread );
+ else if ( vals[ 5 ] == "repeat" || vals[ 5 ] == "2" )
+ gradient.setSpread( QGradient::RepeatSpread );
+ else if ( vals[ 5 ] == "reflect" || vals[ 5 ] == "1" )
+ gradient.setSpread( QGradient::ReflectSpread );
+ }
+ // stop points
+ QGradientStops stops;
+ for ( int i = 6; i < vals.count(); i+=2 )
+ {
+ bool bOk5, bOk6 = false;
+ QColor c;
+ double stop = vals[i].toDouble( &bOk5 );
+ if ( i+1 < vals.count() )
+ bOk6 = stringToColor( vals[ i+1 ], c );
+ if ( bOk5 && stop >= 0.0 && stop <= 1.0 && bOk6 && c.isValid() )
+ stops.append( QGradientStop( stop, c ) );
+ }
+ gradient.setStops( stops );
+ success = true;
+ }
+ }
+ return success;
+}
+
+/*!
+ \brief Create radial gradient from its string representation.
+ \param str string representation of the radial gradient
+ \param gradient resulting radial gradient object
+ \return \c true if the conversion is successful and \c false otherwise
+ \sa gradientToString()
+*/
+bool Qtx::stringToRadialGradient( const QString& str, QRadialGradient& gradient )
+{
+ bool success = false;
+ QStringList vals = str.split( "|", QString::SkipEmptyParts );
+ if ( vals.count() > 5 && vals[0] == "radial" || vals[0] == "rg" )
+ {
+ // center, radius and focal point
+ double cx, cy, r, fx, fy;
+ bool bOk1, bOk2, bOk3, bOk4, bOk5;
+ cx = vals[1].toDouble( &bOk1 );
+ cy = vals[2].toDouble( &bOk2 );
+ r = vals[3].toDouble( &bOk3 );
+ fx = vals[4].toDouble( &bOk4 );
+ fy = vals[5].toDouble( &bOk5 );
+ if ( bOk1 && bOk2 && bOk3 && bOk4 && bOk5 )
+ {
+ gradient = QRadialGradient( cx, cy, r, fx, fy );
+ // spread type
+ if ( vals.count() > 6 )
+ {
+ if ( vals[ 6 ] == "pad" || vals[ 6 ] == "0" )
+ gradient.setSpread( QGradient::PadSpread );
+ else if ( vals[ 6 ] == "repeat" || vals[ 6 ] == "2" )
+ gradient.setSpread( QGradient::RepeatSpread );
+ else if ( vals[ 6 ] == "reflect" || vals[ 6 ] == "1" )
+ gradient.setSpread( QGradient::ReflectSpread );
+ }
+ // stop points
+ QGradientStops stops;
+ for ( int i = 7; i < vals.count(); i+=2 )
+ {
+ bool bOk7, bOk8 = false;
+ QColor c;
+ double stop = vals[i].toDouble( &bOk7 );
+ if ( i+1 < vals.count() )
+ bOk8 = stringToColor( vals[ i+1 ], c );
+ if ( bOk7 && stop >= 0.0 && stop <= 1.0 && bOk8 && c.isValid() )
+ stops.append( QGradientStop( stop, c ) );
+ }
+ gradient.setStops( stops );
+ success = true;
+ }
+ }
+ return success;
+}
+
+/*!
+ \brief Create conical gradient from its string representation.
+ \param str string representation of the conical gradient
+ \param gradient resulting conical gradient object
+ \return \c true if the conversion is successful and \c false otherwise
+ \sa gradientToString()
+*/
+bool Qtx::stringToConicalGradient( const QString& str, QConicalGradient& gradient )
+{
+ bool success = false;
+ QStringList vals = str.split( "|", QString::SkipEmptyParts );
+ if ( vals.count() > 3 && vals[0] == "conical" || vals[0] == "cg" )
+ {
+ // center and angle
+ double cx, cy, a;
+ bool bOk1, bOk2, bOk3;
+ cx = vals[1].toDouble( &bOk1 );
+ cy = vals[2].toDouble( &bOk2 );
+ a = vals[3].toDouble( &bOk3 );
+ if ( bOk1 && bOk2 && bOk3 )
+ {
+ gradient = QConicalGradient( cx, cy, a );
+ // spread type
+ if ( vals.count() > 4 )
+ {
+ if ( vals[ 4 ] == "pad" || vals[ 4 ] == "0" )
+ gradient.setSpread( QGradient::PadSpread );
+ else if ( vals[ 4 ] == "repeat" || vals[ 4 ] == "2" )
+ gradient.setSpread( QGradient::RepeatSpread );
+ else if ( vals[ 4 ] == "reflect" || vals[ 4 ] == "1" )
+ gradient.setSpread( QGradient::ReflectSpread );
+ }
+ // stop points
+ QGradientStops stops;
+ for ( int i = 5; i < vals.count(); i+=2 )
+ {
+ bool bOk4, bOk5 = false;
+ QColor c;
+ double stop = vals[i].toDouble( &bOk4 );
+ if ( i+1 < vals.count() )
+ bOk5 = stringToColor( vals[ i+1 ], c );
+ if ( bOk4 && stop >= 0.0 && stop <= 1.0 && bOk5 && c.isValid() )
+ stops.append( QGradientStop( stop, c ) );
+ }
+ gradient.setStops( stops );
+ success = true;
+ }
+ }
+ return success;
+}
class QObject;
class QWidget;
class QCompleter;
+class QLinearGradient;
+class QRadialGradient;
+class QConicalGradient;
typedef QList<int> QIntList; //!< list of int values
typedef QList<short> QShortList; //!< list of short int values
static QImage transparentImage( const int, const int, const int = -1 );
static QPixmap transparentPixmap( const int, const int, const int = -1 );
static QPixmap composite( const QPixmap&, const int, const int, const QPixmap& = QPixmap() );
+
+ static QString colorToString( const QColor& );
+ static bool stringToColor( const QString&, QColor& );
+
+ static QString gradientToString( const QLinearGradient& );
+ static QString gradientToString( const QRadialGradient& );
+ static QString gradientToString( const QConicalGradient& );
+ static bool stringToLinearGradient( const QString&, QLinearGradient& );
+ static bool stringToRadialGradient( const QString&, QRadialGradient& );
+ static bool stringToConicalGradient( const QString&, QConicalGradient& );
};
#endif
protected:
static int intValue( const ItemAttributes&, const QString&, const int );
static QString strValue( const ItemAttributes&, const QString&,
- const QString& = QString::null );
+ const QString& = QString() );
private:
QtxActionMgr::Reader* myReader; //!< actions reader
};
virtual ~Reader();
QStringList options() const;
- QString option( const QString&, const QString& = QString::null ) const;
+ QString option( const QString&, const QString& = QString() ) const;
void setOption( const QString&, const QString& );
virtual bool read( const QString&, Creator& ) const = 0;
myMin = min;
myMax = max;
- myPrecise = QString::null;
+ myPrecise = QString();
if ( colorMode() == Auto || labelMode() == Auto )
updateScale();
return;
myFormat = format;
- myPrecise = QString::null;
+ myPrecise = QString();
if ( colorMode() == Auto )
updateScale();
}
return;
myInterval = num;
- myPrecise = QString::null;
+ myPrecise = QString();
updateScale();
}
setUpdatesEnabled( false );
setItemIcon( curIndex, QIcon() );
- setItemText( curIndex, QString::null );
+ setItemText( curIndex, QString() );
QComboBox::paintEvent( e );
if ( !(*it).startsWith( itemPrefix ) )
continue;
- QString link = resMgr->stringValue( section, *it, QString::null );
+ QString link = resMgr->stringValue( section, *it, QString() );
if ( link.isEmpty() || map.contains( link ) )
continue;
if ( !(*it).startsWith( itemPrefix ) )
continue;
- QString link = resMgr->stringValue( section, *it, QString::null );
+ QString link = resMgr->stringValue( section, *it, QString() );
if ( !link.isEmpty() && !map.contains( link ) )
{
lst.append( link );
QStringList prepareFilters( const QString& ) const;
bool hasVisibleChildren( QWidget* ) const;
QStringList filterWildCards( const QString& ) const;
- QString autoExtension( const QString&, const QString& = QString::null ) const;
+ QString autoExtension( const QString&, const QString& = QString() ) const;
protected:
enum { OpenFile, SaveFile, OpenDir, SaveDir, NewDir };
if ( !quietMode && QMessageBox::information(this,
tr("Warning"),
tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()),
- tr("Yes"), tr("No"), QString::null, 1, 1) == 1) {
+ tr("Yes"), tr("No"), QString(), 1, 1) == 1) {
myEdit->setFocus();
return false;
}
bool getBoolean( const bool = false ) const;
QColor getColor( const QColor& = QColor() ) const;
QFont getFont( const QFont& = QFont() ) const;
- QString getString( const QString& = QString::null ) const;
+ QString getString( const QString& = QString() ) const;
void setInteger( const int );
void setDouble( const double );
if ( !filePath.isEmpty() )
{
if ( !QFileInfo( filePath ).exists() )
- filePath = QString::null;
+ filePath = QString();
}
return filePath;
}
*/
QString QtxResourceMgr::Resources::environmentVariable( const QString& str, int& start, int& len ) const
{
- QString varName = QString::null;
+ QString varName;
len = 0;
QRegExp rx( "(^\\$\\{|[^\\$]\\$\\{)([a-zA-Z]+[a-zA-Z0-9_]*)(\\})|(^\\$\\(|[^\\$]\\$\\()([a-zA-Z]+[a-zA-Z0-9_]*)(\\))|(^\\$|[^\\$]\\$)([a-zA-Z]+[a-zA-Z0-9_]*)|(^%|[^%]%)([a-zA-Z]+[a-zA-Z0-9_]*)(%[^%]|%$)" );
if ( !value( sect, name, val, true ) )
return false;
- bool res = true;
- QStringList vals = val.split( QRegExp( "[\\s|,]" ), QString::SkipEmptyParts );
-
- QIntList nums;
- for ( QStringList::const_iterator it = vals.begin(); it != vals.end() && res; ++it )
- {
- int num = 0;
- if ( (*it).startsWith( "#" ) )
- num = (*it).mid( 1 ).toInt( &res, 16 );
- else
- num = (*it).toInt( &res, 10 );
- if ( res )
- nums.append( num );
- }
-
- res = res && nums.count() >= 3;
- if ( res )
- cVal.setRgb( nums[0], nums[1], nums[2] );
-
- if ( !res )
- {
- int pack = val.toInt( &res );
- if ( res )
- cVal = Qtx::rgbSet( pack );
- }
-
- if ( !res )
- {
- cVal = QColor( val );
- res = cVal.isValid();
- }
-
- return res;
+ return Qtx::stringToColor( val, cVal );
}
/*!
return !baVal.isEmpty();
}
+/*!
+ \brief Get linear gradient parameter value.
+ \param sect section name
+ \param name parameter name
+ \param gVal parameter to return resulting linear gradient value value
+ \return \c true if parameter is found and \c false if parameter is not found
+ (in this case \a gVal value is undefined)
+*/
+bool QtxResourceMgr::value( const QString& sect, const QString& name, QLinearGradient& gVal ) const
+{
+ QString val;
+ if ( !value( sect, name, val, true ) )
+ return false;
+
+ return Qtx::stringToLinearGradient( val, gVal );
+}
+
+/*!
+ \brief Get radial gradient parameter value.
+ \param sect section name
+ \param name parameter name
+ \param gVal parameter to return resulting radial gradient value value
+ \return \c true if parameter is found and \c false if parameter is not found
+ (in this case \a gVal value is undefined)
+*/
+bool QtxResourceMgr::value( const QString& sect, const QString& name, QRadialGradient& gVal ) const
+{
+ QString val;
+ if ( !value( sect, name, val, true ) )
+ return false;
+
+ return Qtx::stringToRadialGradient( val, gVal );
+}
+
+/*!
+ \brief Get conical gradient parameter value.
+ \param sect section name
+ \param name parameter name
+ \param gVal parameter to return resulting conical gradient value value
+ \return \c true if parameter is found and \c false if parameter is not found
+ (in this case \a gVal value is undefined)
+*/
+bool QtxResourceMgr::value( const QString& sect, const QString& name, QConicalGradient& gVal ) const
+{
+ QString val;
+ if ( !value( sect, name, val, true ) )
+ return false;
+
+ return Qtx::stringToConicalGradient( val, gVal );
+}
+
/*!
\brief Get string parameter value (native format).
\param sect section name
return val;
}
+/*!
+ \brief Get linear gradient parameter value.
+
+ If the specified parameter is not found, the specified default value is returned instead.
+
+ \param sect section name
+ \param name parameter name
+ \param def default value
+ \return parameter value (or default value if parameter is not found)
+*/
+QLinearGradient QtxResourceMgr::linearGradientValue( const QString& sect, const QString& name, const QLinearGradient& def ) const
+{
+ QLinearGradient val;
+ if ( !value( sect, name, val ) )
+ val = def;
+ return val;
+}
+
+/*!
+ \brief Get radial gradient parameter value.
+
+ If the specified parameter is not found, the specified default value is returned instead.
+
+ \param sect section name
+ \param name parameter name
+ \param def default value
+ \return parameter value (or default value if parameter is not found)
+*/
+QRadialGradient QtxResourceMgr::radialGradientValue( const QString& sect, const QString& name, const QRadialGradient& def ) const
+{
+ QRadialGradient val;
+ if ( !value( sect, name, val ) )
+ val = def;
+ return val;
+}
+
+/*!
+ \brief Get conical gradient parameter value.
+
+ If the specified parameter is not found, the specified default value is returned instead.
+
+ \param sect section name
+ \param name parameter name
+ \param def default value
+ \return parameter value (or default value if parameter is not found)
+*/
+QConicalGradient QtxResourceMgr::conicalGradientValue( const QString& sect, const QString& name, const QConicalGradient& def ) const
+{
+ QConicalGradient val;
+ if ( !value( sect, name, val ) )
+ val = def;
+ return val;
+}
+
/*!
\brief Check parameter existence.
\param sect section name
if ( checkExisting() && value( sect, name, res ) && res == val )
return;
- setResource( sect, name, val.isValid() ? val.name() : QString() );
+ setResource( sect, name, Qtx::colorToString( val ) );
}
/*!
setResource( sect, name, lst.join( " " ) );
}
+/*!
+ \brief Set linear gradient parameter value.
+ \param sect section name
+ \param name parameter name
+ \param val parameter value
+*/
+void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QLinearGradient& val )
+{
+ QLinearGradient res;
+ if ( checkExisting() && value( sect, name, res ) && res == val )
+ return;
+
+ setResource( sect, name, Qtx::gradientToString( val ) );
+}
+
+/*!
+ \brief Set radial gradient parameter value.
+ \param sect section name
+ \param name parameter name
+ \param val parameter value
+*/
+void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QRadialGradient& val )
+{
+ QRadialGradient res;
+ if ( checkExisting() && value( sect, name, res ) && res == val )
+ return;
+
+ setResource( sect, name, Qtx::gradientToString( val ) );
+}
+
+/*!
+ \brief Set conical gradient parameter value.
+ \param sect section name
+ \param name parameter name
+ \param val parameter value
+*/
+void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QConicalGradient& val )
+{
+ QConicalGradient res;
+ if ( checkExisting() && value( sect, name, res ) && res == val )
+ return;
+
+ setResource( sect, name, Qtx::gradientToString( val ) );
+}
+
/*!
\brief Remove resources section.
\param sect section name
#include <QPixmap>
#include <QByteArray>
#include <QStringList>
+#include <QLinearGradient>
+#include <QRadialGradient>
+#include <QConicalGradient>
class QTranslator;
#endif
public:
- QtxResourceMgr( const QString&, const QString& = QString::null );
+ QtxResourceMgr( const QString&, const QString& = QString() );
virtual ~QtxResourceMgr();
- QString appName() const;
- QStringList dirList() const;
-
- bool checkExisting() const;
- virtual void setCheckExisting( const bool );
-
- bool isPixmapCached() const;
- void setIsPixmapCached( const bool );
-
- void clear();
-
- void setIgnoreUserValues( const bool = true );
- bool ignoreUserValues() const;
-
- bool value( const QString&, const QString&, int& ) const;
- bool value( const QString&, const QString&, double& ) const;
- bool value( const QString&, const QString&, bool& ) const;
- bool value( const QString&, const QString&, QColor& ) const;
- bool value( const QString&, const QString&, QFont& ) const;
- bool value( const QString&, const QString&, QByteArray& ) const;
- bool value( const QString&, const QString&, QString&, const bool = true ) const;
-
- int integerValue( const QString&, const QString&, const int = 0 ) const;
- double doubleValue( const QString&, const QString&, const double = 0 ) const;
- bool booleanValue( const QString&, const QString&, const bool = false ) const;
- QFont fontValue( const QString&, const QString&, const QFont& = QFont() ) const;
- QColor colorValue( const QString&, const QString&, const QColor& = QColor() ) const;
- QString stringValue( const QString&, const QString&, const QString& = QString::null ) const;
- QByteArray byteArrayValue( const QString&, const QString&, const QByteArray& = QByteArray() ) const;
-
- bool hasSection( const QString& ) const;
- bool hasValue( const QString&, const QString& ) const;
-
- void setValue( const QString&, const QString&, const int );
- void setValue( const QString&, const QString&, const double );
- void setValue( const QString&, const QString&, const bool );
- void setValue( const QString&, const QString&, const QFont& );
- void setValue( const QString&, const QString&, const QColor& );
- void setValue( const QString&, const QString&, const QString& );
- void setValue( const QString&, const QString&, const QByteArray& );
-
- void remove( const QString& );
- void remove( const QString&, const QString& );
-
- QString currentFormat() const;
- void setCurrentFormat( const QString& );
-
- Format* format( const QString& ) const;
- void installFormat( Format* );
- void removeFormat( Format* );
-
- QStringList options() const;
- QString option( const QString& ) const;
- void setOption( const QString&, const QString& );
-
- QPixmap defaultPixmap() const;
- virtual void setDefaultPixmap( const QPixmap& );
-
- QString resSection() const;
- QString langSection() const;
-
- QPixmap loadPixmap( const QString&, const QString& ) const;
- QPixmap loadPixmap( const QString&, const QString&, const bool ) const;
- QPixmap loadPixmap( const QString&, const QString&, const QPixmap& ) const;
- void loadLanguage( const QString& = QString::null, const QString& = QString::null );
-
- void raiseTranslators( const QString& );
- void removeTranslators( const QString& );
- void loadTranslator( const QString&, const QString& );
- void loadTranslators( const QString&, const QStringList& );
-
- QString path( const QString&, const QString&, const QString& ) const;
-
- bool load();
- bool import( const QString& );
- bool save();
-
- QStringList sections() const;
- QStringList parameters( const QString& ) const;
-
- void refresh();
+ QString appName() const;
+ QStringList dirList() const;
+
+ bool checkExisting() const;
+ virtual void setCheckExisting( const bool );
+
+ bool isPixmapCached() const;
+ void setIsPixmapCached( const bool );
+
+ void clear();
+
+ void setIgnoreUserValues( const bool = true );
+ bool ignoreUserValues() const;
+
+ bool value( const QString&, const QString&, int& ) const;
+ bool value( const QString&, const QString&, double& ) const;
+ bool value( const QString&, const QString&, bool& ) const;
+ bool value( const QString&, const QString&, QColor& ) const;
+ bool value( const QString&, const QString&, QFont& ) const;
+ bool value( const QString&, const QString&, QByteArray& ) const;
+ bool value( const QString&, const QString&, QLinearGradient& ) const;
+ bool value( const QString&, const QString&, QRadialGradient& ) const;
+ bool value( const QString&, const QString&, QConicalGradient& ) const;
+ bool value( const QString&, const QString&, QString&, const bool = true ) const;
+
+ int integerValue( const QString&, const QString&, const int = 0 ) const;
+ double doubleValue( const QString&, const QString&, const double = 0 ) const;
+ bool booleanValue( const QString&, const QString&, const bool = false ) const;
+ QFont fontValue( const QString&, const QString&, const QFont& = QFont() ) const;
+ QColor colorValue( const QString&, const QString&, const QColor& = QColor() ) const;
+ QString stringValue( const QString&, const QString&, const QString& = QString() ) const;
+ QByteArray byteArrayValue( const QString&, const QString&, const QByteArray& = QByteArray() ) const;
+ QLinearGradient linearGradientValue( const QString&, const QString&, const QLinearGradient& = QLinearGradient() ) const;
+ QRadialGradient radialGradientValue( const QString&, const QString&, const QRadialGradient& = QRadialGradient() ) const;
+ QConicalGradient conicalGradientValue( const QString&, const QString&, const QConicalGradient& = QConicalGradient() ) const;
+
+ bool hasSection( const QString& ) const;
+ bool hasValue( const QString&, const QString& ) const;
+
+ void setValue( const QString&, const QString&, const int );
+ void setValue( const QString&, const QString&, const double );
+ void setValue( const QString&, const QString&, const bool );
+ void setValue( const QString&, const QString&, const QFont& );
+ void setValue( const QString&, const QString&, const QColor& );
+ void setValue( const QString&, const QString&, const QString& );
+ void setValue( const QString&, const QString&, const QByteArray& );
+ void setValue( const QString&, const QString&, const QLinearGradient& );
+ void setValue( const QString&, const QString&, const QRadialGradient& );
+ void setValue( const QString&, const QString&, const QConicalGradient& );
+
+ void remove( const QString& );
+ void remove( const QString&, const QString& );
+
+ QString currentFormat() const;
+ void setCurrentFormat( const QString& );
+
+ Format* format( const QString& ) const;
+ void installFormat( Format* );
+ void removeFormat( Format* );
+
+ QStringList options() const;
+ QString option( const QString& ) const;
+ void setOption( const QString&, const QString& );
+
+ QPixmap defaultPixmap() const;
+ virtual void setDefaultPixmap( const QPixmap& );
+
+ QString resSection() const;
+ QString langSection() const;
+
+ QPixmap loadPixmap( const QString&, const QString& ) const;
+ QPixmap loadPixmap( const QString&, const QString&, const bool ) const;
+ QPixmap loadPixmap( const QString&, const QString&, const QPixmap& ) const;
+ void loadLanguage( const QString& = QString(), const QString& = QString() );
+
+ void raiseTranslators( const QString& );
+ void removeTranslators( const QString& );
+ void loadTranslator( const QString&, const QString& );
+ void loadTranslators( const QString&, const QStringList& );
+
+ QString path( const QString&, const QString&, const QString& ) const;
+
+ bool load();
+ bool import( const QString& );
+ bool save();
+
+ QStringList sections() const;
+ QStringList parameters( const QString& ) const;
+
+ void refresh();
protected:
- virtual void setDirList( const QStringList& );
- virtual void setResource( const QString&, const QString&, const QString& );
+ virtual void setDirList( const QStringList& );
+ virtual void setResource( const QString&, const QString&, const QString& );
- virtual QString userFileName( const QString&, const bool = true ) const;
- virtual QString globalFileName( const QString& ) const;
+ virtual QString userFileName( const QString&, const bool = true ) const;
+ virtual QString globalFileName( const QString& ) const;
private:
- void initialize( const bool = true ) const;
- QString substMacro( const QString&, const QMap<QChar, QString>& ) const;
+ void initialize( const bool = true ) const;
+ QString substMacro( const QString&, const QMap<QChar, QString>& ) const;
private:
typedef QList<Resources*> ResList;
typedef QMap<QString, TransList> TransListMap;
private:
- QString myAppName; //!< application name
- QStringList myDirList; //!< list of resources directories
- FormatList myFormats; //!< list of formats
- OptionsMap myOptions; //!< options map
- ResList myResources; //!< resources list
- bool myCheckExist; //!< "check existance" flag
- TransListMap myTranslator; //!< map of loaded translators
- QPixmap* myDefaultPix; //!< default icon
- bool myIsPixmapCached; //!< "cached pixmaps" flag
-
- bool myIsIgnoreUserValues; //!< "ignore user values" flag
+ QString myAppName; //!< application name
+ QStringList myDirList; //!< list of resources directories
+ FormatList myFormats; //!< list of formats
+ OptionsMap myOptions; //!< options map
+ ResList myResources; //!< resources list
+ bool myCheckExist; //!< "check existance" flag
+ TransListMap myTranslator; //!< map of loaded translators
+ QPixmap* myDefaultPix; //!< default icon
+ bool myIsPixmapCached; //!< "cached pixmaps" flag
+
+ bool myIsIgnoreUserValues; //!< "ignore user values" flag
friend class QtxResourceMgr::Format;
};
//
#include "QtxSplash.h"
+#include "QtxResourceMgr.h"
#include <QApplication>
#include <QPainter>
return myInfo;
}
+/*!
+ \brief Set constant information option value.
+
+ The option is a part of the constant information text,
+ which is replaced at the time of the displaying.
+
+ The following options are supported:
+ - %A - could be used as application name
+ - %V - could be used as application version
+ - %L - could be used as application license information
+ - %C - could be used as application copyright information
+
+ \param name option name
+ \param option value
+ \sa option()
+*/
+void QtxSplash::setOption( const QString& name, const QString& value )
+{
+ myOptions[ name ] = value;
+ repaint();
+}
+
+/*!
+ \brief Get constant information option value.
+ \param name option name
+ \return option value or empty string if option is not set
+ \sa setOption()
+*/
+QString QtxSplash::option( const QString& name ) const
+{
+ QString val;
+ if ( myOptions.contains( name ) )
+ val = myOptions[ name ];
+ return val;
+}
+
/*!
\brief Get current status message.
\return status message
QApplication::flush();
}
+/*!
+ \brief Read splash settings from the resources manager.
+ \param resMgr resources manager
+ \param section resources file section name (if empty, the default name is used).
+*/
+void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section )
+{
+ QString resSection = section.isEmpty() ? "splash" : section;
+
+ // pixmap
+ QString pxname;
+ if ( resMgr->value( resSection, "image", pxname ) ) {
+ QPixmap px( pxname );
+ if ( !px.isNull() )
+ setPixmap( px );
+ }
+
+ // hide-on-click
+#ifdef _DEBUG_
+ setHideOnClick( true );
+#else
+ bool bHide;
+ if ( resMgr->value( resSection, "hide_on_click", bHide ) ) {
+ setHideOnClick( bHide );
+ }
+#endif
+
+ // margin
+ int m;
+ if ( resMgr->value( resSection, "margin", m ) ) {
+ setMargin( m );
+ }
+
+ // progress bar width
+ int pw;
+ if ( resMgr->value( resSection, "progress_width", pw ) ) {
+ setProgressWidth( pw );
+ }
+
+ // progress bar position and direction
+ int pf;
+ if ( resMgr->value( resSection, "progress_flags", pf ) ) {
+ setProgressFlags( pf );
+ }
+
+ // opacity
+ double op;
+ if ( resMgr->value( resSection, "opacity", op ) ) {
+ setOpacity( op );
+ }
+
+ // font
+ QFont f;
+ if ( resMgr->value( resSection, "font", f ) ) {
+ setFont( f );
+ }
+
+ // text alignment
+ int al;
+ if ( resMgr->value( resSection, "alignment", al ) ) {
+ setTextAlignment( al );
+ }
+
+ // progress color(s)
+ QString pc;
+ QLinearGradient grad;
+ if ( resMgr->value( resSection, "progress_gradient", grad ) ) {
+ // gradient-colored progress bar
+ setProgressGradient( grad );
+ }
+ else if ( resMgr->value( resSection, "progress_color", pc ) ||
+ resMgr->value( resSection, "progress_colors", pc ) ) {
+ // one/two-colored progress bar
+ QStringList colors = pc.split( "|", QString::SkipEmptyParts );
+ QColor c1, c2;
+ QtxSplash::GradientType gradType = QtxSplash::Vertical;
+ if ( colors.count() > 0 ) c1 = QColor( colors[0] );
+ if ( colors.count() > 1 ) c2 = QColor( colors[1] );
+ int gt;
+ bool bOk;
+ if ( colors.count() > 2 ) {
+ gt = colors[2].toInt( &bOk );
+ if ( bOk && gt >= QtxSplash::Horizontal && gt <= QtxSplash::Vertical )
+ gradType = (QtxSplash::GradientType)gt;
+ }
+ setProgressColors( c1, c2, gradType );
+ }
+
+ // text color(s)
+ QString tc;
+ if ( resMgr->value( resSection, "text_color", tc ) ||
+ resMgr->value( resSection, "text_colors", tc ) ) {
+ QStringList colors = tc.split( "|", QString::SkipEmptyParts );
+ QColor c1, c2;
+ if ( colors.count() > 0 )
+ c1 = QColor( colors[0] );
+ if ( colors.count() > 1 )
+ c2 = QColor( colors[1] );
+ setTextColors( c1, c2 );
+ }
+
+ // const info
+ QString cinfo;
+ if ( resMgr->value( resSection, "constant_info", cinfo, false ) ||
+ resMgr->value( resSection, "info", cinfo, false ) ) {
+ setConstantInfo( cinfo.split( "|", QString::KeepEmptyParts ).join( "\n" ) );
+ }
+}
+
/*!
\brief Set status message for the splash screen and define its color
and aligment flags.
*/
void QtxSplash::clear()
{
- myMessage = QString::null;
+ myMessage.clear();
repaint();
}
QString QtxSplash::fullMessage() const
{
QStringList info;
- if ( !myInfo.isEmpty() )
- info << myInfo;
+
+ QString cinfo = myInfo;
+ cinfo = cinfo.replace( QRegExp( "%A" ), option( "%A" ) );
+ cinfo = cinfo.replace( QRegExp( "%V" ), option( "%V" ) );
+ cinfo = cinfo.replace( QRegExp( "%L" ), option( "%L" ) );
+ cinfo = cinfo.replace( QRegExp( "%C" ), option( "%C" ) );
+
+ if ( !cinfo.isEmpty() )
+ info << cinfo;
if ( !myMessage.isEmpty() )
info << myMessage;
return info.join( "\n" );
#include <QWidget>
#include <QPixmap>
#include <QLinearGradient>
+#include <QMap>
#ifdef WIN32
#pragma warning( disable:4251 )
#endif
+class QtxResourceMgr;
+
class QTX_EXPORT QtxSplash : public QWidget
{
Q_OBJECT
static QtxSplash* splash( const QPixmap& = QPixmap() );
static void setStatus( const QString&, const int = -1 );
- static void setError( const QString&, const QString& = QString::null, const int = -1 );
+ static void setError( const QString&, const QString& = QString(), const int = -1 );
void setPixmap( const QPixmap& );
QPixmap pixmap() const;
void setConstantInfo( const QString& info );
QString constantInfo() const;
+ void setOption( const QString&, const QString& );
+ QString option( const QString& ) const;
+
QString message() const;
int error() const;
void finish( QWidget* );
void repaint();
+ void readSettings( QtxResourceMgr*, const QString& = QString() );
+
public slots:
void setMessage( const QString&,
const int,
void setError( const int );
QString fullMessage() const;
+private:
+ typedef QMap<QString, QString> OptMap;
+
private:
static QtxSplash* mySplash;
double myOpacity; //!< progress bar / status message opacity
int myError; //!< error code
bool myGradientUsed; //!< 'use custom gradient color scale' flag
+ OptMap myOptions; //!< constant info options
};
#endif
if ( !isHeaderEditing() )
return;
- QString oldTxt = myEditedHeader ? myEditedHeader->label( myEditedSection ) : QString::null;
+ QString oldTxt = myEditedHeader ? myEditedHeader->label( myEditedSection ) : QString();
if ( accept && myEditedHeader )
setHeaderContentFromEditor( myEditedHeader, myEditedSection, myHeaderEditor );
- QString newTxt = myEditedHeader ? myEditedHeader->label( myEditedSection ) : QString::null;
+ QString newTxt = myEditedHeader ? myEditedHeader->label( myEditedSection ) : QString();
int sec = myEditedSection;
QHeader* hdr = myEditedHeader;
#include <QApplication>
#include <QInputDialog>
#include <QStackedWidget>
+#include <QAbstractButton>
#include <QPainter>
#include <QStyleOption>
}
-QtxWorkstackAreaTitleButton::QtxWorkstackAreaTitleButton(QWidget *widget)
-: QAbstractButton(widget)
+/*
+ \class CloseButton
+ \brief Workstack area close button.
+ \internal
+*/
+class CloseButton : public QAbstractButton
+{
+public:
+ CloseButton( QWidget* );
+
+ QSize sizeHint() const;
+ QSize minimumSizeHint() const;
+
+ void enterEvent( QEvent* );
+ void leaveEvent( QEvent* );
+ void paintEvent( QPaintEvent* );
+};
+
+/*!
+ \brief Constructor
+ \internal
+ \param parent parent widget
+*/
+CloseButton::CloseButton( QWidget* parent )
+: QAbstractButton( parent )
{
- setFocusPolicy(Qt::NoFocus);
+ setFocusPolicy( Qt::NoFocus );
}
-QSize QtxWorkstackAreaTitleButton::sizeHint() const
+/*!
+ \brief Get appropriate size for the button.
+ \internal
+ \return size value
+*/
+QSize CloseButton::sizeHint() const
{
ensurePolished();
int dim = 0;
- if( !icon().isNull() ) {
+ if( !icon().isNull() )
+ {
const QPixmap pm = icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ),
QIcon::Normal );
- dim = qMax(pm.width(), pm.height());
+ dim = qMax( pm.width(), pm.height() );
}
return QSize( dim + 4, dim + 4 );
}
-void QtxWorkstackAreaTitleButton::enterEvent( QEvent *event )
+
+/*!
+ \brief Get minimum appropriate size for the button.
+ \internal
+ \return minimum size value
+*/
+QSize CloseButton::minimumSizeHint() const
+{
+ return sizeHint();
+}
+
+/*!
+ \brief Process mouse enter event.
+ \internal
+ \param event mouse enter event
+*/
+void CloseButton::enterEvent( QEvent *event )
{
if ( isEnabled() )
update();
QAbstractButton::enterEvent( event );
}
-void QtxWorkstackAreaTitleButton::leaveEvent( QEvent *event )
+/*!
+ \brief Process mouse leave event.
+ \internal
+ \param event mouse leave event
+*/
+void CloseButton::leaveEvent( QEvent *event )
{
if( isEnabled() )
update();
QAbstractButton::leaveEvent( event );
}
-void QtxWorkstackAreaTitleButton::paintEvent( QPaintEvent* )
+/*!
+ \brief Process paint event.
+ \internal
+ \param event paint event
+*/
+void CloseButton::paintEvent( QPaintEvent* )
{
- QPainter p(this);
+ QPainter p( this );
QRect r = rect();
QStyleOption opt;
- opt.init(this);
+ opt.init( this );
opt.state |= QStyle::State_AutoRaise;
- if (isEnabled() && underMouse() && !isChecked() && !isDown())
+ if ( isEnabled() && underMouse() && !isChecked() && !isDown() )
opt.state |= QStyle::State_Raised;
- if (isChecked())
+ if ( isChecked() )
opt.state |= QStyle::State_On;
- if (isDown())
+ if ( isDown() )
opt.state |= QStyle::State_Sunken;
- style()->drawPrimitive(QStyle::PE_PanelButtonTool, &opt, &p, this);
+ style()->drawPrimitive( QStyle::PE_PanelButtonTool, &opt, &p, this );
- int shiftHorizontal = opt.state & QStyle::State_Sunken ? style()->pixelMetric(QStyle::PM_ButtonShiftHorizontal, &opt, this) : 0;
- int shiftVertical = opt.state & QStyle::State_Sunken ? style()->pixelMetric(QStyle::PM_ButtonShiftVertical, &opt, this) : 0;
+ int shiftHorizontal = opt.state & QStyle::State_Sunken ? style()->pixelMetric( QStyle::PM_ButtonShiftHorizontal, &opt, this ) : 0;
+ int shiftVertical = opt.state & QStyle::State_Sunken ? style()->pixelMetric( QStyle::PM_ButtonShiftVertical, &opt, this ) : 0;
- r.adjust(2, 2, -2, -2);
- r.translate(shiftHorizontal, shiftVertical);
+ r.adjust( 2, 2, -2, -2 );
+ r.translate( shiftHorizontal, shiftVertical );
QPixmap pm = icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ), isEnabled() ?
underMouse() ? QIcon::Active : QIcon::Normal
- : QIcon::Disabled,
- isDown() ? QIcon::On : QIcon::Off);
- style()->drawItemPixmap(&p, r, Qt::AlignCenter, pm);
+ : QIcon::Disabled,
+ isDown() ? QIcon::On : QIcon::Off );
+ style()->drawItemPixmap( &p, r, Qt::AlignCenter, pm );
}
/*!
myBar = new QtxWorkstackTabBar( top );
tl->addWidget( myBar, 1 );
- QtxWorkstackAreaTitleButton* close = new QtxWorkstackAreaTitleButton( top );
+ CloseButton* close = new CloseButton( top );
close->setIcon( style()->standardIcon( QStyle::SP_TitleBarCloseButton ) );
myClose = close;
tl->addWidget( myClose );
#include <QTabBar>
#include <QEvent>
#include <QMap>
-#include <QAbstractButton>
class QAction;
class QSplitter;
class QStackedWidget;
class QRubberBand;
+class QAbstractButton;
class QtxWorkstackArea;
class QtxWorkstackDrag;
friend class QtxWorkstackDrag;
};
-/*
- Tool window title
-*/
-class QtxWorkstackAreaTitleButton : public QAbstractButton
-{
- Q_OBJECT
-
-public:
- QtxWorkstackAreaTitleButton(QWidget *widget);
-
- QSize sizeHint() const;
- inline QSize minimumSizeHint() const
- { return sizeHint(); }
-
- void enterEvent(QEvent *event);
- void leaveEvent(QEvent *event);
- void paintEvent(QPaintEvent *event);
-};
-
class QtxWorkstackArea : public QFrame
{
Q_OBJECT
void STD_Application::onOpenDoc()
{
// It is preferrable to use OS-specific file dialog box here !!!
- QString aName = getFileName( true, QString::null, getFileFilter(), QString::null, 0 );
+ QString aName = getFileName( true, QString(), getFileFilter(), QString(), 0 );
if ( aName.isNull() )
return;
bool isOk = false;
while ( !isOk )
{
- QString aName = getFileName( false, study->studyName(), getFileFilter(), QString::null, 0 );
+ QString aName = getFileName( false, study->studyName(), getFileFilter(), QString(), 0 );
if ( aName.isNull() )
return false;
SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel, SUIT_MessageBox::Yes );
if ( aAnswer == SUIT_MessageBox::Cancel )
{ // cancelled
- aName = QString::null;
+ aName = QString();
isOk = true;
}
else if ( aAnswer == SUIT_MessageBox::No ) // not save to this file
void viewManagers( ViewManagerList& ) const;
void viewManagers( const QString&, ViewManagerList& ) const;
- virtual QString getFileFilter() const { return QString::null; }
+ virtual QString getFileFilter() const { return QString(); }
virtual QString getFileName( bool open, const QString& initial, const QString& filters,
const QString& caption, QWidget* parent );
QString getDirectory( const QString& initial, const QString& caption, QWidget* parent );
*/
QString SUIT_Application::applicationVersion() const
{
- return QString::null;
+ return QString();
}
/*!
bool changed = !myStatusLabel->text().isEmpty();
myStatusLabel->clear();
if ( changed )
- emit infoChanged( QString::null );
+ emit infoChanged( QString() );
}
/*!
*/
QString SUIT_Operation::operationName() const
{
- return QString::null;
+ return QString();
}
/*!
virtual bool openTransaction();
virtual bool abortTransaction();
virtual bool hasTransaction() const;
- virtual bool commitTransaction( const QString& = QString::null );
+ virtual bool commitTransaction( const QString& = QString() );
void setExecStatus( const int );
class SUIT_EXPORT SUIT_ResourceMgr : public QtxResourceMgr
{
public:
- SUIT_ResourceMgr( const QString&, const QString& = QString::null );
+ SUIT_ResourceMgr( const QString&, const QString& = QString() );
virtual ~SUIT_ResourceMgr();
virtual QString version() const;
virtual ~SUIT_SelectionMgr();
void clearSelected();
- virtual void selected( SUIT_DataOwnerPtrList&, const QString& = QString::null ) const;
+ virtual void selected( SUIT_DataOwnerPtrList&, const QString& = QString() ) const;
virtual void setSelected( const SUIT_DataOwnerPtrList&, const bool = false );
void selectors( QList<SUIT_Selector*>& ) const;
void selectors( const QString&, QList<SUIT_Selector*>& ) const;
- void setEnabled( const bool, const QString& = QString::null );
+ void setEnabled( const bool, const QString& = QString() );
bool hasSelectionMode( const int ) const;
virtual bool openTransaction();
virtual bool abortTransaction();
virtual bool hasTransaction() const;
- virtual bool commitTransaction( const QString& = QString::null );
+ virtual bool commitTransaction( const QString& = QString() );
private:
typedef QList<SUIT_Operation*> Operations;
// get file name
SUIT_Application* app = myManager->study()->application();
- QString fileName = app->getFileName( false, QString::null, filter(), tr( "TLT_DUMP_VIEW" ), 0 );
+ QString fileName = app->getFileName( false, QString(), filter(), tr( "TLT_DUMP_VIEW" ), 0 );
if ( !fileName.isEmpty() )
{
QString fmt = SUIT_Tools::extension( fileName ).toUpper();