当前位置: 首页>>代码示例>>C++>>正文


C++ setOpen函数代码示例

本文整理汇总了C++中setOpen函数的典型用法代码示例。如果您正苦于以下问题:C++ setOpen函数的具体用法?C++ setOpen怎么用?C++ setOpen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setOpen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: throw

void TreeViewItem::restoreOpennessState (const XmlElement& e) throw()
{
    if (e.hasTagName ("CLOSED"))
    {
        setOpen (false);
    }
    else if (e.hasTagName ("OPEN"))
    {
        setOpen (true);

        forEachXmlChildElement (e, n)
        {
            const String id (n->getStringAttribute ("id"));

            for (int i = 0; i < subItems.size(); ++i)
            {
                TreeViewItem* const ti = subItems.getUnchecked(i);

                if (ti->getUniqueName() == id)
                {
                    ti->restoreOpennessState (*n);
                    break;
                }
            }
        }
    }
开发者ID:Labmind,项目名称:GUI,代码行数:26,代码来源:juce_TreeView.cpp

示例2: thisId

TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString)
{
    const String thisId (getUniqueName());

    if (thisId == identifierString)
        return this;

    if (identifierString.startsWith (thisId + "/"))
    {
        const String remainingPath (identifierString.substring (thisId.length() + 1));

        bool wasOpen = isOpen();
        setOpen (true);

        for (int i = subItems.size(); --i >= 0;)
        {
            TreeViewItem* item = subItems.getUnchecked(i)->findItemFromIdentifierString (remainingPath);

            if (item != 0)
                return item;
        }

        setOpen (wasOpen);
    }

    return 0;
}
开发者ID:Labmind,项目名称:GUI,代码行数:27,代码来源:juce_TreeView.cpp

示例3: openPositions

bool TutFile::open(const QByteArray &data)
{
	QList<quint32> positions;
	quint32 dataSize = data.size();

	positions = openPositions(data);
	if(positions.isEmpty()) {
		return false;
	}

	tutos.clear();
	for(int i=0 ; i<positions.size()-1 ; ++i) {
		if(positions.at(i) < dataSize && positions.at(i) < positions.at(i+1)) {
			QByteArray t = data.mid(positions.at(i), positions.at(i+1)-positions.at(i));
//			if(t.startsWith("KAO")) {
//				t.prepend('A'); // PC bug
//			}
//			qDebug() << i << t.left(16).toHex();
			tutos.append(t);
		}
	}

	setOpen(true);

	return true;
}
开发者ID:TurBoss,项目名称:makoureactor,代码行数:26,代码来源:TutFile.cpp

示例4: while

void TreeItem::insertNode(GNode * node)
{
    nodeObj_ = node;
    node->setGuiPtr(this);
//      return;
    QListIterator < GNode > it = QListIterator < GNode > (node->children());
    while (it.current()) {
        GNode *n = it.current();
#ifdef DEBUGMSG
        qDebug("TreeItem: add %s\n", (const char *) n->name());
#endif
        TreeItem *item = new TreeItem(this, n->name());
        ASSERT(item!=0);
        if (n->isA("SNode")) {
            pixmap_.resize(20, 10);
            pixmap_.fill(((SNode *) n)->color());
            item->setPixmap(0, pixmap_);
        }
#if 0
        if (nodeObj_->isCompound())
            item->setPixmap(0, *pixmap_compound);
        else
            item->setPixmap(0, *pixmap_generalize);
#endif
#ifdef DEBUGMSG
        qDebug("TreeItem: done %s\n", (const char *) n->name());
#endif
        item->insertNode(n);
        ++it;
    }
    setOpen(TRUE);
}
开发者ID:BackupTheBerlios,项目名称:geoaida-svn,代码行数:32,代码来源:treeitem.cpp

示例5: qDebug

void CDatabaseItem::setConnected(bool isconnected)
{
#ifdef DEBUG
  qDebug("CDatabaseItem::setConnected(%s)", debug_string(booltostr(isconnected)));
#endif

  if (isBlocked())
    return;

  setBlocked(true);  

  if (isconnected)
    is_connected = isconnected && mysql()->mysql()->mysqlSelectDb(text(0));
  else
    is_connected = false;

  setPixmap(0, is_connected ? databaseConnectedIcon : databaseDisconnectedIcon);
  if (is_connected)
  {
    new CTableGroupItem(this, text(0), mysql());
    setOpen(true);
  }
  else
    deleteChilds();

  createWindowMenu(consoleWindow()->itemToolBar());
  setBlocked(false);
}
开发者ID:soundgnome,项目名称:mysqlcc,代码行数:28,代码来源:CDatabaseItem.cpp

示例6: close

/**
 * Override
 * Open a connection to the database.
 * @param db            The name of the database which is to open.
 * @param user          A username of a database role.
 * @param password      The password to the username.
 * @param host          The host name or address where the database is home.
 * @param port          The port number to the database.
 * @param connOpts      Additional and optional options.
 * @return              True if database is open. Otherwise returns false.
 */
bool KQPostgreSqlDriver::open(const QString &db, const QString &user, const QString &password, const QString &host, int port, const QString &connOpts)
{
    if (isOpen()) {
        close();
    }
    QByteArray connectionInfo;
    connectionInfo.append("host=").append(host).append(' ');
    connectionInfo.append("port=").append(QString::number(port)).append(' ');
    connectionInfo.append("dbname=").append(db).append(' ');
    connectionInfo.append("user=").append(user).append(' ');
    connectionInfo.append("password=").append(password);
    if (! connOpts.isEmpty()) {
        QString options = QString(connOpts).replace(QChar(';'), QChar(' '));
        connectionInfo.append(' ').append(options);
    }
    m_connection = PQconnectdb(connectionInfo.data());
    ConnStatusType status = PQstatus(m_connection);
    if (status == CONNECTION_BAD) {
        QSqlError error(QString("Could not open database !"), QString(PQerrorMessage(m_connection)), QSqlError::ConnectionError);
        setLastError(error);
        setOpenError(true);
        PQfinish(m_connection);
        m_connection = NULL;

        return false;
    }
    setOpen(true);
    setOpenError(false);

    return true;
}
开发者ID:Kri-7-q,项目名称:PWKeeper,代码行数:42,代码来源:kqpostgresqldriver.cpp

示例7: LazyFetchItem

WatchRoot::WatchRoot(VariableTree *parent)
    : LazyFetchItem(parent)
{
    setText(VAR_NAME_COLUMN, i18n("Watch"));
    setOpen(true);
	setSelectable(false);
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:7,代码来源:variablewidget.cpp

示例8: mouseDoubleClick

    void mouseDoubleClick (const MouseEvent& e) override
    {
        if (e.y < titleHeight) {
            setOpen (! isOpen);
        }

    }
开发者ID:ahmadfarihan,项目名称:the-source,代码行数:7,代码来源:FoldablePanel.cpp

示例9: appendFromXML

/**
 * @brief Overwritten drop handler
 *
 * @param evt the event
 */
void TreeEntry::dropped(QDropEvent *evt)
{
    if (evt->provides("application/x-qpamat")) {
        evt->accept();
        QString xml = QString::fromUtf8(evt->encodedData("application/x-qpamat"));
        QDomDocument doc;
        doc.setContent(xml);
        QDomElement elem = doc.documentElement();

        Q3ListViewItem* src = reinterpret_cast<TreeEntry*>(elem.attribute("memoryAddress").toLong());

        QpamatWindow *win = Qpamat::instance()->getWindow();
        if (src == this) {
            win->message(tr("Cannot dray to itself."));
            return;
        }

        TreeEntry* item = m_isCategory ? this : dynamic_cast<TreeEntry*>(parent());
        TreeEntry* appended = 0;
        if (item)
            appended = appendFromXML(item, elem);
        else
            appended = appendFromXML(listView(), elem);

        if (!isOpen())
            setOpen(true);

        listView()->setSelected(appended, true);
        dynamic_cast<Tree*>(listView())->updatePasswordStrengthView();
        delete src;
    }
}
开发者ID:BackupTheBerlios,项目名称:qpamat,代码行数:37,代码来源:treeentry.cpp

示例10: QListViewItem

DriverItem::DriverItem(QListViewItem *parent, QListViewItem *after, DrBase *item) : QListViewItem(parent, after), m_item(item), m_conflict(false)
{
    setOpen(depth() < 3);
    if(item)
        setPixmap(0, SmallIcon((item->isOption() ? "document" : "folder")));
    updateText();
}
开发者ID:serghei,项目名称:kde3-kdelibs,代码行数:7,代码来源:driveritem.cpp

示例11: qDebug

int BulkController::close() {
    if (!isOpen()) {
        qDebug() << " device" << getName() << "already closed";
        return -1;
    }

    qDebug() << "Shutting down USB Bulk device" << getName();

    // Stop the reading thread
    if (m_pReader == NULL) {
        qWarning() << "BulkReader not present for" << getName()
                   << "yet the device is open!";
    } else {
        disconnect(m_pReader, SIGNAL(incomingData(QByteArray, mixxx::Duration)),
                   this, SLOT(receive(QByteArray, mixxx::Duration)));
        m_pReader->stop();
        controllerDebug("  Waiting on reader to finish");
        m_pReader->wait();
        delete m_pReader;
        m_pReader = NULL;
    }

    // Stop controller engine here to ensure it's done before the device is
    // closed incase it has any final parting messages
    stopEngine();

    // Close device
    controllerDebug("  Closing device");
    libusb_close(m_phandle);
    m_phandle = NULL;
    setOpen(false);
    return 0;
}
开发者ID:MLudgate,项目名称:mixxx,代码行数:33,代码来源:bulkcontroller.cpp

示例12: selectFile

    bool selectFile (const File& target)
    {
        if (file == target)
        {
            setSelected (true, true);
            return true;
        }

        if (target.isAChildOf (file))
        {
            setOpen (true);

            for (int maxRetries = 500; --maxRetries > 0;)
            {
                for (int i = 0; i < getNumSubItems(); ++i)
                    if (FileListTreeItem* f = dynamic_cast <FileListTreeItem*> (getSubItem (i)))
                        if (f->selectFile (target))
                            return true;

                // if we've just opened and the contents are still loading, wait for it..
                if (subContentsList != nullptr && subContentsList->isStillLoading())
                {
                    Thread::sleep (10);
                    rebuildItemsFromContentList();
                }
                else
                {
                    break;
                }
            }
        }

        return false;
    }
开发者ID:anthonyhuecouret,项目名称:argotlunar,代码行数:34,代码来源:juce_FileTreeComponent.cpp

示例13: QListViewItem

StreamItem::StreamItem( QListView* parent, const QString& n ):
QListViewItem( parent, n )
{
  name = n;
  stream = 0;
  setOpen( true );
}
开发者ID:BackupTheBerlios,项目名称:pole-svn,代码行数:7,代码来源:poleview.cpp

示例14: close

/*
   SQLite dbs have no user name, passwords, hosts or ports.
   just file names.
*/
bool QSQLite2Driver::open(const QString & db, const QString &, const QString &, const QString &, int, const QString &)
{
    if (isOpen())
        close();

    if (db.isEmpty())
        return false;

    char* err = 0;
    d->access = sqlite_open(QFile::encodeName(db), 0, &err);
    if (err) {
        setLastError(QSqlError(tr("Error opening database"), QString::fromAscii(err),
                     QSqlError::ConnectionError));
        sqlite_freemem(err);
        err = 0;
    }

    if (d->access) {
        setOpen(true);
        setOpenError(false);
        return true;
    }
    setOpenError(true);
    return false;
}
开发者ID:RS102839,项目名称:qt,代码行数:29,代码来源:qsql_sqlite2.cpp

示例15: s

void DriverItem::updateText()
{
    if(m_item)
    {
        QString s(m_item->get("text"));
        if(m_item->isOption())
            s.append(QString::fromLatin1(": <%1>").arg(m_item->prettyText()));
        if(m_item->type() == DrBase::List)
        {
            // remove all children: something has changed (otherwise this
            // function would not be called), so it make sense to remove
            // those children in all cases.
            while(firstChild())
                delete firstChild();
            DrBase *ch = static_cast< DrListOption * >(m_item)->currentChoice();
            if(ch && ch->type() == DrBase::ChoiceGroup)
            {
                // add new children
                static_cast< DrChoiceGroup * >(ch)->createItem(this);
                setOpen(true);
            }
        }
        setText(0, s);
    }
    else
        setText(0, "ERROR");
    widthChanged();
}
开发者ID:serghei,项目名称:kde3-kdelibs,代码行数:28,代码来源:driveritem.cpp


注:本文中的setOpen函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。