这篇教程C++ updateSize函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中updateSize函数的典型用法代码示例。如果您正苦于以下问题:C++ updateSize函数的具体用法?C++ updateSize怎么用?C++ updateSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了updateSize函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: QToolButtonToolButton::ToolButton( QAction * _a, const QString & _label, const QString & _alt_label, const QString & _desc, QObject * _receiver, const char * _slot, QWidget * _parent ) : QToolButton( _parent ), m_pixmap( _a->icon().pixmap( 128, 128 ) ), m_img( FastQImage( m_pixmap.toImage() ).scaled( 32, 32 ) ), m_mouseOver( false ), m_label( _label ), m_altLabel( _alt_label ), m_title( _a->text() ), m_descr( _desc ){ setAttribute( Qt::WA_NoSystemBackground, true ); updateSize(); if( _receiver != NULL && _slot != NULL ) { connect( this, SIGNAL( clicked() ), _receiver, _slot ); connect( _a, SIGNAL( triggered( bool ) ), _receiver, _slot ); }}
开发者ID:EmebedQtsoft,项目名称:italc2,代码行数:24,
示例2: addvoid HashTable<Type>:: add(HashNode<Type> currentNode){ if(!contains(currentNode)) { if(this->size/this->capacity >= this->efficiencyPercentile) { updateSize(); } int positionToInsert = findPosition(currentNode); if(internalStorage[positionToInsert] != nullptr) { while(internalStorage[positionToInsert] != nullptr) { positionToInsert = (positionToInsert +1) % size; } internalStorage[positionToInsert] = ¤tNode; } else { internalStorage[positionToInsert] = ¤tNode; } }}
开发者ID:AlexHuntsman,项目名称:NodesInXcode,代码行数:24,
示例3: TEST_FTEST_F(CpuMultiplicativeInteractionModelTest, Construct) { const int numberOfIndividuals = 10; MKLWrapper& mklWrapper; CpuMultiplicativeInteractionModel cpuMultiplicativeInteractionModel(mklWrapper); Container::RegularHostVector snpData(numberOfIndividuals); Container::RegularHostVector envData(numberOfIndividuals); Container::RegularHostVector interData(numberOfIndividuals); for(int i = 0; i < numberOfIndividuals; ++i){ snpData(i) = i; } for(int i = 0; i < numberOfIndividuals; ++i){ envData(i) = numberOfIndividuals - i; } Container::SNPVectorMock<Container::RegularHostVector> snpVectorMock; EXPECT_CALL(snpVectorMock, getNumberOfIndividualsToInclude()).WillRepeatedly(Return(numberOfIndividuals)); EXPECT_CALL(snpVectorMock, getOriginalSNPData()).Times(1).WillRepeatedly(ReturnRef(snpData)); Container::EnvironmentVectorMock<Container::RegularHostVector> environmentVectorMock; EXPECT_CALL(environmentVectorMock, getNumberOfIndividualsToInclude()).WillRepeatedly(Return(numberOfIndividuals)); EXPECT_CALL(environmentVectorMock, getEnvironmentData()).Times(1).WillRepeatedly(ReturnRef(envData)); Container::InteractionVectorMock<Container::RegularHostVector> interactionVectorMock; EXPECT_CALL(interactionVectorMock, getNumberOfIndividualsToInclude()).WillRepeatedly(Return(numberOfIndividuals)); EXPECT_CALL(interactionVectorMock, getInteractionData()).Times(1).WillRepeatedly(ReturnRef(interData)); EXPECT_CALL(interactionVectorMock, updateSize(numberOfIndividuals)).Times(1); cpuMultiplicativeInteractionModel.applyModel(snpVectorMock, environmentVectorMock, interactionVectorMock); for(int i = 0; i < numberOfIndividuals; ++i){ EXPECT_EQ(i * (numberOfIndividuals - i), interData(i)); }}
开发者ID:Berjiz,项目名称:CuEira,代码行数:36,
示例4: MYGUI_LOG MessageBoxStyle Message::addButtonName(const UString& _name) { //FIXME if (mVectorButton.size() >= MessageBoxStyle::_CountUserButtons) { MYGUI_LOG(Warning, "Too many buttons in message box, ignored"); return MessageBoxStyle::None; } // бит, номер кнопки + смещение до Button1 MessageBoxStyle info = MessageBoxStyle(MessageBoxStyle::Enum(MYGUI_FLAG(mVectorButton.size() + MessageBoxStyle::_IndexUserButton1))); // запоминаем кнопки для отмены и подтверждения if (mVectorButton.empty()) mInfoOk = info; mInfoCancel = info; Widget* button = createWidgetT(mButtonType, mButtonSkin, IntCoord(), Align::Left | Align::Bottom); button->eventMouseButtonClick = newDelegate(this, &Message::notifyButtonClick); button->setCaption(_name); button->_setInternalData(info); mVectorButton.push_back(button); updateSize(); return info; }
开发者ID:OndraK,项目名称:openmw,代码行数:24,
示例5: GdxRuntimeExceptionvoid GlfwGraphics::createWindow(const char* title, int width, int height){ // Open a window and create its OpenGL context if( !glfwOpenWindow( width, height, 0, 0, 0, 0, 0, 0, GLFW_WINDOW ) ) { ::glfwTerminate(); throw GdxRuntimeException("Failed to open GLFW window"); } ::glfwSetWindowTitle(title); //initializa glew glewInit(); updateSize(); //TODO: implement also window resize //setup a callback? m_listener.create(); m_frameStart = m_timer.systemNanoSeconds(); m_lastFrameTime = m_frameStart; m_deltaTime = 0;}
开发者ID:pcman75,项目名称:libgdx-cpp,代码行数:24,
示例6: loadTexturevoid PGE_QuestionBox::construct(QString _title, PGE_MenuBox::msgType _type, PGE_Point pos, float _padding, QString texture){ if(!texture.isEmpty()) loadTexture(texture); updateTickValue(); _page=0; running=false; _answer_id = -1; _pos=pos; _menu.setTextLenLimit(30, true); _menu.setItemsNumber(2); setTitleFont(ConfigManager::setup_menu_box.title_font_name); setTitleFontColor(ConfigManager::setup_menu_box.title_font_rgba); /****************Word wrap*********************/ title = _title; FontManager::optimizeText(title, 27); title_size = FontManager::textSize(_title, fontID, 27); /****************Word wrap*end*****************/ setPadding(_padding); setType(_type); updateSize();}
开发者ID:tcvicio,项目名称:PGE-Project,代码行数:24,
示例7: QMainWindowMainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ QWidget *centralWidget=new QWidget; QLabel *fontLabel=new QLabel(tr("Font:")); fontCombo =new QFontComboBox; QLabel *sizeLabel =new QLabel(tr("Size:")); sizeCombo =new QComboBox; QLabel *styleLabel=new QLabel(tr("Style:")); styleCombo =new QComboBox; QLabel *fontMeringLabel=new Qlabel(tr("Automatic Font Mergint:")); fontMerging=new QCheckBox; fontMerging->setChecked(true); scrollArea =new QScrollArea; characterWidget =new characterWidget; scrollArea->setWidget(characterWidget); findStyles(fontCombo->currentData()); lineEdit=new QLineEdit;#ifndef QT_NO_CLIPBOARD QPushButton *clipboardButton =new QpushButton(tr("&To clipboard")); connect(fontCombo, SIGNAL(currentFontChanged(QFont)), this, SLOT(findStyles(QFont))); connect(fontCombo, SIGNAL(currentFontChanged(QFont)), this, SLOT(findSizes(QFont))); connect(fontCombo, SIGNAL(currentFontChanged(QFont)), characterWidget, SLOT(updateFont(QFont))); connect(sizeCombo, SIGNAL(currentIndexChanged(QString)), characterWidget, SLOT(updateSize(QString))); connect(styleCombo, SIGNAL(currentIndexChanged(QString)), characterWidget, SLOT(updateStyle(QString)));}
开发者ID:woaitubage,项目名称:QT,代码行数:36,
示例8: updateSizevoid BokehBlurOperation::executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) { cl_kernel kernel = device->COM_clCreateKernel("bokehBlurKernel", NULL); if (!this->m_sizeavailable) { updateSize(); } const float max_dim = max(this->getWidth(), this->getHeight()); cl_int radius = this->m_size * max_dim / 100.0f; cl_int step = this->getStep(); device->COM_clAttachMemoryBufferToKernelParameter(kernel, 0, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputBoundingBoxReader); device->COM_clAttachMemoryBufferToKernelParameter(kernel, 1, 4, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram); device->COM_clAttachMemoryBufferToKernelParameter(kernel, 2, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputBokehProgram); device->COM_clAttachOutputMemoryBufferToKernelParameter(kernel, 3, clOutputBuffer); device->COM_clAttachMemoryBufferOffsetToKernelParameter(kernel, 5, outputMemoryBuffer); clSetKernelArg(kernel, 6, sizeof(cl_int), &radius); clSetKernelArg(kernel, 7, sizeof(cl_int), &step); device->COM_clAttachSizeToKernelParameter(kernel, 8, this); device->COM_clEnqueueRange(kernel, outputMemoryBuffer, 9, this);}
开发者ID:BlueLabelStudio,项目名称:blender,代码行数:24,
示例9: updateSize// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>void OriginSymbol::setPreferredMagnitudeValue(double magnitudeValue) { _magnitude = magnitudeValue; updateSize();}
开发者ID:marcelobianchi,项目名称:seiscomp3,代码行数:5,
示例10: whilevoid CDesertConfigDialog::OnLvnItemchangedCfglist(NMHDR *pNMHDR, LRESULT *pResult){ LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR); // TODO: Add your control notification handler code here if( pNMLV->uNewState & LVIS_SELECTED ) { int sel = pNMLV->iItem; for(map<HTREEITEM, int>::iterator it=cfgTreeMap.begin();it!=cfgTreeMap.end();++it) { HTREEITEM node = (*it).first; int elemId = (*it).second; if(elemId==0) { HTREEITEM parent_node = m_cfgtree.GetParentItem(node); HTREEITEM hNextItem; HTREEITEM hChildItem = m_cfgtree.GetChildItem(parent_node); bool selected = true; bool otherSel = false; while (hChildItem != NULL) { map<HTREEITEM, int>::iterator pos = cfgTreeMap.find(hChildItem); if(pos!=cfgTreeMap.end()) { int itemId = (*pos).second; if(itemId!=0 && dhelper_ptr->isElementSelected(sel, itemId, true)) { selected = false; otherSel = true; break; } } hNextItem = m_cfgtree.GetNextItem(hChildItem, TVGN_NEXT); hChildItem = hNextItem; } if(!otherSel) { map<HTREEITEM, int>::iterator pos = cfgTreeMap.find(parent_node); if(pos!=cfgTreeMap.end()) { int itemId = (*pos).second; if(itemId!=0 && dhelper_ptr->isElementSelected(sel, itemId, true)) selected = true; else selected = false; } else selected = false; } if(selected) m_cfgtree.SetItemState(node,TVIS_BOLD, TVIS_BOLD); else m_cfgtree.SetItemState(node,0, TVIS_BOLD); } else { if(dhelper_ptr->isElementSelected(sel, elemId)) m_cfgtree.SetItemState(node,TVIS_BOLD, TVIS_BOLD); else m_cfgtree.SetItemState(node,0, TVIS_BOLD); } } } int ns = pNMLV->uNewState & LVIS_STATEIMAGEMASK; if ((ns & 0x2000) != 0) checkedSize++; else if ((ns & 0x1000) != 0) checkedSize--; updateSize(); *pResult = 0;}
开发者ID:dyao-vu,项目名称:meta-core,代码行数:78,
示例11: updateSizevoid FrameBuffer::resize(const QSize &size) { this->size = size; updateSize();}
开发者ID:Abbath,项目名称:Beetle,代码行数:4,
示例12: NUS_Weibullvoid StrokeProcessState::updateState(ParamBox input){ this->prevParam = curParam; this->curParam = input; //Compare the difference between curParam and prevParam, then update according to the changes if (this->StrokeList.empty()) { NUS_Weibull(this->imgData->SaliencyImage, & (this->StrokeList), this->curParam.mDensity,this->curParam.mNon_Uniformity); } if (laterUpdate_graph) //re-update the saliency sampling-> initial connection graph { //NUS_Weibull(this->imgData->SaliencyImage, & (this->StrokeList), this->curParam.mDensity,this->curParam.mNon_Uniformity); initStrokeOrientation(StrokeList, this->imgData->GradientOrientation); connectStrokeGraph(StrokeList, this->imgData->SegmentImage); //Debug use ...Show Image //vis_StrokePositions(this->imgData->OriginalImage, this->StrokeList); } if (curParam.mLocal_Iostropy != prevParam.mLocal_Iostropy || laterUpdate_graph) // update connection graph { updateOrientation(this->StrokeList, this->curParam.mLocal_Iostropy); connectStrokeGraph(StrokeList, this->imgData->SegmentImage); laterUpdate_graph = true; } if (curParam.mCoarseness != prevParam.mCoarseness || laterUpdate_graph) // reinitialize the size { initStrokeSize(this->imgData->SaliencyImage, this->imgData->GradientRatio, (this->StrokeList), this->curParam.mCoarseness); laterUpdate_size = true; } if (curParam.mSize_Contrast!=prevParam.mSize_Contrast || laterUpdate_graph || laterUpdate_size) //update size { updateSize(StrokeList, this->curParam.mSize_Contrast); } /*if (laterUpdate_graph || laterUpdate_size) { initStrokeColor(StrokeList, this->imgData->OriginalImage); }*/ if (curParam.mHue_Constrast != prevParam.mHue_Constrast || curParam.mLightness_Contrast != prevParam.mLightness_Contrast|| curParam.mChroma_Constrast != prevParam.mChroma_Constrast|| laterUpdate_graph||laterUpdate_size ) //update the three color channels separately { initStrokeColor(StrokeList, this->imgData->OriginalImage); updateHue(StrokeList,curParam.mHue_Constrast); updateLightness(StrokeList, curParam.mLightness_Contrast); updateChroma(StrokeList, curParam.mChroma_Constrast); } //if (curParam.mLightness_Contrast != prevParam.mLightness_Contrast ||laterUpdate_graph||laterUpdate_size) //update the three color channels separately //{ // updateLightness(StrokeList, curParam.mLightness_Contrast); //} //if (curParam.mChroma_Constrast != prevParam.mChroma_Constrast ||laterUpdate_graph||laterUpdate_size) //update the three color channels separately //{ // updateChroma(StrokeList, curParam.mChroma_Constrast); //}}
开发者ID:zijunwei,项目名称:GraphicsProject,代码行数:69,
示例13: SDL_SetWindowFullscreenvoid SDL2Window::changeMode(DisplayMode mode, bool makeFullscreen) { if(!m_window) { m_size = mode.resolution; m_fullscreen = makeFullscreen; return; } if(m_fullscreen == makeFullscreen && m_size == mode.resolution) { return; } bool wasFullscreen = m_fullscreen; m_renderer->beforeResize(false); if(makeFullscreen) { if(wasFullscreen) { // SDL will not update the window size with the new mode if already fullscreen SDL_SetWindowFullscreen(m_window, 0); } if(mode.resolution != Vec2i_ZERO) { SDL_DisplayMode sdlmode; SDL_DisplayMode requested; requested.driverdata = NULL; requested.format = 0; requested.refresh_rate = 0; requested.w = mode.resolution.x; requested.h = mode.resolution.y; int display = SDL_GetWindowDisplayIndex(m_window); if(!SDL_GetClosestDisplayMode(display, &requested, &sdlmode)) { if(SDL_GetDesktopDisplayMode(display, &sdlmode)) { return; } } if(SDL_SetWindowDisplayMode(m_window, &sdlmode) < 0) { return; } } } Uint32 flags = getSDLFlagsForMode(mode.resolution, makeFullscreen); if(SDL_SetWindowFullscreen(m_window, flags) < 0) { return; } if(!makeFullscreen) { SDL_SetWindowSize(m_window, mode.resolution.x, mode.resolution.y); } if(wasFullscreen != makeFullscreen) { onToggleFullscreen(makeFullscreen); } if(makeFullscreen) { // SDL regrettably sends resize events when a fullscreen window is minimized. // Because of that we ignore all size change events when fullscreen. // Instead, handle the size change here. updateSize(); } tick();}
开发者ID:striezel,项目名称:ArxLibertatis,代码行数:63,
示例14: QGraphicsWidgetIcon::Icon(TaskManager::AbstractGroupableItem *abstractItem, Launcher *launcher, Job *job, Applet *parent) : QGraphicsWidget(parent), m_applet(parent), m_task(NULL), m_launcher(NULL), m_glowEffect(NULL), m_layout(new QGraphicsLinearLayout(this)), m_animationTimeLine(new QTimeLine(1000, this)), m_jobAnimationTimeLine(NULL), m_itemType(TypeOther), m_factor(parent->initialFactor()), m_animationProgress(-1), m_jobsProgress(0), m_jobsAnimationProgress(0), m_dragTimer(0), m_highlightTimer(0), m_menuVisible(false), m_demandsAttention(false), m_jobsRunning(false), m_isVisible(true), m_isPressed(false){ setObjectName("FancyTasksIcon"); setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); setAcceptsHoverEvents(true); setAcceptDrops(true); setFocusPolicy(Qt::StrongFocus); setFlag(QGraphicsItem::ItemIsFocusable); setLayout(m_layout); m_visualizationPixmap = NULL; m_thumbnailPixmap = NULL; m_animationTimeLine->setFrameRange(0, 100); m_animationTimeLine->setUpdateInterval(50); m_animationTimeLine->setCurveShape(QTimeLine::LinearCurve); m_layout->setOrientation((m_applet->location() == Plasma::LeftEdge || m_applet->location() == Plasma::RightEdge)?Qt::Vertical:Qt::Horizontal); m_layout->addStretch(); m_layout->addStretch(); if (abstractItem) { setTask(abstractItem); } else if (launcher) { setLauncher(launcher); } else if (job) { addJob(job); } connect(this, SIGNAL(destroyed()), m_applet, SLOT(updateSize())); connect(this, SIGNAL(hoverMoved(QGraphicsWidget*, qreal)), m_applet, SLOT(itemHoverMoved(QGraphicsWidget*, qreal))); connect(this, SIGNAL(hoverLeft()), m_applet, SLOT(hoverLeft())); connect(m_applet, SIGNAL(sizeChanged(qreal)), this, SLOT(setSize(qreal))); connect(m_applet, SIGNAL(sizeChanged(qreal)), this, SIGNAL(sizeChanged(qreal))); connect(m_animationTimeLine, SIGNAL(finished()), this, SLOT(stopAnimation())); connect(m_animationTimeLine, SIGNAL(frameChanged(int)), this, SLOT(progressAnimation(int)));}
开发者ID:amithash,项目名称:fancytasks,代码行数:68,
示例15: updateSizevoid QtWaitingSpinner::setRadius(int radius) { myRadius = radius; updateSize();}
开发者ID:daodaoliang,项目名称:QtWaitingSpinner,代码行数:4,
示例16: arx_assert//.........这里部分代码省略......... info.version.patch = 4; if(SDL_GetWindowWMInfo(m_window, reinterpret_cast<SDL_SysWMinfo *>(&info))) { switch(info.subsystem) { case ARX_SDL_SYSWM_UNKNOWN: break; case ARX_SDL_SYSWM_WINDOWS: system = "Windows"; break; case ARX_SDL_SYSWM_X11: system = "X11"; break;#if SDL_VERSION_ATLEAST(2, 0, 3) case ARX_SDL_SYSWM_WINRT: system = "WinRT"; break;#endif case ARX_SDL_SYSWM_DIRECTFB: system = "DirectFB"; break; case ARX_SDL_SYSWM_COCOA: system = "Cocoa"; break; case ARX_SDL_SYSWM_UIKIT: system = "UIKit"; break;#if SDL_VERSION_ATLEAST(2, 0, 2) case ARX_SDL_SYSWM_WAYLAND: system = "Wayland"; break; case ARX_SDL_SYSWM_MIR: system = "Mir"; break;#endif#if SDL_VERSION_ATLEAST(2, 0, 4) case ARX_SDL_SYSWM_ANDROID: system = "Android"; break;#endif } } } int red = 0, green = 0, blue = 0, alpha = 0, depth = 0, doublebuffer = 0; SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &red); SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &green); SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &blue); SDL_GL_GetAttribute(SDL_GL_ALPHA_SIZE, &alpha); SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &depth); SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &doublebuffer); LogInfo << "Window: " << system << " r:" << red << " g:" << green << " b:" << blue << " a:" << alpha << " depth:" << depth << " aa:" << msaa << "x" << " doublebuffer:" << doublebuffer; break; } // Use the executable icon for the window#if ARX_PLATFORM == ARX_PLATFORM_WIN32 { SDL_SysWMinfo info; SDL_VERSION(&info.version); if(SDL_GetWindowWMInfo(m_window, &info) && info.subsystem == SDL_SYSWM_WINDOWS) { platform::WideString filename; filename.allocate(filename.capacity()); while(true) { DWORD size = GetModuleFileNameW(NULL, filename.data(), filename.size()); if(size < filename.size()) { filename.resize(size); break; } filename.allocate(filename.size() * 2); } HICON largeIcon = 0; HICON smallIcon = 0; ExtractIconExW(filename, 0, &largeIcon, &smallIcon, 1); if(smallIcon) { SendMessage(info.info.win.window, WM_SETICON, ICON_SMALL, LPARAM(smallIcon)); } if(largeIcon) { SendMessage(info.info.win.window, WM_SETICON, ICON_BIG, LPARAM(largeIcon)); } } }#endif setVSync(m_vsync); SDL_ShowWindow(m_window); SDL_ShowCursor(SDL_DISABLE); m_renderer->initialize(); onCreate(); onToggleFullscreen(m_fullscreen); updateSize(true); onShow(true); onFocus(true); return true;}
开发者ID:striezel,项目名称:ArxLibertatis,代码行数:101,
示例17: updateSizevoid StatusBarWidget::resizeEvent(QResizeEvent *event){ QStatusBar::resizeEvent(event); updateSize();}
开发者ID:RDCH106,项目名称:otter-browser,代码行数:6,
示例18: whilevoid SDL2Window::tick() { SDL_Event event; while(SDL_PollEvent(&event)) { switch(event.type) { case SDL_WINDOWEVENT: { switch(event.window.event) { case SDL_WINDOWEVENT_SHOWN: onShow(true); break; case SDL_WINDOWEVENT_HIDDEN: onShow(false); break; case SDL_WINDOWEVENT_EXPOSED: onPaint(); break; case SDL_WINDOWEVENT_MINIMIZED: onMinimize(); break; case SDL_WINDOWEVENT_MAXIMIZED: onMaximize(); break; case SDL_WINDOWEVENT_RESTORED: onRestore(); break; case SDL_WINDOWEVENT_FOCUS_GAINED: onFocus(true); break; case SDL_WINDOWEVENT_FOCUS_LOST: onFocus(false); break; case SDL_WINDOWEVENT_MOVED: { onMove(event.window.data1, event.window.data2); break; } case SDL_WINDOWEVENT_SIZE_CHANGED: { Vec2i newSize(event.window.data1, event.window.data2); if(newSize != m_size && !m_fullscreen) { m_renderer->beforeResize(false); updateSize(); } else { // SDL regrettably sends resize events when a fullscreen window // is minimized - we'll have none of that! } break; } case SDL_WINDOWEVENT_CLOSE: { // The user has requested to close a single window // TODO we only support one main window for now break; } } break; } case SDL_QUIT: { // The user has requested to close the whole program // TODO onDestroy() fits SDL_WINDOWEVENT_CLOSE better, but SDL captures Ctrl+C // evenst and *only* sends the SDL_QUIT event for them while normal close // generates *both* SDL_WINDOWEVENT_CLOSE and SDL_QUIT onDestroy(); return; // abort event loop! } } if(m_input) { m_input->onEvent(event); } } if(!m_renderer->isInitialized()) { updateSize(); m_renderer->afterResize(); m_renderer->SetViewport(Rect(m_size.x, m_size.y)); }}
开发者ID:striezel,项目名称:ArxLibertatis,代码行数:85,
示例19: updateSize////////////////////////////////////////////////////////////////////////////////// Get width////////////////////////////////////////////////////////////////////////////////float RichText::getWidth() const{ updateSize(); return mySize.x;}
开发者ID:Yalir,项目名称:RichText,代码行数:8,
示例20: updateSizevoid KWCanvasItem::pageSetupChanged(){ m_viewMode->pageSetupChanged(); updateSize();}
开发者ID:crayonink,项目名称:calligra-2,代码行数:5,
示例21: writeFullBoxHeadervoid ElementaryStreamDescriptorBox::writeBox(BitStream& bitstr) const{ writeFullBoxHeader(bitstr); bitstr.write8Bits(mES_Descriptor.ES_DescrTag); bool esSizeConverged = false; std::uint64_t esSizeSize; std::uint32_t esDescriptorSize = mES_Descriptor.size; BitStream esBitstr; /* Write the whole stuff, then figure out if we wrote the correct * size for it (we allos mES_Descriptor to be incorrect); rewrite * everything with the correct size. However, this may increase * the size due to bigger size having been written and thus moving * the remaining of the data forward, so we may need to loop even * thrice. */ while (!esSizeConverged) { esBitstr.clear(); esSizeSize = writeSize(esBitstr, esDescriptorSize); esBitstr.write16Bits(mES_Descriptor.ES_ID); esBitstr.write8Bits(mES_Descriptor.flags); if (mES_Descriptor.flags & 0x80) // streamDependenceFlag as defined in 7.2.6.5.1 of ISO/IEC 14486-1:2010(E) { esBitstr.write16Bits(mES_Descriptor.dependsOn_ES_ID); } if (mES_Descriptor.flags & 0x40) // URL_Flag as defined in 7.2.6.5.1 of ISO/IEC 14486-1:2010(E) { esBitstr.write8Bits(mES_Descriptor.URLlength); if (mES_Descriptor.URLlength) { esBitstr.writeString(mES_Descriptor.URLstring); } } if (mES_Descriptor.flags & 0x20) // OCRstreamFlag as defined in 7.2.6.5.1 of ISO/IEC 14486-1:2010(E) { esBitstr.write16Bits(mES_Descriptor.OCR_ES_Id); } esBitstr.write8Bits(mES_Descriptor.decConfigDescr.DecoderConfigDescrTag); BitStream decConfigBitstr; std::uint64_t decConfigSize = mES_Descriptor.decConfigDescr.size; std::uint64_t decConfigSizeSize; bool decConfigSizeConverged = false; while (!decConfigSizeConverged) { decConfigBitstr.clear(); decConfigSizeSize = writeSize(decConfigBitstr, static_cast<uint32_t>(decConfigSize)); decConfigBitstr.write8Bits(mES_Descriptor.decConfigDescr.objectTypeIndication); decConfigBitstr.write8Bits((mES_Descriptor.decConfigDescr.streamType << 2) | 0x01); decConfigBitstr.write24Bits(mES_Descriptor.decConfigDescr.bufferSizeDB); decConfigBitstr.write32Bits(mES_Descriptor.decConfigDescr.maxBitrate); decConfigBitstr.write32Bits(mES_Descriptor.decConfigDescr.avgBitrate); if (mES_Descriptor.decConfigDescr.decSpecificInfo.DecSpecificInfoTag == 5) { writeDecoderSpecificInfo(decConfigBitstr, mES_Descriptor.decConfigDescr.decSpecificInfo); } for (const auto& decSpecificInfo : mOtherDecSpecificInfo) { writeDecoderSpecificInfo(decConfigBitstr, decSpecificInfo); } decConfigSizeConverged = decConfigBitstr.getSize() == std::uint64_t(decConfigSize) + decConfigSizeSize; if (!decConfigSizeConverged) { decConfigSize = decConfigBitstr.getSize() - decConfigSizeSize; } } esBitstr.writeBitStream(decConfigBitstr); esSizeConverged = esBitstr.getSize() == std::uint64_t(esDescriptorSize) + esSizeSize; if (!esSizeConverged) { esDescriptorSize = std::uint32_t(esBitstr.getSize() - esSizeSize); } } bitstr.writeBitStream(esBitstr); updateSize(bitstr);}
开发者ID:jfiguinha,项目名称:Regards,代码行数:87,
示例22: updateSizevoid pn::WindowManager::resize(bool fullscreen, unsigned width, unsigned height) { mm::setWindowSize(m_window, width, height); updateSize(fullscreen, width, height);}
开发者ID:ryanjk,项目名称:PN-Game-Engine,代码行数:4,
示例23: Q_UNUSEDvoid Clock::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect){ Q_UNUSED(option); if (!m_time.isValid() || !m_date.isValid()) { return; } p->setPen(QPen(m_plainClockColor)); p->setRenderHint(QPainter::SmoothPixmapTransform); p->setRenderHint(QPainter::Antialiasing); /* ... helps debugging contentsRect and sizing ... QColor c = QColor(Qt::blue); c.setAlphaF(.5); p->setBrush(c); p->drawRect(contentsRect); */ // Paint the date, conditionally, and let us know afterwards how much // space is left for painting the time on top of it. QRectF dateRect; const QString timeString = KGlobal::locale()->formatTime(m_time, m_showSeconds); const QString fakeTimeString = KGlobal::locale()->formatTime(QTime(23,59,59), m_showSeconds); QFont smallFont = KGlobalSettings::smallestReadableFont(); //create the string for the date and/or the timezone if (m_dateStyle || showTimezone()) { QString dateString; //Create the localized date string if needed if (m_dateStyle) { // JPL This needs a complete rewrite for l10n issues QString day = KGlobal::locale()->calendar()->formatDate(m_date, KLocale::Day, KLocale::ShortNumber); QString month = KGlobal::locale()->calendar()->formatDate(m_date, KLocale::Month, KLocale::LongNumber); if (m_dateStyle == 1) { //compact date dateString = i18nc("@label Compact date: " "%1 day in the month, %2 month number", "%1/%2", day, month); } else if (m_dateStyle == 2) { //short date dateString = KGlobal::locale()->formatDate(m_date, KLocale::ShortDate); } else if (m_dateStyle == 3) { //long date dateString = KGlobal::locale()->formatDate(m_date, KLocale::LongDate); } else if (m_dateStyle == 4) { //ISO date dateString = KGlobal::locale()->formatDate(m_date, KLocale::IsoDate); } else { //shouldn't happen dateString = KGlobal::locale()->formatDate(m_date, KLocale::ShortDate); } if (showTimezone()) { QString currentTimezone = prettyTimezone(); dateString = i18nc("@label Date with currentTimezone: " "%1 day of the week with date, %2 currentTimezone", "%1 %2", dateString, currentTimezone); } } else if (showTimezone()) { dateString = prettyTimezone(); } dateString = dateString.trimmed(); if (m_dateString != dateString) { // If this string has changed (for example due to changes in the config // we have to reset the sizing of the applet m_dateString = dateString; updateSize(); } // Check sizes // magic 10 is for very big spaces, // where there's enough space to grow without harming time space QFontMetrics fm(smallFont); if (contentsRect.height() > contentsRect.width() * 2) { //kDebug() << Plasma::Vertical << contentsRect.height() <<contentsRect.width() * 2; QRect dateRect = contentsRect; dateRect.setHeight(dateRect.width()); smallFont.setPixelSize(qMax(dateRect.height() / 2, fm.ascent())); m_dateRect = preparePainter(p, dateRect, smallFont, dateString); } else { // Find a suitable size for the date font if (formFactor() == Plasma::Vertical) { smallFont.setPixelSize(qMax(contentsRect.height()/6, fm.ascent())); } else if (formFactor() == Plasma::Horizontal) { smallFont.setPixelSize(qMax(qMin(contentsRect.height(), contentsRect.width())*2/7, fm.ascent())); //we want to write the date always on one line fm = QFontMetrics(smallFont); const int tempWidth = fm.width(dateString); if(tempWidth > contentsRect.width()){ smallFont.setPixelSize((contentsRect.width() * smallFont.pixelSize())/tempWidth); } } else { smallFont.setPixelSize(qMax(qMin(contentsRect.height(), contentsRect.width())/8, KGlobalSettings::smallestReadableFont().pointSize())); } m_dateRect = preparePainter(p, contentsRect, smallFont, dateString); }//.........这里部分代码省略.........
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:101,
示例24: setSize void setSize(int xSize, int ySize) { MoveWindow(windowHandle, xPosition, yPosition, xSize, ySize, TRUE); updateSize(); }
开发者ID:sopyer,项目名称:Shadowgrounds,代码行数:5,
注:本文中的updateSize函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ updateSpeed函数代码示例 C++ updateShape函数代码示例 |