Created
May 15, 2011 12:42
-
-
Save codeyash/973115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mainwindow.h" | |
#include "ui_mainwindow.h" | |
MainWindow::MainWindow(QWidget *parent) : | |
QMainWindow(parent), | |
ui(new Ui::MainWindow) | |
{ | |
ui->setupUi(this); | |
QString source="34895pc"; | |
QString value,unit; | |
//seperateValueUnit(source); | |
qDebug () << value << unit; | |
} | |
MainWindow::~MainWindow() | |
{ | |
delete ui; | |
} | |
QStringList MainWindow::seperateValueUnit(QString source){ | |
QRegExp rx("(\\d+)(\\s*)(px|pt|in|cm|mm|pc|em|ex|%)*"); | |
rx.indexIn(source); | |
QStringList list = rx.capturedTexts(); | |
return list; | |
// qDebug() <<list.at (1) << list.at (3); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment