mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-06 09:15:23 +08:00
6.6.1 original
This commit is contained in:
@ -2,8 +2,12 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
#include "dialog.h"
|
||||
#include <QFileDialog>
|
||||
|
||||
#include <QBuffer>
|
||||
#include <QFileDialog>
|
||||
#include <QNativeIpcKey>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
/*!
|
||||
\class Dialog
|
||||
@ -29,8 +33,9 @@
|
||||
each button.
|
||||
*/
|
||||
//! [0]
|
||||
|
||||
Dialog::Dialog(QWidget *parent)
|
||||
: QDialog(parent), sharedMemory("QSharedMemoryExample")
|
||||
: QDialog(parent), sharedMemory(QNativeIpcKey(u"QSharedMemoryExample"_s))
|
||||
{
|
||||
ui.setupUi(this);
|
||||
connect(ui.loadFromFileButton, &QPushButton::clicked,
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <QDialog>
|
||||
#include <QSharedMemory>
|
||||
|
||||
#include "ui_dialog.h"
|
||||
|
||||
//! [0]
|
||||
@ -13,21 +14,21 @@ class Dialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
public:
|
||||
Dialog(QWidget *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
public slots:
|
||||
void loadFromFile();
|
||||
void loadFromMemory();
|
||||
|
||||
private:
|
||||
private:
|
||||
void detach();
|
||||
|
||||
private:
|
||||
private:
|
||||
Ui::Dialog ui;
|
||||
QSharedMemory sharedMemory;
|
||||
};
|
||||
//! [0]
|
||||
|
||||
#endif
|
||||
#endif // DIALOG_H
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
#include <QApplication>
|
||||
#include "dialog.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
//! [0]
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
Reference in New Issue
Block a user