Qt 4.8
Macros | Functions
qaction.cpp File Reference
#include "qaction.h"
#include "qactiongroup.h"
#include "qaction_p.h"
#include "qapplication.h"
#include "qevent.h"
#include "qlist.h"
#include "qdebug.h"
#include <private/qshortcutmap_p.h>
#include <private/qapplication_p.h>
#include <private/qmenu_p.h>
#include "moc_qaction.cpp"

Go to the source code of this file.

Macros

#define QAPP_CHECK(functionName)
 

Functions

static QString qt_strippedText (QString s)
 

Macro Definition Documentation

◆ QAPP_CHECK

#define QAPP_CHECK (   functionName)
Value:
if (!qApp) { \
qWarning("QAction: Initialize QApplication before calling '" functionName "'."); \
return; \
}
#define qApp

Definition at line 55 of file qaction.cpp.

Referenced by QAction::setAutoRepeat(), QAction::setEnabled(), QAction::setShortcut(), QAction::setShortcutContext(), QAction::setShortcuts(), and QAction::setVisible().

Function Documentation

◆ qt_strippedText()

static QString qt_strippedText ( QString  s)
static

Definition at line 66 of file qaction.cpp.

Referenced by QAction::setIconText(), and QAction::setToolTip().

67 {
68  s.remove( QString::fromLatin1("...") );
69  int i = 0;
70  while (i < s.size()) {
71  ++i;
72  if (s.at(i-1) != QLatin1Char('&'))
73  continue;
74  if (i < s.size() && s.at(i) == QLatin1Char('&'))
75  ++i;
76  s.remove(i-1,1);
77  }
78  return s.trimmed();
79 }
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
Definition: qstring.cpp:4506
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
Definition: qstring.cpp:1867
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55