QTfrontend/ui/widget/selectWeapon.cpp
changeset 14839 e239378a9400
parent 14836 b9437746bffb
child 15542 3b0b6ce76303
equal deleted inserted replaced
14837:5443e5e0faa3 14839:e239378a9400
    29 #include <QBitmap>
    29 #include <QBitmap>
    30 #include <QLineEdit>
    30 #include <QLineEdit>
    31 #include <QSettings>
    31 #include <QSettings>
    32 #include <QMessageBox>
    32 #include <QMessageBox>
    33 #include <QTabWidget>
    33 #include <QTabWidget>
       
    34 #include <QRegExp>
       
    35 #include <QRegExpValidator>
       
    36 
    34 #include <math.h>
    37 #include <math.h>
    35 
    38 
    36 QImage getAmmoImage(int num)
    39 QImage getAmmoImage(int num)
    37 {
    40 {
    38     static QImage ammo(":Ammos.png");
    41     static QImage ammo(":Ammos.png");
   203         ++k;
   206         ++k;
   204     }
   207     }
   205 
   208 
   206     //pLayout->setRowStretch(5, 100);
   209     //pLayout->setRowStretch(5, 100);
   207     m_name = new QLineEdit(this);
   210     m_name = new QLineEdit(this);
       
   211     QRegExp rx(*cSafeFileNameRegExp);
       
   212     QRegExpValidator* val = new QRegExpValidator(rx, m_name);
       
   213     m_name->setValidator(val);
   208     pageLayout->addWidget(m_name, i, 0, 1, 5);
   214     pageLayout->addWidget(m_name, i, 0, 1, 5);
   209 }
   215 }
   210 
   216 
   211 void SelWeaponWidget::setWeapons(const QString& ammo)
   217 void SelWeaponWidget::setWeapons(const QString& ammo)
   212 {
   218 {