Closed hestrro closed 2 months ago
The intention of the implementation is: QskDialog::select returns the selected string only when being accepted. Otherwise it returns an empty string.
Is this issue a bug report ( = it is not working that way ) or a change request ( = the selected string should always be returned ) ?
The problem is that when I open the dialog, I select a line of content and click OK, but an empty string is returned. Also when I connect the signal auto diawin= new QskSelectionSubWindow(this); diawin->setEntries(entries);//设置内容 diawin->setTitle("select");//设置标题 diawin->setModal(true);//设置模态
connect(diawin,&QskSelectionSubWindow::selectedRowChanged,[=](int value)
{
qDebug()<<"选中文本"<<diawin->selectedEntry();
qDebug()<<"选中行数"<<diawin->selectedRow();
});
connect(diawin,&QskSelectionSubWindow::selectedEntryChanged,[](QString value)
{
qDebug()<<value;
});
connect(diawin,&QskSelectionSubWindow::entriesChanged,[]()
{
qDebug()<<"内容改变";
});
diawin->exec();//弹出窗口
The printed output is still an empty string
QString QskSelectionSubWindow::selectedEntry() const { if ( auto listBox = qskListBox( this ) ) listBox->selectedEntry();
return QString();
}
You can find that you do not return listBox->selectedEntry();
Of course - the return was missing. Fixed, thanks for reporting.
The select function of the pop-up box does not return the selected content, but returns an empty string. You can solve this problem by modifying the return values of selectedEntry of QskSelectionWindow and QskSelectionsubWindow, and the qskselectsubwindow and qskselectwindow functions of QskDailog. dialog.docx