本文整理汇总了C++中setAllowedAreas函数的典型用法代码示例。如果您正苦于以下问题:C++ setAllowedAreas函数的具体用法?C++ setAllowedAreas怎么用?C++ setAllowedAreas使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAllowedAreas函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:cguebert,项目名称:SofaViewer,代码行数:50,代码来源:MainWindow.cpp
示例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_);
}
开发者ID:sarbi127,项目名称:inviwo,代码行数:29,代码来源:propertylistwidget.cpp
示例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();
}
开发者ID:AdrianShe,项目名称:MuseScore,代码行数:25,代码来源:palettebox.cpp
示例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);
}
开发者ID:lihw,项目名称:glf,代码行数:32,代码来源:glf_output_window.cpp
示例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)));
}
开发者ID:HipHopScoreboard,项目名称:MuseScore,代码行数:60,代码来源:texttools.cpp
示例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);
}
开发者ID:hfiguiere,项目名称:rolisteam,代码行数:25,代码来源:toolsbar.cpp
示例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());
}
开发者ID:t27duck,项目名称:dolphin,代码行数:35,代码来源:RegisterWidget.cpp
示例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);
*/
}
开发者ID:ngocthanhtnt,项目名称:ledshow,代码行数:30,代码来源:progManage.cpp
示例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);
}
开发者ID:Ojaswi,项目名称:inviwo,代码行数:27,代码来源:pythoneditorwidget.cpp
示例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();
}
开发者ID:cancamilo,项目名称:amarok,代码行数:34,代码来源:BrowserDock.cpp
示例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();//默认关闭
}
开发者ID:enefry,项目名称:cpad,代码行数:34,代码来源:functionlistarea.cpp
示例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;
}
}
开发者ID:sarbi127,项目名称:inviwo,代码行数:29,代码来源:helpwidget.cpp
示例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()) );
}
开发者ID:DSastre,项目名称:supercollider,代码行数:30,代码来源:help_browser.cpp
示例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()));
}
开发者ID:nanox,项目名称:tupi,代码行数:7,代码来源:tupconfigurationarea.cpp
示例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&)));
}
开发者ID:uwei,项目名称:MuseScore,代码行数:26,代码来源:palettebox.cpp
示例16: QToolBar
BtModuleChooserBar::BtModuleChooserBar(QWidget *parent)
: QToolBar(parent),
BtWindowModuleChooser(CSwordModuleInfo::Unknown, nullptr),
m_idCounter(0),
m_window(nullptr) {
setAllowedAreas(Qt::TopToolBarArea);
setFloatable(false);
}
开发者ID:bibletime,项目名称:bibletime,代码行数:8,代码来源:btmodulechooserbar.cpp
示例17: QToolBar
ToolBar::ToolBar (QWidget *parent = NULL) : QToolBar(parent)
{
setAllowedAreas(Qt::AllToolBarAreas);
setMovable(true);
setFloatable(true);
initActions();
}
开发者ID:spthaolt,项目名称:qt-virt-manager,代码行数:8,代码来源:toolbar.cpp
示例18: QDockWidget
ShapePropertiesDocker::ShapePropertiesDocker(QWidget *parent)
: QDockWidget(i18n("Shape Properties"), parent),
d( new Private() )
{
setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
d->widgetStack = new QStackedWidget();
setWidget(d->widgetStack);
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:8,代码来源:ShapePropertiesDocker.cpp
示例19: BaseDock
BaseTreeDock::BaseTreeDock(QString window_title, QString object_name, bool requires_refresh, QWidget *parent, Qt::WindowFlags flags)
: BaseDock(parent, flags)
, m_collapsed(true)
{
setWindowTitle(window_title);
setObjectName(object_name);
setFeatures(QDockWidget::AllDockWidgetFeatures);
setAllowedAreas(Qt::AllDockWidgetAreas);
m_arr_in = QIcon(":img/arrow-in.png");
m_arr_out = QIcon(":img/arrow-out.png");
QWidget *w = new QWidget();
QVBoxLayout *l = new QVBoxLayout();
w->setLayout(l);
m_tree_view = new QTreeWidget(this);
m_tree_view->setEditTriggers(QAbstractItemView::NoEditTriggers);
m_tree_view->setDropIndicatorShown(false);
m_tree_view->setProperty("showSortIndicator",QVariant(true));
m_tree_view->setSelectionMode(QAbstractItemView::ExtendedSelection);
QHBoxLayout *s = new QHBoxLayout();
QLabel *lbl_search = new QLabel(tr("Search"),this);
s->addWidget(lbl_search);
m_le_search = new QLineEdit(this);
m_le_search->setObjectName("le_search");
s->addWidget(m_le_search);
m_btn_toggle_tree = new QPushButton(this);
m_btn_toggle_tree->setIcon(m_arr_out);
s->addWidget(m_btn_toggle_tree);
QPushButton *btn_clear_search = new QPushButton(this);
QIcon icn_cross(":img/cross.png");
btn_clear_search->setIcon(icn_cross);
s->addWidget(btn_clear_search);
l->addLayout(s);
QPushButton *btn = new QPushButton(tr("Clear Filter"),this);
w->layout()->addWidget(m_tree_view);
w->layout()->addWidget(btn);
setWidget(w);
connect(btn, SIGNAL(clicked()),this,SLOT(clear_filter()));
connect(m_le_search, SIGNAL(textChanged(QString)), this, SLOT(search_changed(QString)));
connect(btn_clear_search, SIGNAL(clicked()),this,SLOT(clear_search()));
connect(m_btn_toggle_tree, SIGNAL(clicked()), this, SLOT(toggle_tree()));
connect(m_tree_view, SIGNAL(itemSelectionChanged()), this, SLOT(selection_changed()));
m_requires_refresh = requires_refresh;
if(DT){
connect(DT,SIGNAL(units_refreshed()),this,SLOT(refresh()));
}
}
开发者ID:klassekatze,项目名称:Dwarf-Therapist,代码行数:58,代码来源:basetreedock.cpp
示例20: setAllowedAreas
void DockWidget::setState(bool edit) {
QDockWidget::DockWidgetFeatures features;
if (edit) {
setAllowedAreas(Qt::AllDockWidgetAreas);
features = QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable;
if (isClosable()) {
features |= QDockWidget::DockWidgetClosable;
}
} else {
setAllowedAreas(Qt::NoDockWidgetArea);
features = QDockWidget::NoDockWidgetFeatures;
if (isFloating()) {
features |= QDockWidget::DockWidgetFloatable;
}
}
setFeatures(features);
setTitleBarWidget(isFloating() || edit ? Q_NULLPTR : m_titleHide);
}
开发者ID:zdimension,项目名称:CEmu,代码行数:18,代码来源:dockwidget.cpp
注:本文中的setAllowedAreas函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论