Qt 4.8
Classes | Functions
complexwidgets.cpp File Reference
#include "complexwidgets.h"
#include <qapplication.h>
#include <qabstractbutton.h>
#include <qevent.h>
#include <qheaderview.h>
#include <qtabbar.h>
#include <qcombobox.h>
#include <qlistview.h>
#include <qtableview.h>
#include <qlineedit.h>
#include <qstyle.h>
#include <qstyleoption.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qtreeview.h>
#include <private/qtabbar_p.h>
#include <QAbstractScrollArea>
#include <QScrollArea>
#include <QScrollBar>
#include <QDebug>

Go to the source code of this file.

Classes

class  ModelIndexIterator
 

Functions

QString Q_GUI_EXPORT qt_accStripAmp (const QString &text)
 
static void removeInvisibleWidgetsFromList (QWidgetList *list)
 
static QItemSelection rowAt (const QModelIndex &idx)
 

Function Documentation

◆ qt_accStripAmp()

QString Q_GUI_EXPORT qt_accStripAmp ( const QString text)

Definition at line 135 of file qaccessiblewidget.cpp.

Referenced by QAccessibleTabBar::text().

136 {
137  QString newText(text);
138  int ampIndex = qt_accAmpIndex(newText);
139  if (ampIndex != -1)
140  newText.remove(ampIndex, 1);
141 
142  return newText.replace(QLatin1String("&&"), QLatin1String("&"));
143 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
static int qt_accAmpIndex(const QString &text)

◆ removeInvisibleWidgetsFromList()

static void removeInvisibleWidgetsFromList ( QWidgetList list)
inlinestatic

Definition at line 1929 of file complexwidgets.cpp.

1930 {
1931  if (!list || list->isEmpty())
1932  return;
1933 
1934  for (int i = 0; i < list->count(); ++i) {
1935  QWidget *widget = list->at(i);
1936  if (!widget->isVisible())
1937  list->removeAt(i);
1938  }
1939 }
QPointer< QWidget > widget
bool isVisible() const
Definition: qwidget.h:1005
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480

◆ rowAt()

static QItemSelection rowAt ( const QModelIndex idx)
static

Definition at line 657 of file complexwidgets.cpp.

Referenced by QAccessibleItemRow::doAction().

658 {
659  return QItemSelection(idx.sibling(idx.row(), 0),
660  idx.sibling(idx.row(), idx.model()->columnCount(idx.parent())));
661 }
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
QModelIndex sibling(int row, int column) const
Returns the sibling at row and column.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
int row() const
Returns the row this model index refers to.
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
The QItemSelection class manages information about selected items in a model.