[][src]Struct qt_widgets::QMapOfQDateQTextCharFormat

#[repr(C)]pub struct QMapOfQDateQTextCharFormat { /* fields omitted */ }

The QMap class is a template class that provides a red-black-tree-based dictionary.

C++ class: QMap<QDate, QTextCharFormat>.

C++ documentation:

The QMap class is a template class that provides a red-black-tree-based dictionary.

QMap<Key, T> is one of Qt's generic container classes. It stores (key, value) pairs and provides fast lookup of the value associated with a key.

QMap and QHash provide very similar functionality. The differences are:

  • QHash provides average faster lookups than QMap. (See Algorithmic Complexity for details.)
  • When iterating over a QHash, the items are arbitrarily ordered. With QMap, the items are always sorted by key.
  • The key type of a QHash must provide operator==() and a global qHash(Key) function. The key type of a QMap must provide operator<() specifying a total order. Since Qt 5.8.1 it is also safe to use a pointer type as key, even if the underlying operator<() does not provide a total order.

Here's an example QMap with QString keys and int values:

QMap<QString, int> map;

To insert a (key, value) pair into the map, you can use operator[]():

map["one"] = 1; map["three"] = 3; map["seven"] = 7;

This inserts the following three (key, value) pairs into the QMap: ("one", 1), ("three", 3), and ("seven", 7). Another way to insert items into the map is to use insert():

map.insert("twelve", 12);

To look up a value, use operator[]() or value():

int num1 = map["thirteen"]; int num2 = map.value("thirteen");

If there is no item with the specified key in the map, these functions return a default-constructed value.

If you want to check whether the map contains a certain key, use contains():

int timeout = 30; if (map.contains("TIMEOUT")) timeout = map.value("TIMEOUT");

There is also a value() overload that uses its second argument as a default value if there is no item with the specified key:

int timeout = map.value("TIMEOUT", 30);

In general, we recommend that you use contains() and value() rather than operator[]() for looking up a key in a map. The reason is that operator[]() silently inserts an item into the map if no item exists with the same key (unless the map is const). For example, the following code snippet will create 1000 items in memory:

// WRONG QMap<int, QWidget *> map; ... for (int i = 0; i < 1000; ++i) { if (map[i] == okButton) cout << "Found button at index " << i << endl; }

To avoid this problem, replace map[i] with map.value(i) in the code above.

If you want to navigate through all the (key, value) pairs stored in a QMap, you can use an iterator. QMap provides both Java-style iterators (QMapIterator and QMutableMapIterator) and STL-style iterators (QMap::const_iterator and QMap::iterator). Here's how to iterate over a QMap<QString, int> using a Java-style iterator:

QMapIterator<QString, int> i(map); while (i.hasNext()) { i.next(); cout << i.key() << ": " << i.value() << endl; }

Here's the same code, but using an STL-style iterator this time:

QMap<QString, int>::const_iterator i = map.constBegin(); while (i != map.constEnd()) { cout << i.key() << ": " << i.value() << endl; ++i; }

The items are traversed in ascending key order.

Normally, a QMap allows only one value per key. If you call insert() with a key that already exists in the QMap, the previous value will be erased. For example:

map.insert("plenty", 100); map.insert("plenty", 2000); // map.value("plenty") == 2000

However, you can store multiple values per key by using insertMulti() instead of insert() (or using the convenience subclass QMultiMap). If you want to retrieve all the values for a single key, you can use values(const Key &key), which returns a QList<T>:

QList<int> values = map.values("plenty"); for (int i = 0; i < values.size(); ++i) cout << values.at(i) << endl;

The items that share the same key are available from most recently to least recently inserted. Another approach is to call find() to get the STL-style iterator for the first item with a key and iterate from there:

QMap<QString, int>::iterator i = map.find("plenty"); while (i != map.end() && i.key() == "plenty") { cout << i.value() << endl; ++i; }

If you only need to extract the values from a map (not the keys), you can also use foreach:

QMap<QString, int> map; ... foreach (int value, map) cout << value << endl;

Items can be removed from the map in several ways. One way is to call remove(); this will remove any item with the given key. Another way is to use QMutableMapIterator::remove(). In addition, you can clear the entire map using clear().

QMap's key and value data types must be assignable data types. This covers most data types you are likely to encounter, but the compiler won't let you, for example, store a QWidget as a value; instead, store a QWidget *. In addition, QMap's key type must provide operator<(). QMap uses it to keep its items sorted, and assumes that two keys x and y are equal if neither x < y nor y < x is true.

Example:

#ifndef EMPLOYEE_H #define EMPLOYEE_H

class Employee { public: Employee() {} Employee(const QString &name, const QDate &dateOfBirth); ...

private: QString myName; QDate myDateOfBirth; };

inline bool operator<(const Employee &e1, const Employee &e2) { if (e1.name() != e2.name()) return e1.name() < e2.name(); return e1.dateOfBirth() < e2.dateOfBirth(); }

#endif // EMPLOYEE_H

In the example, we start by comparing the employees' names. If they're equal, we compare their dates of birth to break the tie.

Methods

impl QMapOfQDateQTextCharFormat[src]

pub unsafe fn begin_mut(&self) -> CppBox<Iterator>[src]

Returns an STL-style iterator pointing to the first item in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::begin().

C++ documentation:

Returns an STL-style iterator pointing to the first item in the map.

See also constBegin() and end().

pub unsafe fn begin(&self) -> CppBox<ConstIterator>[src]

This is an overloaded function.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::begin() const.

C++ documentation:

This is an overloaded function.

pub unsafe fn cbegin(&self) -> CppBox<ConstIterator>[src]

Returns a const STL-style iterator pointing to the first item in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::cbegin() const.

C++ documentation:

Returns a const STL-style iterator pointing to the first item in the map.

This function was introduced in Qt 5.0.

See also begin() and cend().

pub unsafe fn cend(&self) -> CppBox<ConstIterator>[src]

Returns a const STL-style iterator pointing to the imaginary item after the last item in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::cend() const.

C++ documentation:

Returns a const STL-style iterator pointing to the imaginary item after the last item in the map.

This function was introduced in Qt 5.0.

See also cbegin() and end().

pub unsafe fn clear(&self)[src]

Removes all items from the map.

Calls C++ function: void QMap<QDate, QTextCharFormat>::clear().

C++ documentation:

Removes all items from the map.

See also remove().

pub unsafe fn const_begin(&self) -> CppBox<ConstIterator>[src]

Returns a const STL-style iterator pointing to the first item in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::constBegin() const.

C++ documentation:

Returns a const STL-style iterator pointing to the first item in the map.

See also begin() and constEnd().

pub unsafe fn const_end(&self) -> CppBox<ConstIterator>[src]

Returns a const STL-style iterator pointing to the imaginary item after the last item in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::constEnd() const.

C++ documentation:

Returns a const STL-style iterator pointing to the imaginary item after the last item in the map.

See also constBegin() and end().

pub unsafe fn const_find(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<ConstIterator>
[src]

Returns an const iterator pointing to the item with key key in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::constFind(const QDate& key) const.

C++ documentation:

Returns an const iterator pointing to the item with key key in the map.

If the map contains no item with key key, the function returns constEnd().

This function was introduced in Qt 4.1.

See also find() and QMultiMap::constFind().

pub unsafe fn contains(&self, key: impl CastInto<Ref<QDate>>) -> bool[src]

Returns true if the map contains an item with key key; otherwise returns false.

Calls C++ function: bool QMap<QDate, QTextCharFormat>::contains(const QDate& key) const.

C++ documentation:

Returns true if the map contains an item with key key; otherwise returns false.

See also count() and QMultiMap::contains().

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QMapOfQDateQTextCharFormat>>
) -> Ref<QMapOfQDateQTextCharFormat>
[src]

Assigns other to this map and returns a reference to this map.

Calls C++ function: QMap<QDate, QTextCharFormat>& QMap<QDate, QTextCharFormat>::operator=(const QMap<QDate, QTextCharFormat>& other).

C++ documentation:

Assigns other to this map and returns a reference to this map.

pub unsafe fn count_1a(&self, key: impl CastInto<Ref<QDate>>) -> c_int[src]

Returns the number of items associated with key key.

Calls C++ function: int QMap<QDate, QTextCharFormat>::count(const QDate& key) const.

C++ documentation:

Returns the number of items associated with key key.

See also contains(), insertMulti(), and QMultiMap::count().

pub unsafe fn count_0a(&self) -> c_int[src]

This is an overloaded function.

Calls C++ function: int QMap<QDate, QTextCharFormat>::count() const.

C++ documentation:

This is an overloaded function.

Same as size().

pub unsafe fn detach(&self)[src]

Calls C++ function: void QMap<QDate, QTextCharFormat>::detach().

pub unsafe fn empty(&self) -> bool[src]

This function is provided for STL compatibility. It is equivalent to isEmpty(), returning true if the map is empty; otherwise returning false.

Calls C++ function: bool QMap<QDate, QTextCharFormat>::empty() const.

C++ documentation:

This function is provided for STL compatibility. It is equivalent to isEmpty(), returning true if the map is empty; otherwise returning false.

pub unsafe fn end_mut(&self) -> CppBox<Iterator>[src]

Returns an STL-style iterator pointing to the imaginary item after the last item in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::end().

C++ documentation:

Returns an STL-style iterator pointing to the imaginary item after the last item in the map.

See also begin() and constEnd().

pub unsafe fn end(&self) -> CppBox<ConstIterator>[src]

This is an overloaded function.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::end() const.

C++ documentation:

This is an overloaded function.

pub unsafe fn erase(&self, it: impl CastInto<Ref<Iterator>>) -> CppBox<Iterator>[src]

Removes the (key, value) pair pointed to by the iterator pos from the map, and returns an iterator to the next item in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::erase(QMap<QDate, QTextCharFormat>::iterator it).

C++ documentation:

Removes the (key, value) pair pointed to by the iterator pos from the map, and returns an iterator to the next item in the map.

See also remove().

pub unsafe fn find_mut(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<Iterator>
[src]

Returns an iterator pointing to the item with key key in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::find(const QDate& key).

C++ documentation:

Returns an iterator pointing to the item with key key in the map.

If the map contains no item with key key, the function returns end().

If the map contains multiple items with key key, this function returns an iterator that points to the most recently inserted value. The other values are accessible by incrementing the iterator. For example, here's some code that iterates over all the items with the same key:

QMap<QString, int> map; ... QMap<QString, int>::const_iterator i = map.find("HDR"); while (i != map.end() && i.key() == "HDR") { cout << i.value() << endl; ++i; }

See also constFind(), value(), values(), lowerBound(), upperBound(), and QMultiMap::find().

pub unsafe fn find(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<ConstIterator>
[src]

This is an overloaded function.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::find(const QDate& key) const.

C++ documentation:

This is an overloaded function.

pub unsafe fn first_mut(&self) -> Ref<QTextCharFormat>[src]

Returns a reference to the first value in the map, that is the value mapped to the smallest key. This function assumes that the map is not empty.

Calls C++ function: QTextCharFormat& QMap<QDate, QTextCharFormat>::first().

C++ documentation:

Returns a reference to the first value in the map, that is the value mapped to the smallest key. This function assumes that the map is not empty.

When unshared (or const version is called), this executes in constant time.

This function was introduced in Qt 5.2.

See also last(), firstKey(), and isEmpty().

pub unsafe fn first(&self) -> Ref<QTextCharFormat>[src]

This is an overloaded function.

Calls C++ function: const QTextCharFormat& QMap<QDate, QTextCharFormat>::first() const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.2.

pub unsafe fn first_key(&self) -> Ref<QDate>[src]

Returns a reference to the smallest key in the map. This function assumes that the map is not empty.

Calls C++ function: const QDate& QMap<QDate, QTextCharFormat>::firstKey() const.

C++ documentation:

Returns a reference to the smallest key in the map. This function assumes that the map is not empty.

This executes in constant time.

This function was introduced in Qt 5.2.

See also lastKey(), first(), keyBegin(), and isEmpty().

pub unsafe fn index_mut(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> Ref<QTextCharFormat>
[src]

Returns the value associated with the key key as a modifiable reference.

Calls C++ function: QTextCharFormat& QMap<QDate, QTextCharFormat>::operator[](const QDate& key).

C++ documentation:

Returns the value associated with the key key as a modifiable reference.

If the map contains no item with key key, the function inserts a default-constructed value into the map with key key, and returns a reference to it. If the map contains multiple items with key key, this function returns a reference to the most recently inserted value.

See also insert() and value().

pub unsafe fn index(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<QTextCharFormat>
[src]

This is an overloaded function.

Calls C++ function: QTextCharFormat QMap<QDate, QTextCharFormat>::operator[](const QDate& key) const.

C++ documentation:

This is an overloaded function.

Same as value().

pub unsafe fn insert_2a(
    &self,
    key: impl CastInto<Ref<QDate>>,
    value: impl CastInto<Ref<QTextCharFormat>>
) -> CppBox<Iterator>
[src]

Inserts a new item with the key key and a value of value.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::insert(const QDate& key, const QTextCharFormat& value).

C++ documentation:

Inserts a new item with the key key and a value of value.

If there is already an item with the key key, that item's value is replaced with value.

If there are multiple items with the key key, the most recently inserted item's value is replaced with value.

See also insertMulti().

pub unsafe fn insert_3a(
    &self,
    pos: impl CastInto<Ref<ConstIterator>>,
    key: impl CastInto<Ref<QDate>>,
    value: impl CastInto<Ref<QTextCharFormat>>
) -> CppBox<Iterator>
[src]

This is an overloaded function.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::insert(QMap<QDate, QTextCharFormat>::const_iterator pos, const QDate& key, const QTextCharFormat& value).

C++ documentation:

This is an overloaded function.

Inserts a new item with the key key and value value and with hint pos suggesting where to do the insert.

If constBegin() is used as hint it indicates that the key is less than any key in the map while constEnd() suggests that the key is (strictly) larger than any key in the map. Otherwise the hint should meet the condition (pos - 1).key() < key <= pos.key(). If the hint pos is wrong it is ignored and a regular insert is done.

If there is already an item with the key key, that item's value is replaced with value.

If there are multiple items with the key key, then exactly one of them is replaced with value.

If the hint is correct and the map is unshared, the insert executes in amortized constant time.

When creating a map from sorted data inserting the largest key first with constBegin() is faster than inserting in sorted order with constEnd(), since constEnd() - 1 (which is needed to check if the hint is valid) needs logarithmic time.

Note: Be careful with the hint. Providing an iterator from an older shared instance might crash but there is also a risk that it will silently corrupt both the map and the pos map.

This function was introduced in Qt 5.1.

See also insertMulti().

pub unsafe fn insert_multi_2a(
    &self,
    key: impl CastInto<Ref<QDate>>,
    value: impl CastInto<Ref<QTextCharFormat>>
) -> CppBox<Iterator>
[src]

Inserts a new item with the key key and a value of value.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::insertMulti(const QDate& key, const QTextCharFormat& value).

C++ documentation:

Inserts a new item with the key key and a value of value.

If there is already an item with the same key in the map, this function will simply create a new one. (This behavior is different from insert(), which overwrites the value of an existing item.)

See also insert() and values().

pub unsafe fn insert_multi_3a(
    &self,
    pos: impl CastInto<Ref<ConstIterator>>,
    akey: impl CastInto<Ref<QDate>>,
    avalue: impl CastInto<Ref<QTextCharFormat>>
) -> CppBox<Iterator>
[src]

This is an overloaded function.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::insertMulti(QMap<QDate, QTextCharFormat>::const_iterator pos, const QDate& akey, const QTextCharFormat& avalue).

C++ documentation:

This is an overloaded function.

Inserts a new item with the key key and value value and with hint pos suggesting where to do the insert.

If constBegin() is used as hint it indicates that the key is less than any key in the map while constEnd() suggests that the key is larger than any key in the map. Otherwise the hint should meet the condition (pos - 1).key() < key <= pos.key(). If the hint pos is wrong it is ignored and a regular insertMulti is done.

If there is already an item with the same key in the map, this function will simply create a new one.

Note: Be careful with the hint. Providing an iterator from an older shared instance might crash but there is also a risk that it will silently corrupt both the map and the pos map.

This function was introduced in Qt 5.1.

See also insert().

pub unsafe fn is_detached(&self) -> bool[src]

Calls C++ function: bool QMap<QDate, QTextCharFormat>::isDetached() const.

pub unsafe fn is_empty(&self) -> bool[src]

Returns true if the map contains no items; otherwise returns false.

Calls C++ function: bool QMap<QDate, QTextCharFormat>::isEmpty() const.

C++ documentation:

Returns true if the map contains no items; otherwise returns false.

See also size().

pub unsafe fn is_shared_with(
    &self,
    other: impl CastInto<Ref<QMapOfQDateQTextCharFormat>>
) -> bool
[src]

Calls C++ function: bool QMap<QDate, QTextCharFormat>::isSharedWith(const QMap<QDate, QTextCharFormat>& other) const.

pub unsafe fn key_2a(
    &self,
    value: impl CastInto<Ref<QTextCharFormat>>,
    default_key: impl CastInto<Ref<QDate>>
) -> CppBox<QDate>
[src]

This is an overloaded function.

Calls C++ function: QDate QMap<QDate, QTextCharFormat>::key(const QTextCharFormat& value, const QDate& defaultKey = …) const.

C++ documentation:

This is an overloaded function.

Returns the first key with value value, or defaultKey if the map contains no item with value value. If no defaultKey is provided the function returns a default-constructed key.

This function can be slow (linear time), because QMap's internal data structure is optimized for fast lookup by key, not by value.

This function was introduced in Qt 4.3.

See also value() and keys().

pub unsafe fn key_1a(
    &self,
    value: impl CastInto<Ref<QTextCharFormat>>
) -> CppBox<QDate>
[src]

This is an overloaded function.

Calls C++ function: QDate QMap<QDate, QTextCharFormat>::key(const QTextCharFormat& value) const.

C++ documentation:

This is an overloaded function.

Returns the first key with value value, or defaultKey if the map contains no item with value value. If no defaultKey is provided the function returns a default-constructed key.

This function can be slow (linear time), because QMap's internal data structure is optimized for fast lookup by key, not by value.

This function was introduced in Qt 4.3.

See also value() and keys().

pub unsafe fn key_begin(&self) -> CppBox<KeyIterator>[src]

Returns a const STL-style iterator pointing to the first key in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::key_iterator QMap<QDate, QTextCharFormat>::keyBegin() const.

C++ documentation:

Returns a const STL-style iterator pointing to the first key in the map.

This function was introduced in Qt 5.6.

See also keyEnd() and firstKey().

pub unsafe fn key_end(&self) -> CppBox<KeyIterator>[src]

Returns a const STL-style iterator pointing to the imaginary item after the last key in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::key_iterator QMap<QDate, QTextCharFormat>::keyEnd() const.

C++ documentation:

Returns a const STL-style iterator pointing to the imaginary item after the last key in the map.

This function was introduced in Qt 5.6.

See also keyBegin() and lastKey().

pub unsafe fn last_mut(&self) -> Ref<QTextCharFormat>[src]

Returns a reference to the last value in the map, that is the value mapped to the largest key. This function assumes that the map is not empty.

Calls C++ function: QTextCharFormat& QMap<QDate, QTextCharFormat>::last().

C++ documentation:

Returns a reference to the last value in the map, that is the value mapped to the largest key. This function assumes that the map is not empty.

When unshared (or const version is called), this executes in logarithmic time.

This function was introduced in Qt 5.2.

See also first(), lastKey(), and isEmpty().

pub unsafe fn last(&self) -> Ref<QTextCharFormat>[src]

This is an overloaded function.

Calls C++ function: const QTextCharFormat& QMap<QDate, QTextCharFormat>::last() const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.2.

pub unsafe fn last_key(&self) -> Ref<QDate>[src]

Returns a reference to the largest key in the map. This function assumes that the map is not empty.

Calls C++ function: const QDate& QMap<QDate, QTextCharFormat>::lastKey() const.

C++ documentation:

Returns a reference to the largest key in the map. This function assumes that the map is not empty.

This executes in logarithmic time.

This function was introduced in Qt 5.2.

See also firstKey(), last(), keyEnd(), and isEmpty().

pub unsafe fn lower_bound_mut(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<Iterator>
[src]

Returns an iterator pointing to the first item with key key in the map. If the map contains no item with key key, the function returns an iterator to the nearest item with a greater key.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::lowerBound(const QDate& key).

C++ documentation:

Returns an iterator pointing to the first item with key key in the map. If the map contains no item with key key, the function returns an iterator to the nearest item with a greater key.

Example:

QMap<int, QString> map; map.insert(1, "one"); map.insert(5, "five"); map.insert(10, "ten");

map.lowerBound(0); // returns iterator to (1, "one") map.lowerBound(1); // returns iterator to (1, "one") map.lowerBound(2); // returns iterator to (5, "five") map.lowerBound(10); // returns iterator to (10, "ten") map.lowerBound(999); // returns end()

If the map contains multiple items with key key, this function returns an iterator that points to the most recently inserted value. The other values are accessible by incrementing the iterator. For example, here's some code that iterates over all the items with the same key:

QMap<QString, int> map; ... QMap<QString, int>::const_iterator i = map.lowerBound("HDR"); QMap<QString, int>::const_iterator upperBound = map.upperBound("HDR"); while (i != upperBound) { cout << i.value() << endl; ++i; }

See also upperBound() and find().

pub unsafe fn lower_bound(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<ConstIterator>
[src]

This is an overloaded function.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::lowerBound(const QDate& key) const.

C++ documentation:

This is an overloaded function.

pub unsafe fn new() -> CppBox<QMapOfQDateQTextCharFormat>[src]

Constructs an empty map.

Calls C++ function: [constructor] void QMap<QDate, QTextCharFormat>::QMap().

C++ documentation:

Constructs an empty map.

See also clear().

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QMapOfQDateQTextCharFormat>>
) -> CppBox<QMapOfQDateQTextCharFormat>
[src]

Constructs a copy of other.

Calls C++ function: [constructor] void QMap<QDate, QTextCharFormat>::QMap(const QMap<QDate, QTextCharFormat>& other).

C++ documentation:

Constructs a copy of other.

This operation occurs in constant time, because QMap is implicitly shared. This makes returning a QMap from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and this takes linear time.

See also operator=().

pub unsafe fn remove(&self, key: impl CastInto<Ref<QDate>>) -> c_int[src]

Removes all the items that have the key key from the map. Returns the number of items removed which is usually 1 but will be 0 if the key isn't in the map, or > 1 if insertMulti() has been used with the key.

Calls C++ function: int QMap<QDate, QTextCharFormat>::remove(const QDate& key).

C++ documentation:

Removes all the items that have the key key from the map. Returns the number of items removed which is usually 1 but will be 0 if the key isn't in the map, or > 1 if insertMulti() has been used with the key.

See also clear(), take(), and QMultiMap::remove().

pub unsafe fn set_sharable(&self, sharable: bool)[src]

Calls C++ function: void QMap<QDate, QTextCharFormat>::setSharable(bool sharable).

pub unsafe fn size(&self) -> c_int[src]

Returns the number of (key, value) pairs in the map.

Calls C++ function: int QMap<QDate, QTextCharFormat>::size() const.

C++ documentation:

Returns the number of (key, value) pairs in the map.

See also isEmpty() and count().

pub unsafe fn swap(&self, other: impl CastInto<Ref<QMapOfQDateQTextCharFormat>>)[src]

Swaps map other with this map. This operation is very fast and never fails.

Calls C++ function: void QMap<QDate, QTextCharFormat>::swap(QMap<QDate, QTextCharFormat>& other).

C++ documentation:

Swaps map other with this map. This operation is very fast and never fails.

This function was introduced in Qt 4.8.

pub unsafe fn take(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<QTextCharFormat>
[src]

Removes the item with the key key from the map and returns the value associated with it.

Calls C++ function: QTextCharFormat QMap<QDate, QTextCharFormat>::take(const QDate& key).

C++ documentation:

Removes the item with the key key from the map and returns the value associated with it.

If the item does not exist in the map, the function simply returns a default-constructed value. If there are multiple items for key in the map, only the most recently inserted one is removed and returned.

If you don't use the return value, remove() is more efficient.

See also remove().

pub unsafe fn unite(
    &self,
    other: impl CastInto<Ref<QMapOfQDateQTextCharFormat>>
) -> Ref<QMapOfQDateQTextCharFormat>
[src]

Inserts all the items in the other map into this map. If a key is common to both maps, the resulting map will contain the key multiple times.

Calls C++ function: QMap<QDate, QTextCharFormat>& QMap<QDate, QTextCharFormat>::unite(const QMap<QDate, QTextCharFormat>& other).

C++ documentation:

Inserts all the items in the other map into this map. If a key is common to both maps, the resulting map will contain the key multiple times.

See also insertMulti().

pub unsafe fn upper_bound_mut(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<Iterator>
[src]

Returns an iterator pointing to the item that immediately follows the last item with key key in the map. If the map contains no item with key key, the function returns an iterator to the nearest item with a greater key.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::upperBound(const QDate& key).

C++ documentation:

Returns an iterator pointing to the item that immediately follows the last item with key key in the map. If the map contains no item with key key, the function returns an iterator to the nearest item with a greater key.

Example:

QMap<int, QString> map; map.insert(1, "one"); map.insert(5, "five"); map.insert(10, "ten");

map.upperBound(0); // returns iterator to (1, "one") map.upperBound(1); // returns iterator to (5, "five") map.upperBound(2); // returns iterator to (5, "five") map.upperBound(10); // returns end() map.upperBound(999); // returns end()

See also lowerBound() and find().

pub unsafe fn upper_bound(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<ConstIterator>
[src]

This is an overloaded function.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::upperBound(const QDate& key) const.

C++ documentation:

This is an overloaded function.

pub unsafe fn value_2a(
    &self,
    key: impl CastInto<Ref<QDate>>,
    default_value: impl CastInto<Ref<QTextCharFormat>>
) -> CppBox<QTextCharFormat>
[src]

Returns the value associated with the key key.

Calls C++ function: QTextCharFormat QMap<QDate, QTextCharFormat>::value(const QDate& key, const QTextCharFormat& defaultValue = …) const.

C++ documentation:

Returns the value associated with the key key.

If the map contains no item with key key, the function returns defaultValue. If no defaultValue is specified, the function returns a default-constructed value. If there are multiple items for key in the map, the value of the most recently inserted one is returned.

See also key(), values(), contains(), and operator[]().

pub unsafe fn value_1a(
    &self,
    key: impl CastInto<Ref<QDate>>
) -> CppBox<QTextCharFormat>
[src]

Returns the value associated with the key key.

Calls C++ function: QTextCharFormat QMap<QDate, QTextCharFormat>::value(const QDate& key) const.

C++ documentation:

Returns the value associated with the key key.

If the map contains no item with key key, the function returns defaultValue. If no defaultValue is specified, the function returns a default-constructed value. If there are multiple items for key in the map, the value of the most recently inserted one is returned.

See also key(), values(), contains(), and operator[]().

Trait Implementations

impl Begin for QMapOfQDateQTextCharFormat[src]

type Output = CppBox<ConstIterator>

Output type.

unsafe fn begin(&self) -> CppBox<ConstIterator>[src]

This is an overloaded function.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::begin() const.

C++ documentation:

This is an overloaded function.

impl BeginMut for QMapOfQDateQTextCharFormat[src]

type Output = CppBox<Iterator>

Output type.

unsafe fn begin_mut(&self) -> CppBox<Iterator>[src]

Returns an STL-style iterator pointing to the first item in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::begin().

C++ documentation:

Returns an STL-style iterator pointing to the first item in the map.

See also constBegin() and end().

impl CppDeletable for QMapOfQDateQTextCharFormat[src]

unsafe fn delete(&self)[src]

Destroys the map. References to the values in the map, and all iterators over this map, become invalid.

Calls C++ function: [destructor] void QMap<QDate, QTextCharFormat>::~QMap().

C++ documentation:

Destroys the map. References to the values in the map, and all iterators over this map, become invalid.

impl End for QMapOfQDateQTextCharFormat[src]

type Output = CppBox<ConstIterator>

Output type.

unsafe fn end(&self) -> CppBox<ConstIterator>[src]

This is an overloaded function.

Calls C++ function: QMap<QDate, QTextCharFormat>::const_iterator QMap<QDate, QTextCharFormat>::end() const.

C++ documentation:

This is an overloaded function.

impl EndMut for QMapOfQDateQTextCharFormat[src]

type Output = CppBox<Iterator>

Output type.

unsafe fn end_mut(&self) -> CppBox<Iterator>[src]

Returns an STL-style iterator pointing to the imaginary item after the last item in the map.

Calls C++ function: QMap<QDate, QTextCharFormat>::iterator QMap<QDate, QTextCharFormat>::end().

C++ documentation:

Returns an STL-style iterator pointing to the imaginary item after the last item in the map.

See also begin() and constEnd().

impl PartialEq<Ref<QMapOfQDateQTextCharFormat>> for QMapOfQDateQTextCharFormat[src]

fn eq(&self, other: &Ref<QMapOfQDateQTextCharFormat>) -> bool[src]

Returns true if other is equal to this map; otherwise returns false.

Calls C++ function: bool QMap<QDate, QTextCharFormat>::operator==(const QMap<QDate, QTextCharFormat>& other) const.

C++ documentation:

Returns true if other is equal to this map; otherwise returns false.

Two maps are considered equal if they contain the same (key, value) pairs.

This function requires the value type to implement operator==().

See also operator!=().

impl Size for QMapOfQDateQTextCharFormat[src]

unsafe fn size(&self) -> usize[src]

Returns the number of (key, value) pairs in the map.

Calls C++ function: int QMap<QDate, QTextCharFormat>::size() const.

C++ documentation:

Returns the number of (key, value) pairs in the map.

See also isEmpty() and count().

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.