Qt 4.8
Functions
qtabbar.cpp File Reference
#include "private/qlayoutengine_p.h"
#include "qabstractitemdelegate.h"
#include "qapplication.h"
#include "qbitmap.h"
#include "qcursor.h"
#include "qevent.h"
#include "qpainter.h"
#include "qstyle.h"
#include "qstyleoption.h"
#include "qstylepainter.h"
#include "qtabwidget.h"
#include "qtooltip.h"
#include "qwhatsthis.h"
#include "private/qtextengine_p.h"
#include "qaccessible.h"
#include "qdebug.h"
#include "private/qtabbar_p.h"
#include <private/qt_mac_p.h>
#include <private/qt_cocoa_helpers_mac_p.h>
#include "qs60style.h"
#include "moc_qtabbar.cpp"

Go to the source code of this file.

Functions

static QString computeElidedText (Qt::TextElideMode mode, const QString &text)
 
static bool verticalTabs (QTabBar::Shape shape)
 

Function Documentation

◆ computeElidedText()

static QString computeElidedText ( Qt::TextElideMode  mode,
const QString text 
)
static

Definition at line 1349 of file qtabbar.cpp.

Referenced by QTabBarPrivate::minimumTabSizeHint().

1350 {
1351  if (text.length() <= 3)
1352  return text;
1353 
1354  static const QLatin1String Ellipses("...");
1355  QString ret;
1356  switch (mode) {
1357  case Qt::ElideRight:
1358  ret = text.left(2) + Ellipses;
1359  break;
1360  case Qt::ElideMiddle:
1361  ret = text.left(1) + Ellipses + text.right(1);
1362  break;
1363  case Qt::ElideLeft:
1364  ret = Ellipses + text.right(2);
1365  break;
1366  case Qt::ElideNone:
1367  ret = text;
1368  break;
1369  }
1370  return ret;
1371 }
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
Definition: qstring.cpp:3664
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QString right(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n rightmost characters of the string.
Definition: qstring.cpp:3682
#define text
Definition: qobjectdefs.h:80

◆ verticalTabs()

static bool verticalTabs ( QTabBar::Shape  shape)
inlinestatic