QMainWindowTray::QMainWindowTray(QWidget *parent) : QMainWindow(parent) , icon_online(QIcon (":/resources/icon-online.svg")) , icon_offline(QIcon (":/resources/icon-offline.svg")) , icon_unread(QIcon (":/resources/icon-unread.svg")) { #if not __ANDROID__ if (QSystemTrayIcon::isSystemTrayAvailable()) { createActions(); createTrayIcon(); setMainWindowIcon(); connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked())); connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); trayIcon->setIcon(QIcon(":/resources/icon-offline.svg")); trayIcon->setToolTip(tr("Vcrypt messanger")); trayIcon->show(); } qDebug() << "windows state: " << 0 + windowState(); #endif }
void BasisManager::createBasisManager(void) // создаем начальную точки каркаса приложения { Ogre::String pluginsPath; // only use plugins.cfg if not static #ifndef OGRE_STATIC_LIB pluginsPath = mResourcePath + "plugins.cfg"; #endif mRoot = new Ogre::Root("", mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log"); mRoot->installPlugin( new Ogre::D3D9Plugin( ) ); setupResources(); if (!mRoot->restoreConfig()) { // попробуем завестись на дефолтных if (!mRoot->showConfigDialog()) return; // ничего не получилось, покажем диалог } mWindow = mRoot->initialise(true, "MyGUI Layout Editor"); mWidth = mWindow->getWidth(); mHeight = mWindow->getHeight(); #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 mWindow->getCustomAttribute("WINDOW", &mHwnd); // устанавливаем поддержку дропа файлов long style = ::GetWindowLong((HWND)mHwnd, GWL_EXSTYLE); ::SetWindowLong((HWND)mHwnd, GWL_EXSTYLE, style | WS_EX_ACCEPTFILES); #endif setMainWindowIcon(IDI_ICON); mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "BasisSceneManager"); mCamera = mSceneMgr->createCamera("BasisCamera"); mCamera->setNearClipDistance(5); mCamera->setPosition(Ogre::Vector3(200, 200, 200)); mCamera->lookAt(Ogre::Vector3(0.0, 0.0, 0.0)); // Create one viewport, entire window /*Ogre::Viewport * vp = */mWindow->addViewport(mCamera); // Alter the camera aspect ratio to match the viewport mCamera->setAspectRatio(Ogre::Real(mWidth) / Ogre::Real(mHeight)); // Set default mipmap level (NB some APIs ignore this) Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); Ogre::Light* mLight = mSceneMgr->createLight("BasisLight"); mLight->setDiffuseColour(Ogre::ColourValue::White); mLight->setSpecularColour(Ogre::ColourValue::White); mLight->setAttenuation(8000,1,0.0005,0); // Load resources Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); // узнам в каком режиме экрана мы запущенны mFullscreen = mRoot->getRenderSystem()->getConfigOptions().find("Full Screen")->second.currentValue == "Yes"; // создаем систему ввода mInput = new input::InputManager(); mInput->createInput(mWindow, mFullscreen, this, this); mGUI = new MyGUI::Gui(); mGUI->initialise(mWindow, "editor.xml"); // подписываемся на события фреймов mRoot->addFrameListener(this); // пдписываемся на события окна Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 // если оконное, то скрываем if (!mFullscreen) MyGUI::Gui::getInstance().hidePointer(); // забиваем карту маппинга на стандартные курсоры mInput->addMapPointer("arrow", (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW))); mInput->addMapPointer("beam", (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_IBEAM))); mInput->addMapPointer("size_left", (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENWSE))); mInput->addMapPointer("size_right", (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENESW))); mInput->addMapPointer("size_horz", (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEWE))); mInput->addMapPointer("size_vert", (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENS))); mInput->addMapPointer("hand", (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND))); #endif changeState(&mEditor); startRendering(); }