UPDATED:
I have created a custom edit widget that is a promoted widget in the QMainWindow. The problem is that the custom edit widget is unable to connect to a created signal emitted by the app in QMainWindow.
mainwindow.h
{
Q_OBJECT
public:
explicit MainWindow();
~MainWindow();
signals:
void signalRowSelected
(QVariant rowdata
);
...
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow();
~MainWindow();
signals:
void signalRowSelected(QVariant rowdata);
...
};
To copy to clipboard, switch view to plain text mode
mainwindow.cpp
emit signalRowSelected(QVariant(vals));
To copy to clipboard, switch view to plain text mode
editwidget.hpp
EditWidget:public QWdiget
{
...
private:
}
EditWidget:public QWdiget
{
...
private:
QWidget *mw;
}
To copy to clipboard, switch view to plain text mode
editwidget.cpp
EditWidget::EditWidget()
{
...
mw = parent;
connect(mw,
SIGNAL(signalRowSelected
(QVariant rowdata
)),
this,
SLOT(slotDisplayRow
(QVariant rowdata
)));
// (similar problem when only parent is used) }
EditWidget::EditWidget()
{
...
mw = parent;
connect(mw, SIGNAL(signalRowSelected(QVariant rowdata)), this, SLOT(slotDisplayRow(QVariant rowdata))); // (similar problem when only parent is used)
}
To copy to clipboard, switch view to plain text mode
As I mentioned before the editwidget is a promoted QWidget in the QMainwindow form so they are in the same GUI QThread.
The chages above now connects to QMainWindow but still does not know of the signal emitted.
What am I missing here?
Bookmarks