Help with QTextEdit.
-
Well, actually, an old version is shown earlier in this thread, but here's an updated version:
@#include "projectisthisabadgame.h"
#include "splitter.h"
#include<QSplitter>
#include<QTextEdit>
#include<QHBoxLayout>ProjectIsThisaBadGame::ProjectIsThisaBadGame(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
}ProjectIsThisaBadGame::~ProjectIsThisaBadGame()
{}
splitter::splitter(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
QHBoxLayout *layout=new QHBoxLayout(this);
QTextEdit editor1 = new QTextEdit("Hello World",this);QSplitter splitter(Qt::Vertical);
splitter.addWidget(editor1);
layout->addWidget(editor1);
setStyleSheet(" { background-color:rgb(0,0,0);color:rgb(255,255,255); padding: 7px}}");setLayout(layout);
showMaximized();
}splitter::~splitter()
{
}void splitter::showHide()
{
}CONFIG += help@
EDIT: Um, the forum messed up the formatting a bit I think, but, whatever...
-
Line 39!!!!
@CONFIG += help@
got to be removed from this file and add it into your .pro file, try to recompile then.
-
But the reason I added it there is because it seems Visual Studio doesn't support pro files...
-
I think that you got to generate it with qmake.exe and add it in your links, i'll search more infos for later, stand by mate
-
You can use the "Visual Studio Add-in":http://qt.nokia.com/downloads/visual-studio-add-in to manage the mapping between .pro files and Visual Studio project files. The manual is "here":http://doc.qt.nokia.com/vs-add-in-1.1.7/index.html.
-
OK, here is the deal:
You have to generate a .pro file with 'Qt command prompt' (look into qt root folder)
Start Qt Command prompt and enter following commands:-> cd c:\Folder\of\your\project\ (directory that contains Visual studio's project file)
-> qmake -project
-> qmakeafter these commands look into your project folder, you'll see some auto generated files and folders, and .pro file will be there, just edit it however you want.
If you want to compile just continue with the following command:
-> make -
Thanks, but after doing qmake, this happened:
-
A couple of warnings - nothing to worry about. What happens after running nmake?
-
Is your project compiled?
By the way, use preferably directories without spaces for your projects, very important!
Ex.: c:\Dev\Qt_Projects\This_is_a_very_bad_game
Never use spaces, compilator might show you some errors. -
[quote author="Azr79" date="1303931305"]Is your project compiled?
By the way, use preferably directories without spaces for your projects, very important!
Ex.: c:\Dev\Qt_Projects\This_is_a_very_bad_game
Never use spaces, compilator might show you some errors.[/quote]Well, it's never compiled succesfully since everything in ths thread's happened... (Not to be rude.)
-
why not using QtCreator? There is no problems with it, because already configured for qt projects....
-
[quote author="Azr79" date="1303944734"]why not using QtCreator? There is no problems with it, because already configured for qt projects....[/quote]
The problem is it doesn't seem to be friendly with what I'm trying to do. -
Do you have your old vcproj file stored somewhere?
If you want to add a lib in MSVS, use the MSVS way, even for Qt libs:open project settinbs, go to linker --> input page and add the file
-
Open the Visual Studio command shell and run:
@
cd c:\path\to\your\project
qmake -project
@Then install the Visual Studio add in (link mentioned earlier) and restart VS, if you did not before.
Then open Visual Studio.
Then open menu Qt / Qt Options and check if your Qt version is listed there. If not, add it!
Now create a new solution, open Menu Qt / Open qt project file (.pro) and select the newly created .pro from the first step.
Your setup is basically complete now.
OR
Create a new solution, add a new project and select one of the Qt4 project templates (Qt4 Application most likely) and just add your source, header and ui files.
In both cases, it might help if you start in a fresh new directory, where you copy in just the .h, .cpp, .ui files before calling qmake -project or creating the new Qt4 project.
-
Well, I made a pro, except it still got the same error after I added the CONFIG += help
However, I noticed that the pro was in place of the vcxproj, a.k.a. the Visual Studio Solution. Also, I noticed that the pro already contained CONFIG += [a bunch of stuff] help [another bunch of stuff] This seems to indicate that the CONFIG += help... was already there...
So, it doesn't seem to be the problem. Any more help? Thanks for all the help so far, BTW. (Not to be rude.)
Thnk you,
M260 -
If you just change the .pro and do nothing else, the VS project is not changed. What about the steps mentioned in my previous comment?
-
[quote author="Volker" date="1304027822"]If you just change the .pro and do nothing else, the VS project is not changed. What about the steps mentioned in my previous comment?[/quote]
Well, I've already done all that - unless you really think I should just start a new project & re-add everything... (Not to be rude.) -
I would try to start from scratch in a fresh, empty directory. Just copy the sources (h, cpp, ui). Make a directory without spaces in it to eliminate this problem. Then run qmake -project and import the .pro with the VS addin.
Be sure you have setup the Qt versions in the addin!
-
1st of all, sorry it's taken me months to reply? Anyways, Volker, can I just have the actual files from when you 1st successfully compiled it as described in your 1st posst? I know I won't be able to use Visual Studio.
-
Sorry, I did not keep the files for that long.