Beispiel #1
0
void TransfersView::dropEvent(QDropEvent * event)
{
    QModelIndex dropIndex = indexAt(event->pos());
    QTreeView::dropEvent(event);

    setExpanded(dropIndex, true);
}
Beispiel #2
0
void FeedsView::onItemExpandRequested(const QList<RootItem*> &items, bool exp) {
  foreach (const RootItem *item, items) {
    QModelIndex source_index = m_sourceModel->indexForItem(item);
    QModelIndex proxy_index = m_proxyModel->mapFromSource(source_index);

    //setExpanded(proxy_index, !exp);
    setExpanded(proxy_index, exp);
  }
 void PrimitiveTreeView::itemPressed(const QModelIndex & index)
 {
   QModelIndex parent = model()->parent(index);
   if(!parent.isValid())
   {
     setExpanded(index, !isExpanded(index));
   }
 }
TransverseCurveTreeWidgetItem::TransverseCurveTreeWidgetItem(const balazs::TransverseCurve& tc, QTreeWidgetItem *parent) :
    QTreeWidgetItem(parent), m_transverseCurve(tc)
{

    // length
    setText(0, QString::number(static_cast<double>(m_transverseCurve.length())));
    setExpanded(true);
}
void TreeView::onRowsInserted(const QModelIndex &parent, int first, int last)
{
	for (; first <= last; ++first) {
		QModelIndex index = model()->index(first, 0, parent);
		if (!m_closedIndexes.contains(index.data(TagName).toString()))
			setExpanded(index, true);
	}
}
Beispiel #6
0
void QgsLayerTreeView::updateExpandedStateFromNode( QgsLayerTreeNode* node )
{
  QModelIndex idx = layerTreeModel()->node2index( node );
  setExpanded( idx, node->isExpanded() );

  foreach ( QgsLayerTreeNode* child, node->children() )
    updateExpandedStateFromNode( child );
}
void AutoExpandingTreeView::ItemClicked(const QModelIndex& index) {
  if (ignore_next_click_) {
    ignore_next_click_ = false;
    return;
  }

  setExpanded(index, !isExpanded(index));
}
// Default constructor
LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_id, const LLUUID& object_id) :
	LLFloater(name, rect, title),
	mItemID(item_id),
	mObjectID(object_id),
	mDirty(TRUE)
	// <edit>
	, mExpanded(FALSE)
	// </edit>
{
	LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml");

	if (!sPropertiesObserver)
	{
		sPropertiesObserver = new LLPropertiesObserver;
	}
	sPropertiesObserverCount++;
	
	childSetTextArg("TextPrice", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
	
	// add the object to the static structure
	LLUUID key = mItemID ^ mObjectID;
	sInstances.insert(instance_map::value_type(key, this));
	// build the UI
	// item name & description
	childSetPrevalidate("LabelItemName",&LLLineEditor::prevalidatePrintableNotPipe);
	childSetCommitCallback("LabelItemName",onCommitName,this);
	childSetPrevalidate("LabelItemDesc",&LLLineEditor::prevalidatePrintableNotPipe);
	childSetCommitCallback("LabelItemDesc", onCommitDescription, this);
	// Creator information
	childSetAction("BtnCreator",onClickCreator,this);
	// owner information
	childSetAction("BtnOwner",onClickOwner,this);
	// acquired date
	// owner permissions
	// Permissions debug text
	// group permissions
	childSetCommitCallback("CheckShareWithGroup",&onCommitPermissions, this);
	// everyone permissions
	childSetCommitCallback("CheckEveryoneCopy",&onCommitPermissions, this);
	// next owner permissions
	childSetCommitCallback("CheckNextOwnerModify",&onCommitPermissions, this);
	childSetCommitCallback("CheckNextOwnerCopy",&onCommitPermissions, this);
	childSetCommitCallback("CheckNextOwnerTransfer",&onCommitPermissions, this);
	// Mark for sale or not, and sale info
	childSetCommitCallback("CheckPurchase",&onCommitSaleInfo, this);
	childSetCommitCallback("RadioSaleType",&onCommitSaleType, this);
	// "Price" label for edit
	childSetCommitCallback("EditPrice",&onCommitSaleInfo, this);
	// <edit>
	childSetAction("more_btn", &onClickMore, this);
	childSetAction("less_btn", &onClickLess, this);
	childSetAction("copy_btn", &onClickCopy, this);
	childSetAction("update_btn", &onClickUpdate, this);
	setExpanded(mExpanded);
	// </edit>
	// The UI has been built, now fill in all the values
	refresh();
}
Beispiel #9
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
{
    setPdmRoot(RiaApplication::instance()->project());
    restoreTreeViewState();

    if (m_pdmUiPropertyView && m_pdmUiPropertyView->currentObject())
    {
        m_pdmUiPropertyView->currentObject()->uiCapability()->updateConnectedEditors();
    }

    {
        auto* obj = RiaSummaryTools::summaryCaseMainCollection();
        if (obj)
        {
            setExpanded(obj);
        }
    }

    {
        auto* obj = RiaSummaryTools::summaryPlotCollection();
        if (obj)
        {
            setExpanded(obj);
        }
    }

    if (subWindowsAreTiled())
    {
        tileSubWindows();
    }

    if (m_activePlotViewWindow && m_activePlotViewWindow->viewWidget())
    {
        if (m_activePlotViewWindow->mdiWindowGeometry().isMaximized)
        {
            auto subWin = findMdiSubWindow(m_activePlotViewWindow->viewWidget());
            if (subWin)
            {
                subWin->showMaximized();
            }
        }
    }

    refreshToolbars();
}
    void addDetails() {
        // Add UL/DL packet and byte counts.
        ul_frames_item_ = new MacULDLTreeWidgetItem(this,  ueid_, rnti_, mac_ulsch_packet_count_row_type);
        ul_bytes_item_ = new MacULDLTreeWidgetItem(this,  ueid_, rnti_, mac_ulsch_byte_count_row_type);
        dl_frames_item_ = new MacULDLTreeWidgetItem(this,  ueid_, rnti_, mac_dlsch_packet_count_row_type);
        dl_bytes_item_ = new MacULDLTreeWidgetItem(this,  ueid_, rnti_, mac_dlsch_byte_count_row_type);

        setExpanded(false);
    }
void ExpandableWidget::setTitle(const QString& title)
{
	m_title = title;
	m_button->setText(title);
	setObjectName(qPrintable(title));
	
	QSettings settings;
	setExpanded(settings.value(QString("ExpandableWidget/state/%1").arg(title),false).toBool());
}
Beispiel #12
0
bool TransferItem::setData(int role, const QVariant &value) {
    switch (role) {
    case ExpandedRole:
        setExpanded(value.toBool());
        return true;
    default:
        return false;
    }
}
ExplorerReplicaSetTreeItem::ExplorerReplicaSetTreeItem(QTreeWidgetItem *parent, MongoServer *const server,
        const mongo::HostAndPort& repMemberHostAndPort, const bool isPrimary, const bool isUp)
    : BaseClass(parent),
      _repMemberHostAndPort(repMemberHostAndPort),
      _isPrimary(isPrimary),
      _isUp(isUp),
      _server(server),
      _connSettings(server->connectionRecord()->clone()),
      _bus(AppRegistry::instance().bus())
{
    // Set connection settings of this replica member
    _connSettings->setConnectionName(_repMemberHostAndPort.toString() + " [member of " + _connSettings->connectionName() + "]");
    _connSettings->setServerHost(_repMemberHostAndPort.host());
    _connSettings->setServerPort(_repMemberHostAndPort.port());
    _connSettings->setReplicaSet(false);
    _connSettings->replicaSetSettings()->setMembers(std::vector<std::string>()); // todo: replicaSetSettings->clear()

    // Add Actions
    auto openShellAction = new QAction("Open Shell", this);
    openShellAction->setIcon(GuiRegistry::instance().mongodbIcon());
    VERIFY(connect(openShellAction, SIGNAL(triggered()), SLOT(ui_openShell())));

    auto openDirectConnection = new QAction("Open Direct Connection", this);
    VERIFY(connect(openDirectConnection, SIGNAL(triggered()), SLOT(ui_openDirectConnection())));

    auto serverStatus = new QAction("Server Status", this);
    VERIFY(connect(serverStatus, SIGNAL(triggered()), SLOT(ui_serverStatus())));

    auto serverVersion = new QAction("MongoDB Version", this);
    VERIFY(connect(serverVersion, SIGNAL(triggered()), SLOT(ui_serverVersion())));

    auto serverHostInfo = new QAction("Host Info", this);
    VERIFY(connect(serverHostInfo, SIGNAL(triggered()), SLOT(ui_serverHostInfo())));

    auto showLog = new QAction("Show Log", this);
    VERIFY(connect(showLog, SIGNAL(triggered()), SLOT(ui_showLog())));

    BaseClass::_contextMenu->addAction(openShellAction);
    BaseClass::_contextMenu->addAction(openDirectConnection);
    BaseClass::_contextMenu->addSeparator();
    BaseClass::_contextMenu->addAction(serverStatus);
    BaseClass::_contextMenu->addAction(serverHostInfo);
    BaseClass::_contextMenu->addAction(serverVersion);
    BaseClass::_contextMenu->addSeparator();
    BaseClass::_contextMenu->addAction(showLog);

    //BaseClass::_contextMenu->setHidden(!_isUp);

    // Todo: remove ?
    //_bus->subscribe(this, DatabaseListLoadedEvent::Type, _server);
    //_bus->subscribe(this, MongoServerLoadingDatabasesEvent::Type, _server);

    updateState(_isUp, _isPrimary);

    setExpanded(true);
    setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicator);
}
void TreeView::checkTag(const QModelIndex &parent, QAbstractItemModel *model)
{
	for (int i = 0, count = model->rowCount(parent); i < count; ++i) {
		QModelIndex index = model->index(i, 0, parent);
		checkTag(index, model);
		if (!m_closedIndexes.contains(index.data(TagName).toString()))
			setExpanded(index, true);
	}
}
Beispiel #15
0
VariableItemView::VariableItemView(bool t_fixed)
  : OSCollapsibleView()
{
  setMaximumWidth(650);

  variableContentView = new VariableContentView(t_fixed); 
  setContent(variableContentView);

  variableHeaderView = new VariableHeaderView(t_fixed);
  setHeader(variableHeaderView);
 

  if (t_fixed)
  {
    setExpanded(false);
  } else {
    setExpanded(true);
  }
}
Beispiel #16
0
void RosterTreeView::fixGroups()
{
	QModelIndex root = rootIndex();
	for(int i = 0; i < model()->rowCount(root); ++i) {
		QModelIndex index = model()->index(i, 0, root);
		if(index.data(RosterItem::TypeRole).toInt() == RosterItem::Group) {
			setExpanded(index, index.data(RosterItem::ExpandedRole).toBool());
		}
	}
}
void SceneItem::expand()
{
    setExpanded(true);

    get_assembly_collection_item().setExpanded(true);
    get_assembly_instance_collection_item().setExpanded(true);

    if (get_assembly_collection_item().childCount() == 1)
        get_assembly_collection_item().child(0)->setExpanded(true);
}
Beispiel #18
0
void KDPropertyView::rowsInserted(const QModelIndex& parent, int start, int end)
{
  qDebug() << "KDPropertyView::rowsInserted()";
  if ( const QAbstractItemModel * const m = model() )
      for( int i = start; i <= end; ++i ) {
          const QModelIndex idx = m->index( i, 0, parent );
          setExpanded( idx, true );
      }
  QTreeView::rowsInserted(parent,start,end);
}
Beispiel #19
0
void QtTreeWidget::handleModelItemExpanded(const QModelIndex& index, bool shouldExpand) {
    if (!index.isValid()) {
        return;
    }
    bool alreadyRight = this->isExpanded(index) == shouldExpand;
    if (alreadyRight) {
        return;
    }
    setExpanded(index, shouldExpand);
}
    ExplorerDatabaseCategoryTreeItem::ExplorerDatabaseCategoryTreeItem(ExplorerDatabaseTreeItem *databaseItem, ExplorerDatabaseCategory category) :
        BaseClass(databaseItem), _category(category)
    {
        if (_category == Collections) {
            QAction *createCollection = new QAction("Create Collection...", this);
            VERIFY(connect(createCollection, SIGNAL(triggered()), SLOT(ui_createCollection())));

            QAction *dbCollectionsStats = new QAction("Collections Statistics", this);
            VERIFY(connect(dbCollectionsStats, SIGNAL(triggered()), SLOT(ui_dbCollectionsStatistics())));

            QAction *refreshCollections = new QAction("Refresh", this);
            VERIFY(connect(refreshCollections, SIGNAL(triggered()), SLOT(ui_refreshCollections())));

            BaseClass::_contextMenu->addAction(dbCollectionsStats);
            BaseClass::_contextMenu->addAction(createCollection);
            BaseClass::_contextMenu->addSeparator();
            BaseClass::_contextMenu->addAction(refreshCollections);
        }
        else if (_category == Users) {

            QAction *refreshUsers = new QAction("Refresh", this);
            VERIFY(connect(refreshUsers, SIGNAL(triggered()), SLOT(ui_refreshUsers())));

            QAction *viewUsers = new QAction("View Users", this);
            VERIFY(connect(viewUsers, SIGNAL(triggered()), SLOT(ui_viewUsers())));

            QAction *addUser = new QAction("Add User...", this);
            VERIFY(connect(addUser, SIGNAL(triggered()), SLOT(ui_addUser())));

            BaseClass::_contextMenu->addAction(viewUsers);
            BaseClass::_contextMenu->addAction(addUser);
            BaseClass::_contextMenu->addSeparator();
            BaseClass::_contextMenu->addAction(refreshUsers);
        }
        else if (_category == Functions) {

            QAction *refreshFunctions = new QAction("Refresh", this);
            VERIFY(connect(refreshFunctions, SIGNAL(triggered()), SLOT(ui_refreshFunctions())));

            QAction *viewFunctions = new QAction("View Functions", this);
            VERIFY(connect(viewFunctions, SIGNAL(triggered()), SLOT(ui_viewFunctions())));

            QAction *addFunction = new QAction("Add Function...", this);
            VERIFY(connect(addFunction, SIGNAL(triggered()), SLOT(ui_addFunction())));

            BaseClass::_contextMenu->addAction(viewFunctions);
            BaseClass::_contextMenu->addAction(addFunction);
            BaseClass::_contextMenu->addSeparator();
            BaseClass::_contextMenu->addAction(refreshFunctions);
        }

        setExpanded(false);
        setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
    }
Beispiel #21
0
void EasyTreeWidgetItem::expandAll()
{
    for (int i = 0, childrenNumber = childCount(); i < childrenNumber; ++i)
    {
        static_cast<EasyTreeWidgetItem*>(child(i))->expandAll();
    }

    setExpanded(true);
    if (parent() != nullptr)
        guiBlock().expanded = true;
}
Beispiel #22
0
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 
// model wrapping
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 
void FileTreeView::setCurrentFolder( QString currentFolder )
{
    QModelIndex index;
    QStringList fullPath = currentFolder.split( "/" );
    QStringList fullPathByStep;
    foreach( QString chunkOfPath, fullPath )
    {
        fullPathByStep << "/" << chunkOfPath;
        index = _fileTreeModel->index( fullPathByStep.join("") );
        setExpanded( index, true );
    }
void SimpleTreeView::rowsInserted(const QModelIndex& parent, int start, int end)
{
	QTreeView::rowsInserted(parent, start, end);

	if(isAutoExpanding_) {
		for(int i = start; i <= end; ++i) {
			QModelIndex index = model()->index(i, 0, parent);
			setExpanded(index, true);
		}
	}
}
Beispiel #24
0
    void BsonTreeItem::setupDocument(MongoDocumentPtr document)
    {
        setText(0, buildObjectFieldName());
        setIcon(0, GuiRegistry::instance().bsonObjectIcon());

        setText(2, "Object");
        setForeground(2, GuiRegistry::instance().typeBrush());

        setExpanded(true);
        setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
    }
    SrtTableTreeWidgetItem(QTreeWidget *parent, const srt_stat_table *srt_table) :
        QTreeWidgetItem (parent, srt_table_type_),
        srt_table_(srt_table)
    {
        setText(0, srt_table_->name);
        setFirstColumnSpanned(true);
        setExpanded(true);

        for (int i = 0; i < srt_table_->num_procs; i++) {
            new SrtRowTreeWidgetItem(this, &srt_table_->procedures[i]);
        }
    }
Beispiel #26
0
void PropertyEditor::applyExpansionState()
{
    const QList<QtBrowserItem *> items = m_currentBrowser->topLevelItems();
    if (m_sorting) {
        applyPropertiesExpansionState(items);
    } else {
        QListIterator<QtBrowserItem *> itTopLevel(items);
        const QMap<QString, bool>::const_iterator excend = m_expansionState.constEnd();
        while (itTopLevel.hasNext()) {
            QtBrowserItem *item = itTopLevel.next();
            const QString groupName = item->property()->propertyName();
            const QMap<QString, bool>::const_iterator git = m_expansionState.constFind(groupName);
            if (git != excend)
                setExpanded(item, git.value());
            else
                setExpanded(item, true);
            // properties stuff here
            applyPropertiesExpansionState(item->children());
        }
    }
}
Beispiel #27
0
VariableGroupItemView::VariableGroupItemView(bool t_fixedMeasuresOnly, MeasureType measureType)
  : OSCollapsibleView()
{
  variableGroupHeader = new LightGradientHeader();
  variableGroupHeader->setMeasureType(measureType);
  setHeader(variableGroupHeader);

  variableGroupContentView = new VariableGroupContentView(t_fixedMeasuresOnly);
  setContent(variableGroupContentView);

  setExpanded(true);
}
VariableGroupItemView::VariableGroupItemView()
  : OSCollapsibleView(0)
{
  variableGroupHeaderView = new DarkGradientHeader();
  setHeader(variableGroupHeaderView);

  variableGroupContentView = new OSListView();
  variableGroupContentView->setContentsMargins(0,5,0,0);
  setContent(variableGroupContentView);

  setExpanded(true);
}
Beispiel #29
0
ExpandableGroupBox::ExpandableGroupBox(QWidget *parent, const QString &title): QGroupBox(title,parent), _expanded(true), _widget(0) {
  setCheckable(true);
  setChecked(true);
  setExpanded(_expanded);
  connect(this,SIGNAL(toggled(bool)),this,SLOT(setExpanded(bool)));

  QVBoxLayout *lyt = new QVBoxLayout;
  lyt->setContentsMargins(0,0,0,0);
  lyt->setMargin(0);
  lyt->setSpacing(0);
  setLayout(lyt);
}
// Comes from korganizer/resourceview.cpp
void KABCResourceItem::createSubresourceItems()
{
  if ( !mIsSubresource && !mSubItemsCreated ) {
    KABC::ResourceABC* res = dynamic_cast<KABC::ResourceABC *>( mResource );
    QStringList subresources;
    if ( res )
      subresources = res->subresources();
    if ( !subresources.isEmpty() ) {
      setExpanded( true );

      // This resource has subresources
      QStringList::ConstIterator it;
      for ( it = subresources.constBegin(); it != subresources.constEnd(); ++it ) {
        (void)new KABCResourceItem( res, this, *it );
      }
    }
    mSubItemsCreated = true;

    setExpanded( childCount() > 0 );
  }
}