-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.11.0 FF
-
None
-
Debian testing, qtbase self-compiled from git dev as of 897034bc9361ae776de9dfb615af24daffaf3778
The QAccessibleTextInterface::textBeforeOffset implementation used in the case of QLineEdit hits an assert with some valid indices passed, like the following example.
Sample steps to reproduce:
- compile and run this sample program on Linux
#include <QApplication> #include <QLineEdit> #include <QMainWindow> #include <QTextEdit> #include <QVBoxLayout>int main(int argc, char* argv[]) { QApplication a(argc, argv); QMainWindow w; QWidget* widget = new QWidget; w.setCentralWidget(widget); QVBoxLayout* layout = new QVBoxLayout(widget); layout->addWidget(new QLineEdit); layout->addWidget(new QTextEdit); w.show(); return a.exec(); }
- type "hello" in the QLineEdit
- start Accerciser Accessibility Explorer ( https://gitlab.gnome.org/GNOME/accerciser )
- in Accerciser's treeview of the sample program's a11y hierarchy, select the object for the QLineEdit
- in Accerciser's IPython console, try to get the word before the index 1
In [1]: acc.queryText().getTextBeforeOffset(1, 1) --------------------------------------------------------------------------- Error Traceback (most recent call last) Cell In[1], line 1 ----> 1 acc.queryText().getTextBeforeOffset(1, 1)File /usr/lib/python3/dist-packages/pyatspi/text.py:497, in Text.getTextBeforeOffset(self, offset, type) 472 def getTextBeforeOffset(self, offset, type): 473 """ 474 Deprecated in favor of getStringAtOffset. 475 Obtain a subset of the text content of an object which entirely (...) 495 the object, delimited by the specified boundary condition. 496 """ --> 497 ret = Atspi.Text.get_text_before_offset(self.obj, offset, type) 498 return textRangeToList(ret)Error: atspi_error: Message recipient disconnected from message bus without replying (1)
Actual Result:
Exception/Error shown in Accerciser.
The program crashes/hits an assert:
qt.accessibility.atspi: AtSpiAdaptor::applicationInterface does not implement "GetApplicationBusAddress" "/org/a11y/atspi/accessible/root" ASSERT: "boundary.position() >= 0" in file /home/michi/development/git/qt5/qtbase/src/gui/accessible/qaccessible.cpp, line 2282
Expected result:
No assert hit. Since there is no word before index 1, an empty string and corresponding indices should be returned) instead.
| For Gerrit Dashboard: QTBUG-140467 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 678586,2 | a11y: Don't assert on text existing before index | dev | qt/qtbase | Status: NEW | +2 | 0 |