本文整理汇总了C++中QMap::toStdMap方法的典型用法代码示例。如果您正苦于以下问题:C++ QMap::toStdMap方法的具体用法?C++ QMap::toStdMap怎么用?C++ QMap::toStdMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMap
的用法示例。
在下文中一共展示了QMap::toStdMap方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
m_progBarDial(new ProgressBarDialog(this))
{
ui->setupUi(this);
this->prepareGUI();
this->selectedPlace = nullptr;
QMap<int, QString> pluginIndexNameMap;
pluginManager.loadPlugin(pluginIndexNameMap);
for(auto e: pluginIndexNameMap.toStdMap())
{
this->list.addItemToBox(e.second, QVariant(e.first));
pluginManager.getPluginByIndex(e.first)->setMap(this);
}
placesListChanged = false;
}
示例2: insertPasteSelection
bool FxSelection::insertPasteSelection() {
QClipboard *clipboard = QApplication::clipboard();
const FxsData *fxsData = dynamic_cast<const FxsData *>(clipboard->mimeData());
m_pastePosition = TConst::nowhere;
if (!fxsData || !fxsData->isConnected()) return false;
if (m_selectedLinks.isEmpty()) return true;
// Start an undo block and ensure it is appropriately destroyed
struct Auto {
bool m_destruct;
~Auto() {
if (m_destruct) TUndoManager::manager()->endBlock();
}
} auto_ = {false};
// Need to make a temporary copy of selected links. It's necessary since the
// selection will
// be updated (cleared) after each insertion.
QList<TFxCommand::Link> selectedLinks(m_selectedLinks);
int i, size = selectedLinks.size();
for (i = 0; i < size; ++i) {
// Clone the fxs to be inserted
QList<TFxP> fxs;
QMap<TFx *, int> zeraryFxColumnSize;
QList<TXshColumnP> columns;
fxsData->getFxs(fxs, zeraryFxColumnSize, columns);
if (fxs.empty() && columns.empty()) return true;
if (!auto_.m_destruct)
auto_.m_destruct = true, TUndoManager::manager()->beginBlock();
TFxCommand::insertPasteFxs(selectedLinks[i], fxs.toStdList(),
zeraryFxColumnSize.toStdMap(),
columns.toStdList(), m_xshHandle, m_fxHandle);
}
return true;
}
示例3: getFlash
QString ApplicationHelper::getFlash(const QMap<QString, QString>& flash)
{
if(flash.empty())
return "";
QMap<QString, QString> classes;
classes.insert("notice", "info");
classes.insert("alert", "danger");
classes.insert("success", "success");
classes.insert("warning", "warning");
QString result = "";
for(const auto& msg: flash.toStdMap())
{
if(!classes.contains(msg.first) || msg.second.trimmed().isEmpty())
continue;
result += QString("<div class=\"alert alert-%1\">%2</div>\n").arg(classes[msg.first], msg.second);
}
return result;
}
示例4: pasteSelection
void FxSelection::pasteSelection() {
/*--- Fxノードを1つだけ選択していた場合、Replace paste ---*/
if (m_selectedFxs.size() >= 1 && m_selectedLinks.size() == 0 &&
m_selectedColIndexes.isEmpty())
replacePasteSelection();
/*--- Linkを1つだけ選択していた場合、Insert paste ---*/
else if (m_selectedFxs.size() == 0 && m_selectedLinks.size() >= 1 &&
m_selectedColIndexes.isEmpty())
insertPasteSelection();
else {
QClipboard *clipboard = QApplication::clipboard();
const FxsData *fxsData =
dynamic_cast<const FxsData *>(clipboard->mimeData());
if (!fxsData) return;
QList<TFxP> fxs;
QMap<TFx *, int> zeraryFxColumnSize;
QList<TXshColumnP> columns;
fxsData->getFxs(fxs, zeraryFxColumnSize, columns);
if (fxs.isEmpty() && columns.isEmpty()) return;
// in case of the paste command triggered from short cut key
if (m_pastePosition == TConst::nowhere && m_schematicScene) {
SchematicSceneViewer *ssv =
dynamic_cast<SchematicSceneViewer *>(m_schematicScene->views().at(0));
if (ssv)
m_pastePosition =
TPointD(ssv->getOldScenePos().x(), ssv->getOldScenePos().y());
}
TFxCommand::pasteFxs(fxs.toStdList(), zeraryFxColumnSize.toStdMap(),
columns.toStdList(), m_pastePosition, m_xshHandle,
m_fxHandle);
if (m_schematicScene) {
selectNone();
for (int i = 0; i < (int)fxs.size(); i++) select(fxs[i]);
m_schematicScene->selectNodes(fxs);
}
}
m_pastePosition = TConst::nowhere;
}
示例5: replacePasteSelection
bool FxSelection::replacePasteSelection() {
QClipboard *clipboard = QApplication::clipboard();
const FxsData *fxsData = dynamic_cast<const FxsData *>(clipboard->mimeData());
m_pastePosition = TConst::nowhere;
if (!fxsData || !fxsData->isConnected()) return false;
if (m_selectedFxs.isEmpty()) return true;
struct Auto {
bool m_destruct;
~Auto() {
if (m_destruct) TUndoManager::manager()->endBlock();
}
} auto_ = {false};
QList<TFxP> selectedFxs(m_selectedFxs);
int i, size = selectedFxs.size();
for (i = 0; i < size; ++i) {
// Clone the fxs to be inserted
QList<TFxP> fxs;
QMap<TFx *, int> zeraryFxColumnSize;
QList<TXshColumnP> columns;
fxsData->getFxs(fxs, zeraryFxColumnSize, columns);
if (fxs.empty() && columns.empty()) return true;
if (!auto_.m_destruct)
auto_.m_destruct = true, TUndoManager::manager()->beginBlock();
TFx *inFx = m_selectedFxs[i].getPointer();
TFxCommand::replacePasteFxs(inFx, fxs.toStdList(),
zeraryFxColumnSize.toStdMap(),
columns.toStdList(), m_xshHandle, m_fxHandle);
}
return true;
}
示例6: afficherImage
afficherImage();
}
using namespace std;
void MultiCanalDisplay::afficherImage()
{
foreach(CanalDisplay * display, widgetsList)
{
Glayout->removeWidget(display);
delete display;
}
widgetsList.clear();
imagesMap.clear();
QMap<QString, Image *> map = MultiCanalController::getImagesList(dossier, finF);
imagesMap = map.toStdMap();
std::map<QString, Image *>::iterator it;
int j = 0;
for(it = imagesMap.begin() ; it != imagesMap.end() ; ++it)
{
QString s = it->first;
Image * img = it->second;
CanalDisplay * display = new CanalDisplay(s, img);
widgetsList.push_back(display);
Glayout->addWidget(display, j/3, j%3);
display->setOffsetX(offsetX);
display->setOffsetY(offsetY);
QObject::connect(display, SIGNAL(PixelSelected(int,int)), this, SLOT(ChangeCoordinate(int,int)));
QObject::connect(display, SIGNAL(decouper(int,int,int,int,bool)), this, SLOT(decoupeImages(int,int,int,int,bool)));
QObject::connect(locationWidget, SIGNAL(coordinateChanged(int,int)), this, SLOT(ChangeCoordinate(int,int)));
QObject::connect(communeSelection, SIGNAL(communeSelected(double,double)), locationWidget, SLOT(ChangeLatLong(double,double)));
示例7: addUser
//SLOT
void Gui_AdminWindow::addUser() {
bool inserted = true;
QString name = edt[0]->text();
QString surn = edt[1]->text();
QString uname = edt[2]->text();
QString passw = edt[3]->text();
int level = _level->itemData(_level->currentIndex()).toInt();
QMap<string, string> map;
map.insert("name", name.toStdString());
map.insert("surname", surn.toStdString());
map.insert("birthdate", QDate::currentDate().toString("dd.MM.yyyy").toStdString());
try {
_admin->insertUser(uname.toStdString(), passw.toStdString(), (privLevel) level, map.toStdMap(), 1);
}catch(Error e) {
QMessageBox::critical(this, "Error", QString::fromStdString(e.errorMessage()));
inserted = false;
}
if(inserted) {
QMessageBox::information(this, "Operation complete", "User successfully created");
emit modified();
}
}