Classes | Functions
QGpGuiTools Namespace Reference

Classes

class  Application
 Brief description of class still missing. More...
class  Attachments
class  BugReport
class  Cast
class  ColorButton
 A pushbutton to select a color. More...
class  ColorHistogram
class  ColorPalette
 A ColorPalette links a color palette with a vector of values. More...
class  ColorPaletteData
 Brief description of class still missing. More...
class  ColumnTextColumnsProperties
 Brief description of class still missing. More...
class  ColumnTextDelegate
 Brief description of class still missing. More...
class  ColumnTextItem
 Brief description of class still missing. More...
class  ColumnTextLinesProperties
 Brief description of class still missing. More...
class  ColumnTextSectionsProperties
 Brief description of class still missing. More...
class  ColumnTextWidget
 Brief description of class still missing. More...
class  ConnectionParam
 Brief description of class still missing. More...
class  CoordinateConvert
 Brief description of class still missing. More...
class  CoordinateFile
 Brief description of class still missing. More...
class  Dialog
 Dialog class for saving current rect in registry When a dialog box is not visible on the screen, it is not possible to retrieve its correct rectangle and state (maximized, minimized,...). This class dynamically store the rectangle while the dialog box is visible and save it to registry upon request, usually after Settings::setWidget(). More...
class  DockWidget
class  DoubleSpinBox
 Brief description of class still missing. More...
class  ExpandTabTitle
 Brief description of class still missing. More...
class  ExpandTabWidget
 Brief description of class still missing. More...
class  ExpressionEditor
 Brief description of class still missing. More...
class  FileDialog
class  FindReplaceWidget
 Brief description of class still missing. More...
class  FrameGrabber
class  GeographicalReference
 Brief description of class still missing. More...
class  GuiMessage
class  HttpAccess
 Brief description of class still missing. More...
class  HttpProxy
 Brief description of class still missing. More...
class  HttpProxyList
 Brief description of class still missing. More...
class  HttpProxyScript
 Brief description of class still missing. More...
class  LineEditDelegate
 A delegate for QLineEdit which initializes with model data. More...
class  LogView
class  LogWidget
class  LoopProgressWidget
 Brief description of class still missing. More...
class  MessageBox
class  MultiDocumentEnvironment
 Brief description of class still missing. More...
class  MultiDocumentSubWindow
 Brief description of class still missing. More...
class  MultiDocumentTab
 Brief description of class still missing. More...
class  MultiDocumentTabBar
 Brief description of class still missing. More...
class  MultiDocumentTabWidget
 Brief description of class still missing. More...
class  MultiDocumentWindow
 Brief description of class still missing. More...
class  NumericalLineEdit
 Brief description of class still missing. More...
class  PluginApplication
 Basic application feature made available for plugins. More...
class  PrintDialogWrapper
 Brief description of class still missing. More...
class  PrintParametersInt
class  ProgressBar
 Optimized for intensive computation. More...
class  PropertyArea
 Brief description of class still missing. More...
class  PropertyCategory
 Brief description of class still missing. More...
class  PropertyCategorySettings
 Brief description of class still missing. More...
class  PropertyContext
 Brief description of class still missing. More...
class  PropertyEditor
 Brief description of class still missing. More...
class  PropertyItem
 Brief description of class still missing. More...
class  PropertyProxy
 Brief description of class still missing. More...
class  PropertyTab
 Brief description of class still missing. More...
class  PropertyTabSettings
 Brief description of class still missing. More...
class  PropertyValue
 A property value managing red and bold indicators for constant and touched states, respectively. More...
class  PropertyWidget
 Brief description of class still missing. More...
class  RegExpRowSelector
 Brief description of class still missing. More...
class  SamplingParameterWidget
class  SendMail
class  Settings
class  SizeGrip
 Adds a size grip in the left/right bottom corner of a widget. More...
class  SmoothingParameterWidget
 Brief description of class still missing. More...
class  UpdateIcon
 Brief description of class still missing. More...
class  XMLEditor
 Brief description of class still missing. More...
class  XMLEditorDelegate
class  XMLItem
 Brief description of class still missing. More...

Functions

QString encodeToHtml (QString str)
bool inWeekdayRange (int day, const QString &wd1, const QString &wd2)
int monthIndex (const QString &mon)
QTextStream & operator<< (QTextStream &s, const ColorPalette &p)
QTextStream & operator>> (QTextStream &s, ColorPalette &p)
 PACKAGE_INFO (QGpGuiTools, QGPGUITOOLS)
QDialogButtonBox::StandardButton qtStandardButton (QString but)
void setWidgetColor (QWidget *w, QColor c)
QColor widgetColor (QWidget *w)

Detailed Description

QGpGuiTools.h


Function Documentation

QString QGpGuiTools::encodeToHtml ( QString  str)

References str.

  {
    str.replace("&","&amp;");
    str.replace("'","&apos;");
    str.replace("\"","&quot;");
    str.replace("<","&lt;");
    str.replace(">","&gt;");
    return str;
  }
bool QGpGuiTools::inWeekdayRange ( int  day,
const QString &  wd1,
const QString &  wd2 
)
  {
    int i=0;
    while(i<7 && wd1!=days[i]) {
      i++;
    }
    if(i==7) {
      return false;
    }
    while(day!=i && wd2!=days[i]) {
      i++;
      if(i==7) {
        i=0;
      }
    }
    return day==i;

  }
int QGpGuiTools::monthIndex ( const QString &  mon)
  {
    int i=0;
    while(i<12) {
      if(mon==months[i]) {
        return i;
      }
      i++;
    }
    return -1;
  }
QGPGUITOOLS_EXPORT QTextStream & QGpGuiTools::operator<< ( QTextStream &  s,
const ColorPalette &  p 
)

References TRACE.

Referenced by QGpGuiTools::LogView::append().

{
  TRACE;
  int n=p.count();
  s << n << " elements\n";
  s << "upper   red    green    blue\n";
  for(int i=0; i < (n - 1); i++ ) {
    s << p.upperValue(i) << " ";
    s << p.color(i).red() << " ";
    s << p.color(i).green() << " ";
    s << p.color(i).blue() << "\n";
  }
  // for compatibility reasons (with Sardine), store a last value
  s << 0 << " ";
  s << p.color(n - 1).red() << " ";
  s << p.color(n - 1).green() << " ";
  s << p.color(n - 1).blue() << "\n";
  // for compatibility reasons (with Sardine), store as a C printf format
  s << "%g0.6\n";
  return s;
}
QGPGUITOOLS_EXPORT QTextStream & QGpGuiTools::operator>> ( QTextStream &  s,
ColorPalette &  p 
)

References QGpGuiTools::ColorPalette::allocate(), QGpGuiTools::ColorPalette::setColor(), QGpGuiTools::ColorPalette::setUpperValue(), str, QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  QString str;
  int r, g, b;
  bool ok;

  str=s.readLine();
  int n=str.section( " ", 0, 0).toInt(&ok);
  if( !ok || !n) goto error;
  p.allocate(n);
  s.readLine();
  for(int i=0; i < n - 1; i++ ) {
    str=s.readLine();
    p.setUpperValue(i, str.section( " ", 0, 0).toDouble(&ok));
    if( !ok) goto error;
    r=str.section( " ", 1, 1).toInt(&ok);
    if( !ok) goto error;
    g=str.section( " ", 2, 2).toInt(&ok);
    if( !ok) goto error;
    b=str.section( " ", 3, 3).toInt(&ok);
    if( !ok) goto error;
    p.setColor(i, QColor(r, g, b) );
  }
  str=s.readLine();
  // first value is ignored for compatibility reasons (with Sardine)
  r=str.section( " ", 1, 1).toInt(&ok);
  if( !ok) goto error;
  g=str.section( " ", 2, 2).toInt(&ok);
  if( !ok) goto error;
  b=str.section( " ", 3, 3).toInt(&ok);
  if( !ok) goto error;
  p.setColor(n - 1, QColor(r, g, b) );
  str=s.readLine(); // Read precision and number type for compatibility (no longer part of ColorPalette 20080326)
  return s;
error:
  Message::wrongTextFormat(s, ColorPalette::tr("Restoring color palette"));
  return s;
}
QGpGuiTools::PACKAGE_INFO ( QGpGuiTools  ,
QGPGUITOOLS   
)
QDialogButtonBox::StandardButton QGpGuiTools::qtStandardButton ( QString  but)

References QGpCoreTools::tr().

Referenced by QGpGuiTools::MessageBox::setButton().

{
  if(but==tr("OK")) {
    return QDialogButtonBox::Ok;
  }
  if(but==tr("Cancel")) {
    return QDialogButtonBox::Cancel;
  }
  if(but==tr("Yes")) {
    return QDialogButtonBox::Yes;
  }
  if(but==tr("No")) {
    return QDialogButtonBox::No;
  }
  if(but==tr("Close")) {
    return QDialogButtonBox::Close;
  }
  if(but==tr("Ignore")) {
    return QDialogButtonBox::Ignore;
  }
  return QDialogButtonBox::NoButton;
}
QGPGUITOOLS_EXPORT void QGpGuiTools::setWidgetColor ( QWidget *  w,
QColor  c 
)

References TRACE.

{
  TRACE;
  QPalette palette;
  return w->palette().color(w->backgroundRole());
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines