本文整理汇总了C++中setAllowedAreas函数的典型用法代码示例。如果您正苦于以下问题:C++ setAllowedAreas函数的具体用法?C++ setAllowedAreas怎么用?C++ setAllowedAreas使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAllowedAreas函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
// Buttons
auto buttonsDock = new QDockWidget(tr("Buttons"));
m_buttonsDockWidget = new QWidget(this);
auto buttonsLayout = new QGridLayout;
m_buttonsDockWidget->setLayout(buttonsLayout);
buttonsDock->setObjectName("ButtonsDock");
buttonsDock->setWidget(m_buttonsDockWidget);
buttonsDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
addDockWidget(Qt::LeftDockWidgetArea, buttonsDock);
// Graph tree
m_graphView = new GraphView(this);
auto graphDock = new QDockWidget(tr("Graph"), this);
graphDock->setObjectName("GraphDock");
graphDock->setWidget(m_graphView->view());
graphDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
addDockWidget(Qt::LeftDockWidgetArea, graphDock);
m_openGLView = new OpenGLView(this);
setCentralWidget(m_openGLView);
createActions();
createMenus();
statusBar();
std::vector<QMenu*> menus = { m_fileMenu, m_toolsMenu, m_viewMenu, m_helpMenu };
m_simpleGUI = std::make_shared<SimpleGUIImpl>(this, m_openGLView, m_buttonsDockWidget, menus);
connect(m_graphView, &GraphView::itemOpened, [this](void* item) {
m_simpleGUI->openPropertiesDialog(static_cast<GraphNode*>(item));
});
setWindowIcon(QIcon(":/share/icons/icon.png"));
setCurrentFile("");
setAcceptDrops(true);
readSettings();
loadModules();
auto& factory = DocumentFactory::instance();
if (factory.creatableDocuments().empty())
m_newAction->setEnabled(false);
if (factory.loadFilesFilter().empty())
m_openAction->setEnabled(false);
}
示例2: InviwoDockWidget
PropertyListWidget::PropertyListWidget(QWidget* parent)
: InviwoDockWidget(tr("Properties"), parent) {
setObjectName("ProcessorListWidget");
setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
QSizePolicy sp(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
sp.setVerticalStretch(1);
sp.setHorizontalStretch(1);
setSizePolicy(sp);
scrollArea_ = new QScrollArea(this);
scrollArea_->setWidgetResizable(true);
scrollArea_->setMinimumWidth(320);
scrollArea_->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
scrollArea_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea_->setFrameShape(QFrame::NoFrame);
scrollArea_->setContentsMargins(0, PropertyWidgetQt::SPACING, 0, PropertyWidgetQt::SPACING);
listWidget_ = new PropertyListFrame(this);
listLayout_ = new QVBoxLayout();
listWidget_->setLayout(listLayout_);
listLayout_->setAlignment(Qt::AlignTop);
listLayout_->setContentsMargins(0, PropertyWidgetQt::SPACING, 0, PropertyWidgetQt::SPACING);
listLayout_->setSpacing(7);
listLayout_->setSizeConstraint(QLayout::SetMinAndMaxSize);
scrollArea_->setWidget(listWidget_);
setWidget(scrollArea_);
}
示例3: QDockWidget
PaletteBox::PaletteBox(QWidget* parent)
: QDockWidget(tr("Palettes"), parent)
{
setObjectName("palette-box");
setAllowedAreas(Qt::DockWidgetAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea));
PaletteBoxScrollArea* sa = new PaletteBoxScrollArea;
sa->setFocusPolicy(Qt::NoFocus);
sa->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
sa->setContextMenuPolicy(Qt::CustomContextMenu);
sa->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
sa->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
sa->setWidgetResizable(true);
sa->setFrameShape(QFrame::NoFrame);
setWidget(sa);
QWidget* paletteList = new QWidget;
sa->setWidget(paletteList);
vbox = new QVBoxLayout;
paletteList->setLayout(vbox);
vbox->setMargin(0);
vbox->setSpacing(1);
vbox->addStretch();
paletteList->show();
}
示例4: KxDockWidget
GLFOutputWindow::GLFOutputWindow(QWidget* parent)
: KxDockWidget(tr("Output"), parent)
{
setFloating(true);
setFeatures(QDockWidget::DockWidgetMovable | QDockWidget:: DockWidgetFloatable);
setAllowedAreas(Qt::NoDockWidgetArea);
setMinimumSize(640, 120);
QWidget* mainWidget = new QWidget(this);
setWidget(mainWidget);
_pTextEdit = new QTextEdit(this);
_pTextEdit->setReadOnly(true);
_pSaveButton = new QPushButton(tr("Save"), this);
_pClearButton = new QPushButton(tr("Clear"), this);
connect(_pSaveButton, SIGNAL(clicked()), this, SLOT(onSave()));
connect(_pClearButton, SIGNAL(clicked()), this, SLOT(onClear()));
QVBoxLayout* mainLayout = new QVBoxLayout(mainWidget);
mainWidget->setLayout(mainLayout);
mainLayout->addWidget(_pTextEdit);
QHBoxLayout* hboxLayout = new QHBoxLayout();
mainLayout->addLayout(hboxLayout);
hboxLayout->addStretch();
hboxLayout->addWidget(_pClearButton);
hboxLayout->addWidget(_pSaveButton);
}
示例5: QDockWidget
TextTools::TextTools(QWidget* parent)
: QDockWidget(parent)
{
_textElement = 0;
setObjectName("text-tools");
setWindowTitle(tr("Text Tools"));
setAllowedAreas(Qt::DockWidgetAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea));
QToolBar* tb = new QToolBar(tr("Text Edit"));
tb->setIconSize(QSize(preferences.iconWidth, preferences.iconHeight));
showKeyboard = getAction("show-keys");
showKeyboard->setCheckable(true);
tb->addAction(showKeyboard);
typefaceBold = tb->addAction(*icons[int(Icons::textBold_ICON)], "");
typefaceBold->setToolTip(tr("Bold"));
typefaceBold->setCheckable(true);
typefaceItalic = tb->addAction(*icons[int(Icons::textItalic_ICON)], "");
typefaceItalic->setToolTip(tr("Italic"));
typefaceItalic->setCheckable(true);
typefaceUnderline = tb->addAction(*icons[int(Icons::textUnderline_ICON)], "");
typefaceUnderline->setToolTip(tr("Underline"));
typefaceUnderline->setCheckable(true);
tb->addSeparator();
typefaceSubscript = tb->addAction(*icons[int(Icons::textSub_ICON)], "");
typefaceSubscript->setToolTip(tr("Subscript"));
typefaceSubscript->setCheckable(true);
typefaceSuperscript = tb->addAction(*icons[int(Icons::textSuper_ICON)], "");
typefaceSuperscript->setToolTip(tr("Superscript"));
typefaceSuperscript->setCheckable(true);
tb->addSeparator();
typefaceFamily = new QFontComboBox(this);
tb->addWidget(typefaceFamily);
typefaceSize = new QDoubleSpinBox(this);
typefaceSize->setFocusPolicy(Qt::ClickFocus);
tb->addWidget(typefaceSize);
setWidget(tb);
QWidget* w = new QWidget(this);
setTitleBarWidget(w);
titleBarWidget()->hide();
connect(typefaceSize, SIGNAL(valueChanged(double)), SLOT(sizeChanged(double)));
connect(typefaceFamily, SIGNAL(currentFontChanged(const QFont&)), SLOT(fontChanged(const QFont&)));
connect(typefaceBold, SIGNAL(triggered(bool)), SLOT(boldClicked(bool)));
connect(typefaceItalic, SIGNAL(triggered(bool)), SLOT(italicClicked(bool)));
connect(typefaceUnderline, SIGNAL(triggered(bool)), SLOT(underlineClicked(bool)));
connect(typefaceSubscript, SIGNAL(triggered(bool)), SLOT(subscriptClicked(bool)));
connect(typefaceSuperscript, SIGNAL(triggered(bool)), SLOT(superscriptClicked(bool)));
connect(showKeyboard, SIGNAL(triggered(bool)), SLOT(showKeyboardClicked(bool)));
}
示例6: QDockWidget
ToolsBar::ToolsBar(QWidget *parent)
: QDockWidget(parent)
{
m_currentTool = Handler;
setWindowTitle(tr("Tools"));
setObjectName("ToolsBar");
setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
m_mainWidget = new QWidget(this);
setWidget(m_mainWidget);
createActions();
createTools();
connect(m_resetCountAct, SIGNAL(triggered(bool)), this, SLOT(resetNpcNumber()));
connect(m_textEdit, SIGNAL(textEdited(const QString &)), this, SIGNAL(currentTextChanged(QString)));
connect(m_npcNameEdit, SIGNAL(textEdited(const QString &)), this, SIGNAL(currentNpcNameChanged(QString)));
connect(this, SIGNAL(topLevelChanged(bool)), this, SLOT(changeSize(bool)));
setFloating(false);
}
示例7: QDockWidget
RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
{
setWindowTitle(tr("Registers"));
setAllowedAreas(Qt::AllDockWidgetAreas);
QSettings settings;
restoreGeometry(settings.value(QStringLiteral("registerwidget/geometry")).toByteArray());
setFloating(settings.value(QStringLiteral("registerwidget/floating")).toBool());
CreateWidgets();
PopulateTable();
ConnectWidgets();
connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this](Core::State state) {
if (Settings::Instance().IsDebugModeEnabled() && Core::GetState() == Core::State::Paused)
emit RequestTableUpdate();
});
connect(this, &RegisterWidget::RequestTableUpdate, [this] {
m_updating = true;
emit UpdateTable();
m_updating = false;
});
connect(&Settings::Instance(), &Settings::RegistersVisibilityChanged,
[this](bool visible) { setHidden(!visible); });
connect(&Settings::Instance(), &Settings::DebugModeToggled, [this](bool enabled) {
setHidden(!enabled || !Settings::Instance().IsRegistersVisible());
});
setHidden(!Settings::Instance().IsRegistersVisible() ||
!Settings::Instance().IsDebugModeEnabled());
}
示例8: CprogManage
//program管理
CprogManage:: CprogManage(QWidget *parent):QDockWidget(tr("节目管理"), parent)
{
setAllowedAreas(Qt::LeftDockWidgetArea);
treeWidget = new QTreeWidget(this);//(this);
treeWidget->setHeaderHidden(true);//header()->setVisible(false);
//QObject::connect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
// this, SLOT(clickItem(QTreeWidgetItem *, int)));
setWidget(treeWidget);
setFeatures(QDockWidget::NoDockWidgetFeatures);
//previewWin = new QMainWindow(w);
//previewArea = new CscreenArea;
/*
previewWin = new QMainWindow(w);
previewWin->setWindowModality(Qt::WindowModal);
previewArea = new CscreenArea;//(previewWin);
previewArea->setWindowModality(Qt::WindowModal);
previewArea->previewFlag = 1;
previewWin->setCentralWidget(previewArea);
//QDialog d(previewArea);
*/
}
示例9: InviwoDockWidget
PythonEditorWidget::PythonEditorWidget(QWidget* parent)
: InviwoDockWidget(tr("Python Editor"), parent)
, settings_("Inviwo", "Inviwo")
, infoTextColor_(153, 153, 153)
, errorTextColor_(255, 107, 107)
, script_()
, unsavedChanges_(false) {
ivwAssert(instance_ == nullptr, "This is a Singelton, constructor may only be called once")
instance_ = this;
setObjectName("PythonEditor");
settings_.beginGroup("PythonEditor");
QString lastFile = settings_.value("lastScript", "").toString();
settings_.endGroup();
setVisible(false);
buildWidget();
resize(500, 700);
InviwoApplication::getPtr()->registerFileObserver(this);
unsavedChanges_ = false;
if (lastFile.size() != 0) loadFile(lastFile.toLocal8Bit().constData(), false);
setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
setFloating(true);
}
示例10: AmarokDockWidget
BrowserDock::BrowserDock( QWidget *parent )
: AmarokDockWidget( i18n( "&Media Sources" ), parent )
{
setObjectName( "Media Sources dock" );
setAllowedAreas( Qt::AllDockWidgetAreas );
//we have to create this here as it is used when setting up the
//categories (unless of course we move that to polish as well...)
m_mainWidget = new KVBox( this );
setWidget( m_mainWidget );
m_mainWidget->setContentsMargins( 0, 0, 0, 0 );
m_mainWidget->setFrameShape( QFrame::NoFrame );
m_mainWidget->setMinimumWidth( 200 );
m_mainWidget->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored );
m_mainWidget->setFocus( Qt::ActiveWindowFocusReason );
m_breadcrumbWidget = new BrowserBreadcrumbWidget( m_mainWidget );
new HorizontalDivider( m_mainWidget );
m_categoryList = new BrowserCategoryList( "root list", m_mainWidget );
m_breadcrumbWidget->setRootList( m_categoryList.data() );
m_messageArea = new BrowserMessageArea( m_mainWidget );
m_messageArea->setAutoFillBackground( true );
m_messageArea->setFixedHeight( 36 );
Amarok::Logger *logger = Amarok::Components::logger();
ProxyLogger *proxy = dynamic_cast<ProxyLogger *>( logger );
if( proxy )
proxy->setLogger( m_messageArea );
else
error() << "Was not able to register BrowserDock as logger";
ensurePolish();
}
示例11: QWidget
void FunctionListArea::generalSetting()
{
QWidget *widget = new QWidget();
QHBoxLayout *layout = new QHBoxLayout();
QLabel *label = new QLabel(tr("函数列表:"), this);
widget->setLayout(layout);
layout->addWidget(label);
layout->addWidget(functionListBox, 1);
setTitleBarWidget(widget);
setWidget(new QWidget());
setFixedHeight(24);
layout->setContentsMargins(5, 4, 5, 0);
connect(functionListBox,
SIGNAL(activated(int)),
this,
SLOT(cursorMove(int))
);
connect(functionListBox,
SIGNAL(updateFunctionList()),
this,
SLOT(createFunctionList())
);
QFont afont(font());
afont.setPointSize(10);
setFont(afont);
setWindowTitle(tr(""));
setAllowedAreas(Qt::TopDockWidgetArea);
setFeatures(QDockWidget::DockWidgetClosable);
//QDockWidget::DockWidgetVerticalTitleBar);
QMainWindow *main = qobject_cast<QMainWindow *>(parent());
main->addDockWidget(Qt::TopDockWidgetArea, this);
hide();//默认关闭
}
示例12: InviwoDockWidget
HelpWidget::HelpWidget(QWidget* parent)
: InviwoDockWidget(tr("Help"), parent), helpBrowser_(nullptr), helpEngine_(nullptr) {
setObjectName("HelpWidget");
setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
QWidget* centralWidget = new QWidget();
QVBoxLayout* vLayout = new QVBoxLayout(centralWidget);
vLayout->setSpacing(7);
vLayout->setContentsMargins(0, 0, 0, 0);
std::string helpfile =
InviwoApplication::getPtr()->getPath(InviwoApplication::PATH_HELP, "/inviwo.qhc");
helpEngine_ = new QHelpEngineCore(QString::fromStdString(helpfile), this);
helpBrowser_ = new HelpBrowser(this, helpEngine_);
helpBrowser_->setHtml(QString("Hello world"));
vLayout->addWidget(helpBrowser_);
centralWidget->setLayout(vLayout);
setWidget(centralWidget);
connect(helpEngine_, SIGNAL(setupFinished()), this, SLOT(setupFinished()));
if (!helpEngine_->setupData()) {
LogWarn("Faild to setup the help engine:" << helpEngine_->error().toUtf8().constData());
delete helpEngine_;
helpEngine_ = nullptr;
}
}
示例13: Docklet
HelpBrowserDocklet::HelpBrowserDocklet( QWidget *parent ):
Docklet(tr("Help browser"), parent)
{
mHelpBrowser = new HelpBrowser;
setAllowedAreas(Qt::AllDockWidgetAreas);
setWidget(mHelpBrowser);
mFindBox = new HelpBrowserFindBox();
toolBar()->addWidget( mHelpBrowser->loadProgressIndicator(), 1 );
toolBar()->addAction( mHelpBrowser->mActions[HelpBrowser::GoHome] );
toolBar()->addAction( mHelpBrowser->mWebView->pageAction(QWebPage::Back) );
toolBar()->addAction( mHelpBrowser->mWebView->pageAction(QWebPage::Forward) );
toolBar()->addAction( mHelpBrowser->mWebView->pageAction(QWebPage::Reload) );
toolBar()->addWidget( mFindBox );
connect( mFindBox, SIGNAL(query(QString, bool)),
mHelpBrowser, SLOT(findText(QString, bool)) );
connect(Main::scProcess(), SIGNAL(started()), this, SLOT(onInterpreterStart()));
OverridingAction * action;
action = new OverridingAction(this);
action->setShortcut(QKeySequence::Find);
action->addToWidget(mHelpBrowser);
action->addToWidget(toolBar());
connect( action, SIGNAL(triggered(bool)), mFindBox, SLOT(setFocus()) );
connect( action, SIGNAL(triggered(bool)), mFindBox, SLOT(selectAll()) );
}
示例14: QDockWidget
TupConfigurationArea::TupConfigurationArea(QWidget *parent) : QDockWidget(parent), k(new Private)
{
k->toolTipShowed = false;
setAllowedAreas(Qt::RightDockWidgetArea);
connect(&k->shower, SIGNAL(timeout()), this, SLOT(showConfigurator()));
}
示例15: QDockWidget
PaletteBox::PaletteBox(QWidget* parent)
: QDockWidget(tr("Palettes"), parent)
{
setObjectName("palette-box");
setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
QScrollArea* sa = new QScrollArea;
sa->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
sa->setContextMenuPolicy(Qt::CustomContextMenu);
sa->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
sa->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
sa->setWidgetResizable(true);
setWidget(sa);
QWidget* paletteList = new QWidget;
sa->setWidget(paletteList);
vbox = new QVBoxLayout;
paletteList->setLayout(vbox);
_dirty = false;
vbox->setMargin(0);
vbox->setSpacing(1);
vbox->addStretch();
paletteList->show();
// connect(sa, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(contextMenu(const QPoint&)));
}