Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. NSView in QWidget
QtWS25 Last Chance

NSView in QWidget

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 4.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Powerpaule
    wrote on last edited by
    #1

    Hi,
    I have an application which uses NSTextView. Since QT5 doesnt contain QMacCocoaViewContainer any more, i had to find an other way to set an NSView into a QWidget. This way works in most cases:

    @
    NSView* parentNSView = reinterpret_cast<NSView*>(parent->winId());
    [parentNSView addSubview:(NSView*)nsTextView];
    @

    The widget is being displayed correctly. But Qt debugs the message "QBackingStore::flush() called with non-exposed window, behavior is undefined", and there are some problems when the nstextview is part of a docking widget... so I think it is not the right solution. I also tried

    @
    create(WId((NSView*)nsTextView), false, true);
    @

    In the QWidget's constructor that contains the NSTextview, but then it is not visible.
    Any tips?
    Thanks a alot..

    1 Reply Last reply
    0
    • B Offline
      B Offline
      b1gsnak3
      wrote on last edited by
      #2

      You can wait for Qt 5.1 (when this bug will be fixed). And if you cannot then keep using 4.8.x

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved