日志
-
2022-05-09 21:32
-
参考KDAB新鲜出炉的测评:
阅读全文»分类:默认分类|回复:0|浏览:558
https://www.kdab.com/say-no-to-qt-style-sheets/
这个文章的评论也很精彩,有不少惊喜
-
2022-05-07 15:26
-
1.主要是mac平台的库依赖区别于windows
阅读全文»分类:默认分类|回复:0|浏览:455
故在编译库的时候,可以提前指定rpath
复制代码QMAKE_LFLAGS += -Wl,-rpath,@loader_path/../,-rpath,@executable_path/../,-rpath,@executable_path/../Frameworks
-
2022-04-13 15:23
-
复制代码mac平台:
阅读全文»分类:默认分类|回复:0|浏览:587
#include <AppKit/AppKit.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
NSView* view = (NSView*)w.effectiveWinId();
NSWindow* window = ;
window.titlebarAppearsTransparent = YES;
window.backgroundColor = ;
w.show();
return a.exec();
}windows平台临时办法:
https://github.com/envyen/qt-winDark
-
2022-04-11 16:55
-
简洁的使用
阅读全文»分类:默认分类|回复:1|浏览:491
复制代码QAction *button = ui->lineEdit->findChild<QAction *>("_q_qlineeditclearaction", Qt::FindDirectChildrenOnly);
if(button){
QCommonStyle style;
QIcon icon = style.standardIcon(QStyle::SP_ComputerIcon);
button->setIcon( icon );
}
或者
QList<QAction *> allPButtons = ui->lineEdit->findChildren<QAction *>();
foreach (QAction *var, allPButtons) {
if( !var->objectName().isEmpty()){
QCommonStyle style;
QIcon icon = styl ..
-
2021-09-13 16:43
-
大部分情况下Qt的x86应用程序可以运行于M1的 Rosetta之上,但是当我们基于Qt的应用程序依赖仅仅支持Arm64架构的库时就无法链接通过了.当前时间点为2021年8月份Qt尚未提供支持M1的免费发布版本,Qt 6.2有一个Preview版本支持M1,但普通用户有使用期限,且Preview版本并不是稳定版用上去有风险.
阅读全文»分类:默认分类|回复:0|浏览:736
具体参考:
https://www.cnblogs.com/wqcwood/p/15138983.html
-
2020-09-28 14:16
-
Disable Scene Interaction
阅读全文»分类:默认分类|回复:0|浏览:12346
Event handling is responsible by a good part of the CPU usage by the QGraphicsView engine. At each mouse movement the view asks the scene for the items under the mouse, which calls the QGraphicsItem::shape() method to detect intersections. It happens even with disabled items. So, if you don't need your scene to interact with mouse events, you can set QGraphicsView::setIntenteractive(false). In my case, I had two modes in my tool (measurement and move/rotate) where t ..
-
2020-03-27 19:21
-
复制代码macx|ios: {
阅读全文»分类:默认分类|回复:1|浏览:774
CONFIG += lib_bundle
# shared is default on OS X, static is default for iOS, since
# prior to iOS 8, only static libraries were permitted. So,
# we explicitly do shared
CONFIG += shared
FRAMEWORK_HEADERS.version = Versions
FRAMEWORK_HEADERS.files = $${HEADERS}
FRAMEWORK_HEADERS.path = Headers
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
}
-
2020-02-26 23:52
-
有时候我们会有这种需求,自己的桌面程序需要置顶,但是程序包含了很多窗口,可能我们要求窗口1,2都在其它桌面程序之上,但是窗口1必须随时在窗口2之上。
阅读全文»分类:默认分类|回复:0|浏览:860
Qt提供的置顶方式是在windowsflags上增加标签,setWindowFlags(Qt::WindowStaysOnTopHint);但是针对两个window窗口,当焦点切换的时候两个窗口会互相抢占置顶效果,达不到我们预期的效果。
这个问题之前也思考了很久有什么比较巧妙的方案来实现,最后确定一个不算很完美的方案(如果有看到的朋友有更好的方案欢迎分享):通过父子窗口的指定来完成。
就像窗口布局一个label一样 ..