From patchwork Fri Aug 12 12:46:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Utkarsh Tiwari X-Patchwork-Id: 17100 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 73393BE173 for ; Fri, 12 Aug 2022 12:47:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 29FA86332C; Fri, 12 Aug 2022 14:47:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660308434; 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=oVQo44/ZPjtX0RHG4C+T19FMelzhp7x80xUW4N8OBEAJDjB29Q7GDzD8NGBLfM0Hd fAHxYAIi/46hRUgjrpH2fz4Q67DFleIWvKO8/Mv2twseHMhfZmxGyS5+OO3RbNPL1k ihLPW2LGNqTpPF+pj0saNh8hLqgSHpuWczqogfH6X991AMO1jk2O85NSI9j8AJRqSq FfskvJuXEcOi3Uq46ZrRSEFsJ5nRMSNX2eofuj6R1VKQuuIl6/cTLJv8N3XZ2ZS0X8 yxfWzoaNiI+JNtOam6cOtty/g6D3tNtS8W41nENAYxL1kZ2arIygF5PiKvppuvhPbr w81ex0A0CH0jQ== 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 93FDF63328 for ; Fri, 12 Aug 2022 14:47:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lJ/DKbTP"; dkim-atps=neutral Received: by mail-pj1-x1029.google.com with SMTP id ha11so921810pjb.2 for ; Fri, 12 Aug 2022 05:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=CcoTbYUj3cSt0YMH+9NqHU45gZLE6JusliHQMFRScRI=; b=lJ/DKbTPbFjd17l3JGM6dJPQO9W613j1FcUVpzfV3uuqVVd0tb8rybCj7upu8hfGGr zZJOaYRNiaex1JHTXbA3m6xPXW80CdeK294cjhfLaZ4bVE8EE6wh3/aoyUr/vY+1TSk9 tw9ujrXXkTI9QDcdDJL41TSYrlbyTShlkUSUe17g6vHO03CamGMvJbHhmqqsCzEf1wSx 6PM5+/Su1t/2HOfTn2wWpJh3PhMPZe745Sm0SMUmiuwGCgP5F7UzIzCj6v6Fqxa5BzF/ bq9mmY0F2kQ2FMM2kjzm/DH0kj3zPeKY5TabTIhlHmGcU25YULL7yoCrvwuHNfMoM0k7 Zkuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=CcoTbYUj3cSt0YMH+9NqHU45gZLE6JusliHQMFRScRI=; b=1zXgsPAYiCnxFRwUhgT07IHEqHSn2KIDAyLH8DCHcDeUSaJ+x5hfIlp75l1vw20B9P Oxjhdf6uSU36oiT0pxTWvnCo/qkVYRIueRNseWJR49Nlkdwaqxu96WYp4gIgIkS//KEA M1WyQ8Ok6gp4IVg6rYU4LXUVIDAJqkLb8ZYmuA7D5fTDUPhXPREOIggd9HFz0GhK+ozD R7vmy1l6E80vikYvYPinkVa3EHwIyCO4JBnETfzqD7MY4Z8X/Um9CRqpb1ibnERgA+vC OwHe8mGhCIkflAZ74rgtVANANfXgnO0hoqDZgQXK2YAYqaDb/kjNUdUvYJ1Rr0pQULKn I4wA== X-Gm-Message-State: ACgBeo2SKo3sRU1X0P2+7erLB2sFEECIRIQIkpHN1rpOwMDYx24nMItm OCqHesH1rWOJQdFnJ7DKUtn7FtHPx/Q= X-Google-Smtp-Source: AA6agR525tLOb329TyGMh1K2yBfZ8CJKc4XTKUmn3+msOTkr2walvgcpWrc+rKRd4aeL53OhfvMrAg== X-Received: by 2002:a17:90a:1912:b0:1f7:8c6c:4fde with SMTP id 18-20020a17090a191200b001f78c6c4fdemr4067484pjg.8.1660308430794; Fri, 12 Aug 2022 05:47:10 -0700 (PDT) Received: from localhost.localdomain ([2404:bd00:3:dc0d:d8e:96a2:2dbe:5a83]) by smtp.gmail.com with ESMTPSA id e6-20020a17090a728600b001f069352d73sm1431785pjg.25.2022.08.12.05.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 05:47:10 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 12 Aug 2022 18:16:44 +0530 Message-Id: <20220812124651.27496-5-utkarsh02t@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812124651.27496-1-utkarsh02t@gmail.com> References: <20220812124651.27496-1-utkarsh02t@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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