[solved] resize the screen
I want to delete a table if the width is smaller than 500
if the user resizes the screen then
What do you mean by delete a table? Do you mean like hide the widget or remove it from the layout entirely?
To hide it you can just use:
To find when your window is resizing just override QWidget::resizeEvent(). That will let you find new sizes so when it goes below the "500" you are concerned with you can then hide the table or whatever you need to do.
Thank you so much!
@int width = this->width(); int height = this->height(); QString s_widht = QString::number(width); QString s_height = QString::number(height); ui->lineEdit_widht->setText(s_widht); ui->lineEdit_height->setText(s_height);@
I want whenever I resize the width and height appears
Well that code would work, just add it to your MyWidget::resizeEvent(...) function, like so:
class MyWidget : public QWidget
void resizeEvent(QResizeEvent *event);
void MyWidget::resizeEvent(QResizeEvent *event)
Thank you so much ambershark :)
Looks good, glad it worked. :) Make sure to add [solved] to the thread title.