본문 바로가기

전체 글

(35)
Qt deleteLater Qt Source에는 이렇게 되어었다. /*! Schedules this object for deletion. The object will be deleted when control returns to the event loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the event loop is started. Note that entering and leaving a new event loop (e..
QT add network option QMake 사용 시에는 단순히 아래와 같이 추가해주면 되지만 cmake로 build  시스템 선택한 경우에는  find package와 link library를 모두 추가해야한다.Building with qmakeQT += network Building with CMakefind_package(Qt6 REQUIRED COMPONENTS Network)target_link_libraries(mytarget PRIVATE Qt6::Network)
[Visual Studio Code] CMake tools Visual studio code cannot find kits 간혹 scan for kit을 해도 정상적으로 kit 목록이 업데이트 되지 않은 경우가 있다. 아래 파일을 열고 직접 수정하면 된다. [MacOS] /Users//.local/share/CMakeTools/cmake-tools-kits.json [Windows ] C:\Users\\AppData\Local\CMakeTools\cmake-tools-kits.json [Ubuntu] /home//.local/share/CMakeTools/cmake-tools-kits.json [ { "name": "Clang 14.0.0 x86_64-apple-darwin21.6.0", "compilers": { "C": "/usr/bin/clang", "CXX": "/usr/bin/clang++" }, "isTrusted..
숫자를 스트링으로 바꿀 때 컴마 붙이기 QLocale class는 locale에 따라 환율, 날짜, 시간 등의 숫자의 표기를 여러 행태로 변환해주는 기능을 가지고 있다. 임의로 원하는 국가의 코드를 사용하여 해당 locale로 데이터를 처리할 수고 기본적으로 App에서 설정된 locale은 QWidget::locale() 함수로 접근 가능하다. QLocale lc("en"); qDebug()
bluetooth keyboard dual boot on windows and ubuntu https://bustatech.com/bluetooth-keyboard-dual-boot-windows-ubuntu/ Bluetooth Keyboard on Dual Boot Windows and Ubuntu – Bust A TECH I’ve recently started to use Apple Wireless (bluetooth) keyboard and it is really a very great keyboard (more info here). I felt like I can type faster and more accurate using this keyboard. The only downside of this keyboard is the lack of dedicated Delet bustatech..
QML Plugin QmlType 생성 QML plugin 만들고 그 creator에서 참조하려면 다음과 같이 빌드 스텝에 추가해 준다. qml plugin 생성 후 설치과정이 포함되어야 qml plugin 으로써 제대로 동작될 수 있다. 해당 plugin을 사용하는 곳에서 QML2_IMPORT_PATH 혹은 실행되는 디렉토리에 import형식에 맞게 디렉토리가 구성되어 있으면 빌드는 가능하다. 하지만 Qt creator에서는 모듈을 찾을 수 없다는 메시지가 뜨거나 형식에 맞는 정보가 없다는 식으로 메시지가 뜬다. 이를 해결하려면 plugin 설치 시 qmltype 파일도 구성해 주어야 한다. 파일을 손으로 작성할 필요는 없다. 친절히 툴을 제공해 준다. "qmlplugindump" 이 유틸리티로 qmltypes를 생성할 수 있다. 아래 예제..
STL ifstream read text file STL 함수 이용 텍스트 파일 읽기 종종 쓰지만 생각이 잘 안나는 경우가 있어 기록해 놓는다. std::stringstream ss;std::ifstreamifs;ifs.open(strFilePath, std::ifstream::binary | std::ifstream::in);if (ifs.is_open()) { ss
Obtaining the title of another application It's very easy to get pointer of CWnd instance. Just use CWnd::FindWindow function. and we can find the title using GetWindowText member function This is an example code to get a title of VLC player. The class of VLC player is 'QWidget' CString str; CWnd* pWnd = CWnd::FindWindow(_T("QWidget"), 0); if (pWnd) { pWnd->GetWindowText(str); } if (str.Find(_T("VLC")) >= 0) { MessageBox(str); }