I have a widget that I cannot get to "show up" inside of my dock widget. It shows up un-docked on top of my main window. My widget is just a clock with some VCR-like buttons (play, stop,etc).
A dock widget is created on my main window at the top like I want, but nothing is in it.
Here is my set up for my clock:
class cClockDlg
: public QWidget,
public Ui
::cClockDlg{
Q_OBJECT
public:
...
};
class cClockDlg : public QWidget, public Ui::cClockDlg
{
Q_OBJECT
public:
cClockDlg(QWidget * parent = 0);
...
};
To copy to clipboard, switch view to plain text mode
And then in my mainWindow where I try to make it a dockWidget:
Note: I call this method in my mainWindow constructor after I call setupUi(this).
void cMainWindow::setupClockWidget()
{
clockDockWidget->setAllowedAreas(Qt::AllDockWidgetAreas);
mClockDlg = new cClockDlg(clockDockWidget);
clockDockWidget->setWidget(mClockDlg);
addDockWidget(Qt::TopDockWidgetArea, clockDockWidget);
} // cMainWindow::setupClockWidget
void cMainWindow::setupClockWidget()
{
QDockWidget * clockDockWidget = new QDockWidget(tr("Simulation Clock"), this);
clockDockWidget->setAllowedAreas(Qt::AllDockWidgetAreas);
mClockDlg = new cClockDlg(clockDockWidget);
clockDockWidget->setWidget(mClockDlg);
addDockWidget(Qt::TopDockWidgetArea, clockDockWidget);
} // cMainWindow::setupClockWidget
To copy to clipboard, switch view to plain text mode
Any ideas on what I'm doing wrong? TIA.
Bookmarks