FreeCAD C++
Public Slots | Public Member Functions | Protected Member Functions | List of all members
Gui::MainWindow Class Reference

#include <Gui/MainWindow.h>

Detailed Description

The MainWindow class provides a main window with menu bar, toolbars, dockable windows, a status bar and mainly a workspace for the MDI windows.

Author
Werner Mayer

Public Slots

void setPaneText (int i, QString text)
 
void arrangeIcons ()
 
void tile ()
 
void cascade ()
 
void closeActiveWindow ()
 
void closeAllWindows ()
 
void activateNextWindow ()
 
void activatePreviousWindow ()
 
void activateWorkbench (const QString &)
 
void whatsThis ()
 

Public Member Functions

 MainWindow (QWidget *parent=0, Qt::WindowFlags f=Qt::Window)
 
 ~MainWindow ()
 
bool eventFilter (QObject *o, QEvent *e)
 
void addWindow (MDIView *view)
 
void removeWindow (MDIView *view)
 
QList< QWidget * > windows (QMdiArea::WindowOrder order=QMdiArea::CreationOrder) const
 
void tabChanged (MDIView *view)
 
MDIViewactiveWindow () const
 
void setActiveWindow (MDIView *view)
 
void appendRecentFile (const QString &filename)
 
QMenu * createPopupMenu ()
 
Layout Methods
void loadWindowSettings ()
 Loads the main window settings.
 
void saveWindowSettings ()
 Saves the main window settings.
 
MIME data handling
QMimeData * createMimeDataFromSelection () const
 
bool canInsertFromMimeData (const QMimeData *source) const
 
void insertFromMimeData (const QMimeData *source)
 
void loadUrls (App::Document *, const QList< QUrl > &)
 
void setUrlHandler (const QString &scheme, UrlHandler *handler)
 
void unsetUrlHandler (const QString &scheme)
 

Protected Member Functions

void closeEvent (QCloseEvent *e)
 
void dropEvent (QDropEvent *e)
 
void dragEnterEvent (QDragEnterEvent *e)
 
void changeEvent (QEvent *e)
 

Splasher and access methods

void startSplasher (void)
 
void stopSplasher (void)
 
QPixmap splashImage () const
 
void showDocumentation (const QString &help)
 
static MainWindowgetInstance ()
 

Constructor & Destructor Documentation

◆ MainWindow()

Gui::MainWindow::MainWindow ( QWidget *  parent = 0,
Qt::WindowFlags  f = Qt::Window 
)

Constructs an empty main window. For default parent is 0, as there usually is no toplevel window there.

◆ ~MainWindow()

Gui::MainWindow::~MainWindow ( )

Destroys the object and frees any allocated resources.

Member Function Documentation

◆ activateNextWindow

void Gui::MainWindow::activateNextWindow ( )
slot

Activates the next window in the child window chain.

◆ activatePreviousWindow

void Gui::MainWindow::activatePreviousWindow ( )
slot

Activates the previous window in the child window chain.

◆ activateWorkbench

void Gui::MainWindow::activateWorkbench ( const QString &  )
slot

Just emits the workbenchActivated() signal to notify all receivers.

◆ activeWindow()

MDIView* Gui::MainWindow::activeWindow ( ) const

Returns the active MDI window or 0 if there is none.

◆ addWindow()

void Gui::MainWindow::addWindow ( MDIView view)

Adds an MDI window view to the main window's workspace and adds a new tab to the tab bar.

◆ appendRecentFile()

void Gui::MainWindow::appendRecentFile ( const QString &  filename)

MRU: Appends file to the list of recent files.

◆ arrangeIcons

void Gui::MainWindow::arrangeIcons ( )
slot

Arranges all child windows in a horizontal tile pattern.

◆ canInsertFromMimeData()

bool Gui::MainWindow::canInsertFromMimeData ( const QMimeData *  source) const

Check if mime data contains object data

◆ cascade

void Gui::MainWindow::cascade ( )
slot

Arranges all the child windows in a cascade pattern.

◆ changeEvent()

void Gui::MainWindow::changeEvent ( QEvent *  e)
protected

This method is called from the Qt framework automatically whenever a QTranslator object has been installed. This allows to translate all relevant user visible text.

◆ closeActiveWindow

void Gui::MainWindow::closeActiveWindow ( )
slot

Closes the child window that is currently active.

◆ closeAllWindows

void Gui::MainWindow::closeAllWindows ( )
slot

Closes all child windows. The windows are closed in random order. The operation stops if a window does not accept the close event.

◆ closeEvent()

void Gui::MainWindow::closeEvent ( QCloseEvent *  e)
protected

This method checks if the main window can be closed by checking all open documents and views.

◆ createMimeDataFromSelection()

QMimeData* Gui::MainWindow::createMimeDataFromSelection ( ) const

Create mime data from selected objects

◆ createPopupMenu()

QMenu* Gui::MainWindow::createPopupMenu ( )

Returns true that the context menu contains the 'Customize...' menu item.

◆ dragEnterEvent()

void Gui::MainWindow::dragEnterEvent ( QDragEnterEvent *  e)
protected

Checks if a mime source object can be interpreted.

◆ dropEvent()

void Gui::MainWindow::dropEvent ( QDropEvent *  e)
protected

Try to interpret dropped elements.

◆ eventFilter()

bool Gui::MainWindow::eventFilter ( QObject *  o,
QEvent *  e 
)

Filters events if this object has been installed as an event filter for the watched object.

◆ getInstance()

static MainWindow* Gui::MainWindow::getInstance ( )
static

Gets the one and only instance.

◆ insertFromMimeData()

void Gui::MainWindow::insertFromMimeData ( const QMimeData *  source)

Insert the objects into the active document. If no document exists one gets created.

◆ loadUrls()

void Gui::MainWindow::loadUrls ( App::Document ,
const QList< QUrl > &   
)

Load files from the given URLs into the given document. If the document is 0 one gets created automatically if needed.

If a url handler is registered that supports its scheme it will be delegated to this handler. This mechanism allows to change the default behaviour.

◆ removeWindow()

void Gui::MainWindow::removeWindow ( MDIView view)

Removes an MDI window from the main window's workspace and its associated tab without deleting the widget. If the main windows does not have such a window nothing happens.

◆ setActiveWindow()

void Gui::MainWindow::setActiveWindow ( MDIView view)

Sets the active window to view.

◆ setPaneText

void Gui::MainWindow::setPaneText ( int  i,
QString  text 
)
slot

Sets text to the pane in the status bar.

◆ setUrlHandler()

void Gui::MainWindow::setUrlHandler ( const QString &  scheme,
UrlHandler *  handler 
)

Sets the handler for the given scheme. If setUrlHandler() is used to set a new handler for a scheme which already has a handler, the existing handler is simply replaced with the new one. Since MainWindow does not take ownership of handlers, no objects are deleted when a handler is replaced.

◆ showDocumentation()

void Gui::MainWindow::showDocumentation ( const QString &  help)

Shows the online documentation.

◆ startSplasher()

void Gui::MainWindow::startSplasher ( void  )

Starts the splasher at startup.

◆ stopSplasher()

void Gui::MainWindow::stopSplasher ( void  )

Stops the splasher after startup.

◆ tabChanged()

void Gui::MainWindow::tabChanged ( MDIView view)

Can be called after the caption of an MDIView has changed to update the tab's caption.

◆ tile

void Gui::MainWindow::tile ( )
slot

Arranges all child windows in a tile pattern.

◆ unsetUrlHandler()

void Gui::MainWindow::unsetUrlHandler ( const QString &  scheme)

Removes a previously set URL handler for the specified scheme.

◆ whatsThis

void Gui::MainWindow::whatsThis ( )
slot

Starts the what's this mode.

◆ windows()

QList<QWidget*> Gui::MainWindow::windows ( QMdiArea::WindowOrder  order = QMdiArea::CreationOrder) const

Returns a list of all MDI windows in the worpspace.