Unsolved qt standard signal wont trigger custom slot
-
hi ,
bool connectStat=QObject::connect(dateEdit, SIGNAL(editingFinished()), this, SLOT(slotSetTempDateSetting(void)), Qt::QueuedConnection); qDebug() << "connectStat : " <<connectStat;
in this scenario connectStat get 'true' value, but unable to invoke my customised slot.
can anyone help me how to figure out that QDateedit->editingfinished() emited or not ? if yes then why wont respective slot invoked?
-
i also consider link text but unable to fix the problem.
-
@Anas_Deshmukh How do you test? You need to put the cursor in one of the spin boxes and then remove it from there (for example pressing TAB key).
-
@jsulm i am pressing TAB key.
I am using QDateEdit and QTimeEdit fields in dialogbox,
need to set maxlimit for date and time field (both QDateEdit and QTimeEdit using setMaximumDate and setMaximumTime).test case :
edit date for current date : both date and time wont exceed currentdate-time frame,
when i edit yesterday date my time edit wont allow to accept 24 hrs.// my customized slot : slotSetTempDateSetting void window::slotSetTempDateSetting(void) { qDebug() << "slotSetTempDateSetting called, : "; QDateEdit* tempDateEditObj=(QDateEdit*)tempDateEditVar; qDebug() << "tempDateEditObj : " << tempDateEditObj->date(); QTimeEdit* tempTimeEditEditObj=(QTimeEdit*)timeEditGlobalObjVar; if(tempDateEditObj->date() < QDate::currentDate()) { qDebug() << "given date is less thn current date"; QTime tempTimeObj=QTime::fromString("23:59:59","hh:mm:ss"); tempTimeEditEditObj->setMaximumTime(tempTimeObj); } else { qDebug() << "given date is same as current date"; QString qstrTimeMaxLimit=QString::fromLocal8Bit(defaultInTime); QTime tempTimeObj=QTime::fromString(qstrTimeMaxLimit,"hh:mm:ss"); tempTimeEditEditObj->setMaximumTime(tempTimeObj); } }
-
@Anas_Deshmukh said in qt standard signal wont trigger custom slot:
qDebug() << "slotSetTempDateSetting called, : ";
do you see this in the app output?
-
@jsulm NO.
-
Hi
Do you have any threads u didnt tell about ?
Im wondering why you use Qt::QueuedConnection -
Hi,
@Anas_Deshmukh said in qt standard signal wont trigger custom slot:
SLOT(slotSetTempDateSetting(void)
That
void
there looks fishy.If you are using Qt 5, you might want to use the new syntax.