daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest Dec 16th, 2018 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class SomeClass : public QObject
  2. {
  3.     Q_OBJECT
  4. public:
  5.     QHash *parameterTable;
  6.     explicit ExCurrentSession(QObject *parent = nullptr);
  7. };
  8.  
  9. SomeClass::SomeClass (QObject *parent) : QObject(parent)
  10. {
  11.     parameterTable = new QHash;//used dynamic creation
  12.     QFile file("someFile.txt");//Creating an object on the stack
  13.     if (!file.open(QIODevice::ReadOnly|QIODevice::WriteOnly))
  14.     QTextStream fileSream(&file);//Creating an object on the stack
  15.     QString buff = fileSream.readLine();//Creating an object on the stack
  16.     //...Other code to set the QHash table with a parameter and a value from a file...
  17. }
  18.    
  19. SomeClass::SomeClass(QObject *parent) : QObject(parent)
  20. {
  21.     parameterTable = new QHash;//used dynamic creation
  22.     QFile *file = new QFile("someFile.txt");//Creating an object on the stack
  23.     if (!file->open(QIODevice::ReadOnly|QIODevice::WriteOnly))
  24.     QTextStream *fileSream = new QTextStream(file);//Creating an object on the stack
  25.     QString *buff = fileSream->readLine();//Creating an object on the stack
  26.     //...Other code to set the QHash table with a parameter and a value from a file...
  27.     delete file;
  28.     delete fileSream;
  29.     delete buff;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top