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

A dialog base class with standard buttons and predefined layouts. More...

#include <KoDialog.h>

+ Inheritance diagram for KoDialog:

Public Types

enum  ButtonCode {
  None = 0x00000000 , Help = 0x00000001 , Default = 0x00000002 , Ok = 0x00000004 ,
  Apply = 0x00000008 , Try = 0x00000010 , Cancel = 0x00000020 , Close = 0x00000040 ,
  No = 0x00000080 , Yes = 0x00000100 , Reset = 0x00000200 , Details = 0x00000400 ,
  User1 = 0x00001000 , User2 = 0x00002000 , User3 = 0x00004000 , NoDefault = 0x00008000
}
 
enum  ButtonPopupMode { InstantPopup = 0 , DelayedPopup = 1 }
 
enum  CaptionFlag { NoCaptionFlags = 0 , AppNameCaption = 1 , ModifiedCaption = 2 , HIGCompliantCaption = AppNameCaption }
 

Public Slots

void delayedDestruct ()
 
void enableButton (ButtonCode id, bool state)
 
void enableButtonApply (bool state)
 
void enableButtonCancel (bool state)
 
void enableButtonOk (bool state)
 
void enableLinkedHelp (bool state)
 
bool isDetailsWidgetVisible () const
 
virtual void setCaption (const QString &caption)
 
virtual void setCaption (const QString &caption, bool modified)
 
void setDetailsWidget (QWidget *detailsWidget)
 
void setDetailsWidgetVisible (bool visible)
 
void setHelp (const QString &anchor, const QString &appname=QString())
 
void setHelpLinkText (const QString &text)
 
virtual void setPlainCaption (const QString &caption)
 

Signals

void aboutToShowDetails ()
 
void applyClicked ()
 
void buttonClicked (KoDialog::ButtonCode button)
 
void cancelClicked ()
 
void closeClicked ()
 
void defaultClicked ()
 
void finished ()
 
void helpClicked ()
 
void hidden ()
 
void layoutHintChanged ()
 
void noClicked ()
 
void okClicked ()
 
void resetClicked ()
 
void tryClicked ()
 
void user1Clicked ()
 
void user2Clicked ()
 
void user3Clicked ()
 
void yesClicked ()
 

Public Member Functions

QPushButton * button (ButtonCode id) const
 
QIcon buttonIcon (ButtonCode id) const
 
QString buttonText (ButtonCode id) const
 
QString buttonToolTip (ButtonCode id) const
 
QString buttonWhatsThis (ButtonCode id) const
 
ButtonCode defaultButton () const
 
QString helpLinkText () const
 
void incrementInitialSize (const QSize &size)
 
bool isButtonEnabled (ButtonCode id) const
 
 KoDialog (QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags())
 
QWidget * mainWidget ()
 
QSize minimumSizeHint () const override
 
void setButtonFocus (ButtonCode id)
 
void setButtonGuiItem (ButtonCode id, const KGuiItem &item)
 
void setButtonIcon (ButtonCode id, const QIcon &icon)
 
void setButtons (ButtonCodes buttonMask)
 
void setButtonsOrientation (Qt::Orientation orientation)
 
void setButtonText (ButtonCode id, const QString &text)
 
void setButtonToolTip (ButtonCode id, const QString &text)
 
void setButtonWhatsThis (ButtonCode id, const QString &text)
 
void setDefaultButton (ButtonCode id)
 
void setEscapeButton (ButtonCode id)
 
void setInitialSize (const QSize &size)
 
void setMainWidget (QWidget *widget)
 
void showButton (ButtonCode id, bool state)
 
void showButtonSeparator (bool state)
 
QSize sizeHint () const override
 
 ~KoDialog () override
 

Static Public Member Functions

static int groupSpacingHint ()
 
static QString makeStandardCaption (const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption)
 
static int marginHint ()
 
static void resizeLayout (QLayout *lay, int margin, int spacing)
 
static void resizeLayout (QWidget *widget, int margin, int spacing)
 
static int spacingHint ()
 

Protected Slots

virtual void slotButtonClicked (int button)
 

Protected Member Functions

void closeEvent (QCloseEvent *e) override
 
void hideEvent (QHideEvent *) override
 
void keyPressEvent (QKeyEvent *) override
 
void showEvent (QShowEvent *e) override
 

Private Member Functions

 KoDialog (KoDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f=Qt::WindowFlags())
 

Private Attributes

KoDialogPrivate *const d_ptr
 

Detailed Description

A dialog base class with standard buttons and predefined layouts.

Provides basic functionality needed by nearly all dialogs.

It offers the standard action buttons you'd expect to find in a dialog as well as the capability to define at most three configurable buttons. You can define a main widget that contains your specific dialog layout

The class takes care of the geometry management. You only need to define a minimum size for the widget you want to use as the main widget.

By default, the dialog is non-modal.

Standard buttons (action buttons):
You select which buttons should be displayed, but you do not choose the order in which they are displayed. This ensures a standard interface in KDE. The button order can be changed, but this ability is only available for a central KDE control tool. The following buttons are available: OK, Cancel/Close, Apply/Try, Default, Help and three user definable buttons: User1, User2 and User3. You must specify the text of the UserN buttons. Each button Q_EMIT a signal, so you can choose to connect that signal.

The default action of the Help button will open the help system if you have provided a path to the help text. The default action of Ok and Cancel will run QDialog::accept() and QDialog::reject(), which you can override by reimplementing slotButtonClicked(). The default action of the Close button will close the dialog.

Note that the KoDialog will animate a button press when the user presses Escape. The button that is enabled is either Cancel, Close or the button that is defined by setEscapeButton(). Your custom dialog code should reimplement the keyPressEvent and animate the cancel button so that the dialog behaves like regular dialogs.

Layout:
The dialog consists of a help area on top (becomes visible if you define a help path and use enableLinkedHelp()), the main area which is the built-in dialog face or your own widget in the middle and by default a button box at the bottom. The button box can also be placed at the right edge (to the right of the main widget). Use setButtonsOrientation() to control this behavior. A separator can be placed above the button box (or to the left when the button box is at the right edge).

Standard compliance:
The marginHint() and spacingHint() sizes shall be used whenever you lay out the interior of a dialog. One special note. If you make your own action buttons (OK, Cancel etc), the space between the buttons shall be spacingHint(), whereas the space above, below, to the right and to the left shall be marginHint(). If you add a separator line above the buttons, there shall be a marginHint() between the buttons and the separator and a marginHint() above the separator as well.

Example:

KoDialog *dialog = new KoDialog( this );
dialog->setCaption( "My title" );
dialog->setButtons( KoDialog::Ok | KoDialog::Cancel | KoDialog::Apply );
FooWidget *widget = new FooWidget( dialog );
dialog->setMainWidget( widget );
connect( dialog, SIGNAL( applyClicked() ), widget, SLOT( save() ) );
connect( dialog, SIGNAL( okClicked() ), widget, SLOT( save() ) );
connect( widget, SIGNAL( changed( bool ) ), dialog, SLOT( enableButtonApply( bool ) ) );
dialog->enableButtonApply( false );
dialog->show();
A dialog base class with standard buttons and predefined layouts.
Definition KoDialog.h:116
void applyClicked()
void enableButtonApply(bool state)
Definition KoDialog.cpp:611
@ Ok
Show Ok button. (this button accept()s the dialog; result set to QDialog::Accepted)
Definition KoDialog.h:127
@ Apply
Show Apply button.
Definition KoDialog.h:128
@ Cancel
Show Cancel-button. (this button reject()s the dialog; result set to QDialog::Rejected)
Definition KoDialog.h:130
KoDialog(QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags())
Definition KoDialog.cpp:176
void okClicked()
KDE Dialog example

This class can be used in many ways. Note that most KDE ui widgets and many of KDE core applications use the KoDialog so for more inspiration you should study the code for these.

See also
KPageDialog
Author
Thomas Tanghus tangh.nosp@m.us@e.nosp@m.arthl.nosp@m.ing..nosp@m.net
Espen Sand espen.nosp@m.sa@o.nosp@m.nline.nosp@m..no
Mirko Boehm mirko.nosp@m.@kde.nosp@m..org
Olivier Goffart <ogoffart at kde.org>
Tobias Koenig tokoe.nosp@m.@kde.nosp@m..org

Definition at line 115 of file KoDialog.h.

Member Enumeration Documentation

◆ ButtonCode

Enumerator
None 
Help 

Show Help button. (this button will run the help set with setHelp)

Default 

Show Default button.

Ok 

Show Ok button. (this button accept()s the dialog; result set to QDialog::Accepted)

Apply 

Show Apply button.

Try 

Show Try button.

Cancel 

Show Cancel-button. (this button reject()s the dialog; result set to QDialog::Rejected)

Close 

Show Close-button. (this button closes the dialog)

No 

Show No button. (this button closes the dialog and sets the result to KoDialog::No)

Yes 

Show Yes button. (this button closes the dialog and sets the result to KoDialog::Yes)

Reset 

Show Reset button.

Details 

Show Details button. (this button will show the detail widget set with setDetailsWidget)

User1 

Show User defined button 1.

User2 

Show User defined button 2.

User3 

Show User defined button 3.

NoDefault 

Used when specifying a default button; indicates that no button should be marked by default.

Definition at line 123 of file KoDialog.h.

123 {
124 None = 0x00000000,
125 Help = 0x00000001,
126 Default = 0x00000002,
127 Ok = 0x00000004,
128 Apply = 0x00000008,
129 Try = 0x00000010,
130 Cancel = 0x00000020,
131 Close = 0x00000040,
132 No = 0x00000080,
133 Yes = 0x00000100,
134 Reset = 0x00000200,
135 Details = 0x00000400,
136 User1 = 0x00001000,
137 User2 = 0x00002000,
138 User3 = 0x00004000,
139 NoDefault = 0x00008000
140 };
@ User2
Show User defined button 2.
Definition KoDialog.h:137
@ No
Show No button. (this button closes the dialog and sets the result to KoDialog::No)
Definition KoDialog.h:132
@ Reset
Show Reset button.
Definition KoDialog.h:134
@ User3
Show User defined button 3.
Definition KoDialog.h:138
@ Yes
Show Yes button. (this button closes the dialog and sets the result to KoDialog::Yes)
Definition KoDialog.h:133
@ Default
Show Default button.
Definition KoDialog.h:126
@ NoDefault
Used when specifying a default button; indicates that no button should be marked by default.
Definition KoDialog.h:139
@ User1
Show User defined button 1.
Definition KoDialog.h:136
@ Details
Show Details button. (this button will show the detail widget set with setDetailsWidget)
Definition KoDialog.h:135
@ Help
Show Help button. (this button will run the help set with setHelp)
Definition KoDialog.h:125
@ Try
Show Try button.
Definition KoDialog.h:129
@ Close
Show Close-button. (this button closes the dialog)
Definition KoDialog.h:131

◆ ButtonPopupMode

Enumerator
InstantPopup 
DelayedPopup 

Definition at line 144 of file KoDialog.h.

144 {
145 InstantPopup = 0,
146 DelayedPopup = 1
147 };
@ InstantPopup
Definition KoDialog.h:145
@ DelayedPopup
Definition KoDialog.h:146

◆ CaptionFlag

Used to specify how to construct a window caption

Enumerator
NoCaptionFlags 
AppNameCaption 
ModifiedCaption 
HIGCompliantCaption 

Definition at line 398 of file KoDialog.h.

398 {
399 NoCaptionFlags = 0,
400 AppNameCaption = 1,
401 ModifiedCaption = 2,
403 };
@ ModifiedCaption
Definition KoDialog.h:401
@ AppNameCaption
Definition KoDialog.h:400
@ HIGCompliantCaption
Definition KoDialog.h:402
@ NoCaptionFlags
Definition KoDialog.h:399

Constructor & Destructor Documentation

◆ KoDialog() [1/2]

KoDialog::KoDialog ( QWidget * parent = 0,
Qt::WindowFlags f = Qt::WindowFlags() )
explicit

Creates a dialog.

Parameters
parentThe parent of the dialog.
flagsThe widget flags passed to the QDialog constructor

Definition at line 176 of file KoDialog.cpp.

177 : QDialog(parent ? parent : qApp->activeWindow(), flags)
179{
180 d_ptr->init(this);
181}
void init(KoDialog *)
Definition KoDialog.cpp:159
KoDialogPrivate *const d_ptr
Definition KoDialog.h:787

References d_ptr, and KoDialogPrivate::init().

◆ ~KoDialog()

KoDialog::~KoDialog ( )
override

Destroys the dialog.

Definition at line 190 of file KoDialog.cpp.

191{
192 delete d_ptr;
193}

References d_ptr.

◆ KoDialog() [2/2]

KoDialog::KoDialog ( KoDialogPrivate & dd,
QWidget * parent,
Qt::WindowFlags f = Qt::WindowFlags() )
private

Definition at line 183 of file KoDialog.cpp.

184 : QDialog(parent ? parent : qApp->activeWindow(), flags)
185 , d_ptr(&dd)
186{
187 d_ptr->init(this);
188}

References d_ptr, and KoDialogPrivate::init().

Member Function Documentation

◆ aboutToShowDetails

void KoDialog::aboutToShowDetails ( )
signal

The detailsWidget is about to get shown. This is your last chance to call setDetailsWidget if you haven't done so yet.

◆ applyClicked

void KoDialog::applyClicked ( )
signal

The Apply button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ button()

QPushButton * KoDialog::button ( ButtonCode id) const

Returns the button that corresponds to the id.

Normally you should not use this function. Never delete the object returned by this function. See also enableButton(), showButton(), setButtonGuiItem().

Parameters
idIdentifier of the button.
Returns
The button or 0 if the button does not exist.

Definition at line 582 of file KoDialog.cpp.

583{
584 Q_D(const KoDialog);
585 return d->mButtonList.value(id, 0);
586}

◆ buttonClicked

void KoDialog::buttonClicked ( KoDialog::ButtonCode button)
signal

A button has been pressed. This signal is only emitted if slotButtonClicked() is not replaced

Parameters
buttonis the code of the pressed button.

◆ buttonIcon()

QIcon KoDialog::buttonIcon ( ButtonCode id) const

Returns the icon of any button.

Definition at line 672 of file KoDialog.cpp.

673{
674 QPushButton *button = this->button(id);
675 if (button) {
676 return button->icon();
677 } else {
678 return QIcon();
679 }
680}
QPushButton * button(ButtonCode id) const
Definition KoDialog.cpp:582

References button().

◆ buttonText()

QString KoDialog::buttonText ( ButtonCode id) const

Returns the text of any button.

Definition at line 654 of file KoDialog.cpp.

655{
656 QPushButton *button = this->button(id);
657 if (button) {
658 return button->text();
659 } else {
660 return QString();
661 }
662}

References button().

◆ buttonToolTip()

QString KoDialog::buttonToolTip ( ButtonCode id) const

Returns the tooltip of any button.

Definition at line 694 of file KoDialog.cpp.

695{
696 QPushButton *button = this->button(id);
697 if (button) {
698 return button->toolTip();
699 } else {
700 return QString();
701 }
702}

References button().

◆ buttonWhatsThis()

QString KoDialog::buttonWhatsThis ( ButtonCode id) const

Returns the "What's this?" text of any button.

Definition at line 716 of file KoDialog.cpp.

717{
718 QPushButton *button = this->button(id);
719 if (button) {
720 return button->whatsThis();
721 } else {
722 return QString();
723 }
724}

References button().

◆ cancelClicked

void KoDialog::cancelClicked ( )
signal

The Cancel button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ closeClicked

void KoDialog::closeClicked ( )
signal

The Close button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ closeEvent()

void KoDialog::closeEvent ( QCloseEvent * e)
overrideprotected

Detects when a dialog is being closed from the window manager controls. If the Cancel or Close button is present then the button is activated. Otherwise standard QDialog behavior will take place.

Definition at line 934 of file KoDialog.cpp.

935{
936 Q_D(KoDialog);
937 QPushButton *button = this->button(d->mEscapeButton);
938 if (button && !isHidden()) {
939 button->animateClick();
940
941 if (testAttribute(Qt::WA_DeleteOnClose)) {
942 // Don't let QWidget::close do a deferred delete just yet, wait for the click first
943 d->mDeferredDelete = true;
944 setAttribute(Qt::WA_DeleteOnClose, false);
945 }
946 } else {
947 QDialog::closeEvent(event);
948 }
949}

References button().

◆ defaultButton()

KoDialog::ButtonCode KoDialog::defaultButton ( ) const

Returns the button code of the default button, or NoDefault if there is no default button.

Definition at line 331 of file KoDialog.cpp.

332{
333 Q_D(const KoDialog);
334 QHashIterator<int, QPushButton *> it(d->mButtonList);
335 while (it.hasNext()) {
336 it.next();
337 if (it.value()->isDefault()) {
338 return (ButtonCode)it.key();
339 }
340 }
341
342 return d->mDefaultButton;
343}

◆ defaultClicked

void KoDialog::defaultClicked ( )
signal

The Default button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ delayedDestruct

void KoDialog::delayedDestruct ( )
slot

Destruct the dialog delayed.

You can call this function from slots like closeClicked() and hidden(). You should not use the dialog any more after calling this function.

Deprecated
use hide()+deleteLater()

Definition at line 802 of file KoDialog.cpp.

803{
804 if (isVisible()) {
805 hide();
806 }
807
808 deleteLater();
809}

◆ enableButton

void KoDialog::enableButton ( ButtonCode id,
bool state )
slot

Enable or disable (gray out) a general action button.

Parameters
idButton identifier.
statetrue enables the button(s).

Definition at line 588 of file KoDialog.cpp.

589{
590 QPushButton *button = this->button(id);
591 if (button) {
592 button->setEnabled(state);
593 }
594}

References button().

◆ enableButtonApply

void KoDialog::enableButtonApply ( bool state)
slot

Enable or disable (gray out) the Apply button.

Parameters
statetrue enables the button.

Definition at line 611 of file KoDialog.cpp.

612{
613 enableButton(Apply, state);
614}
void enableButton(ButtonCode id, bool state)
Definition KoDialog.cpp:588

References Apply, and enableButton().

◆ enableButtonCancel

void KoDialog::enableButtonCancel ( bool state)
slot

Enable or disable (gray out) the Cancel button.

Parameters
statetrue enables the button.

Definition at line 616 of file KoDialog.cpp.

617{
618 enableButton(Cancel, state);
619}

References Cancel, and enableButton().

◆ enableButtonOk

void KoDialog::enableButtonOk ( bool state)
slot

Enable or disable (gray out) the OK button.

Parameters
statetrue enables the button.

Definition at line 606 of file KoDialog.cpp.

607{
608 enableButton(Ok, state);
609}

References enableButton(), and Ok.

◆ enableLinkedHelp

void KoDialog::enableLinkedHelp ( bool state)
slot

Display or hide the help link area on the top of the dialog.

Parameters
statetrue will display the area.
See also
helpLinkText()
setHelpLinkText()
setHelp()

Definition at line 876 of file KoDialog.cpp.

877{
878 Q_D(KoDialog);
879 if ((d->mUrlHelp != 0) == state) {
880 return;
881 }
882 if (state) {
883 if (d->mUrlHelp) {
884 return;
885 }
886
887 d->mUrlHelp = new KUrlLabel(this);
888 d->mUrlHelp->setText(helpLinkText());
889 d->mUrlHelp->setFloatEnabled(true);
890 d->mUrlHelp->setUnderline(true);
891 d->mUrlHelp->setMinimumHeight(fontMetrics().height() + marginHint());
892 connect(d->mUrlHelp, SIGNAL(leftClickedUrl()), SLOT(helpLinkClicked()));
893
894 d->mUrlHelp->show();
895 } else {
896 delete d->mUrlHelp;
897 d->mUrlHelp = 0;
898 }
899
900 d->setupLayout();
901}
static int marginHint()
Definition KoDialog.cpp:446
QString helpLinkText() const
Definition KoDialog.cpp:919

References helpLinkText(), and marginHint().

◆ finished

void KoDialog::finished ( )
signal

The dialog has finished.

A dialog emits finished after a user clicks a button that ends the dialog.

This signal is also emitted when you call hide()

If you have stored a pointer to the dialog do not try to delete the pointer in the slot that is connected to this signal.

You should use deleteLater() instead.

◆ groupSpacingHint()

int KoDialog::groupSpacingHint ( )
static

Returns the number of pixels that should be used to visually separate groups of related options in a dialog according to the KDE standard.

Since
4.2

Definition at line 456 of file KoDialog.cpp.

457{
458 return QFontMetricsF(QApplication::font()).lineSpacing();
459}

◆ helpClicked

void KoDialog::helpClicked ( )
signal

The Help button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ helpLinkText()

QString KoDialog::helpLinkText ( ) const

Returns the help link text.

If no text has been defined, "Get help..." (internationalized) is returned.

Returns
The help link text.
See also
enableLinkedHelp()
setHelpLinkText()
setHelp()

Definition at line 919 of file KoDialog.cpp.

920{
921 Q_D(const KoDialog);
922 return (d->mHelpLinkText.isEmpty() ? i18n("Get help...") : d->mHelpLinkText);
923}

◆ hidden

void KoDialog::hidden ( )
signal

The dialog is about to be hidden.

A dialog is hidden after a user clicks a button that ends the dialog or when the user switches to another desktop or minimizes the dialog.

◆ hideEvent()

void KoDialog::hideEvent ( QHideEvent * event)
overrideprotected

Emits the hidden signal. You can connect to that signal to detect when a dialog has been closed.

Definition at line 925 of file KoDialog.cpp.

926{
927 Q_EMIT hidden();
928
929 if (!event->spontaneous()) {
930 Q_EMIT finished();
931 }
932}
void finished()
void hidden()

References finished(), and hidden().

◆ incrementInitialSize()

void KoDialog::incrementInitialSize ( const QSize & size)

Convenience method. Add a size to the default minimum size of a dialog.

This method should only be called right before show() or exec().

Parameters
sizeSize added to minimum size.

Definition at line 576 of file KoDialog.cpp.

577{
578 d_func()->mIncSize = size;
579 adjustSize();
580}
int size(const Forest< T > &forest)
Definition KisForest.h:1232

◆ isButtonEnabled()

bool KoDialog::isButtonEnabled ( ButtonCode id) const

Returns whether any button is enabled.

Definition at line 596 of file KoDialog.cpp.

597{
598 QPushButton *button = this->button(id);
599 if (button) {
600 return button->isEnabled();
601 }
602
603 return false;
604}

References button().

◆ isDetailsWidgetVisible

bool KoDialog::isDetailsWidgetVisible ( ) const
slot

Returns the status of the Details button.

Definition at line 755 of file KoDialog.cpp.

756{
757 return d_func()->mDetailsVisible;
758}

◆ keyPressEvent()

void KoDialog::keyPressEvent ( QKeyEvent * event)
overrideprotected

Definition at line 395 of file KoDialog.cpp.

396{
397 Q_D(KoDialog);
398 if (event->modifiers() == 0) {
399 if (event->key() == Qt::Key_F1) {
400 QPushButton *button = this->button(Help);
401
402 if (button) {
403 button->animateClick();
404 event->accept();
405 return;
406 }
407 }
408
409 if (event->key() == Qt::Key_Escape) {
410 QPushButton *button = this->button(d->mEscapeButton);
411
412 if (button) {
413 button->animateClick();
414 event->accept();
415 return;
416 }
417
418 }
419 } else if (event->key() == Qt::Key_F1 && event->modifiers() == Qt::ShiftModifier) {
420 QWhatsThis::enterWhatsThisMode();
421 event->accept();
422 return;
423 } else if (event->modifiers() == Qt::ControlModifier &&
424 (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)) {
425 // accept the dialog when Ctrl-Return is pressed
426 QPushButton *button = this->button(Ok);
427
428 if (button) {
429 button->animateClick();
430 event->accept();
431 return;
432 }
433 }
434
435 QDialog::keyPressEvent(event);
436}

References button(), Help, and Ok.

◆ layoutHintChanged

void KoDialog::layoutHintChanged ( )
signal

Emitted when the margin size and/or spacing size have changed.

Use marginHint() and spacingHint() in your slot to get the new values.

Deprecated
This signal is not emitted. Listen to QEvent::StyleChange events instead.

◆ mainWidget()

QWidget * KoDialog::mainWidget ( )
Returns
The current main widget. Will create a QWidget as the mainWidget if none was set before. This way you can write
ui.setupUi(mainWidget());
QWidget * mainWidget()
Definition KoDialog.cpp:359
when using designer.

Definition at line 359 of file KoDialog.cpp.

360{
361 Q_D(KoDialog);
362 if (!d->mMainWidget) {
363 setMainWidget(new QWidget(this));
364 }
365 return d->mMainWidget;
366}
void setMainWidget(QWidget *widget)
Definition KoDialog.cpp:345

References setMainWidget().

◆ makeStandardCaption()

QString KoDialog::makeStandardCaption ( const QString & userCaption,
QWidget * window = 0,
CaptionFlags flags = HIGCompliantCaption )
static

Builds a caption that contains the application name along with the userCaption using a standard layout.

To make a compliant caption for your window, simply do: setWindowTitle(KoDialog::makeStandardCaption(yourCaption));

To ensure that the caption is appropriate to the desktop in which the application is running, pass in a pointer to the window the caption will be applied to.

If using a KoDialog or KisKMainWindow subclass, call setCaption instead and an appropriate standard caption will be created for you

Parameters
userCaptionThe caption string you want to display in the window caption area. Do not include the application name!
windowa pointer to the window this application will apply to
flags
Returns
the created caption

Definition at line 461 of file KoDialog.cpp.

464{
465 Q_UNUSED(window);
466 QString caption = qApp->applicationDisplayName();
467 QString captionString = userCaption.isEmpty() ? caption : userCaption;
468
469 // If the document is modified, add '[modified]'.
470 if (flags & ModifiedCaption) {
471 captionString += QString::fromUtf8(" [") + i18n("modified") + QString::fromUtf8("]");
472 }
473
474 if (!userCaption.isEmpty()) {
475 // Add the application name if:
476 // User asked for it, it's not a duplication and the app name (caption()) is not empty
477 if (flags & AppNameCaption &&
478 !caption.isEmpty() &&
479 !userCaption.endsWith(caption)) {
480 // TODO: check to see if this is a transient/secondary window before trying to add the app name
481 // on platforms that need this
482 captionString += i18nc("Document/application separator in titlebar", " – ") + caption;
483 }
484 }
485
486 return captionString;
487}

References AppNameCaption, and ModifiedCaption.

◆ marginHint()

int KoDialog::marginHint ( )
static

Returns the number of pixels that should be used between a dialog edge and the outermost widget(s) according to the KDE standard.

Deprecated
Use the style's pixelMetric() function to query individual margins. Different platforms may use different values for the four margins.

Definition at line 446 of file KoDialog.cpp.

447{
448 return QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
449}

◆ minimumSizeHint()

QSize KoDialog::minimumSizeHint ( ) const
override

Reimplemented from QDialog.

Definition at line 382 of file KoDialog.cpp.

383{
384 Q_D(const KoDialog);
385
386 if (d->dirty) {
387 const_cast<KoDialogPrivate *>(d)->queuedLayoutUpdate();
388 }
389 return QDialog::minimumSizeHint() + d->mIncSize;
390}

◆ noClicked

void KoDialog::noClicked ( )
signal

The No button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ okClicked

void KoDialog::okClicked ( )
signal

The OK button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ resetClicked

void KoDialog::resetClicked ( )
signal

The Reset button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ resizeLayout() [1/2]

void KoDialog::resizeLayout ( QLayout * lay,
int margin,
int spacing )
static

Resize every layout associated with lay and its children.

Parameters
laylayout to be resized
marginThe new layout margin
spacingThe new layout spacing
Deprecated
Use QLayout functions where necessary. Setting margin and spacing values recursively for all children prevents QLayout from creating platform native layouts.

Definition at line 530 of file KoDialog.cpp.

531{
532 QLayoutItem *child;
533 int pos = 0;
534
535 while ((child = layout->itemAt(pos))) {
536 if (child->layout()) {
537 resizeLayout(child->layout(), margin, spacing);
538 }
539
540 ++pos;
541 }
542
543 if (layout->layout()) {
544 layout->layout()->setContentsMargins(margin, margin, margin, margin);
545 layout->layout()->setSpacing(spacing);
546 }
547}
static void resizeLayout(QWidget *widget, int margin, int spacing)
Definition KoDialog.cpp:514

References resizeLayout().

◆ resizeLayout() [2/2]

void KoDialog::resizeLayout ( QWidget * widget,
int margin,
int spacing )
static

Resize every layout manager used in widget and its nested children.

Parameters
widgetThe widget used.
marginThe new layout margin.
spacingThe new layout spacing.
Deprecated
Use QLayout functions where necessary. Setting margin and spacing values recursively for all children prevents QLayout from creating platform native layouts.

Definition at line 514 of file KoDialog.cpp.

515{
516 if (widget->layout()) {
517 resizeLayout(widget->layout(), margin, spacing);
518 }
519
520 if (widget->children().count() > 0) {
521 const QList<QObject *> list = widget->children();
522 foreach (QObject *object, list) {
523 if (object->isWidgetType()) {
524 resizeLayout((QWidget *)object, margin, spacing);
525 }
526 }
527 }
528}

References resizeLayout().

◆ setButtonFocus()

void KoDialog::setButtonFocus ( ButtonCode id)

Sets the focus to the button of the passed id.

Definition at line 726 of file KoDialog.cpp.

727{
728 QPushButton *button = this->button(id);
729 if (button) {
730 button->setFocus();
731 }
732}

References button().

◆ setButtonGuiItem()

void KoDialog::setButtonGuiItem ( ButtonCode id,
const KGuiItem & item )

Sets the KGuiItem directly for the button instead of using 3 methods to set the text, tooltip and whatsthis strings. This also allows to set an icon for the button which is otherwise not possible for the extra buttons beside Ok, Cancel and Apply.

Parameters
idThe button identifier.
itemThe KGuiItem for the button.

Definition at line 629 of file KoDialog.cpp.

630{
631 QPushButton *button = this->button(id);
632 if (!button) {
633 return;
634 }
635
636 KGuiItem::assign(button, item);
637}

References button().

◆ setButtonIcon()

void KoDialog::setButtonIcon ( ButtonCode id,
const QIcon & icon )

Sets the icon of any button.

Parameters
idThe button identifier.
iconButton icon.

Definition at line 664 of file KoDialog.cpp.

665{
666 QPushButton *button = this->button(id);
667 if (button) {
668 button->setIcon(icon);
669 }
670}

References button().

◆ setButtons()

void KoDialog::setButtons ( ButtonCodes buttonMask)

Creates (or recreates) the button box and all the buttons in it.

Note that some combinations are not possible. That means, you can't have the following pairs of buttons in a dialog:

  • Default and Details
  • Cancel and Close
  • Ok and Try

This will reset all default KGuiItem of all button.

Parameters
buttonMaskSpecifies what buttons will be made.
Deprecated
Since 5.0 use QDialogButtonBox

Definition at line 195 of file KoDialog.cpp.

196{
197 Q_D(KoDialog);
198 if (d->mButtonBox) {
199 d->mButtonList.clear();
200
201 delete d->mButtonBox;
202 d->mButtonBox = 0;
203 }
204
205 if (buttonMask & Cancel) {
206 buttonMask &= ~Close;
207 }
208
209 if (buttonMask & Apply) {
210 buttonMask &= ~Try;
211 }
212
213 if (buttonMask & Details) {
214 buttonMask &= ~Default;
215 }
216
217 if (buttonMask == None) {
218 d->setupLayout();
219 return; // When we want no button box
220 }
221
222 d->mEscapeButton = (buttonMask & Cancel) ? Cancel : Close;
223 d->mButtonBox = new QDialogButtonBox(this);
224
225 if (buttonMask & Help) {
226 d->appendButton(Help, KStandardGuiItem::help());
227 }
228 if (buttonMask & Default) {
229 d->appendButton(Default, KStandardGuiItem::defaults());
230 }
231 if (buttonMask & Reset) {
232 d->appendButton(Reset, KStandardGuiItem::reset());
233 }
234 if (buttonMask & User3) {
235 d->appendButton(User3, KGuiItem());
236 }
237 if (buttonMask & User2) {
238 d->appendButton(User2, KGuiItem());
239 }
240 if (buttonMask & User1) {
241 d->appendButton(User1, KGuiItem());
242 }
243 if (buttonMask & Ok) {
244 d->appendButton(Ok, KStandardGuiItem::ok());
245 }
246 if (buttonMask & Apply) {
247 d->appendButton(Apply, KStandardGuiItem::apply());
248 }
249 if (buttonMask & Try) {
250 d->appendButton(Try, KGuiItem(i18n("&Try")));
251 }
252 if (buttonMask & Cancel) {
253 d->appendButton(Cancel, KStandardGuiItem::cancel());
254 }
255 if (buttonMask & Close) {
256 d->appendButton(Close, KStandardGuiItem::close());
257 }
258 if (buttonMask & Yes) {
259 d->appendButton(Yes, KStandardGuiItem::apply());
260 }
261 if (buttonMask & No) {
262 d->appendButton(No, KStandardGuiItem::cancel());
263 }
264 if (buttonMask & Details) {
265 d->appendButton(Details, KGuiItem(QString(), "help-about"));
267 }
268
269 d->setupLayout();
270}
void setDetailsWidgetVisible(bool visible)
Definition KoDialog.cpp:760

References Apply, Cancel, Close, Default, Details, Help, No, None, Ok, Reset, setDetailsWidgetVisible(), Try, User1, User2, User3, and Yes.

◆ setButtonsOrientation()

void KoDialog::setButtonsOrientation ( Qt::Orientation orientation)

Sets the orientation of the button box.

It can be Vertical or Horizontal. If Horizontal (default), the button box is positioned at the bottom of the dialog. If Vertical it will be placed at the right edge of the dialog.

Parameters
orientationThe button box orientation.

Definition at line 272 of file KoDialog.cpp.

273{
274 Q_D(KoDialog);
275 if (d->mButtonOrientation != orientation) {
276 d->mButtonOrientation = orientation;
277
278 if (d->mActionSeparator) {
279 d->mActionSeparator->setOrientation(d->mButtonOrientation);
280 }
281
282 if (d->mButtonOrientation == Qt::Vertical) {
283 enableLinkedHelp(false); // 2000-06-18 Espen: No support for this yet.
284 }
285 }
286}
void enableLinkedHelp(bool state)
Definition KoDialog.cpp:876

References enableLinkedHelp().

◆ setButtonText()

void KoDialog::setButtonText ( ButtonCode id,
const QString & text )

Sets the text of any button.

Parameters
idThe button identifier.
textButton text.

Definition at line 639 of file KoDialog.cpp.

640{
641 Q_D(KoDialog);
642 if (!d->mSettingDetails && (id == Details)) {
643 d->mDetailsButtonText = text;
644 setDetailsWidgetVisible(d->mDetailsVisible);
645 return;
646 }
647
648 QPushButton *button = this->button(id);
649 if (button) {
650 button->setText(text);
651 }
652}

References button(), Details, and setDetailsWidgetVisible().

◆ setButtonToolTip()

void KoDialog::setButtonToolTip ( ButtonCode id,
const QString & text )

Sets the tooltip text of any button.

Parameters
idThe button identifier.
textButton text.

Definition at line 682 of file KoDialog.cpp.

683{
684 QPushButton *button = this->button(id);
685 if (button) {
686 if (text.isEmpty()) {
687 button->setToolTip(QString());
688 } else {
689 button->setToolTip(text);
690 }
691 }
692}

References button().

◆ setButtonWhatsThis()

void KoDialog::setButtonWhatsThis ( ButtonCode id,
const QString & text )

Sets the "What's this?" text of any button.

Parameters
idThe button identifier.
textButton text.

Definition at line 704 of file KoDialog.cpp.

705{
706 QPushButton *button = this->button(id);
707 if (button) {
708 if (text.isEmpty()) {
709 button->setWhatsThis(QString());
710 } else {
711 button->setWhatsThis(text);
712 }
713 }
714}

References button().

◆ setCaption [1/2]

void KoDialog::setCaption ( const QString & caption)
virtualslot

Make a KDE compliant caption.

Parameters
captionYour caption. Do not include the application name in this string. It will be added automatically according to the KDE standard.
Deprecated
Since 5.0 use QWidget::setWindowTitle

Definition at line 489 of file KoDialog.cpp.

490{
491 const QString caption = makeStandardCaption(_caption, this);
492 setPlainCaption(caption);
493}
static QString makeStandardCaption(const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption)
Definition KoDialog.cpp:461
virtual void setPlainCaption(const QString &caption)
Definition KoDialog.cpp:507

References makeStandardCaption(), and setPlainCaption().

◆ setCaption [2/2]

void KoDialog::setCaption ( const QString & caption,
bool modified )
virtualslot

Makes a KDE compliant caption.

Parameters
captionYour caption. Do not include the application name in this string. It will be added automatically according to the KDE standard.
modifiedSpecify whether the document is modified. This displays an additional sign in the title bar, usually "**".
Deprecated
Since 5.0 use QWidget::setWindowTitle and QWidget::setWindowModified.

Definition at line 495 of file KoDialog.cpp.

496{
497 CaptionFlags flags = HIGCompliantCaption;
498
499 // ### Qt5 TODO: port to [*], see QWidget::setWindowFilePath
500 if (modified) {
501 flags |= ModifiedCaption;
502 }
503
504 setPlainCaption(makeStandardCaption(caption, this, flags));
505}

References HIGCompliantCaption, makeStandardCaption(), ModifiedCaption, and setPlainCaption().

◆ setDefaultButton()

void KoDialog::setDefaultButton ( ButtonCode id)

Sets the button that will be activated when the Enter key is pressed.

By default, this is the Ok button if it is present

Parameters
idThe button code.

Definition at line 293 of file KoDialog.cpp.

294{
295 Q_D(KoDialog);
296
297 if (newDefaultButton == None) {
298 newDefaultButton = NoDefault; // #148969
299 }
300
301 const KoDialog::ButtonCode oldDefault = defaultButton();
302
303 bool oldDefaultHadFocus = false;
304
305 if (oldDefault != NoDefault) {
306 QPushButton *old = button(oldDefault);
307 if (old) {
308 oldDefaultHadFocus = (focusWidget() == old);
309 old->setDefault(false);
310 }
311 }
312
313 if (newDefaultButton != NoDefault) {
314 QPushButton *b = button(newDefaultButton);
315 if (b) {
316 b->setDefault(true);
317 if (focusWidget() == 0 || oldDefaultHadFocus) {
318 // No widget had focus yet, or the old default button had
319 // -> ok to give focus to the new default button, so that it's
320 // really default (Enter triggers it).
321 // But we don't do this if the kdialog user gave focus to a
322 // specific widget in the dialog.
323 b->setFocus();
324 }
325 }
326 }
327 d->mDefaultButton = newDefaultButton;
328 Q_ASSERT(defaultButton() == newDefaultButton);
329}
ButtonCode defaultButton() const
Definition KoDialog.cpp:331

References button(), defaultButton(), NoDefault, and None.

◆ setDetailsWidget

void KoDialog::setDetailsWidget ( QWidget * detailsWidget)
slot

Sets the widget that gets shown when "Details" is enabled.

The dialog takes over ownership of the widget. Any previously set widget gets deleted.

Definition at line 734 of file KoDialog.cpp.

735{
736 Q_D(KoDialog);
737 if (d->mDetailsWidget == detailsWidget) {
738 return;
739 }
740 delete d->mDetailsWidget;
741 d->mDetailsWidget = detailsWidget;
742
743 if (d->mDetailsWidget->parentWidget() != this) {
744 d->mDetailsWidget->setParent(this);
745 }
746
747 d->mDetailsWidget->hide();
748 d->setupLayout();
749
750 if (!d->mSettingDetails) {
751 setDetailsWidgetVisible(d->mDetailsVisible);
752 }
753}

References setDetailsWidgetVisible().

◆ setDetailsWidgetVisible

void KoDialog::setDetailsWidgetVisible ( bool visible)
slot

Sets the status of the Details button.

Definition at line 760 of file KoDialog.cpp.

761{
762 Q_D(KoDialog);
763 if (d->mDetailsButtonText.isEmpty()) {
764 d->mDetailsButtonText = i18n("&Details");
765 }
766
767 d->mSettingDetails = true;
768 d->mDetailsVisible = visible;
769 if (d->mDetailsVisible) {
770 Q_EMIT aboutToShowDetails();
771 setButtonText(Details, d->mDetailsButtonText + " <<");
772 if (d->mDetailsWidget) {
773 if (layout()) {
774 layout()->setEnabled(false);
775 }
776
777 d->mDetailsWidget->show();
778
779 adjustSize();
780
781 if (layout()) {
782 layout()->activate();
783 layout()->setEnabled(true);
784 }
785 }
786 } else {
787 setButtonText(Details, d->mDetailsButtonText + " >>");
788 if (d->mDetailsWidget) {
789 d->mDetailsWidget->hide();
790 }
791
792 if (layout()) {
793 layout()->activate();
794 adjustSize();
795 }
796
797 }
798
799 d->mSettingDetails = false;
800}
void aboutToShowDetails()
void setButtonText(ButtonCode id, const QString &text)
Definition KoDialog.cpp:639

References aboutToShowDetails(), Details, and setButtonText().

◆ setEscapeButton()

void KoDialog::setEscapeButton ( ButtonCode id)

Sets the button that will be activated when the Escape key is pressed.

By default, the Escape key is mapped to either the Cancel or the Close button if one of these buttons are defined. The user expects that Escape will cancel an operation so use this function with caution.

Parameters
idThe button code.

Definition at line 288 of file KoDialog.cpp.

289{
290 d_func()->mEscapeButton = id;
291}

◆ setHelp

void KoDialog::setHelp ( const QString & anchor,
const QString & appname = QString() )
slot

Sets the help path and topic.

Parameters
anchorDefined anchor in your docbook sources
appnameDefines the appname the help belongs to If empty it's the current one
Note
The help button works differently for the class KCMultiDialog, so it does not make sense to call this function for Dialogs of that type. See KCMultiDialog::slotHelp() for more information.

Definition at line 903 of file KoDialog.cpp.

904{
905 Q_D(KoDialog);
906 d->mAnchor = anchor;
907 d->mHelpApp = appname;
908}

◆ setHelpLinkText

void KoDialog::setHelpLinkText ( const QString & text)
slot

Sets the text that is shown as the linked text.

If text is empty, the text "Get help..." (internationalized) is used instead.

Parameters
textThe link text.
See also
helpLinkText()
enableLinkedHelp()
setHelp()

Definition at line 910 of file KoDialog.cpp.

911{
912 Q_D(KoDialog);
913 d->mHelpLinkText = text;
914 if (d->mUrlHelp) {
915 d->mUrlHelp->setText(helpLinkText());
916 }
917}

References helpLinkText().

◆ setInitialSize()

void KoDialog::setInitialSize ( const QSize & size)

Convenience method. Sets the initial dialog size.

This method should only be called right before show() or exec(). The initial size will be ignored if smaller than the dialog's minimum size.

Parameters
sizeStartup size.

Definition at line 570 of file KoDialog.cpp.

571{
572 d_func()->mMinSize = size;
573 adjustSize();
574}

◆ setMainWidget()

void KoDialog::setMainWidget ( QWidget * widget)

Sets the main widget of the dialog.

Definition at line 345 of file KoDialog.cpp.

346{
347 Q_D(KoDialog);
348 if (d->mMainWidget == widget) {
349 return;
350 }
351 d->mMainWidget = widget;
352 if (d->mMainWidget && d->mMainWidget->layout()) {
353 // Avoid double-margin problem
354 d->mMainWidget->layout()->setContentsMargins(0, 0, 0, 0);
355 }
356 d->setupLayout();
357}

◆ setPlainCaption

void KoDialog::setPlainCaption ( const QString & caption)
virtualslot

Make a plain caption without any modifications.

Parameters
captionYour caption. This is the string that will be displayed in the window title.

Definition at line 507 of file KoDialog.cpp.

508{
509 if (QWidget *win = window()) {
510 win->setWindowTitle(caption);
511 }
512}

◆ showButton()

void KoDialog::showButton ( ButtonCode id,
bool state )

Hide or display a general action button.

Only buttons that have been created in the constructor can be displayed. This method will not create a new button.

Parameters
idButton identifier.
statetrue display the button(s).

Definition at line 621 of file KoDialog.cpp.

622{
623 QPushButton *button = this->button(id);
624 if (button) {
625 state ? button->show() : button->hide();
626 }
627}

References button().

◆ showButtonSeparator()

void KoDialog::showButtonSeparator ( bool state)

Hide or display the a separator line drawn between the action buttons an the main widget.

Definition at line 549 of file KoDialog.cpp.

550{
551 Q_D(KoDialog);
552 if ((d->mActionSeparator != 0) == state) {
553 return;
554 }
555 if (state) {
556 if (d->mActionSeparator) {
557 return;
558 }
559
560 d->mActionSeparator = new KSeparator(this);
561 d->mActionSeparator->setOrientation(d->mButtonOrientation);
562 } else {
563 delete d->mActionSeparator;
564 d->mActionSeparator = 0;
565 }
566
567 d->setupLayout();
568}

◆ showEvent()

void KoDialog::showEvent ( QShowEvent * e)
overrideprotected

Definition at line 438 of file KoDialog.cpp.

439{
440 QDialog::showEvent(e);
441 QTimer::singleShot(5, Qt::CoarseTimer, [&]() {
442 adjustPosition(parentWidget());
443 });
444}

◆ sizeHint()

QSize KoDialog::sizeHint ( ) const
override

Reimplemented from QDialog.

Definition at line 368 of file KoDialog.cpp.

369{
370 Q_D(const KoDialog);
371
372 if (!d->mMinSize.isEmpty()) {
373 return d->mMinSize.expandedTo(minimumSizeHint()) + d->mIncSize;
374 } else {
375 if (d->dirty) {
376 const_cast<KoDialogPrivate *>(d)->queuedLayoutUpdate();
377 }
378 return QDialog::sizeHint() + d->mIncSize;
379 }
380}
QSize minimumSizeHint() const override
Definition KoDialog.cpp:382

References minimumSizeHint().

◆ slotButtonClicked

void KoDialog::slotButtonClicked ( int button)
protectedvirtualslot

Activated when the button button is clicked

Sample that shows how to catch and handle button clicks within an own dialog;

class MyDialog : public KoDialog {
protected Q_SLOTS:
virtual void slotButtonClicked(int button) {
accept();
else
}
}
virtual void slotButtonClicked(int button)
Definition KoDialog.cpp:811
QString button(const QWheelEvent &ev)
Parameters
buttonis the type KoDialog::ButtonCode
Deprecated
since 5.0 use QDialogButtonBox and connect to the clicked signal

Definition at line 811 of file KoDialog.cpp.

812{
813 Q_D(KoDialog);
814 Q_EMIT buttonClicked(static_cast<KoDialog::ButtonCode>(button));
815
816 switch (button) {
817 case Ok:
818 Q_EMIT okClicked();
819 accept();
820 break;
821 case Apply:
822 Q_EMIT applyClicked();
823 break;
824 case Try:
825 Q_EMIT tryClicked();
826 break;
827 case User3:
828 Q_EMIT user3Clicked();
829 break;
830 case User2:
831 Q_EMIT user2Clicked();
832 break;
833 case User1:
834 Q_EMIT user1Clicked();
835 break;
836 case Yes:
837 Q_EMIT yesClicked();
838 done(Yes);
839 break;
840 case No:
841 Q_EMIT noClicked();
842 done(No);
843 break;
844 case Cancel:
845 Q_EMIT cancelClicked();
846 reject();
847 break;
848 case Close:
849 Q_EMIT closeClicked();
850 done(Close); // KDE5: call reject() instead; more QDialog-like.
851 break;
852 case Help:
853 Q_EMIT helpClicked();
854 if (!d->mAnchor.isEmpty() || !d->mHelpApp.isEmpty()) {
855 KHelpClient::invokeHelp(d->mAnchor, d->mHelpApp);
856 }
857 break;
858 case Default:
859 Q_EMIT defaultClicked();
860 break;
861 case Reset:
862 Q_EMIT resetClicked();
863 break;
864 case Details:
865 setDetailsWidgetVisible(!d->mDetailsVisible);
866 break;
867 }
868
869 // If we're here from the closeEvent, and auto-delete is on, well, auto-delete now.
870 if (d->mDeferredDelete) {
871 d->mDeferredDelete = false;
873 }
874}
void user1Clicked()
void user3Clicked()
void tryClicked()
void resetClicked()
void delayedDestruct()
Definition KoDialog.cpp:802
void yesClicked()
void defaultClicked()
void helpClicked()
void buttonClicked(KoDialog::ButtonCode button)
void user2Clicked()
void noClicked()
void cancelClicked()
void closeClicked()
KRITAWIDGETUTILS_EXPORT void invokeHelp(const QString &anchor=QString(), const QString &appname=QString())

References Apply, applyClicked(), button(), buttonClicked(), Cancel, cancelClicked(), Close, closeClicked(), Default, defaultClicked(), delayedDestruct(), Details, Help, helpClicked(), KHelpClient::invokeHelp(), No, noClicked(), Ok, okClicked(), Reset, resetClicked(), setDetailsWidgetVisible(), Try, tryClicked(), User1, user1Clicked(), User2, user2Clicked(), User3, user3Clicked(), Yes, and yesClicked().

◆ spacingHint()

int KoDialog::spacingHint ( )
static

Returns the number of pixels that should be used between widgets inside a dialog according to the KDE standard.

Deprecated
Use the style's layoutSpacing() function to query individual spacings. Different platforms may use different values depending on widget types and pairs.

Definition at line 451 of file KoDialog.cpp.

452{
453 return QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
454}

◆ tryClicked

void KoDialog::tryClicked ( )
signal

The Try button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ user1Clicked

void KoDialog::user1Clicked ( )
signal

The User1 button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ user2Clicked

void KoDialog::user2Clicked ( )
signal

The User2 button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ user3Clicked

void KoDialog::user3Clicked ( )
signal

The User3 button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

◆ yesClicked

void KoDialog::yesClicked ( )
signal

The Yes button was pressed. This signal is only emitted if slotButtonClicked() is not replaced

Member Data Documentation

◆ d_ptr

KoDialogPrivate* const KoDialog::d_ptr
private

Definition at line 787 of file KoDialog.h.


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