All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qt.widgets.QColorDialog Maven / Gradle / Ivy

There is a newer version: 6.8.2
Show newest version
package io.qt.widgets;


/**
 * 

Dialog widget for specifying colors

*

Java wrapper for Qt class QColorDialog

*/ public class QColorDialog extends io.qt.widgets.QDialog { /** * This variable stores the meta-object for the class. */ public static final io.qt.core.QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QColorDialog.class); /** *

Java wrapper for Qt enum QColorDialog::ColorDialogOption

* * @see ColorDialogOptions */ public enum ColorDialogOption implements io.qt.QtFlagEnumerator { ShowAlphaChannel(1), NoButtons(2), DontUseNativeDialog(4); private ColorDialogOption(int value) { this.value = value; } /** * {@inheritDoc} */ public int value() { return value; } /** * Create a QFlags of the enum entry. * @return QFlags */ public ColorDialogOptions asFlags() { return new ColorDialogOptions(value); } /** * Combines this entry with other enum entry. * @param e enum entry * @return new flag */ public ColorDialogOptions combined(ColorDialogOption e) { return new ColorDialogOptions(this, e); } /** * Creates a new {@link ColorDialogOptions} from the entries. * @param values entries * @return new flag */ public static ColorDialogOptions flags(ColorDialogOption ... values) { return new ColorDialogOptions(values); } /** * Returns the corresponding enum entry for the given value. * @param value * @return enum entry */ public static ColorDialogOption resolve(int value) { switch (value) { case 1: return ShowAlphaChannel; case 2: return NoButtons; case 4: return DontUseNativeDialog; default: throw new io.qt.QNoSuchEnumValueException(value); } } private final int value; } /** * QFlags type for enum {@link ColorDialogOption} */ public static final class ColorDialogOptions extends io.qt.QFlags implements Comparable { private static final long serialVersionUID = 0xacbf6e133d89b4c2L; /** * Creates a new ColorDialogOptions where the flags in args are set. * @param args enum entries */ public ColorDialogOptions(ColorDialogOption ... args){ super(args); } /** * Creates a new ColorDialogOptions with given value. * @param value */ public ColorDialogOptions(int value) { super(value); } /** * Combines this flags with enum entry. * @param e enum entry * @return new ColorDialogOptions */ @Override public final ColorDialogOptions combined(ColorDialogOption e){ return new ColorDialogOptions(value() | e.value()); } /** * Sets the flag e * @param e enum entry * @return this */ public final ColorDialogOptions setFlag(ColorDialogOption e){ super.setFlag(e); return this; } /** * Sets or clears the flag flag * @param e enum entry * @param on set (true) or clear (false) * @return this */ public final ColorDialogOptions setFlag(ColorDialogOption e, boolean on){ super.setFlag(e, on); return this; } /** * Returns an array of flag objects represented by this ColorDialogOptions. * @return array of enum entries */ @Override public final ColorDialogOption[] flags(){ return super.flags(ColorDialogOption.values()); } /** * {@inheritDoc} */ @Override public final ColorDialogOptions clone(){ return new ColorDialogOptions(value()); } /** * {@inheritDoc} */ @Override public final int compareTo(ColorDialogOptions other){ return Integer.compare(value(), other.value()); } } /** *

See QColorDialog::colorSelected(QColor)

*/ public final Signal1 colorSelected = new Signal1<>(); /** *

See QColorDialog::currentColorChanged(QColor)

*/ @io.qt.QtPropertyNotify(name="currentColor") public final Signal1 currentColorChanged = new Signal1<>(); /** *

Overloaded constructor for {@link #QColorDialog(io.qt.widgets.QWidget)} * with parent = null.

*/ public QColorDialog() { this((io.qt.widgets.QWidget)null); } /** *

See QColorDialog::QColorDialog(QWidget*)

*/ public QColorDialog(io.qt.widgets.QWidget parent){ super((QPrivateConstructor)null); initialize_native(this, parent); } private native static void initialize_native(QColorDialog instance, io.qt.widgets.QWidget parent); /** *

Overloaded constructor for {@link #QColorDialog(io.qt.gui.QColor, io.qt.widgets.QWidget)} * with parent = null.

*/ public QColorDialog(io.qt.gui.QColor initial) { this(initial, (io.qt.widgets.QWidget)null); } /** *

See QColorDialog::QColorDialog(QColor,QWidget*)

*/ public QColorDialog(io.qt.gui.QColor initial, io.qt.widgets.QWidget parent){ super((QPrivateConstructor)null); initialize_native(this, initial, parent); } private native static void initialize_native(QColorDialog instance, io.qt.gui.QColor initial, io.qt.widgets.QWidget parent); /** *

See QColorDialog::currentColor()const

*/ @io.qt.QtPropertyReader(name="currentColor") @io.qt.QtUninvokable public final io.qt.gui.QColor currentColor(){ return currentColor_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @io.qt.QtUninvokable private native io.qt.gui.QColor currentColor_native_constfct(long __this__nativeId); /** *

See QColorDialog::open(QObject*,const char*)

*/ @io.qt.QtUninvokable public final void open(io.qt.core.QObject receiver, java.lang.String member){ if(!member.startsWith("1") || !member.startsWith("2")) member = '1'+member; open_native_QObject_ptr_const_char_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(receiver), member); } @io.qt.QtUninvokable private native void open_native_QObject_ptr_const_char_ptr(long __this__nativeId, long receiver, java.lang.String member); /** *

See QColorDialog::options()const

*/ @io.qt.QtPropertyReader(name="options") @io.qt.QtUninvokable public final io.qt.widgets.QColorDialog.ColorDialogOptions options(){ return new io.qt.widgets.QColorDialog.ColorDialogOptions(options_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this))); } @io.qt.QtUninvokable private native int options_native_constfct(long __this__nativeId); /** *

See QColorDialog::selectedColor()const

*/ @io.qt.QtUninvokable public final io.qt.gui.QColor selectedColor(){ return selectedColor_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @io.qt.QtUninvokable private native io.qt.gui.QColor selectedColor_native_constfct(long __this__nativeId); /** *

See QColorDialog::setCurrentColor(QColor)

*/ @io.qt.QtPropertyWriter(name="currentColor") @io.qt.QtUninvokable public final void setCurrentColor(io.qt.gui.QColor color){ setCurrentColor_native_cref_QColor(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(color)); } @io.qt.QtUninvokable private native void setCurrentColor_native_cref_QColor(long __this__nativeId, long color); /** *

Overloaded function for {@link #setOption(io.qt.widgets.QColorDialog.ColorDialogOption, boolean)} * with on = true.

*/ @io.qt.QtUninvokable public final void setOption(io.qt.widgets.QColorDialog.ColorDialogOption option) { setOption(option, (boolean)true); } /** *

See QColorDialog::setOption(QColorDialog::ColorDialogOption,bool)

*/ @io.qt.QtUninvokable public final void setOption(io.qt.widgets.QColorDialog.ColorDialogOption option, boolean on){ setOption_native_QColorDialog_ColorDialogOption_bool(QtJambi_LibraryUtilities.internal.nativeId(this), option.value(), on); } @io.qt.QtUninvokable private native void setOption_native_QColorDialog_ColorDialogOption_bool(long __this__nativeId, int option, boolean on); /** *

Overloaded function for {@link #setOptions(io.qt.widgets.QColorDialog.ColorDialogOptions)}.

*/ @io.qt.QtUninvokable public final void setOptions(io.qt.widgets.QColorDialog.ColorDialogOption ... options){ setOptions(new io.qt.widgets.QColorDialog.ColorDialogOptions(options)); } /** *

See QColorDialog::setOptions(ColorDialogOptions)

*/ @io.qt.QtPropertyWriter(name="options") @io.qt.QtUninvokable public final void setOptions(io.qt.widgets.QColorDialog.ColorDialogOptions options){ setOptions_native_QFlags_QColorDialog_ColorDialogOption_(QtJambi_LibraryUtilities.internal.nativeId(this), options.value()); } @io.qt.QtUninvokable private native void setOptions_native_QFlags_QColorDialog_ColorDialogOption_(long __this__nativeId, int options); /** *

See QColorDialog::testOption(QColorDialog::ColorDialogOption)const

*/ @io.qt.QtUninvokable public final boolean testOption(io.qt.widgets.QColorDialog.ColorDialogOption option){ return testOption_native_QColorDialog_ColorDialogOption_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), option.value()); } @io.qt.QtUninvokable private native boolean testOption_native_QColorDialog_ColorDialogOption_constfct(long __this__nativeId, int option); /** *

See QWidget::changeEvent(QEvent*)

*/ @io.qt.QtUninvokable protected void changeEvent(io.qt.core.QEvent event){ changeEvent_native_QEvent_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(event)); } @io.qt.QtUninvokable private native void changeEvent_native_QEvent_ptr(long __this__nativeId, long event); /** *

See QDialog::done(int)

*/ @io.qt.QtUninvokable public void done(int result){ done_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), result); } @io.qt.QtUninvokable private native void done_native_int(long __this__nativeId, int result); /** *

See QWidget::setVisible(bool)

*/ @io.qt.QtUninvokable public void setVisible(boolean visible){ setVisible_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), visible); } @io.qt.QtUninvokable private native void setVisible_native_bool(long __this__nativeId, boolean visible); /** *

See QColorDialog::customColor(int)

*/ public native static io.qt.gui.QColor customColor(int index); /** *

See QColorDialog::customCount()

*/ public native static int customCount(); /** *

Overloaded function for {@link #getColor(io.qt.gui.QColor, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QColorDialog.ColorDialogOptions)}.

*/ public static io.qt.gui.QColor getColor(io.qt.gui.QColor initial, io.qt.widgets.QWidget parent, java.lang.String title, io.qt.widgets.QColorDialog.ColorDialogOption ... options){ return getColor(initial, parent, title, new io.qt.widgets.QColorDialog.ColorDialogOptions(options)); } /** *

Overloaded function for {@link #getColor(io.qt.gui.QColor, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QColorDialog.ColorDialogOptions)} * with options = new io.qt.widgets.QColorDialog.ColorDialogOptions(0).

*/ public static io.qt.gui.QColor getColor(io.qt.gui.QColor initial, io.qt.widgets.QWidget parent, java.lang.String title) { return getColor(initial, parent, title, new io.qt.widgets.QColorDialog.ColorDialogOptions(0)); } /** *

Overloaded function for {@link #getColor(io.qt.gui.QColor, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QColorDialog.ColorDialogOptions)}

*

with:

    *
  • title = ""
  • *
  • options = new io.qt.widgets.QColorDialog.ColorDialogOptions(0)
  • *
*/ public static io.qt.gui.QColor getColor(io.qt.gui.QColor initial, io.qt.widgets.QWidget parent) { return getColor(initial, parent, "", new io.qt.widgets.QColorDialog.ColorDialogOptions(0)); } /** *

Overloaded function for {@link #getColor(io.qt.gui.QColor, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QColorDialog.ColorDialogOptions)}

*

with:

    *
  • parent = null
  • *
  • title = ""
  • *
  • options = new io.qt.widgets.QColorDialog.ColorDialogOptions(0)
  • *
*/ public static io.qt.gui.QColor getColor(io.qt.gui.QColor initial) { return getColor(initial, (io.qt.widgets.QWidget)null, "", new io.qt.widgets.QColorDialog.ColorDialogOptions(0)); } /** *

Overloaded function for {@link #getColor(io.qt.gui.QColor, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QColorDialog.ColorDialogOptions)}

*

with:

    *
  • initial = new io.qt.gui.QColor(io.qt.core.Qt.GlobalColor.white)
  • *
  • parent = null
  • *
  • title = ""
  • *
  • options = new io.qt.widgets.QColorDialog.ColorDialogOptions(0)
  • *
*/ public static io.qt.gui.QColor getColor() { return getColor(new io.qt.gui.QColor(io.qt.core.Qt.GlobalColor.white), (io.qt.widgets.QWidget)null, "", new io.qt.widgets.QColorDialog.ColorDialogOptions(0)); } /** *

See QColorDialog::getColor(QColor,QWidget*,QString,ColorDialogOptions)

*/ public static io.qt.gui.QColor getColor(io.qt.gui.QColor initial, io.qt.widgets.QWidget parent, java.lang.String title, io.qt.widgets.QColorDialog.ColorDialogOptions options){ return getColor_native_cref_QColor_QWidget_ptr_cref_QString_QFlags_QColorDialog_ColorDialogOption_(QtJambi_LibraryUtilities.internal.checkedNativeId(initial), QtJambi_LibraryUtilities.internal.checkedNativeId(parent), title, options.value()); } private native static io.qt.gui.QColor getColor_native_cref_QColor_QWidget_ptr_cref_QString_QFlags_QColorDialog_ColorDialogOption_(long initial, long parent, java.lang.String title, int options); /** *

See QColorDialog::setCustomColor(int,QColor)

*/ public static void setCustomColor(int index, io.qt.gui.QColor color){ setCustomColor_native_int_QColor(index, QtJambi_LibraryUtilities.internal.checkedNativeId(color)); } private native static void setCustomColor_native_int_QColor(int index, long color); /** *

See QColorDialog::setStandardColor(int,QColor)

*/ public static void setStandardColor(int index, io.qt.gui.QColor color){ setStandardColor_native_int_QColor(index, QtJambi_LibraryUtilities.internal.checkedNativeId(color)); } private native static void setStandardColor_native_int_QColor(int index, long color); /** *

See QColorDialog::standardColor(int)

*/ public native static io.qt.gui.QColor standardColor(int index); /** * Constructor for internal use only. * @param p expected to be null. */ @io.qt.NativeAccess protected QColorDialog(QPrivateConstructor p) { super(p); } /** * Constructor for internal use only. * It is not allowed to call the declarative constructor from inside Java. */ @io.qt.NativeAccess protected QColorDialog(QDeclarativeConstructor constructor) { super((QPrivateConstructor)null); initialize_native(this, constructor); } @io.qt.QtUninvokable private static native void initialize_native(QColorDialog instance, QDeclarativeConstructor constructor); /** *

See QColorDialog::open(QObject *, const char *)

*/ @io.qt.QtUninvokable public final void open(io.qt.core.QMetaObject.Slot1 selectedSlot) { io.qt.core.QMetaMethod metaMethod = io.qt.core.QMetaMethod.fromMethod(java.util.Objects.requireNonNull(selectedSlot)); if(metaMethod==null || !metaMethod.isValid()) { throw new IllegalArgumentException("Unable to detect slot for given handle."); } if(metaMethod.parameterCount()!=1) { throw new IllegalArgumentException("Connected method does not take a single argument: "+metaMethod.cppMethodSignature()); } if(metaMethod.parameterType(0)!=io.qt.core.QMetaType.Type.QColor.value()) { throw new IllegalArgumentException("Method does not take a single QColor argument: "+metaMethod.cppMethodSignature()); } io.qt.core.QObject object = QtJambi_LibraryUtilities.internal.lambdaContext(selectedSlot); if(object==null) { throw new IllegalArgumentException("Unable to determine QObject from given slot handle."); } open(object, metaMethod); } /** *

See QColorDialog::open(QObject *, const char *)

*/ @io.qt.QtUninvokable public final void open(io.qt.core.QMetaObject.Connectable1 selectedSignal) { io.qt.core.QMetaMethod metaMethod = io.qt.core.QMetaMethod.fromSignal(selectedSignal); if(metaMethod==null || !metaMethod.isValid()) { throw new IllegalArgumentException("Unable to detect signal for given handle."); } if(metaMethod.parameterCount()!=1) { throw new IllegalArgumentException("Connected method does not take a single argument: "+metaMethod.cppMethodSignature()); } if(metaMethod.parameterType(0)!=io.qt.core.QMetaType.Type.QColor.value()) { throw new IllegalArgumentException("Method does not take a single QColor argument: "+metaMethod.cppMethodSignature()); } if(!(selectedSignal.containingObject() instanceof io.qt.core.QObject)) { throw new IllegalArgumentException("Unable to determine QObject from given signal handle."); } open((io.qt.core.QObject)selectedSignal.containingObject(), metaMethod); } private native void open(io.qt.core.QObject obj, io.qt.core.QMetaMethod metaMethod); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy