跳到內容
  • 143k 主題
    719k 貼文
    N
    Qt 6.9.2, Windows. I put a native widget (made native with winId()) into a QTabWidget, which is a child of some root QWidget. It works OK, but if I add more widgets, their geometry breaks. The next widgets have regions on the right and bottom sides that are rendered with random garbage. I have this problem on Qt 6.9.2, but the same code works fine on Qt 5.12.3. Here's a minimal reproduction: #include <QApplication> #include <QPushButton> #include <QTabWidget> #include <QStackedWidget> #include <QVBoxLayout> int main(int argc, char *argv[]) { QApplication a(argc, argv); auto button = new QPushButton("buton"); button->resize(200, 200); button->show(); auto window = new QWidget{}; auto main_layout = new QVBoxLayout(window); window->resize(500,500); window->show(); QObject::connect(button, &QPushButton::clicked, [&]() { auto widget = new QWidget(); widget->setStyleSheet("QWidget { background-color: #119911; }"); widget->winId(); // make it native auto tab_widget = new QTabWidget(window); // tab_widget->winId(); // fixes the problem tab_widget->addTab(widget, "mytab"); main_layout->addWidget(tab_widget); }); return QApplication::exec(); } [image: 5e7c55d8-87fb-4b40-85c8-2eb4950b1ff0.png] I fixed the problem by making QTabWidget native first. I could also use Qt::WA_DontCreateNativeAncestors, but I ran into other problems with scroll areas, so I can't use this attribute. It looks like it has something to do with the window frame. The size of the garbage area suspiciously matches the height of the window frame. If I use the Qt::FramelessWindowHint window flag for the widget, it fixes the problem in the code above. But it doesn’t help in my actual code, where the widget hierarchy is more complicated. I inspected the native windows of the widget and its parent with Spy++: the rectangles don't match, even though the widgets have the same geometry in GammaRay. So the native windows and Qt widgets got out of sync for some reason. [image: 00c7eed8-a185-4560-9254-1d14e220d1e8.png]
  • Jobs, project showcases, announcements - anything that isn't directly development
    4k 23k
    4k 主題
    23k 貼文
    FeRDNYCF
    @Pedro said in Forum Updated NodeBB v4.3 + New features: Profile View Now you get a profilecard snippet by hovering over a user's name/picture. * Only if logged in. (Which probably makes sense, but I just thought I'd point it out. ....After logging in to get the feature working.)
  • Everything related to designing and design tools

    129 391
    129 主題
    391 貼文
    J
    In QT Design Studio, Tab Buttons are mostly for navigation within the UI, but each tab doesn’t automatically hide other content. Usually, a StackView or Loader is needed to switch visible content depending on the active tab.
  • Everything related to the QA Tools

    81 219
    81 主題
    219 貼文
    H
    @IamSumit can you reproduce the issue and share the Support Information logs. Please refer to the following Knowledge Base Article regarding how to obtain the Support Information is https://qatools.knowledgebase.qt.io/misc/collecting-support-info/collecting-support-information-linux-mac-windows/
  • Everything related to learning Qt.

    389 2k
    389 主題
    2k 貼文
    L
    [image: 81cdd613-e1dc-4336-8d29-6b627547d990.png] Shouldn't the padding area be between the red Background and the blue Content item? Why does it here refer to the distance directly from the outside to the content area? Is this correct? Or is my understanding correct? Inset is the distance between a component and the outside, while padding is the distance between the Background and the Content item. I really don't understand this picture; it confuses me.
  • 2k 主題
    13k 貼文
    T
    In qnamespace.h, I add some key_code mappings : For example : enum Key { [...] KEY_CLEYVER_F1 = 0x01002122, // unused Qt keycode map for Cleyver XTremTab8 F1 Key KEY_CLEYVER_F2 = 0x01002121, // unused Qt keycode map for Cleyver XTremTab8 F2 Key [...] } And in androidjniinput, I add switches in static QKeyCombination mapAndroidKey(int key) { [...] switch (key) { case 0x00000122: // XTREMTAB f1 return Qt::KEY_CLEYVER_F1 ; [...] } I have four android keycodes : 0x121, 0x122 (for Cleyver) , 0x1a0 and 0x1a1 (for Crosscall).
  • 4k 主題
    18k 貼文
    GrecKoG
    Le [=] n'étant pas nécessaire ici vu qu'il n'y a rien à capturer dans la lambda. connect(obj1, &MyObject::mySignal , this, [](int arg1){ qDebug() << arg1; });
  • This is where all the posts related to the Qt web services go. Including severe sillyness.
    1k 10k
    1k 主題
    10k 貼文
    SGaistS
    Hi, I think you can use https://forum.qt.io/category/5/qt-io-webservices category for this type of question (moved there by the way). Are these in your "unread" section ? Are they marked as you following them ?