SamsonWang

SamsonWang

V2EX member #328596, joined on 2018-07-12 10:31:03 +08:00
Today's activity rank 16397
Per SamsonWang's settings, the topics list is only visible after you sign in
Deals info, including closed deals, is not hidden
SamsonWang's recent replies
Mar 26, 2025
Replied to a topic by Bssn Qt Qt5 托盘菜单右击时的异常
QMenu 的 parent 是主面板,所以会随着主面板显示出来
Mar 26, 2025
Replied to a topic by Bssn Qt Qt5 托盘菜单右击时的异常
`case QSystemTrayIcon::Context:`的时候啥都不用做,Qt 会自己把 context menu 显示出来
V 站 emacs 用户不多,见到一个真是不容易啊
```
#include <iostream>

class Person {
public:
Person(const char* name)
: m_name(name) {
std::cout << "Person constructor" << std::endl;
}
~Person() {
std::cout << "Person destructor" << std::endl;
}

const char* GetName() const {
return m_name;
}

private:
const char *m_name;
};

int main(int argc, char *argv[]) {

Person *pers = new Person[3]{"name1","name2","name3"};

for (int i = 0; i < 3; ++i) {
std::cout << pers[i].GetName() << std::endl;
}

delete[] pers;
pers = nullptr;

return 0;
}
```

gcc 4.8.5 编译命令

```
g++ -std=c++11 test.cpp
```
Jul 4, 2019
Replied to a topic by rj2 Python 请教 pyqt5 获取 exe 中的图标
fromWinHBITMAP 在 Qt5 换名字了,这个函数还是有的,放在 WinExtras 里了。
----------------------------------
https://doc.qt.io/qt-5/qtwinextras-iconextractor-main-cpp.html
官方文档里有例子,不过是 C++写的,可以参考下。
Jul 3, 2019
Replied to a topic by yuptyy 职场话题 offer 比较, 29 岁了, 该怎么打算
这个 2、3 点下班,是凌晨了么?感觉这样熬下去身体受不了啊。
试试手气
Jun 4, 2019
Replied to a topic by yongzhong 程序员 如果觉得自己选错了人生会怎么样
工作以后慢慢认识到大部分人都是普通人,曾经也有很多梦想,随着时间的推移也慢慢放下了,随遇而安吧。
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5650 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 08:22 · PVG 16:22 · LAX 01:22 · JFK 04:22
♥ Do have faith in what you're doing.