Qt Jambi Home

com.trolltech.qt
Class QtJambiObject

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
All Implemented Interfaces:
QtJambiInterface
Direct Known Subclasses:
QAbstractFileEngine, QAbstractFileEngineHandler, QAbstractFileEngineIterator, QAbstractGraphicsShapeItem, QAbstractTextDocumentLayout_PaintContext, QAbstractTextDocumentLayout_Selection, QAccessible, QAccessible2Interface, QAccessibleBridge, QAuthenticator, QBasicTimer, QBitArray, QBrush, QByteArray, QByteArrayMatcher, QColor, QColormap, QCryptographicHash, QCursor, QDataStream, QDate, QDateTime, QDesktopServices, QDir, QDirIterator, QDomImplementation, QDomNamedNodeMap, QDomNode, QDomNodeList, QEvent, QFileIconProvider, QFileInfo, QFont, QFontDatabase, QFontInfo, QFontMetrics, QFontMetricsF, QGLColormap, QGLContext, QGLFormat, QGLFramebufferObject, QGLPixelBuffer, QGradient, QGraphicsItem, QGraphicsItemGroup, QGraphicsLineItem, QGraphicsPixmapItem, QHostAddress, QHostInfo, QHttpHeader, QIcon, QIconEngine, QImage, QImageIOHandler, QImageReader, QImageWriter, QInputContextFactory, QInputMethodEvent_Attribute, QIPv6Address, QItemEditorCreatorBase, QItemEditorFactory, QItemSelection, QItemSelectionRange, QKeySequence, QLayoutItem, QLibraryInfo, QLine, QLineF, QListWidgetItem, QLocale, QMatrix, QMutex, QNetworkAddressEntry, QNetworkInterface, QNetworkProxy, QObject, QPaintDevice, QPaintEngine, QPaintEngineState, QPainter, QPainterPath, QPainterPath_Element, QPainterPathStroker, QPalette, QPen, QPersistentModelIndex, QPicture, QPictureIO, QPixmap, QPixmapCache, QPoint, QPointF, QPolygon, QPolygonF, QPrintEngine, QPrinter, QReadWriteLock, QRect, QRectF, QRegExp, QRegion, QSemaphore, QSize, QSizeF, QSizePolicy, QSpacerItem, QSqlDatabase, QSqlDriverCreatorBase, QSqlError, QSqlField, QSqlQuery, QSqlRecord, QSqlRelation, QSqlResult, QStandardItem, QStringMatcher, QStyleFactory, QStyleHintReturn, QStyleOption, QSystemLocale, QTableWidgetItem, QTableWidgetSelectionRange, QTextBlock, QTextBlock_iterator, QTextBlockUserData, QTextCodec, QTextCodec_ConverterState, QTextCursor, QTextDecoder, QTextDocumentFragment, QTextEdit_ExtraSelection, QTextEncoder, QTextFormat, QTextFragment, QTextFrame_iterator, QTextInlineObject, QTextItem, QTextLayout, QTextLayout_FormatRange, QTextLength, QTextLine, QTextObjectInterface, QTextOption, QTextStream, QTextTableCell, QTime, QToolTip, QTransform, QTreeWidgetItem, QTreeWidgetItemIterator, QUndoCommand, QUrl, QUrlInfo, QUuid, QVariant, QWaitCondition, QWhatsThis, QWidgetItem, QXmlAttributes, QXmlContentHandler, QXmlDeclHandler, QXmlDefaultHandler, QXmlDTDHandler, QXmlEntityResolver, QXmlErrorHandler, QXmlInputSource, QXmlLexicalHandler, QXmlLocator, QXmlNamespaceSupport, QXmlParseException, QXmlReader, QXmlStreamAttribute, QXmlStreamAttributes, QXmlStreamEntityDeclaration, QXmlStreamNamespaceDeclaration, QXmlStreamNotationDeclaration, QXmlStreamReader, QXmlStreamWriter

public abstract class QtJambiObject
extends QSignalEmitter
implements QtJambiInterface

The super class of all class types in Qt Jambi. Loading this class or any of its subclasses will imply a dependency on both the Qt Jambi library and the Qt libraries.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
QtJambiObject()
          Creates a new QtJambiObject.
 
Method Summary
 void dispose()
          Explicitly removes the native resources held by the object.
protected  void disposed()
          Called either as the native resources that belong to the object are being cleaned up or directly before the object is finalized.
protected  void finalize()
          Called before the java object is removed by the garbage collector.
static QtJambiObject reassignNativeResources(QtJambiObject object, java.lang.Class<? extends QtJambiObject> clazz)
          In certain, uncommon cases, the native resources of a QtJambiObject object may be out of sync with its class.
 java.lang.String tr(java.lang.String source)
          Returns a translated version of source, or source itself if there is no appropriate translated version.
 java.lang.String tr(java.lang.String source, java.lang.String comment)
          Returns a translated version of source, or source itself if there is no appropriate translated version.
 java.lang.String tr(java.lang.String source, java.lang.String comment, int count)
          Returns a translated version of source, or source itself if there is no appropriate translated version.
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QtJambiObject

public QtJambiObject()
Creates a new QtJambiObject.

Method Detail

disposed

protected void disposed()
Called either as the native resources that belong to the object are being cleaned up or directly before the object is finalized. Reimplement this function to do clean up when the object is destroyed. The function will never be called more than once per object, and the object is guaranteed to be unusable after this function has returned. The default implementation does nothing.


tr

public java.lang.String tr(java.lang.String source)
Returns a translated version of source, or source itself if there is no appropriate translated version.

Parameters:
source - the source text to translate.
Returns:
translated version of the source text.

tr

public java.lang.String tr(java.lang.String source,
                           java.lang.String comment)
Returns a translated version of source, or source itself if there is no appropriate translated version. The comment is used to help translators translate the source text.

Parameters:
source - the source text to translate.
comment - helps the translator translate the source text.
Returns:
translated version of the source text.

tr

public java.lang.String tr(java.lang.String source,
                           java.lang.String comment,
                           int count)
Returns a translated version of source, or source itself if there is no appropriate translated version. If %n occurs in the source text, it will be substituted with count. The comment is used to help translators translate the source text.

Parameters:
source - the source text to translate.
comment - helps the translator translate the source text.
count - in source %n will be substituted by count.
Returns:
translated version of the source text.

finalize

protected final void finalize()
Called before the java object is removed by the garbage collector. As the native resources belonging to an object may be cleaned up prior to the call of this function, it has been set as final. Reimplement disposed() instead, which will be called either as the native resources are being removed or just before the object is finalized, whichever happens first.

Overrides:
finalize in class java.lang.Object

dispose

public final void dispose()
Explicitly removes the native resources held by the object. Note that though this method does not guarantee that the object will be garbage collected, it is not safe to reference the object after it has been disposed.


reassignNativeResources

public static QtJambiObject reassignNativeResources(QtJambiObject object,
                                                    java.lang.Class<? extends QtJambiObject> clazz)
                                             throws java.lang.InstantiationException
In certain, uncommon cases, the native resources of a QtJambiObject object may be out of sync with its class. In such cases this method can be used to reassign the native resources to an object of another class. Take special care when using this method, as it has limited type safety and may cause crashes when used in the wrong way. Note also that as the returned object "steals" the native resources held by the original object, the original object will not be usable after a call to this function. Invoking a method on the original object may result in an exception being raised. If an exception is raised, it is safe to assume that the original object is still valid. If the object is already of the type specified by clazz, then a reference to the object itself is returned.

Parameters:
object - The original object which holds the native resources. This object will be considered unusable after the call.
clazz - The class of the new object. The class must be a subclass of QtJambiObject and you must not rely on any constructors being invoked upon construction of the object.
Returns:
An object of the specified type which owns the resources previously held by object.
Throws:
java.lang.ClassCastException - If the class of object is unrelated to clazz, or if clazz is an unsupported class type.
java.lang.InstantiationException - If clazz cannot be instantiated

Qt Jambi Home