Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unused code in Qt Charts module
Forum Updated to NodeBB v4.3 + New Features

Unused code in Qt Charts module

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 602 Views 1 Watching
  • 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.
  • L Offline
    L Offline
    lantern
    wrote on last edited by
    #1

    In chartaxiselement.cpp theres a variable n which is not used.

    
    QStringList ChartAxisElement::createDateTimeLabels(qreal min, qreal max,int ticks,
                                                       const QString &format) const
    {
        QStringList labels;
    
        if (max <= min || ticks < 1)
            return labels;
    
        int n = qMax(int(-qFloor(std::log10((max - min) / (ticks - 1)))), 0);
        n++;
        for (int i = 0; i < ticks; i++) {
            qreal value = min + (i * (max - min) / (ticks - 1));
            labels << presenter()->locale().toString(QDateTime::fromMSecsSinceEpoch(value), format);
        }
        return labels;
    }
    
    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Please consider notifying the developers via https://bugreports.qt.io, or submitting a patch yourself.

      (Z(:^

      1 Reply Last reply
      1
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Looks like it's a copy'n'paste leftover from the other two ChartAxisElement::createFoo() functions where 'n' is used for the label strings. But yes, please provide a bug report and maybe link it here.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        2
        • L Offline
          L Offline
          lantern
          wrote on last edited by
          #4

          Ok will do, thank you.

          1 Reply Last reply
          1
          • L Offline
            L Offline
            lantern
            wrote on last edited by
            #5

            https://bugreports.qt.io/browse/QTBUG-70179

            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 Extensions
            • Unsolved