Save and Restore QToolbar position
-
It is cool how you change your posts in the past from the future...
-
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 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. -
ddriver: There is no need to call people names here. Just move on to another thread if somebody annoys you.
-
[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.
-
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 :)
-
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();
}
[/code] -
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());
}@