SoQtComponent(3)
πΈ NAME πΈ
SoQtComponent β hi bestie, welcome to the SoQtComponent(3) manual page! This class is literally the base class for all GUI components. Periodt. π
β¨ SYNOPSIS β¨
#include <Inventor/Qt/SoQtComponent.h>
- Inherits:
SoQtObjectπ«Ά - Inherited by:
SoQtGLWidgetπ
π Public Member Functions π
virtual SoType getTypeId (void) constβ type ID check, slay βvirtual ~SoQtComponent ()β destructor moment πvirtual void show (void)β show time β¨virtual void hide (void)β hide, bestie πvirtual void setComponentCursor (const SoQtCursor &cursor)β set that component cursor πSbBool isFullScreen (void) constβ fullscreen check, no capSbBool setFullScreen (const SbBool onoff)β set fullscreenonoffπ₯SbBool isVisible (void)β visibility check πSbBool isTopLevelShell (void) constβ top-level-shell check πQWidget * getWidget (void) constβ get that widget π«ΆQWidget * getBaseWidget (void) constβ get the base widget πΈQWidget * getShellWidget (void) constβ get the shell widget π¦QWidget * getParentWidget (void) constβ get the parent widget πvoid setSize (const SbVec2s size)β set the sizeSbVec2s getSize (void) constβ get the sizevoid setTitle (const char *const title)β set the title πconst char * getTitle (void) constβ get the titlevoid setIconTitle (const char *const title)β set the icon title πconst char * getIconTitle (void) constβ get the icon titleconst char * getWidgetName (void) constβ get the widget nameconst char * getClassName (void) constβ get the class namevoid setWindowCloseCallback (SoQtComponentCB *const func, void *const user=NULL)β set that window-close callback, withuser=NULLas the default π«Ά
π§ Public Member Functions inherited from SoQtObject π§
SbBool isOfType (SoType type) constβ type check vibes β¨
π Static Public Member Functions π
static void initClass (void)β init the classstatic SoType getClassTypeId (void)β get the class type IDstatic void setWidgetCursor (QWidget *w, const SoQtCursor &cursor)β set a widget cursor onwπ―static SoQtComponent * getComponent (QWidget *widget)β get the component for awidgetstatic void initClasses (void)β init the classes, plural, periodt π
π¦ Static Public Member Functions inherited from SoQtObject π¦
static void initClass (void)β init the classstatic SoType getClassTypeId (void)β get the class type IDstatic void init (void)β init
π Protected Member Functions π
SoQtComponent (QWidget *const parent=NULL, const char *const name=NULL, const SbBool embed=TRUE)β protected constructor energy π§virtual void afterRealizeHook (void)β the after-realize hookvoid setClassName (const char *const name)β set the class namevoid setBaseWidget (QWidget *widget)β set the base widgetvoid registerWidget (QWidget *widget)β register a widgetvoid unregisterWidget (QWidget *widget)β unregister a widgetvirtual const char * getDefaultWidgetName (void) constβ get the default widget namevirtual const char * getDefaultTitle (void) constβ get the default titlevirtual const char * getDefaultIconTitle (void) constβ get the default icon titlevirtual void sizeChanged (const SbVec2s &size)β size-changed hookvoid addVisibilityChangeCallback (SoQtComponentVisibilityCB *const func, void *const user=NULL)β add a visibility-change callback, withuser=NULLdefault πvoid removeVisibilityChangeCallback (SoQtComponentVisibilityCB *const func, void *const user=NULL)β remove a visibility-change callback, sameuser=NULLdefault π
π Detailed Description π
Okay so SoQtComponent is literally the base class for all GUI components. No cap.
Components in the SoQt component library all inherit this abstract base class. It provides basic methods for setting and querying about the relationship between the component object and its underlying Qt object(s). π«Ά
Application programmers lowkey should not need to interface any code against this class β unless they want to extend the SoQt library in entirely new directions. For making new viewer components, for instance, other classes further down the inheritance hierarchy would be better suited for subclassing. Periodt. π
Big vibe check: the relationship between all SoQtComponent derived classes and Qt widgets is one of "has-A", not "is-A" β i.e. SoQtComponent contains a QWidget*, it doesn't derive from or subclass it. That's the whole mood. π
π Constructor & Destructor Documentation π
π SoQtComponent::~SoQtComponent () [virtual] π
Destructor. That's it β it's the destructor. π
π§ SoQtComponent::SoQtComponent (QWidget *const parent = NULL, const char *const name = NULL, const SbBool embed = TRUE) [protected] π§
This is a protected constructor, used only by derived classes. π
The parent argument is the parent widget of the component. If you don't supply a parent, the main window (the one given to or returned from SoQt::init()) is used β and the embed argument is considered to be FALSE. π«Ά
The name argument is the name of the component. If you don't supply one, the name will default to something, depending on the inheritance hierarchy. β¨
The embed argument tells whether the component should be embedded in the parent widget or should create its own shell. This flag is only checked if the parent widget argument is specified (not NULL). π
If you create a non-embedded component, the component will create its own shell, which will be a top level shell type. If you embed the component, the component will create a form widget type widget inside the parent widget β and you can get the handle of that by calling SoQtComponent::getBaseWidget(). π
π Member Function Documentation π
okay bestie, this is the function-by-function tea β β every single member function, no skips, no cap. Let's get into it π
virtual SoType SoQtComponent::getTypeId (void ) const[virtual]β returns the type identification of an object derived from a class inheriting fromSoQtObject. This is used for runtime type checking and "downward" casting. ImplementsSoQtObject.
Usage example:
void foo(SoQtViewer * comp)
{
if (comp->getTypeId() == SoQtExaminerViewer::getClassTypeId()) {
// safe downward cast, knows the type
SoQtExaminerViewer * exviewer = (SoQtExaminerViewer *)comp;
}
else if (comp->getTypeId().isOfType(SoQtFlyViewer::getClassTypeId())) {
// safe downward cast, knows the type
SoQtFlyViewer * flyviewer = (SoQtFlyViewer *)comp;
// then something else
}
}
void SoQtComponent::show (void )[virtual]β this will show the widget, de-iconifying and raising it if necessary. See also:hide(),isVisible().
β οΈ this function must be called by subclasses after the component's widget has been otherwise initialized. no cap, it's important.
void SoQtComponent::hide (void )[virtual]β this will hide the widget. See also:show(),isVisible().void SoQtComponent::setComponentCursor (const SoQtCursor & cursor)[virtual]β sets the cursor for this component.
note: not part of the original SGI InventorXt API.
Reimplemented in SoQtFullViewer.
void SoQtComponent::setWidgetCursor (QWidget * w, const SoQtCursor & cursor)[static]β set cursor for a native widget in the underlying toolkit.
note: not part of the original SGI InventorXt API.
SbBool SoQtComponent::isFullScreen (void ) constβ returns whether this widget/component is in full screen mode or not.SbBool SoQtComponent::setFullScreen (const SbBool onoff)β toggle full screen mode for this component, if possible. ReturnsFALSEif operation failed. This might happen if the toolkit doesn't support attempts at making the component cover the complete screen or if the component is not a top level window.SbBool SoQtComponent::isVisible (void )β returns visibility status on the widget. If any parents of this widget or this widget itself is hidden, returnsFALSE. Note that a widget which is just obscured by other windows on the desktop is not hidden in this sense, andTRUEwill be returned. See also:show(),hide().SbBool SoQtComponent::isTopLevelShell (void ) constβ returnsTRUEif this component is a top level shell, i.e. it has a window representation on the desktop. See also:getShellWidget().QWidget * SoQtComponent::getWidget (void ) constβ returns a pointer to the component's window system widget. See also:getShellWidget(),getParentWidget().QWidget * SoQtComponent::getBaseWidget (void ) constβ anSoQtComponentmay be composed of any number of widgets in parent-children relationships in a tree structure with any depth. This method will return the root widget in that tree. See also:setBaseWidget().QWidget * SoQtComponent::getShellWidget (void ) constβ this method returns the shell widget of the component, but only if it was created as a top level shell.NULLwill be returned for embedded components. (The top level shell is the desktop window which contains the component.) To get the top level shell of embedded components, you can use theSoQt::getShellWidget()method. See also:isTopLevelShell(),getWidget().QWidget * SoQtComponent::getParentWidget (void ) constβ returns the widget which is the parent of (i.e. contains) this component's base widget. See also:getWidget(),baseWidget(),isTopLevelShell().void SoQtComponent::setSize (const SbVec2s size)β resize the component widget. The method assumes the caller knows what he is doing. See also:getSize().SbVec2s SoQtComponent::getSize (void ) constβ returns the component widget size. The size that is returned is a cached size value, not a value fetched from the GUI system. See also:setSize().void SoQtComponent::setTitle (const char *const title)β set the window title of this component. The title will appear on the window title bar, if the component manages its own window.
π note that there is one peculiarity to be aware of if you are using the non-commercial version of Qt: only window titles with the substring "Qt" in them are allowed (!), and attempts to set a window title without this substring will simply be ignored.
See also: getTitle(), setIconTitle(), isTopLevelShell().
const char * SoQtComponent::getTitle (void ) constβ returns the window title. If a title has been set, that title will be returned. If no title has been set, the default title is returned. See also:setTitle(),isTopLevelShell().void SoQtComponent::setIconTitle (const char *const title)β this method sets the title of the icon representation of the window. The title will appear on the window icon, if the component manages its own window. See also:getIconTitle(),setTitle(),isTopLevelShell().const char * SoQtComponent::getIconTitle (void ) constβ returns the title the window has when iconified. If an icon title has been set, that icon title is returned. If no icon title has been set, the default icon title is returned. See also:setIconTitle(),isTopLevelShell().const char * SoQtComponent::getWidgetName (void ) constβ returns name of the widget.const char * SoQtComponent::getClassName (void ) constβ returns class name of widget.void SoQtComponent::setWindowCloseCallback (SoQtComponentCB *const func, void *const data = NULL)β set up a callback function to use when the component gets closed. A component must be a top level shell for this to have any effect. For top level shells with no close callback set, the window will simply be hidden. The typical action to take in the callback would be to delete the component. See also:isTopLevelShell().SoQtComponent * SoQtComponent::getComponent (QWidget * widget)[static]β finds and returns theSoQtComponentcorresponding to the givenQWidget*, if any. If the widget does not seem to belong to anySoQtComponent,NULLwill be returned.void SoQtComponent::initClasses (void )[static]β this function initializes the type system for all the component classes. It is called indirectly for you when you callSoQt::init(). See also:SoQt::init(),SoQtDevice::initClasses().void SoQtComponent::afterRealizeHook (void )[protected],[virtual]β a function "hook" / callback invoked just after the window for the component has been realized. Override this if you need specific initialization for your own component or viewer class to happen right after it has been made visible, but remember to call upwards in the inheritance hierarchy:
void
MyLittleViewer::afterRealizeHook(void)
{
<superclass>::afterRealizeHook();
// [own initialization here]
}
Reimplemented in SoQtExaminerViewer, SoQtFlyViewer, SoQtPlaneViewer, and SoQtRenderArea.
void SoQtComponent::setClassName (const char *const name)[protected]β set class name of component. See also:getClassName(),componentClassName().void SoQtComponent::setBaseWidget (QWidget * widget)[protected]β set the core widget for thisSoQtcomponent. It is important that subclasses get this correct, as the widget set here will be the widget returned from query methods. See also:baseWidget().void SoQtComponent::registerWidget (QWidget * widget)[protected]β this method should be used by subclasses to register the widgets they set up from the underlying native toolkit, so they can be "reverse" mapped to the owner component. Subclasses failing to register the widgets they use will cause theSoQtComponent::getComponent()method to fail with those widgets. See also:unregisterWidget(),getComponent().void SoQtComponent::unregisterWidget (QWidget * widget)[protected]β remove a previously registered native toolkit widget from the widget-to-component mappings used bySoQtComponent::getComponent(). See also:registerWidget().const char * SoQtComponent::getDefaultWidgetName (void ) const[protected],[virtual]β this method returns the default name of a component widget class. It should be overridden by derived non-abstract classes for the topmost widget in the component to have a proper name. Reimplemented inSoQtExaminerViewer,SoQtFlyViewer,SoQtPlaneViewer, andSoQtRenderArea.const char * SoQtComponent::getDefaultTitle (void ) const[protected],[virtual]β this method returns the default window caption string of the component. It should be overridden by derived non-abstract classes so the window and pop-up menu will get a proper title. Reimplemented inSoQtExaminerViewer,SoQtFlyViewer,SoQtPlaneViewer, andSoQtRenderArea.const char * SoQtComponent::getDefaultIconTitle (void ) const[protected],[virtual]β this method returns the default icon title of the component. It should be overridden by derived non-abstract classes so icons will get proper titles. Reimplemented inSoQtExaminerViewer,SoQtFlyViewer,SoQtPlaneViewer, andSoQtRenderArea.void SoQtComponent::sizeChanged (const SbVec2s & size)[protected],[virtual]β called internally from within theSoQtlibrary when the widget embedded in a component changes its size, which is usually triggered by end-user interaction. This method is then invoked to notify the component that the size has changed. It is called from the top and all the way down to the bottom, the size being adjusted to take into account extra decorations having been added at each level in the component class hierarchy. Reimplemented inSoQtFullViewer,SoQtGLWidget,SoQtRenderArea, andSoQtViewer.void SoQtComponent::addVisibilityChangeCallback (SoQtComponentVisibilityCB *const func, void *const user = NULL)[protected]β add a callback which will be called whenever the widget component changes visibility status (because of iconification or deiconification, for instance). See also:removeVisibilityChangeCallback(),isVisible().void SoQtComponent::removeVisibilityChangeCallback (SoQtComponentVisibilityCB *const func, void *const data = NULL)[protected]β remove one of the callbacks from the list of visibility notification callbacks. See also:addVisibilityChangeCallback(),isVisible().
π Author π
Generated automatically by Doxygen for SoQt from the source code.
And that's the whole page, bestie! This icon is from SoQt 1.6.2, dated Sat Jan 6 2024 12:20:55, and it's the SoQtComponent(3) page β periodt π β¨
π¦ where this page comes from
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms