49,761 Topics

Member Avatar for
Member Avatar for iraj.jelo

i have a Qt code writed in C++ . i want translate it to python code, but i have a problem in 4 code line: all code is: void TableView::print(QPainter* painter, const QRect& area) { const int rows = model()->rowCount(); const int cols = model()->columnCount(); // calculate the total width/height …

Member Avatar for HiHe
0
2K
Member Avatar for Lucaci Andrew

Have some problems with the qt destructor. I'm working on QtCreator: here's the class: the .cpp #include "controller.h" Controller::Controller() { } Controller::Controller(MovieRepo *movrep, MovieValidator *movval){ this->movrep=movrep; this->movval=movval; } void Controller::addMov(int id, string title, string desc, string type)throw(ValidatorException){ Movie* mov=new Movie(id, title, desc, type); movval->validate(*mov); movrep->store(*mov); } const Movie* Controller::getById(int id){ …

Member Avatar for Lucaci Andrew
0
268
Member Avatar for NunsBeachSurfer

Hi, I'm working on some coding and ran into the problem that my multidimensional arrays are too large for my RAM. After reading a lot of articles, I figure that what I need to do is dynamically allocate the size of the array? The array that I need to do …

Member Avatar for NunsBeachSurfer
0
146
Member Avatar for triumphost

I'm trying to have my function return an OPENFILENAME struct. Problem: It returns it fine and everything except that I cannot print the filetitle :S At the moment, it prints the path of the file perfectly fine but when it comes to printing the file title via cout, it prints …

Member Avatar for Ancient Dragon
0
269
Member Avatar for twsmale

So I'm writing a program to mimic the "find" command in linux. I have everything taken care of, but I cannot figure out how to format the string from ctime, mtime and atime. I know the arguments are struct time_t, but I can't find to convert it to a formatable …

Member Avatar for Ancient Dragon
0
152
Member Avatar for Jsplinter

I'd like to represent an integer with a value between 0-100,000. Unsigned short int (range 0-65535) is too small. Unsigned int (range 0 - 4294967295) is big enough, but for a large data set this wastes a lot of space. Does there already exist a class that is in between? …

Member Avatar for Jsplinter
0
4K
Member Avatar for sternone

Hi, I found this forum with some google searches and I really enjoyed reading some Q&As here. I love C++, I love C++, did I told you yet I love C++ ? I hate C#, I really hate C# !!!!. did I told you yet I hate C# ? I'm …

Member Avatar for Onlineshade
0
362
Member Avatar for tomtetlaw

When I handle WM_MOUSEMOVE in my window prodedure, HIWORD(lParam) and LOWORD(lParam) are both a little off. It's returning a point that is slightly to the left and slightly above where my cursor actually is... What's really weird is that as I move the cursor closer to the top left of …

Member Avatar for tomtetlaw
0
554
Member Avatar for aznairjordan

i found out how to get each individual word from a text file. Now i am trying to limit each line to a certain number of characters. If the line limit is 10 and the word "string" starts at position 8, i need to make a newline and put "string" …

Member Avatar for Sky Diploma
0
210
Member Avatar for tyggagucci

hie guys could anyone help me on how i can read a delimited file as i view all customer details #include <fstream #include <iostream> #include <string> using namespace std; int main () { int choice [1]; string name; string idnumber; string address; string surname; string FileName; fstream myfile; string line; …

Member Avatar for deceptikon
0
229
Member Avatar for 330xi

How to hide and then to show again when I want to a standard menu toolbar in MFC doc view application?

0
92
Member Avatar for dimitrije17

Hello I would like to know how to make .bat files with a time trigger some thing like this: I make a file with autorun and it ahs a time trigger and after two monts it opens this file... can someone please help me resolve this problem..... thanks...

Member Avatar for dimitrije17
0
252
Member Avatar for Lord_Migit

Hi there. I am having some trouble trying to figure out how to delete a pointer that is held in a vector. int main() { vector<Test*> iVector1; vector<Test*> iVector2; vector<Test*>* pVec1(&iVector1); vector<Test*>* pVec2(&iVector2); pVec1->push_back(new Test(11)); pVec1->push_back(new Test(12)); pVec2->push_back(new Test(23)); pVec2->push_back(new Test(24)); //delete iVector1.at(0); delete iVector1[0]; iVector1.at(0) = new Test(21); pVec1->at(1) …

Member Avatar for Lord_Migit
0
256
Member Avatar for vincent5487

Write a program that prompts the user to input the start time and the stop time in hours and minutes (use 24 hour format), and then print out the time spent in work in hours and minutes. For example: Enter start time : 9 30 Enter finish time : 13 …

Member Avatar for subith86
0
202
Member Avatar for yavindu
Member Avatar for WaltP
0
80
Member Avatar for DonutsnCode

Hi guys, Your typical C++ beginner here. I'm using the renowned Deitel C++: How to program to learn C++. I am my own mentor and here's what I can't comprehend: What's a Dangling Reference? According to Deitel C++: How to Program and I quote "Functions can return references, but this …

Member Avatar for elmohler
0
931
Member Avatar for 9tontruck

Hi guys, I am having a small problem on using QNetworkAccessManager in QThread. The error message is: "Object::connect: No such slot QThread::replyFinished(QNetworkrReply\*)" And my code is header class SSLReceive : public QThread { //Q_OBJECT public slots: void replyFinished(QNetworkReply* net_reply); protected: void run(); private: void initialize(); QNetworkAccessManager* manager; QSslConfiguration config; }; …

0
177
Member Avatar for Dadkhah

it is my first time which I want to use ethernet card to read some date from PLC my application/software . does any body has an expereince? is it possible introduce a example or any reference for this isuue? thanks a lot in advance.

Member Avatar for skatamatic
0
175
Member Avatar for abdelhakeem

Hello Daniwebers! I was just reading This C++0x Beginner Tutorial: http://www.daniweb.com/software-development/cpp/tutorials/373787/beginning-c0x-making-a-raii-class And I was confused by something: " `int_vector(int_vector& aV);` > Obviously, this type of constructor would allow the transfer of the resource, since the source object can be modified and put into an empty-state (or "zombie-state"). But there are …

Member Avatar for abdelhakeem
0
210
Member Avatar for timberwolf94

I have been trying to write a program for the game of life and have been having some issues. The rules are: 1. Any live cell with fewer than two live neighbours dies, as if caused by under-population. 2. Any live cell with two or three live neighbours lives on …

Member Avatar for TrustyTony
0
341
Member Avatar for DubyStev

Hello great people, I have a challenge passing array into functions.. I will be very grateful for quick responses.. THANKS

Member Avatar for mike_2000_17
0
238
Member Avatar for rhoit

i don't know how it happen but the exe formed after compilation was 1.23 MB which has never happen before.

Member Avatar for rhoit
0
366
Member Avatar for lewashby

#include <Stdafx.h> #include <iostream> #include <math.h> #include <stdlib.h> #include <time.h> using namespace std; int rand_0toN1(int n); int main() { int n, i; int r; srand(time(NULL)); // set a seed for random-number generation. cout<< "Enter number of dice to roll: "; cin>> n; for(i = 1; i <= n; i++) { …

Member Avatar for ravenous
0
149
Member Avatar for poolet

Hello, Well I am trying to finished the following progam and I need help with 2 functions [i]reverse book(s)[/i] and [i]return book[/i]... If someone can told me points where to start I will appritieate:: below is my code, note that I don't know if the [i]customer_book_count[/i] is work since I …

Member Avatar for mike_2000_17
0
166
Member Avatar for hamzakhan

Hello, I'm new to this community and well to C++ itself. I'm trying to create a graphical calculator which displays the parabolic path of a projectile in the form of a graph plot, but the problem is that I don't even know how to plot points on C++.So can any …

Member Avatar for mike_2000_17
0
193
Member Avatar for altec64

Hi there this is my first post here :) So I got an assignment about TicTacToe project here's a basic header and main file of my project I think i should made a basic one before adding some "advanced" features please help with the logic of the command undo thank …

Member Avatar for mrnutty
0
1K
Member Avatar for BigEEter

Hi. I am wondering if a log file can be created in a header which is associated with a try-catch block. Below is my stripped down code for the log_header.h and log_test.cpp Here is log_header.h #include<fstream> #include<iostream> using namespace std; class thrower{ //fstream myfile2; public: void errormessage(); }; void thrower::errormessage(){ …

Member Avatar for BigEEter
0
392
Member Avatar for rezonk

#include <iostream> #include <iomanip> #include <fstream> const int NUM_SURVEY=3; using namespace std; struct Survey { int IdentificationNumber; double annualIncome; int numberOfHouseMember; }; void getData(); void calculateAverage(); void findPoverty(); void printReport(); int main() { getData(); calculateAverage(); findPoverty(); printReport(); system("pause"); return 0; } void getData() { Survey Households[NUM_SURVEY]; int i; cout<<"------------Enter " …

Member Avatar for abdelhakeem
0
216
Member Avatar for MasterHacker110

I am currently using code::blocks but i am experinsing trouble trying to link the ws2_32.lib and other libraries. I tried visual studio express but it doesnt work with me. What are some good FREE c++ compilers that have very easy library linking and are rather user-friendly and that i can …

Member Avatar for MasterHacker110
0
186
Member Avatar for hii...

In my project (Borland C++ Builder, Windows Xp ) am using following code for opening the file TOpenDialog *OpenDialog; OpenDialog->Filter = "all files (*.*)"; OpenDialog->InitialDir="::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"; OpenDialog->Execute(); But the "My computer" tab is empty its not showing the drives. Rest "My Rescent Documnets" , "Desktop", "My Documents", "My network drives" all …

Member Avatar for hii...
0
430

The End.