Fix compilation of some manual tests
- qtabletevent/device_information - dialogs - windowflags Change-Id: Id3e4b2aec2a873b00dcda39fb1227b24832181ca Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>bb10
parent
b0b4fcd05c
commit
18bd226564
|
|
@ -440,7 +440,7 @@ void FileDialogPanel::restoreDefaults()
|
|||
m_confirmOverWrite->setChecked(!d.testOption(QFileDialog::DontConfirmOverwrite));
|
||||
m_nameFilterDetailsVisible->setChecked(!d.testOption(QFileDialog::HideNameFilterDetails));
|
||||
m_resolveSymLinks->setChecked(!d.testOption(QFileDialog::DontResolveSymlinks));
|
||||
m_readOnly->setChecked(d.isReadOnly());
|
||||
m_readOnly->setChecked(d.testOption(QFileDialog::ReadOnly));
|
||||
m_native->setChecked(true);
|
||||
m_customDirIcons->setChecked(d.testOption(QFileDialog::DontUseCustomDirectoryIcons));
|
||||
m_directory->setText(QDir::homePath());
|
||||
|
|
|
|||
|
|
@ -157,17 +157,19 @@ QTextStream &operator<<(QTextStream &s, const QRectF &rect)
|
|||
|
||||
QTextStream &operator<<(QTextStream &s, const QPrinter &printer)
|
||||
{
|
||||
s << '"' << printer.printerName() << "\"\nPaper #" <<printer.paperSize()
|
||||
<< " \"" << printer.paperName() << '"'
|
||||
<< (printer.orientation() == QPrinter::Portrait ? ", Portrait" : ", Landscape");
|
||||
const auto pageLayout = printer.pageLayout();
|
||||
const auto pageSize = pageLayout.pageSize();
|
||||
s << '"' << printer.printerName() << "\"\nPaper #" << pageSize.id()
|
||||
<< " \"" << pageSize.name() << '"'
|
||||
<< (pageLayout.orientation() == QPageLayout::Portrait ? ", Portrait" : ", Landscape");
|
||||
if (printer.fullPage())
|
||||
s << ", full page";
|
||||
s << "\nPaper size: "
|
||||
<< printer.paperSize(QPrinter::Point) << "pt "
|
||||
<< printer.paperSize(QPrinter::Millimeter) << "mm "
|
||||
<< "\n " << printer.paperSize(QPrinter::DevicePixel) << "device pt "
|
||||
<< printer.paperSize(QPrinter::Inch) << "inch "
|
||||
<< "\nPagedPaintDevSize: " << printer.pageSizeMM() << "mm"
|
||||
<< pageSize.sizePoints() << "pt "
|
||||
<< pageSize.size(QPageSize::Millimeter) << "mm "
|
||||
<< "\n " << pageSize.sizePixels(printer.resolution()) << " device pt "
|
||||
<< pageSize.size(QPageSize::Inch) << "inch "
|
||||
<< "\n " << pageSize.size(QPageSize::Millimeter) << "mm"
|
||||
<< "\nLogical resolution : " << printer.logicalDpiX() << ',' << printer.logicalDpiY() << "DPI"
|
||||
<< "\nPhysical resolution: " << printer.physicalDpiX() << ',' << printer.physicalDpiY() << "DPI"
|
||||
<< "\nPaperRect: " << printer.paperRect(QPrinter::Point) << "pt "
|
||||
|
|
@ -236,7 +238,7 @@ static bool print(QPrinter *printer, QString *errorMessage)
|
|||
return false;
|
||||
}
|
||||
|
||||
const QRectF pageF = printer->pageRect();
|
||||
const QRectF pageF = printer->pageRect(QPrinter::DevicePixel);
|
||||
|
||||
QFont font = painter.font();
|
||||
font.setFamily("Courier");
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ WizardStyleControl::WizardStyleControl(QWidget *parent)
|
|||
, m_group(new QButtonGroup(this))
|
||||
{
|
||||
m_group->setExclusive(true);
|
||||
connect(m_group, SIGNAL(buttonClicked(int)), this, SIGNAL(wizardStyleChanged(int)));
|
||||
connect(m_group, &QButtonGroup::idClicked, this, &WizardStyleControl::wizardStyleChanged);
|
||||
QVBoxLayout *vLayout = new QVBoxLayout(this);
|
||||
QRadioButton *radioButton = new QRadioButton(tr("None/OS Default"), this);
|
||||
m_group->addButton(radioButton, QWizard::NStyles);
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public:
|
|||
pos.rx() += buttonSize.width() + spacing;
|
||||
ButtonItem *qi = new ButtonItem("Quit", QRect(pos, buttonSize),
|
||||
QColor(Qt::red).lighter(), this);
|
||||
qi->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||
qi->setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
connect(qi, &ButtonItem::clicked, qApp, &QCoreApplication::quit);
|
||||
addItem(qi);
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ EmbeddingWindow::EmbeddingWindow(QWindow *window) : m_window(window)
|
|||
fileMenu->addSeparator();
|
||||
action = fileMenu->addAction("Quit", qApp, &QCoreApplication::quit);
|
||||
toolbar->addAction(action);
|
||||
action->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||
action->setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
}
|
||||
|
||||
void EmbeddingWindow::releaseForeignWindow()
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
|
||||
QMenu *fileMenu = menuBar()->addMenu("File");
|
||||
QAction *quitAction = fileMenu->addAction("Quit");
|
||||
quitAction->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||
quitAction->setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
|
||||
|
||||
QToolBar *fileToolBar = addToolBar("File");
|
||||
|
|
|
|||
|
|
@ -171,15 +171,15 @@ ScreenWatcherMainWindow::ScreenWatcherMainWindow(QScreen *screen)
|
|||
|
||||
QMenu *fileMenu = menuBar()->addMenu(QLatin1String("&File"));
|
||||
QAction *a = fileMenu->addAction(QLatin1String("Close"));
|
||||
a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W));
|
||||
a->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_W));
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(close()));
|
||||
a = fileMenu->addAction(QLatin1String("Quit"));
|
||||
a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
|
||||
a->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));
|
||||
connect(a, SIGNAL(triggered()), qApp, SLOT(quit()));
|
||||
|
||||
QMenu *toolsMenu = menuBar()->addMenu(QLatin1String("&Tools"));
|
||||
a = toolsMenu->addAction(QLatin1String("Mouse Monitor"));
|
||||
a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
|
||||
a->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_M));
|
||||
connect(a, &QAction::triggered, this, &ScreenWatcherMainWindow::startMouseMonitor);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,6 @@ void TabletWidget::paintEvent(QPaintEvent *)
|
|||
eventInfo << QString("Pointer type: %1").arg(pointerTypeToString(mDev->pointerType()));
|
||||
eventInfo << QString("Capabilities: %1").arg(pointerCapabilitiesToString(mDev->capabilities()));
|
||||
eventInfo << QString("Unique Id: %1").arg(QString::number(mDev->uniqueId().numericId(), 16));
|
||||
eventInfo << QString("System Id: %1").arg(mDev->id());
|
||||
}
|
||||
eventInfo << QString("Button: %1 (0x%2)").arg(buttonToString(mButton)).arg(mButton, 0, 16);
|
||||
eventInfo << QString("Buttons currently pressed: %1 (0x%2)").arg(buttonsToString(mButtons)).arg(mButtons, 0, 16);
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ int main(int argc, char *argv[])
|
|||
QObject::connect(widget, &EventReportWidget::stats,
|
||||
mainWindow.statusBar(), &QStatusBar::showMessage);
|
||||
QAction *quitAction = fileMenu->addAction("Quit", qApp, &QCoreApplication::quit);
|
||||
quitAction->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||
quitAction->setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
mainWindow.setCentralWidget(widget);
|
||||
mainWindow.show();
|
||||
return app.exec();
|
||||
|
|
|
|||
|
|
@ -538,15 +538,15 @@ MainWindow::MainWindow()
|
|||
addToolBar(Qt::TopToolBarArea, toolBar);
|
||||
QMenu *fileMenu = menuBar()->addMenu("File");
|
||||
QAction *newWindowAction = fileMenu->addAction(QStringLiteral("New Window"), this, &MainWindow::newWindow);
|
||||
newWindowAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));
|
||||
newWindowAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_N));
|
||||
toolBar->addAction(newWindowAction);
|
||||
fileMenu->addSeparator();
|
||||
QAction *dumpDeviceAction = fileMenu->addAction(QStringLiteral("Dump devices"));
|
||||
dumpDeviceAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D));
|
||||
dumpDeviceAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_D));
|
||||
connect(dumpDeviceAction, &QAction::triggered, this, &MainWindow::dumpTouchDevices);
|
||||
toolBar->addAction(dumpDeviceAction);
|
||||
QAction *clearLogAction = fileMenu->addAction(QStringLiteral("Clear Log"));
|
||||
clearLogAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
|
||||
clearLogAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_L));
|
||||
connect(clearLogAction, &QAction::triggered, m_logTextEdit, &QPlainTextEdit::clear);
|
||||
toolBar->addAction(clearLogAction);
|
||||
QAction *toggleDrawPointAction = fileMenu->addAction(QStringLiteral("Draw Points"));
|
||||
|
|
@ -555,11 +555,11 @@ MainWindow::MainWindow()
|
|||
connect(toggleDrawPointAction, &QAction::toggled, m_touchWidget, &TouchTestWidget::setDrawPoints);
|
||||
toolBar->addAction(toggleDrawPointAction);
|
||||
QAction *clearPointAction = fileMenu->addAction(QStringLiteral("Clear Points"));
|
||||
clearPointAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P));
|
||||
clearPointAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_P));
|
||||
connect(clearPointAction, &QAction::triggered, m_touchWidget, &TouchTestWidget::clearPoints);
|
||||
toolBar->addAction(clearPointAction);
|
||||
QAction *quitAction = fileMenu->addAction(QStringLiteral("Quit"));
|
||||
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
|
||||
quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));
|
||||
connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
|
||||
toolBar->addAction(quitAction);
|
||||
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ MainWindow::MainWindow()
|
|||
{
|
||||
QMenu *fileMenu = menuBar()->addMenu("&File");
|
||||
QAction *a = fileMenu->addAction("Quit", this, &QWidget::close);
|
||||
a->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||
a->setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
|
||||
QWidget *central = new QWidget;
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(central);
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ ControllerWindow::ControllerWindow()
|
|||
bottomLayout->addWidget(clearLogButton);
|
||||
QPushButton *quitButton = new QPushButton(tr("&Quit"));
|
||||
connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
|
||||
quitButton->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||
quitButton->setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
bottomLayout->addWidget(quitButton);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ WindowStateControl::WindowStateControl(QWidget *parent)
|
|||
layout->addWidget(maximizeButton);
|
||||
group->addButton(fullscreenButton, Qt::WindowFullScreen);
|
||||
layout->addWidget(fullscreenButton);
|
||||
connect(group, SIGNAL(buttonReleased(int)), this, SIGNAL(stateChanged(int)));
|
||||
connect(group, &QButtonGroup::idReleased, this, &WindowStateControl::stateChanged);
|
||||
}
|
||||
|
||||
Qt::WindowStates WindowStateControl::state() const
|
||||
|
|
@ -301,7 +301,7 @@ TypeControl::TypeControl(QWidget *parent)
|
|||
layout->addWidget(toolTipRadioButton, 2, 1);
|
||||
group->addButton(splashScreenRadioButton, Qt::SplashScreen);
|
||||
layout->addWidget(splashScreenRadioButton, 3, 1);
|
||||
connect(group, SIGNAL(buttonReleased(int)), this, SLOT(slotChanged()));
|
||||
connect(group, &QButtonGroup::idReleased, this, &TypeControl::slotChanged);
|
||||
}
|
||||
|
||||
Qt::WindowFlags TypeControl::type() const
|
||||
|
|
|
|||
Loading…
Reference in New Issue