Solved QLabel snap to ScrollBar
-
@Mikeeeeee said in QLabel snap to ScrollBar:
How do I know the visible coordinates of an Image?
What do you mean?
What are "visible coordinates" and relative to what do you want to have them?
Do you mean you want to know which part of displayed image is visible? -
Yes. For example, I see the Central 50% of the image? How do I know I'm seeing an image from 25% to 75%?
-
Partially solve. But regardless of the scrollbar state, pageStep() returns a single value
qDebug()<<scrollArea->horizontalScrollBar()->value() <<scrollArea->horizontalScrollBar()->maximum() <<scrollArea->horizontalScrollBar()->minimum() <<scrollArea->horizontalScrollBar()->pageStep();
-
@Mikeeeeee said in QLabel snap to ScrollBar:
pageStep
But it is a single step value. how much to scroll for a page.
What do you need it for ? -
I wanted to know the width of the scroll and scrollbar and calculate the visible part.
-
Need to know the size of the scroll and its position and determine.
Scroll size = (widget size/picture size)/zoom -
How can I remove the menu bar? If I remove createActions(); from the constructor, the program does not start.
-
Hi
If i do
// createActions();
it starts fine.
Please provide more details. -
The compiler writes that the program closed abnormally. Debagger says he received a signal from the operating system: SIGSEGV , destination: Segmentation fault
-
If you want, I can send you the project
-
hi
I think its something else than createActions();
Use the debugger to find the line where it crashes. -
error in qaction.cpp
void QAction::setEnabled(bool b) { Q_D(QAction); if (b == d->enabled && b != d->forceDisabled) return; d->forceDisabled = !b; if (b && (!d->visible || (d->group && !d->group->isEnabled()))) return; QAPP_CHECK("setEnabled"); d->enabled = b; #ifndef QT_NO_SHORTCUT d->setShortcutEnabled(b, qApp->d_func()->shortcutMap); //here #endif d->sendDataChanged(); }
-
This post is deleted! -
I commented out all QAction and the program starts, but the picture at start is not loaded. But you need to change the zoom level to display the picture. Please tell me how to fix it.
-
hi
I think it would be better to call
createActions();
and simply domenuBar()->hide();
so its not shown.
That way you dont get issues with dangling pointers in the program.
-