本文整理汇总了C++中QScrollArea::setWindowFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollArea::setWindowFlags方法的具体用法?C++ QScrollArea::setWindowFlags怎么用?C++ QScrollArea::setWindowFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollArea
的用法示例。
在下文中一共展示了QScrollArea::setWindowFlags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: activated
void FileBrowser::activated(const QModelIndex &index)
{
QFileInfo fileInfo = fileSystemModel->fileInfo(index);
if (fileInfo.isDir() && fileInfo.fileName() != QLatin1String(".")) {
if (fileInfo.fileName() == QLatin1String("..")) {
QModelIndex parent = view->rootIndex().parent();
fileInfo = fileSystemModel->fileInfo(parent);
if (fileInfo.absoluteFilePath() == rootPath)
fileSystemModel->setFilter(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs);
view->setRootIndex(parent);
} else {
fileSystemModel->setFilter(QDir::AllEntries | QDir::AllDirs);
view->setRootIndex(index);
}
setWindowTitle(fileInfo.fileName());
} else {
if (fileInfo.fileName() == QLatin1String("."))
fileInfo = fileSystemModel->fileInfo(view->rootIndex());
#if defined(Q_WS_MAEMO_5)
DocumentPropertiesWidget *widget = new DocumentPropertiesWidget(fileInfo, gallery, this);
widget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
QScrollArea *window = new QScrollArea(this);
window->setWindowFlags(window->windowFlags() | Qt::Window);
window->setAttribute(Qt::WA_DeleteOnClose);
window->setAttribute(Qt::WA_Maemo5StackedWindow);
window->setWidgetResizable(true);
window->setWidget(widget);
window->show();
#elif defined (Q_OS_SYMBIAN)
QScrollArea *window = new QScrollArea(this);
DocumentPropertiesWidget *widget = new DocumentPropertiesWidget(fileInfo, gallery, window);
widget->setWindowModality(Qt::WindowModal);
window->setWindowFlags(window->windowFlags() | Qt::Dialog);
window->setAttribute(Qt::WA_DeleteOnClose);
window->setWidgetResizable(true);
window->setWidget(widget);
window->showMaximized();
#else
DocumentPropertiesWidget *widget = new DocumentPropertiesWidget(fileInfo, gallery, this);
widget->setWindowFlags(widget->windowFlags() | Qt::Dialog);
widget->setAttribute(Qt::WA_DeleteOnClose);
widget->setWindowModality(Qt::WindowModal);
# if defined(Q_OS_SYMBIAN)
widget->showMaximized();
# else
widget->show();
# endif
#endif
}
}
示例2: display
void CGraphicBuildingTile::display(QList<QString> _toDisplay)
{
QDialog* infoDialog = new QDialog;//(dynamic_cast<QWidget*>(this->parent()));
QVBoxLayout* newLayout = new QVBoxLayout();
int q=0;
QScrollArea* scrolArea = new QScrollArea(dynamic_cast<QWidget*>(this->parent()));
for(int i=0;i<_toDisplay.count();i++)
{ QLabel* newLabel = new QLabel(_toDisplay.at(i));
newLabel->setFixedWidth(280);
newLabel->setMinimumHeight(22);
newLabel->setStyleSheet("border: 1px solid black");
newLayout->addWidget(newLabel);
q++;
}
QPalette pal;
pal.setColor(QPalette::Background,QColor(230,200,167));
infoDialog->setFixedWidth(330);
infoDialog->setMinimumHeight(30+22*q);
infoDialog->setLayout(newLayout);
infoDialog->setAutoFillBackground(true);
infoDialog->setPalette(pal);
infoDialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
scrolArea->setWidget(infoDialog);
scrolArea->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
scrolArea->setMaximumHeight(infoDialog->size().height()+2);
scrolArea->setWindowTitle(QString("Info about"));
scrolArea->show();
}