Hi folks,
i have a problem regarding Qspinbox in combination with checkbox.. this is an example of my form :

so as u see i want to click on the checkbox and chose a number which is smaller or equal to something in qspinbox .. on clicking the ok button, my code list only the items with a value or smaller than the chosen number in qspinbox on screen.. i dont know how to compare the value in qspinbox with the value of the items on my screen in my code i do it like this but it doesnt work:
int x = 50;
optionsDlg dlg(this);
QListViewItemIterator it (this);
while (it.current())
{
if (!it.current()->parent())
{
SomethingItem *somethingItem = (SomethingItem*) it.current();
QString itemName
= it.
current()->text
(Col_Item_Names
);
if (somethingItem->getCol_Val() > x )
{
if (dlg.check_item_smaller && dlg.itemBox1)
{
dlg.check_item_smaller->setChecked(true);
somethingItem->setVisible(false);
}
else
somethingItem->setVisible(false);
}
else if (somethingItem->getCol_Val() < x)
{
if(dlg.check_item_greater && dlg.itemBox2)
{
dlg.check_item_greater->setChecked(true);
somethingItem->setVisible(true);
}
else
somethingItem->setVisible(false);
}
}
it++;
}
int x = 50;
optionsDlg dlg(this);
QListViewItemIterator it (this);
while (it.current())
{
if (!it.current()->parent())
{
SomethingItem *somethingItem = (SomethingItem*) it.current();
QString itemName = it.current()->text (Col_Item_Names);
if (somethingItem->getCol_Val() > x )
{
if (dlg.check_item_smaller && dlg.itemBox1)
{
dlg.check_item_smaller->setChecked(true);
somethingItem->setVisible(false);
}
else
somethingItem->setVisible(false);
}
else if (somethingItem->getCol_Val() < x)
{
if(dlg.check_item_greater && dlg.itemBox2)
{
dlg.check_item_greater->setChecked(true);
somethingItem->setVisible(true);
}
else
somethingItem->setVisible(false);
}
}
it++;
}
To copy to clipboard, switch view to plain text mode
with getCol_Val() it compare if the numbers in col are smaller than 50 then show the items. but i want to do this with that QspinBox in the form. i want to chose a number is qspinbox and then comapre with getCol_Val()..
can someone look at the code?
thanks in advance
Bookmarks