FreeCAD C++
|
#include <Gui/MainWindow.h>
The MainWindow class provides a main window with menu bar, toolbars, dockable windows, a status bar and mainly a workspace for the MDI windows.
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) |
MDIView * | activeWindow () 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 MainWindow * | getInstance () |
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.
Gui::MainWindow::~MainWindow | ( | ) |
Destroys the object and frees any allocated resources.
|
slot |
Activates the next window in the child window chain.
|
slot |
Activates the previous window in the child window chain.
|
slot |
Just emits the workbenchActivated() signal to notify all receivers.
MDIView* Gui::MainWindow::activeWindow | ( | ) | const |
Returns the active MDI window or 0 if there is none.
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.
void Gui::MainWindow::appendRecentFile | ( | const QString & | filename | ) |
MRU: Appends file to the list of recent files.
|
slot |
Arranges all child windows in a horizontal tile pattern.
bool Gui::MainWindow::canInsertFromMimeData | ( | const QMimeData * | source | ) | const |
Check if mime data contains object data
|
slot |
Arranges all the child windows in a cascade pattern.
|
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.
|
slot |
Closes the child window that is currently active.
|
slot |
Closes all child windows. The windows are closed in random order. The operation stops if a window does not accept the close event.
|
protected |
This method checks if the main window can be closed by checking all open documents and views.
QMimeData* Gui::MainWindow::createMimeDataFromSelection | ( | ) | const |
Create mime data from selected objects
QMenu* Gui::MainWindow::createPopupMenu | ( | ) |
Returns true that the context menu contains the 'Customize...' menu item.
|
protected |
Checks if a mime source object can be interpreted.
|
protected |
Try to interpret dropped elements.
bool Gui::MainWindow::eventFilter | ( | QObject * | o, |
QEvent * | e | ||
) |
Filters events if this object has been installed as an event filter for the watched object.
|
static |
Gets the one and only instance.
void Gui::MainWindow::insertFromMimeData | ( | const QMimeData * | source | ) |
Insert the objects into the active document. If no document exists one gets created.
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.
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.
void Gui::MainWindow::setActiveWindow | ( | MDIView * | view | ) |
Sets the active window to view.
|
slot |
Sets text to the pane in the status bar.
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.
void Gui::MainWindow::showDocumentation | ( | const QString & | help | ) |
Shows the online documentation.
void Gui::MainWindow::startSplasher | ( | void | ) |
Starts the splasher at startup.
void Gui::MainWindow::stopSplasher | ( | void | ) |
Stops the splasher after startup.
void Gui::MainWindow::tabChanged | ( | MDIView * | view | ) |
Can be called after the caption of an MDIView has changed to update the tab's caption.
|
slot |
Arranges all child windows in a tile pattern.
void Gui::MainWindow::unsetUrlHandler | ( | const QString & | scheme | ) |
Removes a previously set URL handler for the specified scheme.
|
slot |
Starts the what's this mode.
QList<QWidget*> Gui::MainWindow::windows | ( | QMdiArea::WindowOrder | order = QMdiArea::CreationOrder | ) | const |
Returns a list of all MDI windows in the worpspace.