PDA

View Full Version : delete items from list box



vvbkumar
23rd June 2006, 15:51
hi

i have a list box and two buttons
one button is "Add" and the second is "Delete"

i have written code sucessfully for ADD.
But for deleting (When the delete button is pressed, the selected item should get deleted from the list box) there seems to be some probs

pl help
thanks in advance

jacek
23rd June 2006, 16:07
What problems do you have exactly?

vvbkumar
23rd June 2006, 16:20
the console looks like this


QTAssignment1.cpp(48) : error C2664: 'removeItem' : cannot convert parameter 1 f
rom 'void' to 'int' Expressions of type void cannot be converted to other types
NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\NMAKE.EXE"' : return code '0x2' Stop.

jacek
23rd June 2006, 19:46
QTAssignment1.cpp(48) : error C2664: 'removeItem' : cannot convert parameter 1 from 'void' to 'int' Expressions of type void cannot be converted to other types
Well... you have an error in QTAssignment1.cpp file on line 48 --- open your favorite editor (i.e. vim ;)) and fix it.
Most likely you are trying to obtain a return value from a function that doesn't return anything.

bits
23rd June 2006, 20:08
vvbKumar,
Maybe we can help you better if you can show us your piece of code.
- Shobhit