if(isset($arr['argument']) && $g = $arr["argument"])
{
echo $g;
}
if(isset($arr['argument']))
{
$g = $arr["argument"];
echo $g;
}
delegate: ItemDelegate {
width: comboBox.width
contentItem: Text {
text: modelData
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
font.pointSize: 11
font.family: "Arial"
wrapMode: Text.WordWrap
}
}
#include "port.h"
#include "ui_port.h"
#include <QString>
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
using namespace std;
const char *pp = ".//text2.txt";
Port::Port(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Port)
{
ui->setupUi(this);
but = new QPushButton;
but->resize(200,50);
but->setText("Click");
text = new QPlainTextEdit;
text->resize(640,480);
text->show();
but->show();
connect(but,SIGNAL(clicked()),this,SLOT(clearp()));
}
Port::~Port()
{
delete ui;
}
void Port::clearp() {
vector<string> stp;
stp.push_back(text->toPlainText().toStdString());
sort(stp.begin(),stp.end());
stp.erase(unique(stp.begin(),stp.end()),stp.end());
ofstream filesave(pp);
copy(stp.begin(),stp.end(), ostream_iterator<string>(filesave,"\n"));
}