KDEUI
kcolordialog.cpp
Go to the documentation of this file.
141 virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
567 // We must replace the untranslated file names by translate names (of course only for KDE's standard palettes)
748 QString finalMsg = i18ncp("%1 is the number of paths, %2 is the list of paths (with newlines between them)",
870 KColorTable::KColorTablePrivate::slotColorCellDoubleClicked(int index , const QColor& /*color*/)
909 KColorCollection *recentPal = new KColorCollection(colorCollectionName[ recentColorIndex ].m_fileName);
1011 QPoint(event->xmotion.x_root, event->xmotion.y_root) , Qt::NoButton, Qt::NoButton, Qt::NoModifier);
1113 d->hedit->setSuffix(i18nc("The angular degree unit (for hue)", "\302\260")); // U+00B0 DEGREE SIGN
1177 QRect labelRect = modeButton->style()->subElementRect(QStyle::SE_RadioButtonContents, &option, modeButton);
1178 int indent = layoutDirection() == Qt::LeftToRight ? labelRect.left() : modeButton->geometry().right() - labelRect.right();
1470 group.writeEntry("CurrentPalette", collectionName); //Make sure the untranslated name is saved, assuming there is one
1630 void KColorDialog::KColorDialogPrivate::slotColorSelected(const QColor &color, const QString &name)
1691 int value = qRound(getComponentValue(color, chooserMode()) * (chooserMode() == ChooserHue ? 360.0 : 255.0));
QLayout * layout() const
void colorChanged(const QColor &)
This signal is emitted whenever the current color changes due to a drop event.
void setSelected(int index)
Sets the currently selected cell to index.
Definition: kcolordialog.cpp:251
QString i18n(const char *text)
static QColor grabColor(const QPoint &p)
Gets the color from the pixel at point p on the screen.
Definition: kcolordialog.cpp:1759
void releaseMouse()
Definition: kcolorchoosermode.h:28
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
Type type() const
virtual void dragEnterEvent(QDragEnterEvent *)
Definition: kcolordialog.cpp:518
const QPalette & palette() const
QColor darker(int factor) const
void setModal(bool modal)
const QMimeData * mimeData() const
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setSelectionMode(QAbstractItemView::SelectionMode mode)
virtual QSize sizeHint() const
void setFixedWidth(int w)
void setRenderHint(RenderHint hint, bool on)
qreal contrastRatio(const QColor &, const QColor &)
Calculate the contrast ratio between two colors, according to the W3C/WCAG2.0 algorithm, (Lmax + 0.05)/(Lmin + 0.05), where Lmax and Lmin are the luma values of the lighter color and the darker color, respectively.
Definition: kcolorutils.cpp:50
Definition: kcolorvalueselector.h:28
QByteArray trimmed() const
#define I18N_NOOP2(comment, x)
We need to remember the context to get the correct translation.
Definition: kstandardshortcut.cpp:68
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
int right() const
Qt::DropAction start(QFlags< Qt::DropAction > request)
void setAlphaChannelEnabled(bool alpha)
When set to true, the user is allowed to change the alpha component of the color. ...
Definition: kcolordialog.cpp:1376
QRect contentsRect() const
bool isAlphaChannelEnabled() const
Returns true when the user can change the alpha channel.
void setFrameShape(Shape)
void setItem(int row, int column, QTableWidgetItem *item)
void setDefaultColor(const QColor &defaultCol)
Call this to make the dialog show a "Default Color" checkbox.
Definition: kcolordialog.cpp:1343
bool canDecode(const QMimeData *mimeData)
Returns true if the MIME data mimeData contains a color object.
Definition: kcolormimedata.cpp:36
QString & prepend(QChar ch)
int value() const
Display * display()
QStyle * style() const
Show Cancel-button. (this button reject()s the dialog; result set to QDialog::Rejected) ...
Definition: kdialog.h:144
QString label(StandardShortcut id)
Returns a localized label for user-visible display.
Definition: kstandardshortcut.cpp:267
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
int x() const
int y() const
qreal getComponentValue(const QColor &color, KColorChooserMode chooserMode)
Definition: kcolorchoosermode.cpp:26
const QPoint & pos() const
virtual void mouseDoubleClickEvent(QMouseEvent *)
Definition: kcolordialog.cpp:458
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
void save()
virtual void mouseReleaseEvent(QMouseEvent *)
Definition: kcolordialog.cpp:428
T value() const
int exec()
QWidget * viewport() const
void setAlpha(int alpha)
void setColor(const QColor &col)
Set the color to display and update the display.
Definition: kcolordialog.cpp:495
Definition: kcolorchoosermode.h:27
QPixmap grabWindow(WId window, int x, int y, int width, int height)
QHeaderView * verticalHeader() const
virtual bool x11Event(XEvent *event)
Qt::MouseButtons buttons() const
void setFrameStyle(int style)
void drawLine(const QLineF &line)
void addSpacing(int size)
void setRgb(int r, int g, int b, int a)
virtual QSize sizeHint() const
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
virtual void mouseReleaseEvent(QMouseEvent *event)
QString indent(QString text, int spaces)
virtual QVariant data(int role) const
int hue() const
void setIcon(const QIcon &icon)
int selectedIndex() const
Returns the index of the cell which is currently selected.
Definition: kcolordialog.cpp:258
void setColor(int index, const QColor &col)
Sets the color in the given index in the table.
Definition: kcolordialog.cpp:263
virtual void mouseReleaseEvent(QMouseEvent *event)
virtual void mouseMoveEvent(QMouseEvent *)
Definition: kcolordialog.cpp:1731
void getHsv(int *h, int *s, int *v, int *a) const
void update()
virtual void setCaption(const QString &caption)
Make a KDE compliant caption.
Definition: kdialog.cpp:469
virtual void dragEnterEvent(QDragEnterEvent *)
Definition: kcolordialog.cpp:396
int x() const
int y() const
void setComponentValue(QColor &color, KColorChooserMode chooserMode, qreal value)
Definition: kcolorchoosermode.cpp:44
QString i18nc(const char *ctxt, const char *text)
virtual void setData(int role, const QVariant &value)
geometry
KSharedConfigPtr config()
bool isNull() const
void colorDoubleClicked(int index, const QColor &color)
Emitted when a color in the table is double-clicked.
void resizeSection(int logicalIndex, int size)
Definition: khuesaturationselect.h:28
void initFrom(const QWidget *widget)
Definition: kcolorchoosermode.h:26
bool acceptDrags() const
int width() const
void setBuddy(QWidget *buddy)
int addColor(const QColor &newColor, const QString &newColorName=QString())
Add a color.
Definition: kcolorcollection.cpp:246
void setMinimumSize(const QSize &)
QColor toRgb() const
QRgb pixel(int x, int y) const
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
static QStringList installedCollections()
Query which KDE color collections are installed.
Definition: kcolorcollection.cpp:108
void append(const T &value)
Definition: kcolordialog.cpp:115
const QPoint & globalPos() const
Qt::LayoutDirection layoutDirection() const
virtual void paintEvent(QPaintEvent *)
virtual void resizeEvent(QResizeEvent *event)
Definition: kcolordialog.cpp:311
QRgb rgb() const
int appScreen()
static int spacingHint()
Returns the number of pixels that should be used between widgets inside a dialog according to the KDE...
Definition: kdialog.cpp:432
QString i18ncp(const char *ctxt, const char *sing, const char *plur, const A1 &a1)
void setPen(const QColor &color)
virtual void mouseMoveEvent(QMouseEvent *)
Definition: kcolordialog.cpp:510
void drawEllipse(const QRectF &rectangle)
int left() const
virtual void dragMoveEvent(QDragMoveEvent *)
Definition: kcolordialog.cpp:406
void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy)
static void sorry(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
Display an "Sorry" dialog.
Definition: kmessagebox.cpp:904
void setObjectName(const QString &name)
void setTabOrder(QWidget *first, QWidget *second)
virtual void mouseMoveEvent(QMouseEvent *event)
bool isEmpty() const
int removeAll(const T &value)
void setItemDelegate(QAbstractItemDelegate *delegate)
bool sendEvent(QObject *receiver, QEvent *event)
Definition: kcolordialog.cpp:116
int column(const QTableWidgetItem *item) const
QColor defaultColor() const
void setBrush(const QBrush &brush)
int result() const
WId winId() const
void setText(const QString &)
void hide()
QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount=0.0)
Adjust the luma and chroma components of a color.
Definition: kcolorutils.cpp:71
void setButtons(ButtonCodes buttonMask)
Creates (or recreates) the button box and all the buttons in it.
Definition: kdialog.cpp:206
QByteArray mid(int pos, int len) const
void setMargin(int margin)
int alpha() const
The KGradientSelector widget allows the user to choose from a one-dimensional range of colors which i...
Definition: kselector.h:132
void setAcceptDrops(bool on)
Show Ok button. (this button accept()s the dialog; result set to QDialog::Accepted) ...
Definition: kdialog.h:141
void insertCatalog(const QString &catalog)
int key() const
int positionToCell(const QPoint &pos, bool ignoreBorders=false) const
Definition: kcolordialog.cpp:345
void accept()
QDrag * createDrag(const QColor &color, QWidget *dragsource)
Creates a color drag object.
Definition: kcolormimedata.cpp:61
QColor fromRgbF(qreal r, qreal g, qreal b, qreal a)
void setFixedSize(const QSize &s)
bool shading() const
sizeHint
QColor lighter(int factor) const
Definition: kcolordialog.cpp:114
virtual void mouseMoveEvent(QMouseEvent *event)
virtual bool eventFilter(QObject *obj, QEvent *ev)
Definition: kcolordialog.cpp:1325
void setMaximumSize(const QSize &)
Class for handling color collections ("palettes").
Definition: kcolorcollection.h:42
KLocale * locale()
void restore()
void colorSelected(int index, const QColor &color)
Emitted when a color is selected in the table.
Definition: kcolorchoosermode.h:25
virtual void mouseReleaseEvent(QMouseEvent *)
Definition: kcolordialog.cpp:1742
QColor fromMimeData(const QMimeData *mimeData)
Decodes the MIME data mimeData and returns the resulting color.
Definition: kcolormimedata.cpp:50
KPushButton * button(ButtonCode id) const
Returns the button that corresponds to the id.
Definition: kdialog.cpp:655
void setColumnCount(int columns)
void addLayout(QLayout *layout, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
static const ColorCollectionNameType colorCollectionName[]
Definition: kcolordialog.cpp:101
QTableWidgetItem * itemAt(const QPoint &point) const
bool activate()
QByteArray toLatin1() const
Definition: kcolorchoosermode.h:24
QVariant data(int role) const
QDesktopWidget * desktop()
static const char *const * namedColorFilePath(void)
Definition: kcolordialog.cpp:618
virtual void mousePressEvent(QMouseEvent *event)
int row(const QTableWidgetItem *item) const
void setColumnStretch(int column, int stretch)
QWidget * parentWidget() const
void addItem(QLayoutItem *item, int row, int column, int rowSpan, int columnSpan, QFlags< Qt::AlignmentFlag > alignment)
QString & sprintf(const char *cformat,...)
void releaseKeyboard()
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
void getRgb(int *r, int *g, int *b, int *a) const
KColorDialog(QWidget *parent=0L, bool modal=false)
Constructs a color selection dialog.
Definition: kcolordialog.cpp:1021
int height() const
QTableWidgetItem * item(int row, int column) const
void setSelected(bool select)
char * data()
void setHsv(int h, int s, int v, int a)
Definition: kcolorchoosermode.h:29
virtual int sizeHintForColumn(int column) const
Definition: kcolordialog.cpp:326
void setText(const QString &text)
QString fromLatin1(const char *str, int size)
void sort()
int count() const
Returns the total number of color cells in the table.
Definition: kcolordialog.cpp:226
int saturation() const
QFuture< void > filter(Sequence &sequence, FilterFunction filterFunction)
virtual QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const =0
const QPoint & pos() const
Definition: kcolorchoosermode.h:30
QColor color(int index) const
Returns the color at a given index in the table.
Definition: kcolordialog.cpp:216
virtual bool eventFilter(QObject *o, QEvent *e)
QImage toImage() const
virtual void mousePressEvent(QMouseEvent *)
Definition: kcolordialog.cpp:336
static int getColor(QColor &theColor, QWidget *parent=0L)
Creates a modal color dialog, let the user choose a color, and returns when the dialog is closed...
Definition: kcolordialog.cpp:1492
void setBackgroundRole(QPalette::ColorRole role)
void fillOpaqueRect(QPainter *painter, const QRect &rect, const QBrush &brush)
Definition: kcolorhelpers.cpp:28
void clearSelection()
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setRowCount(int rows)
virtual void mouseMoveEvent(QMouseEvent *)
Definition: kcolordialog.cpp:372
A variant of QListWidget that honors KDE's system-wide settings.
Definition: klistwidget.h:40
QHeaderView * horizontalHeader() const
virtual int sizeHintForRow(int column) const
Definition: kcolordialog.cpp:331
static int dndEventDelay()
Returns a threshold in pixels for drag & drop operations.
Definition: kglobalsettings.cpp:227
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)
int height() const
bool isValid() const
void addLayout(QLayout *layout, int stretch)
void setDragEnabled(bool enable)
singleShot
KColorCells(QWidget *parent, int rows, int columns)
Constructs a new table of color cells, consisting of rows * columns colors.
Definition: kcolordialog.cpp:182
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.