Results 1 to 10 of 10

Thread: QML Desktop Components weird Menu ...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QML Desktop Components weird Menu ...

    Which platform are you using?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Dec 2011
    Posts
    21
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QML Desktop Components weird Menu ...

    Linux X11, qt 4.8.4

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QML Desktop Components weird Menu ...

    Set the "visible" property of the window object to "true".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Dec 2011
    Posts
    21
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QML Desktop Components weird Menu ...

    Qt Code:
    1. Window {
    2. width: 600
    3. height: 400
    4. visible: true
    5.  
    6. MenuBar{
    7. Menu {
    8. text: "File"
    9.  
    10. MenuItem {
    11. text:"file"
    12. }
    13. }
    14. }
    15.  
    16. Window{
    17. id: window1
    18. width: 600
    19. height: 400
    20. MenuBar{
    To copy to clipboard, switch view to plain text mode 

    Then child window appears immediately, but still menu appears in the middle of nowhere.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QML Desktop Components weird Menu ...

    This code works just fine:

    javascript Code:
    1. import QtQuick 1.1
    2. import QtDesktop 0.1
    3.  
    4. Window {
    5. width: 600
    6. height: 400
    7. visible: true
    8.  
    9. MenuBar{
    10. Menu {
    11. text: "It does"
    12.  
    13. MenuItem {
    14. text:"not appear!!"
    15. }
    16. }
    17. }
    18. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Dec 2011
    Posts
    21
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QML Desktop Components weird Menu ...

    But then two windows appears.

    Maybe it's something wrong with my c++ launcher.
    Qt Code:
    1. #include <QApplication>
    2. #include "qmlapplicationviewer.h"
    3.  
    4. Q_DECL_EXPORT int main(int argc, char *argv[])
    5. {
    6. QScopedPointer<QApplication> app(createApplication(argc, argv));
    7.  
    8. QmlApplicationViewer viewer;
    9. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    10. viewer.setMainQmlFile(QLatin1String("test.qml"));
    11. viewer.showExpanded();
    12.  
    13. return app->exec();
    14. }
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QML Desktop Components weird Menu ...

    One window is your viewer, another is the window created by "Window". If you don't want the viewer then use QDeclarativeEngine or don't show the viewer.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. The following user says thank you to wysota for this useful post:

    travick (23rd January 2013)

Similar Threads

  1. Using QML Components for the Desktop with PySide
    By hansotronic in forum Qt Quick
    Replies: 2
    Last Post: 30th October 2012, 00:49
  2. Replies: 3
    Last Post: 13th July 2012, 09:39
  3. QtCreator and Desktop Components
    By Splashy in forum Qt Quick
    Replies: 6
    Last Post: 24th March 2012, 00:43
  4. Replies: 2
    Last Post: 16th March 2012, 14:22
  5. Replies: 0
    Last Post: 26th February 2012, 16:48

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.