本文整理汇总了C++中QDockWidget::setMinimumWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ QDockWidget::setMinimumWidth方法的具体用法?C++ QDockWidget::setMinimumWidth怎么用?C++ QDockWidget::setMinimumWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDockWidget
的用法示例。
在下文中一共展示了QDockWidget::setMinimumWidth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
QDockWidget *testDock = new QDockWidget(tr("Test Dock"));
testDock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable
| QDockWidget::DockWidgetMovable);
testDock->setMinimumWidth(200);
testDock->setStyleSheet(tr("background-color:green;"));
MyDockTitleBar *titlebar1 = new MyDockTitleBar(testDock);
testDock->setTitleBarWidget(titlebar1);
QWidget *testWidget = new QWidget;
QVBoxLayout *box = new QVBoxLayout;
QPushButton *okButton = new QPushButton(tr("Ok"));
okButton->setStyleSheet(tr("background-color:white;"));
box->addWidget(okButton);
testWidget->setLayout(box);
testDock->setWidget(testWidget);
//////////////////////////////////////////////////////////
QDockWidget *testDock2 = new QDockWidget(tr("Test Dock2"));
testDock2->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable
| QDockWidget::DockWidgetMovable);
testDock2->setMinimumWidth(200);
testDock2->setStyleSheet(tr("background-color:orange;"));
MyDockTitleBar *titlebar2 = new MyDockTitleBar(testDock2);
testDock2->setTitleBarWidget(titlebar2);
QWidget *testWidget2 = new QWidget;
QVBoxLayout *box2 = new QVBoxLayout;
QPushButton *okButton2 = new QPushButton(tr("Ok"));
okButton2->setStyleSheet(tr("background-color:white;"));
box2->addWidget(okButton2);
testWidget2->setLayout(box2);
testDock2->setWidget(testWidget2);
//////////////////////////////////////////////////////////
this->addDockWidget(Qt::LeftDockWidgetArea, testDock);
this->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::West);
this->tabifyDockWidget(testDock, testDock2);
}
示例2: 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()));
}
}
示例3: 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);
}
}
}
示例4: QDockWidget
VisionDisplayModule::VisionDisplayModule(QWidget *parent) :
QMainWindow(parent),
currentCamera(Camera::TOP),
topDisplay(this),
bottomDisplay(this),
topThrDisplay(this),
botThrDisplay(this),
bottomImage(base()),
topImage(base()),
tTImage(base()),
tYImage(base()),
tUImage(base()),
tVImage(base()),
bTImage(base()),
bYImage(base()),
bUImage(base()),
bVImage(base()),
joints(base()),
inertials(base()),
visMod()
{
subdiagram.addModule(topDisplay);
subdiagram.addModule(bottomDisplay);
subdiagram.addModule(topThrDisplay);
subdiagram.addModule(botThrDisplay);
subdiagram.addModule(visMod);
topDisplay.imageIn.wireTo(&topImage, true);
bottomDisplay.imageIn.wireTo(&bottomImage, true);
topThrDisplay.imageIn.wireTo(&visMod.topOutPic);
botThrDisplay.imageIn.wireTo(&visMod.botOutPic);
visMod.topThrImage.wireTo(&tTImage, true);
visMod.topYImage.wireTo(&tYImage, true);
visMod.topUImage.wireTo(&tUImage, true);
visMod.topVImage.wireTo(&tVImage, true);
visMod.botThrImage.wireTo(&bTImage, true);
visMod.botYImage.wireTo(&bYImage, true);
visMod.botUImage.wireTo(&bUImage, true);
visMod.botVImage.wireTo(&bVImage, true);
visMod.joint_angles.wireTo(&joints, true);
visMod.inertial_state.wireTo(&inertials, true);
field_viewer = new logview::TypedProtoViewer<messages::VisionField>();
field_viewer->input.wireTo(&visMod.vision_field);
subdiagram.addModule(*field_viewer);
robot_viewer = new logview::TypedProtoViewer<messages::VisionRobot>();
robot_viewer->input.wireTo(&visMod.vision_robot);
subdiagram.addModule(*robot_viewer);
ball_viewer = new logview::TypedProtoViewer<messages::VisionBall>();
ball_viewer->input.wireTo(&visMod.vision_ball);
subdiagram.addModule(*ball_viewer);
obstacle_viewer = new logview::TypedProtoViewer<messages::VisionObstacle>();
obstacle_viewer->input.wireTo(&visMod.vision_obstacle);
subdiagram.addModule(*obstacle_viewer);
QDockWidget* dockWidget = new QDockWidget("Vision Field", this);
dockWidget->setMinimumWidth(300);
dockWidget->setWidget(field_viewer);
this->addDockWidget(Qt::RightDockWidgetArea, dockWidget);
dockWidget = new QDockWidget("Vision Robot", this);
dockWidget->setMinimumWidth(300);
dockWidget->setWidget(robot_viewer);
this->addDockWidget(Qt::RightDockWidgetArea, dockWidget);
dockWidget = new QDockWidget("Vision Ball", this);
dockWidget->setMinimumWidth(300);
dockWidget->setWidget(ball_viewer);
this->addDockWidget(Qt::RightDockWidgetArea, dockWidget);
dockWidget = new QDockWidget("Vision Obstacle", this);
dockWidget->setMinimumWidth(300);
dockWidget->setWidget(obstacle_viewer);
this->addDockWidget(Qt::RightDockWidgetArea, dockWidget);
// GUI
QHBoxLayout* mainLayout = new QHBoxLayout;
QWidget* mainWidget = new QWidget;
imageTabs = new QTabWidget(this);
mainLayout->addWidget(imageTabs);
imageTabs->addTab(&topDisplay, "Top Image");
imageTabs->addTab(&bottomDisplay, "Bottom Image");
imageTabs->addTab(&topThrDisplay, "Top Thresh");
imageTabs->addTab(&botThrDisplay, "Bottom Thresh");
mainWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
mainWidget->setLayout(mainLayout);
this->setCentralWidget(mainWidget);
//corner ownership
this->setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
this->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
//.........这里部分代码省略.........