SoQtComponent(3)

πŸ“¦
version 1.6.2 Β· 3 versions
, in opensuse-leap 16.0

🌸 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 cap
  • SbBool setFullScreen (const SbBool onoff) β€” set fullscreen onoff πŸ”₯
  • 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 size
  • SbVec2s getSize (void) const β€” get the size
  • void setTitle (const char *const title) β€” set the title πŸ‘‘
  • const char * getTitle (void) const β€” get the title
  • void setIconTitle (const char *const title) β€” set the icon title πŸŽ€
  • const char * getIconTitle (void) const β€” get the icon title
  • const char * getWidgetName (void) const β€” get the widget name
  • const char * getClassName (void) const β€” get the class name
  • void setWindowCloseCallback (SoQtComponentCB *const func, void *const user=NULL) β€” set that window-close callback, with user=NULL as 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 class
  • static SoType getClassTypeId (void) β€” get the class type ID
  • static void setWidgetCursor (QWidget *w, const SoQtCursor &cursor) β€” set a widget cursor on w 🎯
  • static SoQtComponent * getComponent (QWidget *widget) β€” get the component for a widget
  • static void initClasses (void) β€” init the classes, plural, periodt πŸ’…

πŸ¦‹ Static Public Member Functions inherited from SoQtObject πŸ¦‹

  • static void initClass (void) β€” init the class
  • static SoType getClassTypeId (void) β€” get the class type ID
  • static 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 hook
  • void setClassName (const char *const name) β€” set the class name
  • void setBaseWidget (QWidget *widget) β€” set the base widget
  • void registerWidget (QWidget *widget) β€” register a widget
  • void unregisterWidget (QWidget *widget) β€” unregister a widget
  • virtual const char * getDefaultWidgetName (void) const β€” get the default widget name
  • virtual const char * getDefaultTitle (void) const β€” get the default title
  • virtual const char * getDefaultIconTitle (void) const β€” get the default icon title
  • virtual void sizeChanged (const SbVec2s &size) β€” size-changed hook
  • void addVisibilityChangeCallback (SoQtComponentVisibilityCB *const func, void *const user=NULL) β€” add a visibility-change callback, with user=NULL default πŸ‘€
  • void removeVisibilityChangeCallback (SoQtComponentVisibilityCB *const func, void *const user=NULL) β€” remove a visibility-change callback, same user=NULL default πŸ™ˆ

πŸ’– 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 from SoQtObject. This is used for runtime type checking and "downward" casting. Implements SoQtObject.

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. Returns FALSE if 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, returns FALSE. Note that a widget which is just obscured by other windows on the desktop is not hidden in this sense, and TRUE will be returned. See also: show(), hide().
  • SbBool SoQtComponent::isTopLevelShell (void ) const β€” returns TRUE if 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 β€” an SoQtComponent may 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. NULL will 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 the SoQt::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 the SoQtComponent corresponding to the given QWidget*, if any. If the widget does not seem to belong to any SoQtComponent, NULL will 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 call SoQt::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 this SoQt component. 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 the SoQtComponent::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 by SoQtComponent::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 in SoQtExaminerViewer, SoQtFlyViewer, SoQtPlaneViewer, and SoQtRenderArea.
  • 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 in SoQtExaminerViewer, SoQtFlyViewer, SoQtPlaneViewer, and SoQtRenderArea.
  • 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 in SoQtExaminerViewer, SoQtFlyViewer, SoQtPlaneViewer, and SoQtRenderArea.
  • void SoQtComponent::sizeChanged (const SbVec2s & size) [protected], [virtual] β€” called internally from within the SoQt library 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 in SoQtFullViewer, SoQtGLWidget, SoQtRenderArea, and SoQtViewer.
  • 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