Hi, i'm looking basicly for something like: QDoubleSpinBoxArray, QDoubleSpinBoxList,.., or
CListView WidgetView; // (i have this in my far memory..)
WidgetView.AddItem( double ) // add some variable with the correct type.....
CListView WidgetView; // (i have this in my far memory..)
WidgetView.AddItem( double ) // add some variable with the correct type.....
To copy to clipboard, switch view to plain text mode
In my SW, i wish to add in a loop for example:
for(int i =0; i < MyArray.Size(); i++)
{
WidgetView.AddItem( MyArray[i]; )
}
for(int i =0; i < MyArray.Size(); i++)
{
WidgetView.AddItem( MyArray[i]; )
}
To copy to clipboard, switch view to plain text mode
And then i want to navigate with the Arrows of the widget through the index, and not through the digits/numbers of "2340.22", for example.
It would be nice to have such a feature. Maybe i did not have found the correct or appropriate widget until now, or i have overseen the correct member function of
http://doc.trolltech.com/4.5/qdouble...x-members.html
The Problem is:
QDoubleSpinBox has no item like
QVector <double> Data
To copy to clipboard, switch view to plain text mode
I tried that subclass thing, but, i run into too much troubles. (of course i have to learn it someday..)
For the interested reader i did:
header file:
#ifndef CMYDOUBLESPINBOX_H
#define CMYDOUBLESPINBOX_H
#include <qspinbox.h>
#include <CData.h>
{
Q_OBJECT
public:
CMyDoubleSpinBox
(QWidget *parent
= 0);
double singleStep() const;
void setSingleStep(double value);
CData MyData;
};
#endif // CMYDOUBLESPINBOX_H
#ifndef CMYDOUBLESPINBOX_H
#define CMYDOUBLESPINBOX_H
#include <qspinbox.h>
#include <CData.h>
class CMyDoubleSpinBox : public QDoubleSpinBox
{
Q_OBJECT
public:
CMyDoubleSpinBox(QWidget *parent = 0);
double singleStep() const;
void setSingleStep(double value);
CData MyData;
};
#endif // CMYDOUBLESPINBOX_H
To copy to clipboard, switch view to plain text mode
and the cpp file: The out commented things are from the original implementation.
#include "CMyDoubleSpinBox.h"
{
;
}
double CMyDoubleSpinBox::singleStep() const
{
// Q_D(const QDoubleSpinBox);
// return d->singleStep.toDouble();
}
void CMyDoubleSpinBox::setSingleStep(double value)
{
// Q_D(QDoubleSpinBox);
// if (value >= 0)
// {
// d->singleStep = value;
// d->updateEdit();
// }
}
#include "CMyDoubleSpinBox.h"
CMyDoubleSpinBox::CMyDoubleSpinBox(QWidget *parent ): QDoubleSpinBox(parent)
{
;
}
double CMyDoubleSpinBox::singleStep() const
{
// Q_D(const QDoubleSpinBox);
// return d->singleStep.toDouble();
}
void CMyDoubleSpinBox::setSingleStep(double value)
{
// Q_D(QDoubleSpinBox);
// if (value >= 0)
// {
// d->singleStep = value;
// d->updateEdit();
// }
}
To copy to clipboard, switch view to plain text mode
regards Astronomy
Ah! and sorry for any grammatical mistakes in my English,
maybe because of that, something does not come out clear
Bookmarks