com.sibvisions.rad.ui.qt.ext
Class QVxChoice

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.core.QObject
                  extended by com.trolltech.qt.gui.QWidget
                      extended by com.trolltech.qt.gui.QLineEdit
                          extended by com.sibvisions.rad.ui.qt.ext.QVxLineEdit
                              extended by com.sibvisions.rad.ui.qt.ext.QVxChoice
All Implemented Interfaces:
ISizableWidget, QPaintDeviceInterface, QtJambiInterface

public class QVxChoice
extends QVxLineEdit

A Choice editor can display and switch several values as Image. This is more flexible than QRadioButton or QCheckBox, because it can be configured which items should be returned and which images should be displayed instead.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QLineEdit
QLineEdit.EchoMode, QLineEdit.TextMargins
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget
QWidget.RenderFlag, QWidget.RenderFlags
 
Nested classes/interfaces inherited from class com.trolltech.qt.QtJambiObject
QtJambiObject.QPrivateConstructor
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1<A>, QSignalEmitter.PrivateSignal2<A,B>, QSignalEmitter.PrivateSignal3<A,B,C>, QSignalEmitter.PrivateSignal4<A,B,C,D>, QSignalEmitter.PrivateSignal5<A,B,C,D,E>, QSignalEmitter.PrivateSignal6<A,B,C,D,E,F>, QSignalEmitter.PrivateSignal7<A,B,C,D,E,F,G>, QSignalEmitter.PrivateSignal8<A,B,C,D,E,F,G,H>, QSignalEmitter.PrivateSignal9<A,B,C,D,E,F,G,H,I>, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 QSignalEmitter.Signal0 changed
          the signal for the information that the item was changed.
 QSignalEmitter.Signal1<Object> itemDeselect
          the signal for deselecting an item (takes <Object> as parameter, for the deselected value).
 QSignalEmitter.Signal1<Object> itemSelect
          the signal for selecting a new item (takes <Object> as parameter, for the selected value).
 
Fields inherited from class com.trolltech.qt.gui.QLineEdit
cursorPositionChanged, editingFinished, returnPressed, selectionChanged, textChanged, textEdited
 
Fields inherited from class com.trolltech.qt.gui.QWidget
customContextMenuRequested
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QVxChoice()
          Constructs a new QVxChoice component.
QVxChoice(Object[] pAllowedValues, QPixmap[] pImages)
          Constructs a new QVxChoice with the given allowed values and image names.
QVxChoice(Object[] pAllowedValues, QPixmap[] pImages, QWidget pParent)
          Constructs a new QVxChoice with the given allowed values, image names and a specific parent widget.
QVxChoice(QWidget pParent)
          Constructs a new QVxChoice component with a specifig parent widget.
 
Method Summary
 Object[] getAllowedValues()
          Gets all allowed values.
 QColor getBackground()
          Gets the current background color.
 QPixmap getDefaultImage()
          Gets the default image that is shown if selectedIndex is -1.
 Qt.AlignmentFlag getHorizontalAlignment()
          Gets the horizontal alignment of the icon.
 QPixmap[] getImages()
          Gets the images that are used for displaying the values.
 QSize getImageSize()
          Returns the image size.
 QColor getInnerBackground()
          Gets the inner background.
 QRect getInnerBounds()
          Gets the inner bounds of the editor for the outer editor bounds.
protected  QRect getInnerBounds(QRect pRect)
          Returns the inner bounds of the choice component.
 int getSelectedIndex()
          Gets the selected index, or -1 if no value is selected.
 Object getSelectedItem()
          Gets the current selected value, or null, if no one is selected.
 Qt.AlignmentFlag getVerticalAlignment()
          Gets the vertical alignment of the icon.
 boolean isImageBorderVisible()
          Gets the inner border.
 void keyReleaseEvent(QKeyEvent pEvent)
          
 QSize minimumSizeHint()
          
 void mouseDoubleClickEvent(QMouseEvent pEvent)
          
 void mouseMoveEvent(QMouseEvent pEvent)
          
 void mousePressEvent(QMouseEvent pEvent)
          
protected  void paint(QPainter pPainter, QRect pRect)
          Paints the choice with a specific painter and bounds.
protected  void paintEvent(QPaintEvent pEvent)
          
 void selectNextIndex()
          Selects the next index.
 void setAllowedValues(Object[] pAllowedValues)
          Sets all allowed values.
 void setBackground(QColor pBackground)
          Sets the background color of the editor.
 void setDefaultImage(QPixmap pDefaultImage)
          Sets the default image that is shown if selectedIndex is -1.
 void setHorizontalAlignment(Qt.AlignmentFlag pHorizontalAlignment)
          Sets the horizontal alignment of the icon.
 void setImageBorderVisible(boolean pImageBorderVisible)
          sets the inner border.
 void setImages(QPixmap[] pImages)
          Sets the images that are used for displaying the values.
 void setImageSize(QSize pImageSize)
          Returns the image size.
 void setInnerBackground(QColor pInnerBackground)
          sets the inner background.
 void setSelectedIndex(int pSelectedIndex)
          Sets the selected index.
 void setSelectedItem(Object pSelectedItem)
          Sets the value that should be selected.
 void setVerticalAlignment(Qt.AlignmentFlag pVerticalAlignment)
          Sets the vertical alignment of the icon.
 QSize sizeHint()
          
 
Methods inherited from class com.sibvisions.rad.ui.qt.ext.QVxLineEdit
getColumns, getColumnWidth, isMaximumSizeHintSet, isMinimumSizeHintSet, isSizeHintSet, maximumSizeHint, setColumns, setMaximumSizeHint, setMinimumSizeHint, setSizeHint
 
Methods inherited from class com.trolltech.qt.gui.QLineEdit
__qt_signalInitialization, alignment, backspace, changeEvent, clear, completer, contextMenuEvent, copy, createStandardContextMenu, cursorBackward, cursorBackward, cursorForward, cursorForward, cursorPosition, cursorPositionAt, cursorRect, cursorWordBackward, cursorWordForward, cut, del, deselect, displayText, dragEnabled, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, echoMode, end, event, focusInEvent, focusOutEvent, fromNativePointer, getTextMargins, hasAcceptableInput, hasFrame, hasSelectedText, home, initStyleOption, inputMask, inputMethodEvent, inputMethodQuery, insert, isModified, isReadOnly, isRedoAvailable, isUndoAvailable, keyPressEvent, maxLength, mouseReleaseEvent, paste, redo, selectAll, selectedText, selectionStart, setAlignment, setAlignment, setCompleter, setCursorPosition, setDragEnabled, setEchoMode, setFrame, setInputMask, setMaxLength, setModified, setReadOnly, setSelection, setText, setTextMargins, setValidator, text, undo, validator
 
Methods inherited from class com.trolltech.qt.gui.QWidget
__qt_cast_to_QPaintDevice, acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuPolicy, createWinId, cursor, depth, destroy, destroy, destroy, devType, effectiveWinId, ensurePolished, enterEvent, focusNextChild, focusNextPrevChild, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, graphicsProxyWidget, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, hideEvent, inputContext, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, languageChange, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumWidth, mouseGrabber, move, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, overrideWindowState, paintEngine, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, widthMM, window, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y
 
Methods inherited from class com.trolltech.qt.core.QObject
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, toString, userProperty
 
Methods inherited from class com.trolltech.qt.QtJambiObject
disableGarbageCollection, dispose, disposed, equals, finalize, nativeId, nativePointer, reassignNativeResources, reenableGarbageCollection, setJavaOwnership, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
disconnect, disconnect, signalSender
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Field Detail

itemSelect

public final QSignalEmitter.Signal1<Object> itemSelect
the signal for selecting a new item (takes <Object> as parameter, for the selected value).


itemDeselect

public final QSignalEmitter.Signal1<Object> itemDeselect
the signal for deselecting an item (takes <Object> as parameter, for the deselected value).


changed

public final QSignalEmitter.Signal0 changed
the signal for the information that the item was changed.

Constructor Detail

QVxChoice

public QVxChoice()
Constructs a new QVxChoice component.


QVxChoice

public QVxChoice(QWidget pParent)
Constructs a new QVxChoice component with a specifig parent widget.

Parameters:
pParent - the parent widget

QVxChoice

public QVxChoice(Object[] pAllowedValues,
                 QPixmap[] pImages)
Constructs a new QVxChoice with the given allowed values and image names.

Parameters:
pAllowedValues - the allowed values.
pImages - the images.

QVxChoice

public QVxChoice(Object[] pAllowedValues,
                 QPixmap[] pImages,
                 QWidget pParent)
Constructs a new QVxChoice with the given allowed values, image names and a specific parent widget.

Parameters:
pAllowedValues - the allowed values.
pImages - the images.
pParent - the parent widget
Method Detail

paintEvent

protected void paintEvent(QPaintEvent pEvent)

Overrides:
paintEvent in class QLineEdit

sizeHint

public QSize sizeHint()

Overrides:
sizeHint in class QVxLineEdit

minimumSizeHint

public QSize minimumSizeHint()

Overrides:
minimumSizeHint in class QVxLineEdit

mousePressEvent

public void mousePressEvent(QMouseEvent pEvent)

Overrides:
mousePressEvent in class QLineEdit

mouseDoubleClickEvent

public void mouseDoubleClickEvent(QMouseEvent pEvent)

Overrides:
mouseDoubleClickEvent in class QLineEdit

keyReleaseEvent

public void keyReleaseEvent(QKeyEvent pEvent)

Overrides:
keyReleaseEvent in class QWidget

mouseMoveEvent

public void mouseMoveEvent(QMouseEvent pEvent)

Overrides:
mouseMoveEvent in class QLineEdit

paint

protected void paint(QPainter pPainter,
                     QRect pRect)
Paints the choice with a specific painter and bounds.

Parameters:
pPainter - the painter
pRect - the bounds

getInnerBackground

public QColor getInnerBackground()
Gets the inner background.

Returns:
the inner background.

setInnerBackground

public void setInnerBackground(QColor pInnerBackground)
sets the inner background.

Parameters:
pInnerBackground - the inner background.

isImageBorderVisible

public boolean isImageBorderVisible()
Gets the inner border.

Returns:
the inner border.

setImageBorderVisible

public void setImageBorderVisible(boolean pImageBorderVisible)
sets the inner border.

Parameters:
pImageBorderVisible - the inner border.

getAllowedValues

public Object[] getAllowedValues()
Gets all allowed values.

Returns:
all allowed values.

setAllowedValues

public void setAllowedValues(Object[] pAllowedValues)
Sets all allowed values.

Parameters:
pAllowedValues - all allowed values.

getImages

public QPixmap[] getImages()
Gets the images that are used for displaying the values.

Returns:
the images.

setImages

public void setImages(QPixmap[] pImages)
Sets the images that are used for displaying the values.

Parameters:
pImages - the images.

getImageSize

public QSize getImageSize()
Returns the image size. The original size of the image.

Returns:
the size the images should have.

setImageSize

public void setImageSize(QSize pImageSize)
Returns the image size. The original size of the image.

Parameters:
pImageSize - the size the images should have.

getInnerBounds

public QRect getInnerBounds()
Gets the inner bounds of the editor for the outer editor bounds.

Returns:
the inner bounds

getInnerBounds

protected QRect getInnerBounds(QRect pRect)
Returns the inner bounds of the choice component. Mouse events will only effect inside the inner bounds.

Parameters:
pRect - the bounds of the choice editor
Returns:
the inner bounds.

getDefaultImage

public QPixmap getDefaultImage()
Gets the default image that is shown if selectedIndex is -1.

Returns:
the default image.

setDefaultImage

public void setDefaultImage(QPixmap pDefaultImage)
Sets the default image that is shown if selectedIndex is -1.

Parameters:
pDefaultImage - the default image.

getVerticalAlignment

public Qt.AlignmentFlag getVerticalAlignment()
Gets the vertical alignment of the icon.

Returns:
the alignment

setVerticalAlignment

public void setVerticalAlignment(Qt.AlignmentFlag pVerticalAlignment)
Sets the vertical alignment of the icon.

Parameters:
pVerticalAlignment - the alignment

getHorizontalAlignment

public Qt.AlignmentFlag getHorizontalAlignment()
Gets the horizontal alignment of the icon.

Returns:
the alignment

setHorizontalAlignment

public void setHorizontalAlignment(Qt.AlignmentFlag pHorizontalAlignment)
Sets the horizontal alignment of the icon.

Parameters:
pHorizontalAlignment - the alignment

getSelectedIndex

public int getSelectedIndex()
Gets the selected index, or -1 if no value is selected.

Returns:
the selected index.

setSelectedIndex

public void setSelectedIndex(int pSelectedIndex)
Sets the selected index. If the index does not exist, it is set to -1 (deselected).

Parameters:
pSelectedIndex - the index to select.

selectNextIndex

public void selectNextIndex()
Selects the next index. This functionality is round robin.


getSelectedItem

public Object getSelectedItem()
Gets the current selected value, or null, if no one is selected. Be careful, null can also be a allowed value.

Returns:
the selected value.

setSelectedItem

public void setSelectedItem(Object pSelectedItem)
Sets the value that should be selected. If the value i not included in the allowed values list, the selected index is set to -1. Be careful, null can also be a allowed value.

Parameters:
pSelectedItem - the value to select.

setBackground

public void setBackground(QColor pBackground)
Sets the background color of the editor.

Parameters:
pBackground - the color

getBackground

public QColor getBackground()
Gets the current background color.

Returns:
the color


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.