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

  • Home
  • SEARCH
  • 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 8582801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:23:06+00:00 2026-06-11T21:23:06+00:00

Im havin some problem with Qt in Visual Studio 2010. I have downloaded the

  • 0

Im havin some problem with Qt in Visual Studio 2010.
I have downloaded the qt binaries from this site, version Qt-4.7.3-dev-msvc2010-rdh.
This code copiles without any problem.

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget* parent);

protected:
     void paintEvent(QPaintEvent *e);
private:
};

When I add this line:

void keyPressEvent(QKeyEvent *e);

This error happens

1>------ Build started: Project: lol, Configuration: Release Win32 ------
1>Build started 25/09/2012 21:04:40.
1>InitializeBuildStatus:
1>  Creating "Release\lol.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>CustomBuild:
1>  Moc'ing lol.h...
1>ClCompile:
1>  All outputs are up-to-date.
1>  moc_lol.cpp
1>  lol.cpp
1>  main.cpp
1>  Generating Code...
1>lol.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall lol::mousePressEvent(class QMouseEvent *)" (?mousePressEvent@lol@@MAEXPAVQMouseEvent@@@Z)
1>C:\Users\VTM\Documents\Visual Studio 2010\Projects\TC\Win32\Release\\lol.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:04.68
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  • 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-06-11T21:23:09+00:00Added an answer on June 11, 2026 at 9:23 pm

    It seems that the linker is not able to find keyPressEvent implementation.
    Have you implemented keyPressEvent() in your Widget class? You will have to do that since your are declaring that in your class definition. Add the following code just to forward the event to baseclass.

    void Widget::keyPressEvent(QKeyEvent *e){ QWidget::keyPressEvent(e);}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a WCF service in Visual Studio 2010 along with some supporting
OS: Win7 IDE: Visual Studio 2010 Professional Boost Lib Version: 1.47 Downloaded boost_1_47_setup.exe installer
I am new to TFS integration with Visual Studio 2010, and I have a
I'm having some problems with Edit and Continue when using Visual Studio 2010 on
I have created a program in Visual Basic using Microsoft Visual Studio 2010 Professional.
I have an InstallShield project (InstallShield 2011 Limited Edition) for Visual Studio 2010. The
So I have a solution (in Visual Studio, 2010) with two projects: ProjectA and
I have a weird situation: Visual Studio 2010 will hang up indefinitely on me
I converted my visual studio solution from 2008 to 2010. A project has a
I've been having some serious issues with Visual Studio 2010 as of late. It's

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.