Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6247327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:51:00+00:00 2026-05-24T12:51:00+00:00

I want to do some changes on screen rotation , the code of the

  • 0

I want to do some changes on screen rotation , the code of the method that is supposed to handle such event is taken from here

http://www.developer.nokia.com/Community/Wiki/CS001437_-_Listening_for_screen_orientation_changes_in_Qt

edit: I have a scroll area , and its getting of border on rotation how can i adjust its size?so it could fit the screen plz check the event handler below
this my whole code :

//FORM1.CPP
#include "form1.h"
#include "ui_form1.h"
#include "form.h"
#include "ui_form.h"
#include <QResizeEvent>



Form1::Form1(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form1)
{
    ui->setupUi(this);
}

Form1::~Form1()
{
    delete ui;
}

//the method that is supposed to handle such event
void Form1::resizeEvent (QResizeEvent* event)
{
    QWidget::resizeEvent(event);
    ui->textBrowser->setText("karim");
}

I got this error:

\Users\user\Desktop\karim\Qt\Project\form1.cpp:31: error: 'QMyWidget' has not been declared

Please note that I didn’t do anything else this is my whole code …
Can you please tell me whats wrong or what am not getting ?

Please be specific I would appreciate that …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:51:01+00:00Added an answer on May 24, 2026 at 12:51 pm

    I do not see any reference to your QMyWidget class other than the below line. May be I’m missing something. But if you have defined your QMyWidget class elsewhere, you atleast need to include the header.

    void QMyWidget::resizeEvent(QResizeEvent* event)
    {
        ui->labelk->setText("blabla");
    }
    

    May be you meant this instead of the above:

    void Form1::resizeEvent(QResizeEvent* event)
    {
        ui->labelk->setText("blabla");
    }
    

    Update to the comment: You can try doing this.

    void Form1::resizeEvent(QResizeEvent* event)
    {
        // call the base class for the default behavior
        QWidget::resizeEvent(event);
        // Add your custom changes here
        ui->labelk->setText("blabla");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add some text to a screen. Since this text changes color
I want to make some changes to the stock Mms Android application and install
If I'm not online, I sometimes want to package some changes to a commit,
Specifically, I want to create a backup of a list, then make some changes
I have a treeView with many nodes. I want that some nodes change their
I want to write some JavaScript that will change the onmousedown of a div
I want to change master page some label value from child page.
I have some data. I want to go through that data and change cells
I want to draw some items on screen, each item is in one of
We have a DLL that monitors changes in status and looks for events from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.