Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. * When possible use a ranged for loop instead of begin() and end() iterators
This commit is contained in:
@@ -88,7 +88,7 @@ public:
|
||||
static void moveCallback(void * data, SoSensor * sensor)
|
||||
{
|
||||
Q_UNUSED(sensor);
|
||||
Private* self = static_cast<Private*>(data);
|
||||
auto self = static_cast<Private*>(data);
|
||||
if (self->view) {
|
||||
Gui::View3DInventorViewer* view = self->view->getViewer();
|
||||
SoClipPlane* clip = self->clipView;
|
||||
@@ -187,7 +187,7 @@ Clipping::Clipping(Gui::View3DInventor* view, QWidget* parent)
|
||||
Clipping* Clipping::makeDockWidget(Gui::View3DInventor* view)
|
||||
{
|
||||
// embed this dialog into a QDockWidget
|
||||
Clipping* clipping = new Clipping(view);
|
||||
auto clipping = new Clipping(view);
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
QDockWidget* dw = pDockMgr->addDockWindow("Clipping", clipping, Qt::LeftDockWidgetArea);
|
||||
dw->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
|
||||
@@ -210,7 +210,7 @@ Clipping::~Clipping()
|
||||
void Clipping::reject()
|
||||
{
|
||||
QDialog::reject();
|
||||
QDockWidget* dw = qobject_cast<QDockWidget*>(parent());
|
||||
auto dw = qobject_cast<QDockWidget*>(parent());
|
||||
if (dw) {
|
||||
dw->deleteLater();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user