Skip to content
  • 0 Votes
    3 Posts
    803 Views
    P

    @Bonnie said in UI Stretch with QtCreator:

    Because the three layout widgets are not added to any layout. They are child widgets of centralWidget, but they are not added to its layout.
    A widget will only be resized and moved to fit the window when it is added to a layout whose parent widget is either the window or also added to an layout whose.....

    Thanks for help me, that works

  • zooming an SVG image

    Unsolved QML and Qt Quick
    1
    0 Votes
    1 Posts
    624 Views
    No one has replied
  • 0 Votes
    1 Posts
    261 Views
    No one has replied
  • 0 Votes
    3 Posts
    628 Views
    Gojir4G

    @galou_breizh
    I think point_size is too small and the ellipse generated is "pixelated" because of that.

    This gives a nice circle filled with blue

    # -*- coding: utf-8 -*- """Show an incomprehension in setScale for QGraphicsItemGroup.""" from PySide2 import QtCore from PySide2 import QtGui from PySide2 import QtWidgets point_size = 10.0 # In real-world units. # Get entrypoint through which we control underlying Qt framework app = QtWidgets.QApplication([]) scene = QtWidgets.QGraphicsScene() group = QtWidgets.QGraphicsItemGroup() scale = 50.0 # 1 real-world units = 500 px. !! Has no apparent effect. pen = QtGui.QPen(QtCore.Qt.red) brush = QtGui.QBrush(QtCore.Qt.blue) x = 1.0 # Real-world units. y = 2.0 # Real-world units. top_left = (x - point_size / 2.0, y - point_size / 2.0) ellipse = QtWidgets.QGraphicsEllipseItem( QtCore.QRectF(*top_left, point_size, point_size)) ellipse.setPen(pen) ellipse.setBrush(brush) ellipse.setScale(scale) group.addToGroup(ellipse) # group.setScale(scale) scene.addItem(group) view = QtWidgets.QGraphicsView(scene) view.show() # Start Qt/PySide2 application. If we don't show any windows, the # app would just loop at this point without the means to exit app.exec_()
  • 0 Votes
    4 Posts
    719 Views
    Gojir4G

    @galou_breizh I answered in the other post. But it's not a good way to duplicate post for the same issue. Please try to avoid it in the future, thanks

  • 0 Votes
    3 Posts
    509 Views
    C

    @KillerSmath Time is not a problem, in my app I don't revert animation immediately but on user request and the problem still occurrs.
    Actually I've found a solution : simply remove Transition and instead of this use Behavior on

  • 0 Votes
    2 Posts
    808 Views
    delamorD

    If found the way by myself, if this can help to someone, is a question of attaching the texture again and change it before the fbo generation.

    Like:
    ```
    glBindTexture(GL_TEXTURE_2D, d->fbo->texture());
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // Linear Filtering
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Linear Filtering

  • 0 Votes
    3 Posts
    2k Views
    J

    Thanks for your reply.

    This seems to have improved the situation somewhat, as I can now see the red image when I click. However, the original image seems to be overlayed over the top of the red image with a level of transparency. It's almost like the visible: false parameter is changed when the MouseArea is clicked?

    It's somewhat hard to explain, hopefully the above makes sense?

    If not, I can put together some screenshots to demonstrate the issue?

    EDIT: Never mind, it looks like user error after all! I had the z-order configured incorrectly, so the drop shadow was being drawn on top of the image rather than underneath it. Thanks again for your help!

  • 0 Votes
    3 Posts
    2k Views
    aragatsA

    @Konstantin-Tokarev , thanks!
    QGraphicsView::scale() works great.

  • 0 Votes
    3 Posts
    4k Views
    ?

    You can add a widget to the scene using QGraphicsProxyWidget *QGraphicsScene::addWidget(QWidget *widget, Qt::WindowFlags wFlags = Qt::WindowFlags()).

  • 1 Votes
    2 Posts
    2k Views
    pauleddP

    I think I found a solution. I roughly quadrupled the QCameraViewfinder size and repositioned it to the middle.
    Its all done with "cameraVf->setGeometry(x,y,x,y);". And I parented the viewfinder to a new QFrame
    to have a frame and to have the viewfinder not overlaying the start button.

    alt text

    mainwindow.cpp

    ... QFrame *frameVideo = new QFrame(frame4); // extra frame where the video is in frameVideo->setGeometry(5,35,375,380); camera = new QCamera("/dev/video0"); cameraVf = new QCameraViewfinder(frameVideo); camera->setViewfinder(cameraVf); cameraVf->setGeometry(0,0,375,380); QCameraViewfinderSettings vfsettings; vfsettings.setPixelFormat(QVideoFrame::Format_YUV420P); vfsettings.setResolution(640,480); camera->setViewfinderSettings(vfsettings); cameraVf->show(); ... void MainWindow::onZoomClicked(){ if(cameraVf->width() != 1600) { cameraVf->setGeometry(-590,-490,1600,1440); // zoom in } else { cameraVf->setGeometry(0,0,375,380); // zoom out } }
  • 0 Votes
    6 Posts
    2k Views
    J

    @mrjj yeah its not, but thanks though

  • 0 Votes
    1 Posts
    656 Views
    No one has replied
  • 0 Votes
    7 Posts
    3k Views
    AlvaroSA

    @mrjj Yes it seems that...
    So now it is solved ;)

    Thanks a lot.

  • 0 Votes
    3 Posts
    3k Views
    M

    Hi @Lisbetti,

    Your question reminds me of a real-time "zoom" feature that clones part of a component that I've just developed using ShaderEffectSource.

    ShaderEffectSource allows to select, in real time and with high performance, a part of a component and display it in another larger rectangle for zooming in.

    // To add to your "source" component. MouseArea { id: iMouseArea anchors.fill: parent hoverEnabled: true propagateComposedEvents: true onPositionChanged:(mouse) => { // Allow events to be transmitted to components below. mouse.accepted = false iShaderEffectSource.sourceRect = Qt.rect(mouse.x-75, mouse.y-50, 150, 100) } } ... Rectangle { id: iRectDest width: 300 height: 200 anchors.right: parent.right ShaderEffectSource { id: iShaderEffectSource anchors.fill: parent sourceItem: iRectSrc /* Preserve visual quality. */ textureSize: Qt.size(iRectDest.width, iRectDest.height) }
  • 0 Votes
    5 Posts
    10k Views
    mrjjM

    ah ok.
    Good to know that it will (try) to scale an image to 0,0 :)

    Remember to flag as solved if your happy.

  • 0 Votes
    2 Posts
    4k Views
    K

    @HappyCoder

    Out of personal experience I recommend also to ask your question on QWT mailing list
    AFAIK QWT is still independent and only based on Qt libs. Uwe has been monitoring this forum in the past, but answers are potentially faster through QWT mailing list.

  • 0 Votes
    2 Posts
    1k Views
    P

    Yeah I solved it.
    It had something to do with the break layout button in the designer mode.

  • 0 Votes
    34 Posts
    13k Views
    SGaistS

    Looks like a bug, you should check on the bug report system