22 #include <QDragEnterEvent> 23 #include <QDesktopServices> 35 QMainWindow(widget, flags),
36 display_toolbars_(nullptr),
37 first_activation_(true)
58 configure_action_ -> setStatusTip(
tr(
"Permet de régler différents paramètres de QElectroTech",
"status bar tip"));
66 qde->reloadOldElementPanel();
69 pv->updateAllTabsTitle();
81 about_qet_ -> setStatusTip(
tr(
"Affiche des informations sur QElectroTech",
"status bar tip"));
82 connect(
about_qet_, SIGNAL(triggered()), qet_app, SLOT(aboutQET()));
85 manual_online_ -> setStatusTip(
tr(
"Lance le navigateur par défaut vers le manuel en ligne de QElectroTech",
"status bar tip"));
88 QString link =
"https://download.tuxfamily.org/qet/manual_0.7/build/index.html";
89 QDesktopServices::openUrl(QUrl(link));
95 youtube_ -> setStatusTip(
tr(
"Lance le navigateur par défaut vers la chaine Youtube de QElectroTech",
"status bar tip"));
97 connect(
youtube_, &QAction::triggered, [](
bool) {
98 QString link =
"https://www.youtube.com/user/scorpio8101/videos";
99 QDesktopServices::openUrl(QUrl(link));
103 upgrade_ -> setStatusTip(
tr(
"Lance le navigateur par défaut vers le dépot Nightly en ligne de QElectroTech",
"status bar tip"));
106 upgrade_M -> setStatusTip(
tr(
"Lance le navigateur par défaut vers le dépot Nightly en ligne de QElectroTech",
"status bar tip"));
108 connect(
upgrade_, &QAction::triggered, [](
bool) {
109 QString link =
"https://qelectrotech.org/download_windows_QET.html";
110 QDesktopServices::openUrl(QUrl(link));
113 connect(
upgrade_M, &QAction::triggered, [](
bool) {
114 QString link =
"https://qelectrotech.org/download_mac_QET.html";
115 QDesktopServices::openUrl(QUrl(link));
119 donate_ -> setStatusTip(
tr(
"Soutenir le projet QElectroTech par un don",
"status bar tip"));
121 connect(
donate_, &QAction::triggered, [](
bool) {
122 QString link =
"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZZHC9D7C3MDPC";
123 QDesktopServices::openUrl(QUrl(link));
127 about_qt_ -> setStatusTip(
tr(
"Affiche des informations sur la bibliothèque Qt",
"status bar tip"));
128 connect(
about_qt_, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
176 QAction *menu_action = menuBar() ->
insertMenu(before_action, menu);
180 menu -> setTearOffEnabled(
true);
195 setWindowState(windowState() ^ Qt::WindowFullScreen);
203 if (windowState() & Qt::WindowFullScreen) {
206 fullscreen_action_ -> setStatusTip(
tr(
"Affiche QElectroTech en mode fenêtré",
"status bar tip"));
210 fullscreen_action_ -> setStatusTip(
tr(
"Affiche QElectroTech en mode plein écran",
"status bar tip"));
234 if (e -> type() == QEvent::WindowStateChange) {
240 return(QMainWindow::event(e));
256 if (e -> mimeData() -> hasUrls()) {
258 e -> acceptProposedAction();
269 if (e -> mimeData() -> hasUrls()) {
271 if (filepaths.count()) {
static QStringList handledFiles(const QList< QUrl > &)
virtual void firstActivation(QEvent *)
void dragEnterEvent(QDragEnterEvent *e) override
QAction * about_qt_
launch the "About Qt" dialog
QMenu * settings_menu_
Settings menu.
QMenu * display_toolbars_
Show/hide toolbars/docks.
bool event(QEvent *) override
QAction * configure_action_
Launch the QElectroTech configuration dialog.
QAction * about_qet_
Launch the "About QElectroTech" dialog.
QMenu * help_menu_
Help menu.
QAction * manual_online_
Launch browser on QElectroTech online manual.
void dropEvent(QDropEvent *e) override
QAction * upgrade_
Launch browser on QElectroTech Windows Nightly builds.
~QETMainWindow() override
QAction * youtube_
Launch browser on QElectroTech Youtube channel.
bool first_activation_
Used to detect whether the window is activated for the first time.
QAction * fullscreen_action_
Toggle full screen.
QAction * actionForMenu(QMenu *)
QAction * whatsthis_action_
Toggle "What's this" mode.
static QList< QETDiagramEditor * > diagramEditors()
void insertMenu(QMenu *, QMenu *, bool=true)
QAction * donate_
Launch browser to donate link.
QAction * upgrade_M
Launch browser on QElectroTech MAC_OS_X builds.
QETMainWindow(QWidget *=nullptr, Qt::WindowFlags=nullptr)
QHash< QMenu *, QAction * > menu_actions_
Store actions retrieved when inserting menus.
void updateFullScreenAction()
static QETApp * instance()