KCodecAction

Search for usage in LXR

#include <KCodecAction>

Inheritance diagram for KCodecAction:

Properties

int codecMib
 
QString codecName
 
- Properties inherited from QAction
 autoRepeat
 
 checkable
 
 checked
 
 enabled
 
 font
 
 icon
 
 iconText
 
 iconVisibleInMenu
 
 menuRole
 
 priority
 
 shortcut
 
 shortcutContext
 
 shortcutVisibleInContextMenu
 
 statusTip
 
 text
 
 toolTip
 
 visible
 
 whatsThis
 
- Properties inherited from QObject
 objectName
 

Signals

void codecTriggered (QTextCodec *codec)
 
void defaultItemTriggered ()
 
void encodingProberTriggered (KEncodingProber::ProberType)
 
void triggered (const QString &text)
 
void triggered (int index)
 
void triggered (KEncodingProber::ProberType)
 
void triggered (QAction *action)
 
void triggered (QTextCodec *codec)
 
- Signals inherited from KSelectAction
void indexTriggered (int index)
 
void textTriggered (const QString &text)
 
void triggered (const QString &text)
 
void triggered (int index)
 
void triggered (QAction *action)
 

Public Member Functions

 KCodecAction (const QIcon &icon, const QString &text, QObject *parent, bool showAutoOptions=false)
 
 KCodecAction (const QString &text, QObject *parent, bool showAutoOptions=false)
 
 KCodecAction (QObject *parent, bool showAutoOptions=false)
 
QTextCodeccodecForMib (int mib) const
 
QTextCodeccurrentCodec () const
 
int currentCodecMib () const
 
QString currentCodecName () const
 
KEncodingProber::ProberType currentProberType () const
 
int mibForName (const QString &codecName, bool *ok=nullptr) const
 
bool setCurrentCodec (const QString &codecName)
 
bool setCurrentCodec (int mib)
 
bool setCurrentCodec (QTextCodec *codec)
 
bool setCurrentProberType (KEncodingProber::ProberType)
 
- Public Member Functions inherited from KSelectAction
 KSelectAction (const QIcon &icon, const QString &text, QObject *parent)
 
 KSelectAction (const QString &text, QObject *parent)
 
 KSelectAction (QObject *parent)
 
QActionaction (const QString &text, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
 
QActionaction (int index) const
 
QList< QAction * > actions () const
 
QActionaddAction (const QIcon &icon, const QString &text)
 
QActionaddAction (const QString &text)
 
void addAction (QAction *action)
 
void changeItem (int index, const QString &text)
 
void clear ()
 
int comboWidth () const
 
QActioncurrentAction () const
 
int currentItem () const
 
QString currentText () const
 
virtual void insertAction (QAction *before, QAction *action)
 
bool isEditable () const
 
QStringList items () const
 
bool menuAccelsEnabled () const
 
virtual QActionremoveAction (QAction *action)
 
void removeAllActions ()
 
QActionGroupselectableActionGroup () const
 
void setComboWidth (int width)
 
bool setCurrentAction (const QString &text, Qt::CaseSensitivity cs=Qt::CaseSensitive)
 
bool setCurrentAction (QAction *action)
 
bool setCurrentItem (int index)
 
void setEditable (bool)
 
void setItems (const QStringList &lst)
 
void setMaxComboViewCount (int n)
 
void setMenuAccelsEnabled (bool b)
 
void setToolBarMode (ToolBarMode mode)
 
void setToolButtonPopupMode (QToolButton::ToolButtonPopupMode mode)
 
ToolBarMode toolBarMode () const
 
QToolButton::ToolButtonPopupMode toolButtonPopupMode () const
 
- Public Member Functions inherited from QWidgetAction
 QWidgetAction (QObject *parent)
 
QWidgetdefaultWidget () const const
 
void releaseWidget (QWidget *widget)
 
QWidgetrequestWidget (QWidget *parent)
 
void setDefaultWidget (QWidget *widget)
 
- Public Member Functions inherited from QAction
 QAction (const QIcon &icon, const QString &text, QObject *parent)
 
 QAction (const QString &text, QObject *parent)
 
 QAction (QObject *parent)
 
QActionGroupactionGroup () const const
 
void activate (QAction::ActionEvent event)
 
QList< QGraphicsWidget * > associatedGraphicsWidgets () const const
 
QList< QWidget * > associatedWidgets () const const
 
bool autoRepeat () const const
 
void changed ()
 
QVariant data () const const
 
QFont font () const const
 
void hover ()
 
void hovered ()
 
QIcon icon () const const
 
QString iconText () const const
 
bool isCheckable () const const
 
bool isChecked () const const
 
bool isEnabled () const const
 
bool isIconVisibleInMenu () const const
 
bool isSeparator () const const
 
bool isShortcutVisibleInContextMenu () const const
 
bool isVisible () const const
 
QMenumenu () const const
 
QAction::MenuRole menuRole () const const
 
QWidgetparentWidget () const const
 
QAction::Priority priority () const const
 
void setActionGroup (QActionGroup *group)
 
void setAutoRepeat (bool)
 
void setCheckable (bool)
 
void setChecked (bool)
 
void setData (const QVariant &userData)
 
void setDisabled (bool b)
 
void setEnabled (bool)
 
void setFont (const QFont &font)
 
void setIcon (const QIcon &icon)
 
void setIconText (const QString &text)
 
void setIconVisibleInMenu (bool visible)
 
void setMenu (QMenu *menu)
 
void setMenuRole (QAction::MenuRole menuRole)
 
void setPriority (QAction::Priority priority)
 
void setSeparator (bool b)
 
void setShortcut (const QKeySequence &shortcut)
 
void setShortcutContext (Qt::ShortcutContext context)
 
void setShortcuts (const QList< QKeySequence > &shortcuts)
 
void setShortcuts (QKeySequence::StandardKey key)
 
void setShortcutVisibleInContextMenu (bool show)
 
void setStatusTip (const QString &statusTip)
 
void setText (const QString &text)
 
void setToolTip (const QString &tip)
 
void setVisible (bool)
 
void setWhatsThis (const QString &what)
 
QKeySequence shortcut () const const
 
Qt::ShortcutContext shortcutContext () const const
 
QList< QKeySequenceshortcuts () const const
 
bool showStatusText (QWidget *widget)
 
QString statusTip () const const
 
QString text () const const
 
void toggle ()
 
void toggled (bool checked)
 
QString toolTip () const const
 
void trigger ()
 
void triggered (bool checked)
 
QString whatsThis () const const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Slots

void actionTriggered (QAction *) override
 
- Protected Slots inherited from KSelectAction
virtual void actionTriggered (QAction *action)
 
void slotToggled (bool)
 

Additional Inherited Members

- Public Types inherited from KSelectAction
enum  ToolBarMode
 
- Public Types inherited from QAction
enum  ActionEvent
 
enum  MenuRole
 
enum  Priority
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from KSelectAction
 ComboBoxMode
 
 MenuMode
 
- Public Attributes inherited from QAction
 AboutQtRole
 
 AboutRole
 
 ApplicationSpecificRole
 
 HighPriority
 
 Hover
 
 LowPriority
 
 NormalPriority
 
 NoRole
 
 PreferencesRole
 
 QuitRole
 
 TextHeuristicRole
 
 Trigger
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from KSelectAction
 KSelectAction (KSelectActionPrivate &dd, QObject *parent)
 
QWidgetcreateWidget (QWidget *parent) override
 
void deleteWidget (QWidget *widget) override
 
- Protected Member Functions inherited from QWidgetAction
QList< QWidget * > createdWidgets () const const
 
virtual bool event (QEvent *event) override
 
virtual bool eventFilter (QObject *obj, QEvent *event) override
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

Action for selecting one of several QTextCodec.

This action shows up a submenu with a list of the available codecs on the system.

Definition at line 25 of file kcodecaction.h.

Member Function Documentation

◆ codecTriggered

void KCodecAction::codecTriggered ( QTextCodec codec)
signal

Specific (proper) codec was selected.

Note that textTriggered(const QString &) is emitted too (as defined in KSelectAction).

In your KCodecAction subclass to be backward-compatible to KF < 5.78, emit instead just the deprecated signal triggered(QTextCodec *). That will also automatically emit codecTriggered(QTextCodec *) because this signal is connected to the deprevcated one in the KCodecAction constructor. Only if you compile against a variant of KConfigWidgets built without all API deprecated up to version 5.78, then emit this signal directly. Your code would be like this:

#if KCONFIGWIDGETS_BUILD_DEPRECATED_SINCE(5, 78)
// will also indirectly emit codecTriggered since 5.78
Q_EMIT triggered(codec);
#else
#endif
Since
5.78

◆ currentProberType()

KEncodingProber::ProberType KCodecAction::currentProberType ( ) const

Applicable only if showAutoOptions in c'tor was true.

Returns
KEncodingProber::None if specific encoding is selected, not autodetection, otherwise... you know it!

Definition at line 245 of file kcodecaction.cpp.

◆ defaultItemTriggered

void KCodecAction::defaultItemTriggered ( )
signal

If showAutoOptions is true, then better handle the signal encodingProberTriggered(KEncodingProber::ProberType) (or triggered(KEncodingProber::ProberType), to support also KF < 5.78).

◆ encodingProberTriggered

void KCodecAction::encodingProberTriggered ( KEncodingProber::ProberType  )
signal

Autodetection has been selected.

emits KEncodingProber::Universal if Default was selected.

Applicable only if showAutoOptions in c'tor was true

In your KCodecAction subclass to be backward-compatible to KF < 5.78, emit instead just the deprecated signal triggered(KEncodingProber::ProberType). That will also automatically emit encodingProberTriggered(KEncodingProber::ProberType) because this signal is connected to the deprecated one in the KCodecAction constructor. Only if you compile against a variant of KConfigWidgets built without all API deprecated up to version 5.78, then emit this signal directly. Your code would be like this:

#if KCONFIGWIDGETS_BUILD_DEPRECATED_SINCE(5, 78)
// will also indirectly emit encodingProberTriggered since 5.78
Q_EMIT triggered(encodingProber);
#else
#endif
Since
5.78

◆ setCurrentProberType()

bool KCodecAction::setCurrentProberType ( KEncodingProber::ProberType  scri)

Applicable only if showAutoOptions in c'tor was true.

KEncodingProber::Universal means 'Default' item

Definition at line 250 of file kcodecaction.cpp.

◆ triggered [1/2]

void KCodecAction::triggered ( KEncodingProber::ProberType  )
signal

Autodetection has been selected.

emits KEncodingProber::Universal if Default was selected.

Applicable only if showAutoOptions in c'tor was true

Deprecated:
Since 5.78, use encodingProberTriggered(KEncodingProber::ProberType)

◆ triggered [2/2]

void KCodecAction::triggered ( QTextCodec codec)
signal

Specific (proper) codec was selected.

Note that triggered(const QString &) is emitted too (as defined in KSelectAction).

Deprecated:
Since 5.78, use codecTriggered(QTextCodec *)

The documentation for this class was generated from the following files:
Q_EMITQ_EMIT
void triggered(QTextCodec *codec)
Specific (proper) codec was selected.
void codecTriggered(QTextCodec *codec)
Specific (proper) codec was selected.
void encodingProberTriggered(KEncodingProber::ProberType)
Autodetection has been selected.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Dec 4 2022 03:49:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.