本文整理汇总了C++中QMdiSubWindow::setWindowIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ QMdiSubWindow::setWindowIcon方法的具体用法?C++ QMdiSubWindow::setWindowIcon怎么用?C++ QMdiSubWindow::setWindowIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMdiSubWindow
的用法示例。
在下文中一共展示了QMdiSubWindow::setWindowIcon方法的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: CreateTableReport
void MainWindow::CreateTableReport()
{
if (!SetActiveTable(tReport))
{
QMdiSubWindow *sw = CreateTable(tReport, new TblReport(mdiArea));
sw->setWindowIcon(QIcon(":/Resource/Images/Report.ico"));
}
}
示例3: CreateTableContract
void MainWindow::CreateTableContract()
{
if (!SetActiveTable(tContract))
{
QMdiSubWindow *sw = CreateTable(tContract, new TblContract(mdiArea));
sw->setWindowIcon(QIcon(":/Resource/Images/Contract.ico"));
}
}
示例4: CreateTableDeveloper
void MainWindow::CreateTableDeveloper()
{
if (!SetActiveTable(tDeveloper))
{
QMdiSubWindow *sw = CreateTable(tDeveloper, new TblDeveloper(mdiArea));
sw->setWindowIcon(QIcon(":/Resource/Images/Developer.ico"));
}
}
示例5: CreateTableDistrProjDev
void MainWindow::CreateTableDistrProjDev()
{
if (!SetActiveTable(tDistrProjDev))
{
QMdiSubWindow *sw = CreateTable(tDistrProjDev, new TblDistrProjDev(mdiArea));
sw->setWindowIcon(QIcon(":/Resource/Images/Distribution.ico"));
}
}
示例6: CreateTableProblemDepend
void MainWindow::CreateTableProblemDepend()
{
if (!SetActiveTable(tProblemDepend))
{
QMdiSubWindow *sw = CreateTable(tProblemDepend, new TblProblemDepend(mdiArea));
sw->setWindowIcon(QIcon(":/Resource/Images/Depending.ico"));
}
}
示例7: 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);
}
示例8: pix
QMdiSubWindow *CustomMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags flags) {
QMdiSubWindow *subwindow = QMdiArea::addSubWindow(widget, flags);
QPixmap pix(16, 16);
pix.fill(Qt::transparent);
subwindow->setWindowIcon(QIcon(pix));
subwindow->setOption(QMdiSubWindow::RubberBandResize, true);
subwindow->setOption(QMdiSubWindow::RubberBandMove, true);
return subwindow;
}
示例9: slotFileNew
void App::slotFileNew()
{
QLCFixtureEditor* editor;
QMdiSubWindow* sub;
sub = new QMdiSubWindow(centralWidget());
editor = new QLCFixtureEditor(sub, new QLCFixtureDef());
sub->setWidget(editor);
sub->setAttribute(Qt::WA_DeleteOnClose);
sub->setWindowIcon(QIcon(":/fixture.png"));
qobject_cast<QMdiArea*> (centralWidget())->addSubWindow(sub);
editor->show();
sub->show();
}
示例10: insertPlot
PlotWithCurves* Group::insertPlot()
{
QMdiSubWindow* window = new QMdiSubWindow;
{
window->setMinimumSize(250, 150);
window->setWindowIcon(QIcon(":/res/mainWindow/closeAllPlots.png"));
window->setAttribute(Qt::WA_DeleteOnClose);
}
PlotWithCurves* plot = new PlotWithCurves(samplesManager, curvesManagerView, window);
{
plot->connect(plot, SIGNAL(destroyed()), this, SLOT(retitle()));
window->setWidget(plot);
addSubWindow(window);
window->show();
retitle();
}
return plot;
}
示例11: displayText
//-----------------------------------------------------------------------------------------
bool GenericTextEditor::displayText(QString docName, QString text, QString extension, QString optionalData)
{
// If there is no extra extension passed, then try to find the matching one based on the doc name
ITextEditorCodecFactory* codecFactory;
if(extension == "")
codecFactory = GenericTextEditor::findMatchingCodecFactory(docName);
else
codecFactory = GenericTextEditor::findMatchingCodecFactory(extension);
if(codecFactory == 0)
return false;
GenericTextEditorDocument* document = 0;
if(!isDocAlreadyShowing(docName, document) || isAllowDoubleDisplay())
{
document = new GenericTextEditorDocument(this);
ITextEditorCodec* codec = codecFactory->create(document, docName);
document->setCodec(codec);
document->displayText(docName, text, optionalData);
QMdiSubWindow *window = addSubWindow(document);
window->setWindowIcon(QIcon(codec->getDocumentIcon()));
document->showMaximized();
QTabBar* tabBar = findChildren<QTabBar*>().at(0);
tabBar->setTabToolTip(findChildren<QMdiSubWindow*>().size() - 1, docName);
}
else
{
document->getCodec()->setOptionalData(optionalData);
document->getCodec()->onDisplayRequest();
setActiveSubWindow(qobject_cast<QMdiSubWindow*>(document->window()));
document->setFocus(Qt::ActiveWindowFocusReason);
}
moveToForeground();
connect(document, SIGNAL(textChanged()), document, SLOT(documentWasModified()));
mActSave->setEnabled(false);
return true;
}
示例12: addEditorWindow
void MainWindow::addEditorWindow() {
_editor = new QsciScintilla;
_luaLexer = new QsciLexerLua;
_editor->setLexer(_luaLexer);
_luaLexer->setFont(QFont("Courier New"));
// symbols
_editor->setMarginType(1, QsciScintilla::SymbolMargin);
_editor->setMarginWidth(1, "xx");
_editor->setMarginSensitivity (1, true);
_editor->markerDefine(QsciScintilla::RightTriangle, BOOKMARK_MARKER);
_editor->setMarkerBackgroundColor(QColor (0,0,232), BOOKMARK_MARKER);
_editor->markerDefine(QsciScintilla::Circle, BREAKPOINT_MARKER);
_editor->setMarkerBackgroundColor(QColor (192,0,0), BREAKPOINT_MARKER);
_editor->markerDefine(QsciScintilla::RightTriangle, DEBUGGER_MARKER);
_editor->setMarkerBackgroundColor(QColor (255,255,0), DEBUGGER_MARKER);
// line numbers
_editor->setMarginsForegroundColor(QColor (96, 96, 96));
_editor->setMarginsBackgroundColor(QColor (232, 232, 220));
_editor->setMarginType(2, QsciScintilla::TextMargin);
_editor->setMarginWidth(2, "xxxx");
_editor->setMarginLineNumbers(2, true);
// other features
_editor->setBraceMatching(QsciScintilla::StrictBraceMatch);
_editor->setAutoIndent(true);
_editor->setIndentationWidth(2);
_editor->setIndentationsUseTabs(false);
_editor->setCaretLineVisible(true);
_editor->setCaretLineBackgroundColor(QColor (248, 248, 248));
_editor->setUtf8(true);
QMdiSubWindow *subWindow = ui->mdiArea->addSubWindow(_editor);
subWindow->setWindowIcon(QIcon("://icons/text-x-generic-template.svg"));
subWindow->showMaximized();
}
示例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: displayTextFromFile
//-----------------------------------------------------------------------------------------
bool GenericTextEditor::displayTextFromFile(QString filePath, QString optionalData)
{
ITextEditorCodecFactory* codecFactory = GenericTextEditor::findMatchingCodecFactory(filePath);
if(codecFactory == 0)
return false;
GenericTextEditorDocument* document = 0;
if(!isPathAlreadyShowing(filePath, document) || isAllowDoubleDisplay())
{
document = new GenericTextEditorDocument(this);
ITextEditorCodec* codec = codecFactory->create(document, filePath);
document->setCodec(codec);
document->displayTextFromFile(QFile(filePath).fileName(), filePath, optionalData);
QMdiSubWindow *window = addSubWindow(document);
window->setWindowIcon(QIcon(codec->getDocumentIcon()));
document->showMaximized();
QTabBar* tabBar = findChildren<QTabBar*>().at(0);
tabBar->setTabToolTip(findChildren<QMdiSubWindow*>().size() - 1, QFile(filePath).fileName());
}
else
{
document->getCodec()->setOptionalData(optionalData);
document->getCodec()->onDisplayRequest();
setActiveSubWindow(qobject_cast<QMdiSubWindow*>(document->window()));
document->setFocus(Qt::ActiveWindowFocusReason);
}
moveToForeground();
connect(document, SIGNAL(textChanged()), document, SLOT(documentWasModified()));
mActSave->setEnabled(false);
return true;
}
示例15: CreateWorkStatement
void MainWindow::CreateWorkStatement()
{
QMdiSubWindow *sw = mdiArea->addSubWindow(new WorkStatement(mdiArea));
sw->show();
sw->setWindowIcon(QIcon(":/Resource/Images/WorkStatement.ico"));
}