Module qtjambi
Package io.qt

Class QFlags<T extends QtFlagEnumerator>

java.lang.Object
io.qt.QFlags<T>
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
EnumAttributes, MetaDataAttributes, MetaObjectAttributes, MethodAttributes, PropertyAttributes, QAbstractFileEngine.FileFlags, QAbstractItemModel.CheckIndexOptions, QAbstractItemView.EditTriggers, QAbstractPrintDialog.PrintDialogOptions, QAbstractSocket.BindMode, QAbstractSocket.PauseModes, QAbstractSpinBox.StepEnabled, QAccessible.Relation, QAnimationCallback.Flags, QBluetooth.AttAccessConstraints, QBluetooth.SecurityFlags, QBluetoothDeviceDiscoveryAgent.DiscoveryMethods, QBluetoothDeviceInfo.CoreConfigurations, QBluetoothDeviceInfo.Fields, QBluetoothDeviceInfo.ServiceClasses, QByteArray.Base64Options, QCamera.CaptureModes, QCamera.LockTypes, QCameraExposure.FlashModes, QCameraFocus.FocusModes, QCameraImageCapture.CaptureDestinations, QCanBusDevice.Directions, QCanBusDevice.Filter.FormatFilters, QCanBusFrame.FrameErrors, QCborValue.DiagnosticNotationOptions, QCborValue.EncodingOptions, QColorDialog.ColorDialogOptions, QCommandLineOption.Flags, QDateTimeEdit.Sections, QDBusConnection.ConnectionCapabilities, QDBusConnection.RegisterOptions, QDBusServiceWatcher.WatchMode, QDialogButtonBox.StandardButtons, QDir.Filters, QDir.SortFlags, QDirIterator.IteratorFlags, QDockWidget.DockWidgetFeatures, QEventLoop.ProcessEventsFlags, QFileDevice.FileHandleFlags, QFileDevice.Permissions, QFileDialog.Options, QFileIconProvider.Options, QFileSystemModel.Options, QFontComboBox.FontFilters, QFontDialog.FontDialogOptions, QGeoAreaMonitorSource.AreaMonitorFeatures, QGeoPositionInfoSource.PositioningMethods, QGeoRouteRequest.FeatureTypes, QGeoRouteRequest.FeatureWeights, QGeoRouteRequest.ManeuverDetails, QGeoRouteRequest.RouteOptimizations, QGeoRouteRequest.SegmentDetails, QGeoRouteRequest.TravelModes, QGeoServiceProvider.GeocodingFeatures, QGeoServiceProvider.MappingFeatures, QGeoServiceProvider.NavigationFeatures, QGeoServiceProvider.PlacesFeatures, QGeoServiceProvider.RoutingFeatures, QGestureRecognizer.Result, QGlyphRun.GlyphRunFlags, QGraphicsBlurEffect.BlurHints, QGraphicsEffect.ChangeFlags, QGraphicsItem.GraphicsItemFlags, QGraphicsScene.SceneLayers, QGraphicsView.CacheMode, QGraphicsView.OptimizationFlags, QHostAddress.ConversionMode, QHstsPolicy.PolicyFlags, QImageIOHandler.Transformations, QImageIOPlugin.Capabilities, QInputDialog.InputDialogOptions, QIODevice.OpenMode, QItemSelectionModel.SelectionFlags, QJSEngine.Extensions, QLibrary.LoadHints, QLocale.DataSizeFormats, QLocale.NumberOptions, QLocalServer.SocketOptions, QLocation.VisibilityScope, QLowEnergyCharacteristic.PropertyTypes, QLowEnergyService.ServiceTypes, QMainWindow.DockOptions, QMdiArea.AreaOptions, QMdiSubWindow.SubWindowOptions, QMediaPlayer.Flags, QMediaServiceProviderHint.Features, QMemoryBarrier.Operations, QMessageBox.StandardButtons, QMetaType.GenericFlags, QNetworkConfiguration.StateFlags, QNetworkConfigurationManager.Capabilities, QNetworkInterface.InterfaceFlags, QNetworkProxy.Capabilities, QNetworkSession.UsagePolicies, QOpenGLBuffer.RangeAccessFlags, QOpenGLDebugMessage.Severities, QOpenGLDebugMessage.Sources, QOpenGLDebugMessage.Types, QOpenGLFunctions.OpenGLFeatures, QOpenGLShader.ShaderType, QOpenGLTexture.Features, QPaintEngine.DirtyFlags, QPaintEngine.PaintEngineFeatures, QPainter.PixmapFragmentHints, QPainter.RenderHints, QPinchGesture.ChangeFlags, QQmlImageProviderBase.Flags, QQuickItem.Flags, QQuickPaintedItem.PerformanceHints, QQuickWindow.CreateTextureOptions, QRawFont.LayoutFlags, QRegularExpression.MatchOptions, QRegularExpression.PatternOptions, QSceneChange.DeliveryFlags, QScriptClass.QueryFlags, QScriptEngine.QObjectWrapOptions, QScriptValue.PropertyFlags, QScriptValue.ResolveFlags, QSerialPort.Directions, QSerialPort.PinoutSignals, QSGAbstractRenderer.ClearMode, QSGAbstractRenderer.MatrixTransformFlags, QSGEngine.CreateTextureOptions, QSGImageNode.TextureCoordinatesTransformMode, QSGMaterial.Flags, QSGMaterialRhiShader.Flags, QSGMaterialRhiShader.GraphicsPipelineState.ColorMask, QSGMaterialShader.RenderState.DirtyStates, QSGNode.DirtyState, QSGNode.Flags, QSGRendererInterface.ShaderCompilationTypes, QSGRendererInterface.ShaderSourceTypes, QSGRenderNode.RenderingFlags, QSGRenderNode.StateFlags, QSGSimpleTextureNode.TextureCoordinatesTransformMode, QSizePolicy.ControlTypes, QSql.ParamType, QStandardPaths.LocateOptions, QString.SectionFlags, QStyle.State, QStyleOptionButton.ButtonFeatures, QStyleOptionFrame.FrameFeatures, QStyleOptionTab.CornerWidgets, QStyleOptionTab.TabFeatures, QStyleOptionToolBar.ToolBarFeatures, QStyleOptionToolButton.ToolButtonFeatures, QStyleOptionViewItem.ViewItemFeatures, QSurfaceFormat.FormatOptions, Qt.Alignment, Qt.ApplicationStates, Qt.DockWidgetAreas, Qt.DropActions, Qt.Edges, Qt.FindChildOptions, Qt.GestureFlags, Qt.ImageConversionFlags, Qt.InputMethodHints, Qt.InputMethodQueries, Qt.ItemFlags, Qt.KeyboardModifiers, Qt.MatchFlags, Qt.MouseButtons, Qt.MouseEventFlags, Qt.Orientations, Qt.ScreenOrientations, Qt.SplitBehavior, Qt.TextInteractionFlags, Qt.ToolBarAreas, Qt.TouchPointStates, Qt.WindowFlags, Qt.WindowStates, Qt3DCore.ChangeFlags, QtConcurrent.ReduceOptions, QTextBoundaryFinder.BoundaryReasons, QTextCodec.ConversionFlags, QTextDocument.FindFlags, QTextDocument.MarkdownFeatures, QTextEdit.AutoFormatting, QTextFormat.PageBreakFlags, QTextItem.RenderFlags, QTextOption.Flags, QTextStream.NumberFlags, QTouchDevice.Capabilities, QTouchEvent.TouchPoint.InfoFlags, QTreeWidgetItemIterator.IteratorFlags, QUrl.ComponentFormattingOptions, QUrl.FormattingOptions, QUrl.UserInputResolutionOptions, QVideoFilterRunnable.RunFlags, QWebEngineContextMenuData.EditFlags, QWebEngineContextMenuData.MediaFlags, QWebEnginePage.FindFlags, QWebEngineUrlScheme.Flags, QWidget.RenderFlags, QWindowsWindowFunctions.TouchWindowTouchTypes, QWizard.WizardOptions, QX11Info.PeekOptions

public abstract class QFlags<T extends QtFlagEnumerator>
extends Object
implements Serializable, Cloneable
This class manages a set of QtFlagEnumerator values. Each enum value is treated as a flag that is either set or unset. You can set and clear flags, and query which flags are set.
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected QFlags​(int value)
    Creates a new QFlags with given value.
    protected QFlags​(T... args)
    Creates a new QFlags where the flags in args are set.
  • Method Summary

    Modifier and Type Method Description
    void clear​(QFlags<T> other)
    Clears the flag other.
    void clear​(T... ts)
    Clears all flags in ts.
    void clearAll()
    Clears all flags.
    QFlags<T> clone()
    Clones the flags
    QFlags<T> combined​(T flag)
    Combines this flags with enum entry.
    boolean equals​(Object object)
    T[] flags()
    Returns an array of flag objects represented by this QFlags.
    protected T[] flags​(T[] possibleValues)
    Returns an unmodifiable set of flag objects represented by this QFlags.
    int hashCode()
    boolean isSet​(QFlags<T> other)
    Tests if other flags are set.
    boolean isSet​(T... ts)
    Tests if other flags are set.
    void set​(QFlags<T> flag)
    Sets the flag flag
    void set​(T... ts)
    Sets the flags in ts.
    QFlags<T> setFlag​(T flag)
    Sets the flag flag
    QFlags<T> setFlag​(T flag, boolean on)
    Sets or clears the flag flag
    void setValue​(int value)
    Sets the value of this QFlags.
    boolean testFlag​(T flag)
    Tests if other flag is set.
    String toString()
    int value()
    Returns the value of this QFlags.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • QFlags

      @SafeVarargs protected QFlags​(T... args)
      Creates a new QFlags where the flags in args are set.
      Parameters:
      args - enum entries
    • QFlags

      protected QFlags​(int value)
      Creates a new QFlags with given value.
      Parameters:
      value -
  • Method Details

    • clone

      public QFlags<T> clone()
      Clones the flags
      Overrides:
      clone in class Object
    • combined

      public QFlags<T> combined​(T flag)
      Combines this flags with enum entry.
      Parameters:
      flag - enum entry
      Returns:
      new flag
    • set

      public final void set​(QFlags<T> flag)
      Sets the flag flag
      Parameters:
      other - other entry
    • setFlag

      public QFlags<T> setFlag​(T flag)
      Sets the flag flag
      Parameters:
      flag - other entry
      Returns:
      this
    • setFlag

      public QFlags<T> setFlag​(T flag, boolean on)
      Sets or clears the flag flag
      Parameters:
      flag - other entry
      on - set (true) or clear (false)
      Returns:
      this
    • set

      @SafeVarargs public final void set​(T... ts)
      Sets the flags in ts.
    • isSet

      public final boolean isSet​(QFlags<T> other)
      Tests if other flags are set.
      Parameters:
      other - other flags
      Returns:
      true if flag other is set
    • isSet

      @SafeVarargs public final boolean isSet​(T... ts)
      Tests if other flags are set.
      Parameters:
      other - other flags
      Returns:
      true if flag other is set
    • testFlag

      public final boolean testFlag​(T flag)
      Tests if other flag is set.
      Parameters:
      other - other flag
      Returns:
      true if flag other is set
    • clear

      public final void clear​(QFlags<T> other)
      Clears the flag other.
    • clear

      @SafeVarargs public final void clear​(T... ts)
      Clears all flags in ts.
    • clearAll

      public final void clearAll()
      Clears all flags.
    • setValue

      public final void setValue​(int value)
      Sets the value of this QFlags.
      Parameters:
      value - new value
    • value

      public final int value()
      Returns the value of this QFlags.
      Returns:
      value
    • flags

      public T[] flags()
      Returns an array of flag objects represented by this QFlags.
      Returns:
      array of enum entries
    • flags

      protected final T[] flags​(T[] possibleValues)
      Returns an unmodifiable set of flag objects represented by this QFlags.
      Returns:
      array of enum entries
    • equals

      public final boolean equals​(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object