UBMagnifier::UBMagnifier(QWidget *parent, bool isInteractive) : QWidget(parent, parent ? Qt::Widget : Qt::Tool | (Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint)) , mShouldMoveWidget(false) , mShouldResizeWidget(false) , borderPen(Qt::darkGray) , gView(0) , mView(0) { isCusrsorAlreadyStored = false; setMouseTracking(true); //--------------------------------------------------// QPixmap pix(":/images/cursors/resize.png"); QTransform tr; tr.rotate(45); mResizeCursor = QCursor(pix.transformed(tr, Qt::SmoothTransformation), pix.width() / 2, pix.height() / 2); //--------------------------------------------------// params.sizePercentFromScene = 20; m_isInteractive = isInteractive; sClosePixmap = new QPixmap(":/images/close.svg"); sIncreasePixmap = new QPixmap(":/images/increase.svg"); sDecreasePixmap = new QPixmap(":/images/decrease.svg"); mResizeItem = new QPixmap(":/images/resize.svg"); sChangeModePixmap = new QPixmap(); setDrawingMode(UBSettings::settings()->magnifierDrawingMode->get().toInt()); if (parent) { setAttribute(Qt::WA_NoMousePropagation); } else { // standalone window // !!!! Should be included into Windows after QT recompilation #ifndef Q_WS_WIN // setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_MacAlwaysShowToolWindow); #endif #ifdef Q_WS_MAC setAttribute(Qt::WA_MacAlwaysShowToolWindow); setAttribute(Qt::WA_MacNonActivatingToolWindow); setAttribute(Qt::WA_MacNoShadow); #endif } connect(&mRefreshTimer, SIGNAL(timeout()), this, SLOT(slot_refresh())); }
void CC3MeshParticleEmitter::setParticleTemplateMesh( CC3Mesh* aMesh ) { if (aMesh == m_pParticleTemplateMesh) return; CC_SAFE_RELEASE( m_pParticleTemplateMesh ); m_pParticleTemplateMesh = aMesh; CC_SAFE_RETAIN( aMesh ); // Add vertex content if not already set, and align the drawing mode if ( getVertexContentTypes() == kCC3VertexContentNone ) setVertexContentTypes( aMesh->getVertexContentTypes() ); setDrawingMode( aMesh->getDrawingMode() ); CC3_TRACE( "[ptc]Particle template mesh of CC3MeshParticleEmitter set to %s drawing %s with %d vertices and %d vertex indices", aMesh->fullDescription().c_str(), stringFromGLEnum(getDrawingMode()).c_str(), aMesh->getVertexCount(), aMesh->getVertexIndexCount() ); }
void CC3ShadowVolumeMeshNode::setShouldDrawTerminator( bool shouldDraw ) { _shouldDrawTerminator = shouldDraw; setDrawingMode( _shouldDrawTerminator ? GL_LINES : GL_TRIANGLES ); checkShadowMaterial(); }
QSGGeometry *ItemListItem::createSGGeometry() { auto geometry = new QSGGeometry(QSGGeometry::defaultAttributes_ColoredPoint2D(), 0); geometry->setDrawingMode(GL_TRIANGLES); return geometry; }