...
 
Commits (3)
    https://gitcode.net/qq_21438461/qt/-/commit/a2e62a0ec81a2a668425652f1582e45c17762c60 Merge branch 'develop' into 'master' 2022-11-23T22:31:20+08:00 泡沫o0 442701102@qq.com Develop See merge request <a href="/qq_21438461/qt/-/merge_requests/1" data-original="qq_21438461/qt!1" data-link="false" data-link-reference="false" data-project="200905" data-merge-request="60481" data-project-path="qq_21438461/qt" data-iid="1" data-mr-title="Develop" data-reference-type="merge_request" data-container="body" data-placement="top" title="" class="gfm gfm-merge_request">!1</a> https://gitcode.net/qq_21438461/qt/-/commit/cf08edca0ba2ce7614b239099d6519a9249a763b fix code 2023-05-31T00:56:04+08:00 442701102 38686457+442701102@users.noreply.github.com https://gitcode.net/qq_21438461/qt/-/commit/f9f96029126b617f805d77f118ff9fae972fd910 Merge branch 'master' into 'develop' 2023-05-31T00:59:04+08:00 泡沫o0 442701102@qq.com Master See merge request <a href="/qq_21438461/qt/-/merge_requests/2" data-original="qq_21438461/qt!2" data-link="false" data-link-reference="false" data-project="200905" data-merge-request="69847" data-project-path="qq_21438461/qt" data-iid="2" data-mr-title="Master" data-reference-type="merge_request" data-container="body" data-placement="top" title="" class="gfm gfm-merge_request">!2</a>
......@@ -18,7 +18,7 @@ int Operation_Linux::ScreenOperation(bool commond)
}
int Operation_Linux::PoweroffOperation(int commond)
{
#if defined(Q_CC_GNU)
#ifdef __linux__
if(commond == 1)
{
return reboot(RB_HALT_SYSTEM);
......
......@@ -3,11 +3,12 @@
#include "./OperationManager/operationManager.h"
#include <iostream>
#if defined(Q_CC_GNU)
#ifdef __linux__
#include <unistd.h>
#include <linux/reboot.h>
#include <sys/reboot.h>
#endif
class Operation_Linux : public OpeartionMangaer
{
public:
......
......@@ -6,7 +6,7 @@ Operation_Windows::Operation_Windows()
}
int Operation_Windows::ScreenOperation(bool commond)
{
#if (defined(Q_CC_MSVC) || defined(Q_CC_MINGW))
#ifdef _WIN32
if(commond==true)
{
::PostMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM)2);
......@@ -23,7 +23,7 @@ int Operation_Windows::ScreenOperation(bool commond)
}
bool Operation_Windows::envinit()
{
#if (defined(Q_CC_MSVC) || defined(Q_CC_MINGW))
#ifdef _WIN32
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
......@@ -44,7 +44,7 @@ bool Operation_Windows::envinit()
}
int Operation_Windows::PoweroffOperation(int commond)
{
#if (defined(Q_CC_MSVC) || defined(Q_CC_MINGW))
#ifdef _WIN32
if(envinit() !=0) return -1;
/*****************************************************************/
if(commond == 1)
......
#ifndef OPERATION_WINDOWS_H
#define OPERATION_WINDOWS_H
#include "./OperationManager/operationManager.h"
#if (defined(Q_CC_MSVC) || defined(Q_CC_MINGW))
#ifdef _WIN32
#include "windows.h"
#endif
class Operation_Windows : public OpeartionMangaer
......
......@@ -10,7 +10,7 @@ CONFIG += c++11
INCLUDEPATH +=
DEPENDPATH +=
FORMS += mainwindow.ui
SOURCES += \
OperationManager/operation_linux.cpp \
OperationManager/operation_windows.cpp \
......@@ -25,8 +25,7 @@ HEADERS += \
mainwindow.h \
$$PWD/TimeManager/timethread.h \
OperationManager/operationManager.h \
FORMS += \
mainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
......
此差异已折叠。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 2.7.2, 2023-05-30T23:02:58. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">-1</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QByteArray" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QString" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QByteArray" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<value type="QString">{4020c493-a284-4b65-a0c1-7be44d471d45}</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">12</value>
</data>
</qtcreator>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#ifdef _WIN32
int d_system_type = WINDOWS;
#else
#include <unistd.h>
#include <linux/reboot.h>
#include <sys/reboot.h>
#if (defined(Q_CC_MSVC) || defined(Q_CC_MINGW))
int system_type = WINDOWS;
#elif defined(Q_CC_GNU)
int d_system_type = Linux;
#endif
//static QString widgetbackgroundSheet ="background-color: qconicalgradient(cx:0.5, cy:0, angle:0, stop:0 rgba(55, 55, 202, 100), stop:1 rgba(207, 179, 179, 255))";
......