Selected item from QListWidget
-
Hi SGaist,
I'm rewriting a project developed in C + + using MFC. I'm also new to Qt, but now reading I saw what was going wrong. The correct is QString
Another question please.
When I comment the lines:
@
connect (ui.m_buttonOk, SIGNAL (clicked (bool)), this, SLOT (OnBnClickedOk ()));QList <QListWidgetItem *> ITEMLIST = ui.m_listPacote-> selectedItems (); / / If so, m_LineCommand.clear (); m_LineCommand + = ";" for (int i = 0; i <itemList.size (); i + +) { m_LineCommad itemList.at = + (i) -> text (); if (i <itemList.size ()) m_LineCommand + = ";" }@
The Qt does not lock and run my form, but keep the uncommented lines to load the form and try to select an option, the form Qt crashes. What can it be?
-
Your question is not clear at all, can you rephrase it please ?
-
Hi,
I managed to solve, first I went "Clean Solution", then I went on "Rebuild Solution"
But can you please help me with this part of the code.
I need to get the Initial Date, End Date and concatenate them. I did this:
@// Declaration of Variables
string strDate, strInitialDate, strFinalDate;
string a_pckIdList;QString csDate;
CSPTDateTime DateTimeInitial;
CSPTDateTime DateTimeFinal;// Recovering the Initial Date of the calendar
DateTimeInitial = ui.m_initialDate->GetDateSelect();
if (DateTimeInitial.GetYMD(strDate,2) == SPTERRO) return;
strInitialDate = strDate.substr(0, 11);@But this errors occurs: "ERRORS": http://pastebin.com/AKtB8zdC
-
I can't since I don't know what's in CSPTDatePopup.h
-
You might need to use it, but it seems that the error comes from it.
-
Beside telling you that you are calling a function that doesn't exist in QCalendarWidget… You might be rather looking for selectedDate
-
Hi,
Can you help me?
In this line is occurs this error: (Line) DateTimeInitial = ui.m_initialDate->selectedDate();
(Error)
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'QDate' (or there is no acceptable conversion)This line: if (DateTimeInitial.GetYMD(strDate,2) == SPTERRO) return;
This error: error C2664: 'CSPTDateTime::GetYMD' : cannot convert parameter 1 from 'QString' to 'std::string &'This line: strInitialDate = strDate.substr(0, 11);
error C2039: 'substr' : is not a member of 'QString' -
Please, read the documentation of the classes you are using. You can't use = to automagically put a QDate in a QString. You can't auto convert QString in string.
First thing to do: cleanup your code. You are uselessly mixing Qt with some other library. If you need to return a string somewhere, fine, but do the conversion at the last time, there's no need to go back and forth between different library types like that.