本文整理汇总了C++中QDockWidget::show方法的典型用法代码示例。如果您正苦于以下问题:C++ QDockWidget::show方法的具体用法?C++ QDockWidget::show怎么用?C++ QDockWidget::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDockWidget
的用法示例。
在下文中一共展示了QDockWidget::show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _showForm
/*
・ウィンドウ表示を行う
・既に DockWidget に登録済みの場合は、一旦削除を行い表示を行う
*/
void FormNodeEditorImpl::_showForm(QWidget* pWidget, const QString& rqStr, Qt::DockWidgetAreas allowedDockArea, Qt::DockWidgetArea initDockArea)
{
int nDockCnt = listDockWidgets.size();
for (int i = 0; i < nDockCnt; i++) {
QWidget* pWidgetTmp = listDockWidgets[i]->widget();
if (pWidgetTmp == pWidget) {
this->removeDockWidget(listDockWidgets[i]);
listDockWidgets[i]->setWidget(NULL);
/* [NOTE]
一度、DockWidget化した widget を show() しても表示されない問題が発生した。
その対処として、setParent(NULL) を明示的に行ったところ、show()にて表示できるようになった。
現在の状態が、pWidgetTmp->isVisibleTo(listDockWidgets[i]) にて true の状態であるため、
親値を外す必要があると思われる。
*/
pWidgetTmp->setParent(NULL);
listDockWidgets.removeAt(i);
break;
}
}
if (_isEnableFormDockable) {
QDockWidget* pDock = new QDockWidget(rqStr, this);
pDock->setWidget(pWidget);
pDock->setAllowedAreas(allowedDockArea);
addDockWidget(initDockArea, pDock, Qt::Horizontal);
pDock->show();
listDockWidgets.push_back(pDock);
} else {
pWidget->show();
}
}
示例2:
void GCF::Components::MainWindow::removeChildWidget(QWidget* parent, QWidget* child)
{
if(!parent || !child)
return;
if(parent == d->workspace)
{
d->workspace->removeTab(d->workspace->indexOf(child));
child->removeEventFilter(this);
}
else
{
QList<QDockWidget*> dockWidgets = d->dockWidgetMap.values();
QDockWidget* dw = qobject_cast<QDockWidget*>(parent);
if(dw && dockWidgets.contains(dw))
{
QTabWidget* tw = qobject_cast<QTabWidget*>(dw->widget());
tw->removeTab(tw->indexOf(child));
if(tw->count())
dw->show();
else
dw->hide();
}
}
}
示例3:
void tst_QDockWidget::task237438_setFloatingCrash()
{
//should not crash
QDockWidget pqdwDock;
pqdwDock.setFloating(false);
pqdwDock.show();
}
示例4: 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));
}
示例5: 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();
}
示例6: MakeGLView
void ExecutingPietLibraries::MakeGLView (std::vector<PietTree> & pt){
if(pt.size() == 0 )return;
if(pt[0].isLeaf()) return;
pt = pt[0].Nodes();
if(pt.size() < 3) return;
int w = pt[0].Val();
int h = pt[1].Val();
QString title = pt[2].toString();
for(int i:range(3)) pt.pop_back();
GLGameWidget* glgw = GLGameWidget::MakeUniqueGLWidget(nullptr);
if(glgw == nullptr) return ;
glgw->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
glgw->setSize(w,h);
QDockWidget* dw = new QDockWidget(nullptr);
dw->setFloating(true);
dw->setAllowedAreas(Qt::NoDockWidgetArea);
dw->connect(dw,&QDockWidget::dockLocationChanged,[=](){ dw->setFloating(true);});
dw->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
dw->setWidget(glgw);
dw->setAttribute(Qt::WA_DeleteOnClose);
dw->setWindowTitle(title);
dw->show();
}
示例7: workspaceWidgetActivated
void GCF::Components::MainWindow::addChildWidget(QWidget* parent, QWidget* child)
{
if(!parent || !child)
return;
if(parent == d->workspace)
{
d->workspace->addTab(child, child->windowTitle());
child->installEventFilter(this);
child->setAutoFillBackground(true);
emit workspaceWidgetActivated(d->workspace->currentWidget());
}
else
{
QList<QDockWidget*> dockWidgets = d->dockWidgetMap.values();
QDockWidget* dw = qobject_cast<QDockWidget*>(parent);
if(dw && dockWidgets.contains(dw))
{
QTabWidget* tw = qobject_cast<QTabWidget*>(dw->widget());
tw->addTab(child, child->windowTitle());
child->setAutoFillBackground(true);
if(tw->count())
dw->show();
else
dw->hide();
}
}
}
示例8: setTitleBarWidget
void tst_QDockWidget::setTitleBarWidget()
{
//test the successive usage of setTitleBarWidget
QDockWidget dock;
QWidget w, w2;
dock.show();
qApp->processEvents();
dock.setTitleBarWidget(&w);
qApp->processEvents();
QCOMPARE(w.isVisible(), true);
//set another widget as the titlebar widget
dock.setTitleBarWidget(&w2); // this used to crash (task 184668)
qApp->processEvents();
QCOMPARE(w.isVisible(), false);
QCOMPARE(w2.isVisible(), true);
//tries to reset the titlebarwidget to none
dock.setTitleBarWidget(0);
qApp->processEvents();
QCOMPARE(w.isVisible(), false);
QCOMPARE(w2.isVisible(), false);
}
示例9: 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();
}
示例10: DlgEvaluateMeshImp
/**
* Constructs a DockEvaluateMeshImp which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
DockEvaluateMeshImp::DockEvaluateMeshImp( QWidget* parent, Qt::WFlags fl )
: DlgEvaluateMeshImp( parent, fl )
{
// embed this dialog into a dockable widget container
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
// use Qt macro for preparing for translation stuff (but not translating yet)
QDockWidget* dw = pDockMgr->addDockWindow("Evaluate & Repair Mesh",
this, Qt::RightDockWidgetArea);
//dw->setAttribute(Qt::WA_DeleteOnClose);
dw->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
dw->show();
}
示例11: addDock
void BaseWidget::addDock(QWidget *w)
{
QDockWidget *dock = new QDockWidget(w->windowTitle(),this);
dock->setObjectName(w->windowTitle());
addDockWidget(Qt::LeftDockWidgetArea, dock);
dock->setWidget(w);
dock->setAttribute(Qt::WA_DeleteOnClose);
dock->show();
docks.append(dock);
connect(dock, SIGNAL(destroyed(QObject*)), this, SLOT(dock_destroyed_cb(QObject *)));
}
示例12: updateQueueConfig
void XletAgentStatusDashboard::updateQueueConfig(const QString & queue_id)
{
QDockWidget * dock;
FilteredAgentList * filtered_agent_list;
if (m_filtered_agent_lists.contains(queue_id)) {
dock = this->m_window->findChild<QDockWidget *>(queue_id);
filtered_agent_list = this->m_filtered_agent_lists.value(queue_id);
} else {
dock = this->createDock(queue_id);
filtered_agent_list = this->createFilteredAgentList(queue_id);
QWidget * agent_list_view = dynamic_cast<QWidget *>(filtered_agent_list->getView());
dock->setWidget(agent_list_view);
dock->show();
}
dock->setWindowTitle(filtered_agent_list->getQueueName());
}
示例13: QVERIFY
void tst_QDockWidget::taskQTBUG_1665_closableChanged()
{
QDockWidget dock;
dock.show();
QVERIFY(QTest::qWaitForWindowExposed(&dock));
QDockWidgetLayout *l = qobject_cast<QDockWidgetLayout*>(dock.layout());
if (l && !l->nativeWindowDeco())
QSKIP("this machine doesn't support native dock widget");
QVERIFY(dock.windowFlags() & Qt::WindowCloseButtonHint);
//now let's remove the closable attribute
dock.setFeatures(dock.features() ^ QDockWidget::DockWidgetClosable);
QVERIFY(!(dock.windowFlags() & Qt::WindowCloseButtonHint));
}
示例14: showDialog
void ControlSingleton::showDialog(Gui::TaskView::TaskDialog *dlg)
{
// only one dialog at a time
assert(!ActiveDialog || ActiveDialog==dlg);
Gui::DockWnd::CombiView* pcCombiView = qobject_cast<Gui::DockWnd::CombiView*>
(Gui::DockWindowManager::instance()->getDockWindow("Combo View"));
// should return the pointer to combo view
if (pcCombiView) {
pcCombiView->showDialog(dlg);
// make sure that the combo view is shown
QDockWidget* dw = qobject_cast<QDockWidget*>(pcCombiView->parentWidget());
if (dw) {
dw->setVisible(true);
dw->toggleViewAction()->setVisible(true);
dw->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
}
if (ActiveDialog == dlg)
return; // dialog is already defined
ActiveDialog = dlg;
connect(dlg, SIGNAL(destroyed()), this, SLOT(closedDialog()));
}
// not all workbenches have the combo view enabled
else if (!_taskPanel) {
QDockWidget* dw = new QDockWidget();
dw->setWindowTitle(tr("Task panel"));
dw->setFeatures(QDockWidget::DockWidgetMovable);
_taskPanel = new Gui::TaskView::TaskView(dw);
dw->setWidget(_taskPanel);
_taskPanel->showDialog(dlg);
getMainWindow()->addDockWidget(Qt::LeftDockWidgetArea, dw);
connect(dlg, SIGNAL(destroyed()), dw, SLOT(deleteLater()));
// if we have the normal tree view available then just tabify with it
QWidget* treeView = Gui::DockWindowManager::instance()->getDockWindow("Tree view");
QDockWidget* par = treeView ? qobject_cast<QDockWidget*>(treeView->parent()) : 0;
if (par && par->isVisible()) {
getMainWindow()->tabifyDockWidget(par, dw);
qApp->processEvents(); // make sure that the task panel is tabified now
dw->show();
dw->raise();
}
}
}
示例15: attach
bool ExtendingFrameAttachmentPoint::attach(AttachableFrame* frame)
{
int index = 0;
if ((int)mAttachedFrames.size() >= mMaxAttachmentCount)
{
LOG_ERROR() << "FrameAttachmentPoint::attach(): cannot attach more than " << mMaxAttachmentCount <<
" Frame" << (mMaxAttachmentCount > 1 ? "s" : "") << " to Attachment Point " << mName << ".";
return false;
}
//Attach the frame in a way depending on its type
if (mType == ATTACHMENT_DOCKWIDGET_CREATOR)
{
//Create new dockwidget and attach frame to it
QDockWidget* newWidget = new QDockWidget(mName, mAttachmentPoint, Qt::WindowMinMaxButtonsHint);
mWidgetMap.insert(frame, newWidget);
//QLayout* layout = WindowManager::createNeutralLayout();
//newWidget->setLayout(layout);
//WindowManager::changeToNeutralLayout(newWidget->layout());
newWidget->setWidget(frame);
//newWidget->layout()->addWidget(frame);
newWidget->show();
frame->show();
}
else
{
LOG_ERROR() << "ExtendingFrameAttachmentPoint::attach(): unknown Attachment Point.";
return false;
}
//Store the attachment pointer
mAttachedFrames.insert(frame->getPluginId(), frame);
return true;
}