Integer to any base QString

This function takes an integer and returns a QString with the representation in any base < 16.

It uses the val2hex function from previous post:
.....................................................................................................
```c
QString val2hex( int d )
{
    QString Hex="0123456789ABCDEF";

    QString h = Hex.mid( d&15, 1 );

    while( d>15 )
    {
        d >>= 4;
        h = Hex.mid( d&15,1 ) + h;
    }
    return h;
}

QString decToBase( int value, int base, int digits )
{
    QString converted = "";

    for( int i=0; i= base ) converted = val2hex(value%base) + converted;
        else                converted = val2hex(value) + converted;

        value = floor( value/base );
    }
    return converted;
}
```
.....................................................................................................

Integer to Hex QString

This function takes an integer and returns a QString with the exadecimal representation:
.....................................................................................................
```c
QString val2hex( int d )
{
    QString Hex="0123456789ABCDEF";

    QString h = Hex.mid( d&15, 1 );

    while( d>15 )
    {
        d >>= 4;
        h = Hex.mid( d&15,1 ) + h;
    }
    return h;
}
```
.....................................................................................................

File to QString

Read a file and parse whole content to a QString:
.....................................................................................................
```c
QString fileToString( const QString &fileName, const QString &caller )
{
    QFile file( fileName );

    if( !file.open(QFile::ReadOnly | QFile::Text))
    {
        QMessageBox::warning( 0l, caller, 
                              "Cannot read file "
                              +fileName+":\n"
                              +file.errorString());
        return "";
    }

    QTextStream in( &file );
    QString text = in.readAll();
    file.close();

    return text;
}
```
.....................................................................................................

File to QStringList

Read a file and parse each line to a QStringList:

.....................................................................................................

```c
QStringList fileToStringList( const QString &fileName, const QString &caller )
{
    QStringList text;
    QFile file(fileName);

    if( !file.open( QFile::ReadOnly | QFile::Text) )
    {
        QMessageBox::warning( 0l, caller, 
                              "Cannot read file "
                              +fileName+":\n"
                              +file.errorString());
        return text;
    }

    QTextStream in( &file );
    while( !in.atEnd() ) text.append( in.readLine() );
    file.close();

    return text;
}
```

.....................................................................................................

Add entry to QListWidget and resize to content

Sometimes is useful resizing a QListWidget to the size of its content.
This is one way to do it.

Don't forget resizing again when you remove an item.

.....................................................................................................

```c
void addEntry( QString name, QListWidget* list )
{
    QListWidgetItem* item = new QListWidgetItem( name, list, 0 );
  
    QFont font;
    font.setPointSize(10);
    font.setWeight(70);
    item->setFont( font );

    item->setIcon( QIcon(":/icon.png") );
       
    int iconSize = 22;                       // I know icon size

    int size = list->count()*iconSize + 2;

    list->setFixedHeight( size );
}
```

.....................................................................................................

Fast linked list without list

If you need a very fast way to iterate over a list of objects and call the same method on all of them, then here is a posible solution. Der...