Changed: #1193 added ability changing render mode.

This commit is contained in:
dnk-88 2011-01-20 10:26:45 +02:00
parent 6b8b28b908
commit 5eed88050b
3 changed files with 24 additions and 1 deletions

View file

@ -649,6 +649,26 @@ void CMainWindow::updateRender()
} }
} }
void CMainWindow::keyPressEvent(QKeyEvent *keyEvent)
{
if (keyEvent->key() == Qt::Key_F1)
{
// Change render mode
switch (Modules::objView().getDriver()->getPolygonMode())
{
case NL3D::UDriver::Filled:
Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line);
break;
case NL3D::UDriver::Line:
Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point);
break;
case NL3D::UDriver::Point:
Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled);
break;
}
}
QMainWindow::keyPressEvent(keyEvent);
}
} /* namespace NLQT */ } /* namespace NLQT */

View file

@ -81,6 +81,9 @@ private Q_SLOTS:
void updateStatusBar(); void updateStatusBar();
void updateRender(); void updateRender();
protected:
virtual void keyPressEvent(QKeyEvent *keyEvent);
private: private:
void createActions(); void createActions();
void createMenus(); void createMenus();

View file

@ -110,7 +110,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="pageGeneral"> <widget class="QWidget" name="pageGeneral">
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">