Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QCamera (on Windows 7) re-sizing does not work, window grows only bigger not smaller.
Qt 6.11 is out! See what's new in the release blog

QCamera (on Windows 7) re-sizing does not work, window grows only bigger not smaller.

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 404 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cnc-bert
    wrote on last edited by
    #1

    I just want a simple Camera webcam vieuwer in my App.

    The code below works, but the window can only be size bigger, smaller does not work.
    Also KeepaspectRation isnt working,etither

    1. How can I solve this?
    2. I want to draw a simple cross with 2 lines over the camera image view, how can I do that?
    3. How can I show the image in e.g. a QLabel?

    This is my code, standard Qt creator project:

    CameraWindow::CameraWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::CameraWindow)
    {
    ui->setupUi(this);

    //QAbstractVideoSurface
    
    camera = new QCamera;
    viewFinder = new QCameraViewfinder;
    viewFinder->setAspectRatioMode(Qt::KeepAspectRatioByExpanding);
    viewFinder->show();
    
    camera->setViewfinder(viewFinder);
    camera->setCaptureMode(QCamera::CaptureStillImage);
    camera->start();
    this->setCentralWidget(viewFinder);
    

    }

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved