QPixmap Util::getKRegExpEditorIcon( const QString& name ) { #ifdef QT_ONLY QPixmap pix; pix.convertFromImage( qembed_findImage(name) ); return pix; #else return KGlobal::iconLoader()->loadIcon(locate("data", QString::fromLatin1("kregexpeditor/pics/") +name ), KIcon::Toolbar ); #endif }
KACLListView::KACLListView(QWidget *parent, const char *name) : KListView(parent, name), m_hasMask(false), m_allowDefaults(false) { // Add the columns addColumn(i18n("Type")); addColumn(i18n("Name")); addColumn(i18n("read permission", "r")); addColumn(i18n("write permission", "w")); addColumn(i18n("execute permission", "x")); addColumn(i18n("Effective")); header()->setClickEnabled(false); // Load the avatars for(int i = 0; i < LAST_IDX; ++i) { s_itemAttributes[i].pixmap = new QPixmap(qembed_findImage(s_itemAttributes[i].pixmapName)); } m_yesPixmap = new QPixmap(qembed_findImage("yes")); m_yesPartialPixmap = new QPixmap(qembed_findImage("yespartial")); setSelectionMode(QListView::Extended); // fill the lists of all legal users and groups struct passwd *user = 0; setpwent(); while((user = getpwent()) != 0) { m_allUsers << QString::fromLatin1(user->pw_name); } endpwent(); struct group *gr = 0; setgrent(); while((gr = getgrent()) != 0) { m_allGroups << QString::fromLatin1(gr->gr_name); } endgrent(); m_allUsers.sort(); m_allGroups.sort(); }
QIconSet Util::getSystemIconSet( const QString& name ) { #ifdef QT_ONLY QPixmap pix; pix.convertFromImage( qembed_findImage( name ) ); return QIconSet( pix ); #else KIconLoader loader; return loader.loadIconSet( name, KIcon::Toolbar); #endif }
static QImage load_image(const QString &name) { QImage img; #ifndef LIBQPE_NO_INLINE_IMAGES img = qembed_findImage(name.latin1()); #endif if ( img.isNull() ) { // No inlined image, try file QString f = Resource::findPixmap(name); if ( !f.isEmpty() ) img.load(f); } return img; }
// ============================================================================ // T E X T U R E S // ============================================================================ Texture::Texture(QString name, int _sample) { // load texture from disk or embeded #if 0 texture= new QImage(qembed_findImage(name)); #else texture= new QImage("/home/jcl/text1.png"); #endif if (name) {;} // remove compiler warning sample = _sample; // number of samples for the texture tex_alpha = new TexAlpha[sample]; // allocate array to store textures's alpha channel; // initialyse texture for (int i=0; i<sample; i++) { tex_alpha[i].init(texture,i+1); } //tex_alpha[50].print(); }
QPixmap calGetPixmap(const QString& filename) { return QPixmap(qembed_findImage(filename.latin1())); } // !calGetPixmap()
QImage calGetImage(const QString& filename) { return qembed_findImage(filename.latin1()); } // !calGetImage()