Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. 'class QPushButton' has no member named 'accessibleName'
Qt 6.12 LTS is out! See what's new in the release blog

'class QPushButton' has no member named 'accessibleName'

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cainiao123
    wrote on last edited by
    #1

    I had an error while compiling the code,please see below:
    aa0da604-ffad-4c9d-abf8-33f12e2ec56b-image.png

    i have already include the head file <QPushButton>
    the class QPushButton is a derived class of QAbstractButton, and the QAbstractButton is a derived class of QWidget,
    i can found the function accessibleName() defined in the head file <qwidget.h>
    35f28681-0859-44d6-b581-afd642b377e2-image.png
    7463be9e-0537-4d25-8983-3ae04f7b29bc-image.png
    c6665102-3ac5-4398-8324-6f1b32e2ba70-image.png

    It looks like everything's ok, why the error reported when compiling?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      The key here is:

      #ifndef QT_NO_ACCESSIBILITY
      ...
      #endif
      

      Your Qt has been built with QT_NO_ACCESSIBILITY defined.
      See here

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cainiao123
        wrote on last edited by
        #3

        @ChrisW67 said in 'class QPushButton' has no member named 'accessibleName':

        Your Qt has been built with QT_NO_ACCESSIBILITY defined.

        how can i resolve this problem?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cainiao123
          wrote on last edited by
          #4

          the macro QT_NO_ACCESSIBILITY defined in the <QtGui/qtgui-config.h>
          i delete the definition, it can compile now.
          as you say, this QT environment should bulit with QT_NO_ACCESSIBILITY,
          i compared the file <QtGui/qtgui-config.h> in another QT environment, there is no definition for QT_NO_ACCESSIBILITY.

          thx.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            What you have done is produce something that might compile, probably will not link (because the actual implementation of these methods is also removed by the same QT_NO_ACCESSIBILITY defines), and if it does will experience unpredictable problems.

            You fix this problem by compiling your Qt library without specifying the -no-feature-accessibility option to configure (which is how your library seems to have been built).

            1 Reply Last reply
            3

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt
            • Unsolved