void QTreeViewPrivate::insertViewItems(int pos, int count, const QTreeViewItem &viewItem)
{
Q_Q(QTreeView);
+ Q_UNUSED(q)
viewItems.insert(pos, count, viewItem);
QTreeViewItem *items = viewItems.data();
for (int i = pos + count; i < viewItems.count(); i++)
if (items[i].parentItem >= pos)
items[i].parentItem += count;
#ifndef QT_NO_ACCESSIBILITY
-#ifdef Q_WS_X11
+#ifdef Q_OS_UNIX
if (QAccessible::isActive()) {
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
}
void QTreeViewPrivate::removeViewItems(int pos, int count)
{
Q_Q(QTreeView);
+ Q_UNUSED(q)
viewItems.remove(pos, count);
QTreeViewItem *items = viewItems.data();
for (int i = pos; i < viewItems.count(); i++)
if (items[i].parentItem >= pos)
items[i].parentItem -= count;
#ifndef QT_NO_ACCESSIBILITY
-#ifdef Q_WS_X11
+#ifdef Q_OS_UNIX
if (QAccessible::isActive()) {
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
}
}
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive() && current.isValid()) {
-#ifdef Q_WS_X11
+#ifdef Q_OS_UNIX
int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column() + 1;
QAccessible::updateAccessibility(this, entry, QAccessible::Focus);
#else
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
-#ifdef Q_WS_X11
+#ifdef Q_OS_UNIX
int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column() + 1;
Q_ASSERT(entry > 0);
QAccessible::updateAccessibility(this, entry, QAccessible::Selection);
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
-#ifdef Q_WS_X11
+#ifdef Q_OS_UNIX
int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column() + 1;
Q_ASSERT(entry > 0);
QAccessible::updateAccessibility(this, entry, QAccessible::SelectionRemove);
QVERIFY(iface->isValid());
w->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(w);
+ QCoreApplication::processEvents();
QTest::qWait(100);
-#endif
// let one widget rotate around center
for (i = 0; i < 360; i+=skip) {
QWidget *w2 = new QWidget(w);
w2->setObjectName(QString("2"));
w->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(w);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
{
QWidget *toplevel = createWidgets();
toplevel->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(toplevel);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
QLayout *lout = toplevel->layout();
QScrollBar *scrollBar = new QScrollBar(Qt::Horizontal);
scrollBar->resize(200, 50);
scrollBar->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(scrollBar);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
QAccessibleInterface * const scrollBarInterface = QAccessible::queryAccessibleInterface(scrollBar);
void tst_QAccessibility::listViewTest()
{
-#if defined(Q_WS_X11)
+#if defined(Q_OS_UNIX)
QSKIP( "Accessible table1 interface is no longer supported on X11.", SkipAll);
#else
{
listView.resize(400,400);
listView.show();
QTest::qWait(1); // Need this for indexOfchild to work.
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(&listView);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents(&listView);
QTest::qWait(100);
#endif
QMdiArea mdiArea;
mdiArea.show();
qApp->setActiveWindow(&mdiArea);
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(&mdiArea);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(150);
#endif
if (i == 0) {
int minimumWidth = window->width() * subWindowCount + 20;
mdiArea.resize(mdiArea.size().expandedTo(QSize(minimumWidth, 0)));
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(&mdiArea);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
if (mdiArea.width() >= minimumWidth)
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&box);
QVERIFY(iface);
box.show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(&box);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
QVERIFY(iface);
box.setOrientation(Qt::Vertical);
box.show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(&box);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
dial.setValue(20);
QCOMPARE(dial.value(), 20);
dial.show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(&dial);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
abstractScrollArea.resize(400, 400);
abstractScrollArea.show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(&abstractScrollArea);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
const QRect globalGeometry = QRect(abstractScrollArea.mapToGlobal(QPoint(0, 0)),
{
QScrollArea scrollArea;
scrollArea.show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(&scrollArea);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&scrollArea);
void tst_QAccessibility::tableWidgetTest()
{
-#if defined(Q_WS_X11)
+#if defined(Q_OS_UNIX)
QSKIP( "Accessible table1 interface is no longer supported on X11.", SkipAll);
#else
{
}
w->resize(100, 100);
topLevel->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(w);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents(w);
QTest::qWait(100);
#endif
QAccessibleInterface *client = QAccessible::queryAccessibleInterface(w);
void tst_QAccessibility::tableViewTest()
{
-#if defined(Q_WS_X11)
+#if defined(Q_OS_UNIX)
QSKIP( "Accessible table1 interface is no longer supported on X11.", SkipAll);
#else
{
w->resizeColumnsToContents();
w->resizeRowsToContents();
w->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(w);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents(w);
QTest::qWait(100);
#endif
QAccessibleInterface *client = QAccessible::queryAccessibleInterface(w);
void tst_QAccessibility::table2ListTest()
{
-#if !defined(Q_WS_X11)
+#if !defined(Q_OS_UNIX)
QSKIP( "Accessible table2 interface is currently only supported on X11.", SkipAll);
#else
QListWidget *listView = new QListWidget;
listView->resize(400,400);
listView->show();
QTest::qWait(1); // Need this for indexOfchild to work.
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(listView);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
void tst_QAccessibility::table2TreeTest()
{
-#if !defined(Q_WS_X11)
+#if !defined(Q_OS_UNIX)
QSKIP( "Accessible table2 interface is currently only supported on X11.", SkipAll);
#else
QTreeWidget *treeView = new QTreeWidget;
treeView->resize(400,400);
treeView->show();
QTest::qWait(1); // Need this for indexOfchild to work.
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(treeView);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
treeView->expandAll();
QTest::qWait(1); // Need this for indexOfchild to work.
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(treeView);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
void tst_QAccessibility::table2TableTest()
{
-#if !defined(Q_WS_X11)
+#if !defined(Q_OS_UNIX)
QSKIP( "Accessible table2 interface is currently only supported on X11.", SkipAll);
#else
QTableWidget *tableView = new QTableWidget(3, 3);
tableView->resize(600,600);
tableView->show();
QTest::qWait(1); // Need this for indexOfchild to work.
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(tableView);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
calendarWidget.resize(400, 300);
calendarWidget.show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(&calendarWidget);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
mw->resize(600,400);
mw->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(mw);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
QComboBox *cb = new QComboBox(w);
cb->addItems(QStringList() << "one" << "two" << "three");
w->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(w);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
QTest::qWait(100);
#endif
QAccessibleInterface *acc = QAccessible::queryAccessibleInterface(w);
void tst_QAccessibility::treeWidgetTest()
{
-#if defined(Q_WS_X11)
+#if defined(Q_OS_UNIX)
QSKIP( "Accessible table1 interface is no longer supported on X11.", SkipAll);
#else
QWidget *w = new QWidget;
}
w->show();
// QTest::qWait(1000);
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(w);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents(w);
QTest::qWait(100);
#endif
QLabel *label = new QLabel(text);
label->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(label);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
#endif
QTest::qWait(100);
label->setText(tr("Q &A&B"));
QCOMPARE(accLineEdit->text(QAccessible::Accelerator, 0), QKeySequence(Qt::ALT).toString(QKeySequence::NativeText) + QLatin1String("A"));
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(window);
+#if defined(Q_OS_UNIX)
+ QCoreApplication::processEvents();
#endif
QTest::qWait(100);
delete window;