[Kde-bindings] [Bug 279931] Qyoto has severely broken QFile class

Arno Rehn arno at arnorehn.de
Fri Aug 12 15:35:24 UTC 2011


https://bugs.kde.org/show_bug.cgi?id=279931


Arno Rehn <arno at arnorehn.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |arno at arnorehn.de
         Resolution|                            |INVALID




--- Comment #1 from Arno Rehn <arno arnorehn de>  2011-08-12 15:35:24 ---
It works exactly as it's supposed to.

First, the QFile constructor does NOT open the file for you. (I wonder where
you got that from, certainly it doesn't say so in the Qt docs).

Second, you're doing it wrong. See the following snippet to learn how to do it
the right way:


using System;
using Qyoto;

class MainClass {
    public static void Main(string[] args) {
        new QCoreApplication(args);  // just for Qyoto initialization

        QFile file = new QFile("hello.txt");
        file.Open((uint) QIODevice.OpenModeFlag.WriteOnly);

        QTextStream stream = new QTextStream(file);
        stream.Write("Hello World!");

        file.Close();
    }
}

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kde-bindings mailing list