Qt 4.8
Classes | Functions | Variables
qerrormessage.cpp File Reference
#include "qerrormessage.h"
#include "qapplication.h"
#include "qcheckbox.h"
#include "qlabel.h"
#include "qlayout.h"
#include "qmessagebox.h"
#include "qpushbutton.h"
#include "qstringlist.h"
#include "qtextedit.h"
#include "qdialog_p.h"
#include "qpixmap.h"
#include "qmetaobject.h"
#include "qthread.h"
#include "qqueue.h"
#include "qset.h"
#include <stdio.h>
#include <stdlib.h>
#include "qguifunctions_wince.h"

Go to the source code of this file.

Classes

class  QErrorMessagePrivate
 
class  QErrorMessageTextView
 

Functions

static void deleteStaticcQErrorMessage ()
 
static void jump (QtMsgType t, const char *m)
 
bool qt_wince_is_high_dpi ()
 
bool qt_wince_is_mobile ()
 

Variables

static bool metFatal = false
 
static QErrorMessageqtMessageHandler = 0
 

Function Documentation

◆ deleteStaticcQErrorMessage()

static void deleteStaticcQErrorMessage ( )
static

Definition at line 191 of file qerrormessage.cpp.

Referenced by QErrorMessage::qtHandler().

192 {
193  if (qtMessageHandler) {
194  delete qtMessageHandler;
195  qtMessageHandler = 0;
196  }
197 }
static QErrorMessage * qtMessageHandler

◆ jump()

static void jump ( QtMsgType  t,
const char *  m 
)
static

Definition at line 201 of file qerrormessage.cpp.

Referenced by do_size_hints(), qt_grab_cursor(), qt_mac_update_widget_position(), QErrorMessage::qtHandler(), and QErrorMessage::~QErrorMessage().

202 {
203  if (!qtMessageHandler)
204  return;
205 
206  QString rich;
207 
208  switch (t) {
209  case QtDebugMsg:
210  default:
211  rich = QErrorMessage::tr("Debug Message:");
212  break;
213  case QtWarningMsg:
214  rich = QErrorMessage::tr("Warning:");
215  break;
216  case QtFatalMsg:
217  rich = QErrorMessage::tr("Fatal Error:");
218  }
219  rich = QString::fromLatin1("<p><b>%1</b></p>").arg(rich);
221 
222  // ### work around text engine quirk
223  if (rich.endsWith(QLatin1String("</p>")))
224  rich.chop(4);
225 
226  if (!metFatal) {
227  if (QThread::currentThread() == qApp->thread()) {
229  } else {
231  "showMessage",
233  Q_ARG(QString, rich));
234  }
235  metFatal = (t == QtFatalMsg);
236  }
237 }
Q_GUI_EXPORT QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode=WhiteSpacePre)
Converts the plain text string plain to an HTML-formatted paragraph while preserving most of its look...
void chop(int n)
Removes n characters from the end of the string.
Definition: qstring.cpp:4623
#define Q_ARG(type, data)
Definition: qobjectdefs.h:246
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QThread * currentThread()
Returns a pointer to a QThread which manages the currently executing thread.
Definition: qthread.cpp:419
static bool metFatal
#define qApp
static QErrorMessage * qtMessageHandler
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
void showMessage(const QString &message)
Shows the given message, message, and returns immediately.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
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
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
Invokes the member (a signal or a slot name) on the object obj.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
Definition: qstring.cpp:3796

◆ qt_wince_is_high_dpi()

bool qt_wince_is_high_dpi ( )

Definition at line 300 of file qguifunctions_wince.cpp.

Referenced by QErrorMessageTextView::minimumSizeHint(), and QErrorMessageTextView::sizeHint().

300  {
301  if (!qt_wince_is_pocket_pc())
302  return false;
303  HDC deviceContext = GetDC(0);
304  int dpi = GetDeviceCaps(deviceContext, LOGPIXELSX);
305  ReleaseDC(0, deviceContext);
306  if ((dpi < 1000) && (dpi > 0))
307  return dpi > 96;
308  else
309  return false;
310 }
bool qt_wince_is_pocket_pc()

◆ qt_wince_is_mobile()

bool qt_wince_is_mobile ( )

Definition at line 296 of file qguifunctions_wince.cpp.

Referenced by QErrorMessageTextView::minimumSizeHint(), and QErrorMessageTextView::sizeHint().

296  {
298 }
bool qt_wince_is_pocket_pc()
bool qt_wince_is_smartphone()

Variable Documentation

◆ metFatal

bool metFatal = false
static

Definition at line 199 of file qerrormessage.cpp.

Referenced by QErrorMessage::done(), and jump().

◆ qtMessageHandler

QErrorMessage* qtMessageHandler = 0
static

Definition at line 189 of file qerrormessage.cpp.

Referenced by deleteStaticcQErrorMessage(), and QErrorMessage::qtHandler().