Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. QwtDial::setScale
QtWS25 Last Chance

QwtDial::setScale

Scheduled Pinned Locked Moved 3rd Party Software
9 Posts 2 Posters 7.3k 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.
  • S Offline
    S Offline
    SolarQuark
    wrote on 7 Feb 2011, 23:52 last edited by
    #1

    Hi all.

    Windows XP SP3

    {Qt 2010.05
    Qt Creator 2.0.1
    Mingw - do not know how to establish versions of Mingw } These three installed from a single download

    Qwt 6.0.0-rc5

    Me again. This is the second of my two queries.
    I hope it is OK to post a query about Qwt here. If not, let me know and I will go elsewhere.

    Am just trying to learn C++/Qt (+Qwt)
    Have created a little app, just trying things out, but am having a little difficulty with setting the scale in a QwtDial.

    Specifically, I have a scale with a range of 0 to 50 - QwtDial::setRange(0,50)
    I would like major scale ticks every 10 units and mid-sized scale ticks every 5 units (excluding the major ticks) and minor scale ticks every 1 unit (excluding the major and mid-sized scale ticks).
    I (think I) am setting the appropriate lengths of the scale ticks with QwtDial::setScaleTicks(2,4,8), but am not entirely certain that is what this function does.
    I have played with QwtDial::setScale(int maxMajIntv, int maxMinIntv, double step = 0.0) but clearly do not understand this function. The last parameter seems to set the major scale points (where the scale text is).

    I have tried QwtDial::setScale(x,y,10) using values of 1 to 10 for x and y but without success (I get a dial with a scale with major points with text every 10 units but no mid points and no minor points).

    Does anyone know what maxMinIntv and maxMajIntv do?

    Take care.

    Mike

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on 8 Feb 2011, 07:17 last edited by
      #2

      Apparently at Qwt they have made the mistake of using abbreviations and not documenting them.
      maxMajIntv: Maximum major interval
      maxMinIntv: Maximum minor interval

      Maybe this bit helps already.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SolarQuark
        wrote on 8 Feb 2011, 11:51 last edited by
        #3

        Thanks for the reply, Franzk.

        Do you know what 'Maximum Major Interval' is supposes to mean, and do?
        Do you know what 'Maximum Minor Interval' is supposed to mean, and do?

        Is maxMinIntv the maximum number of minor scale ticks between each major and mid-sized scale tick?
        What then determines the number of mid-sized scale ticks?

        I have tried various values for maxMajIntv and maxMinIntv but these don't seem to have a predictabel effect.

        I have now set the size of the scale to setScaleTicks(3,6,8) just in case the minor scale tick was too small - this was setScaleTicks(2,4,8) with the predictable difference that the mid-sized scale ticks became larger, but still no sign of the small scale ticks.

        I am obviously just an idiot and just do not understand the intention of maxMaxIntv and maxMinIntv (unless there is another function that I have missed that has an effect on this).

        Thank you again for your help, although I think it is too late to save my sanity.

        Mike

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on 8 Feb 2011, 12:00 last edited by
          #4

          Try leaving the step argument at its default value and see what happens. At the moment I don't have Qwt available.

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SolarQuark
            wrote on 8 Feb 2011, 15:34 last edited by
            #5

            Hi Franzk.

            Setting step to default setScale(x,y,-1), results in a scale with major (labelled) interval of 1 unit, or 50 major scale point for this particular scale.

            I did further experiments with the following results

            with the following settings
            setRange(0.0,50.0)
            setScaleTicks(3,6,8)

            setScale
            ([0-10],[0-1],10) - no minor or mid scale ticks
            ([0-10],[2-4],10) - one mid sized tick between the major ticks
            ([0-10],[5-9],10) - 4 minor ticks between major ticks
            ([0-10],10,10) - one mid sized tick between major ticks and 4 minor ticks between each major and mid sized tick

            In short...
            the first parameter, maxMajIntv, desn't seem to have any effect when used with values between 0 and 10. Also tried -1 with no apparent effect either.

            the second parameter, maxMinIntv, will result in no mid-sized or minor sized scale ticks for a value of 0 or 1, will result in a 1 mid-sized tick between major ticks for a value of 2, 3 or 4, will result in 4 minor ticks for values of 5,6,7,8 or 9, and will result in one mid-sized tick between major ticks and 4 minor ticks between each major and mid-sized tick for a value of 10.

            For this dial, with a range of 0 to 50 with major scale intervals of 10 units, I should now be able to get a scale that will look OK.
            But I still don't understand maxMajIntv and maxMinIntv and how to predict the effect of any value passed.

            Thanks ofr your help, Franzk

            Take care.

            Mike

            1 Reply Last reply
            0
            • F Offline
              F Offline
              Franzk
              wrote on 8 Feb 2011, 16:01 last edited by
              #6

              [quote author="SolarQuark" date="1297179255"]But I still don't understand maxMajIntv and maxMinIntv and how to predict the effect of any value passed.[/quote]For that the best documentation is probably the Qwt source code and that might not even be really helpful... Good to see that you got a few workable values though.

              "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SolarQuark
                wrote on 8 Feb 2011, 16:12 last edited by
                #7

                [quote author="Franzk" date="1297180895"]For that the best documentation is probably the Qwt source code
                [/quote]

                I was afraid of that.

                Isn't this Qt stuff nice?

                Many thanks, Franzk

                Mike

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  Franzk
                  wrote on 8 Feb 2011, 16:15 last edited by
                  #8

                  [quote author="SolarQuark" date="1297181527"]Isn't this Qt stuff nice?[/quote]Just in case this was a sneer at Qt, Qwt is not maintained by Nokia.

                  Anyway, you're welcome.

                  "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SolarQuark
                    wrote on 8 Feb 2011, 17:39 last edited by
                    #9

                    [quote author="Franzk" date="1297181733"][quote author="SolarQuark" date="1297181527"]Isn't this Qt stuff nice?[/quote]Just in case this was a sneer at Qt, Qwt is not maintained by Nokia.

                    Anyway, you're welcome.[/quote]

                    Absolutely NOT!

                    I genuinely think this Qt stuff is amazing.
                    It is not that long ago that someone like me really had a choice of VB/Delphi/or trying to write some graphics using the windows api and c (Petzold?).
                    Life was, and still is, far too short.

                    I did not even know of the existence of Qt, wxWidgets, FLTK, GTK, FOX, et al, until I recently began to do some research into modern C/C++ development platforms and if it was possible to program for a 'modern' (is there ever such a thing?) OS.
                    And so, in trying to teach myself C++, I tripped across the above technologies and, having researched as much as was reasonable, or perhaps even unreasonable, I decided to learn C++/Qt in parallel.
                    I do not regret that decision - despite my slowness of mind - and I genuinely am stunned by the capabilities of Qt. I wish, I wish, I wish that the documentation for Qwt was half as good as that for Qt though.

                    Take care, and thank you again for your help.

                    Mike

                    1 Reply Last reply
                    0

                    1/9

                    7 Feb 2011, 23:52

                    • Login

                    • Login or register to search.
                    1 out of 9
                    • First post
                      1/9
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved