Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSelectionOptions Class Reference

#include <kis_selection_options.h>

+ Inheritance diagram for KisSelectionOptions:

Classes

class  Private
 

Public Types

enum  ReferenceLayers { CurrentLayer , AllLayers , ColorLabeledLayers }
 

Signals

void actionChanged (SelectionAction action)
 
void antiAliasSelectionChanged (bool antiAliasSelection)
 
void featherSelectionChanged (int featherSelection)
 
void growSelectionChanged (int growSelection)
 
void modeChanged (SelectionMode mode)
 
void referenceLayersChanged (ReferenceLayers referenceLayers)
 
void selectedColorLabelsChanged ()
 
void stopGrowingAtDarkestPixelChanged (bool stopGrowingAtDarkestPixel)
 

Public Member Functions

SelectionAction action () const
 
bool antiAliasSelection () const
 
int featherSelection () const
 
int growSelection () const
 
 KisSelectionOptions (QWidget *parent=nullptr)
 
SelectionMode mode () const
 
ReferenceLayers referenceLayers () const
 
QList< int > selectedColorLabels () const
 
void setAction (SelectionAction newAction)
 
void setActionSectionVisible (bool visible)
 
void setAdjustmentsSectionVisible (bool visible)
 
void setAntiAliasSelection (bool newAntiAliasSelection)
 
void setFeatherSelection (int newFeatherSelection)
 
void setGrowSelection (int newGrowSelection)
 
void setMode (SelectionMode newMode)
 
void setModeSectionVisible (bool visible)
 
void setReferenceLayers (ReferenceLayers newReferenceLayers)
 
void setReferenceSectionVisible (bool visible)
 
void setSelectedColorLabels (const QList< int > &newSelectedColorLabels)
 
void setStopGrowingAtDarkestPixel (bool newStopGrowingAtDarkestPixel)
 
void setStopGrowingAtDarkestPixelButtonVisible (bool visible)
 
bool stopGrowingAtDarkestPixel () const
 
void updateActionButtonToolTip (SelectionAction action, const QKeySequence &shortcut)
 
 ~KisSelectionOptions () override
 
- Public Member Functions inherited from KisOptionCollectionWidget
void appendWidget (const QString &id, QWidget *widget)
 Insert the given widget with the given id at the end of the list. The list widget takes ownership of the inserted widget.
 
bool containsWidget (const QString &id) const
 Get if the list contains a widget with the given id.
 
QWidget * findWidget (const QString &path) const
 Get the widget that is at the given path. The path must be a forward slash separated list of ids. If the list contains some other KisOptionCollectionWidget or KisOptionCollectionWidgetWithHeader, and they do as well, then they form a hierarchy tree, so the path is searched recursively through all those child widgets.
 
template<typename T >
findWidgetAs (const QString &path) const
 Get the widget that is at the given path casted to some other class.
 
void insertWidget (int index, const QString &id, QWidget *widget)
 Insert the given widget with the given id at the given position. The list widget takes ownership of the inserted widget.
 
 KisOptionCollectionWidget (QWidget *parent=nullptr)
 
int numberOfVisibleWidgets () const
 Get the number of visible widgets in the list.
 
void removeWidget (const QString &id)
 Remove the widget that has the given id from the list. This also destroys the widget.
 
void removeWidget (int index)
 Remove the widget that is at the given position from the list. This also destroys the widget.
 
void setOrientation (Qt::Orientation orientation, bool recursive=false)
 Set the orientation of the list of widgets.
 
void setSeparatorsVisible (bool visible)
 Set the visibility of the separators.
 
void setWidgetsMargin (int margin)
 Set the margins of the widgets. This allows to indent the widgets with respect to the separators. The separators themselves are not changed.
 
void setWidgetVisible (const QString &id, bool visible)
 Set the visibility of the widget that has the given id. Use this function instead of the widget's one directly to get better visual results.
 
void setWidgetVisible (int index, bool visible)
 Set the visibility of the widget that is at the given position. Use this function instead of the widget's one directly to get better visual results.
 
int size () const
 Get the number of widgets in the list.
 
QWidget * takeWidget (const QString &id)
 Remove the widget that has the given id from the list. The widget is returned instead of being destroyed.
 
QWidget * takeWidget (int index)
 Remove the widget that is at the given position from the list. The widget is returned instead of being destroyed.
 
QWidget * widget (const QString &id) const
 Get the widget with the given id.
 
QWidget * widget (int index) const
 Get the widget that is at the given position.
 
template<typename T >
widgetAs (const QString &id) const
 Get the widget with the given id casted to some other class.
 
template<typename T >
widgetAs (int index) const
 Get the widget that is at the given position casted to some other class.
 
int widgetIndexFromId (const QString &id) const
 Get the index of the widget that has the given id.
 
 ~KisOptionCollectionWidget () override
 

Private Attributes

QScopedPointer< Privatem_d
 

Detailed Description

Definition at line 17 of file kis_selection_options.h.

Member Enumeration Documentation

◆ ReferenceLayers

Enumerator
CurrentLayer 
AllLayers 
ColorLabeledLayers 

Definition at line 22 of file kis_selection_options.h.

Constructor & Destructor Documentation

◆ KisSelectionOptions()

KisSelectionOptions::KisSelectionOptions ( QWidget * parent = nullptr)

Definition at line 152 of file kis_selection_options.cc.

154 , m_d(new Private)
155{
156 m_d->q = this;
157 // Create widgets
158 m_d->optionButtonStripMode = new KisOptionButtonStrip;
159 m_d->optionButtonStripMode->addButton(
160 KisIconUtils::loadIcon("select-pixel"));
161 m_d->optionButtonStripMode->addButton(
162 KisIconUtils::loadIcon("select-shape"));
163 m_d->optionButtonStripMode->button(0)->setChecked(true);
164
165 m_d->optionButtonStripAction = new KisOptionButtonStrip;
166 m_d->optionButtonStripAction->addButton(
167 KisIconUtils::loadIcon("selection_replace"));
168 m_d->optionButtonStripAction->addButton(
169 KisIconUtils::loadIcon("selection_intersect"));
170 m_d->optionButtonStripAction->addButton(
171 KisIconUtils::loadIcon("selection_add"));
172 m_d->optionButtonStripAction->addButton(
173 KisIconUtils::loadIcon("selection_subtract"));
174 m_d->optionButtonStripAction->addButton(
175 KisIconUtils::loadIcon("selection_symmetric_difference"));
176 m_d->optionButtonStripAction->button(0)->setChecked(true);
177
178 m_d->checkBoxAntiAliasSelection = new QCheckBox(
179 i18nc("The anti-alias checkbox in fill tool options", "Anti-aliasing"));
180 KisOptionCollectionWidget *containerGrowSelection = new KisOptionCollectionWidget;
181 m_d->sliderGrowSelection = new KisSliderSpinBox;
182 m_d->sliderGrowSelection->setPrefix(
183 i18nc("The 'grow/shrink' spinbox prefix in selection tools options",
184 "Grow: "));
185 m_d->sliderGrowSelection->setRange(-400, 400);
186 m_d->sliderGrowSelection->setSoftRange(-40, 40);
187 m_d->sliderGrowSelection->setSuffix(i18n(" px"));
188 m_d->buttonStopGrowingAtDarkestPixel = new QToolButton;
189 m_d->buttonStopGrowingAtDarkestPixel->setAutoRaise(true);
190 m_d->buttonStopGrowingAtDarkestPixel->setCheckable(true);
191 m_d->buttonStopGrowingAtDarkestPixel->setIcon(KisIconUtils::loadIcon("stop-at-boundary"));
192 containerGrowSelection->appendWidget("sliderGrowSelection", m_d->sliderGrowSelection);
193 containerGrowSelection->appendWidget("buttonStopGrowingAtDarkestPixel", m_d->buttonStopGrowingAtDarkestPixel);
194 containerGrowSelection->setOrientation(Qt::Horizontal);
195 containerGrowSelection->setWidgetVisible("buttonStopGrowingAtDarkestPixel", false);
196 m_d->sliderFeatherSelection = new KisSliderSpinBox;
197 m_d->sliderFeatherSelection->setPrefix(
198 i18nc("The 'feather' spinbox prefix in selection tools options",
199 "Feather: "));
200 m_d->sliderFeatherSelection->setRange(0, 400);
201 m_d->sliderFeatherSelection->setSoftRange(0, 40);
202 m_d->sliderFeatherSelection->setSuffix(i18n(" px"));
203
204 m_d->optionButtonStripReference = new KisOptionButtonStrip;
205 m_d->optionButtonStripReference->addButton(
206 KisIconUtils::loadIcon("current-layer"));
207 m_d->optionButtonStripReference->addButton(
208 KisIconUtils::loadIcon("all-layers"));
209 m_d->optionButtonStripReference->addButton(KisIconUtils::loadIcon("tag"));
210 m_d->optionButtonStripReference->button(0)->setChecked(true);
211 m_d->widgetLabels = new KisColorLabelSelectorWidget;
212 m_d->widgetLabels->setExclusive(false);
213 m_d->widgetLabels->setButtonSize(20);
214 m_d->widgetLabels->setButtonWrapEnabled(true);
215 m_d->widgetLabels->setMouseDragEnabled(true);
216
217 // Set the tooltips
218 m_d->optionButtonStripMode->button(0)->setToolTip(
219 i18nc("@info:tooltip", "Pixel Selection"));
220 m_d->optionButtonStripMode->button(1)->setToolTip(
221 i18nc("@info:tooltip", "Vector Selection"));
222
223 m_d->optionButtonStripAction->button(0)->setToolTip(
224 i18nc("@info:tooltip", "Replace"));
225 m_d->optionButtonStripAction->button(1)->setToolTip(
226 i18nc("@info:tooltip", "Intersect"));
227 m_d->optionButtonStripAction->button(2)->setToolTip(
228 i18nc("@info:tooltip", "Add"));
229 m_d->optionButtonStripAction->button(3)->setToolTip(
230 i18nc("@info:tooltip", "Subtract"));
231 m_d->optionButtonStripAction->button(4)->setToolTip(
232 i18nc("@info:tooltip", "Symmetric Difference"));
233
234 m_d->checkBoxAntiAliasSelection->setToolTip(
235 i18n("Smooths the edges of the selection"));
236 m_d->sliderGrowSelection->setToolTip(
237 i18n("Grow or shrink the selection by the set amount"));
238 m_d->buttonStopGrowingAtDarkestPixel->setToolTip(
239 i18n("Stop growing at the darkest and/or most opaque pixels"));
240 m_d->sliderFeatherSelection->setToolTip(
241 i18n("Blur the selection by the set amount"));
242
243 m_d->optionButtonStripReference->button(0)->setToolTip(
244 i18n("Select regions found from the active layer"));
245 m_d->optionButtonStripReference->button(1)->setToolTip(
246 i18n("Select regions found from the merging of all layers"));
247 m_d->optionButtonStripReference->button(2)->setToolTip(
248 i18n("Select regions found from the merging of layers with specific color labels"));
249
250 // Construct the option widget
252
255 i18nc("The 'mode' section label in selection tools options",
256 "Mode"));
257 sectionMode->setPrimaryWidget(m_d->optionButtonStripMode);
258 appendWidget("sectionMode", sectionMode);
259
262 i18nc("The 'action' section label in selection tools options",
263 "Action"));
264 sectionAction->setPrimaryWidget(m_d->optionButtonStripAction);
265 appendWidget("sectionAction", sectionAction);
266
267 KisOptionCollectionWidgetWithHeader *sectionReference =
269 i18nc("The 'reference' section label in selection tools options",
270 "Reference"));
271 sectionReference->setPrimaryWidget(m_d->optionButtonStripReference);
272 sectionReference->appendWidget("widgetLabels", m_d->widgetLabels);
273 sectionReference->setWidgetVisible("widgetLabels", false);
274 appendWidget("sectionReference", sectionReference);
275
276 KisOptionCollectionWidgetWithHeader *sectionAdjustments =
278 i18nc("The 'adjustments' section label in selection tools options",
279 "Adjustments"));
280 sectionAdjustments->appendWidget("checkBoxAntiAliasSelection",
281 m_d->checkBoxAntiAliasSelection);
282 sectionAdjustments->appendWidget("containerGrowSelection", containerGrowSelection);
283 sectionAdjustments->appendWidget("sliderFeather",
284 m_d->sliderFeatherSelection);
285 appendWidget("sectionAdjustments", sectionAdjustments);
286
287 // Make connections
288 connect(m_d->optionButtonStripMode,
289 QOverload<int, bool>::of(&KisOptionButtonStrip::buttonToggled),
290 [this](int i, int c) {
291 m_d->on_optionButtonStripMode_buttonToggled(i, c);
292 });
293 connect(m_d->optionButtonStripAction,
294 QOverload<int, bool>::of(&KisOptionButtonStrip::buttonToggled),
295 [this](int i, int c) {
296 m_d->on_optionButtonStripAction_buttonToggled(i, c);
297 });
298 connect(m_d->checkBoxAntiAliasSelection,
299 SIGNAL(toggled(bool)),
300 SIGNAL(antiAliasSelectionChanged(bool)));
301 connect(m_d->sliderGrowSelection,
302 SIGNAL(valueChanged(int)),
303 SIGNAL(growSelectionChanged(int)));
304 connect(m_d->buttonStopGrowingAtDarkestPixel,
305 SIGNAL(toggled(bool)),
307 connect(m_d->sliderFeatherSelection,
308 SIGNAL(valueChanged(int)),
309 SIGNAL(featherSelectionChanged(int)));
310 connect(m_d->optionButtonStripReference,
311 QOverload<int, bool>::of(&KisOptionButtonStrip::buttonToggled),
312 [this](int i, int c) {
313 m_d->on_optionButtonStripReference_buttonToggled(i, c);
314 });
315 connect(m_d->widgetLabels,
316 SIGNAL(selectionChanged()),
318}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void setExclusive(bool exclusive)
Set if the button selection is mutually exclusive. This allows switching between single or multiple s...
Provides a list of consecutive tool buttons.
void buttonToggled(KoGroupButton *button, bool checked)
KoGroupButton * addButton(const QIcon &icon, const QString &text=QString())
Wrapper class around a KisOptionCollectionWidget that also provide a header with a title label and an...
void setPrimaryWidget(QWidget *widget)
Set the primary widget. The list widget takes ownership of it.
void appendWidget(const QString &id, QWidget *widget)
Insert the given widget with the given id at the end of the list. The list widget takes ownership of ...
void setWidgetVisible(int index, bool visible)
Set the visibility of the widget that is at the given position.
Class providing a list of widgets with some addons such as separators, orientation or individual widg...
void setOrientation(Qt::Orientation orientation, bool recursive=false)
Set the orientation of the list of widgets.
KisOptionCollectionWidget(QWidget *parent=nullptr)
void setWidgetVisible(int index, bool visible)
Set the visibility of the widget that is at the given position. Use this function instead of the widg...
void appendWidget(const QString &id, QWidget *widget)
Insert the given widget with the given id at the end of the list. The list widget takes ownership of ...
void setSeparatorsVisible(bool visible)
Set the visibility of the separators.
void antiAliasSelectionChanged(bool antiAliasSelection)
void featherSelectionChanged(int featherSelection)
void selectedColorLabelsChanged()
QScopedPointer< Private > m_d
void stopGrowingAtDarkestPixelChanged(bool stopGrowingAtDarkestPixel)
void growSelectionChanged(int growSelection)
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setRange(int newMinimum, int newMaximum, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range, computing a new "fast slider step" based on the ...
QIcon loadIcon(const QString &name)

References KisOptionButtonStrip::addButton(), antiAliasSelectionChanged(), KisOptionCollectionWidget::appendWidget(), KisOptionCollectionWidgetWithHeader::appendWidget(), KisOptionButtonStrip::buttonToggled(), connect(), featherSelectionChanged(), growSelectionChanged(), KisOptionCollectionWidget::KisOptionCollectionWidget(), KisIconUtils::loadIcon(), m_d, selectedColorLabelsChanged(), KisColorLabelSelectorWidget::setExclusive(), KisOptionCollectionWidget::setOrientation(), KisOptionCollectionWidgetWithHeader::setPrimaryWidget(), KisSliderSpinBox::setRange(), KisOptionCollectionWidget::setSeparatorsVisible(), KisOptionCollectionWidget::setWidgetVisible(), KisOptionCollectionWidgetWithHeader::setWidgetVisible(), and stopGrowingAtDarkestPixelChanged().

◆ ~KisSelectionOptions()

KisSelectionOptions::~KisSelectionOptions ( )
override

Definition at line 320 of file kis_selection_options.cc.

321{
322}

Member Function Documentation

◆ action()

SelectionAction KisSelectionOptions::action ( ) const

Definition at line 330 of file kis_selection_options.cc.

331{
332 return m_d->buttonIndexToAction(
333 m_d->optionButtonStripAction->checkedButtonIndex());
334}

References m_d.

◆ actionChanged

void KisSelectionOptions::actionChanged ( SelectionAction action)
signal

◆ antiAliasSelection()

bool KisSelectionOptions::antiAliasSelection ( ) const

Definition at line 336 of file kis_selection_options.cc.

337{
338 return m_d->checkBoxAntiAliasSelection->isChecked();
339}

References m_d.

◆ antiAliasSelectionChanged

void KisSelectionOptions::antiAliasSelectionChanged ( bool antiAliasSelection)
signal

◆ featherSelection()

int KisSelectionOptions::featherSelection ( ) const

Definition at line 351 of file kis_selection_options.cc.

352{
353 return m_d->sliderFeatherSelection->value();
354}

References m_d.

◆ featherSelectionChanged

void KisSelectionOptions::featherSelectionChanged ( int featherSelection)
signal

◆ growSelection()

int KisSelectionOptions::growSelection ( ) const

Definition at line 341 of file kis_selection_options.cc.

342{
343 return m_d->sliderGrowSelection->value();
344}

References m_d.

◆ growSelectionChanged

void KisSelectionOptions::growSelectionChanged ( int growSelection)
signal

◆ mode()

SelectionMode KisSelectionOptions::mode ( ) const

Definition at line 324 of file kis_selection_options.cc.

325{
326 return m_d->buttonIndexToMode(
327 m_d->optionButtonStripMode->checkedButtonIndex());
328}

References m_d.

◆ modeChanged

void KisSelectionOptions::modeChanged ( SelectionMode mode)
signal

◆ referenceLayers()

KisSelectionOptions::ReferenceLayers KisSelectionOptions::referenceLayers ( ) const

Definition at line 357 of file kis_selection_options.cc.

358{
359 return m_d->buttonIndexToReferenceLayers(
360 m_d->optionButtonStripReference->checkedButtonIndex());
361}

References m_d.

◆ referenceLayersChanged

void KisSelectionOptions::referenceLayersChanged ( ReferenceLayers referenceLayers)
signal

◆ selectedColorLabels()

QList< int > KisSelectionOptions::selectedColorLabels ( ) const

Definition at line 363 of file kis_selection_options.cc.

364{
365 return m_d->widgetLabels->selection();
366}

References m_d.

◆ selectedColorLabelsChanged

void KisSelectionOptions::selectedColorLabelsChanged ( )
signal

◆ setAction()

void KisSelectionOptions::setAction ( SelectionAction newAction)

Definition at line 377 of file kis_selection_options.cc.

378{
379 KoGroupButton *button = m_d->optionButtonStripAction->button(
380 m_d->actionToButtonIndex(newAction));
382
383 button->setChecked(true);
384}
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
QString button(const QWheelEvent &ev)

References button(), KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.

◆ setActionSectionVisible()

void KisSelectionOptions::setActionSectionVisible ( bool visible)

Definition at line 426 of file kis_selection_options.cc.

427{
428 setWidgetVisible("sectionAction", visible);
429}

References KisOptionCollectionWidget::setWidgetVisible().

◆ setAdjustmentsSectionVisible()

void KisSelectionOptions::setAdjustmentsSectionVisible ( bool visible)

Definition at line 438 of file kis_selection_options.cc.

439{
440 setWidgetVisible("sectionAdjustments", visible);
441}

References KisOptionCollectionWidget::setWidgetVisible().

◆ setAntiAliasSelection()

void KisSelectionOptions::setAntiAliasSelection ( bool newAntiAliasSelection)

Definition at line 386 of file kis_selection_options.cc.

387{
388 m_d->checkBoxAntiAliasSelection->setChecked(newAntiAliasSelection);
389}

References m_d.

◆ setFeatherSelection()

void KisSelectionOptions::setFeatherSelection ( int newFeatherSelection)

Definition at line 401 of file kis_selection_options.cc.

402{
403 m_d->sliderFeatherSelection->setValue(newFeatherSelection);
404}

References m_d.

◆ setGrowSelection()

void KisSelectionOptions::setGrowSelection ( int newGrowSelection)

Definition at line 391 of file kis_selection_options.cc.

392{
393 m_d->sliderGrowSelection->setValue(newGrowSelection);
394}

References m_d.

◆ setMode()

void KisSelectionOptions::setMode ( SelectionMode newMode)

Definition at line 368 of file kis_selection_options.cc.

369{
371 m_d->optionButtonStripMode->button(m_d->modeToButtonIndex(newMode));
373
374 button->setChecked(true);
375}

References button(), KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.

◆ setModeSectionVisible()

void KisSelectionOptions::setModeSectionVisible ( bool visible)

Definition at line 421 of file kis_selection_options.cc.

422{
423 setWidgetVisible("sectionMode", visible);
424}

References KisOptionCollectionWidget::setWidgetVisible().

◆ setReferenceLayers()

void KisSelectionOptions::setReferenceLayers ( ReferenceLayers newReferenceLayers)

Definition at line 406 of file kis_selection_options.cc.

407{
408 KoGroupButton *button = m_d->optionButtonStripReference->button(
409 m_d->referenceLayersToButtonIndex(newReferenceLayers));
411
412 button->setChecked(true);
413}

References button(), KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.

◆ setReferenceSectionVisible()

void KisSelectionOptions::setReferenceSectionVisible ( bool visible)

Definition at line 443 of file kis_selection_options.cc.

444{
445 setWidgetVisible("sectionReference", visible);
446}

References KisOptionCollectionWidget::setWidgetVisible().

◆ setSelectedColorLabels()

void KisSelectionOptions::setSelectedColorLabels ( const QList< int > & newSelectedColorLabels)

Definition at line 415 of file kis_selection_options.cc.

417{
418 m_d->widgetLabels->setSelection(newSelectedColorLabels);
419}

References m_d.

◆ setStopGrowingAtDarkestPixel()

void KisSelectionOptions::setStopGrowingAtDarkestPixel ( bool newStopGrowingAtDarkestPixel)

Definition at line 396 of file kis_selection_options.cc.

397{
398 m_d->buttonStopGrowingAtDarkestPixel->setChecked(newStopGrowingAtDarkestPixel);
399}

References m_d.

◆ setStopGrowingAtDarkestPixelButtonVisible()

void KisSelectionOptions::setStopGrowingAtDarkestPixelButtonVisible ( bool visible)

Definition at line 431 of file kis_selection_options.cc.

432{
433 widgetAs<KisOptionCollectionWidgetWithHeader*>("sectionAdjustments")
434 ->widgetAs<KisOptionCollectionWidget*>("containerGrowSelection")
435 ->setWidgetVisible("buttonStopGrowingAtDarkestPixel", visible);
436}

References KisOptionCollectionWidget::setWidgetVisible().

◆ stopGrowingAtDarkestPixel()

bool KisSelectionOptions::stopGrowingAtDarkestPixel ( ) const

Definition at line 346 of file kis_selection_options.cc.

347{
348 return m_d->buttonStopGrowingAtDarkestPixel->isChecked();
349}

References m_d.

◆ stopGrowingAtDarkestPixelChanged

void KisSelectionOptions::stopGrowingAtDarkestPixelChanged ( bool stopGrowingAtDarkestPixel)
signal

◆ updateActionButtonToolTip()

void KisSelectionOptions::updateActionButtonToolTip ( SelectionAction action,
const QKeySequence & shortcut )

Definition at line 448 of file kis_selection_options.cc.

451{
452 const QString shortcutString = shortcut.toString(QKeySequence::NativeText);
453 QString toolTipText;
454 const int buttonIndex = m_d->actionToButtonIndex(action);
455
456 switch (action) {
459 toolTipText = shortcutString.isEmpty()
460 ? i18nc("@info:tooltip", "Replace")
461 : i18nc("@info:tooltip", "Replace (%1)", shortcutString);
462 break;
463 case SELECTION_ADD:
464 toolTipText = shortcutString.isEmpty()
465 ? i18nc("@info:tooltip", "Add")
466 : i18nc("@info:tooltip", "Add (%1)", shortcutString);
467 break;
469 toolTipText = shortcutString.isEmpty()
470 ? i18nc("@info:tooltip", "Subtract")
471 : i18nc("@info:tooltip", "Subtract (%1)", shortcutString);
472 break;
474 toolTipText = shortcutString.isEmpty()
475 ? i18nc("@info:tooltip", "Intersect")
476 : i18nc("@info:tooltip", "Intersect (%1)", shortcutString);
477 break;
479 toolTipText = shortcutString.isEmpty()
480 ? i18nc("@info:tooltip", "Symmetric Difference")
481 : i18nc("@info:tooltip",
482 "Symmetric Difference (%1)",
483 shortcutString);
484 break;
485 }
486
487 m_d->optionButtonStripAction->button(buttonIndex)->setToolTip(toolTipText);
488}
@ SELECTION_REPLACE
@ SELECTION_INTERSECT
@ SELECTION_SYMMETRICDIFFERENCE
@ SELECTION_DEFAULT
@ SELECTION_SUBTRACT
@ SELECTION_ADD
SelectionAction action() const

References action(), m_d, SELECTION_ADD, SELECTION_DEFAULT, SELECTION_INTERSECT, SELECTION_REPLACE, SELECTION_SUBTRACT, and SELECTION_SYMMETRICDIFFERENCE.

Member Data Documentation

◆ m_d

QScopedPointer<Private> KisSelectionOptions::m_d
private

Definition at line 66 of file kis_selection_options.h.


The documentation for this class was generated from the following files: