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. Save and Restore QToolbar position

Save and Restore QToolbar position

Scheduled Pinned Locked Moved General and Desktop
22 Posts 3 Posters 18.3k 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #13

    It is cool how you change your posts in the past from the future...

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #14

      Certainly not as cool as being a lazy ungrateful jackass to people who waste their time to help you. Good luck, I am done with you!

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #15

        [quote author="ddriver" date="1331829830"]Certainly not as cool as being a lazy ungrateful jackass to people who waste their time to help you. Good luck, I am done with you![/quote]
        I hope you will not come back, dude.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #16

          ddriver: There is no need to call people names here. Just move on to another thread if somebody annoys you.

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #17

            [quote author="ddriver" date="1331819988"][quote author="ddriver" date="1331819488"]
            QToolBar inherits a QPoint returning member function called pos from QWidget that holds the position of the toolbar in its parent widget.[/quote]
            This property holds the position of the widget within its parent widget.
            You also have:
            @void move ( const QPoint & )@
            which, in case you cannot figure out, moves the widget to the QPoint location.
            [/quote]

            It just does not work with QToolBar, dude.
            Try it youself:

            [code]
            QPoint posa(m_toolBar1->pos());
            m_toolBar1->move(pos.x()+10, pos.y());
            [/code]

            The toolbar stays where it was.

            1 Reply Last reply
            0
            • ? This user is from outside of this forum
              ? This user is from outside of this forum
              Guest
              wrote on last edited by
              #18

              Both pos() and move() work for me perfectly well, when the toolbar is docked it returns and moves to coordinates, relative to the application window, when floating, it is relative to the active display, so the problem is all in your "TV", dude!

              @Tobias Hunger - it wasn't a name, but a definition, it is offensive only when it is degrading, if it is justified and objective - I don't think there is something wrong with calling things what they are :)

              1 Reply Last reply
              0
              • . Offline
                . Offline
                .ddriver
                wrote on last edited by
                #19

                O, really?

                [code]
                #include <QtGui>

                int main(int argc, char argv[])
                {
                QApplication a(argc, argv);
                QMainWindow wnd1;
                QMainWindow
                wnd(&wnd1);
                QToolBar* m_toolBar1 = new QToolBar(wnd);
                QAction* action1 = new QAction("test 1", m_toolBar1);
                action1->setText("1");
                m_toolBar1->addAction(action1);

                QToolBar* m_toolBar2 = new QToolBar(wnd);
                QAction* action2 = new QAction("test 2", m_toolBar2);
                m_toolBar2->addAction(action2);
                action2->setText("2");
                
                wnd->addToolBar(m_toolBar1);
                wnd->addToolBar(m_toolBar2);
                
                wnd->setCentralWidget(new QLabel("text"));
                
                wnd1.show();
                
                m_toolBar2->resize(200, 100);
                m_toolBar2->move(200, 200);
                
                return a.exec&#40;&#41;;
                

                }
                [/code]

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mgran
                  wrote on last edited by
                  #20

                  Hi folks, please keep this thread civil; http://qt-project.org/forums/rules

                  @.ddriver: You need to change your screen name to something else.

                  Project Manager - Qt Development Frameworks

                  1 Reply Last reply
                  0
                  • ? This user is from outside of this forum
                    ? This user is from outside of this forum
                    Guest
                    wrote on last edited by
                    #21

                    Is that why you deleted your profile? I assumed you were just ashamed and went for a fresh and better start, but seeing how you mock my username, which further solidifies my theory that you are indeed a jackass, I see I overestimated you. I suggest you delete that profile as well, because your behavior gives me a good reason to report you on personal basis, then make yourself a normal profile and start behaving like a grown man, not a spoiled brat.

                    And just to assure you the methods work perfectly fine, here is a few screenshots in an animated gif and some code:

                    !http://i39.tinypic.com/2119xmu.gif!

                    @void MainWindow::setPos()
                    {
                    ui->mainToolBar->move(ui->spinX->value(), ui->spinY->value());
                    }

                    void MainWindow::getPos()
                    {
                    ui->spinX->setValue(ui->mainToolBar->pos().x());
                    ui->spinY->setValue(ui->mainToolBar->pos().y());
                    }@

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mgran
                      wrote on last edited by
                      #22

                      .ddrivers screen name has been changed for stalking reasons.

                      And I'm closing this thread.

                      Project Manager - Qt Development Frameworks

                      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