Skip to content

Commit 9eb53b7

Browse files
committed
Fix deprecated Qt::operator+ warnings and QDESIGNER_WIDGET_EXPORT redefinition
- Replace deprecated Qt::CTRL + Qt::Key_X with Qt::CTRL | Qt::Key_X in examples - Add guard to prevent QDESIGNER_WIDGET_EXPORT macro redefinition in Qt6
1 parent b418a7c commit 9eb53b7

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

designer/QGCodeEditorPlugin.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
2626
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
2727
#include <QtUiPlugin/QDesignerExportWidget>
28-
#define QDESIGNER_WIDGET_EXPORT QGCODEEDITOR_EXPORT
28+
#if !defined(QDESIGNER_WIDGET_EXPORT)
29+
#define QDESIGNER_WIDGET_EXPORT QGCODEEDITOR_EXPORT
30+
#endif
2931
#elif QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
3032
#include <QtUiPlugin/QDesignerExportWidget>
3133
#else

examples/contextMenu/mainwindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ MainWindow::MainWindow(QWidget *parent) :
2828
ui->setupUi(this);
2929

3030
QList<QKeySequence> s; // exit app with ESC or CTRL+Q
31-
s << QKeySequence(Qt::Key_Escape) << QKeySequence(Qt::CTRL + Qt::Key_Q);
31+
s << QKeySequence(Qt::Key_Escape) << QKeySequence(Qt::CTRL | Qt::Key_Q);
3232
ui->action_Quit->setShortcuts(s);
3333

3434
connect(ui->gcode, SIGNAL(runFromSelected(int)), this, SLOT(onRunFromSelected(int)));
3535

3636
// add a non-menubar keyboard shortcut to QMainWindow
3737
QAction* a = new QAction(this);
3838
QList<QKeySequence> sr; // run from selected line with F1 or CTRL+R
39-
sr << QKeySequence(Qt::Key_F1) << QKeySequence(Qt::CTRL + Qt::Key_R);
39+
sr << QKeySequence(Qt::Key_F1) << QKeySequence(Qt::CTRL | Qt::Key_R);
4040
a->setShortcuts(sr);
4141
connect(a, SIGNAL(triggered()), ui->gcode, SLOT(onRunFrom()));
4242
this->addAction(a);

examples/contextMenu/mygcodeeditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ MyGCodeEditor::MyGCodeEditor(QWidget *parent) : QGCodeEditor(parent)
3333
actionRunFrom = new QAction(this);
3434
actionRunFrom->setObjectName(QString::fromUtf8("actionRunFrom"));
3535
actionRunFrom->setText(tr("Run"));
36-
actionRunFrom->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
36+
actionRunFrom->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_R));
3737
}
3838

3939
void MyGCodeEditor::contextMenuEvent(QContextMenuEvent *event)

examples/pipe/mainwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ MainWindow::MainWindow(QWidget *parent) :
3131
ui->setupUi(this);
3232

3333
QList<QKeySequence> s; // exit app with ESC or CTRL+Q
34-
s << QKeySequence(Qt::Key_Escape) << QKeySequence(Qt::CTRL + Qt::Key_Q);
34+
s << QKeySequence(Qt::Key_Escape) << QKeySequence(Qt::CTRL | Qt::Key_Q);
3535
ui->action_Quit->setShortcuts(s);
3636

3737
// disable line buffering on stdin

0 commit comments

Comments
 (0)