I would say that the find button should take into consideration ALL of the data filled in on the form.
In any case, the form could provide a slot that gives the search data, e.g. a map of field name to string data QMap<QString, QString>.
// form with line edits cpp
void lineeditform::slotGiveSearchData(QMap<QString, QString>& data)
{
// grab data from ui and put in map
}
//results.hpp - your widget with find button and search results
{
Q_OBJECT
...
private slots:
void slotFind();
signals:
signalGetSearchData();
};
// results form cpp
results::results(...)
{
// connect find button clicked() to slotFind() slot
// connect signalGetSearchData to slotGiveSearchData on lineedit form
}
void results::slotFind()
{
QMap<QString, QString> searchData;
// use signal signalGetSearchData
emit signalGetSearchData(searchData);
// we now have the data.
// Do your search...
}
// form with line edits cpp
void lineeditform::slotGiveSearchData(QMap<QString, QString>& data)
{
// grab data from ui and put in map
}
//results.hpp - your widget with find button and search results
class results : QWidget
{
Q_OBJECT
...
private slots:
void slotFind();
signals:
signalGetSearchData();
};
// results form cpp
results::results(...)
{
// connect find button clicked() to slotFind() slot
// connect signalGetSearchData to slotGiveSearchData on lineedit form
}
void results::slotFind()
{
QMap<QString, QString> searchData;
// use signal signalGetSearchData
emit signalGetSearchData(searchData);
// we now have the data.
// Do your search...
}
To copy to clipboard, switch view to plain text mode
Bookmarks