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. QMessageBox
Qt 6.11 is out! See what's new in the release blog

QMessageBox

Scheduled Pinned Locked Moved General and Desktop
10 Posts 2 Posters 5.1k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hey!
    How would I launch QMessageBox? I want it set up so that when I click a button, it pops up.
    I have the following code, but it doesn't seem to launch it.
    @void MainWindow::on_toolButton_clicked()
    {
    QMessageBox msgBox;
    msgBox.setText("messagebox");
    msgBox.exec();
    }@

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      oops wait a sec. I restarted Qt and its working. weird.

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        For small tasks I usually use the static methods:

        • "about":http://qt-project.org/doc/qt-5.0/qtwidgets/qmessagebox.html#about
        • "information":http://qt-project.org/doc/qt-5.0/qtwidgets/qmessagebox.html#information
        • warning... etc.

        (Z(:^

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Im trying to make a window that contains icons of various web apps. Kind of an app drawer builtin to the browser. Ive been trying to use messagebox for this. Is this possible?

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            It is possible indeed, but I would not think that QMessageBox is a good candidate for this. Plain QWidget, graphicsview or QML would fit better.

            (Z(:^

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Ok, how would I do a Plain QWidget?

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                I would recommend grabbing a book on Qt t get the idea. Explaining everything here will be tedious.

                I don't know exactly what and how you want to achieve. For the description given above, I would go for this:

                Create a new QWidget-based UI (in Qt Creator that is "Create new designer class" IIRC)

                Add QLabels containing your web app icons and text

                Lay out the labels on the widget in a grid layout

                Done :)

                (Z(:^

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  I guess I haven't explained my goal really. Essentially, I am trying to make a standalone application that serves as an 'app drawer' for web apps. While online in a browser, you can choose to 'download' apps from a web app repository website. After 'downloading' them, the icon of the apps appear in my application and can be clicked to launch. My app serves as a way to launch the apps quickly and without mucking around in a browser. Its a bit like the 'app drawer' in Chrome OS.

                  1 Reply Last reply
                  0
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #9

                    The scenario from my last post will still work in that case. The real problem here, of course, will be integrating this with browsers.

                    (Z(:^

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #10

                      Would it be possible to put a webview in a messagebox and than code the rest on the web?

                      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