--- examples/draganddrop/draggableicons/dragwidget.cpp 2011-09-30 09:24:53.000000000 -0400 +++ examples/draganddrop/draggableicons/dragwidget.cpp.new 2011-12-14 14:39:18.000000000 -0500 @@ -42,6 +42,8 @@ #include "dragwidget.h" +static bool isShowingDialog = false; + //! [0] DragWidget::DragWidget(QWidget *parent) : QFrame(parent) @@ -123,6 +125,24 @@ } else { event->ignore(); } + + if (!isShowingDialog) + { + isShowingDialog = true; + QDialog dlg(this); + QHBoxLayout *horizontalLayout = new QHBoxLayout; + horizontalLayout->addWidget(new DragWidget); + horizontalLayout->addWidget(new DragWidget); + + QPushButton *btn = new QPushButton("Dismiss", &dlg); + horizontalLayout->addWidget(btn); + QObject::connect(btn, SIGNAL(clicked()), &dlg, SLOT(close())); + + dlg.setLayout(horizontalLayout); + dlg.exec(); + isShowingDialog = false; + } } //! [1]