From 4e8fa8bd724c90643569d6a05dfaa6bb6c4e62fa Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Thu, 24 Feb 2011 15:07:23 +0200 Subject: [PATCH] Changed: #1206 Works search settings page. Update core and example plugin. --- .../src/plugins/CMakeLists.txt | 3 +- .../src/plugins/core/core.cpp | 6 + .../object_viewer_qt/src/plugins/core/core.h | 1 + .../src/plugins/core/core.qrc | 8 +- .../src/plugins/core/core_constants.h | 8 + .../src/plugins/core/core_plugin.cpp | 8 +- .../object_viewer_qt/src/plugins/core/icore.h | 7 + .../src/plugins/core/images/go-down.png | Bin 0 -> 2404 bytes .../src/plugins/core/images/go-up.png | Bin 0 -> 2426 bytes .../src/plugins/core/images/list-add.png | Bin 0 -> 2658 bytes .../src/plugins/core/images/list-remove.png | Bin 0 -> 1592 bytes .../src/plugins/core/main_window.cpp | 5 + .../src/plugins/core/main_window.h | 4 +- .../core/search_paths_settings_page.cpp | 138 ++++++++++- .../plugins/core/search_paths_settings_page.h | 20 +- .../core/search_paths_settings_page.ui | 220 +++++++++++------- .../src/plugins/example/qnel_widget.h | 19 +- 17 files changed, 343 insertions(+), 104 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/go-down.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/go-up.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/list-add.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/list-remove.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt index ac151cb0a..e36da9e65 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt @@ -1,4 +1,5 @@ ADD_SUBDIRECTORY(core) ADD_SUBDIRECTORY(example) ADD_SUBDIRECTORY(ovqt_sheet_builder) -ADD_SUBDIRECTORY(log) \ No newline at end of file +ADD_SUBDIRECTORY(log) +ADD_SUBDIRECTORY(disp_sheet_id) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp index 380413077..6c681f15a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp @@ -19,6 +19,7 @@ #include "core.h" #include "imenu_manager.h" #include "main_window.h" +#include "../../extension_system/iplugin_manager.h" static Core::CoreImpl *m_coreInstance = 0; @@ -63,4 +64,9 @@ QMainWindow *CoreImpl::mainWindow() const return m_mainWindow; } +ExtensionSystem::IPluginManager *CoreImpl::pluginManager() const +{ + return m_mainWindow->pluginManager(); +} + } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h index e138b73ca..d3b25b918 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h @@ -42,6 +42,7 @@ public: virtual QSettings *settings() const; virtual QMainWindow *mainWindow() const; + virtual ExtensionSystem::IPluginManager *pluginManager() const; private: MainWindow *m_mainWindow; friend class MainWindow; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc index e6b5615d8..c9cae1893 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc @@ -1,6 +1,10 @@ - + + images/list-add.png + images/list-remove.png + images/go-up.png + images/go-down.png images/nel.png images/preferences.png - + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h index 051c15e9d..6f1c0f06d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h @@ -57,6 +57,14 @@ const char * const ABOUT = "ObjectViewerQt.About"; const char * const ABOUT_PLUGINS = "ObjectViewerQt.AboutPlugins"; const char * const ABOUT_QT = "ObjectViewerQt.AboutQt"; +//settings +const char * const DATA_PATH_SECTION = "DataPath"; +const char * const SEARCH_PATHS = "SearchPaths"; +const char * const RECURSIVE_SEARCH_PATHS = "RecursiveSearchPathes"; +const char * const LEVELDESIGN_PATH = "LevelDesignPath"; +const char * const ASSETS_PATH = "LevelDesignPath"; + +//resources const char * const ICON_NEL = ":/core/images/nel.png"; const char * const ICON_SETTINGS = ":/core/images/preferences.png"; } // namespace Constants diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp index adf00409b..f8f4a6ea0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp @@ -75,6 +75,7 @@ bool CorePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QStr connect(newAction, SIGNAL(triggered()), this, SLOT(execSettings())); connect(newAction2, SIGNAL(triggered()), _pluginView, SLOT(show())); _oldOVQT = false; + return true; } else { @@ -97,11 +98,12 @@ bool CorePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QStr } _oldOVQT = true; bool success = _mainWindow->initialize(errorString); + CSearchPathsSettingsPage *serchPathPage = new CSearchPathsSettingsPage(this); + serchPathPage->applySearchPaths(); + addAutoReleasedObject(serchPathPage); + return success; } - - addAutoReleasedObject(new CSearchPathsSettingsPage(this)); - return true; } void CorePlugin::extensionsInitialized() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h index 942daedc2..8f0c5b4ca 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h @@ -28,6 +28,11 @@ class QMainWindow; class QSettings; QT_END_NAMESPACE +namespace ExtensionSystem +{ +class IPluginManager; +} + namespace Core { class IMenuManager; @@ -51,6 +56,8 @@ public: virtual QSettings *settings() const = 0; virtual QMainWindow *mainWindow() const = 0; + virtual ExtensionSystem::IPluginManager *pluginManager() const = 0; + Q_SIGNALS: void closeMainWindow(); }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/go-down.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/go-down.png new file mode 100644 index 0000000000000000000000000000000000000000..780714b8fa8db3e15b9a258bccb3589e57ca5d80 GIT binary patch literal 2404 zcmV-q37htbP)#Yb#qihEXpDal z{6iBL^y9Yow)cF${?2>P=}DU+ zaJy1W_S`=AcTR6l`#iso_q->?hxmVnlrkVE7J5A+Vj*A)5YJ9@kM8Up$Zq@fzH|C` z#s-iVBjX>Md)2Hzy!q}X``$G*zk2vn&D$AcH`c&`6a9Mk`xDdmZ)g&)v=1VkwdaVR zPk0PN*YMzmCR`lO+V|bnR6+(^6aaw&@$Fx}<_pfmP$r8{u5Ca)is$6|>Ui;uUL1L| zPa^{!2shM#@0hSDj*VwvnN>iHYc|q1IELQ-VNmwvjW^($N}cOiuq?ZfDT3$N@acMm z8*RXIOcfnFFi@BX&$Wr>(ire#129dyz$94kouxA1#s=(bY#~XnxfSr2sshsY0S36P z3$xG`@;vySyEFzE*BH|T$cL)H^+3ufGHAkJOJx9>UJPGySn&*8-*U<{@I>(vRe*7( z871(+VP0PaVmnMg7^O>70dfFgl);y>;AIrN7{Vz3;3^$7|Ak}RIOwj?lu6wA^P(g zNHDAa?YFzm8ivufyhex6`23Y;09PGEs1D!AiKMoP=&< zESO6Yr_8WOPbfa0Vn6sih~cs4QzUwxjEx{h(nvt(41e1DB1%e<&j4S%qJb!5`$|_m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%a9U0wL0ZX=iDmvKH_oK6W|G4eFJ%4s{S)W+hT7V&Mt|12Aa|Hs6 zBut#u5saMH_VUprqT3#U^+|!RD)nUQ?RTF#cjz$wna&bH&U;ZvPO{P*=oC2DB;V_P s!Rv+knnu;DN0zNrtLa()Z+C0^F907|%u2o>TL1t607*qoM6N<$f_jRTD*ylh literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/list-add.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/list-add.png new file mode 100644 index 0000000000000000000000000000000000000000..af5b56e3c4fbd6d91eb3fa6e337ddb89c5843854 GIT binary patch literal 2658 zcmV-o3Z3hJMY0I>9n3i^&>GUy= z&gQ-z2CU*k(ayMdNzH0eh6=lzlNHf zgCR!A7;Ii~J8oLO6_rxu!~K)*-22llJBM)v8eb{pzrOyPhabD;N1JY0b}QDj_oHf- zz*=|+;0)HbUyHu>0epVd{TuG-dEn3w_CD0td;-C3)|C5S7+7*+b$Ie9R=2Ik>dHF6 z5}b94dJpJwdt@C36i)n4=WiJwln(ji^{&x8d8#*=~+}^tbTUOqNn^tZ{9W#hA zheVR%LN@Xw`fy_ABOIF8i^1uA_+WD1rkB3>{(+_ju_UI)5>6B(^#n~P-~>b#UMpsAyE)wlNG`+ynod9!0+GgmQ0793wU@Vm6A(NI zfH+(g7SIkU4~Pg-bs@S$3|RO#oD$HOX}$$uK`yMQWl}duoV|<-*&>MHpxrA?;F*2T zlwLXd${o8#c5R%RpI8eECNQx84Dtvh?GdR%}1K<;E|)vjaQQ%My6%ji z8R%{A#njxSUeJF)Jy*no0CGWn6<`pA1unRda~2?kIg2eIPO>?qQ|_?V-Jv}X%K|tD zFl(TbYk<(f%MsTXFgoChU(T87tc;IyH^xv!H>cGmjmFTW?L#*na z$rNz;IKYX*sZ?mLPt{cvSwA3gF?2l|FYDnnhCD)slJI+0U>i~z(xDnHMMu`D^T`aR>r>US+2NfHo%3?K)ONw+HdD&H7f>SeNi0w2^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RM_>A#6{=P-T$ zK8~F}O>fCmbftMMi51oAK0g7&>}6cklJUxe2Y4+H*(IZEZD9dcF6Tdx(HJVyfC&6# zLUq?1mZUNMXk@V@?~-W)?(W9Y(h{bxU&qY7d#Er2!nwP5(I?mLqer1QMHXwB$cweG zBHQJ@ehmhEMNl_&IKi0eNru5P`+*{)SL0G5mW**olU4xC%SUSN$`#Dd%=p)q&?x1X zD~Z5H;xdul^I&n9K!o0IXszRQ8iFX2NE{sYhA>nZVSpdPNfm6!*xCTD9t{rEELav=mK9EX5NG`a%LF zp?|OAfP@gAiJ+z5+{HyyWIV6U&iZBQdhc7GJX!BvW@uyLJLs(irPeTk<#3_0x{BxX z^H`7xWQ!uLqFP>p$O*F&h$FO#V9Cp*!F{W|au9NusMdg2eqJfc^NiHADV5;&TcjMF z$W&tp)_0vFCG8sH3((Qh0xeC_I7NY zoMh=wvH@C8aufmz%jX;5_ch>96>uwnZMC+-Zf#`~{w7j3A(eL>BoY635yj6w%)Yfk z+kkdxqdpO5R#%BdSXpx&FE-$h9l*za9A67n5a0V1;8#hay9Q_%;99a#8y}tj=Yh?R z`AO>lBsL?Qm$gp;j59zM16&bD%Yp)q0Qgb-4@@XJK*_IY$Rs%CHwQKO5DJ;zEZtz> ziz@J!S{L4;AWIg~ko@5)@DT?b(m+8hbK)qG48YX+O2{!kPBajMh5`K$~!Che{zVoC4%ZPqNPa%M{zE}a23y_W+eG{k8CjYcp3EPy( z+K-ckh5%>;co!*Bq)3q>MT!(DQfwst13T)2D?NY%?PN(TTo*alb-Q_5Tb0000(obj); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h index 11a77cc56..76eca3a42 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h @@ -19,7 +19,7 @@ #define MAIN_WINDOW_H // Project includes -#include "../../extension_system/iplugin.h" +#include "../../extension_system/iplugin_manager.h" #include "plugin_view_dialog.h" // STL includes @@ -51,6 +51,8 @@ public: IMenuManager *menuManager() const; QSettings *settings() const; + ExtensionSystem::IPluginManager *pluginManager() const; + public Q_SLOTS: bool showOptionsDialog(const QString &group = QString(), const QString &page = QString(), diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp index 585fb2089..ead8451f0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp @@ -15,21 +15,29 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +// Project includes #include "search_paths_settings_page.h" - -// Qt includes -#include +#include "core_constants.h" +#include "icore.h" // NeL includes +#include -// Project includes +// Qt includes +#include +#include +#include namespace Core { CSearchPathsSettingsPage::CSearchPathsSettingsPage(QObject *parent) : IOptionsPage(parent), - _currentPage(0) + m_page(0) +{ +} + +CSearchPathsSettingsPage::~CSearchPathsSettingsPage() { } @@ -55,13 +63,127 @@ QString CSearchPathsSettingsPage::trCategory() const QWidget *CSearchPathsSettingsPage::createPage(QWidget *parent) { - _currentPage = new QWidget(parent); - _ui.setupUi(_currentPage); - return _currentPage; + m_page = new QWidget(parent); + m_ui.setupUi(m_page); + + readSettings(); + checkEnabledButton(); + connect(m_ui.addToolButton, SIGNAL(clicked()), this, SLOT(addPath())); + connect(m_ui.removeToolButton, SIGNAL(clicked()), this, SLOT(delPath())); + connect(m_ui.upToolButton, SIGNAL(clicked()), this, SLOT(upPath())); + connect(m_ui.downToolButton, SIGNAL(clicked()), this, SLOT(downPath())); + return m_page; } void CSearchPathsSettingsPage::apply() { + writeSettings(); + applySearchPaths(); +} + +void CSearchPathsSettingsPage::finish() +{ + delete m_page; + m_page = 0; +} + +void CSearchPathsSettingsPage::applySearchPaths() +{ + QStringList paths; + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + settings->endGroup(); + Q_FOREACH(QString path, paths) + { + NLMISC::CPath::addSearchPath(path.toStdString(), false, false); + } + NLMISC::CPath::remapExtension("png", "tga", true); + NLMISC::CPath::remapExtension("png", "dds", true); +} + +void CSearchPathsSettingsPage::addPath() +{ + QString newPath = QFileDialog::getExistingDirectory(m_page); + if (!newPath.isEmpty()) + { + QListWidgetItem *newItem = new QListWidgetItem; + newItem->setText(newPath); + newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + m_ui.pathsListWidget->addItem(newItem); + } + + checkEnabledButton(); +} + +void CSearchPathsSettingsPage::delPath() +{ + QListWidgetItem *removeItem = m_ui.pathsListWidget->takeItem(m_ui.pathsListWidget->currentRow()); + if (!removeItem) + delete removeItem; + + checkEnabledButton(); +} + +void CSearchPathsSettingsPage::upPath() +{ + int currentRow = m_ui.pathsListWidget->currentRow(); + if (!(currentRow == 0)) + { + QListWidgetItem *item = m_ui.pathsListWidget->takeItem(currentRow); + m_ui.pathsListWidget->insertItem(--currentRow, item); + m_ui.pathsListWidget->setCurrentRow(currentRow); + } +} + +void CSearchPathsSettingsPage::downPath() +{ + int currentRow = m_ui.pathsListWidget->currentRow(); + if (!(currentRow == m_ui.pathsListWidget->count()-1)) + { + QListWidgetItem *item = m_ui.pathsListWidget->takeItem(currentRow); + m_ui.pathsListWidget->insertItem(++currentRow, item); + m_ui.pathsListWidget->setCurrentRow(currentRow); + } +} + +void CSearchPathsSettingsPage::readSettings() +{ + QStringList paths; + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + settings->endGroup(); + Q_FOREACH(QString path, paths) + { + QListWidgetItem *newItem = new QListWidgetItem; + newItem->setText(path); + newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + m_ui.pathsListWidget->addItem(newItem); + } +} + +void CSearchPathsSettingsPage::writeSettings() +{ + QStringList paths; + for (int i = 0; i < m_ui.pathsListWidget->count(); ++i) + paths << m_ui.pathsListWidget->item(i)->text(); + + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + settings->setValue(Core::Constants::SEARCH_PATHS, paths); + settings->endGroup(); +} + +void CSearchPathsSettingsPage::checkEnabledButton() +{ + bool bEnabled = true; + if (m_ui.pathsListWidget->count() == 0) + bEnabled = false; + + m_ui.removeToolButton->setEnabled(bEnabled); + m_ui.upToolButton->setEnabled(bEnabled); + m_ui.downToolButton->setEnabled(bEnabled); } } /* namespace Core */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h index cbea4239c..15f28f6c8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h @@ -38,7 +38,7 @@ class CSearchPathsSettingsPage : public Core::IOptionsPage public: CSearchPathsSettingsPage(QObject *parent = 0); - ~CSearchPathsSettingsPage() {} + ~CSearchPathsSettingsPage(); QString id() const; QString trName() const; @@ -47,11 +47,23 @@ public: QWidget *createPage(QWidget *parent); void apply(); - void finish() {} + void finish(); + + void applySearchPaths(); + +private Q_SLOTS: + void addPath(); + void delPath(); + void upPath(); + void downPath(); private: - QWidget *_currentPage; - Ui::CSearchPathsSettingsPage _ui; + void readSettings(); + void writeSettings(); + void checkEnabledButton(); + + QWidget *m_page; + Ui::CSearchPathsSettingsPage m_ui; }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui index f0d08e40b..e250cfdda 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui @@ -6,8 +6,8 @@ 0 0 - 422 - 272 + 431 + 285 @@ -15,97 +15,149 @@ - 0 + 6 + + + 3 - - + + Search paths - - - - - - - - - - - 0 - 0 - - - - ... - - - - :/images/list-add.png:/images/list-add.png - - - - 16 - 16 - - - - - - - - ... - - - - :/images/list-remove.png:/images/list-remove.png - - - - - - - ... - - - - :/images/go-up.png:/images/go-up.png - - - - - - - ... - - - - :/images/go-down.png:/images/go-down.png - - - - - - - - - Qt::Vertical - - - - 20 - 195 - - - - - + + + + Qt::Horizontal + + + + 228 + 20 + + + + + + + + 3 + + + + + + 0 + 0 + + + + + + + + :/core/images/list-add.png:/core/images/list-add.png + + + + 20 + 20 + + + + true + + + + + + + + 0 + 0 + + + + + + + + :/core/images/list-remove.png:/core/images/list-remove.png + + + + 20 + 20 + + + + true + + + + + + + + 0 + 0 + + + + + + + + :/core/images/go-up.png:/core/images/go-up.png + + + + 20 + 20 + + + + true + + + + + + + + 0 + 0 + + + + + + + + :/core/images/go-down.png:/core/images/go-down.png + + + + 20 + 20 + + + + true + + + + + + + + - + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h index b0969c3a2..25f8fa651 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h @@ -20,6 +20,7 @@ // NeL includes #include +#include #include // Qt includes @@ -54,11 +55,24 @@ public: /// Set the update interval renderer void setInterval(int msec); - float getFPS() const + /// Set the background color. + void setBackgroundColor(NLMISC::CRGBA backgroundColor); + + float fps() const { return m_fps; } + inline NLMISC::CRGBA backgroundColor() const + { + return m_backgroundColor; + } + + NL3D::UDriver *driver() const + { + return m_driver; + } + virtual QPaintEngine* paintEngine() const { return NULL; @@ -90,7 +104,10 @@ private: QNLWidget &operator=(const QNLWidget &); NL3D::UDriver *m_driver; + NLMISC::CRGBA m_backgroundColor; + QTimer *m_mainTimer; + bool m_initialized; int m_interval; float m_fps;