Apollo 11.0
自动驾驶开放平台
fixedaspectratiowidget.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include <QtCore/QTimer>
20#include <memory>
21
23
24class FixedAspectRatioWidget : public QWidget {
25 Q_OBJECT
26
27 public:
28 explicit FixedAspectRatioWidget(QWidget *parent = nullptr, int index = 0);
29
30 bool is_init(void) const { return viewer_.is_init_; }
31 void SetupDynamicTexture(const std::shared_ptr<Texture> &textureObj);
32
33 void set_index(int i) { index_ = i; }
34 int index(void) const { return index_; }
35
36 void StartOrStopUpdate(bool b);
37 int innerHeight(void) { return viewer_.plane_.texHeight(); }
38
39 signals:
41
42 protected:
43 void mouseDoubleClickEvent(QMouseEvent *event) override;
44 void contextMenuEvent(QContextMenuEvent *) override;
45 void resizeEvent(QResizeEvent *) override;
46 void paintEvent(QPaintEvent *event) override;
47
48 private:
49 int index_;
50 QTimer refresh_timer_;
51 VideoImgViewer viewer_;
52};
void contextMenuEvent(QContextMenuEvent *) override
void resizeEvent(QResizeEvent *) override
void paintEvent(QPaintEvent *event) override
void SetupDynamicTexture(const std::shared_ptr< Texture > &textureObj)
void mouseDoubleClickEvent(QMouseEvent *event) override
void focusOnThis(FixedAspectRatioWidget *)
GLsizei texHeight(void) const
Definition plane.h:48