本文整理汇总了C++中setComment函数的典型用法代码示例。如果您正苦于以下问题:C++ setComment函数的具体用法?C++ setComment怎么用?C++ setComment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setComment函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->setWindowTitle("Storm");
ui->openButton->setFocus();
connect(dt,SIGNAL(setNumOfPieces(int)),this,SLOT(setNumPieces(int)));
connect(dt,SIGNAL(setPiecesLength(int)),this,SLOT(setPiecesLength(int)));
connect(dt,SIGNAL(setInfoHash(QString)),this,SLOT(setInfoHash(QString)));
connect(dt,SIGNAL(setComment(QString)),this,SLOT(setComment(QString)));
connect(dt,SIGNAL(setCreatedBy(QString)),this,SLOT(setCreatedBy(QString)));
connect(dt,SIGNAL(setMagnetLink(QString)),this,SLOT(setMagnetLink(QString)));
connect(dt,SIGNAL(setName(QString)),this,SLOT(setName(QString)));
connect(dt,SIGNAL(setNumOfFiles(int)),this,SLOT(setNumOfFiles(int)));
connect(dt,SIGNAL(setFilesList(QList<QString>)),this,SLOT(setFilesList(QList<QString>)));
// connect();
MainWindow::displayHeader();
MainWindow::setFixedSize(812,847);
MainWindow::move(300,0);
}
示例2: kdDebug
void TDECModuleInfo::init(KService::Ptr s)
{
_allLoaded = false;
d = new TDECModuleInfoPrivate;
if ( s )
_service = s;
else
{
kdDebug(712) << "Could not find the service." << endl;
return;
}
// set the modules simple attributes
setName(_service->name());
setComment(_service->comment());
setIcon(_service->icon());
_fileName = ( _service->desktopEntryPath() );
// library and factory
setLibrary(_service->library());
// get the keyword list
setKeywords(_service->keywords());
}
示例3: QFileDialog
void
WaveMaker::loadFile()
{
QFileDialog* fd = new QFileDialog(this, "Wave Maker Input File", TRUE);
fd->setMode(QFileDialog::AnyFile);
fd->setViewMode(QFileDialog::Detail);
QString fileName;
if (fd->exec() == QDialog::Accepted)
{
fileName = fd->selectedFile();
printf("Loading new file: %s\n", fileName.latin1());
setComment("File Name", fileName);
wave.clear();
QFile file(fileName);
if (file.open(IO_ReadOnly))
{
QTextStream stream(&file);
double value;
while (!stream.atEnd())
{
stream >> value;
wave.push_back(value);
}
filename = fileName;
}
示例4: switch
void
WaveMaker::update(DefaultGUIModel::update_flags_t flag)
{
switch (flag)
{
case INIT:
setParameter("Loops", QString::number(nloops));
setParameter("Gain", QString::number(gain));
setComment("File Name", filename);
setState("Length (s)", length);
break;
case MODIFY:
nloops = getParameter("Loops").toUInt();
gain = getParameter("Gain").toDouble();
filename = getComment("File Name");
break;
case PAUSE:
output(0) = 0; // stop command in case pause occurs in the middle of command
idx = 0;
loop = 0;
gain = 0;
printf("Protocol paused.\n");
break;
case UNPAUSE:
printf("Protocol started.\n");
break;
case PERIOD:
dt = RT::System::getInstance()->getPeriod() * 1e-9;
loadFile(filename);
default:
break;
}
}
示例5: qDebug
void TrackInfoObject::parse() {
// Log parsing of header information in developer mode. This is useful for
// tracking down corrupt files.
const QString& canonicalLocation = m_fileInfo.canonicalFilePath();
if (CmdlineArgs::Instance().getDeveloper()) {
qDebug() << "TrackInfoObject::parse()" << canonicalLocation;
}
// Parse the information stored in the sound file.
SoundSourceProxy proxy(canonicalLocation, m_pSecurityToken);
Mixxx::SoundSource* pProxiedSoundSource = proxy.getProxiedSoundSource();
if (pProxiedSoundSource != NULL && proxy.parseHeader() == OK) {
// Dump the metadata extracted from the file into the track.
// TODO(XXX): This involves locking the mutex for every setXXX
// method. We should figure out an optimization where there are private
// setters that don't lock the mutex.
// If Artist, Title and Type fields are not blank, modify them.
// Otherwise, keep their current values.
// TODO(rryan): Should we re-visit this decision?
if (!(pProxiedSoundSource->getArtist().isEmpty())) {
setArtist(pProxiedSoundSource->getArtist());
}
if (!(pProxiedSoundSource->getTitle().isEmpty())) {
setTitle(pProxiedSoundSource->getTitle());
}
if (!(pProxiedSoundSource->getType().isEmpty())) {
setType(pProxiedSoundSource->getType());
}
setAlbum(pProxiedSoundSource->getAlbum());
setAlbumArtist(pProxiedSoundSource->getAlbumArtist());
setYear(pProxiedSoundSource->getYear());
setGenre(pProxiedSoundSource->getGenre());
setComposer(pProxiedSoundSource->getComposer());
setGrouping(pProxiedSoundSource->getGrouping());
setComment(pProxiedSoundSource->getComment());
setTrackNumber(pProxiedSoundSource->getTrackNumber());
setReplayGain(pProxiedSoundSource->getReplayGain());
setBpm(pProxiedSoundSource->getBPM());
setDuration(pProxiedSoundSource->getDuration());
setBitrate(pProxiedSoundSource->getBitrate());
setSampleRate(pProxiedSoundSource->getSampleRate());
setChannels(pProxiedSoundSource->getChannels());
setKeyText(pProxiedSoundSource->getKey(),
mixxx::track::io::key::FILE_METADATA);
setHeaderParsed(true);
} else {
qDebug() << "TrackInfoObject::parse() error at file"
<< canonicalLocation;
setHeaderParsed(false);
// Add basic information derived from the filename:
parseFilename();
}
}
示例6: setContents
bool ReturnInstruction::setAsXMLNode(QDomNode& node)
{
if (node.hasChildNodes()) {
QDomNodeList nodeList = node.childNodes();
for (unsigned i = 0; i < nodeList.length(); i++) {
QDomElement e = nodeList.item(i).toElement();
if (!e.isNull()) {
if (e.tagName() == "text") {
QDomNode t = e.firstChild();
setContents(t.nodeValue());
} else if (e.tagName() == "comment") {
QDomNode t = e.firstChild();
setComment(t.nodeValue());
}
}
}
} else {
// tekst, komentarz i pixmapa puste
}
validateContents();
return true;
}
示例7: m_type
AppletInfo::AppletInfo(const QString &deskFile, const QString &configFile, const AppletInfo::AppletType type)
: m_type(type), m_unique(true), m_hidden(false)
{
QFileInfo fi(deskFile);
m_desktopFile = fi.fileName();
const char *resource = "applets";
switch(type)
{
case Extension:
resource = "extensions";
break;
case BuiltinButton:
resource = "builtinbuttons";
break;
case SpecialButton:
resource = "specialbuttons";
break;
case Undefined:
case Applet:
default:
break;
}
KDesktopFile df(m_desktopFile, true, resource);
// set the appletssimple attributes
setName(df.readName());
setComment(df.readComment());
setIcon(df.readIcon());
// library
setLibrary(df.readEntry("X-KDE-Library"));
// is it a unique applet?
setIsUnique(df.readBoolEntry("X-KDE-UniqueApplet", false));
// should it be shown in the gui?
m_hidden = df.readBoolEntry("Hidden", false);
if(configFile.isEmpty())
{
// generate a config file base name from the library name
m_configFile = m_lib.lower();
if(m_unique)
{
m_configFile.append("rc");
}
else
{
m_configFile.append("_").append(kapp->randomString(20).lower()).append("_rc");
}
}
else
{
m_configFile = configFile;
}
}
示例8: Q_ASSERT
bool AbstractAspect::readCommentElement(XmlStreamReader * reader)
{
Q_ASSERT(reader->isStartElement() && reader->name() == "comment");
QString temp = reader->readElementText();
temp.replace("\\n", "\n");
setComment(temp);
return true;
}
示例9: setUnitMeasure
BillItemMeasure &BillItemMeasure::operator=(const BillItemMeasure &cp) {
if( &cp != this ){
setUnitMeasure( cp.m_d->unitMeasure );
setComment( cp.m_d->comment );
setFormula( cp.m_d->formula );
}
return *this;
}
示例10: setName
ModelMetadata& operator= (const ModelMetadata& other)
{
setName(other.name());
setComment(other.comment());
setColor(other.color());
setLabel(other.label());
return *this;
}
示例11: CodeAccessorMethod
DCodeAccessorMethod::DCodeAccessorMethod (CodeClassField * field, CodeAccessorMethod::AccessorType type)
: CodeAccessorMethod (field)
{
setType(type);
// lets use full-blown comment
DClassifierCodeDocument* jccd = dynamic_cast<DClassifierCodeDocument*>(field->getParentDocument());
setComment(new DCodeDocumentation(jccd));
}
示例12: setComment
void UCommentTag::edit()
{
bool ok;
QString input=QInputDialog::getText(0,"Edit comment","Comment:",QLineEdit::Normal,comment(),&ok);
if(ok)
{
setComment(input);
}
}
示例13: CodeOperation
RubyCodeOperation::RubyCodeOperation ( RubyClassifierCodeDocument * doc, UMLOperation *parent, const QString & body, const QString & comment )
: CodeOperation (doc, parent, body, comment)
{
// lets not go with the default comment and instead use
// full-blown ruby documentation object instead
setComment(new RubyCodeDocumentation(doc));
// these things never change..
setOverallIndentationLevel(1);
}
示例14: setComment
void XMLElementCodeBlock::init (CodeDocument *parentDoc, const QString &nodeName, const QString &comment)
{
setComment(new XMLCodeComment(parentDoc));
getComment()->setText(comment);
m_nodeName = nodeName;
updateContent();
}
示例15: setComment
void JavaClassDeclarationBlock::init (JavaClassifierCodeDocument *parentDoc, const QString &comment)
{
setComment(new JavaCodeDocumentation(parentDoc));
getComment()->setText(comment);
setEndText("}");
updateContent();
}