public static void main(String args[]) {
    QApplication.initialize(args);
    String localName = "myName";
    QIODevice device;
    {
      QXmlItem value = new QXmlItem();
      QXmlQuery query = new QXmlQuery();
      // ! [0]
      query.bindVariable(new QXmlName(query.namePool(), localName), value);
      // ! [0]
    }

    // ! [1]
    QByteArray myDocument = new QByteArray();
    QBuffer buffer = new QBuffer(myDocument); // This is a QIODevice.
    buffer.open(QIODevice.OpenModeFlag.ReadOnly);
    QXmlQuery query = new QXmlQuery();
    query.bindVariable("myDocument", buffer);
    query.setQuery("declare variable $myDocument external; doc($myDocument)");
    // ! [1]

    // ! [2]
    query.bindVariable(new QXmlName(query.namePool(), localName), device);
    // ! [2]

  }
Esempio n. 2
0
  public static void main(String args[]) {
    QApplication.initialize(args);

    GlassPane pane = new GlassPane();
    pane.show();

    QApplication.execStatic();
    QApplication.shutdown();
  }
    public static void main(String args[]) {
        QApplication.initialize(args);
//! [0]
    QTestEventList events;
    events.addKeyClick('a');
    events.addKeyClick(Qt.Key_Backspace);
    events.addDelay(200);

    QLineEdit ineEdit = new QLineEdit(myParent);
    ...
  public static void main(String args[]) {
    QApplication.initialize(args);

    OpenGLInGraphicsView widget1 = new OpenGLInGraphicsView(true);
    widget1.show();

    OpenGLInGraphicsView widget2 = new OpenGLInGraphicsView(false);
    widget2.show();

    QApplication.execStatic();
    QApplication.shutdown();
  }
  public static void main(String args[]) {
    QApplication.initialize(args);
    // ! [0]
    QNetworkProxy proxy;
    proxy.setType(QNetworkProxy.Socks5Proxy);
    proxy.setHostName("proxy.example.com");
    proxy.setPort(1080);
    proxy.setUser("username");
    proxy.setPassword("password");
    QNetworkProxy.setApplicationProxy(proxy);
    // ! [0]

    // ! [1]
    serverSocket.setProxy(QNetworkProxy.NoProxy);
    // ! [1]

  }
  public static void main(String args[]) {
    QApplication.initialize(args);
    // ! [0]
    QXmlQuery query = new QXmlQuery();
    query.setQuery("<e/>, 1, 'two'");
    QXmlResultItems result = new QXmlResultItems();

    if (query.isValid()) {
      query.evaluateToResult(result);
      QXmlItem item = result.next();
      while (!item.isNull()) {
        // Use item
        item = result.next();
      }

      if (result.hasError()) throw new RuntimeException("Runtime error!");
    }
    // ! [0]
  }
 public static void main(String args[]) {
   QApplication.initialize(args);
 }