# class KGlobalSettings

###

Module | kdeui
Namespace |
Class | KGlobalSettings
Inherits | QObject

Access the KDE global configuration.

Author David Faure \<faure@kde.org\>

### enums

- ChangeType { PaletteChanged, FontChanged, StyleChanged, SettingsChanged, IconChanged, CursorChanged, ToolbarStyleChanged, ClipboardConfigChanged, BlockShortcuts }
- Completion { CompletionNone, CompletionAuto, CompletionMan, CompletionShell, CompletionPopup, CompletionPopupAuto }
- GraphicEffect { NoEffects, GradientEffects, SimpleAnimationEffects, ComplexAnimationEffects }
  typesafe object: GraphicEffects
- SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS, SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS }
- TearOffHandle { Disable, ApplicationLevel, Enable }

enum details

### methods

- KGlobalSettings ( )

  returns ctor
  Not implemented

- activeTextColor ( )

  returns QColor
  static

  The default color to use for active texts. Returns the active text color

- activeTitleColor ( )

  returns QColor
  static

  The default color to use for active titles. Returns the active title color

- allowDefaultBackgroundImages ( )

  returns bool
  static

  Returns if default background images are allowed by the color scheme. A "default" background image is just that, i.e. the user has not actively selected a background image to use. Returns true if default background images may be used

- appearanceChanged ( )

  returns Nothing
  SIGNAL ("appearanceChanged ()")

  Emitted when the application has changed either its GUI style, its font or its palette in response to a kdisplay request. Normally, widgets will update their styles automatically, but you should connect to this to program special behavior.

- autoSelectDelay ( )

  returns int
  static

  Returns the KDE setting for the auto-select option.

  Returns the auto-select delay or -1 if auto-select is disabled.

- autostartPath ( )

  returns QString
  static

  The path to the autostart directory of the current user. Returns the path of the autostart directory

- blockShortcuts (data)

  returns Nothing
  SIGNAL ("blockShortcuts (int)")

  Argument | Type | Default
  --- | --- | ---
  data | int |

  Emitted by BlockShortcuts

- buttonLayout ( )

  returns int
  static

  The layout scheme to use for dialog buttons

  Returns Returns the number of the scheme to use.

- changeCursorOverIcon ( )

  returns bool
  static

  Checks whether the cursor changes over icons. Returns the KDE setting for "change cursor over icon"

- completionMode ( )

  returns KGlobalSettings.Completion
  static

  Returns the preferred completion mode setting.

  Returns Completion. Default is CompletionPopup.

- contextMenuKey ( )

  returns int
  static

  Returns the KDE setting for the shortcut key to open context menus.

  Returns the key that pops up context menus. Deprecated Simply reimplement QWidget.contextMenuEvent() instead.

- contrast ( )

  returns int
  static

  Returns the contrast for borders. Returns the contrast (between 0 for minimum and 10 for maximum contrast)

- contrastF (config)

  returns qreal
  static

  Argument | Type | Default
  --- | --- | ---
  config | KSharedConfigPtr | KSharedConfigPtr()

  Returns the contrast for borders as a floating point value.

  config - pointer to the config from which to read the contrast setting (the default is to use KGlobal.config()) Returns the contrast (between 0.0 for minimum and 1.0 for maximum contrast)

- createApplicationPalette (config)

  returns QPalette
  static

  Argument | Type | Default
  --- | --- | ---
  config | KSharedConfigPtr | KSharedConfigPtr()

  Used to obtain the QPalette that will be used to set the application palette.

  This is only useful for configuration modules such as krdb and should not be used in normal circumstances.

  config - KConfig from which to load the colors (passed as-is to .KColorScheme).

  Returns the QPalette

- cursorChanged ( )

  returns Nothing
  SIGNAL ("cursorChanged ()")

  Emitted when the cursor theme has been changed.

- desktopGeometry (point)

  returns QRect
  static

  Argument | Type | Default
  --- | --- | ---
  point | QPoint |

  This function returns the desktop geometry for an application that needs to set the geometry of a widget on the screen manually. It takes into account the user's display settings (number of screens, Xinerama, etc), and the user's preferences (if KDE should be Xinerama aware).

  Note that this can break in multi-head (not Xinerama) mode because this point could be on multiple screens. Use with care.

  point - a reference point for the widget, for instance one that the widget should be adjacent or on top of.

  Returns the geometry to use for the desktop. Note that it might not start at (0,0).

- desktopGeometry (w)

  returns QRect
  static

  Argument | Type | Default
  --- | --- | ---
  w | QWidget |

  This function returns the desktop geometry for an application that needs to set the geometry of a widget on the screen manually. It takes into account the user's display settings (number of screens, Xinerama, etc), and the user's preferences (if KDE should be Xinerama aware).

  w - the widget in question. This is used to determine which screen to use in Xinerama or multi-head mode.

  Returns the geometry to use for the desktop. Note that it might not start at (0,0).

- desktopPath ( )

  returns QString
  static

  The path to the desktop directory of the current user. Returns the user's desktop directory

- dndEventDelay ( )

  returns int
  static

  Returns a threshold in pixels for drag & drop operations. As long as the mouse movement has not exceeded this number of pixels in either X or Y direction no drag operation may be started. This prevents spurious drags when the user intended to click on something but moved the mouse a bit while doing so.

  For this to work you must save the position of the mouse (oldPos) in the QWidget.mousePressEvent(). When the position of the mouse (newPos) in a QWidget.mouseMoveEvent() exceeds this threshold you may start a drag which should originate from oldPos.

  Example code:

      void KColorCells.mousePressEvent( QMouseEvent *e )
      {
      mOldPos = e->pos();
      }

      void KColorCells.mouseMoveEvent( QMouseEvent *e )
      {
      if( !(e->state() && LeftButton)) return;

      int delay = KGlobalSettings.dndEventDelay();
      QPoint newPos = e->pos();
      if(newPos.x() > mOldPos.x()+delay || newPos.x() < mOldPos.x()-delay ||
      newPos.y() > mOldPos.y()+delay || newPos.y() < mOldPos.y()-delay)
      {
      // Drag color object
      int cell = posToCell(mOldPos); // Find color at mOldPos
      if ((cell != -1) && colors[cell].isValid())
      {
      KColorDrag *d = KColorDrag.makeDrag( colors[cell], this);
      d->dragCopy();
      }
      }
      }

  Returns the threshold for drag & drop in pixels

- documentPath ( )

  returns QString
  static

  The path where documents are stored of the current user. Returns the path of the document directory

- emitChange (changeType, arg)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  changeType | KGlobalSettings.ChangeType |
  arg | int | 0

  Notifies all KDE applications on the current display of a change.

  This is typically called by kcontrol modules after changing the corresponding config file. Do not call this from a normal KDE application.

- fixedFont ( )

  returns QFont
  static

  Returns the default fixed font. Returns the default fixed font.

- generalFont ( )

  returns QFont
  static

  Returns the default general font. Returns the default general font.

- graphicEffectsLevel ( )

  returns KGlobalSettings.GraphicEffects
  static
  KDE 4.1.0 and later only

  This function determines the desired level of effects on the GUI.

  @since 4.1

- graphicEffectsLevelDefault ( )

  returns KGlobalSettings.GraphicEffects
  static
  KDE 4.1.0 and later only

  This function determines the default level of effects on the GUI depending on the system capabilities.

  @since 4.1

- iconChanged (group)

  returns Nothing
  SIGNAL ("iconChanged (int)")

  Argument | Type | Default
  --- | --- | ---
  group | int |

  Emitted when the global icon settings have been changed.

  group - the new group

- inactiveTextColor ( )

  returns QColor
  static

  The default color to use for inactive texts. Returns the inactive text color

- inactiveTitleColor ( )

  returns QColor
  static

  The default color to use for inactive titles. Returns the inactive title color

- insertTearOffHandle ( )

  returns KGlobalSettings.TearOffHandle
  static

  Returns whether tear-off handles are inserted in KMenus. Returns whether tear-off handles are inserted in KMenus.

- isMultiHead ( )

  returns bool
  static

  Returns if the user specified multihead. In case the display has multiple screens, the return value of this function specifies if the user wants KDE to run on all of them or just on the primary On Windows, settings are retrieved from the system. Returns true if the user chose multi head

- kdisplayFontChanged ( )

  returns Nothing
  SIGNAL ("kdisplayFontChanged ()")

  Emitted when the application has changed its font in response to a KControl request.

  Normally widgets will update their fonts automatically, but you should connect to this to monitor global font changes, especially if you are using explicit fonts.

  Note: If you derive from a QWidget-based class, a faster method is to reimplement QWidget.changeEvent(). This is the preferred way to get informed about font updates.

- kdisplayPaletteChanged ( )

  returns Nothing
  SIGNAL ("kdisplayPaletteChanged ()")

  Emitted when the application has changed its palette due to a KControl request.

  Normally, widgets will update their palette automatically, but you should connect to this to program special behavior.

- kdisplayStyleChanged ( )

  returns Nothing
  SIGNAL ("kdisplayStyleChanged ()")

  Emitted when the application has changed its GUI style in response to a KControl request.

  Normally, widgets will update their styles automatically (as they would respond to an explicit setGUIStyle() call), but you should connect to this to program special behavior.

- largeFont (text)

  returns QFont
  static

  Argument | Type | Default
  --- | --- | ---
  text | QString | QString()

  Returns a font of approx. 48 pt. capable of showing text.

  text - the text to test Returns the font that is capable to show the text with 48 pt

- menuFont ( )

  returns QFont
  static

  Returns the default menu font. Returns the default menu font.

- mouseSettings ( )

  returns KGlobalSettings.KMouseSettings
  static

- opaqueResize ( )

  returns bool
  static

  Whether the user wishes to use opaque resizing. Primarily intended for QSplitter.setOpaqueResize()

  Returns Returns true if user wants to use opaque resizing.

- self ( )

  returns KGlobalSettings
  static

  Return the KGlobalSettings singleton. This is used to connect to its signals, to be notified of changes.

- settingsChanged (category)

  returns Nothing
  SIGNAL ("settingsChanged (int)")

  Argument | Type | Default
  --- | --- | ---
  category | int |

  Emitted when the global settings have been changed. KGlobalSettings takes care of calling reparseConfiguration on KGlobal.config() so that applications/classes using this only have to re-read the configuration

  category - the category among the SettingsCategory enum.

- shadeSortColumn ( )

  returns bool
  static

  Returns if the sorted column in a K3ListView shall be drawn with a shaded background color. Returns true if the sorted column shall be shaded

- showContextMenusOnPress ( )

  returns bool
  static

  Returns the KDE setting for context menus.

  Returns whether context menus should be shown on button press or button release (click).

- showFilePreview (a0)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  a0 | KUrl |

  This function determines if the user wishes to see previews for the selected url

  Returns Returns true if user wants to show previews.

- showIconsOnPushButtons ( )

  returns bool
  static

  This function determines if the user wishes to see icons on the push buttons.

  Returns Returns true if user wants to show icons.

- singleClick ( )

  returns bool
  static

  Returns whether KDE runs in single (default) or double click mode. see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html Returns true if single click mode, or false if double click mode.

- smallestReadableFont ( )

  returns QFont
  static

  Returns the smallest readable font. This can be used in dockers, rulers and other places where space is at a premium.

- splashScreenDesktopGeometry ( )

  returns QRect
  static

  This function returns the desktop geometry for an application's splash screen. It takes into account the user's display settings (number of screens, Xinerama, etc), and the user's preferences (if KDE should be Xinerama aware).

  Returns the geometry to use for the desktop. Note that it might not start at (0,0).

- taskbarFont ( )

  returns QFont
  static

  Returns the default taskbar font. Returns the default taskbar font.

- toolBarFont ( )

  returns QFont
  static

  Returns the default toolbar font. Returns the default toolbar font.

- toolbarAppearanceChanged (a0)

  returns Nothing
  SIGNAL ("toolbarAppearanceChanged (int)")

  Argument | Type | Default
  --- | --- | ---
  a0 | int |

  Emitted when the settings for toolbars have been changed. KToolBar will know what to do.

- wheelMouseZooms ( )

  returns bool
  static

  Typically, QScrollView derived classes can be scrolled fast by holding down the Ctrl-button during wheel-scrolling. But QTextEdit and derived classes perform zooming instead of fast scrolling.

  This value determines whether the user wants to zoom or scroll fast with Ctrl-wheelscroll. Returns true if the user wishes to zoom with the mouse wheel, false for scrolling

- windowTitleFont ( )

  returns QFont
  static

  Returns the default window title font. Returns the default window title font.

### enums - detail

- ChangeType { PaletteChanged, FontChanged, StyleChanged, SettingsChanged, IconChanged, CursorChanged, ToolbarStyleChanged, ClipboardConfigChanged, BlockShortcuts }

  An identifier for change signals.

  See also emitChange

  | PaletteChanged | - 0 | - |
  | FontChanged | - | - |
  | StyleChanged | - | - |
  | SettingsChanged | - | - |
  | IconChanged | - | - |
  | CursorChanged | - | - |
  | ToolbarStyleChanged | - | - |
  | ClipboardConfigChanged | - | - |
  | BlockShortcuts | - | - |

- Completion { CompletionNone, CompletionAuto, CompletionMan, CompletionShell, CompletionPopup, CompletionPopupAuto }

  No completion is used.

  | CompletionNone | - 1 | - |
  | CompletionAuto | - | - |
  | CompletionMan | - | - |
  | CompletionShell | - | - |
  | CompletionPopup | - | - |
  | CompletionPopupAuto | - | - |

- GraphicEffect { NoEffects, GradientEffects, SimpleAnimationEffects, ComplexAnimationEffects }

  typesafe object: GraphicEffects

NoEffects - 0x0000 -
GradientEffects - 0x0001 -
SimpleAnimationEffects - 0x0002 -
ComplexAnimationEffects - 0x0006 -

- SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS, SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS }

  Valid values for the settingsChanged signal

  | SETTINGS_MOUSE | - | - |
  | SETTINGS_COMPLETION | - | - |
  | SETTINGS_PATHS | - | - |
  | SETTINGS_POPUPMENU | - | - |
  | SETTINGS_QT | - | - |
  | SETTINGS_SHORTCUTS | - | - |

- TearOffHandle { Disable, ApplicationLevel, Enable }

  This enum describes the return type for insertTearOffHandle() whether to insert a handle or not. Applications who independently want to use handles in their popup menus should test for Application level before calling the appropriate function in KMenu.

  | Disable | - 0 | - |
  | ApplicationLevel | - | - |
  | Enable | - | - |