Skip to content

Commit

Permalink
Ran clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Oct 21, 2024
1 parent 879d4e7 commit b1f8a9c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
7 changes: 2 additions & 5 deletions include/vsgQt/Viewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ namespace vsgQt
// forward declare
class Window;


class VSGQT_DECLSPEC Viewer : public vsg::Inherit<vsg::Viewer, Viewer>
{
public:

/// Create Viewer.
/// If msecTimerInterval is > 0 then call setInterval(msecTimerInterval) to set up QTime to call Viewer::render() at this interval,
/// otherwise the redraw is left application to call Viewer::render() when required, call Viewer::setInverval() to set up the timer,
/// or to call the underlying vsg::Viewer methods for rendering a framne within the application when the viewer needs to redraw a frame.
/// otherwise the redraw is left application to call Viewer::render() when required, call Viewer::setInverval() to set up the timer,
/// or to call the underlying vsg::Viewer methods for rendering a framne within the application when the viewer needs to redraw a frame.
Viewer(int msecTimerInterval = 0);

QTimer timer;
Expand All @@ -51,7 +49,6 @@ namespace vsgQt

/// set the QTimer interval in milliseconds, this controls how often the Viewer::render() is called
void setInterval(int msecTimerInterval);

};

} // namespace vsgQt
Expand Down
1 change: 0 additions & 1 deletion include/vsgQt/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ namespace vsgQt
virtual void initializeWindow();

protected:

void cleanup();

bool event(QEvent* e) override;
Expand Down
3 changes: 1 addition & 2 deletions src/vsgQt/KeyboardMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,12 @@ bool KeyboardMap::getKeySymbol(const QKeyEvent* e, vsg::KeySymbol& keySymbol, vs
else
{
keySymbol = vsg::KeySymbol(e->key());
if (keySymbol>='A' && keySymbol<='Z') keySymbol = vsg::KeySymbol(int(keySymbol) + int('a'-'A'));
if (keySymbol >= 'A' && keySymbol <= 'Z') keySymbol = vsg::KeySymbol(int(keySymbol) + int('a' - 'A'));

modifiedKeySymbol = vsg::KeySymbol(*(e->text().toLatin1().data()));

// std::cout<<"KeyboardMap::getKeySymbol() NOT found in map, keySymbol = "<<keySymbol<<" "<<char(keySymbol)<< ", modifiedKeySymbol = "<<modifiedKeySymbol<<" "<<char(modifiedKeySymbol)<<std::endl;
}


return true;
}
4 changes: 1 addition & 3 deletions src/vsgQt/Viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

using namespace vsgQt;


Viewer::Viewer(int msecTimerInterval)
{
// set the default timer as 8ms.
if (msecTimerInterval > 0) setInterval(msecTimerInterval);
}


bool Viewer::pollEvents(bool discardPreviousEvents)
{
if (discardPreviousEvents) _events.clear();
Expand Down Expand Up @@ -89,6 +87,6 @@ void Viewer::render(double simulationTime)
void Viewer::setInterval(int msecTimerInterval)
{
timer.setInterval(msecTimerInterval);
timer.connect(&timer, &QTimer::timeout, [&](){ render(); } );
timer.connect(&timer, &QTimer::timeout, [&]() { render(); });
timer.start();
}
9 changes: 4 additions & 5 deletions src/vsgQt/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Window::Window(vsg::ref_ptr<vsg::WindowTraits> in_traits, QScreen* targetScreen)
}
else
{
traits =vsg::WindowTraits::create();
traits = vsg::WindowTraits::create();
traits->x = x();
traits->y = y();
traits->width = width();
Expand All @@ -86,7 +86,7 @@ Window::Window(vsg::ref_ptr<vsg::WindowTraits> in_traits, QWindow* parent) :
}
else
{
traits =vsg::WindowTraits::create();
traits = vsg::WindowTraits::create();
traits->x = x();
traits->y = y();
traits->width = width();
Expand All @@ -106,7 +106,7 @@ Window::Window(vsg::ref_ptr<vsgQt::Viewer> in_viewer, vsg::ref_ptr<vsg::WindowTr
}
else
{
traits =vsg::WindowTraits::create();
traits = vsg::WindowTraits::create();
traits->x = x();
traits->y = y();
traits->width = width();
Expand All @@ -126,7 +126,7 @@ Window::Window(vsg::ref_ptr<vsgQt::Viewer> in_viewer, vsg::ref_ptr<vsg::WindowTr
}
else
{
traits =vsg::WindowTraits::create();
traits = vsg::WindowTraits::create();
traits->x = x();
traits->y = y();
traits->width = width();
Expand Down Expand Up @@ -182,7 +182,6 @@ void Window::cleanup()
viewer = {};
}


bool Window::event(QEvent* e)
{
switch (e->type())
Expand Down

0 comments on commit b1f8a9c

Please sign in to comment.