Skip to content

Korean

A forum for those speaking Korean

50 Topics 84 Posts
QtWS25 Last Chance
  • qthread 쓰레드 통신문제

    Unsolved 3 Jan 2024, 07:57
    0 Votes
    2 Posts
    356 Views
    QVector를 QThread 간 통신에서 signal과 slot을 통해 전달할 수 있습니다. QVector<int> 같은 기본적인 타입의 QVector는 Qt의 QueuedConnection에서 자동으로 복사되어 전달됩니다. 1. QVector를 signal과 slot을 통해 전달하는 예제 아래 예제에서는 두 개의 QThread가 있고, 하나의 스레드에서 QVector<int> 데이터를 생성하여 다른 스레드로 전달하는 방식입니다. // 데이터를 생성하는 스레드 class Producer : public QThread { Q_OBJECT signals: void dataProduced(QVector<int> data); protected: void run() override { QVector<int> data = {1, 2, 3, 4, 5}; emit dataProduced(data); // QVector 전달 msleep(1000); } }; // 데이터를 처리하는 스레드 class Consumer : public QThread { Q_OBJECT public slots: void processData(QVector<int> data) { qDebug() << "Received QVector<int>:" << data; } }; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); Producer producer; Consumer consumer; QObject::connect(&producer, &Producer::dataProduced, &consumer, &Consumer::processData, Qt::QueuedConnection); consumer.start(); producer.start(); producer.wait(); consumer.quit(); consumer.wait(); return a.exec(); } 2. 요약 QVector<int> 같은 기본 타입을 담은 QVector는 Qt의 QueuedConnection에서 자동으로 복사 전달됩니다. 만약 QVector<MyClass>처럼 사용자 정의 클래스가 포함된 경우, Q_DECLARE_METATYPE(MyClass) 및 qRegisterMetaType<QVector<MyClass>>()을 호출해야 합니다. 대량의 데이터를 처리할 경우, 복사 비용을 줄이기 위해 const QVector<int>& 같은 참조를 사용하면 좋습니다. 이렇게 하면 QVector를 QThread 간 안전하게 전달할 수 있습니다.
  • 0 Votes
    2 Posts
    340 Views
    Qt 6에서는 QFtp 클래스가 제거되었기 때문에 FTP 기능을 사용하려면 QNetworkAccessManager를 이용하여 구현해야 합니다. 하지만 Qt는 기본적으로 FTP 지원을 제공하지 않으므로, FTP 전용 라이브러리를 사용하는 것이 더 적절합니다. 1. Qt6 + QNetworkAccessManager를 이용한 FTP 다운로드 FTP는 HTTP와 다르게 인증이 필요할 수 있으며, Qt의 QNetworkAccessManager를 사용하여 FTP에서 파일을 가져올 수 있습니다. 하지만 FTP 지원이 기본적으로 활성화되지 않았을 수도 있으므로, 이를 확인해야 합니다. 2. Qt6에서 FTP를 사용하려면 외부 라이브러리 활용 Qt6에서 FTP를 제대로 사용하려면 libcurl 또는 QtFtp 같은 외부 라이브러리를 활용하는 것이 더 효과적입니다. QNetworkAccessManager를 사용하여 FTP 파일을 다운로드할 수 있지만, Qt6에서는 기본적으로 FTP 지원이 없습니다. libcurl을 활용하면 더 쉽게 FTP 파일을 다운로드하고 업로드할 수 있습니다. QtFtp 같은 외부 라이브러리를 사용하는 것도 고려해볼 만합니다. 어떤 방식이든, 최신 환경에서는 SFTP(SSH 기반 FTP)를 사용하는 것이 더 안전하므로, 가능하면 libssh 같은 라이브러리를 활용하는 것이 좋습니다.
  • 0 Votes
    2 Posts
    109 Views
    Squish는 현재 커뮤니티 에디션을 제공하지 않으며, 공식적으로 10일간의 무료 평가판만 제공하는 것으로 알고 있습니다. 평가판 사용 후에는 정식 라이선스를 구매해야 계속 사용할 수 있습니다. 만약 무료로 사용할 수 있는 GUI 테스트 자동화 도구를 찾고 계시다면, 다음과 같은 오픈 소스 대안을 고려해보실 수 있습니다: Selenium : 웹 애플리케이션의 GUI 테스트 자동화를 위한 도구로, 다양한 언어와 플랫폼을 지원합니다. PyAutoGUI : Python으로 GUI 테스트를 자동화할 수 있는 간단한 도구로, 마우스와 키보드 조작을 스크립트로 작성할 수 있습니다. AutoIt : Windows 환경에서 GUI 테스트 자동화를 지원하는 스크립트 언어로, 간단한 스크립트로 복잡한 GUI 작업을 자동화할 수 있습니다.
  • QT Creator 6.5.3 QPDF 사용법 문의

    Moved Unsolved 20 Mar 2024, 05:36
    0 Votes
    4 Posts
    613 Views
    Qt 6.5.3에서 Qt PDF 모듈을 사용하려면 몇 가지 확인해야 할 사항이 있습니다. 아래 단계에 따라 문제를 해결해보세요. 1. Qt PDF 모듈 설치 확인 Qt PDF 모듈이 제대로 설치되었는지 확인하세요. 확인 방법: Qt Maintenance Tool 실행 (C:\Qt\MaintenanceTool.exe) 패키지 추가 또는 제거 선택 Qt 6.5.3 -> Additional Libraries에서 Qt PDF 모듈이 설치되었는지 확인 설치되지 않았다면 체크 후 설치하세요. 2. MinGW용 Qt PDF 지원 여부 확인 Qt PDF는 MSVC 컴파일러에서는 제공되지만, MinGW용 Qt 빌드에서는 지원되지 않을 가능성이 높습니다. 즉, MinGW 11.2.0 환경에서는 Qt PDF를 사용할 수 없을 수 있습니다. 해결 방법: MSVC 2019 또는 MSVC 2022 환경에서 Qt 6.5.3을 설치한 후 다시 빌드해보세요. 만약 MinGW 환경을 유지하고 싶다면, Qt PDF 소스를 직접 빌드해야 합니다. 3. qmake 및 CMake에서 PDF 모듈 추가 방법 qmake 환경에서 .pro 파일에 아래 내용을 추가하세요. QT += pdf 그리고 나서 아래 명령어를 실행하여 프로젝트를 다시 설정합니다. qmake -r mingw32-make clean mingw32-make CMake를 사용하는 경우 CMakeLists.txt에서 다음을 추가해야 합니다. find_package(Qt6 COMPONENTS Pdf REQUIRED) target_link_libraries(MyApp PRIVATE Qt6::Pdf) 4. PDF 모듈 직접 빌드 (MinGW 사용 시) MinGW 환경에서 Qt PDF를 사용하려면 소스를 직접 빌드해야 합니다. 빌드 방법: Qt PDF 소스를 다운로드:git clone https://code.qt.io/qt/qtpdf.git cd qtpdf CMake를 사용하여 빌드:mkdir build cd build cmake .. -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:/Qt/6.5.3/mingw_64 mingw32-make mingw32-make install 프로젝트에서 QT += pdf 추가 후 다시 빌드 5. 최종 점검 Qt PDF가 MinGW에서는 공식 지원되지 않음을 염두에 두세요. 가능하면 MSVC 2019/2022로 변경하여 사용하세요. MinGW에서 사용하려면 직접 빌드해야 합니다.
  • This topic is deleted!

    Unsolved 6 Jan 2025, 09:23
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • 0 Votes
    1 Posts
    227 Views
    No one has replied
  • item could not be created 문제

    Unsolved 26 Nov 2023, 17:46
    0 Votes
    2 Posts
    488 Views
    @mkdir Qt Creator 12.0에서 생긴 버그 같습니다. 12.0.1로 업그레이드해도 여전히 이 문제가 해결된 것 같지는 않습니다.
  • ChartView Data Append

    Unsolved 14 Dec 2023, 00:37
    0 Votes
    1 Posts
    252 Views
    No one has replied
  • ShellExecute 사용 관련 문의

    Moved Unsolved 17 Nov 2023, 02:09
    0 Votes
    5 Posts
    1k Views
    @hlowd said in ShellExecute 사용 관련 문의: 코드로 scp 명령을 수행해야 하는데 해결 방법이 있을까요? ps) qprocess로 실행 시 scp 명령이 유효하지 않는 것 같습니다. I need to run the scp command with the code, is there any workaround? P.S. The scp command doesn't seem to be valid when executed with qprocess. (translated with DeepL) If you want to start a QProcess and run scp do something like this: QProcess process; // Path to your scp, wherever it is... // e.g. C:/Windows/System32/OpenSSH/scp.exe QString command = "C:/Program Files/Git/usr/bin/scp.exe"; // you need full path to scp.exe here // or register in PATH variable on your system so that Windows knows the "scp" command and where the program is located QStringList params; params.append("‪/C/Path/to/File"); params.append("‪user@host:/C/Destination/Path/"); process.start(command, params, QIODevice::ReadWrite);
  • This topic is deleted!

    Unsolved 19 Oct 2023, 01:42
    0 Votes
    1 Posts
    56 Views
    No one has replied
  • This topic is deleted!

    Unsolved 15 Oct 2023, 09:28
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • This topic is deleted!

    Unsolved 15 Oct 2023, 08:58
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • This topic is deleted!

    Unsolved 15 Oct 2023, 08:45
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • This topic is deleted!

    Unsolved 15 Oct 2023, 08:29
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • This topic is deleted!

    Unsolved 15 Oct 2023, 08:16
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • This topic is deleted!

    Unsolved 15 Oct 2023, 07:50
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • This topic is deleted!

    Unsolved 15 Oct 2023, 06:14
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • double 소수점 계산 관련 문의

    Unsolved 13 Oct 2023, 05:29
    0 Votes
    4 Posts
    1k Views
    @hlowd said in double 소수점 계산 관련 문의: 더해지는 값을 double 형 변수에 저장하는 것은 어려울까요? Sure, you can convert the results to floating point numbers at any stage - eg inside the loop, or a the very end. For example: #include <iomanip> #include <iostream> int main() { uint64_t a = 25; uint64_t sum = 0; for(int i = 0; i < 100000; i++) { sum += a; const double sumAsFloat = sum/100000.0; std::cout << (sum/100000) << '.' << std::setfill('0') << std::setw(5) << (sum%100000) << std::setprecision(10) << " \t[" << sumAsFloat << ']' << std::endl; } } Outputs: 0.00025 [0.00025] 0.00050 [0.0005] 0.00075 [0.00075] 0.00100 [0.001] 0.00125 [0.00125] 24.99900 [24.999] 24.99925 [24.99925] 24.99950 [24.9995] 24.99975 [24.99975] 25.00000 [25] Cheers. PS: In printing both the uint64_t and double versions side-by-side, I realised there's was a small error in my previous reply, where the (sum%10000) should have had another 0, ie (sum%100000). I fixed that in the code in this reply :)
  • This topic is deleted!

    Unsolved 17 Sept 2023, 07:02
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • This topic is deleted!

    Unsolved 17 Sept 2023, 06:46
    0 Votes
    1 Posts
    3 Views
    No one has replied