本文整理汇总了C++中QDockWidget::setMaximumHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ QDockWidget::setMaximumHeight方法的具体用法?C++ QDockWidget::setMaximumHeight怎么用?C++ QDockWidget::setMaximumHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDockWidget
的用法示例。
在下文中一共展示了QDockWidget::setMaximumHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newDisplayWidget
void LogViewer::newDisplayWidget(QWidget* widget, std::string title)
{
if (title != "Top Image" && title != "Bottom Image")
{
QDockWidget* dockWidget =
new QDockWidget(QString(title.data()), this);
dockWidget->setMinimumWidth(300);
dockWidget->setMaximumHeight(800);
dockWidget->setWidget(widget);
dockWidgets.push_back(dockWidget);
this->addDockWidget(Qt::RightDockWidgetArea, dockWidget);
}
else
{
imageTabs.addTab(widget, QString(title.data()));
}
}
示例2: FastYUVToBMPImage
MemoryViewer::MemoryViewer(RobotMemoryManager::const_ptr memoryManager) :
memoryManager(memoryManager) {
MRawImages::const_ptr rawImages = memoryManager->getMemory()->get<MRawImages>();
FastYUVToBMPImage* rawTopBMP = new FastYUVToBMPImage(rawImages, Camera::TOP, this);
FastYUVToBMPImage* rawBottomBMP = new FastYUVToBMPImage(rawImages, Camera::BOTTOM, this);
VisualInfoImage* shapesBottom = new VisualInfoImage(memoryManager->getMemory()->get<MVision>(),
Camera::BOTTOM);
VisualInfoImage* shapesTop = new VisualInfoImage(memoryManager->getMemory()->get<MVision>(),
Camera::TOP);
OverlayedImage* comboBottom = new OverlayedImage(rawBottomBMP, shapesBottom, this);
OverlayedImage* comboTop = new OverlayedImage(rawTopBMP, shapesTop, this);
BMPImageViewer* bottomImageViewer = new BMPImageViewer(comboBottom, this);
BMPImageViewer* topImageViewer = new BMPImageViewer(comboTop, this);
BMPImageViewer* top = new BMPImageViewer(comboTop, this);
BMPImageViewer* bottom = new BMPImageViewer(comboBottom, this);
QHBoxLayout* mainLayout = new QHBoxLayout;
QWidget* mainWidget = new QWidget;
QTabWidget* imageTabs = new QTabWidget();
imageTabs->addTab(topImageViewer, QString("Top Image"));
imageTabs->addTab(bottomImageViewer, QString("Bottom Image"));
mainLayout->addWidget(imageTabs);
mainWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
mainWidget->setLayout(mainLayout);
this->setCentralWidget(mainWidget);
//TODO: we call updateView twice per vision frame
memoryManager->connectSlot(bottomImageViewer, SLOT(updateView()), "MVision");
memoryManager->connectSlot(topImageViewer, SLOT(updateView()), "MVision");
//need another set of these to connect the BMPImageViewer copies (top, bottom)
memoryManager->connectSlot(bottom, SLOT(updateView()), "MVision");
memoryManager->connectSlot(top, SLOT(updateView()), "MVision");
//corner ownership
this->setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
this->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
Memory::const_ptr memory = memoryManager->getMemory();
std::vector<QTreeView> messageViewers;
for (Memory::const_iterator iterator = memory->begin(); iterator != memory->end(); iterator++) {
if (iterator->first != "MRawImages" && iterator->first != "GroundTruth") {
QDockWidget* dockWidget = new QDockWidget(QString(iterator->first.c_str()), this);
dockWidget->setMinimumWidth(300);
dockWidget->setMaximumHeight(125);
MObjectViewer* view = new MObjectViewer(iterator->second, dockWidget);
dockWidget->setWidget(view);
this->addDockWidget(Qt::RightDockWidgetArea, dockWidget);
memoryManager->connectSlot(view, SLOT(updateView()), iterator->first);
}
}
}
示例3: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->resize(800,680);
this->setWindowState(Qt::WindowMaximized);
ImageItem *image = new ImageItem();
//create ColorSelection
ColorSelection *CS1 = new ColorSelection(Qt::black);
ColorSelection *CS2 = new ColorSelection(Qt::white);
QObject::connect(CS1,SIGNAL(changeColor(QColor)),image,SLOT(setColor1(QColor)));
QObject::connect(image->getPipette(),SIGNAL(changeColor1(QColor)),CS1,SLOT(setColor(QColor)));
QObject::connect(CS2,SIGNAL(changeColor(QColor)),image,SLOT(setColor2(QColor)));
QObject::connect(image->getPipette(),SIGNAL(changeColor2(QColor)),CS2,SLOT(setColor(QColor)));
QHBoxLayout *Hlayout = new QHBoxLayout();
Hlayout->addStretch(5);
Hlayout->addWidget(CS1);
Hlayout->addWidget(CS2);
Hlayout->addStretch(5);
//Create slider
QSlider *slider = new QSlider(Qt::Horizontal);
slider->setMaximum(100);
slider->setMinimum(1);
slider->setValue(10);
QObject::connect(slider,SIGNAL(valueChanged(int)),image,SLOT(setSize(int)));
QVBoxLayout *Blayout = new QVBoxLayout();
Blayout->addWidget(slider);
Blayout->addLayout(Hlayout);
QWidget *wdg = new QWidget();
wdg->setLayout(Blayout);
// Create Dock
//
//
QDockWidget *dock = new QDockWidget(tr("Настройка"),this);
dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
wdg->setFixedSize(200,100);
dock->setWidget(wdg);
dock->setMaximumHeight(300);
dock->setMaximumWidth(300);
addDockWidget(Qt::RightDockWidgetArea,dock);
QActionGroup *GP = new QActionGroup(this);
GP->addAction(ui->actionPencil);
GP->addAction(ui->actionEraser);
GP->addAction(ui->actionEllipse);
GP->addAction(ui->actionRectangle);
GP->addAction(ui->actionLine);
GP->addAction(ui->actionCurveLine);
GP->addAction(ui->actionFill);
GP->addAction(ui->actionPipette);
GP->addAction(ui->actionSelection);
GP->setExclusive(true);
//create tool bar
QToolBar *TB = new QToolBar();
TB->setAllowedAreas(Qt::TopToolBarArea | Qt::LeftToolBarArea);
TB->setFloatable(false);
TB->setMovable(true);
TB->insertAction(0,ui->actionSaveAs);
TB->insertAction(ui->actionSaveAs,ui->actionSave);
TB->insertAction(ui->actionSave,ui->actionOpen);
TB->insertAction(ui->actionOpen,ui->actionCreate);
TB->addSeparator();
TB->insertAction(0,ui->actionSelection);
TB->insertAction(ui->actionSelection,ui->actionPipette);
TB->insertAction(ui->actionPipette,ui->actionFill);
TB->insertAction(ui->actionFill,ui->actionCurveLine);
TB->insertAction(ui->actionCurveLine,ui->actionLine);
TB->insertAction(ui->actionLine,ui->actionRectangle);
TB->insertAction(ui->actionRectangle,ui->actionEllipse);
TB->insertAction(ui->actionEllipse,ui->actionEraser);
TB->insertAction(ui->actionEraser,ui->actionPencil);
addToolBar(Qt::TopToolBarArea, TB);
// create action connecting
QObject::connect(ui->actionOpen,SIGNAL(triggered(bool)),image,SLOT(open()));
QObject::connect(ui->actionSaveAs,SIGNAL(triggered(bool)),image,SLOT(saveAs()));
QObject::connect(ui->actionSave,SIGNAL(triggered(bool)),image,SLOT(save()));
QObject::connect(ui->actionPencil,SIGNAL(toggled(bool)),image,SLOT(setPencil(bool)));
QObject::connect(ui->actionEraser,SIGNAL(toggled(bool)),image,SLOT(setEraser(bool)));
QObject::connect(ui->actionEllipse,SIGNAL(toggled(bool)),image,SLOT(setEllipse(bool)));
QObject::connect(ui->actionRectangle,SIGNAL(toggled(bool)),image,SLOT(setRectangle(bool)));
QObject::connect(ui->actionLine,SIGNAL(toggled(bool)),image,SLOT(setLine(bool)));
QObject::connect(ui->actionCurveLine,SIGNAL(toggled(bool)),image,SLOT(setCurveLine(bool)));
QObject::connect(ui->actionFill,SIGNAL(toggled(bool)),image,SLOT(setFill(bool)));
QObject::connect(ui->actionPipette,SIGNAL(toggled(bool)),image,SLOT(setPipette(bool)));
QObject::connect(ui->actionSelection,SIGNAL(toggled(bool)),image,SLOT(setSelection(bool)));
//undo and redo
//.........这里部分代码省略.........