本文整理汇总了C++中QMdiSubWindow::setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ QMdiSubWindow::setWindowTitle方法的具体用法?C++ QMdiSubWindow::setWindowTitle怎么用?C++ QMdiSubWindow::setWindowTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMdiSubWindow
的用法示例。
在下文中一共展示了QMdiSubWindow::setWindowTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addMDIWindow
void MWMDIManagerImpl::addMDIWindow(MWMDIWindow* w) {
bool contains = getWindowById(w->getId())!=NULL;
if (contains) {
assert(0); //must never happen
return;
}
w->setParent(mdiArea);
QMdiSubWindow* qw = mdiArea->addSubWindow(w);
qw->setWindowTitle(w->windowTitle());
QIcon icon = w->windowIcon();
if (icon.isNull()) {
icon = QIcon(":/ugene/images/ugene_16.png");
}
qw->setWindowIcon(icon);
//qw->setAttribute(Qt::WA_NativeWindow);
MDIItem* i = new MDIItem(w, qw);
items.append(i);
qw->installEventFilter(this);
uiLog.trace(QString("Adding window: '%1'").arg(w->windowTitle()));
updateState();
emit si_windowAdded(w);
if (items.count() == 1 && defaultIsMaximized) {
qw->showMaximized();
} else {
qw->show();
}
qw->raise();
}
示例2: fileNew
void MainWindow::fileNew() {
if (_sdata)
if (!_sdata->isSaved())
maybeSave();
fileClose();
// if project exist,
// if not saved,
//maybe save?
// close
// run wizard
QMdiSubWindow * world = _mdiArea->addSubWindow(new WorldWidget());
world->setWindowTitle("*untitled");
world->setMinimumSize(300, 200);
world->show();
_sdata = new SimulationData();
_sdata->setSaved(false);
connect(_sdata, SIGNAL(fileNameChanged(QString)), world, SLOT(setWindowTitle(QString)));
SensorNetwork net(40);
net.push();
net.start();
_fileSaveAsAct->setEnabled(true);
_fileCloseAct->setEnabled(true);
}
示例3: BuildCharacterTabs
void GameForm::BuildCharacterTabs(){
tabsWidget = new CharacterTabs();
QMdiSubWindow* tabsWindow = ui->gameArea->addSubWindow(tabsWidget);
tabsWindow->setWindowTitle("PlayerName");
tabsWindow->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);
tabsWindow->setFixedSize(tabsWidget->width()+15, tabsWidget->height()+35);
}
示例4: BuildTownWindow
void GameForm::BuildTownWindow(){
townWidget = new TownWidget();
QMdiSubWindow* townWindow = ui->gameArea->addSubWindow(townWidget);
townWindow->setWindowTitle("The City");
townWindow->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);
townWindow->setFixedSize(townWidget->width()+15, townWidget->height()+35);
}
示例5: setTabName
void PropLov::setTabName(const QModelIndex &index)
{
QMdiSubWindow *subWindow = qobject_cast<QMdiSubWindow *> (this->parent());
QString lovName = modelData(DBLOVXML::LOV, DBLOVXML::NAME,index).toString();
QString id = this->dataId(index);
this->setObjectName("PropLov::" + id);
subWindow->setWindowIcon(qvariant_cast<QIcon>(index.data(Qt::DecorationRole)));
subWindow->setWindowTitle(lovName);
}
示例6: on_actionControlPixmap_triggered
void MainWindow::on_actionControlPixmap_triggered()
{
QAxWidget *container = activeAxWidget();
if (!container)
return;
QLabel *label = new QLabel;
label->setPixmap(QPixmap::grabWidget(container));
QMdiSubWindow *subWindow = mdiArea->addSubWindow(label);
subWindow->setWindowTitle(tr("%1 - Pixmap").arg(container->windowTitle()));
label->show();
}
示例7: updateTitle
void CodeEdit::updateTitle()
{
QMdiSubWindow *sub = (QMdiSubWindow *)this->parent();
if ( !rev->textChangedSinceSave ) {
rev->textChangedSinceSave = true;
sub->setWindowTitle( rev->getDisplayName() );
//TODO: also update in shredTree UI
}
}
示例8: on_action_New_triggered
// 新建文件菜单
void MainWindow::on_action_New_triggered()
{
// 新建文本编辑器部件
QTextEdit *edit = new QTextEdit(this);
// 使用QMdiArea类的addSubWindow()函数创建子窗口,以文本编辑器为中心部件
QMdiSubWindow *child = ui->mdiArea->addSubWindow(edit);
child->setWindowTitle(tr("多文档编辑器子窗口"));
// 显示子窗口
child->show();
}
示例9: on_actionControlDocumentation_triggered
void MainWindow::on_actionControlDocumentation_triggered()
{
QAxWidget *container = activeAxWidget();
if (!container)
return;
const QString docu = container->generateDocumentation();
if (docu.isEmpty())
return;
DocuWindow *docwindow = new DocuWindow(docu);
QMdiSubWindow *subWindow = mdiArea->addSubWindow(docwindow);
subWindow->setWindowTitle(DocuWindow::tr("%1 - Documentation").arg(container->windowTitle()));
docwindow->show();
}
示例10: new_swing_trade
void MainWindow::new_swing_trade()
{
QString contractName = tr("Exchange-Contract-").append(QString("%1").arg(swing_counter_));
SwingTradeDialog *swingTradeDialog = new SwingTradeDialog(contractName, swing_counter_, disp_, this);
connect(swingTradeDialog, SIGNAL(update_contract(QString)), this, SLOT(update_swing_contract(QString)));
QMdiSubWindow *qMdiSubWindow = ui_->mdiArea_swing->addSubWindow(swingTradeDialog);
qMdiSubWindow->setAttribute(Qt::WA_DeleteOnClose);
qMdiSubWindow->setFixedSize(265, 440);
qMdiSubWindow->setWindowFlags(qMdiSubWindow->windowFlags()& ~Qt::WindowMaximizeButtonHint& ~Qt::WindowMinimizeButtonHint);
qMdiSubWindow->setWindowTitle(contractName);
qMdiSubWindow->show();
swing_counter_++;
selcon_->setCurrentText(contractName);
}
示例11: ImageTabs
void
PidMain::openImage()
{
QString path;
path = QFileDialog::getOpenFileName(this,
"Choose an image file to open",
QString::null,
"*.jpg *.jpeg");
if (path != NULL)
{
ImageTabs *img = new ImageTabs(mdiArea, path);
QMdiSubWindow *imgWindow = mdiArea->addSubWindow(img);
imgWindow->setWindowTitle(path);
imgWindow->show();
}
}
示例12: mainAdapterWidget
int mainAdapterWidget(QApplication& a, osg::ArgumentParser& arguments) {
// load the scene.
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
if (!loadedModel) {
std::cerr << arguments[0] << ": No data loaded." << std::endl;
std::cout << "usage: " << arguments[0] << " [--mdi] nodefile" << std::endl;
return 1;
}
std::cout << "Using AdapterWidget - QGLWidget subclassed to integrate with "
"osgViewer using its embedded graphics window support."
<< std::endl;
if (arguments.read("--mdi")) {
std::cout << "Using ViewetQT MDI version" << std::endl;
/*
Following problems are found here:
- miminize causes loaded model to disappear (some problem with Camera
matrix? - clampProjectionMatrix is invalid)
*/
ViewerQT* viewerWindow = new ViewerQT;
viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);
viewerWindow->setSceneData(loadedModel.get());
QMainWindow* mw = new QMainWindow();
QMdiArea* mdiArea = new QMdiArea(mw);
mw->setCentralWidget(mdiArea);
QMdiSubWindow* subWindow = mdiArea->addSubWindow(viewerWindow);
subWindow->showMaximized();
subWindow->setWindowTitle("New Window");
mw->show();
} else {
ViewerQT* viewerWindow = new ViewerQT;
viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);
viewerWindow->setSceneData(loadedModel.get());
viewerWindow->show();
}
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
return a.exec();
}
示例13: addChatWindow
void ChatList::addChatWindow(ChatWindow* chatw)
{
connect(m_mainWindow, SIGNAL(closing()), chatw, SLOT(save()));
int listSize = m_chatWindowList.size();
beginInsertRows(QModelIndex(), listSize, listSize);
m_chatMenu.addAction(chatw->toggleViewAction());
connect(chatw, SIGNAL(ChatWindowHasChanged(ChatWindow *)), this, SLOT(changeChatWindow(ChatWindow *)));
QMdiSubWindow* subWindowChat = static_cast<QMdiSubWindow*>(m_mainWindow->registerSubWindow(chatw,chatw->toggleViewAction()));
connect(chatw->chat(), SIGNAL(changedName(QString)), subWindowChat, SLOT(setWindowTitle(QString)));
m_chatWindowList.append(chatw);
m_chatSubWindowList.append(subWindowChat);
if((subWindowChat->height()<451)||(subWindowChat->width()<264))
{
subWindowChat->resize(264,451);
}
if(NULL!=subWindowChat)
{
chatw->setSubWindow(subWindowChat);
subWindowChat->setWindowTitle(tr("%1 (Chat)").arg(chatw->getTitleFromChat()));
subWindowChat->setWindowIcon(QIcon(":/chat.png"));
subWindowChat->setAttribute(Qt::WA_DeleteOnClose, false);
chatw->setAttribute(Qt::WA_DeleteOnClose, false);
subWindowChat->setVisible(chatw->toggleViewAction()->isChecked());
}
endInsertRows();
}
示例14: openPage
void MainWindow::openPage( int type, quint32 accountid )
{
if( type <= 0 )
return;
QUuid id;
PageWidgetMember *tab = NULL;
QString header;
//usual window
if( type != 13 )
{
if( !hList.contains( type, id ) )
{
//create page
tab = createPage( type, accountid, header );
}
else
{
//show page
setPageActive( id, accountid );
return;
}
}
//transactions window
else if( type == 13 && accountid > 0 )
{
if( !hList.trContains( accountid, id ) )
{
tab = createPage( type, accountid, header );
}
else
{
setPageActive( id );
return;
}
}
// -------
// -------
if( tab == NULL )
return;
connect( tab, SIGNAL( closeRequest( const QUuid & ) ), this, SLOT( closePage( const QUuid & ) ) );
connect( tab, SIGNAL( closed( int ) ), this, SLOT( closedPage( int ) ) );
connect( tab, SIGNAL( headerChanged( const QString & ) ), this, SLOT( changeHeader( const QString & ) ) );
//create an empty tab on tabwidget
disconnect( tabWidget, SIGNAL( currentChanged(int) ), this, SLOT( setPageActive(int) ) );
tabWidget->addTab( new QWidget(), header );
tabWidget->setCurrentIndex( tabWidget->count()-1 );
if( tab->hasIcon() )
tabWidget->setTabIcon( tabWidget->count()-1, *tab->icon() );
connect( tabWidget, SIGNAL( currentChanged(int) ), this, SLOT( setPageActive(int) ) );
// ----
//create and show window in MDI Area
QMdiSubWindow *subW = new QMdiSubWindow(this);
subW->setWidget( tab );
subW->setWindowTitle( header );
subW->setAttribute( Qt::WA_DeleteOnClose );
mdiArea->addSubWindow( subW );
subW->showMaximized();
subW->show();
// -----
//creating a handler for the tab
Handler *h = new Handler();
h->id = QUuid::createUuid();
h->accountid = accountid;
h->type = type;
h->number = tabWidget->count()-1;
// -----
tab->setHandler( *h );
hList.append( h );
}
示例15: mainAdapterWidget
int mainAdapterWidget(QApplication& a, osg::ArgumentParser& arguments)
{
// load the scene.
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
if (!loadedModel)
{
std::cout << arguments[0] <<": No data loaded." << std::endl;
return 1;
}
std::cout<<"Using AdapterWidget - QGLWidget subclassed to integrate with osgViewer using its embedded graphics window support."<<std::endl;
if (arguments.read("--CompositeViewer"))
{
CompositeViewerQT* viewerWindow = new CompositeViewerQT;
unsigned int width = viewerWindow->width();
unsigned int height = viewerWindow->height();
{
osgViewer::View* view1 = new osgViewer::View;
view1->getCamera()->setGraphicsContext(viewerWindow->getGraphicsWindow());
view1->getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(width)/static_cast<double>(height/2), 1.0, 1000.0);
view1->getCamera()->setViewport(new osg::Viewport(0,0,width,height/2));
view1->setCameraManipulator(new osgGA::TrackballManipulator);
view1->setSceneData(loadedModel.get());
viewerWindow->addView(view1);
}
{
osgViewer::View* view2 = new osgViewer::View;
view2->getCamera()->setGraphicsContext(viewerWindow->getGraphicsWindow());
view2->getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(width)/static_cast<double>(height/2), 1.0, 1000.0);
view2->getCamera()->setViewport(new osg::Viewport(0,height/2,width,height/2));
view2->setCameraManipulator(new osgGA::TrackballManipulator);
view2->setSceneData(loadedModel.get());
viewerWindow->addView(view2);
}
viewerWindow->show();
}
else if (arguments.read("--mdi")) {
std::cout<<"Using ViewetQT MDI version"<<std::endl;
/*
Following problems are found here:
- miminize causes loaded model to disappear (some problem with Camera matrix? - clampProjectionMatrix is invalid)
*/
ViewerQT* viewerWindow = new ViewerQT;
viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);
viewerWindow->setSceneData(loadedModel.get());
QMainWindow* mw = new QMainWindow();
QMdiArea* mdiArea = new QMdiArea(mw);
mw->setCentralWidget(mdiArea);
QMdiSubWindow *subWindow = mdiArea->addSubWindow(viewerWindow);
subWindow->showMaximized();
subWindow->setWindowTitle("New Window");
mw->show();
} else {
ViewerQT* viewerWindow = new ViewerQT;
viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);
viewerWindow->setSceneData(loadedModel.get());
viewerWindow->show();
}
a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
return a.exec();
}