bool RenderWidget::updateWidgetGeometry() { if (!m_widget->transformsAffectFrameRect()) return setWidgetGeometry(absoluteContentBox()); LayoutRect contentBox = contentBoxRect(); LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).boundingBox()); if (m_widget->isFrameView()) { contentBox.setLocation(absoluteContentBox.location()); return setWidgetGeometry(contentBox); } return setWidgetGeometry(absoluteContentBox); }
bool RenderWidget::updateWidgetGeometry() { Widget* widget = this->widget(); ASSERT(widget); LayoutRect contentBox = contentBoxRect(); LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).boundingBox()); if (widget->isFrameView()) { contentBox.setLocation(absoluteContentBox.location()); return setWidgetGeometry(contentBox); } return setWidgetGeometry(absoluteContentBox); }
bool LayoutPart::updateWidgetGeometryInternal() { Widget* widget = this->widget(); ASSERT(widget); LayoutRect contentBox = contentBoxRect(); LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(FloatRect(contentBox))).boundingBox()); if (widget->isFrameView()) { if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) contentBox.setLocation(absoluteContentBox.location()); return setWidgetGeometry(contentBox); } // TODO(chrishtr): why are these widgets using an absolute rect for their frameRect? return setWidgetGeometry(absoluteContentBox); }
void RenderWidget::setWidget(Widget* widget) { if (widget != m_widget) { if (m_widget) { m_widget->removeFromParent(); widgetRendererMap().remove(m_widget); deleteWidget(); } m_widget = widget; if (m_widget) { widgetRendererMap().add(m_widget, this); // if we've already received a layout, apply the calculated space to the // widget immediately, but we have to have really been full constructed (with a non-null // style pointer). if (style()) { if (!needsLayout()) setWidgetGeometry(absoluteContentBox()); if (style()->visibility() != VISIBLE) m_widget->hide(); else m_widget->show(); } m_view->addChild(m_widget); } } }
void QuteWidget::applyInternalProperties() { // qDebug() << "QuteWidget::applyInternalProperties()"; #ifdef USE_WIDGET_MUTEX widgetLock.lockForRead(); #endif int x,y,width, height; x = property("QCS_x").toInt(); y = property("QCS_y").toInt(); width = property("QCS_width").toInt(); height = property("QCS_height").toInt(); setWidgetGeometry(x,y,width, height); m_channel = property("QCS_objectName").toString(); m_channel2 = property("QCS_objectName2").toString(); m_midicc = property("QCS_midicc").toInt(); m_midichan = property("QCS_midichan").toInt(); setVisible(property("QCS_visible").toBool()); m_valueChanged = true; #ifdef USE_WIDGET_MUTEX widgetLock.unlock(); #endif }
/** * 处理内容:UI初始化 * @param void * @return void */ void MainWnd::initUi() { // 去除系统标题栏 #if defined(Q_OS_UNIX) || defined(Q_OS_LINUX) setWindowFlags(Qt::FramelessWindowHint/* | Qt::Dialog | Qt::WindowStaysOnBottomHint | Qt::X11BypassWindowManagerHint*/); #else setWindowFlags(Qt::FramelessWindowHint); #endif // 创建窗体控件 createWidget(); // 创建布局 createLayout(); // 设置窗体风格(qss样式) setWidgetStyle(); //设置窗体尺寸大小 setWidgetGeometry(); // 创建快捷方式 createDesktopLnk(); }