Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21310

Q_GLOBAL_STATIC cannot be evaluated outside Q(Core)Application

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 4.8.0-beta1
    • Debugger
    • GDB Ubuntu 7.11.1-0ubuntu1~16.5
    • Linux/X11

    Description

      The following Q_GLOBAL_STATIC cannot be inspected with GDB/Linux:

      #include <QDebug>
      #include <QGlobalStatic>
      #include <QStringList>
      
      Q_GLOBAL_STATIC(QStringList, g_list)
      
      int main(int argc, char *argv[])
      {
          g_list->append("Hello");
          g_list->append("World");
          qDebug() << *g_list;
          return 0; // break here
      }

      However, if the code is in a QMainWindow, it works (if you add *g_list as expression).

      Having it work with just g_list (without prefix *) would be the ice on the cake.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            aha_1980 André Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes