void VirtualConsole::slotBackgroundColor() { QColor color; Q_ASSERT(contents() != NULL); if (m_selectedWidgets.isEmpty() == true) color = contents()->backgroundColor(); else color = m_selectedWidgets.last()->backgroundColor(); color = QColorDialog::getColor(color); if (color.isValid() == true) { if (m_selectedWidgets.isEmpty() == true) { contents()->setBackgroundColor(color); } else { VCWidget* widget; foreach(widget, m_selectedWidgets) widget->setBackgroundColor(color); } } }
void VirtualConsole::slotFont() { bool ok = false; QFont font; Q_ASSERT(contents() != NULL); if (m_selectedWidgets.isEmpty() == true) font = contents()->font(); else font = m_selectedWidgets.last()->font(); /* This crashes with Qt 4.6.x on OSX. Upgrade to 4.7.x. */ font = QFontDialog::getFont(&ok, font); if (ok == true) { if (m_selectedWidgets.isEmpty() == true) { contents()->setFont(font); } else { VCWidget* widget; foreach(widget, m_selectedWidgets) widget->setFont(font); } } }
void VirtualConsole::slotBackgroundImage() { QString path; Q_ASSERT(contents() != NULL); if (m_selectedWidgets.isEmpty() == true) path = contents()->backgroundImage(); else path = m_selectedWidgets.last()->backgroundImage(); path = QFileDialog::getOpenFileName(this, tr("Select background image"), path, "Images (*.png *.xpm *.jpg *.gif)"); if (path.isEmpty() == false) { if (m_selectedWidgets.isEmpty() == true) { contents()->setBackgroundImage(path); } else { VCWidget* widget; foreach(widget, m_selectedWidgets) widget->setBackgroundImage(path); } } }
/* Returns index if a sentence matches, 0 otherwise */ int method(int index) { if(tokens[(index = readTok(index))] == VOID_METHOD_START) { if(tokens[(index = readTok(index))] == OPENTOK) { if(index = contents(index)) { if(tokens[(index = readTok(index))] == CLOSETOK) return index; } } } if(nextTok(index) == METHOD_START) { if(nextTok(index) == OPENTOK) { if(index = contents(index)) { if(nextTok(index) == CLOSETOK) return index; } } } return index; }
void VirtualConsole::updateCustomMenu() { /* Get rid of the custom menu, but delete it later because this might be called from the very menu that is being deleted. */ if (m_customMenu != NULL) { delete m_customMenu; m_customMenu = NULL; } if (m_selectedWidgets.size() > 0) { /* Change the custom menu to the last selected widget's menu */ VCWidget* latestWidget = m_selectedWidgets.last(); m_customMenu = latestWidget->customMenu(m_editMenu); if (m_customMenu != NULL) m_editMenu->addMenu(m_customMenu); } else { /* Change the custom menu to the bottom frame's menu */ Q_ASSERT(contents() != NULL); m_customMenu = contents()->customMenu(m_editMenu); if (m_customMenu != NULL) m_editMenu->addMenu(m_customMenu); } }
AutoChamada::AutoChamada(Wt::Dbo::Session& dbSession, std::vector<std::pair<Wt::WCheckBox*, Wt::Dbo::ptr<SiconfModel::Aluno>>> list) : Wt::WDialog(), _dbSession(dbSession), _list(list), index(0){ Wt::Dbo::Transaction transaction(_dbSession); _presente = new Wt::WPushButton("Presente", footer()); _ausente = new Wt::WPushButton("Ausente", footer()); _anterior = new Wt::WPushButton("Anterior", footer()); _cancelar = new Wt::WPushButton("Cancelar", footer()); new Wt::WText("<h3>Chamada Automatica</h3>", titleBar()); titleBar()->setContentAlignment(Wt::AlignCenter); contents()->setContentAlignment(Wt::AlignCenter); footer()->setContentAlignment(Wt::AlignCenter); _presente->clicked().connect(this, &AutoChamada::_presenteClicked); _ausente->clicked().connect(this, &AutoChamada::_ausenteClicked); _anterior->clicked().connect(this, &AutoChamada::_anteriorClicked); _cancelar->clicked().connect(this, &AutoChamada::_cancelClicked); _presente->setStyleClass("btn-success"); _ausente->setStyleClass("btn-warning"); _anterior->setStyleClass("btn-primary"); _cancelar->setStyleClass("btn-danger"); rejectWhenEscapePressed(); auto aluno = _list.begin()->second->usuario(); _name = new Wt::WText("<h4>" + aluno->nome() + " " + aluno->sobrenome() + "</h4>", contents()); setWidth(Wt::WLength("30%")); show(); }
void KateSyntaxTest::testSyntaxHighlighting_data() { QTest::addColumn<QString>("hlTestCase"); /** * check for directories, one dir == one hl */ const QString testDir(QLatin1String(TEST_DATA_DIR) + QLatin1String("/syntax/")); QDirIterator contents(testDir); while (contents.hasNext()) { const QString hlDir = contents.next(); const QFileInfo info(hlDir); if (!info.isDir() || hlDir.contains(QLatin1Char('.'))) { continue; } /** * now: get the tests per hl */ QDirIterator contents(hlDir); while (contents.hasNext()) { const QString hlTestCase = contents.next(); const QFileInfo info(hlTestCase); if (!info.isFile()) { continue; } QTest::newRow(info.absoluteFilePath().toLocal8Bit().constData()) << info.absoluteFilePath(); } } }
void ScrollView::resize(float newwidth, float newheight) { float scrollBarWidth = scrollBar().getComponent()->getWidth(); scrollBar().getComponent()->resize(scrollBarWidth, newheight); scrollBar().setPos(Vector2(newwidth - scrollBarWidth, 0)); float scrollarea = 0; if(contents().getComponent() != 0) { Component* component = contents().getComponent(); if(component->getFlags() & FLAG_RESIZABLE) component->resize(newwidth - scrollBarWidth, newheight); contents().setClipRect( Rect2D(0, 0, newwidth - scrollBarWidth, newheight)); scrollarea = component->getHeight() - newheight; if(scrollarea < 0) scrollarea = 0; } ScrollBar* scrollBarComponent = (ScrollBar*) scrollBar().getComponent(); scrollBarComponent->setRange(0, scrollarea); scrollBarComponent->setValue(0); width = newwidth; height = newheight; setDirty(); }
void ScrollView::replaceContents(Component* component) { resetChild(contents(), component); contents().setPos(Vector2(0, 0)); resize(width, height); }
void ScrollView::event(const Event& event) { if(event.type == Event::MOUSEBUTTONDOWN && (event.mousebutton == SDL_BUTTON_WHEELUP || event.mousebutton == SDL_BUTTON_WHEELDOWN)) { if(!event.inside) return; ScrollBar* scrollBarComp = dynamic_cast<ScrollBar*> (scrollBar().getComponent()); if(scrollBarComp == 0) { #ifdef DEBUG assert(false); #endif return; } float val = - contents().getPos().y; if(event.mousebutton == SDL_BUTTON_WHEELUP) { val -= MOUSEWHEELSCROLL; if(val < 0) val = 0; } else { val += MOUSEWHEELSCROLL; if(val > scrollBarComp->getRangeMax()) val = scrollBarComp->getRangeMax(); } contents().setPos(Vector2(0, -val)); scrollBarComp->setValue(val); setDirty(); } Component::event(event); }
jint ByteChannel::read(jobject destination) { const ByteBuffer::ClassImpl& bufimpl = ByteBuffer::impl(m_env); const jint remaining = get_remaining(m_env, destination, bufimpl.m_mid_get_remaining); if (!remaining) { // No space in the buffer; don't try to read anything. return 0; } const jint position = get_position(m_env, destination, bufimpl.m_mid_get_position); jint bytes_read = 0; void* data = m_env.GetDirectBufferAddress(destination); if (data) { data = static_cast<char*>(data) + position; bytes_read = m_reader(m_env, data, remaining); } else { // It was not a direct buffer ... see if it has an array. jbyteArray raw_array = get_array(m_env, destination, bufimpl.m_mid_has_array, bufimpl.m_mid_get_array); if (raw_array) { const jint array_offset = get_array_offset( m_env, destination, bufimpl.m_mid_get_array_offset); ByteArray array(m_env, raw_array); ByteArray::MutableContents contents(array); data = contents.data(); data = static_cast<char*>(data) + position + array_offset; bytes_read = m_reader(m_env, data, remaining); } } if (data) { if (bytes_read > 0) set_position(m_env, destination, bufimpl.m_mid_set_position, position + bytes_read); return bytes_read; } // No accessible array, either. Oh well. Create a byte array and // push it into the buffer. ByteArray array(m_env, remaining); ByteArray::MutableContents contents(array); bytes_read = m_reader(m_env, contents.data(), contents.length()); if (bytes_read > 0) put_bytearray(m_env, destination, bufimpl.m_mid_put_bytearray, array, bytes_read); return bytes_read; }
jint ByteChannel::write(jobject source) { const ByteBuffer::ClassImpl& bufimpl = ByteBuffer::impl(m_env); const jint remaining = get_remaining(m_env, source, bufimpl.m_mid_get_remaining); if (!remaining) { // No data in the buffer; don't try to write anything. return 0; } const jint position = get_position(m_env, source, bufimpl.m_mid_get_position); jint bytes_written = 0; const void* data = m_env.GetDirectBufferAddress(source); if (data) { data = static_cast<const char*>(data) + position; bytes_written = m_writer(m_env, data, remaining); } else { // It was not a direct buffer ... see if it has an array. jbyteArray raw_array = get_array(m_env, source, bufimpl.m_mid_has_array, bufimpl.m_mid_get_array); if (raw_array) { const jint array_offset = get_array_offset( m_env, source, bufimpl.m_mid_get_array_offset); const ByteArray array(m_env, raw_array); ByteArray::Contents contents(array); data = contents.data(); data = static_cast<const char*>(data) + position + array_offset; bytes_written = m_writer(m_env, data, remaining); } } if (data) { if (bytes_written > 0) set_position(m_env, source, bufimpl.m_mid_set_position, position + bytes_written); return bytes_written; } // No accessible array, either. Oh well. Get an array from the // buffer and read data from that. ByteArray array(m_env, remaining); get_bytearray(m_env, source, bufimpl.m_mid_get_bytearray, array); ByteArray::Contents contents(array); bytes_written = m_writer(m_env, contents.data(), contents.length()); return bytes_written; }
void Teuchos::updateParametersFromYamlFileAndBroadcast( const std::string &yamlFileName, const Teuchos::Ptr<Teuchos::ParameterList> ¶mList, const Teuchos::Comm<int> &comm, bool overwrite) { struct SafeFile { SafeFile(const char* fname, const char* options) { handle = fopen(fname, options); } ~SafeFile() { if(handle) fclose(handle); } FILE* handle; }; //BMK note: see teuchos/comm/src/Teuchos_XMLParameterListHelpers.cpp if(comm.getSize() == 1) { updateParametersFromYamlFile(yamlFileName, paramList); } else { if(comm.getRank() == 0) { //BMK: TODO! //reader.setAllowsDuplicateSublists(false); //create a string and load file contents into it //C way for readability and speed, same thing with C++ streams is slow & ugly SafeFile yamlFile(yamlFileName.c_str(), "rb"); if(!yamlFile.handle) { throw std::runtime_error(std::string("Failed to open YAML file \"") + yamlFileName + "\"for reading."); } fseek(yamlFile.handle, 0, SEEK_END); int strsize = ftell(yamlFile.handle) + 1; rewind(yamlFile.handle); //Make the array raii Teuchos::ArrayRCP<char> contents(new char[strsize], 0, strsize, true); fread((void*) contents.get(), strsize - 1, 1, yamlFile.handle); contents.get()[strsize - 1] = 0; Teuchos::broadcast<int, int>(comm, 0, &strsize); Teuchos::broadcast<int, char>(comm, 0, strsize, contents.get()); updateParametersFromYamlCString(contents.get(), paramList, overwrite); } else { int strsize; Teuchos::broadcast<int, int>(comm, 0, &strsize); Teuchos::ArrayRCP<char> contents(new char[strsize], 0, strsize, true); Teuchos::broadcast<int, char>(comm, 0, strsize, contents.get()); updateParametersFromYamlCString(contents.get(), paramList, overwrite); } } }
AddFriendDialog(RsPeers *mp) : mPeers(mp) { Wt::WVBoxLayout *layout = new Wt::WVBoxLayout ; contents()->setLayout(layout) ; // add a text box to paste the certificate into _cert_area = new Wt::WTextArea(contents()) ; _cert_area->setEmptyText("Paste a Retroshare certificate here to make friend with someone.") ; _cert_area->setMinimumSize(560,300) ; layout->addWidget(_cert_area,1) ; _cert_area->changed().connect(this,&AddFriendDialog::updateCertInfo) ; // add a text label to display the info Wt::WString str ; str += "Not a valid certificate<br/>" ; str += "<b>Name</b> \t\t: <br/>" ; str += "<b>PGP id</b> \t\t: <br/>" ; str += "<b>PGP fingerprint</b> \t: <br/>" ; str += "<b>Location name </b> \t: <br/>" ; str += "<b>Location ID </b> \t: <br/>" ; _info_label = new Wt::WLabel(str,contents()) ; _info_label->setMinimumSize(128,0) ; layout->addWidget(_info_label) ; // add buttons 'make friend', 'only add to keyring', 'cancel' Wt::WHBoxLayout *lay2 = new Wt::WHBoxLayout; _ok_bnt = new Wt::WPushButton("Make friend", contents()); lay2->addWidget(_ok_bnt) ; _ok_bnt->clicked().connect(this, &AddFriendDialog::makeFriend); _ok_bnt->setEnabled(false) ; Wt::WPushButton *cn_bnt = new Wt::WPushButton("Cancel", contents()); lay2->addWidget(cn_bnt) ; cn_bnt->clicked().connect(this, &Wt::WDialog::reject); lay2->addStretch() ; layout->addLayout(lay2) ; layout->addSpacing(0); _timer = new Wt::WTimer(this) ; _timer->setInterval(1000) ; _timer->timeout().connect(this,&AddFriendDialog::updateCertInfo) ; _timer->start() ; setMinimumSize(620,300) ; //resize() ; }
void WMessageBox::create() { iconW_ = new WIcon(contents()); text_ = new WText(contents()); contents()->addStyleClass("Wt-msgbox-body"); buttonMapper_ = new WSignalMapper<StandardButton>(this); buttonMapper_->mapped().connect(this, &WMessageBox::onButtonClick); rejectWhenEscapePressed(); finished().connect(this, &WMessageBox::onFinished); }
void WMessageBox::create() { std::unique_ptr<WIcon> icon(iconW_ = new WIcon()); contents()->addWidget(std::move(icon)); std::unique_ptr<WText> text(text_ = new WText()); contents()->addWidget(std::move(text)); contents()->addStyleClass("Wt-msgbox-body"); rejectWhenEscapePressed(); finished().connect(this, &WMessageBox::onFinished); }
void VirtualConsole::slotEditProperties() { VCWidget* widget; Q_ASSERT(contents() != NULL); if (m_selectedWidgets.isEmpty() == true) widget = contents(); else widget = m_selectedWidgets.last(); if (widget != NULL) widget->editProperties(); }
void VirtualConsole::slotResetFont() { Q_ASSERT(contents() != NULL); if (m_selectedWidgets.isEmpty() == true) { contents()->resetFont(); } else { VCWidget* widget; foreach(widget, m_selectedWidgets) widget->resetFont(); } }
void M3UPlaylist::triggerTrackLoad() { //TODO make sure we've got all tracks first. if( m_tracksLoaded ) return; //check if file is local or remote if( m_url.isLocalFile() ) { QFile file( m_url.toLocalFile() ); if( !file.open( QIODevice::ReadOnly ) ) { error() << "cannot open file"; return; } QString contents( file.readAll() ); file.close(); QTextStream stream; stream.setString( &contents ); loadM3u( stream ); m_tracksLoaded = true; } else { The::playlistManager()->downloadPlaylist( m_url, PlaylistFilePtr( this ) ); } }
int main() { int len; // meh don't want it to start like decorations.txt // because it messes with tab completion char *data = contents( "./namesDecorations.bin", &len ); // get rid of the damn \n vim insists on adding... data[ len - 1 ] = '\0'; char *currName = data; while( 1 ) { // want \n after the last name too to // make loading the list easier printf( "%s\n", currName ); char *nextName = memnchr( currName, '\0', len ); if( *nextName == NULL ) { break; } currName = nextName; } return EXIT_SUCCESS; }
int main(int argc, char* argv[]) { CClass newclass; CBotDoc *botdoc; if (argc != 2) { std::cout << "Usage: "<<argv[0] << " <filename>" << std::endl; return 0; } std::ifstream in(argv[1]); std::cout << argv[1] << std::endl; if (!in.good()) { std::cout << "Oh no, error!" << std::endl; return 1; } std::string contents((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>()); str = contents; if(!newclass.InitInstance()) { std::cerr << "Initialization not complete!" << std::endl; return 1; } botdoc = new CBotDoc(str); // std::cout << "Hello CBot!" << std::endl << s; botdoc->OnRun(); delete botdoc; newclass.ExitInstance(); }
void ZCompressor::Deflate(uint8 level) { if( _iscompressed || (!size()) || level>9 ) return; char *buf; buf=new char[size()+8]; uint32 newsize=size(),oldsize=size(); reserve(size()+8); _compress((void*)buf, &newsize, (void*)contents(),size(),level); if(!newsize) return; resize(newsize); rpos(0); wpos(0); append(buf,newsize); delete [] buf; _iscompressed=true; _real_size=oldsize; }
void IndentTest::getTestData(const QString& indenter) { QTest::addColumn<QString>("testcase"); // make sure the indenters are valid QFile indenterFile(srcPath + "/../script/data/" + indenter + ".js"); if (!indenterFile.exists()) { QSKIP(qPrintable(QString(indenterFile.fileName() + " does not exist")), SkipAll); } QVERIFY(indenterFile.open(QFile::ReadOnly)); QScriptValue result = m_env->engine()->evaluate(indenterFile.readAll(), indenterFile.fileName()); QVERIFY2( !result.isError(), qPrintable(result.toString() + "\nat " + m_env->engine()->uncaughtExceptionBacktrace().join("\n")) ); const QString testDir( testDataPath + indenter + '/' ); if ( !QFile::exists(testDir) ) { QSKIP(qPrintable(QString(testDir + " does not exist")), SkipAll); } QDirIterator contents( testDir ); while ( contents.hasNext() ) { QString entry = contents.next(); if ( entry.endsWith('.') ) { continue; } QFileInfo info(entry); if ( !info.isDir() ) { continue; } QTest::newRow( info.baseName().toLocal8Bit() ) << info.absoluteFilePath(); } }
unsigned ShaderLibrary::loadShader(QString const& path, unsigned const mode) { unsigned shader(0); QFile file(path); if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { QString contents(file.readAll()); file.close(); QByteArray raw(contents.toLocal8Bit()); const char* c_str(raw.data()); shader = glCreateShader(mode); glShaderSource(shader, 1, &c_str, NULL); glCompileShader(shader); // Check if things compiled okay unsigned buflen(1000); GLsizei msgLength; char msg[buflen]; glGetShaderInfoLog(shader, buflen, &msgLength, msg); if (msgLength != 0) { QLOG_WARN() << "Failed to compile shader " << path; QLOG_WARN() << QString(msg); glDeleteShader(shader); // required? shader = 0; } } return shader; }
bool IdenticalCodeFolding::matchCandidates(FoldingCandidates& pCandidateList) { typedef std::multimap<uint32_t, size_t> ChecksumMap; ChecksumMap checksum_map; std::vector<std::string> contents(pCandidateList.size()); bool converged = true; for (size_t index = 0; index < pCandidateList.size(); ++index) { contents[index] = pCandidateList[index].getContentWithVariables( m_Backend, m_KeptSections); uint32_t checksum = ::crc32(0xFFFFFFFF, (const uint8_t*)contents[index].c_str(), contents[index].length()); size_t count = checksum_map.count(checksum); if (count == 0) { checksum_map.insert(std::make_pair(checksum, index)); } else { std::pair<ChecksumMap::iterator, ChecksumMap::iterator> ret = checksum_map.equal_range(checksum); for (ChecksumMap::iterator it = ret.first; it != ret.second; ++it) { size_t kept_index = (*it).second; if (contents[index].compare(contents[kept_index]) == 0) { m_KeptSections[pCandidateList[index].sect].second = kept_index; converged = false; break; } } } } return converged; }
int main(int argc, const char **argv) { if (argc < 2) { printf("no file name entered\n"); return 1; } if (argc > 2) printCFG = atoi(&argv[2][0]); if (argc > 3) funcToAnalyze = argv[3]; else funcToAnalyze = "main"; printf("Will analyze function %s\n", funcToAnalyze); // Read file contents into a char array std::ifstream in(argv[1]); std::string contents((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>()); // Interval package man = box_manager_alloc(); printf("******************************\n"); printf("Apron: Library %s, version %s\n", man->library, man->version); printf("******************************\n"); int ret = !clang::tooling::runToolOnCode(new ExampleFrontendAction, contents.c_str()); ap_manager_free(man); return ret; }
std::vector<uint8_t> decompress(std::string filename) { std::vector<uint8_t> contents(8); std::ifstream file(filename, std::ios_base::in | std::ios_base::binary); std::string start(8, ' '); file.read(&start[0], 8); if (boost::starts_with(start, "CWS") == false) { return std::vector<uint8_t>(0); } contents[0] = 'F'; std::copy(start.begin() + 1, start.end(), contents.begin() + 1); file.seekg(8, std::ios::beg); boost::iostreams::filtering_streambuf<boost::iostreams::input> in; in.push(boost::iostreams::zlib_decompressor()); in.push(file); boost::iostreams::copy(in, std::back_inserter(contents)); file.close(); return contents; }
void TestDds::testWriteImage() { QFETCH(QString, fileName); QFETCH(QSize, size); const QString path = fileName + QStringLiteral(".dds"); const QString sourcePath = QStringLiteral(":/data/") + fileName + QStringLiteral(".png"); QImage image(sourcePath); QVERIFY(!image.isNull()); QVERIFY(image.size() == size); ImageIO writer(path, QStringLiteral("image/x-dds")); // QVERIFY2(writer.canWrite(), qPrintable(writer.errorString())); writer.setSubType(fileName.toLatin1()); ImageContents contents(image); const auto ok = writer.write(contents); QVERIFY2(ok, qPrintable(ok.toString())); ImageIO reader(path); // QVERIFY(reader.canRead()); const auto result = reader.read(); const auto &status = result.first; const auto &newContents = result.second; QVERIFY2(status, qPrintable(status.toString())); QCOMPARE(newContents.header().size(), size); QVERIFY(image == newContents.image()); }
void MainWindow::on_button_enter() { std::thread( [this](int dummy) { std::string query = m_entry.get_text(); m_entry.set_sensitive(false); m_entry.set_text("計算中です..."); CrTrimString(query); auto result = ChJustDoIt(query); ChFixResultForDisplay(result); std::string contents("にゅうりょく:"); contents += query; contents += '\n'; contents += result; contents += '\n'; add_output(contents); if (result.find("しゅうりょうします") != std::string::npos) { m_entry.set_text("終了中です..."); hide(); } m_entry.set_text(""); m_entry.set_sensitive(true); set_focus(m_entry); }, 0 ).detach(); }
void nodeWidget::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * ) { QString title( "Hello" ); QList <QString> properties; properties << "Thing" << "lalala" << "bouind" << "hahaha"; QRectF originalRect( titlebarRect( painter->font() ) ); _titlePath = QPainterPath(); _titlePath.addRect( originalRect ); QRectF titleRect( originalRect ); titleRect.setHeight( titleRect.height() + ( ROUNDRADIUS * 2 + 1 ) ); QRectF contentsRect( titleRect ); contentsRect.setY( originalRect.height() ); contentsRect.setHeight( originalRect.height() + NODEPROPERTYHEIGHT*( properties.size() - 1 ) - 2*ROUNDRADIUS - 4 ); QPainterPath titleBar( makeRoundedPath( titleRect ) ); QPainterPath contents( makeRoundedPath( contentsRect ) ); QPen outlinePen( Qt::black, 3 ); if( isSelected() ) { outlinePen.setColor( SELECTED_COLOUR ); } QPainterPath globalLine( makeRoundedPath( titleRect.unite( contentsRect ) ) ); painter->setPen( outlinePen ); painter->drawPath( globalLine ); painter->fillPath( titleBar, titleGradient( titleRect ) ); painter->fillPath( contents, contentsBrush( contentsRect ) ); QColor separatingLineColor( Qt::black ); if( isSelected() ) { separatingLineColor = SELECTED_COLOUR; } separatingLineColor.setAlpha( 128 ); QPen separatingLinePen( separatingLineColor ); QPen whitePen( Qt::white ); painter->setPen( whitePen ); painter->drawText( originalRect, Qt::AlignCenter, title ); QRectF textRect( titleRect ); textRect.moveTop( textRect.top() + originalRect.height() - 2*ROUNDRADIUS - 2 ); FOREACH( properties, prop ) { painter->setPen( whitePen ); painter->drawText( textRect, Qt::AlignCenter, *prop ); if( &(*prop) != &(properties.back()) ) { painter->setPen( separatingLinePen ); painter->drawLine( titleRect.x(), textRect.y()+NODEPROPERTYHEIGHT+4, titleRect.x()+titleRect.width(), textRect.y()+NODEPROPERTYHEIGHT+4 ); } textRect.moveTop( textRect.top() + NODEPROPERTYHEIGHT ); }