Results 1 to 13 of 13

Thread: QHBoxLayout and QMessageBox error

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    95
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    5

    Default Re: QHBoxLayout and QMessageBox error

    ashukla:
    I try what you say and get the same error.

    jpn:
    You are right. I think this is a qwidget, but if i change the QHBoxlayout to a Qwidget, all widget inside the qwidget position wherever the want, and don't put where i want. So I try with a QSplitter but I dont want to resize the objects inside (a QDockWidget and a QTabWidget, and this with a QTextBox and two buttons). With a qwidget or a qsplitter i can only see a big button that expand in all windows.......
    I dont know why.

    Sorry for my English.

    Thanks

  2. #2
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    8
    Thanked 14 Times in 14 Posts

    Default Re: QHBoxLayout and QMessageBox error

    ashukla:
    I try what you say and get the same error.
    Dear Zorro68!
    It's work fine for me. Can you restate your problem with code.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  3. #3
    Join Date
    Nov 2007
    Posts
    89
    Qt products
    Qt4
    Platforms
    Windows
    Thanked 21 Times in 18 Posts

    Default Re: QHBoxLayout and QMessageBox error

    Quote Originally Posted by zorro68 View Post
    You are right. I think this is a qwidget, but if i change the QHBoxlayout to a Qwidget, all widget inside the qwidget position wherever the want, and don't put where i want. So I try with a QSplitter but I dont want to resize the objects inside (a QDockWidget and a QTabWidget, and this with a QTextBox and two buttons). With a qwidget or a qsplitter i can only see a big button that expand in all windows.......
    I dont know why.
    You shouldn't add widgets to your widget directly. You should create a layout, add all widgets to layout, then set the layout to your widget.

  4. #4
    Join Date
    Jan 2007
    Posts
    95
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    5

    Default Re: QHBoxLayout and QMessageBox error

    bender86:
    I know, and i dont do this.

    ashukla:
    I send you a reduced example of my programm.


    Thanks
    Attached Files Attached Files

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

    Default Re: QHBoxLayout and QMessageBox error

    So where exactly is the problem?

  6. #6
    Join Date
    Jan 2007
    Posts
    95
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    5

    Default Re: QHBoxLayout and QMessageBox error

    If you compile and run the programm i have send, you notice that main windows shows a big BTNnew button only in the area where must shows all widgets (tabwidget, two buttons,....) and this layout dont resize with main windows.

    I use QT 4.3.1 for windows...(maybe is this the problem?)
    Attached Images Attached Images

  7. #7
    Join Date
    Jan 2007
    Posts
    95
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    5

    Default Re: QHBoxLayout and QMessageBox error

    Anybody knows who is my problem with my programm?

    Thanks

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

    Default Re: QHBoxLayout and QMessageBox error

    Actually I can't compile your program. qmake complains for lots of missing files (case sensivity thing mostly I guess).

    By looking at your code I see some problems. First of all you are placing a dock widget inside a layout, which does not make much sense as it should be managed by the main window and placed in proper places inside the window's layout and not yours. And second of all it would be *much* easier and simpler (to implement and debug) if you used Qt Designer to build your GUI. Currently I'm getting lost after some tenth or so widget is created. I suggest you switch to using Designer and the problem will probably solve itself.

  9. #9
    Join Date
    Jan 2007
    Posts
    95
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    5

    Default Re: QHBoxLayout and QMessageBox error

    First of all you are placing a dock widget inside a layout, which does not make much sense as it should be managed by the main window and placed in proper places inside the window's layout and not yours
    The reason of doing this is because I want this widget appear and disappear pushing a button, thats why i made the windowstextEditor class with functions setvisible and setenabled.

    And second of all it would be *much* easier and simpler (to implement and debug) if you used Qt Designer to build your GUI. Currently I'm getting lost after some tenth or so widget is created. I suggest you switch to using Designer and the problem will probably solve itself.
    I don't like to use QTDesigner. You loose the control of widget.... (my oppinion).

    Thaks.

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

    Default Re: QHBoxLayout and QMessageBox error

    Quote Originally Posted by zorro68 View Post
    The reason of doing this is because I want this widget appear and disappear pushing a button, thats why i made the windowstextEditor class with functions setvisible and setenabled.
    I don't see a reason for using a dock widget for that. You can do it with any widget.


    I don't like to use QTDesigner. You loose the control of widget.... (my oppinion).
    You don't loose anything as you can implement anything you want when making a widget for the form. And currently you have non-working code. I'd rather have less control over a widget (assuming that was the case, which is not) than total control over code that does not work.

    By looking at your code I don't see anything that can't be done with Designer.

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.