本文整理汇总了C++中Ztring::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ Ztring::remove方法的具体用法?C++ Ztring::remove怎么用?C++ Ztring::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ztring
的用法示例。
在下文中一共展示了Ztring::remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: contextMenuEvent
//.........这里部分代码省略.........
{
menu.addAction(new QAction("Fill all open files with this field value", this)); //If you change this, change the test text too
menu.addSeparator();
}
//Handling Clear display
if (!item(Item->row(), Item->column())->text().isEmpty() && C->IsValid(FileName, Field, string()))
{
menu.addAction(new QAction("Clear this value", this)); //If you change this, change the test text too
menu.addSeparator();
}
//Handling date display
if (!Date.empty())
{
menu.addAction(new QAction(QString().fromUtf8(Date.To_Local().c_str()), this));
menu.addSeparator();
}
//Handling history display
size_t Pos=History.size();
if (!History.empty())
do
{
Pos--;
QString Text=QString().fromUtf8(History[Pos].To_Local().c_str());
if (!Text.isEmpty())
{
QAction* Action=new QAction(Text, this);
menu.addAction(Action);
}
}
while (Pos>0);
//Displaying
QAction* Action=menu.exec(Event->globalPos());
if (Action==NULL)
return;
//Retrieving data
QString Text=Action->text();
//Special cases
if (Text=="Fill all open files with this field value") //If you change this, change the creation text too
{
for (int Row=0; Row<rowCount(); Row++)
{
item(Row, Item->column())->setText(QString().fromUtf8(Ztring(C->Get(FileName, Field)).To_Local().c_str()));
dataChanged(indexFromItem(item(Row, Item->column())), indexFromItem(item(Row, Item->column())));
//Special cases
if (Field=="UMID" || Field=="LoudnessValue" || Field=="LoudnessRange" || Field=="MaxTruePeakLevel" || Field=="MaxMomentaryLoudness" || Field=="MaxShortTermLoudness")
{
//Changing BextVersion Enabled value
SetText (*Item, "BextVersion");
SetEnabled(*Item, "BextVersion");
}
}
return;
}
if (Text=="Clear this value") //If you change this, change the creation text too
Text.clear();
//Filling
if (Text.contains("&Set ")) //If you change this, change the creation text too
{
Text=Text.remove("&Set ICRD to file creation timestamp ("); //If you change this, change the creation text too
Text=Text.remove("&Set originationDate and Time to file creation timestamp ("); //If you change this, change the creation text too
Text=Text.remove(")"); //If you change this, change the creation text too
if (horizontalHeaderItem(Item->column())->text()==QString().fromUtf8("ICRD"))
{
item(Item->row(), Item->column())->setText(Text);
dataChanged(indexFromItem(item(Item->row(), Item->column())), indexFromItem(item(Item->row(), Item->column())));
}
else
{
QString Date=Text;
Date.remove(10, 1+12);
QString Time=Text;
Time.remove(0, 10+1);
Time.remove(8, 4);
int Date_Pos=Item->column()+(horizontalHeaderItem(Item->column())->text()==QString().fromUtf8("OriginationDate")?0:-1);
int Time_Pos=Item->column()+(horizontalHeaderItem(Item->column())->text()==QString().fromUtf8("OriginationTime")?0:1);
item(Item->row(), Date_Pos)->setText(Date);
dataChanged(indexFromItem(item(Item->row(), Date_Pos)), indexFromItem(item(Item->row(), Date_Pos)));
item(Item->row(), Time_Pos)->setText(Time);
dataChanged(indexFromItem(item(Item->row(), Time_Pos)), indexFromItem(item(Item->row(), Time_Pos)));
}
}
else
{
item(Item->row(), Item->column())->setText(Text);
dataChanged(indexFromItem(item(Item->row(), Item->column())), indexFromItem(item(Item->row(), Item->column())));
}
//Menu
Main->Menu_Update();
}