本文整理汇总了C++中QDockWidget::setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ QDockWidget::setWindowTitle方法的具体用法?C++ QDockWidget::setWindowTitle怎么用?C++ QDockWidget::setWindowTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDockWidget
的用法示例。
在下文中一共展示了QDockWidget::setWindowTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createDockWidget
void FFCP::createDockWidget()
{
//设置主窗体的第一个QDockWidget
QDockWidget *firstDockWidget = new QDockWidget(this);
//设置第一个QDockWidget的窗口名称
firstDockWidget->setWindowTitle(tr("代码查看器"));
//设置第一个QDockWidget的可停靠区域,全部可停靠
firstDockWidget->setAllowedAreas(Qt::AllDockWidgetAreas);
//设置第一个QDockWidget内的控件并设置该控件的属性
codeViewer = new QTextEdit(tr("打开main.c文件")); //前面别给定义 内存要报错 弄了我一天!!!!!!!!
codeViewer->setAcceptDrops(false); //禁止向codeViewer拖入东西
firstDockWidget->setWidget(codeViewer);
//向主窗体中添加第一个QDockWidget控件 第一个参数表示初始显示的位置 第二个参数是要添加的QDockWidget控件
this->addDockWidget(Qt::RightDockWidgetArea, firstDockWidget);
//向菜单和工具栏中添加第一个QDockWidget的显示和隐藏动作
viewMenu->addAction(firstDockWidget->toggleViewAction());
//设置第二个QDockWidget
QDockWidget *secondDockWidget = new QDockWidget(this);
secondDockWidget->setWindowTitle(tr("功能编辑盒"));
secondDockWidget->setAllowedAreas(Qt::AllDockWidgetAreas);
functionBox = new FunctionBox;
secondDockWidget->setWidget(functionBox);
this->addDockWidget(Qt::LeftDockWidgetArea, secondDockWidget);
//向菜单和工具栏中添加第一个QDockWidget的显示和隐藏动作
viewMenu->addAction(secondDockWidget->toggleViewAction());
}
示例2: makeLayout
void InvMain::makeLayout()
{
// create a docking window for several lists on the right side
QDockWidget *dw = new QDockWidget(this);
dw->setWindowTitle("Renderer Listbox ");
/*qt3 dw->setFeatures(Qt::Horizontal);
dw->setCloseMode(QDockWidget::Docked);
dw->setResizeEnabled(true);*/
listTabs = new QTabWidget(dw);
listTabs->setMinimumWidth(250);
/*colorListBox = new QListView(listTabs);
colorStringList = new QStringList();
colorListModel = new QStringListModel(*colorStringList, NULL);
colorListBox->setModel(colorListModel);*/
colorListWidget = new QListWidget(listTabs);
colorListWidget->setViewMode(QListView::IconMode);
treeWidget = new objTreeWidget(this, listTabs);
treeWidget->show();
listTabs->addTab(treeWidget, "Object Tree");
listTabs->addTab(colorListWidget, "ColorMap List");
dw->setWidget(listTabs);
addDockWidget(Qt::RightDockWidgetArea, dw, Qt::Horizontal);
// make a central widget window for the render area
QWidget *main = new QWidget(this);
main->setMinimumSize(720, 574); // will give PAL size images
viewer = new InvViewer(main);
setCentralWidget(main);
// create the lower docking window for sequencer
dw = new QDockWidget(this);
addDockWidget(Qt::BottomDockWidgetArea, dw, Qt::Vertical);
dw->setWindowTitle("Renderer Sequencer");
// qt3 dw->setHorizontallyStretchable(true);
// qt3 dw->setResizeEnabled(true);
sequencer = new InvSequencer(dw);
dw->setWidget(sequencer);
dw->hide();
// set the view all mode for the renderer
viewer->viewAll();
//connect( colorListBox->selectionModel(), SIGNAL(selectionChanged ( QItemSelection,QItemSelection )),
// this, SLOT(colorSelectionChanged ( QItemSelection,QItemSelection )) );
}
示例3: 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();
}
示例4: 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;
}
示例5: createDockWidget
void MainWindow::createDockWidget()
{
CreateDockWidgetDialog dialog(this);
int ret = dialog.exec();
if (ret == QDialog::Rejected)
return;
QDockWidget *dw = new QDockWidget;
dw->setObjectName(dialog.objectName());
dw->setWindowTitle(dialog.objectName());
dw->setWidget(new QTextEdit);
Qt::DockWidgetArea area = dialog.location();
switch (area) {
case Qt::LeftDockWidgetArea:
case Qt::RightDockWidgetArea:
case Qt::TopDockWidgetArea:
case Qt::BottomDockWidgetArea:
addDockWidget(area, dw);
break;
default:
if (!restoreDockWidget(dw)) {
QMessageBox::warning(this, QString(), tr("Failed to restore dock widget"));
delete dw;
return;
}
break;
}
extraDockWidgets.append(dw);
destroyDockWidgetMenu->setEnabled(true);
destroyDockWidgetMenu->addAction(new QAction(dialog.objectName(), this));
}
示例6: onConsoleWindowTitleChanged
void ConsoleWidgetCollection::onConsoleWindowTitleChanged(const QString & title)
{
QWidget* widget = dynamic_cast<QWidget*>(sender());
QDockWidget* dockWidget = dynamic_cast<QDockWidget*>(sender()->parent());
if (!widget || !dockWidget)
return;
dockWidget->setWindowTitle(widget->windowTitle());
}
示例7: file
EDATool::EDATool() {
this->setWindowTitle(tr("EDATool"));
boardScene = new QGraphicsScene();
boardView = new BoardView(this, boardScene);
if (!QCoreApplication::arguments().contains("-nogl"))
boardView->setViewport(new QGLWidget);
QTabWidget *tabs = new QTabWidget(this);
tabs->setFocusPolicy(Qt::NoFocus); // don't let the tab header itself steal focus
tabs->addTab(boardView, QString("Document"));
tabs->setDocumentMode(true);
this->setCentralWidget(tabs);
QDockWidget *temp = new QDockWidget(this);
QTreeWidget *tree = new QTreeWidget(this);
temp->setWindowTitle("Tool settings");
temp->setWidget(tree);
tree->setColumnCount(1);
tree->setHeaderLabel("Name");
this->addDockWidget(Qt::LeftDockWidgetArea, temp);
this->fileMenu = this->menuBar()->addMenu(tr("File"));
this->editMenu = this->menuBar()->addMenu(tr("Edit"));
this->placeMenu = this->menuBar()->addMenu(tr("&Place"));
QLabel *t = new QLabel("LOL FU");
t->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
this->statusBar()->addPermanentWidget(t);
t = new QLabel("MOAR TESTING");
t->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
this->statusBar()->addPermanentWidget(t);
this->statusBar()->showMessage("showmessage", 2000);
resize(700, 500);
//Board board;
toolBar = addToolBar("Tools");
toolBar->setIconSize(QSize(16, 16));
toolActionGroup = new QActionGroup(this);
SelectTool *selTool = new SelectTool(this);
selTool->install();
RouteTool *tool = new RouteTool(this);
tool->install();
cache = new QHash<QString, QGraphicsItemGroup*>();
QFile file("C:\\Users\\andreas\\workspace\\edatool\\test.brd");
EagleFormat *eagleFormat = new EagleFormat();
eagleFormat->read(&file,cache);
QHashIterator<QString, QGraphicsItemGroup*> i(*cache);
while (i.hasNext()) {
i.next();
QTreeWidgetItem *item = new QTreeWidgetItem(tree, QStringList(i.key()));
}
connect(tree,SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),this,SLOT(itemClicked(QTreeWidgetItem*,QTreeWidgetItem*)));
}
示例8: addToolWindows
DockedMainWindow::DockWidgetList DockedMainWindow::addToolWindows(const DesignerToolWindowList &tls)
{
DockWidgetList rc;
foreach (QDesignerToolWindow *tw, tls) {
QDockWidget *dockWidget = new QDockWidget;
dockWidget->setObjectName(tw->objectName() + QLatin1String("_dock"));
dockWidget->setWindowTitle(tw->windowTitle());
addDockWidget(tw->dockWidgetAreaHint(), dockWidget);
dockWidget->setWidget(tw);
rc.push_back(dockWidget);
}
示例9: transLateWidgetTitle
void DockWidgetManager::transLateWidgetTitle()
{
QMap<QString, QDockWidget*>::iterator ed = m_dockWidgets.end();
QMap<QString, QDockWidget*>::iterator it;
for ( it = m_dockWidgets.begin() ; it != ed ; ++it )
{
QDockWidget *widget = it.value();
widget->setWindowTitle( QApplication::translate( "MainWindow",
it.key().toStdString().c_str() ) );
}
}
示例10: QDockWidget
RightPanel::RightPanel(RestClientMainWindow* app)
{
m_responseHeaders = new QTextEdit;
m_responseHeaders->setAcceptRichText(false);
m_responseHeaders->setReadOnly(true);
QDockWidget *dock = new QDockWidget(app);
dock->setObjectName("Right");
dock->setWindowTitle(QObject::tr("Response Headers"));
dock->setWidget(m_responseHeaders);
dock->setFeatures(QDockWidget::DockWidgetMovable
| QDockWidget::DockWidgetFloatable);
app->addDockWidget(Qt::LeftDockWidgetArea, dock);
}
示例11: addDockWidget
void UiController::addDockWidget(Qt::DockWidgetArea area, QString name, QWidget *widget)
{
QDockWidget *dockWidget = new QDockWidget;
dockWidget->setWindowTitle(name);
dockWidget->setObjectName(name);
dockWidget->setWidget(widget);
widget->setParent(dockWidget);
_mainWindow.addDockWidget(area, dockWidget);
if (area == Qt::BottomDockWidgetArea) {
if (_lastBottomDockWidgetAdded)
_mainWindow.tabifyDockWidget(_lastBottomDockWidgetAdded, dockWidget);
_lastBottomDockWidgetAdded = dockWidget;
}
}
示例12: DockWidget
/**
* @brief
* Constructor
*/
DockWidgetRTTIBrowser::DockWidgetRTTIBrowser(QMainWindow *pQMainWindow, DockWidgetManager *pDockWidgetManager) : DockWidget(reinterpret_cast<QWidget*>(pQMainWindow), pDockWidgetManager)
{
// Get encapsulated Qt dock widget
QDockWidget *pQDockWidget = GetQDockWidget();
if (pQDockWidget) {
// Create RTTI browser widget
pQDockWidget->setWidget(new RTTIBrowserWidget());
// Set window title
pQDockWidget->setWindowTitle(pQDockWidget->tr(GetClass()->GetProperties().Get("Title")));
// Add the created Qt dock widget to the given Qt main window and tabify it for better usability
AddDockWidgetAndTabify(*pQMainWindow, Qt::BottomDockWidgetArea, *pQDockWidget);
}
}
示例13: createHeader
void MainWindow::createHeader()
{
// QToolBar *tb = new QToolBar(this);
QDockWidget *header = new QDockWidget(this);
QHBoxLayout *ly = new QHBoxLayout();
QFrame *frm = new QFrame();
QPushButton *pbExit = new QPushButton();
pbExit->setIcon(QIcon(":/images/meiti-up.png"));
pbExit->setIconSize(QSize(40,40));
pbExit->setFocusPolicy(Qt::NoFocus);
pbExit->setFocusProxy(0);
pbExit->setStyleSheet(QString("background-image: url(:/images/meiti-up.png);\n\n#pbExit:pressed {background-image: url(:/images/meiti-down.png) 4 4 4 4 strech strech;}\n\n#pbExit:hover {background-image: url(:/images/meiti-over.png) 4 4 4 4 strech strech;}\n"));
connect(pbExit, SIGNAL(clicked()), qApp, SLOT(quit()));
ly->addWidget(pbExit);
ly->setAlignment(pbExit,Qt::AlignCenter);
frm->setLayout(ly);
frm->setAttribute(Qt::WA_TranslucentBackground, true); // 设置背景透明(version >= QT4.5
header->setWidget(frm);
header->setAttribute(Qt::WA_TranslucentBackground, true); // 设置背景透明(version >= QT4.5
//header->setWindowFlags(Qt::FramelessWindowHint);
header->setWindowTitle(QString(""));
header->setTitleBarWidget(new QWidget);
header->setFocusPolicy(Qt::NoFocus);
header->setFocusProxy(0);
header->setFeatures(QDockWidget::NoDockWidgetFeatures);
header->setBaseSize(0,40);
addDockWidget(Qt::TopDockWidgetArea,header, Qt::Horizontal);
// tb->addWidget(frm);
// pbExit->setText(QString("%1--%2--%3").arg(this->width()).arg(tb->width()).arg(pbExit->width()));
//
// tb->setMovable(false);
//
// this->addToolBar(tb);
// dockWidget->setWidget(keyboardfrm);
// dockWidget->setAllowedAreas(Qt::BottomDockWidgetArea);
// dockWidget->setFeatures(QDockWidget::DockWidgetClosable);
// addDockWidget(Qt::BottomDockWidgetArea,dockWidget);
}
示例14: 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());
}
示例15: QDockWidget
QDockWidget *DockWidgetCatalog::addDockWidget(QWidget *widget, const QString &windowTitle, Qt::DockWidgetArea area)
{
if (widget == nullptr)
return nullptr;
QDockWidget *dock = new QDockWidget();
dock->setWidget(widget);
dock->setWindowTitle(windowTitle);
dock->setObjectName(windowTitle);
m_widgets.push_back(dock);
m_mainWindow.addDockWidget(area, dock);
onDockWidgetAdded(dock);
return dock;
}