当前位置: 首页>>代码示例>>C++>>正文


C++ QDockWidget::setFeatures方法代码示例

本文整理汇总了C++中QDockWidget::setFeatures方法的典型用法代码示例。如果您正苦于以下问题:C++ QDockWidget::setFeatures方法的具体用法?C++ QDockWidget::setFeatures怎么用?C++ QDockWidget::setFeatures使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDockWidget的用法示例。


在下文中一共展示了QDockWidget::setFeatures方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createDockWidgets

void MainWindow::createDockWidgets()
{
    setDockOptions(QMainWindow::AnimatedDocks);
    QDockWidget::DockWidgetFeatures features =
        QDockWidget::DockWidgetMovable|
        QDockWidget::DockWidgetFloatable;

    transformWidget = new TransformWidget;
    QDockWidget *transformDockWidget = new QDockWidget(
        tr("Transform"), this);
    transformDockWidget->setFeatures(features);
    transformDockWidget->setWidget(transformWidget);
    addDockWidget(Qt::RightDockWidgetArea, transformDockWidget);

    brushWidget = new BrushWidget;
    QDockWidget *brushDockWidget = new QDockWidget(tr("Brush (Fill)"),
            this);
    brushDockWidget->setFeatures(features);
    brushDockWidget->setWidget(brushWidget);
    addDockWidget(Qt::RightDockWidgetArea, brushDockWidget);

    penWidget = new PenWidget;
    QDockWidget *penDockWidget = new QDockWidget(tr("Pen (Outline)"),
            this);
    penDockWidget->setFeatures(features);
    penDockWidget->setWidget(penWidget);
    addDockWidget(Qt::RightDockWidgetArea, penDockWidget);
}
开发者ID:gebilaowang,项目名称:pagedesigner,代码行数:28,代码来源:mainwindow.cpp

示例2: setLocked

void KoDockWidgetTitleBar::setLocked(bool locked)
{
    QDockWidget *q = qobject_cast<QDockWidget*>(parentWidget());

    d->locked = locked;
    d->lockButton->blockSignals(true);
    d->lockButton->setChecked(locked);
    d->lockButton->blockSignals(false);

    //qDebug() << "setlocked" << q << d->locked << locked;

    if (locked) {
        d->features = q->features();
        q->setFeatures(QDockWidget::NoDockWidgetFeatures);
    }
    else {
        q->setFeatures(d->features);
    }

    q->toggleViewAction()->setEnabled(!locked);
    d->closeButton->setEnabled(!locked);
    d->floatButton->setEnabled(!locked);
    d->collapseButton->setEnabled(!locked);

    d->updateIcons();
    q->setProperty("Locked", locked);
    resizeEvent(0);
}
开发者ID:ChrisJong,项目名称:krita,代码行数:28,代码来源:KoDockWidgetTitleBar.cpp

示例3: lockDocks

void DockHost::lockDocks(bool lock)
{
    if (lock == lastLock)
        return;

    lastLock = lock;

    Q_FOREACH (QWidget* widget, widgets)
    {
        QDockWidget* dock = static_cast<QDockWidget*>(widget->parentWidget());

        if (dock)
        {
            if (lock)
            {
                if (dock->isFloating())
                {
                    dock->setFeatures(QDockWidget::DockWidgetFloatable);
                    dock->setAllowedAreas(Qt::NoDockWidgetArea);
                }
                else
                {
                    dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
                    dock->setAllowedAreas(Qt::AllDockWidgetAreas);
                }
            }
            else
            {
                dock->setFeatures(QDockWidget::AllDockWidgetFeatures);
                dock->setAllowedAreas(Qt::AllDockWidgetAreas);
            }

            adjustFloatingWindowFlags(dock);
        }
    }
开发者ID:JulyIGHOR,项目名称:QtBitcoinTrader,代码行数:35,代码来源:dock_host.cpp

示例4: QMainWindow

Window::Window () : QMainWindow (NULL) {
    try {
        viewer = new GLViewer;
    } catch (GLViewer::Exception e) {
        cerr << e.getMessage () << endl;
        exit (1);
    }
    setCentralWidget (viewer);

#if DEBUG
    cout << "/ ! \\ Building in Debug mode. Performance will be impacted" << endl;
#else
    viewer->setBaseSize(500, 500);
#endif
    
    initControlWidget ();
    
    QDockWidget * controlDockWidget = new QDockWidget (this);
    
    controlDockWidget->setWidget (controlWidget);
    controlDockWidget->adjustSize ();
    addDockWidget (Qt::RightDockWidgetArea, controlDockWidget);
    controlDockWidget->setFloating(true);
    controlDockWidget->setFeatures (QDockWidget::AllDockWidgetFeatures);
    controlDockWidget->adjustSize();
    controlDockWidget->move(0, 0);
    
    QDockWidget * focalDockWidget = new QDockWidget (this);
    focalDockWidget->setWidget(focalWidget);
    focalDockWidget->adjustSize ();
    addDockWidget (Qt::LeftDockWidgetArea, focalDockWidget);
    focalDockWidget->setFloating(true);
    focalDockWidget->setFeatures (QDockWidget::AllDockWidgetFeatures);
    focalDockWidget->adjustSize();
    focalDockWidget->move(200, 0);

    QDockWidget* rayTracerDockWidget = new QDockWidget(this);
    rayTracerDockWidget->setWidget(rayTracerWidget);
    rayTracerDockWidget->adjustSize ();
    addDockWidget (Qt::TopDockWidgetArea, rayTracerDockWidget);
    rayTracerDockWidget->setFloating(true);
    rayTracerDockWidget->setFeatures (QDockWidget::AllDockWidgetFeatures);
    rayTracerDockWidget->adjustSize();

    // Move widgets around the raytracer
    
    QDesktopWidget desktop;
    QRect mainScreenSize = desktop.availableGeometry(desktop.primaryScreen());
    
    controlDockWidget->move(mainScreenSize.width() - 200, 0);
    rayTracerDockWidget->move(0, 0);
    focalDockWidget->move(0, mainScreenSize.height() - focalDockWidget->height());
    
    statusBar()->showMessage("");
}
开发者ID:jcaille,项目名称:Raymini,代码行数:55,代码来源:Window.cpp

示例5: setOrientation

void TabBarWidget::setOrientation(Qt::DockWidgetArea orientation)
{
	switch (orientation)
	{
		case Qt::LeftDockWidgetArea:
			setShape(QTabBar::RoundedWest);

			break;
		case Qt::RightDockWidgetArea:
			setShape(QTabBar::RoundedEast);

			break;
		case Qt::BottomDockWidgetArea:
			setShape(QTabBar::RoundedSouth);

			break;
		default:
			setShape(QTabBar::RoundedNorth);

			break;
	}

	QDockWidget *widget = qobject_cast<QDockWidget*>(parentWidget()->parentWidget());

	if (widget)
	{
		if (orientation == Qt::LeftDockWidgetArea || orientation == Qt::RightDockWidgetArea)
		{
			widget->setFeatures(widget->features() & ~QDockWidget::DockWidgetVerticalTitleBar);
		}
		else
		{
			widget->setFeatures(widget->features() | QDockWidget::DockWidgetVerticalTitleBar);
		}
	}

	QBoxLayout *layout = qobject_cast<QBoxLayout*>(parentWidget()->layout());

	if (layout)
	{
		if (orientation == Qt::LeftDockWidgetArea || orientation == Qt::RightDockWidgetArea)
		{
			layout->setDirection(QBoxLayout::TopToBottom);
		}
		else
		{
			layout->setDirection(QBoxLayout::LeftToRight);
		}
	}
}
开发者ID:wanarek,项目名称:otter,代码行数:50,代码来源:TabBarWidget.cpp

示例6: QMainWindow

KinectRecorderWindow::KinectRecorderWindow(int fps, KinectDevice* device)
    : QMainWindow()
    , fps_(fps)
    , device_(device)
    , widget_viewer_(new KinectViewerWidget(fps, device))
{
    widget_viewer_->setMinimumSize(1280, 480);
    widget_viewer_->setMaximumSize(1280, 480);
    setCentralWidget(widget_viewer_);

    QDockWidget *dock = new QDockWidget(this);
    dock->setAllowedAreas(Qt::BottomDockWidgetArea);
    dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
    widget_record_ = new RecordInterfaceWidget(dock);
    connect(widget_record_, SIGNAL(dialogOpened()), widget_viewer_, SLOT(pause()));
    connect(widget_record_, SIGNAL(dialogClosed()), widget_viewer_, SLOT(resume()));
    connect(widget_record_, SIGNAL(destroyed(QObject*)), this, SLOT(close()));
    connect(widget_record_, SIGNAL(startRecord(std::string)), this, SLOT(recordStarted(std::string)));
    connect(widget_record_, SIGNAL(finishRecord()), this, SLOT(recordFinished()));
    widget_record_->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
    dock->setWidget(widget_record_);
    addDockWidget(Qt::BottomDockWidgetArea, dock);

    setWindowTitle("Kinect viewer");
    move(100, 100);
    setAttribute(Qt::WA_DeleteOnClose);
}
开发者ID:pjsdream,项目名称:video_annotator,代码行数:27,代码来源:kinect_recorder.cpp

示例7: addDockWindow

/**
 * Adds a new dock window to the main window and embeds the given \a widget.
 */
QDockWidget* DockWindowManager::addDockWindow(const char* name, QWidget* widget, Qt::DockWidgetArea pos)
{
    // creates the dock widget as container to embed this widget
    MainWindow* mw = getMainWindow();
    QDockWidget* dw = new QDockWidget(mw);
    // Note: By default all dock widgets are hidden but the user can show them manually in the view menu.
    // First, hide immediately the dock widget to avoid flickering, after setting up the dock widgets
    // MainWindow::loadLayoutSettings() is called to restore the layout.
    dw->hide();
    switch (pos) {
    case Qt::LeftDockWidgetArea:
    case Qt::RightDockWidgetArea:
    case Qt::TopDockWidgetArea:
    case Qt::BottomDockWidgetArea:
        mw->addDockWidget(pos, dw);
    default:
        break;
    }
    connect(dw, SIGNAL(destroyed(QObject*)),
            this, SLOT(onDockWidgetDestroyed(QObject*)));
    connect(widget, SIGNAL(destroyed(QObject*)),
            this, SLOT(onWidgetDestroyed(QObject*)));

    // add the widget to the dock widget
    widget->setParent(dw);
    dw->setWidget(widget);

    // set object name and window title needed for i18n stuff
    dw->setObjectName(QLatin1String(name));
    dw->setWindowTitle(QDockWidget::trUtf8(name));
    dw->setFeatures(QDockWidget::AllDockWidgetFeatures);

    d->_dockedWindows.push_back(dw);
    return dw;
}
开发者ID:3DPrinterGuy,项目名称:FreeCAD,代码行数:38,代码来源:DockWindowManager.cpp

示例8: createDock

void MainWindow::createDock()
{
   QDockWidget* dock = new QDockWidget("", this);
   dock->setAllowedAreas(Qt::TopDockWidgetArea);
   dock->setFeatures(QDockWidget::NoDockWidgetFeatures);

   QLabel *roundNumTitle = new QLabel("Round #:");
   rndNum = new QLabel(QString::number(0));
   QLabel *tarRemTitle = new QLabel("Targets Remaining:");
   tarRem = new QLabel(QString::number(0));
   QLabel *errorNumTitle = new QLabel("Errors:");
   errorNum = new QLabel(QString::number(0));

   QWidget *parentWidget = new QWidget();
   QHBoxLayout *layout = new QHBoxLayout();

   layout->addWidget(roundNumTitle);
   layout->addWidget(rndNum);
   layout->addStretch();
   layout->addWidget(tarRemTitle);
   layout->addWidget(tarRem);
   layout->addStretch();
   layout->addWidget(errorNumTitle);
   layout->addWidget(errorNum);

   parentWidget->setLayout(layout);
   dock->setWidget(parentWidget);
   addDockWidget(Qt::TopDockWidgetArea, dock);
}
开发者ID:B-Rich,项目名称:3770Project,代码行数:29,代码来源:mainWindow.cpp

示例9: QDialog

/**
 *  Constructs a DlgDisplayPropertiesImp which is a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f' 
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
DlgDisplayPropertiesImp::DlgDisplayPropertiesImp( QWidget* parent, Qt::WindowFlags fl )
  : QDialog( parent, fl )
{
    this->setupUi(this);
    textLabel1_3->hide();
    changePlot->hide();
    buttonLineColor->setModal(false);
    buttonColor->setModal(false);

    std::vector<Gui::ViewProvider*> views = getSelection();
    setDisplayModes(views);
    fillupMaterials();
    setMaterial(views);
    setColorPlot(views);
    setShapeColor(views);
    setLineColor(views);
    setPointSize(views);
    setLineWidth(views);
    setTransparency(views);
    setLineTransparency(views);

    // embed this dialog into a dockable widget container
    Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
    QDockWidget* dw = pDockMgr->addDockWindow("Display properties", this, Qt::AllDockWidgetAreas);
    dw->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
    dw->setFloating(true);
    dw->show();

    Gui::Selection().Attach(this);

    this->connectChangedObject =
    Gui::Application::Instance->signalChangedObject.connect(boost::bind
        (&DlgDisplayPropertiesImp::slotChangedObject, this, _1, _2));
}
开发者ID:AjinkyaDahale,项目名称:FreeCAD,代码行数:41,代码来源:DlgDisplayPropertiesImp.cpp

示例10: QDialog

DownloadManager::DownloadManager(QWidget *parent)
    : QDialog(parent)
    , m_autoSaver(new AutoSaver(this))
    , m_manager(new NetworkAccessManager(this))
    , m_iconProvider(0)
    , m_removePolicy(Never)
    , ui(new Ui_DownloadManager())
{
    ui->setupUi(this);
    ui->downloadsView->setShowGrid(false);
    ui->downloadsView->verticalHeader()->hide();
    ui->downloadsView->horizontalHeader()->hide();
    ui->downloadsView->setAlternatingRowColors(true);
    ui->downloadsView->horizontalHeader()->setStretchLastSection(true);
    m_model = new DownloadModel(this);
    ui->downloadsView->setModel(m_model);
    connect(ui->cleanupButton, SIGNAL(clicked()), this, SLOT(cleanup()));
    load();

    Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
    QDockWidget* dw = pDockMgr->addDockWindow(QT_TR_NOOP("Download Manager"),
        this, Qt::BottomDockWidgetArea);
    dw->setFeatures(QDockWidget::DockWidgetMovable|
                    QDockWidget::DockWidgetFloatable|
                    QDockWidget::DockWidgetClosable);
    dw->setAttribute(Qt::WA_DeleteOnClose);
    dw->show();
}
开发者ID:AjinkyaDahale,项目名称:FreeCAD,代码行数:28,代码来源:DownloadManager.cpp

示例11: dockVisibilityChanged

// Workaround for bug on Mac: If all docks are hidden,
// it's not possible to open the dock menu and show them again
void MainWindow::dockVisibilityChanged(bool v)
{
    // A dock got visible: make all of them closable
    if(v)
    {
        for(auto dock : docks)
            dock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
        return;
    }

    // All but one dock hidden?
    QDockWidget *remaining = nullptr;
    for(auto dock : docks)
        if(dock->isVisible())
        {
            if(remaining)
                return; // Enough docks visible
            else
                remaining = dock;
        }

    if(!remaining)
        return; // No dock visible?

    // Disable closability on the remaining one
    remaining->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
}
开发者ID:juliusdedekind,项目名称:firebird,代码行数:29,代码来源:mainwindow.cpp

示例12: AddressInput

MainWindow::MainWindow()
{
	AddressInput* addressInput = new AddressInput( this );
	this->addToolBar( addressInput );

	QDockWidget* motor0Dock = new QDockWidget( "Motor 0", this );
	motor0Dock->setWidget( new MotorWidget( this, 0 ) );
	motor0Dock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
	addDockWidget(Qt::BottomDockWidgetArea, motor0Dock );
	motor0Dock->setFloating( false );
	motor0Dock->setVisible( true );

	QDockWidget* motor1Dock = new QDockWidget( "Motor 1", this );
	motor1Dock->setWidget( new MotorWidget( this, 1 ) );
	motor1Dock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
	addDockWidget(Qt::BottomDockWidgetArea, motor1Dock );
	motor1Dock->setFloating( false );
	motor1Dock->setVisible( true );

	QDockWidget* motor2Dock = new QDockWidget( "Motor 2", this );
	motor2Dock->setWidget( new MotorWidget( this, 2 ) );
	motor2Dock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
	addDockWidget(Qt::BottomDockWidgetArea, motor2Dock );
	motor2Dock->setFloating( false );
	motor2Dock->setVisible( true );

	QDockWidget* odometryDock = new QDockWidget( "Odometry", this );
	odometryDock->setWidget( new OdometryWidget( this ) );
	odometryDock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
	addDockWidget(Qt::BottomDockWidgetArea, odometryDock );
	odometryDock->setFloating( false );
	odometryDock->setVisible( true );

	setCentralWidget( new ControlPanelWidget( this ) );
}
开发者ID:ct2034,项目名称:robotino,代码行数:35,代码来源:MainWindow.cpp

示例13: Placement

DockablePlacement::DockablePlacement(QWidget* parent, Qt::WFlags fl) : Placement(parent, fl)
{
    Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
    QDockWidget* dw = pDockMgr->addDockWindow(QT_TR_NOOP("Placement"),
        this, Qt::BottomDockWidgetArea);
    dw->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
    dw->show();
}
开发者ID:aromis,项目名称:FreeCAD_sf_master,代码行数:8,代码来源:Placement.cpp

示例14: createDockWidget

QDockWidget* ConsoleWidgetCollection::createDockWidget(QWidget* widget)
{
		QDockWidget* dockWidget = new QDockWidget(widget->windowTitle(), this);
		connect(widget, &QWidget::windowTitleChanged, this, &ConsoleWidgetCollection::onConsoleWindowTitleChanged);
		dockWidget->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable);
		dockWidget->setObjectName(widget->objectName() + "DockWidget");
		dockWidget->setWidget(widget);
		return dockWidget;
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:9,代码来源:cxConsoleWidgetCollection.cpp

示例15: settings

Tab::Tab(QWidget *parent) :
    QMainWindow(parent)
{
    //Setting code field
    code = new CodeEditor;
    setCentralWidget(code);

    //Setting input and output fields
    input = new RuQTextEdit;
    output = new RuQTextEdit;
    output->setReadOnly(true);
    inputLayout = new QVBoxLayout;
    outputLayout = new QVBoxLayout;
    inputLayout->addWidget(input);
    outputLayout->addWidget(output);

    setDockOptions(QMainWindow::AllowNestedDocks | QMainWindow::AnimatedDocks);

    QDockWidget *inputDock = new QDockWidget(tr("Input"), this);
    inputDock->setAllowedAreas(Qt::AllDockWidgetAreas);
    inputWidget = new QWidget(inputDock);
    inputWidget->setLayout(inputLayout);
    inputDock->setWidget(inputWidget);
    inputDock->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable);
    addDockWidget(Qt::RightDockWidgetArea, inputDock);
    inputDock->setObjectName("inputDock");

    QDockWidget *outputDock = new QDockWidget(tr("Output"), this);
    outputDock->setAllowedAreas(Qt::AllDockWidgetAreas);
    outputWidget = new QWidget(outputDock);
    outputWidget->setLayout(outputLayout);
    outputDock->setWidget(outputWidget);
    outputDock->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable);
    addDockWidget(Qt::RightDockWidgetArea, outputDock);
    outputDock->setObjectName("outputDock");

    //Setting io and code fonts
    setFonts();

    //restore state
    QSettings settings("SASM Project", "SASM");
    restoreGeometry(settings.value("tabgeometry").toByteArray());
    restoreState(settings.value("tabwindowstate").toByteArray());
}
开发者ID:0x0all,项目名称:SASM,代码行数:44,代码来源:tab.cpp


注:本文中的QDockWidget::setFeatures方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。