QwtDial::setScale



  • 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



  • 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.



  • 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



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



  • 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



  • [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.



  • [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



  • [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 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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.