From patchwork Fri Jul 15 19:13:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Utkarsh Tiwari X-Patchwork-Id: 16659 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 633F0BE173 for ; Fri, 15 Jul 2022 19:14:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 12ACB6331F; Fri, 15 Jul 2022 21:14:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657912456; bh=3mc+syPrI82F4rhVHk8MS62FrCry/Q0jomW8Ex+wT7c=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=0lVFQJdGUgEs/w3ezmkBqtEJReR7h1oct7xIMImV7z76PYtCSVvBc2goetsAfUIMm OrKbw1ZMRsIljd3JGreq44AqM8LHGABi9JwCI1TrixqDju+mnJhLPnd/EadYDddyMf 3z6Kt7buZjhI4rIdxQ0qIskGafSaLM8OwFp4c3ZD2dvtI37Ix0Qu1y6+48DyiBFMtI QGQwXrd6adKmARnroD7bKmqnccEMZiETtzAkyxyaaTjtm44S7uDQwWnatyqVXgGvQV sZiEoiMBc0xs8nUVcOxBRi0vqtmV8VxOeJ3Tx7bsBUwBxQkCGs3kSOJJ+YGQalnKGi DExNZpqWLnSEg== Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 061F36330F for ; Fri, 15 Jul 2022 21:14:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="c8nnjqr/"; dkim-atps=neutral Received: by mail-pj1-x1029.google.com with SMTP id q5-20020a17090a304500b001efcc885cc4so6986807pjl.4 for ; Fri, 15 Jul 2022 12:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CcoTbYUj3cSt0YMH+9NqHU45gZLE6JusliHQMFRScRI=; b=c8nnjqr/6QhoQyHyftjONYBBPk/QegLJX35iEnEI2whK+y/UBVAiijTyu8p2GpcsGQ JtnTzXmkYTidnKq1/Okov8vOKl62PFh0qWE8eV8ldmbyx+L4bEM/dkF727WTsqOZNZ6k HcB+lXkSKTUUvLFsCst7vNA2MjX0SwKBdLUK01MIhMfvpiyItgt5kIrvJE/uZjtubyZY BanvYCAVO5SXzanTeX0UeYXupySY80kodqbkaqWgGi4k9i7D9g2VumVzAsha7iMDyHeG zUgYZ/R5b7vF5GeGQh2E2Z/vpdxsmcUlrobIK1IuE76bYiQpulM5keZxWUNByy3rbrMh ue8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CcoTbYUj3cSt0YMH+9NqHU45gZLE6JusliHQMFRScRI=; b=CI63XLfXdC0lBPo+qYEWZd2lFHh2E8yfc+3w3fl22BF7gXO8osnuuQmPIqs/jsrOQw wHeGY7PN6xme57kmicxc0VElE8alfkzdGBgzr+k7z7U49ssIqvpcaqUfZj4Mlev4aV7e K+5sH1lqRDZRE7TparieS5nhS1D/wtQKnvND+jdfpz9jOwfs18Cm+ToW77lkIF47kcpI SkagBc9fQM7oeHTce7TRw0UDLZ7voGGCAnT/TkT0o90BzQrdScDw28MjF7KxUsRz5bHn 3/TDpMv8jajG5LiW5+XAb/14erZfX500kOT6ZVHwqQMbEwnoU9e18s0kOZVXuqahrJFs fU6g== X-Gm-Message-State: AJIora/oSsoq0A2a7YnS/AMJsVqLtwVqy6COClAphJmyLU/xujCf3ws/ I+fFjalErOPqox45FDRAudsDPsBJU493Tw== X-Google-Smtp-Source: AGRyM1ts4KofZ4srBp/IWk50Gjzv2erxS9lTF69z2ha2MOlFul/Xgof2lCdzx1oMT1grkW9qyLy0Fw== X-Received: by 2002:a17:902:aa06:b0:16c:cf06:c2d0 with SMTP id be6-20020a170902aa0600b0016ccf06c2d0mr2549587plb.117.1657912452320; Fri, 15 Jul 2022 12:14:12 -0700 (PDT) Received: from localhost.localdomain ([2406:3003:2005:1c27:d8e8:f9ac:919c:9ac8]) by smtp.gmail.com with ESMTPSA id s10-20020a170903214a00b0016be834d544sm3834315ple.237.2022.07.15.12.14.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 12:14:12 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sat, 16 Jul 2022 03:13:53 +0800 Message-Id: <20220715191400.890976-5-utkarsh02t@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220715191400.890976-1-utkarsh02t@gmail.com> References: <20220715191400.890976-1-utkarsh02t@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 04/11] qcam: ControlsTab: Implement QScrollArea X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Utkarsh Tiwari via libcamera-devel From: Utkarsh Tiwari Reply-To: Utkarsh Tiwari Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If the camera has lots of controls it can overrun the screen. Fix this by using a QScrollArea. Signed-off-by: Utkarsh Tiwari --- src/qcam/settings/controls_tab.cpp | 9 +++++++-- src/qcam/settings/controls_tab.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/qcam/settings/controls_tab.cpp b/src/qcam/settings/controls_tab.cpp index 0777d708..30899783 100644 --- a/src/qcam/settings/controls_tab.cpp +++ b/src/qcam/settings/controls_tab.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include "control_frame.h" @@ -21,10 +22,11 @@ using namespace libcamera; ControlsTab::ControlsTab(std::shared_ptr camera_, QWidget *parent) - : QWidget(parent), controlList_(std::make_shared()) + : QScrollArea(parent), controlList_(std::make_shared()) { + QWidget *containerWidget = new QWidget(this); /* Main Layout for the tab */ - QGridLayout *controlGLayout = new QGridLayout(this); + QGridLayout *controlGLayout = new QGridLayout(containerWidget); int controlCount = 0; for (auto &[control, info] : camera_->controls()) { @@ -39,6 +41,9 @@ ControlsTab::ControlsTab(std::shared_ptr camera_, if (controlCount == 0) controlGLayout->addWidget(new QLabel("No controls available")); + + /* Set widget and policies for the scrollarea */ + setWidget(containerWidget); } /* ----------------------------------------------------------------------------- diff --git a/src/qcam/settings/controls_tab.h b/src/qcam/settings/controls_tab.h index 5bac7d48..28efd35e 100644 --- a/src/qcam/settings/controls_tab.h +++ b/src/qcam/settings/controls_tab.h @@ -11,10 +11,11 @@ #include +#include #include #include -class ControlsTab : public QWidget +class ControlsTab : public QScrollArea { Q_OBJECT